iguazio.dashboard-react-controls 2.0.9 → 2.0.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/FormChipCell/FormChipCellView.js +2 -2
- package/dist/components/FormChipCell/NewChipForm/NewChipForm.js +9 -8
- package/dist/components/FormChipCell/NewChipForm/newChipForm.scss +6 -2
- package/dist/images/arrow-down.svg +3 -0
- package/dist/images/arrow-up.svg +3 -0
- package/dist/images/circled-m.svg +3 -0
- package/dist/images/circled-r.svg +3 -0
- package/dist/images/metrics-icon.svg +10 -0
- package/dist/images/no-data-metric-icon.svg +119 -0
- package/dist/scss/mixins.scss +4 -0
- package/dist/utils/validation.util.js +22 -6
- package/package.json +1 -1
package/dist/scss/mixins.scss
CHANGED
|
@@ -224,6 +224,15 @@ const generateRule = {
|
|
|
224
224
|
label: _constants.validation.REQUIRED.LABEL,
|
|
225
225
|
pattern: new RegExp('\\S')
|
|
226
226
|
};
|
|
227
|
+
},
|
|
228
|
+
checkForValidCustomLabels: internalLabels => {
|
|
229
|
+
return {
|
|
230
|
+
name: 'customLabels',
|
|
231
|
+
label: 'System-defined labels cannot be modified.',
|
|
232
|
+
pattern: value => {
|
|
233
|
+
return !internalLabels.includes(value);
|
|
234
|
+
}
|
|
235
|
+
};
|
|
227
236
|
}
|
|
228
237
|
};
|
|
229
238
|
const commonRules = {
|
|
@@ -316,14 +325,15 @@ const validationRules = {
|
|
|
316
325
|
tag: [generateRule.validCharacters('a-z A-Z 0-9 - _ .'), generateRule.beginEndWith('a-z A-Z 0-9'), generateRule.length({
|
|
317
326
|
max: 56
|
|
318
327
|
})],
|
|
319
|
-
combobox: [generateRule.required()]
|
|
328
|
+
combobox: [generateRule.required()],
|
|
329
|
+
labels: [internalLabels => generateRule.checkForValidCustomLabels(internalLabels)]
|
|
320
330
|
},
|
|
321
331
|
project: {
|
|
322
332
|
name: [generateRule.validCharacters('a-z 0-9 -'), generateRule.beginWith('a-z'), generateRule.endWith('a-z 0-9'), generateRule.length({
|
|
323
333
|
max: 63
|
|
324
334
|
}), generateRule.required()],
|
|
325
335
|
labels: {
|
|
326
|
-
key: commonRules.k8sLabels.key,
|
|
336
|
+
key: [...commonRules.k8sLabels.key, internalLabels => generateRule.checkForValidCustomLabels(internalLabels)],
|
|
327
337
|
value: commonRules.k8sLabels.value
|
|
328
338
|
},
|
|
329
339
|
params: {
|
|
@@ -350,7 +360,7 @@ const validationRules = {
|
|
|
350
360
|
label: {
|
|
351
361
|
key: [generateRule.validCharactersWithPrefix('a-z A-Z 0-9 - _ .'), generateRule.beginEndWith('a-z A-Z 0-9'), generateRule.length({
|
|
352
362
|
max: 75
|
|
353
|
-
})],
|
|
363
|
+
}), internalLabels => generateRule.checkForValidCustomLabels(internalLabels)],
|
|
354
364
|
value: generateRule.length({
|
|
355
365
|
max: 255
|
|
356
366
|
})
|
|
@@ -363,9 +373,15 @@ const validationRules = {
|
|
|
363
373
|
* @function getValidationRules
|
|
364
374
|
* @param {string} type - The property path to the list of validation rules.
|
|
365
375
|
* @param {Array.<Object>} [additionalRules] - Additional rules to append.
|
|
366
|
-
* @
|
|
376
|
+
* @param {Array.<Object>} [customData] - Additional data to be passed to the custom rule functions.
|
|
377
|
+
* @returns {Array.<Object>} The rule list of type `type` with `additionalRules` appended to it if provided.
|
|
367
378
|
*/
|
|
368
|
-
const getValidationRules = (type, additionalRules) => {
|
|
369
|
-
return _lodash.default.chain(validationRules).get(type).defaultTo([]).cloneDeep().
|
|
379
|
+
const getValidationRules = (type, additionalRules, customData) => {
|
|
380
|
+
return _lodash.default.chain(validationRules).get(type).defaultTo([]).cloneDeep().map(rule => {
|
|
381
|
+
if (typeof rule === 'function') {
|
|
382
|
+
return rule(customData);
|
|
383
|
+
}
|
|
384
|
+
return rule;
|
|
385
|
+
}).concat(_lodash.default.defaultTo(additionalRules, [])).value();
|
|
370
386
|
};
|
|
371
387
|
exports.getValidationRules = getValidationRules;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "iguazio.dashboard-react-controls",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.11",
|
|
4
4
|
"description": "Collection of resources (such as CSS styles, fonts and images) and ReactJS 17.x components to share among different Iguazio React repos.",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"module": "dist/index.js",
|