Skip to content

Commit c2debb5

Browse files
authored
Create a new dist version 0.0.27 (#82)
Collecting: - Fix [Artifacts] missing input validation logic in "edit tag" dialog (#81)
1 parent 8270307 commit c2debb5

File tree

3 files changed

+14
-8
lines changed

3 files changed

+14
-8
lines changed

commit_message

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11

22

3-
Create a new dist version 0.0.26
3+
Create a new dist version 0.0.27
44

55
Collecting:
6-
- Fix [Artifacts] information row is missing (#78)
7-
- Fix [UI] Trimmed tooltips of dataset labels (#79)
6+
- Fix [Artifacts] missing input validation logic in "edit tag" dialog (#81)

dist/utils/validation.util.js

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,19 @@
11
"use strict";
22

3+
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
4+
35
Object.defineProperty(exports, "__esModule", {
46
value: true
57
});
68
exports.required = exports.getValidationRules = exports.checkPatternsValidity = void 0;
79

8-
var _lodash = _interopRequireDefault(require("lodash"));
10+
var _lodash = _interopRequireWildcard(require("lodash"));
911

1012
var _constants = require("../constants");
1113

12-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
14+
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
15+
16+
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
1317

1418
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
1519

@@ -76,14 +80,17 @@ var required = function required() {
7680
* @function checkPatternsValidity
7781
* @param {Array} validationRules Array of Validation Rule Objects {name: "", lable: "", pattren: [Function || Regex]}
7882
* @param {string} value Field value to check validity
83+
* @param {boolean} required Specified if the value should be validated
7984
* @returns {Array} [validationRules, isFieldValid] New validationRules With `isValid` property, `true` in case there is at least one failed validation rule, or `false` otherwise.
8085
*/
8186

8287

8388
exports.required = required;
8489

85-
var checkPatternsValidity = function checkPatternsValidity(validationRules, value) {
86-
var newRules = validationRules.map(function (rule) {
90+
var checkPatternsValidity = function checkPatternsValidity(validationRules) {
91+
var value = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';
92+
var required = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;
93+
var newRules = !required && (0, _lodash.isEmpty)(value) ? validationRules : validationRules.map(function (rule) {
8794
return _objectSpread(_objectSpread({}, rule), {}, {
8895
isValid: _lodash.default.isFunction(rule.pattern) ? rule.pattern(value) :
8996
/* else, it is a RegExp */

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "iguazio.dashboard-react-controls",
3-
"version": "0.0.26",
3+
"version": "0.0.27",
44
"description": "Collection of resources (such as CSS styles, fonts and images) and ReactJS 17.x components to share among different Iguazio React repos.",
55
"main": "dist/index.js",
66
"module": "dist/index.js",

0 commit comments

Comments
 (0)