Skip to content

Commit 7424550

Browse files
committed
fix(admin): improved isDirty props in certificationPageLogic form while certificationPartComplete is false
1 parent 5e527f9 commit 7424550

File tree

3 files changed

+6
-3
lines changed

3 files changed

+6
-3
lines changed

packages/reva-admin-react/cypress/e2e/candidacy/feasibility/dematerialized-feasibility-file/dematerialized-feasibility-file-certification.cy.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ describe("Dematerialized Feasibility File Certification Page", () => {
5858
cy.get('[data-test="form-buttons"]')
5959
.should("exist")
6060
.within(() => {
61-
cy.get("button").should("be.disabled");
61+
cy.get("button").should("not.be.disabled");
6262
});
6363

6464
cy.get('input[type="checkbox"]').should("be.checked");
@@ -84,7 +84,7 @@ describe("Dematerialized Feasibility File Certification Page", () => {
8484
cy.get('[data-test="form-buttons"]')
8585
.should("exist")
8686
.within(() => {
87-
cy.get("button").should("be.disabled");
87+
cy.get("button").should("not.be.disabled");
8888
});
8989
});
9090

packages/reva-admin-react/src/app/(aap)/candidacies/[candidacyId]/feasibility-aap/certification/certificationPageLogic.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ const getCandidacyById = graphql(`
2121
firstForeignLanguage
2222
secondForeignLanguage
2323
option
24+
certificationPartComplete
2425
blocsDeCompetences {
2526
certificationCompetenceBloc {
2627
id

packages/reva-admin-react/src/app/(aap)/candidacies/[candidacyId]/feasibility-aap/certification/page.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -259,7 +259,9 @@ const CertificationPage = () => {
259259
<FormButtons
260260
backUrl={`/candidacies/${candidacyId}/feasibility-aap`}
261261
formState={{
262-
isDirty: isDirty,
262+
isDirty:
263+
isDirty ||
264+
!dematerializedFeasibilityFile?.certificationPartComplete,
263265
canSubmit:
264266
completion == "PARTIAL" &&
265267
competenceBlocFields.every((bloc) => !bloc.checked)

0 commit comments

Comments
 (0)