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

Feature/refaktorering ettersending #1479

Open
wants to merge 6 commits into
base: master
Choose a base branch
from

Conversation

nurrebass1
Copy link
Contributor

No description provided.

@nurrebass1 nurrebass1 requested a review from a team as a code owner March 14, 2025 14:22
Copy link
Contributor

@magnurh-cx magnurh-cx left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lag gjerne versjonert tjeneste som fyllut-ettersending kan bruke (eller sørg for bakoverkompatibilitet på en annen måte)

@nurrebass1 nurrebass1 force-pushed the feature/refaktorering-ettersending branch 3 times, most recently from 9bde040 to 28665b8 Compare March 18, 2025 11:38
Copy link
Contributor

@magnurh-cx magnurh-cx left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Husk å opprette en trello-oppgave for å fjerne bakoverkompatibel kode når alle skjemaer er oppdatert med nytt format

@@ -341,7 +341,7 @@ describe('Migration scripts', () => {
...originalForm.properties,
skjemanummer: 'Form1',
submissionTypes: ['DIGITAL'],
ettersending: undefined,
subsequentSubmissionTypes: [],
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Default verdi er ['PAPER', 'DIGITAL']

Copy link
Contributor

@magnurh-cx magnurh-cx left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 🪴 🐐

@@ -11,15 +11,18 @@ const createHeaders = (accessToken?: string, revisionId?: number) => {
};
};

export const removeInnsendingFromForm = (form: Form): Form => {
const formProperties = (({ innsending, ...rest }) => rest)(form.properties);
export const removeInnsendingTypeFromForm = (form: Form): Form => {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Vurder å legge til kommentar her for å forklare at denne funksjonen er her for å støtte bakoverkompatibilitet og kan fjernes når alle skjemadefinisjoner er oppdatert.

@@ -3375,6 +3375,7 @@
"skjemanummer": "TST-123456",
"tema": "DAG",
"submissionTypes": ["PAPER", "DIGITAL"],
"subsequentSubmissionTypes": [],
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
"subsequentSubmissionTypes": [],
"subsequentSubmissionTypes": ["PAPER", "DIGITAL"],

@@ -3508,6 +3508,7 @@
"skjemanummer": "TST-123456",
"tema": "DAG",
"submissionTypes": ["PAPER", "DIGITAL"],
"subsequentSubmissionTypes": [],
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
"subsequentSubmissionTypes": [],
"subsequentSubmissionTypes": ["PAPER", "DIGITAL"],

@@ -50,8 +50,9 @@ const mapLimitedForm = (form: NavFormType, translate: TranslateFunction) => {
properties: {
skjemanummer: form.properties.skjemanummer,
tema: form.properties.tema,
innsending: form.properties.innsending,
submissionTypes: form.properties.submissionTypes,
ettersending: form.properties.ettersending,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Skal innsending ligge her?
innsending og ettersending bør fjernes når fyllut-ettersending er oppdatert

@@ -10,7 +10,7 @@ const mapForm = (form): FormsResponseForm => ({
properties: {
skjemanummer: form.skjemanummer ?? form.properties.skjemanummer,
submissionTypes: form.properties.submissionTypes,
ettersending: form.properties.ettersending,
subsequentSubmissionTypes: form.properties.subsequentSubmissionTypes,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bør denne ha ettersending i tillegg?

Copy link
Contributor

@magnurh-cx magnurh-cx left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🌮 🌮 🌮

Copy link
Contributor

@magnurh-cx magnurh-cx left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🌮 🌮 🌮

submissionTypes:
form.properties.submissionTypes ?? mapInnsendingTypeToSubmissionTypes(form.properties.innsending),
subsequentSubmissionTypes:
form.properties.subsequentSubmissionTypes ?? mapInnsendingTypeToSubmissionTypes(form.properties.ettersending),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Legg til en sjekk før vi kjører mapInnsendingTypeToSubmission. Hvis form.properties.ettersending er undefined, setter vi ['PAPER', 'DIGITAL'], ellers gjør vi mapping.

@nurrebass1 nurrebass1 force-pushed the feature/refaktorering-ettersending branch 3 times, most recently from da9e5d3 to 648dd28 Compare March 21, 2025 12:04
@nurrebass1 nurrebass1 force-pushed the feature/refaktorering-ettersending branch from 648dd28 to feb6b4e Compare March 21, 2025 12:05
@nurrebass1 nurrebass1 force-pushed the feature/refaktorering-ettersending branch from feb6b4e to 27af1d4 Compare March 21, 2025 12:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants