mirror of
https://github.com/Azure/cosmos-explorer.git
synced 2024-11-25 15:06:55 +00:00
parent
6e9144b068
commit
dce52f848c
@ -190,7 +190,8 @@ describe("SelfServeUtils", () => {
|
||||
max: 5,
|
||||
step: 1,
|
||||
uiType: "Spinner",
|
||||
errorMessage: "label, truelabel and falselabel are required for boolean input 'invalidThroughput'.",
|
||||
errorMessage:
|
||||
"labelTkey, trueLabelTKey and falseLabelTKey are required for boolean input 'invalidThroughput'.",
|
||||
},
|
||||
children: [] as Node[],
|
||||
},
|
||||
@ -225,7 +226,8 @@ describe("SelfServeUtils", () => {
|
||||
type: "boolean",
|
||||
labelTKey: "Invalid Enable Logging",
|
||||
placeholderTKey: "placeholder text",
|
||||
errorMessage: "label, truelabel and falselabel are required for boolean input 'invalidEnableLogging'.",
|
||||
errorMessage:
|
||||
"labelTkey, trueLabelTKey and falseLabelTKey are required for boolean input 'invalidEnableLogging'.",
|
||||
},
|
||||
children: [] as Node[],
|
||||
},
|
||||
@ -252,7 +254,7 @@ describe("SelfServeUtils", () => {
|
||||
type: "object",
|
||||
labelTKey: "Invalid Regions",
|
||||
placeholderTKey: "placeholder text",
|
||||
errorMessage: "label and choices are required for Choice input 'invalidRegions'.",
|
||||
errorMessage: "labelTKey and choices are required for Choice input 'invalidRegions'.",
|
||||
},
|
||||
children: [] as Node[],
|
||||
},
|
||||
|
@ -206,8 +206,8 @@ const addToDescriptor = (
|
||||
const getInput = (value: DecoratorProperties): AnyDisplay => {
|
||||
switch (value.type) {
|
||||
case "number":
|
||||
if (!value.labelTKey || !value.step || !value.uiType || !value.min || !value.max) {
|
||||
value.errorMessage = `label, step, min, max and uiType are required for number input '${value.id}'.`;
|
||||
if (!value.labelTKey || !value.uiType || !value.step || !value.max || value.min === undefined) {
|
||||
value.errorMessage = `labelTkey, step, min, max and uiType are required for number input '${value.id}'.`;
|
||||
}
|
||||
return value as NumberInput;
|
||||
case "string":
|
||||
@ -218,17 +218,17 @@ const getInput = (value: DecoratorProperties): AnyDisplay => {
|
||||
return value as DescriptionDisplay;
|
||||
}
|
||||
if (!value.labelTKey) {
|
||||
value.errorMessage = `label is required for string input '${value.id}'.`;
|
||||
value.errorMessage = `labelTKey is required for string input '${value.id}'.`;
|
||||
}
|
||||
return value as StringInput;
|
||||
case "boolean":
|
||||
if (!value.labelTKey || !value.trueLabelTKey || !value.falseLabelTKey) {
|
||||
value.errorMessage = `label, truelabel and falselabel are required for boolean input '${value.id}'.`;
|
||||
value.errorMessage = `labelTkey, trueLabelTKey and falseLabelTKey are required for boolean input '${value.id}'.`;
|
||||
}
|
||||
return value as BooleanInput;
|
||||
default:
|
||||
if (!value.labelTKey || !value.choices) {
|
||||
value.errorMessage = `label and choices are required for Choice input '${value.id}'.`;
|
||||
value.errorMessage = `labelTKey and choices are required for Choice input '${value.id}'.`;
|
||||
}
|
||||
return value as ChoiceInput;
|
||||
}
|
||||
|
@ -8,8 +8,7 @@ i18n
|
||||
.init({
|
||||
fallbackLng: "en",
|
||||
detection: { order: ["navigator", "cookie", "localStorage", "sessionStorage", "querystring", "htmlTag"] },
|
||||
// temporarily setting debug to true to investigate loading issues in prod
|
||||
debug: true,
|
||||
debug: process.env.NODE_ENV === "development",
|
||||
keySeparator: ".",
|
||||
interpolation: {
|
||||
formatSeparator: ",",
|
||||
|
Loading…
Reference in New Issue
Block a user