Skip to content

Commit 18601a7

Browse files
authored
Create a new dist version 2.1.6 (#310)
Collecting: - Fix [DRC] ESLint Error: useRef in Callback (#307) - Fix [UI] Labels don't use all the block width (#308) - Fix [Model endpoints] switching to model/feature set overview is malfunctioning (#309)
1 parent f0ea94e commit 18601a7

File tree

8 files changed

+36
-25
lines changed

8 files changed

+36
-25
lines changed

commit_message

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

22

3-
Create a new dist version 2.1.5
3+
Create a new dist version 2.1.6
44

55
Collecting:
6-
- Fix [UI] Deprecated param - Support for defaultProps will be removed (#305)
6+
- Fix [DRC] ESLint Error: useRef in Callback (#307)
7+
- Fix [UI] Labels don't use all the block width (#308)
8+
- Fix [Model endpoints] switching to model/feature set overview is malfunctioning (#309)

dist/components/FormChipCell/HiddenChipsBlock/HiddenChipsBlock.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@ const HiddenChipsBlock = /*#__PURE__*/_react.default.forwardRef((_ref, _ref2) =>
6161
return /*#__PURE__*/(0, _reactDom.createPortal)( /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
6262
ref: hiddenChipsPopUpRef,
6363
className: hiddenChipsBlockClassNames,
64+
onClick: event => event.stopPropagation(),
6465
children: /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
6566
className: "chip-block-hidden__scrollable-container",
6667
children: chips === null || chips === void 0 ? void 0 : chips.map(element => {

dist/components/FormChipCell/NewChipForm/NewChipForm.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ const NewChipForm = /*#__PURE__*/_react.default.forwardRef((_ref, ref) => {
8585
const labelKeyClassName = (0, _classnames.default)(className, !editConfig.isKeyFocused && 'item_edited', !(0, _lodash.isEmpty)((0, _lodash.get)(meta, ['error', chipIndex, 'key'], [])) && !(0, _lodash.isEmpty)(chipData.key) && !chip.disabled && 'item_edited_invalid');
8686
const labelContainerClassName = (0, _classnames.default)('edit-chip-container', background && "edit-chip-container-background_".concat(background), borderColor && "edit-chip-container-border_".concat(borderColor), font && "edit-chip-container-font_".concat(font), density && "edit-chip-container-density_".concat(density), borderRadius && "edit-chip-container-border_".concat(borderRadius), (editConfig.isEdit || editConfig.isNewChip) && 'edit-chip-container_edited', chip.disabled && 'edit-chip-container_disabled edit-chip-container-font_disabled');
8787
const labelValueClassName = (0, _classnames.default)('input-label-value', !editConfig.isValueFocused && 'item_edited', !(0, _lodash.isEmpty)((0, _lodash.get)(meta, ['error', chipIndex, 'value'], [])) && !(0, _lodash.isEmpty)(chipData.value) && 'item_edited_invalid');
88-
const closeButtonClass = (0, _classnames.default)('item-icon-close', !chip.disabled && (editConfig.chipIndex === chipIndex || !isEditable) && 'item-icon-close_hidden');
88+
const closeButtonClass = (0, _classnames.default)('item-icon-close', !chip.disabled && editConfig.chipIndex === chipIndex && isEditable && 'item-icon-close_invisible', !isEditable && 'item-icon-close_hidden');
8989
(0, _react.useLayoutEffect)(() => {
9090
if (!chipData.keyFieldWidth && !chipData.valueFieldWidth) {
9191
const currentWidthKeyInput = refInputKey.current.scrollWidth + 1;

dist/components/FormChipCell/NewChipForm/newChipForm.scss

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,10 @@
5858
justify-content: center;
5959

6060
&_hidden {
61+
display: none;
62+
}
63+
64+
&_invisible {
6165
visibility: hidden;
6266
}
6367

dist/hooks/useChipCell.hook.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ const useChipCell = (isEditMode, visibleChipsMaxLength) => {
4747
setShowHiddenChips(true);
4848
}
4949
}
50+
event && event.stopPropagation();
5051
}, [isEditMode, visibleChipsMaxLength]);
5152
(0, _react.useEffect)(() => {
5253
if (showHiddenChips) {

dist/hooks/useDebounce.hook.js

Lines changed: 22 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -22,29 +22,31 @@ under the Apache 2.0 license is conditioned upon your compliance with
2222
such restriction.
2323
*/
2424

25-
const useDebounce = () => (validate, time) => {
25+
const useDebounce = () => {
2626
const timeout = (0, _react.useRef)(null);
2727
const lastValue = (0, _react.useRef)(null);
2828
const lastResult = (0, _react.useRef)(null);
29-
return function (value) {
30-
return new Promise(resolve => {
31-
if (timeout.current) {
32-
timeout.current();
33-
}
34-
if (value !== lastValue.current) {
35-
const timerId = setTimeout(() => {
36-
lastValue.current = value;
37-
lastResult.current = validate(value);
29+
return (0, _react.useCallback)((validate, time) => {
30+
return value => {
31+
return new Promise(resolve => {
32+
if (timeout.current) {
33+
timeout.current();
34+
}
35+
if (value !== lastValue.current) {
36+
const timerId = setTimeout(() => {
37+
lastValue.current = value;
38+
lastResult.current = validate(value);
39+
resolve(lastResult.current);
40+
}, time);
41+
timeout.current = () => {
42+
clearTimeout(timerId);
43+
resolve(true);
44+
};
45+
} else {
3846
resolve(lastResult.current);
39-
}, time);
40-
timeout.current = () => {
41-
clearTimeout(timerId);
42-
resolve(true);
43-
};
44-
} else {
45-
resolve(lastResult.current);
46-
}
47-
});
48-
};
47+
}
48+
});
49+
};
50+
}, []);
4951
};
5052
exports.useDebounce = useDebounce;

dist/utils/validation.util.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -380,7 +380,8 @@ const getValidationRules = (type, additionalRules) => {
380380
* @returns {Object} The rule that checks if a value is not in the internal labels.
381381
*/
382382
exports.getValidationRules = getValidationRules;
383-
const getInternalLabelsValidationRule = internalLabels => {
383+
const getInternalLabelsValidationRule = function () {
384+
let internalLabels = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
384385
return {
385386
name: 'customLabels',
386387
label: 'System-defined labels cannot be modified.',

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": "2.1.5",
3+
"version": "2.1.6",
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)