@k-int/stripes-kint-components 5.6.1 → 5.7.1
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/CHANGELOG.md +14 -0
- package/es/index.js +1 -1
- package/es/lib/ActionList/ActionList.js +1 -1
- package/es/lib/ActionList/ActionListFieldArray.js +33 -38
- package/es/lib/ActionList/index.js +1 -1
- package/es/lib/ComboButton/ComboButton.js +6 -7
- package/es/lib/ComboButton/index.js +1 -1
- package/es/lib/CustomProperties/Config/CustomPropertiesLookup.js +5 -8
- package/es/lib/CustomProperties/Config/CustomPropertiesLookup.test.js +1 -1
- package/es/lib/CustomProperties/Config/CustomPropertiesSettings.js +30 -33
- package/es/lib/CustomProperties/Config/CustomPropertiesSettings.test.js +1 -1
- package/es/lib/CustomProperties/Config/CustomPropertyForm.js +59 -59
- package/es/lib/CustomProperties/Config/CustomPropertyForm.test.js +3 -3
- package/es/lib/CustomProperties/Config/CustomPropertyView.js +33 -34
- package/es/lib/CustomProperties/Config/CustomPropertyView.test.js +2 -2
- package/es/lib/CustomProperties/Config/index.js +1 -1
- package/es/lib/CustomProperties/Edit/CustomPropertiesEdit.js +2 -2
- package/es/lib/CustomProperties/Edit/CustomPropertiesEdit.test.js +1 -1
- package/es/lib/CustomProperties/Edit/CustomPropertiesEditCtx.js +4 -4
- package/es/lib/CustomProperties/Edit/CustomPropertiesEditCtx.test.js +1 -1
- package/es/lib/CustomProperties/Edit/CustomPropertiesListField.js +6 -11
- package/es/lib/CustomProperties/Edit/CustomPropertiesListField.test.js +1 -1
- package/es/lib/CustomProperties/Edit/CustomPropertyField.js +19 -26
- package/es/lib/CustomProperties/Edit/CustomPropertyField.test.js +6 -6
- package/es/lib/CustomProperties/Edit/CustomPropertyFormCard.js +3 -3
- package/es/lib/CustomProperties/Edit/CustomPropertyFormCard.test.js +2 -2
- package/es/lib/CustomProperties/Edit/index.js +1 -1
- package/es/lib/CustomProperties/Edit/testResources.js +11 -12
- package/es/lib/CustomProperties/Filter/CustomPropertiesFilter.js +7 -12
- package/es/lib/CustomProperties/Filter/CustomPropertiesFilter.test.js +1 -1
- package/es/lib/CustomProperties/Filter/CustomPropertiesFilterField.js +21 -29
- package/es/lib/CustomProperties/Filter/CustomPropertiesFilterField.test.js +2 -2
- package/es/lib/CustomProperties/Filter/CustomPropertiesFilterFieldArray.js +7 -7
- package/es/lib/CustomProperties/Filter/CustomPropertiesFilterFieldArray.test.js +1 -1
- package/es/lib/CustomProperties/Filter/CustomPropertiesFilterForm.js +1 -1
- package/es/lib/CustomProperties/Filter/CustomPropertiesFilterForm.test.js +1 -1
- package/es/lib/CustomProperties/Filter/CustomPropertiesRule.js +9 -9
- package/es/lib/CustomProperties/Filter/CustomPropertiesRule.test.js +1 -1
- package/es/lib/CustomProperties/Filter/index.js +1 -1
- package/es/lib/CustomProperties/Filter/testResources.js +1 -2
- package/es/lib/CustomProperties/Filter/useParseActiveFilterStrings.js +2 -3
- package/es/lib/CustomProperties/View/CustomPropertiesView.js +2 -2
- package/es/lib/CustomProperties/View/CustomPropertiesView.test.js +1 -1
- package/es/lib/CustomProperties/View/CustomPropertiesViewCtx.js +19 -27
- package/es/lib/CustomProperties/View/CustomPropertiesViewCtx.test.js +1 -1
- package/es/lib/CustomProperties/View/CustomPropertyCard.js +8 -12
- package/es/lib/CustomProperties/View/index.js +1 -1
- package/es/lib/CycleButton/CycleButton.js +2 -2
- package/es/lib/CycleButton/index.js +1 -1
- package/es/lib/EditableRefdataCategoryList/EditableRefdataCategoryList.js +27 -39
- package/es/lib/EditableRefdataCategoryList/index.js +1 -1
- package/es/lib/EditableRefdataList/EditableRefdataList.js +27 -34
- package/es/lib/EditableRefdataList/index.js +1 -1
- package/es/lib/EditableSettingsList/EditableSettingsList.js +1 -1
- package/es/lib/EditableSettingsList/EditableSettingsListFieldArray.js +2 -2
- package/es/lib/EditableSettingsList/EditableSettingsListFieldArray.test.js +1 -1
- package/es/lib/EditableSettingsList/SettingField/EditSettingValue.js +6 -6
- package/es/lib/EditableSettingsList/SettingField/EditSettingValue.test.js +1 -1
- package/es/lib/EditableSettingsList/SettingField/RenderSettingValue.js +11 -13
- package/es/lib/EditableSettingsList/SettingField/RenderSettingValue.test.js +1 -1
- package/es/lib/EditableSettingsList/SettingField/SettingField.js +5 -5
- package/es/lib/EditableSettingsList/SettingField/SettingField.test.js +1 -1
- package/es/lib/EditableSettingsList/SettingField/index.js +1 -1
- package/es/lib/EditableSettingsList/index.js +1 -1
- package/es/lib/FormModal/FormModal.js +1 -1
- package/es/lib/FormModal/index.js +1 -1
- package/es/lib/FormattedKintMessage/FormattedKintMessage.js +5 -8
- package/es/lib/FormattedKintMessage/index.js +1 -1
- package/es/lib/IconSelect/IconSelect.js +6 -10
- package/es/lib/IconSelect/index.js +1 -1
- package/es/lib/NoResultsMessage/NoResultsMessage.js +5 -5
- package/es/lib/NoResultsMessage/index.js +1 -1
- package/es/lib/QueryTypedown/QueryTypedown.js +1 -1
- package/es/lib/QueryTypedown/index.js +1 -1
- package/es/lib/RefdataButtons/RefdataButtons.js +4 -4
- package/es/lib/RefdataButtons/index.js +1 -1
- package/es/lib/RefdataCategoriesSettings/RefdataCategoriesSettings.js +14 -18
- package/es/lib/RefdataCategoriesSettings/index.js +1 -1
- package/es/lib/ResponsiveButtonGroup/ResponsiveButtonGroup.js +22 -29
- package/es/lib/ResponsiveButtonGroup/index.js +1 -1
- package/es/lib/ResponsiveButtonGroup/useResponsiveButtonGroupSizing.js +6 -7
- package/es/lib/RichSelect/RichSelect.js +15 -20
- package/es/lib/RichSelect/index.js +1 -1
- package/es/lib/RichSelect/useSelectedOption.js +1 -2
- package/es/lib/SASQLookupComponent/SASQLookupComponent.js +15 -18
- package/es/lib/SASQLookupComponent/TableBody/TableBody.js +8 -10
- package/es/lib/SASQLookupComponent/TableBody/index.js +1 -1
- package/es/lib/SASQLookupComponent/index.js +1 -1
- package/es/lib/SASQRoute/SASQRoute.js +3 -3
- package/es/lib/SASQRoute/index.js +1 -1
- package/es/lib/SASQViewComponent/SASQViewComponent.js +6 -10
- package/es/lib/SASQViewComponent/index.js +1 -1
- package/es/lib/SearchField/SearchField.js +1 -1
- package/es/lib/SearchField/index.js +1 -1
- package/es/lib/SettingPage/SettingPage.js +1 -1
- package/es/lib/SettingPage/SettingPagePane.js +3 -3
- package/es/lib/SettingPage/index.js +1 -1
- package/es/lib/SettingsFormContainer/SettingsFormContainer.js +3 -3
- package/es/lib/SettingsFormContainer/index.js +1 -1
- package/es/lib/Typedown/Typedown.js +35 -33
- package/es/lib/Typedown/index.js +1 -1
- package/es/lib/contexts/index.js +1 -1
- package/es/lib/hooks/__mocks__/index.js +1 -1
- package/es/lib/hooks/index.js +1 -1
- package/es/lib/hooks/typedownHooks/index.js +1 -1
- package/es/lib/hooks/typedownHooks/useTypedown.js +3 -3
- package/es/lib/hooks/typedownHooks/useTypedownToggle.js +3 -3
- package/es/lib/hooks/useActionListRef.js +1 -1
- package/es/lib/hooks/useActiveElement.js +1 -1
- package/es/lib/hooks/useCustomProperties.js +3 -3
- package/es/lib/hooks/useHelperApp.js +7 -7
- package/es/lib/hooks/useIntlKey.js +1 -1
- package/es/lib/hooks/useIntlKeyStore.js +4 -7
- package/es/lib/hooks/useKintIntl.js +6 -12
- package/es/lib/hooks/useKiwtSASQuery.js +2 -2
- package/es/lib/hooks/useModConfigEntries.js +3 -3
- package/es/lib/hooks/useMutateCustomProperties.js +8 -8
- package/es/lib/hooks/useMutateModConfigEntry.js +2 -2
- package/es/lib/hooks/useMutateRefdataCategory.js +5 -5
- package/es/lib/hooks/useMutateRefdataValue.js +7 -7
- package/es/lib/hooks/useQIndex.js +6 -6
- package/es/lib/hooks/useRefdata.js +4 -4
- package/es/lib/hooks/useTemplates.js +5 -5
- package/es/lib/settingsHooks/index.js +1 -1
- package/es/lib/settingsHooks/useAppSettings.js +7 -11
- package/es/lib/settingsHooks/useSettingSection.js +2 -2
- package/es/lib/settingsHooks/useSettings.js +4 -4
- package/es/lib/utils/buildUrl.js +3 -4
- package/es/lib/utils/filterParsers/deparseKiwtQueryFilters.js +5 -5
- package/es/lib/utils/filterParsers/index.js +1 -1
- package/es/lib/utils/filterParsers/parseKiwtQueryFilters.js +3 -3
- package/es/lib/utils/filterParsers/parseKiwtQueryGroups.js +4 -5
- package/es/lib/utils/filterParsers/parseKiwtQueryGroups.test.js +1 -1
- package/es/lib/utils/filterParsers/parseKiwtQueryString.js +2 -2
- package/es/lib/utils/generateKiwtQuery.js +1 -1
- package/es/lib/utils/generateKiwtQueryParams.js +28 -37
- package/es/lib/utils/groupCustomPropertiesByCtx.js +2 -3
- package/es/lib/utils/highlightString.js +1 -1
- package/es/lib/utils/index.js +1 -1
- package/es/lib/utils/matchString.js +6 -8
- package/es/lib/utils/parseErrorResponse.js +2 -3
- package/es/lib/utils/selectorSafe.js +2 -3
- package/es/lib/utils/sortByLabel.js +2 -3
- package/es/lib/validators/validators.js +4 -4
- package/package.json +2 -4
- package/src/lib/SASQLookupComponent/TableBody/TableBody.js +1 -1
- package/src/lib/Typedown/Typedown.js +12 -5
- package/styles/TypeDown.css +6 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,17 @@
|
|
|
1
|
+
## [5.7.1](https://gitlab.com/knowledge-integration/folio/stripes-kint-components/compare/v5.7.0...v5.7.1) (2024-06-27)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Bug Fixes
|
|
5
|
+
|
|
6
|
+
* Add default MCLProps to TableBody to fix issue with SASQRoute (or below) not being passed mclProps ([30b2984](https://gitlab.com/knowledge-integration/folio/stripes-kint-components/commit/30b2984b8ad73bfd8a30107d400b4c87f07f72b5))
|
|
7
|
+
|
|
8
|
+
# [5.7.0](https://gitlab.com/knowledge-integration/folio/stripes-kint-components/compare/v5.6.1...v5.7.0) (2024-05-07)
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
### Features
|
|
12
|
+
|
|
13
|
+
* Typedown selected styling ([79c2eb3](https://gitlab.com/knowledge-integration/folio/stripes-kint-components/commit/79c2eb32c12bbf7d61db28d5f138946a7fa12ded))
|
|
14
|
+
|
|
1
15
|
## [5.6.1](https://gitlab.com/knowledge-integration/folio/stripes-kint-components/compare/v5.6.0...v5.6.1) (2024-04-16)
|
|
2
16
|
|
|
3
17
|
|
package/es/index.js
CHANGED
|
@@ -394,4 +394,4 @@ var _SettingsFormContainer = _interopRequireDefault(require("./lib/SettingsFormC
|
|
|
394
394
|
var _ComboButton = _interopRequireDefault(require("./lib/ComboButton"));
|
|
395
395
|
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
396
396
|
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
397
|
-
function _interopRequireDefault(
|
|
397
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
@@ -11,7 +11,7 @@ var _reactFinalFormArrays = require("react-final-form-arrays");
|
|
|
11
11
|
var _finalFormArrays = _interopRequireDefault(require("final-form-arrays"));
|
|
12
12
|
var _ActionListFieldArray = _interopRequireDefault(require("./ActionListFieldArray"));
|
|
13
13
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
14
|
-
function _interopRequireDefault(
|
|
14
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
15
15
|
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
16
16
|
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
17
17
|
const propTypes = {
|
|
@@ -13,7 +13,7 @@ var _components = require("@folio/stripes/components");
|
|
|
13
13
|
var _hooks = require("../hooks");
|
|
14
14
|
var _ActionListFieldArray = _interopRequireDefault(require("../../../styles/ActionListFieldArray.css"));
|
|
15
15
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
16
|
-
function _interopRequireDefault(
|
|
16
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
17
17
|
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
18
18
|
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
19
19
|
const EDITING_ACTIONS_WIDTH = 25;
|
|
@@ -43,7 +43,6 @@ const propTypes = {
|
|
|
43
43
|
|
|
44
44
|
// This needs to be outside of the main component for forwardRef to work properly it seems.
|
|
45
45
|
const ActionTrigger = /*#__PURE__*/(0, _react.forwardRef)((_ref, ref) => {
|
|
46
|
-
var _action$label;
|
|
47
46
|
let {
|
|
48
47
|
action,
|
|
49
48
|
...actionTriggerProps
|
|
@@ -59,7 +58,7 @@ const ActionTrigger = /*#__PURE__*/(0, _react.forwardRef)((_ref, ref) => {
|
|
|
59
58
|
ref: ref,
|
|
60
59
|
marginBottom0: true,
|
|
61
60
|
...actionTriggerProps,
|
|
62
|
-
children:
|
|
61
|
+
children: action.label ?? action.name
|
|
63
62
|
});
|
|
64
63
|
});
|
|
65
64
|
ActionTrigger.propTypes = {
|
|
@@ -71,7 +70,6 @@ ActionTrigger.propTypes = {
|
|
|
71
70
|
};
|
|
72
71
|
const NEW_ROW = 'NEW_ROW';
|
|
73
72
|
const ActionListFieldArray = /*#__PURE__*/(0, _react.forwardRef)((_ref2, ref) => {
|
|
74
|
-
var _fields$value$filter$, _fields$value;
|
|
75
73
|
let {
|
|
76
74
|
actionAssigner,
|
|
77
75
|
columnMapping,
|
|
@@ -110,7 +108,7 @@ const ActionListFieldArray = /*#__PURE__*/(0, _react.forwardRef)((_ref2, ref) =>
|
|
|
110
108
|
null for no field, string id if we are editing an existing field and
|
|
111
109
|
'NEW_ROW' for a new row
|
|
112
110
|
*/
|
|
113
|
-
const [editing, setEditing] = (0, _react.useState)((
|
|
111
|
+
const [editing, setEditing] = (0, _react.useState)((fields?.value?.filter(f => f._isNewActionListRow)?.length ?? 0) > 0 ? NEW_ROW : undefined);
|
|
114
112
|
const toggleEditing = (0, _react.useCallback)(id => {
|
|
115
113
|
if (editing) {
|
|
116
114
|
setEditing();
|
|
@@ -121,13 +119,11 @@ const ActionListFieldArray = /*#__PURE__*/(0, _react.forwardRef)((_ref2, ref) =>
|
|
|
121
119
|
|
|
122
120
|
// Ensure editing doesn't get stuck in "NEW_ROW" state;
|
|
123
121
|
(0, _react.useEffect)(() => {
|
|
124
|
-
|
|
125
|
-
if (editing === NEW_ROW && ((_fields$value$filter$2 = fields === null || fields === void 0 || (_fields$value2 = fields.value) === null || _fields$value2 === void 0 || (_fields$value2 = _fields$value2.filter(f => f._isNewActionListRow)) === null || _fields$value2 === void 0 ? void 0 : _fields$value2.length) !== null && _fields$value$filter$2 !== void 0 ? _fields$value$filter$2 : 0) === 0) {
|
|
122
|
+
if (editing === NEW_ROW && (fields?.value?.filter(f => f._isNewActionListRow)?.length ?? 0) === 0) {
|
|
126
123
|
setEditing();
|
|
127
124
|
}
|
|
128
|
-
}, [editing, fields
|
|
125
|
+
}, [editing, fields?.value]);
|
|
129
126
|
const handleSave = index => {
|
|
130
|
-
var _actionAssigner;
|
|
131
127
|
const {
|
|
132
128
|
actionListActions: _a,
|
|
133
129
|
fieldName: _fn,
|
|
@@ -137,7 +133,7 @@ const ActionListFieldArray = /*#__PURE__*/(0, _react.forwardRef)((_ref2, ref) =>
|
|
|
137
133
|
} = fields.value[index];
|
|
138
134
|
|
|
139
135
|
// Find "edit" entry in actionAssigner
|
|
140
|
-
const editCallback =
|
|
136
|
+
const editCallback = actionAssigner(rowData)?.find(act => act.name === 'edit')?.callback;
|
|
141
137
|
if (editCallback) {
|
|
142
138
|
editCallback(rowData);
|
|
143
139
|
}
|
|
@@ -173,14 +169,14 @@ const ActionListFieldArray = /*#__PURE__*/(0, _react.forwardRef)((_ref2, ref) =>
|
|
|
173
169
|
const widthsObject = {};
|
|
174
170
|
visibleFields.forEach(f => {
|
|
175
171
|
if (f !== 'actionListActions') {
|
|
176
|
-
widthsObject[f] =
|
|
172
|
+
widthsObject[f] = `${staticWidth}%`;
|
|
177
173
|
}
|
|
178
174
|
});
|
|
179
|
-
widthsObject.actionListActions = editing ?
|
|
175
|
+
widthsObject.actionListActions = editing ? `${EDITING_ACTIONS_WIDTH}%` : `${NON_EDITING_ACTIONS_WIDTH}%`;
|
|
180
176
|
return widthsObject;
|
|
181
177
|
};
|
|
182
178
|
const renderActionButtons = data => {
|
|
183
|
-
const fieldName =
|
|
179
|
+
const fieldName = `contentData[${data.rowIndex}]`;
|
|
184
180
|
const {
|
|
185
181
|
actionListActions: actions,
|
|
186
182
|
...rest
|
|
@@ -188,7 +184,7 @@ const ActionListFieldArray = /*#__PURE__*/(0, _react.forwardRef)((_ref2, ref) =>
|
|
|
188
184
|
if (data.id === editing || !data.id && editing === NEW_ROW) {
|
|
189
185
|
// Render the save/cancel buttons
|
|
190
186
|
return /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
191
|
-
id:
|
|
187
|
+
id: `action-button-parent-${data.rowIndex + 1}`,
|
|
192
188
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_components.Button, {
|
|
193
189
|
buttonStyle: "primary",
|
|
194
190
|
disabled: hasValidationErrors || submitting || pristine,
|
|
@@ -208,9 +204,9 @@ const ActionListFieldArray = /*#__PURE__*/(0, _react.forwardRef)((_ref2, ref) =>
|
|
|
208
204
|
type: "submit",
|
|
209
205
|
children: kintIntl.formatKintMessage({
|
|
210
206
|
id: 'save',
|
|
211
|
-
overrideValue: labelOverrides
|
|
207
|
+
overrideValue: labelOverrides?.save
|
|
212
208
|
})
|
|
213
|
-
},
|
|
209
|
+
}, `save[${data.rowIndex}]`), /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.Button, {
|
|
214
210
|
"data-type-button": "cancel",
|
|
215
211
|
marginBottom0: true,
|
|
216
212
|
onClick: () => {
|
|
@@ -224,14 +220,14 @@ const ActionListFieldArray = /*#__PURE__*/(0, _react.forwardRef)((_ref2, ref) =>
|
|
|
224
220
|
},
|
|
225
221
|
children: kintIntl.formatKintMessage({
|
|
226
222
|
id: 'cancel',
|
|
227
|
-
overrideValue: labelOverrides
|
|
223
|
+
overrideValue: labelOverrides?.cancel
|
|
228
224
|
})
|
|
229
|
-
},
|
|
225
|
+
}, `cancel[${data.rowIndex}]`)]
|
|
230
226
|
});
|
|
231
227
|
}
|
|
232
228
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
233
|
-
id:
|
|
234
|
-
children: actions
|
|
229
|
+
id: `action-button-parent-${data.rowIndex + 1}`,
|
|
230
|
+
children: actions?.map(action => {
|
|
235
231
|
let actionFunction;
|
|
236
232
|
if (action.callback) {
|
|
237
233
|
actionFunction = () => action.callback(rest);
|
|
@@ -241,25 +237,25 @@ const ActionListFieldArray = /*#__PURE__*/(0, _react.forwardRef)((_ref2, ref) =>
|
|
|
241
237
|
if (action.name === 'edit') {
|
|
242
238
|
actionFunction = () => toggleEditing(data.id);
|
|
243
239
|
}
|
|
244
|
-
let ariaLabel =
|
|
245
|
-
if (action
|
|
240
|
+
let ariaLabel = `action-${action.name}[${data.rowIndex}]`;
|
|
241
|
+
if (action?.ariaLabel) {
|
|
246
242
|
if (typeof action.ariaLabel === 'function') {
|
|
247
243
|
ariaLabel = action.ariaLabel(data);
|
|
248
244
|
} else if (typeof action.ariaLabel === 'string') {
|
|
249
245
|
ariaLabel = action.ariaLabel;
|
|
250
246
|
} else {
|
|
251
|
-
throw new Error(
|
|
247
|
+
throw new Error(`Provided ariaLabel for action "${action.name}" must be a function or a string.`);
|
|
252
248
|
}
|
|
253
249
|
}
|
|
254
250
|
let tooltip;
|
|
255
251
|
let tooltipSub;
|
|
256
|
-
if (action
|
|
252
|
+
if (action?.tooltip) {
|
|
257
253
|
if (typeof action.tooltip === 'function') {
|
|
258
254
|
tooltip = action.tooltip(data);
|
|
259
255
|
} else {
|
|
260
256
|
tooltip = action.tooltip;
|
|
261
257
|
}
|
|
262
|
-
if (action
|
|
258
|
+
if (action?.tooltipSub) {
|
|
263
259
|
if (typeof action.tooltipSub === 'function') {
|
|
264
260
|
tooltipSub = action.tooltipSub(data);
|
|
265
261
|
} else {
|
|
@@ -271,7 +267,7 @@ const ActionListFieldArray = /*#__PURE__*/(0, _react.forwardRef)((_ref2, ref) =>
|
|
|
271
267
|
// If a tooltip is declared, render that around the actionButton
|
|
272
268
|
if (tooltip) {
|
|
273
269
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.Tooltip, {
|
|
274
|
-
id:
|
|
270
|
+
id: `action-${action.name}[${data.rowIndex}]-tooltip`,
|
|
275
271
|
sub: tooltipSub,
|
|
276
272
|
text: tooltip,
|
|
277
273
|
children: _ref3 => {
|
|
@@ -293,7 +289,7 @@ const ActionListFieldArray = /*#__PURE__*/(0, _react.forwardRef)((_ref2, ref) =>
|
|
|
293
289
|
return null;
|
|
294
290
|
},
|
|
295
291
|
to: action.to
|
|
296
|
-
},
|
|
292
|
+
}, `action-${action.name}[${data.rowIndex}]`);
|
|
297
293
|
}
|
|
298
294
|
});
|
|
299
295
|
}
|
|
@@ -311,7 +307,7 @@ const ActionListFieldArray = /*#__PURE__*/(0, _react.forwardRef)((_ref2, ref) =>
|
|
|
311
307
|
return null;
|
|
312
308
|
},
|
|
313
309
|
to: action.to
|
|
314
|
-
},
|
|
310
|
+
}, `action-${action.name}[${data.rowIndex}]`);
|
|
315
311
|
})
|
|
316
312
|
});
|
|
317
313
|
};
|
|
@@ -343,17 +339,16 @@ const ActionListFieldArray = /*#__PURE__*/(0, _react.forwardRef)((_ref2, ref) =>
|
|
|
343
339
|
const editingRow = cd.id === editing || !cd.id;
|
|
344
340
|
|
|
345
341
|
// Default to the passed formatter values
|
|
346
|
-
let returnValue = formatter
|
|
342
|
+
let returnValue = formatter?.[key] ? formatter[key](cd) : cd[key];
|
|
347
343
|
|
|
348
344
|
// If editing, replace values with fields
|
|
349
345
|
if (editingRow) {
|
|
350
|
-
var _editableFields$key, _creatableFields$key;
|
|
351
346
|
/*
|
|
352
347
|
Check if the property is a visible field.
|
|
353
348
|
If it is not then we don't allow editing in this component.
|
|
354
349
|
*/
|
|
355
|
-
const editFunction =
|
|
356
|
-
const createFunction =
|
|
350
|
+
const editFunction = editableFields[key] ?? (() => true);
|
|
351
|
+
const createFunction = creatableFields[key] ?? (() => true);
|
|
357
352
|
/*
|
|
358
353
|
Next check if this is a new row, if so we should run the createableField function with the data.
|
|
359
354
|
If it is not a new row, then we run the editableField function with the data,
|
|
@@ -364,19 +359,19 @@ const ActionListFieldArray = /*#__PURE__*/(0, _react.forwardRef)((_ref2, ref) =>
|
|
|
364
359
|
if (!cd.id && createFunction(cd) || !!cd.id && editFunction(cd)) {
|
|
365
360
|
const passedObject = {
|
|
366
361
|
allValues: values,
|
|
367
|
-
index: cd
|
|
362
|
+
index: cd?.fieldIndex,
|
|
368
363
|
key,
|
|
369
|
-
name:
|
|
364
|
+
name: `${cd.fieldName}.${key}`,
|
|
370
365
|
rowFieldName: cd.fieldName
|
|
371
366
|
};
|
|
372
|
-
const validateFunction = validateFields
|
|
367
|
+
const validateFunction = validateFields?.[key] ? validateFields?.[key](passedObject) : null;
|
|
373
368
|
returnValue = fieldComponents[key] ? fieldComponents[key](passedObject) : /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactFinalForm.Field, {
|
|
374
369
|
ariaLabel: key // TODO at the moment the only way to override this is passing in an entire fieldComponent.
|
|
375
370
|
,
|
|
376
371
|
autoFocus: autoFocus,
|
|
377
372
|
component: _components.TextField,
|
|
378
373
|
marginBottom0: true,
|
|
379
|
-
name:
|
|
374
|
+
name: `${cd.fieldName}.${key}`,
|
|
380
375
|
parse: v => v,
|
|
381
376
|
validate: validateFunction
|
|
382
377
|
});
|
|
@@ -401,7 +396,7 @@ const ActionListFieldArray = /*#__PURE__*/(0, _react.forwardRef)((_ref2, ref) =>
|
|
|
401
396
|
onClick: handleClickCreate,
|
|
402
397
|
children: kintIntl.formatKintMessage({
|
|
403
398
|
id: 'new',
|
|
404
|
-
overrideValue: labelOverrides
|
|
399
|
+
overrideValue: labelOverrides?.new
|
|
405
400
|
})
|
|
406
401
|
})]
|
|
407
402
|
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.MultiColumnList, {
|
|
@@ -409,7 +404,7 @@ const ActionListFieldArray = /*#__PURE__*/(0, _react.forwardRef)((_ref2, ref) =>
|
|
|
409
404
|
...columnMapping,
|
|
410
405
|
actionListActions: kintIntl.formatKintMessage({
|
|
411
406
|
id: 'actions',
|
|
412
|
-
overrideValue: labelOverrides
|
|
407
|
+
overrideValue: labelOverrides?.actions
|
|
413
408
|
})
|
|
414
409
|
},
|
|
415
410
|
columnWidths: getColumnWidths(),
|
|
@@ -10,4 +10,4 @@ Object.defineProperty(exports, "default", {
|
|
|
10
10
|
}
|
|
11
11
|
});
|
|
12
12
|
var _ActionList = _interopRequireDefault(require("./ActionList"));
|
|
13
|
-
function _interopRequireDefault(
|
|
13
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
@@ -10,7 +10,7 @@ var _classnames = _interopRequireDefault(require("classnames"));
|
|
|
10
10
|
var _components = require("@folio/stripes/components");
|
|
11
11
|
var _ResponsiveButtonGroup = _interopRequireDefault(require("../../../styles/ResponsiveButtonGroup.css"));
|
|
12
12
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
13
|
-
function _interopRequireDefault(
|
|
13
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
14
14
|
// FIXME we should probably store the shared styles in a more aptly named file
|
|
15
15
|
|
|
16
16
|
/*
|
|
@@ -34,7 +34,7 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
|
|
|
34
34
|
const onToggle = (0, _react.useCallback)(() => setOpen(!open), [open, setOpen]);
|
|
35
35
|
|
|
36
36
|
// FIXME a lot of this is shared with ResponsiveButtonGroup
|
|
37
|
-
const styledDropdownButtons = (0, _react.useMemo)(() => dropdownButtons
|
|
37
|
+
const styledDropdownButtons = (0, _react.useMemo)(() => dropdownButtons?.map(button => {
|
|
38
38
|
return /*#__PURE__*/(0, _react.cloneElement)(button, {
|
|
39
39
|
buttonStyle: 'dropdownItem'
|
|
40
40
|
});
|
|
@@ -45,7 +45,6 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
|
|
|
45
45
|
children: [...styledDropdownButtons]
|
|
46
46
|
}), [styledDropdownButtons]);
|
|
47
47
|
const renderTrigger = (0, _react.useCallback)(_ref2 => {
|
|
48
|
-
var _buttonProps$buttonSt;
|
|
49
48
|
let {
|
|
50
49
|
onToggle: toggleFunc,
|
|
51
50
|
triggerRef,
|
|
@@ -58,11 +57,11 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
|
|
|
58
57
|
ref: triggerRef,
|
|
59
58
|
"aria-label": "menu",
|
|
60
59
|
buttonClass: (0, _classnames.default)(_ResponsiveButtonGroup.default.width100, _ResponsiveButtonGroup.default.dropdownButtonClass, {
|
|
61
|
-
[
|
|
60
|
+
[`${_ResponsiveButtonGroup.default.marginBottom}`]: !marginBottom0
|
|
62
61
|
}, {
|
|
63
|
-
[
|
|
62
|
+
[`${_ResponsiveButtonGroup.default.marginBottom0}`]: marginBottom0
|
|
64
63
|
}),
|
|
65
|
-
buttonStyle:
|
|
64
|
+
buttonStyle: buttonProps?.buttonStyle ?? 'default',
|
|
66
65
|
onClick: toggleFunc,
|
|
67
66
|
onKeyDown: keyHandler,
|
|
68
67
|
type: "button",
|
|
@@ -74,7 +73,7 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
|
|
|
74
73
|
iconPosition: "end"
|
|
75
74
|
})
|
|
76
75
|
});
|
|
77
|
-
}, [buttonProps
|
|
76
|
+
}, [buttonProps?.buttonStyle, triggerProps, marginBottom0]);
|
|
78
77
|
let comboTrigger;
|
|
79
78
|
if (dropdownButtons.length > 0) {
|
|
80
79
|
comboTrigger = /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.Dropdown, {
|
|
@@ -10,4 +10,4 @@ Object.defineProperty(exports, "default", {
|
|
|
10
10
|
}
|
|
11
11
|
});
|
|
12
12
|
var _ComboButton = _interopRequireDefault(require("./ComboButton"));
|
|
13
|
-
function _interopRequireDefault(
|
|
13
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
@@ -12,7 +12,7 @@ var _SearchField = _interopRequireDefault(require("../../SearchField"));
|
|
|
12
12
|
var _hooks = require("../../hooks");
|
|
13
13
|
var _CustomProperties = _interopRequireDefault(require("../../../../styles/CustomProperties.css"));
|
|
14
14
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
15
|
-
function _interopRequireDefault(
|
|
15
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
16
16
|
const CustomPropertiesLookup = _ref => {
|
|
17
17
|
let {
|
|
18
18
|
contextFilterOptions,
|
|
@@ -133,7 +133,7 @@ const CustomPropertiesLookup = _ref => {
|
|
|
133
133
|
contentData: custprops,
|
|
134
134
|
formatter: {
|
|
135
135
|
primary: data => {
|
|
136
|
-
if (data
|
|
136
|
+
if (data?.primary) {
|
|
137
137
|
return kintIntl.formatKintMessage({
|
|
138
138
|
id: 'yes',
|
|
139
139
|
overrideValue: labelOverrides.yes
|
|
@@ -146,13 +146,10 @@ const CustomPropertiesLookup = _ref => {
|
|
|
146
146
|
}
|
|
147
147
|
},
|
|
148
148
|
type: data => kintIntl.formatKintMessage({
|
|
149
|
-
id:
|
|
150
|
-
overrideValue: labelOverrides
|
|
149
|
+
id: `customProperties.type.${data?.type}`,
|
|
150
|
+
overrideValue: labelOverrides?.[data?.type]
|
|
151
151
|
}),
|
|
152
|
-
category: data =>
|
|
153
|
-
var _data$category;
|
|
154
|
-
return data === null || data === void 0 || (_data$category = data.category) === null || _data$category === void 0 ? void 0 : _data$category.desc;
|
|
155
|
-
}
|
|
152
|
+
category: data => data?.category?.desc
|
|
156
153
|
},
|
|
157
154
|
onRowClick: onSelectCustomProperty,
|
|
158
155
|
visibleColumns: ['label', 'primary', 'ctx', 'weight', 'type', 'category'],
|
|
@@ -5,7 +5,7 @@ var _reactRouterDom = require("react-router-dom");
|
|
|
5
5
|
var _CustomPropertiesLookup = _interopRequireDefault(require("./CustomPropertiesLookup"));
|
|
6
6
|
var _renderWithKintHarness = _interopRequireDefault(require("../../../../test/jest/helpers/renderWithKintHarness"));
|
|
7
7
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
8
|
-
function _interopRequireDefault(
|
|
8
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
9
9
|
jest.mock('../../hooks');
|
|
10
10
|
jest.mock('../../SearchField', () => () => /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
11
11
|
children: "SearchField"
|
|
@@ -17,14 +17,13 @@ var _CustomPropertyForm = _interopRequireDefault(require("./CustomPropertyForm")
|
|
|
17
17
|
var _hooks = require("../../hooks");
|
|
18
18
|
var _utils = require("../../utils");
|
|
19
19
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
20
|
-
function _interopRequireDefault(
|
|
20
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
21
21
|
const EDITING = 'edit';
|
|
22
22
|
const CREATING = 'create';
|
|
23
23
|
const VIEWING = 'view';
|
|
24
24
|
|
|
25
25
|
// A default option for setting up panes manually
|
|
26
26
|
const CustomPropertiesSettings = _ref => {
|
|
27
|
-
var _customProperty$label, _customProperty$label2, _customProperty$categ, _customProperty$label3, _customProperty$label4;
|
|
28
27
|
let {
|
|
29
28
|
afterQueryCalls,
|
|
30
29
|
catchQueryCalls,
|
|
@@ -69,7 +68,7 @@ const CustomPropertiesSettings = _ref => {
|
|
|
69
68
|
// empty string is all custoprop contexts
|
|
70
69
|
label: kintIntl.formatKintMessage({
|
|
71
70
|
id: 'customProperties.config.all',
|
|
72
|
-
overrideValue: labelOverrides
|
|
71
|
+
overrideValue: labelOverrides?.all
|
|
73
72
|
})
|
|
74
73
|
}];
|
|
75
74
|
}
|
|
@@ -83,7 +82,7 @@ const CustomPropertiesSettings = _ref => {
|
|
|
83
82
|
setMode(VIEWING);
|
|
84
83
|
queryClient.invalidateQueries(['stripes-kint-components', 'useCustomProperties', 'custprops']);
|
|
85
84
|
setCustomProperty(res);
|
|
86
|
-
if (afterQueryCalls
|
|
85
|
+
if (afterQueryCalls?.put) {
|
|
87
86
|
afterQueryCalls.put(res);
|
|
88
87
|
}
|
|
89
88
|
},
|
|
@@ -91,7 +90,7 @@ const CustomPropertiesSettings = _ref => {
|
|
|
91
90
|
setMode(VIEWING);
|
|
92
91
|
queryClient.invalidateQueries(['stripes-kint-components', 'useCustomProperties', 'custprops']);
|
|
93
92
|
setCustomProperty(res);
|
|
94
|
-
if (afterQueryCalls
|
|
93
|
+
if (afterQueryCalls?.post) {
|
|
95
94
|
afterQueryCalls.post(res);
|
|
96
95
|
}
|
|
97
96
|
},
|
|
@@ -99,7 +98,7 @@ const CustomPropertiesSettings = _ref => {
|
|
|
99
98
|
setMode(VIEWING);
|
|
100
99
|
queryClient.invalidateQueries(['stripes-kint-components', 'useCustomProperties', 'custprops']);
|
|
101
100
|
setCustomProperty();
|
|
102
|
-
if (afterQueryCalls
|
|
101
|
+
if (afterQueryCalls?.delete) {
|
|
103
102
|
afterQueryCalls.delete(res);
|
|
104
103
|
}
|
|
105
104
|
}
|
|
@@ -112,10 +111,10 @@ const CustomPropertiesSettings = _ref => {
|
|
|
112
111
|
callout.sendCallout({
|
|
113
112
|
message: kintIntl.formatKintMessage({
|
|
114
113
|
id: 'customProperties.config.delete.errorMessage',
|
|
115
|
-
overrideValue: labelOverrides
|
|
114
|
+
overrideValue: labelOverrides?.deleteError
|
|
116
115
|
}, {
|
|
117
|
-
error: errorResp
|
|
118
|
-
label: customProperty
|
|
116
|
+
error: errorResp?.message,
|
|
117
|
+
label: customProperty?.label
|
|
119
118
|
}),
|
|
120
119
|
type: 'error'
|
|
121
120
|
});
|
|
@@ -123,22 +122,20 @@ const CustomPropertiesSettings = _ref => {
|
|
|
123
122
|
...catchQueryCalls // Override defaults here
|
|
124
123
|
},
|
|
125
124
|
endpoint: customPropertiesEndpoint,
|
|
126
|
-
id: customProperty
|
|
125
|
+
id: customProperty?.id
|
|
127
126
|
});
|
|
128
127
|
const handeContextSubmit = submitData => {
|
|
129
|
-
var _submitData$ctx$0$val, _submitData$ctx;
|
|
130
128
|
return {
|
|
131
129
|
...submitData,
|
|
132
|
-
ctx:
|
|
130
|
+
ctx: submitData?.ctx?.[0]?.value ?? ''
|
|
133
131
|
};
|
|
134
132
|
};
|
|
135
133
|
|
|
136
134
|
// When POSTing a custom property, the backend expects a shorthand "Integer" or "LocalDate"
|
|
137
135
|
// When PUTing a custom property, the backend needs the full class name
|
|
138
136
|
const handleType = submitData => {
|
|
139
|
-
var _typeRegex$exec;
|
|
140
137
|
const typeRegex = /(com\.k_int\.web\.toolkit\.custprops\.types\.CustomProperty)(.*)/g;
|
|
141
|
-
const typeMatch =
|
|
138
|
+
const typeMatch = typeRegex.exec(submitData?.type) ?? [];
|
|
142
139
|
return {
|
|
143
140
|
...submitData,
|
|
144
141
|
type: typeMatch[2]
|
|
@@ -155,7 +152,7 @@ const CustomPropertiesSettings = _ref => {
|
|
|
155
152
|
,
|
|
156
153
|
children: kintIntl.formatKintMessage({
|
|
157
154
|
id: 'new',
|
|
158
|
-
overrideValue: labelOverrides
|
|
155
|
+
overrideValue: labelOverrides?.new
|
|
159
156
|
})
|
|
160
157
|
}),
|
|
161
158
|
paneTitle: kintIntl.formatKintMessage({
|
|
@@ -185,10 +182,10 @@ const CustomPropertiesSettings = _ref => {
|
|
|
185
182
|
icon: "edit",
|
|
186
183
|
children: kintIntl.formatKintMessage({
|
|
187
184
|
id: 'edit',
|
|
188
|
-
overrideValue: labelOverrides
|
|
185
|
+
overrideValue: labelOverrides?.edit
|
|
189
186
|
})
|
|
190
187
|
})
|
|
191
|
-
},
|
|
188
|
+
}, `${customProperty.name}-action-edit`));
|
|
192
189
|
}
|
|
193
190
|
if (deleteCondition) {
|
|
194
191
|
actionsArray.push( /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.Button, {
|
|
@@ -202,12 +199,12 @@ const CustomPropertiesSettings = _ref => {
|
|
|
202
199
|
icon: "trash",
|
|
203
200
|
children: kintIntl.formatKintMessage({
|
|
204
201
|
id: 'delete',
|
|
205
|
-
overrideValue: labelOverrides
|
|
202
|
+
overrideValue: labelOverrides?.delete
|
|
206
203
|
})
|
|
207
204
|
})
|
|
208
|
-
},
|
|
205
|
+
}, `${customProperty.name}-action-delete`));
|
|
209
206
|
}
|
|
210
|
-
return actionsArray
|
|
207
|
+
return actionsArray?.length ? actionsArray : null;
|
|
211
208
|
},
|
|
212
209
|
defaultWidth: "fill",
|
|
213
210
|
dismissible: true,
|
|
@@ -215,10 +212,10 @@ const CustomPropertiesSettings = _ref => {
|
|
|
215
212
|
onClose: () => setCustomProperty(),
|
|
216
213
|
paneTitle: kintIntl.formatKintMessage({
|
|
217
214
|
id: 'customProperties.config.viewPaneTitle',
|
|
218
|
-
overrideValue: labelOverrides
|
|
219
|
-
fallbackMessage:
|
|
215
|
+
overrideValue: labelOverrides?.viewPaneTitle,
|
|
216
|
+
fallbackMessage: customProperty?.label ?? customProperty?.name
|
|
220
217
|
}, {
|
|
221
|
-
name:
|
|
218
|
+
name: customProperty?.label ?? customProperty?.name
|
|
222
219
|
}),
|
|
223
220
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_CustomPropertyView.default, {
|
|
224
221
|
customProperty: customProperty,
|
|
@@ -235,22 +232,22 @@ const CustomPropertiesSettings = _ref => {
|
|
|
235
232
|
defaultInternal: true
|
|
236
233
|
} : {
|
|
237
234
|
...customProperty,
|
|
238
|
-
ctx: customProperty
|
|
235
|
+
ctx: customProperty?.ctx ? [{
|
|
239
236
|
value: customProperty.ctx,
|
|
240
237
|
label: customProperty.ctx
|
|
241
238
|
}] : null,
|
|
242
|
-
category: customProperty
|
|
239
|
+
category: customProperty?.category ? customProperty?.category?.id : null
|
|
243
240
|
},
|
|
244
241
|
modalProps: {
|
|
245
242
|
dismissible: true,
|
|
246
243
|
label: mode === CREATING ? kintIntl.formatKintMessage({
|
|
247
244
|
id: 'customProperties.config.newModal',
|
|
248
|
-
overrideValue: labelOverrides
|
|
245
|
+
overrideValue: labelOverrides?.newModalTitle
|
|
249
246
|
}) : kintIntl.formatKintMessage({
|
|
250
247
|
id: 'customProperties.config.editModal',
|
|
251
|
-
overrideValue: labelOverrides
|
|
248
|
+
overrideValue: labelOverrides?.editModalTitle
|
|
252
249
|
}, {
|
|
253
|
-
name:
|
|
250
|
+
name: customProperty?.label ?? customProperty?.name
|
|
254
251
|
}),
|
|
255
252
|
onClose: () => setMode(VIEWING),
|
|
256
253
|
open: mode === CREATING || mode === EDITING
|
|
@@ -271,22 +268,22 @@ const CustomPropertiesSettings = _ref => {
|
|
|
271
268
|
buttonStyle: "danger",
|
|
272
269
|
confirmLabel: kintIntl.formatKintMessage({
|
|
273
270
|
id: 'delete',
|
|
274
|
-
overrideValue: labelOverrides
|
|
271
|
+
overrideValue: labelOverrides?.delete
|
|
275
272
|
}),
|
|
276
273
|
heading: kintIntl.formatKintMessage({
|
|
277
274
|
id: 'customProperties.config.delete.confirmHeading',
|
|
278
|
-
overrideValue: labelOverrides
|
|
275
|
+
overrideValue: labelOverrides?.confirmHeading
|
|
279
276
|
}),
|
|
280
277
|
id: "delete-custprop-confirmation",
|
|
281
278
|
message: kintIntl.formatKintMessage({
|
|
282
279
|
id: 'customProperties.config.delete.confirmMessage',
|
|
283
|
-
overrideValue: labelOverrides
|
|
280
|
+
overrideValue: labelOverrides?.confirmMessage
|
|
284
281
|
}, {
|
|
285
|
-
name:
|
|
282
|
+
name: customProperty?.label ?? customProperty?.name
|
|
286
283
|
}),
|
|
287
284
|
onCancel: () => setDeleteModal(false),
|
|
288
285
|
onConfirm: () => {
|
|
289
|
-
deleteCustProp(customProperty
|
|
286
|
+
deleteCustProp(customProperty?.id);
|
|
290
287
|
setCustomProperty();
|
|
291
288
|
setDeleteModal(false);
|
|
292
289
|
},
|
|
@@ -6,7 +6,7 @@ var _reactRouterDom = require("react-router-dom");
|
|
|
6
6
|
var _CustomPropertiesSettings = _interopRequireDefault(require("./CustomPropertiesSettings"));
|
|
7
7
|
var _jest = require("../../../../test/jest");
|
|
8
8
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
9
|
-
function _interopRequireDefault(
|
|
9
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
10
10
|
jest.mock('../../hooks');
|
|
11
11
|
jest.mock('../../FormModal/FormModal', () => () => /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
12
12
|
children: "FormModal"
|