From df5a86e514fd6735f8ae406942d6489799539dbc Mon Sep 17 00:00:00 2001 From: Vladimir Voitenko Date: Fri, 15 Sep 2023 00:03:30 +0500 Subject: [PATCH] packages:js:fix-date-allowOnly --- packages/js/src/cli/__tests__/snippets.ts | 22 ++++++++++++++++++++++ packages/js/src/schema/defs/type.json | 2 +- 2 files changed, 23 insertions(+), 1 deletion(-) diff --git a/packages/js/src/cli/__tests__/snippets.ts b/packages/js/src/cli/__tests__/snippets.ts index 946b37f..9954930 100644 --- a/packages/js/src/cli/__tests__/snippets.ts +++ b/packages/js/src/cli/__tests__/snippets.ts @@ -30,6 +30,10 @@ spec: required: true errorMessage: null placeholder: null + date: + type: justDate + required: true + errorMessage: null eventDate: type: futureDate required: true @@ -98,6 +102,17 @@ export const formExpectedCode = `export const RegistrationForm = { min: 0.1 } }, + date: { + type: "justDate", + required: true, + errorMessage: null, + placeholder: null, + helperMessage: null, + typeSpec: { + type: "date", + allowOnly: null + } + }, eventDate: { type: "futureDate", required: true, @@ -326,4 +341,11 @@ spec: types: - login - password +... +--- +type: type +metadata: + name: justDate +spec: + type: date ` diff --git a/packages/js/src/schema/defs/type.json b/packages/js/src/schema/defs/type.json index f365667..d8f27ed 100644 --- a/packages/js/src/schema/defs/type.json +++ b/packages/js/src/schema/defs/type.json @@ -104,7 +104,7 @@ }, "allowOnly": { "type": ["string", "null"], - "enum": ["past", "future"], + "enum": ["past", "future", null], "default": null } },