• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

CSCfi / metadata-submitter-frontend / 13917461632

18 Mar 2025 07:13AM UTC coverage: 47.423% (-1.1%) from 48.473%
13917461632

push

github

Hang Le
Add Dac and Policies form (merge commit)

Merge branch 'feature/dac-policy-form' into 'main'
* Add Dac and Policies form

Closes #863
See merge request https://gitlab.ci.csc.fi/sds-dev/sd-submit/metadata-submitter-frontend/-/merge_requests/1073

Reviewed-by: Liisa Lado-Villar <145-lilado@users.noreply.gitlab.ci.csc.fi>
Approved-by: Liisa Lado-Villar <145-lilado@users.noreply.gitlab.ci.csc.fi>
Merged by Hang Le <lhang@csc.fi>

652 of 953 branches covered (68.42%)

Branch coverage included in aggregate %.

238 of 670 new or added lines in 21 files covered. (35.52%)

2 existing lines in 2 files now uncovered.

6166 of 13424 relevant lines covered (45.93%)

3.75 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

89.83
/src/components/SubmissionWizard/WizardSteps/WizardAddObjectStep.tsx
1
import React from "react"
1✔
2

3
import CircularProgress from "@mui/material/CircularProgress"
1✔
4
import Grid from "@mui/material/Grid"
1✔
5
import { styled } from "@mui/system"
1✔
6

7
import WizardAddObjectCard from "../WizardComponents/WizardAddObjectCard"
1✔
8

9
import WizardDacPoliciesStep from "components/SubmissionWizard/WizardSteps/WizardDacPoliciesStep"
1✔
10
import { ObjectTypes } from "constants/wizardObject"
1✔
11
import { useAppSelector } from "hooks"
1✔
12
import type { FormRef } from "types"
13

14
const GridContainer = styled(Grid)({
1✔
15
  margin: 0,
1✔
16
  width: "100%",
1✔
17
  "& > :first-of-type": {
1✔
18
    paddingLeft: 0,
1✔
19
  },
1✔
20
  "& > :last-child": {
1✔
21
    paddingRight: 0,
1✔
22
  },
1✔
23
  "& .MuiGrid-item": {
1✔
24
    paddingTop: 0,
1✔
25
  },
1✔
26
})
1✔
27

28
const ObjectInfo = styled("div")({
1✔
29
  margin: 2,
1✔
30
})
1✔
31

32
/**
33
 * Show selection for object and submission types and correct form based on users choice.
34
 */
35
const WizardAddObjectStep = ({ formRef }: { formRef?: FormRef }) => {
1✔
36
  const objectType = useAppSelector(state => state.objectType)
3✔
37
  const loading = useAppSelector(state => state.loading)
3✔
38
  const openedXMLModal = useAppSelector(state => state.openedXMLModal)
3✔
39

40
  return (
3✔
41
    <>
3✔
42
      <GridContainer container spacing={2}>
3✔
43
        <Grid item xs={12}>
3✔
44
          {objectType === "" ? (
3✔
45
            <ObjectInfo>
1✔
46
              <p>Add objects by clicking the name, then fill form or upload XML File.</p>
1✔
47
              <p>You can also add objects and edit them after saving your draft.</p>
1✔
48
            </ObjectInfo>
1✔
49
          ) : objectType === ObjectTypes.dacPolicies ? (
2!
NEW
50
            <WizardDacPoliciesStep dacPoliciesFormRef={formRef} />
×
51
          ) : (
52
            <WizardAddObjectCard formRef={formRef} />
2✔
53
          )}
54
        </Grid>
3✔
55

56
        <Grid item xs>
3✔
57
          {!openedXMLModal && loading && (
3!
58
            <Grid container justifyContent="center">
×
59
              <CircularProgress />
×
60
            </Grid>
×
61
          )}
62
        </Grid>
3✔
63
      </GridContainer>
3✔
64
    </>
3✔
65
  )
66
}
3✔
67

68
export default WizardAddObjectStep
1✔
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc