Skip to content

Commit

Permalink
Create a new dist version 1.8.11 (#249)
Browse files Browse the repository at this point in the history
Collecting:
- Fix [Project Settings] Validation on parameter - trailing white spaces (#247)
- Impl [Artifacts] lazy load of Data (#248)
  • Loading branch information
ilan7empest authored Mar 10, 2024
1 parent 6deb973 commit 0b3f7a0
Show file tree
Hide file tree
Showing 5 changed files with 50 additions and 29 deletions.
6 changes: 3 additions & 3 deletions commit_message
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@


Create a new dist version 1.8.10
Create a new dist version 1.8.11

Collecting:
- Fix [Batch run] Display selected function on return to step 1 (#244)
- Impl [Project setting] Provide validation rules on labels in UI (#245)
- Fix [Project Settings] Validation on parameter - trailing white spaces (#247)
- Impl [Artifacts] lazy load of Data (#248)
60 changes: 36 additions & 24 deletions dist/components/FormKeyValueTable/FormKeyValueTable.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,25 +11,30 @@ var _reactFinalFormArrays = require("react-final-form-arrays");
var _components = require("../../components");
var _elements = require("../../elements");
var _hooks = require("../../hooks");
var _types = require("../../types");
var _jsxRuntime = require("react/jsx-runtime");
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
/*
Copyright 2022 Iguazio Systems Ltd.
Licensed under the Apache License, Version 2.0 (the "License") with
an addition restriction as set forth herein. You may not use this
file except in compliance with the License. You may obtain a copy of
the License at http://www.apache.org/licenses/LICENSE-2.0.
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
implied. See the License for the specific language governing
permissions and limitations under the License.
In addition, you may not use the software for any purposes that are
illegal under applicable law, and the grant of the foregoing license
under the Apache 2.0 license is conditioned upon your compliance with
such restriction.
*/

function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; } /*
Copyright 2022 Iguazio Systems Ltd.
Licensed under the Apache License, Version 2.0 (the "License") with
an addition restriction as set forth herein. You may not use this
file except in compliance with the License. You may obtain a copy of
the License at http://www.apache.org/licenses/LICENSE-2.0.
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
implied. See the License for the specific language governing
permissions and limitations under the License.
In addition, you may not use the software for any purposes that are
illegal under applicable law, and the grant of the foregoing license
under the Apache 2.0 license is conditioned upon your compliance with
such restriction.
*/
var FormKeyValueTable = function FormKeyValueTable(_ref) {
var actionButtonId = _ref.actionButtonId,
addNewItemLabel = _ref.addNewItemLabel,
Expand All @@ -44,9 +49,11 @@ var FormKeyValueTable = function FormKeyValueTable(_ref) {
keyHeader = _ref.keyHeader,
keyLabel = _ref.keyLabel,
keyOptions = _ref.keyOptions,
keyValidationRules = _ref.keyValidationRules,
onExitEditModeCallback = _ref.onExitEditModeCallback,
valueHeader = _ref.valueHeader,
valueLabel = _ref.valueLabel;
valueLabel = _ref.valueLabel,
valueValidationRules = _ref.valueValidationRules;
var tableClassNames = (0, _classnames.default)('form-table form-key-value-table', className);
var _useFormTable = (0, _hooks.useFormTable)(formState, exitEditModeTriggerItem, onExitEditModeCallback),
addNewRow = _useFormTable.addNewRow,
Expand All @@ -60,7 +67,7 @@ var FormKeyValueTable = function FormKeyValueTable(_ref) {
var uniquenessValidator = function uniquenessValidator(fields, newValue) {
return !fields.value.some(function (_ref2, index) {
var key = _ref2.data.key;
return newValue.trim() === key && index !== editingItem.ui.index;
return newValue.trim() === key.trim() && index !== editingItem.ui.index;
});
};
return /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
Expand Down Expand Up @@ -99,13 +106,13 @@ var FormKeyValueTable = function FormKeyValueTable(_ref) {
density: "normal",
name: "".concat(rowPath, ".data.key"),
required: isKeyRequired,
validationRules: [{
validationRules: [].concat(_toConsumableArray(keyValidationRules), [{
name: 'uniqueness',
label: 'Name must be unique',
pattern: function pattern(newValue) {
return uniquenessValidator(fields, newValue);
}
}]
}])
})
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
className: "form-table__cell form-table__cell_1",
Expand All @@ -114,7 +121,8 @@ var FormKeyValueTable = function FormKeyValueTable(_ref) {
placeholder: valueLabel,
density: "normal",
name: "".concat(rowPath, ".data.value"),
required: isValueRequired
required: isValueRequired,
validationRules: valueValidationRules
})
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_elements.FormRowActions, {
applyChanges: applyChanges,
Expand Down Expand Up @@ -191,9 +199,11 @@ FormKeyValueTable.defaultProps = {
keyHeader: 'Key',
keyLabel: 'Key',
keyOptions: null,
keyValidationRules: [],
onExitEditModeCallback: function onExitEditModeCallback() {},
valueHeader: 'Value',
valueLabel: 'Value'
valueLabel: 'Value',
valueValidationRules: []
};
FormKeyValueTable.propTypes = {
actionButtonId: _propTypes.default.string,
Expand All @@ -212,9 +222,11 @@ FormKeyValueTable.propTypes = {
label: _propTypes.default.string.isRequired,
id: _propTypes.default.string.isRequired
})),
keyValidationRules: _types.INPUT_VALIDATION_RULES,
onExitEditModeCallback: _propTypes.default.func,
valueHeader: _propTypes.default.string,
valueLabel: _propTypes.default.string
valueLabel: _propTypes.default.string,
valueValidationRules: _types.INPUT_VALIDATION_RULES
};
var _default = FormKeyValueTable;
exports.default = _default;
5 changes: 5 additions & 0 deletions dist/scss/variables.scss
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,8 @@ $fieldDense: 36px;
$fieldNormal: 40px;
$fieldMedium: 44px;
$fieldChunky: 48px;

$headerRowHeight: 40;
$headerRowHeightBig: 50;
$rowHeight: 57;
$rowHeightExtended: 82;
6 changes: 5 additions & 1 deletion dist/utils/validation.util.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input ==
* // => 'a–z, A–Z, –, _, *'
*/
var convertToLabel = function convertToLabel(chars) {
return chars.replace(/-/g, '–').replace(/\s/g, ', ').replace(/\bs\b/);
return chars.replace(/-/g, '–').replace(/\s/g, ', ').replace(/\bs\b/, 'spaces');
};

/**
Expand Down Expand Up @@ -382,6 +382,10 @@ var validationRules = {
labels: {
key: commonRules.k8sLabels.key,
value: commonRules.k8sLabels.value
},
params: {
key: [generateRule.beginEndNotWith('s')],
value: [generateRule.beginEndNotWith('s')]
}
},
environmentVariables: {
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "iguazio.dashboard-react-controls",
"version": "1.8.10",
"version": "1.8.11",
"description": "Collection of resources (such as CSS styles, fonts and images) and ReactJS 17.x components to share among different Iguazio React repos.",
"main": "dist/index.js",
"module": "dist/index.js",
Expand Down

0 comments on commit 0b3f7a0

Please sign in to comment.