Skip to content

Commit 3b6daf0

Browse files
committed
hotfix(input_schema): disable datepicker validation
1 parent 486df18 commit 3b6daf0

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

packages/input_schema/src/utilities.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ export function validateInputUsingValidator(
138138

139139
Object.keys(properties).forEach((property) => {
140140
const value = input[property];
141-
const { type, editor, patternKey, patternValue, allowAbsolute, allowRelative } = properties[property];
141+
const { type, editor, patternKey, patternValue } = properties[property];
142142
const fieldErrors = [];
143143
// Check that proxy is required, if yes, valides that it's correctly setup
144144
if (type === 'object' && editor === 'proxy') {
@@ -249,7 +249,8 @@ export function validateInputUsingValidator(
249249
}
250250

251251
// Check datepicker editor format
252-
if (type === 'string' && editor === 'datepicker' && value && typeof value === 'string') {
252+
// TODO: enable validation for datepicker editor later
253+
/* if (type === 'string' && editor === 'datepicker' && value && typeof value === 'string') {
253254
const acceptAbsolute = allowAbsolute !== false;
254255
const acceptRelative = allowRelative === true;
255256
const isValidAbsolute = /^[0-9]{4}-[0-9]{2}-[0-9]{2}$/.test(value);
@@ -289,7 +290,7 @@ export function validateInputUsingValidator(
289290
fieldKey: property,
290291
}));
291292
}
292-
}
293+
} */
293294

294295
if (fieldErrors.length > 0) {
295296
const message = fieldErrors.join(', ');

test/utilities.client.test.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1019,6 +1019,7 @@ describe('utilities.client', () => {
10191019
});
10201020
});
10211021

1022+
/* TODO - enable this tests when the datepicker validation is back on
10221023
describe('special cases for datepicker string type', () => {
10231024
it('should allow absolute dates when allowAbsolute is omitted', () => {
10241025
const { inputSchema, validator } = buildInputSchema({
@@ -1231,6 +1232,7 @@ describe('utilities.client', () => {
12311232
});
12321233
});
12331234
});
1235+
*/
12341236
});
12351237

12361238
describe('#jsonStringifyExtended()', () => {

0 commit comments

Comments
 (0)