Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add property to hide user types in ettersending #1220

Merged
merged 1 commit into from
Jun 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { TextField, Textarea } from '@navikt/ds-react';
import { Checkbox, TextField, Textarea } from '@navikt/ds-react';
import { InnsendingType, NavFormSettingsDiff, NavFormType } from '@navikt/skjemadigitalisering-shared-domain';
import LabelWithDiff from '../LabelWithDiff';
import SubmissionTypeSelect from '../SubmissionTypeSelect';
Expand All @@ -15,6 +15,7 @@ const SubmissionFields = ({ onChange, diff, form, errors }: SubmissionFieldsProp
const innsending = form.properties.innsending;
const ettersending = form.properties.ettersending;
const ettersendelsesfrist = form.properties.ettersendelsesfrist;
const hideUserTypes = form.properties.hideUserTypes;

return (
<>
Expand Down Expand Up @@ -87,6 +88,19 @@ const SubmissionFields = ({ onChange, diff, form, errors }: SubmissionFieldsProp
/>
</>
)}

<Checkbox
className="mb"
checked={hideUserTypes}
onChange={(event) =>
onChange({
...form,
properties: { ...form.properties, hideUserTypes: event.target.checked },
})
}
>
{'Skjul valg for hvem innsendingen gjelder i ettersendingsløsningen'}
</Checkbox>
</>
);
};
Expand Down
1 change: 1 addition & 0 deletions packages/fyllut-backend/src/routers/api/form.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ const mapLimitedForm = (form: NavFormType, translate: TranslateFunction) => {
enhetMaVelgesVedPapirInnsending: form.properties.enhetMaVelgesVedPapirInnsending,
uxSignalsId: form.properties.uxSignalsId,
uxSignalsInnsending: form.properties.uxSignalsInnsending,
hideUserTypes: form.properties.hideUserTypes,
},
attachments: getAttachments(form, translate),
};
Expand Down
1 change: 1 addition & 0 deletions packages/shared-domain/src/form/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ export interface FormPropertiesType {
prefill?: PrefillKey[];
uxSignalsId?: string;
uxSignalsInnsending?: InnsendingType;
hideUserTypes?: boolean;
}

export type FormPropertiesPublishing = Pick<
Expand Down