diff --git a/.github/actions/generic-ci-app/action.yml b/.github/actions/generic-ci-app/action.yml index c14cc0ce1..c8fede3f9 100644 --- a/.github/actions/generic-ci-app/action.yml +++ b/.github/actions/generic-ci-app/action.yml @@ -1,10 +1,10 @@ name: 'Build Application' runs: - using: "composite" + using: 'composite' steps: - uses: actions/setup-node@v4 with: - node-version: 22 + node-version: 23 cache: npm - name: 🏗️ Installing Dependencies shell: bash diff --git a/.github/actions/generic-ci-documentation/action.yml b/.github/actions/generic-ci-documentation/action.yml index 2814deb5d..cc54822ad 100644 --- a/.github/actions/generic-ci-documentation/action.yml +++ b/.github/actions/generic-ci-documentation/action.yml @@ -1,10 +1,10 @@ name: 'Build Documentation' runs: - using: "composite" + using: 'composite' steps: - uses: actions/setup-node@v4 with: - node-version: 22 + node-version: 23 - name: 🏗️ Generate Astro Documentation shell: bash run: ./scripts/documentation-build.sh diff --git a/src/packages/auth/open-id-connect-auth/utils.ts b/src/packages/auth/open-id-connect-auth/utils.ts index fc98ec23d..6c97c73f2 100644 --- a/src/packages/auth/open-id-connect-auth/utils.ts +++ b/src/packages/auth/open-id-connect-auth/utils.ts @@ -1,4 +1,6 @@ import * as R from '../../auth/roles'; +import { Collection } from '../../model/concepts/collection'; +import { Concept } from '../../model/concepts/concept'; export const isAdmin = (roles: string[]) => roles.includes(R.ADMIN); @@ -19,7 +21,7 @@ export const isConceptCreator = ( ) => roles.includes(R.CONCEPTS_CREATOR) && stamp === conceptCreator; export const filterConceptsToValidate = ( - concepts: any[], + concepts: Concept[], roles: string[], stamp: string, ) => @@ -29,12 +31,12 @@ export const filterConceptsToValidate = ( export const isCollectionCreator = ( roles: string[], - stamp: string, - collectionCreator: string, + stamp?: string, + collectionCreator?: string, ) => roles.includes(R.COLLECTIONS_CREATOR) && stamp === collectionCreator; export const filterCollectionsToValidate = ( - collections: any[], + collections: Collection[], roles: string[], stamp: string, ) => diff --git a/src/packages/modules-codelists/components/codelist-partial-detail/edit.jsx b/src/packages/modules-codelists/components/codelist-partial-detail/edit.jsx index 7ca1c35d5..f637bfd0e 100644 --- a/src/packages/modules-codelists/components/codelist-partial-detail/edit.jsx +++ b/src/packages/modules-codelists/components/codelist-partial-detail/edit.jsx @@ -45,6 +45,12 @@ export const DumbCodelistPartialDetailEdit = ({ useTitle(D.codelistsPartialTitle, codelist?.labelLg1); + const resetErrorsMessages = () => + setClientSideErrors({ + ...clientSideErrors, + errorMessage: [], + }); + const handleParentCode = useCallback( (code) => { CodeListApi.getCodesListCodes(code, 1, 0).then((codes) => { @@ -68,6 +74,7 @@ export const DumbCodelistPartialDetailEdit = ({ (parentCL) => parentCL.value === value, ).iriParent, }); + resetErrorsMessages(); handleParentCode(value); }, [codelist, handleParentCode, globalCodeListOptions], @@ -97,10 +104,7 @@ export const DumbCodelistPartialDetailEdit = ({ const handleChange = useCallback( (e) => { const { name, value } = e.target; - setClientSideErrors({ - ...clientSideErrors, - errorMessage: [], - }); + resetErrorsMessages(); setCodelist({ ...codelist, @@ -194,9 +198,7 @@ export const DumbCodelistPartialDetailEdit = ({ onChange={handleChange} disabled={updateMode} aria-invalid={!!clientSideErrors.fields?.id} - aria-describedby={ - clientSideErrors.fields?.id ? 'id-error' : null - } + aria-describedby={clientSideErrors.fields?.id ? 'id-error' : null} /> + setClientSideErrors({ + ...clientSideErrors, + errorMessage: [], + }); + const handleChange = useCallback( (e) => { const { name, value } = e.target; - setClientSideErrors({ - ...clientSideErrors, - errorMessage: [], - }); + resetErrorsMessages(); setComponent({ ...component, [name]: value, @@ -264,6 +267,8 @@ export const DumbComponentDetailEdit = ({ }, {}, ); + + resetErrorsMessages(); setComponent({ ...newComponentWithoutAttributes, type: option }); }; diff --git a/src/packages/utils/date-utils.spec.ts b/src/packages/utils/date-utils.spec.ts index 29f906936..dd43e937b 100755 --- a/src/packages/utils/date-utils.spec.ts +++ b/src/packages/utils/date-utils.spec.ts @@ -3,7 +3,9 @@ import { isDateIn, isOutOfDate, stringToDate } from './date-utils'; describe('is date in', () => { it('returns true if the start and end dates are null', () => { const toTest = '2017-06-25T10:51:47.812'; - expect(isDateIn(toTest, null as any, null as any)).toBe(true); + expect( + isDateIn(toTest, null as unknown as Date, null as unknown as Date), + ).toBe(true); }); it('returns true if the dates match', () => { @@ -23,7 +25,7 @@ describe('is date in', () => { describe('has date passed', () => { it('returns false if the end date is null', () => { - expect(isOutOfDate(null as any)).toBe(false); + expect(isOutOfDate(null as unknown as Date)).toBe(false); }); it('returns false if the date has not passed', () => {