From d36bdb9cd5aad605f64398b8cada8b704581b1bf Mon Sep 17 00:00:00 2001 From: Julianna Apicella <42875581+juliannaeapicella@users.noreply.github.com> Date: Mon, 20 May 2024 13:56:42 -0400 Subject: [PATCH 1/2] fix(hub-common): enable editing for past events --- .../common/src/events/_internal/EventSchemaEdit.ts | 1 - .../src/events/_internal/EventUiSchemaEdit.ts | 14 -------------- .../test/events/_internal/EventSchemaEdit.test.ts | 1 - .../events/_internal/EventUiSchemaEdit.test.ts | 14 -------------- 4 files changed, 30 deletions(-) diff --git a/packages/common/src/events/_internal/EventSchemaEdit.ts b/packages/common/src/events/_internal/EventSchemaEdit.ts index 7e7163290e9..937d760bd05 100644 --- a/packages/common/src/events/_internal/EventSchemaEdit.ts +++ b/packages/common/src/events/_internal/EventSchemaEdit.ts @@ -38,7 +38,6 @@ export const buildSchema = (): IConfigurationSchema => { startDate: { type: "string", format: "date", - formatMinimum: minStartDate, }, endDate: { type: "string", diff --git a/packages/common/src/events/_internal/EventUiSchemaEdit.ts b/packages/common/src/events/_internal/EventUiSchemaEdit.ts index 9dd15a77c06..1a2ea0941e3 100644 --- a/packages/common/src/events/_internal/EventUiSchemaEdit.ts +++ b/packages/common/src/events/_internal/EventUiSchemaEdit.ts @@ -82,7 +82,6 @@ export const buildUiSchema = async ( type: "Control", options: { control: "hub-field-input-date", - min: minStartEndDate, messages: [ { type: "ERROR", @@ -90,12 +89,6 @@ export const buildUiSchema = async ( icon: true, labelKey: `${i18nScope}.fields.startDate.requiredError`, }, - { - type: "ERROR", - keyword: "formatMinimum", - icon: true, - labelKey: `${i18nScope}.fields.startDate.minDateError`, - }, ], }, }, @@ -105,7 +98,6 @@ export const buildUiSchema = async ( type: "Control", options: { control: "hub-field-input-date", - min: minStartEndDate, messages: [ { type: "ERROR", @@ -113,12 +105,6 @@ export const buildUiSchema = async ( icon: true, labelKey: `${i18nScope}.fields.endDate.requiredError`, }, - { - type: "ERROR", - keyword: "formatMinimum", - icon: true, - labelKey: `${i18nScope}.fields.endDate.minDateError`, - }, ], }, }, diff --git a/packages/common/test/events/_internal/EventSchemaEdit.test.ts b/packages/common/test/events/_internal/EventSchemaEdit.test.ts index 8aed585c1cf..c9d4e58709a 100644 --- a/packages/common/test/events/_internal/EventSchemaEdit.test.ts +++ b/packages/common/test/events/_internal/EventSchemaEdit.test.ts @@ -54,7 +54,6 @@ describe("EventSchemaEdit", () => { startDate: { type: "string", format: "date", - formatMinimum: datesAndTimes.startDate, }, endDate: { type: "string", diff --git a/packages/common/test/events/_internal/EventUiSchemaEdit.test.ts b/packages/common/test/events/_internal/EventUiSchemaEdit.test.ts index bcbce2dca85..53c1d70dabf 100644 --- a/packages/common/test/events/_internal/EventUiSchemaEdit.test.ts +++ b/packages/common/test/events/_internal/EventUiSchemaEdit.test.ts @@ -162,7 +162,6 @@ describe("EventUiSchemaEdit", () => { type: "Control", options: { control: "hub-field-input-date", - min: "2024-04-03", messages: [ { type: "ERROR", @@ -170,12 +169,6 @@ describe("EventUiSchemaEdit", () => { icon: true, labelKey: `myI18nScope.fields.startDate.requiredError`, }, - { - type: "ERROR", - keyword: "formatMinimum", - icon: true, - labelKey: `myI18nScope.fields.startDate.minDateError`, - }, ], }, }, @@ -185,7 +178,6 @@ describe("EventUiSchemaEdit", () => { type: "Control", options: { control: "hub-field-input-date", - min: "2024-04-03", messages: [ { type: "ERROR", @@ -193,12 +185,6 @@ describe("EventUiSchemaEdit", () => { icon: true, labelKey: `myI18nScope.fields.endDate.requiredError`, }, - { - type: "ERROR", - keyword: "formatMinimum", - icon: true, - labelKey: `myI18nScope.fields.endDate.minDateError`, - }, ], }, }, From bc81bb49af43deb1053b8ac2b9974f51ad52ab70 Mon Sep 17 00:00:00 2001 From: Julianna Apicella <42875581+juliannaeapicella@users.noreply.github.com> Date: Tue, 21 May 2024 11:06:36 -0400 Subject: [PATCH 2/2] fix(hub-common): re-add error message --- packages/common/src/events/_internal/EventUiSchemaEdit.ts | 6 ++++++ .../common/test/events/_internal/EventUiSchemaEdit.test.ts | 6 ++++++ 2 files changed, 12 insertions(+) diff --git a/packages/common/src/events/_internal/EventUiSchemaEdit.ts b/packages/common/src/events/_internal/EventUiSchemaEdit.ts index 1a2ea0941e3..38999c0a7e8 100644 --- a/packages/common/src/events/_internal/EventUiSchemaEdit.ts +++ b/packages/common/src/events/_internal/EventUiSchemaEdit.ts @@ -105,6 +105,12 @@ export const buildUiSchema = async ( icon: true, labelKey: `${i18nScope}.fields.endDate.requiredError`, }, + { + type: "ERROR", + keyword: "formatMinimum", + icon: true, + labelKey: `${i18nScope}.fields.endDate.minDateError`, + }, ], }, }, diff --git a/packages/common/test/events/_internal/EventUiSchemaEdit.test.ts b/packages/common/test/events/_internal/EventUiSchemaEdit.test.ts index 53c1d70dabf..fa0cae20e11 100644 --- a/packages/common/test/events/_internal/EventUiSchemaEdit.test.ts +++ b/packages/common/test/events/_internal/EventUiSchemaEdit.test.ts @@ -185,6 +185,12 @@ describe("EventUiSchemaEdit", () => { icon: true, labelKey: `myI18nScope.fields.endDate.requiredError`, }, + { + type: "ERROR", + keyword: "formatMinimum", + icon: true, + labelKey: `myI18nScope.fields.endDate.minDateError`, + }, ], }, },