From de536ab5c1d95b2799b4508fef99d5df4d10cf4e Mon Sep 17 00:00:00 2001 From: danetsao Date: Thu, 21 Sep 2023 13:38:17 -0500 Subject: [PATCH 1/5] Update Node.js to v18 in GitHub Actions --- .github/workflows/build-npm-release.yml | 2 +- .github/workflows/build-npm.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build-npm-release.yml b/.github/workflows/build-npm-release.yml index 47510d51..75d20a0a 100644 --- a/.github/workflows/build-npm-release.yml +++ b/.github/workflows/build-npm-release.yml @@ -27,7 +27,7 @@ jobs: PUBLISH_MOD_DESCRIPTOR: 'true' FOLIO_NPM_REGISTRY: 'https://repository.folio.org/repository/npm-folio/' FOLIO_MD_REGISTRY: 'https://folio-registry.dev.folio.org' - NODEJS_VERSION: '16' + NODEJS_VERSION: '18' JEST_JUNIT_OUTPUT_DIR: 'artifacts/jest-junit' JEST_COVERAGE_REPORT_DIR: 'artifacts/coverage-jest/lcov-report/' BIGTEST_JUNIT_OUTPUT_DIR: 'artifacts/runTest' diff --git a/.github/workflows/build-npm.yml b/.github/workflows/build-npm.yml index fbfd2eca..afe48470 100644 --- a/.github/workflows/build-npm.yml +++ b/.github/workflows/build-npm.yml @@ -22,7 +22,7 @@ jobs: PUBLISH_MOD_DESCRIPTOR: 'true' FOLIO_NPM_REGISTRY: 'https://repository.folio.org/repository/npm-folioci/' FOLIO_MD_REGISTRY: 'https://folio-registry.dev.folio.org' - NODEJS_VERSION: '16' + NODEJS_VERSION: '18' JEST_JUNIT_OUTPUT_DIR: 'artifacts/jest-junit' JEST_COVERAGE_REPORT_DIR: 'artifacts/coverage-jest/lcov-report/' SQ_LCOV_REPORT: 'artifacts/coverage-jest/lcov.info' From 4c98df30b5e74084de06f254671af745a4264056 Mon Sep 17 00:00:00 2001 From: danetsao Date: Thu, 21 Sep 2023 13:43:43 -0500 Subject: [PATCH 2/5] Added '?' operator to fix possible null error --- src/forms/CalendarForm/validation/validateExceptions.tsx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/forms/CalendarForm/validation/validateExceptions.tsx b/src/forms/CalendarForm/validation/validateExceptions.tsx index 01c7ed17..fa0e0b15 100644 --- a/src/forms/CalendarForm/validation/validateExceptions.tsx +++ b/src/forms/CalendarForm/validation/validateExceptions.tsx @@ -248,11 +248,11 @@ export function validateExceptionInterOverlaps( const rowMinMaxes: { i: number; startDate: Dayjs; endDate: Dayjs }[] = rows.map((row) => ({ i: row.i, - startDate: dayjs - .min(row.rows.map(({ startDate }) => dayjs(startDate))) + startDate: dayjs?.min( + row.rows.map(({ startDate }) => dayjs(startDate))) .startOf('day'), - endDate: dayjs - .max(row.rows.map(({ endDate }) => dayjs(endDate))) + endDate: dayjs?.max( + row.rows.map(({ endDate }) => dayjs(endDate))) .endOf('day') })); From ced24b983017681329bffd52d38f3cc9fc486623 Mon Sep 17 00:00:00 2001 From: Noah Overcash Date: Thu, 21 Sep 2023 15:10:01 -0400 Subject: [PATCH 3/5] Fix null safety error --- .../CalendarForm/validation/validateExceptions.tsx | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/forms/CalendarForm/validation/validateExceptions.tsx b/src/forms/CalendarForm/validation/validateExceptions.tsx index fa0e0b15..7a1e50f1 100644 --- a/src/forms/CalendarForm/validation/validateExceptions.tsx +++ b/src/forms/CalendarForm/validation/validateExceptions.tsx @@ -248,12 +248,12 @@ export function validateExceptionInterOverlaps( const rowMinMaxes: { i: number; startDate: Dayjs; endDate: Dayjs }[] = rows.map((row) => ({ i: row.i, - startDate: dayjs?.min( - row.rows.map(({ startDate }) => dayjs(startDate))) - .startOf('day'), - endDate: dayjs?.max( - row.rows.map(({ endDate }) => dayjs(endDate))) - .endOf('day') + startDate: dayjs + .min(row.rows.map(({ startDate }) => dayjs(startDate))) + ?.startOf('day'), + endDate: dayjs + .maxrow.rows.map(({ endDate }) => dayjs(endDate))) + ?.endOf('day') })); for (let i = 0; i < rowMinMaxes.length - 1; i++) { From 03bd1914c474a0e5b7a2e00842d53b0ff343329f Mon Sep 17 00:00:00 2001 From: Noah Overcash Date: Thu, 21 Sep 2023 15:12:33 -0400 Subject: [PATCH 4/5] Fix typo --- src/forms/CalendarForm/validation/validateExceptions.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/forms/CalendarForm/validation/validateExceptions.tsx b/src/forms/CalendarForm/validation/validateExceptions.tsx index 7a1e50f1..6aeec69e 100644 --- a/src/forms/CalendarForm/validation/validateExceptions.tsx +++ b/src/forms/CalendarForm/validation/validateExceptions.tsx @@ -252,7 +252,7 @@ export function validateExceptionInterOverlaps( .min(row.rows.map(({ startDate }) => dayjs(startDate))) ?.startOf('day'), endDate: dayjs - .maxrow.rows.map(({ endDate }) => dayjs(endDate))) + .max(row.rows.map(({ endDate }) => dayjs(endDate))) ?.endOf('day') })); From 5e8dd66d6bf2c2261a3642b3dc0ff7b09c219ca0 Mon Sep 17 00:00:00 2001 From: Noah Overcash Date: Thu, 21 Sep 2023 15:18:04 -0400 Subject: [PATCH 5/5] More nullish errors?? --- src/forms/CalendarForm/validation/validateExceptions.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/forms/CalendarForm/validation/validateExceptions.tsx b/src/forms/CalendarForm/validation/validateExceptions.tsx index 6aeec69e..8413ecb9 100644 --- a/src/forms/CalendarForm/validation/validateExceptions.tsx +++ b/src/forms/CalendarForm/validation/validateExceptions.tsx @@ -250,10 +250,10 @@ export function validateExceptionInterOverlaps( i: row.i, startDate: dayjs .min(row.rows.map(({ startDate }) => dayjs(startDate))) - ?.startOf('day'), + ?.startOf('day') ?? dayjs(0), endDate: dayjs .max(row.rows.map(({ endDate }) => dayjs(endDate))) - ?.endOf('day') + ?.endOf('day') ?? dayjs(0) })); for (let i = 0; i < rowMinMaxes.length - 1; i++) {