Skip to content

Commit f8d162e

Browse files
tnagorrafrozenhelium
authored andcommitted
Fix schema for Project and Tutorial form
1 parent 73ec78d commit f8d162e

File tree

12 files changed

+199
-176
lines changed

12 files changed

+199
-176
lines changed

manager-dashboard/app/components/PopupButton/index.tsx

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,10 @@
11
import React from 'react';
22
import { IoIosArrowDown, IoIosArrowUp } from 'react-icons/io';
3-
43
import { _cs } from '@togglecorp/fujs';
54

65
import Button, { ButtonProps } from '#components/Button';
7-
8-
import useBlurEffect from '../../hooks/useBlurEffect';
9-
10-
import Popup from '../Popup';
6+
import useBlurEffect from '#hooks/useBlurEffect';
7+
import Popup from '#components/Popup';
118

129
import styles from './styles.css';
1310

manager-dashboard/app/components/TileServerInput/index.tsx

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,8 @@ function imageryUrlCondition(value: string | null | undefined) {
7878
return 'Imagery url must contain {x}, {y} (or {-y}) & {z} placeholders or {quad_key} placeholder.';
7979
}
8080

81+
const MD_TEXT_MAX_LENGTH = 1000;
82+
8183
type TileServerInputType = PartialForm<TileServer>;
8284
type TileServerSchema = ObjectSchema<PartialForm<TileServerInputType>, unknown>;
8385
type TileServerFields = ReturnType<TileServerSchema['fields']>;
@@ -86,12 +88,12 @@ export function tileServerFieldsSchema(value: TileServerInputType | undefined):
8688
name: {
8789
required: true,
8890
requiredValidation: requiredStringCondition,
89-
validations: [getNoMoreThanNCharacterCondition(1000)],
91+
validations: [getNoMoreThanNCharacterCondition(MD_TEXT_MAX_LENGTH)],
9092
},
9193
credits: {
9294
required: true,
9395
requiredValidation: requiredStringCondition,
94-
validations: [getNoMoreThanNCharacterCondition(1000)],
96+
validations: [getNoMoreThanNCharacterCondition(MD_TEXT_MAX_LENGTH)],
9597
},
9698
};
9799
basicFields = addCondition(
@@ -106,14 +108,14 @@ export function tileServerFieldsSchema(value: TileServerInputType | undefined):
106108
required: true,
107109
requiredValidation: requiredStringCondition,
108110
validations: [
109-
getNoMoreThanNCharacterCondition(1000),
111+
getNoMoreThanNCharacterCondition(MD_TEXT_MAX_LENGTH),
110112
imageryUrlCondition,
111113
],
112114
},
113115
wmtsLayerName: {
114116
required: true,
115117
requiredValidation: requiredStringCondition,
116-
validations: [getNoMoreThanNCharacterCondition(1000)],
118+
validations: [getNoMoreThanNCharacterCondition(MD_TEXT_MAX_LENGTH)],
117119
},
118120
};
119121
}

0 commit comments

Comments
 (0)