@k-int/stripes-kint-components 5.3.0 → 5.3.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 +7 -0
- package/es/lib/ActionList/ActionListFieldArray.js +37 -32
- package/es/lib/ComboButton/ComboButton.js +6 -5
- package/es/lib/CustomProperties/Config/CustomPropertiesLookup.js +7 -4
- package/es/lib/CustomProperties/Config/CustomPropertiesSettings.js +32 -29
- package/es/lib/CustomProperties/Config/CustomPropertyForm.js +58 -58
- package/es/lib/CustomProperties/Config/CustomPropertyForm.test.js +2 -2
- package/es/lib/CustomProperties/Config/CustomPropertyView.js +33 -32
- package/es/lib/CustomProperties/Config/CustomPropertyView.test.js +1 -1
- package/es/lib/CustomProperties/Edit/CustomPropertiesEdit.js +1 -1
- package/es/lib/CustomProperties/Edit/CustomPropertiesEditCtx.js +3 -3
- package/es/lib/CustomProperties/Edit/CustomPropertiesListField.js +10 -5
- package/es/lib/CustomProperties/Edit/CustomPropertyField.js +25 -18
- package/es/lib/CustomProperties/Edit/CustomPropertyField.test.js +5 -5
- package/es/lib/CustomProperties/Edit/CustomPropertyFormCard.js +2 -2
- package/es/lib/CustomProperties/Edit/CustomPropertyFormCard.test.js +1 -1
- package/es/lib/CustomProperties/Edit/testResources.js +12 -11
- package/es/lib/CustomProperties/Filter/CustomPropertiesFilter.js +11 -6
- package/es/lib/CustomProperties/Filter/CustomPropertiesFilterField.js +28 -20
- package/es/lib/CustomProperties/Filter/CustomPropertiesFilterField.test.js +1 -1
- package/es/lib/CustomProperties/Filter/CustomPropertiesFilterFieldArray.js +6 -6
- package/es/lib/CustomProperties/Filter/CustomPropertiesRule.js +8 -8
- package/es/lib/CustomProperties/Filter/testResources.js +2 -1
- package/es/lib/CustomProperties/Filter/useParseActiveFilterStrings.js +2 -1
- package/es/lib/CustomProperties/View/CustomPropertiesView.js +1 -1
- package/es/lib/CustomProperties/View/CustomPropertiesViewCtx.js +26 -18
- package/es/lib/CustomProperties/View/CustomPropertyCard.js +11 -7
- package/es/lib/CycleButton/CycleButton.js +1 -1
- package/es/lib/EditableRefdataCategoryList/EditableRefdataCategoryList.js +38 -26
- package/es/lib/EditableRefdataList/EditableRefdataList.js +33 -26
- package/es/lib/EditableSettingsList/EditableSettingsListFieldArray.js +1 -1
- package/es/lib/EditableSettingsList/SettingField/EditSettingValue.js +5 -5
- package/es/lib/EditableSettingsList/SettingField/RenderSettingValue.js +12 -10
- package/es/lib/EditableSettingsList/SettingField/SettingField.js +4 -4
- package/es/lib/FormattedKintMessage/FormattedKintMessage.js +7 -4
- package/es/lib/IconSelect/IconSelect.js +9 -5
- package/es/lib/NoResultsMessage/NoResultsMessage.js +4 -4
- package/es/lib/RefdataButtons/RefdataButtons.js +3 -3
- package/es/lib/RefdataCategoriesSettings/RefdataCategoriesSettings.js +17 -13
- package/es/lib/ResponsiveButtonGroup/ResponsiveButtonGroup.js +28 -21
- package/es/lib/ResponsiveButtonGroup/useResponsiveButtonGroupSizing.js +6 -5
- package/es/lib/RichSelect/RichSelect.js +19 -14
- package/es/lib/RichSelect/useSelectedOption.js +2 -1
- package/es/lib/SASQLookupComponent/SASQLookupComponent.js +17 -14
- package/es/lib/SASQLookupComponent/TableBody/TableBody.js +6 -4
- package/es/lib/SASQRoute/SASQRoute.js +2 -2
- package/es/lib/SASQViewComponent/SASQViewComponent.js +9 -5
- package/es/lib/SettingPage/SettingPagePane.js +2 -2
- package/es/lib/SettingsFormContainer/SettingsFormContainer.js +2 -2
- package/es/lib/Typedown/Typedown.js +26 -19
- package/es/lib/hooks/typedownHooks/useTypedown.js +2 -2
- package/es/lib/hooks/typedownHooks/useTypedownToggle.js +2 -2
- package/es/lib/hooks/useActionListRef.js +1 -1
- package/es/lib/hooks/useActiveElement.js +1 -1
- package/es/lib/hooks/useCustomProperties.js +2 -2
- package/es/lib/hooks/useHelperApp.js +6 -6
- package/es/lib/hooks/useIntlKeyStore.js +7 -4
- package/es/lib/hooks/useKintIntl.js +11 -5
- package/es/lib/hooks/useKiwtSASQuery.js +1 -1
- package/es/lib/hooks/useModConfigEntries.js +2 -2
- package/es/lib/hooks/useMutateCustomProperties.js +8 -8
- package/es/lib/hooks/useMutateModConfigEntry.js +2 -2
- package/es/lib/hooks/useMutateRefdataCategory.js +4 -4
- package/es/lib/hooks/useMutateRefdataValue.js +6 -6
- package/es/lib/hooks/useQIndex.js +17 -9
- package/es/lib/hooks/useRefdata.js +3 -3
- package/es/lib/hooks/useTemplates.js +4 -4
- package/es/lib/settingsHooks/useAppSettings.js +11 -7
- package/es/lib/settingsHooks/useSettingSection.js +2 -2
- package/es/lib/settingsHooks/useSettings.js +3 -3
- package/es/lib/utils/buildUrl.js +3 -2
- package/es/lib/utils/filterParsers/deparseKiwtQueryFilters.js +5 -5
- package/es/lib/utils/filterParsers/parseKiwtQueryFilters.js +2 -2
- package/es/lib/utils/filterParsers/parseKiwtQueryGroups.js +5 -4
- package/es/lib/utils/filterParsers/parseKiwtQueryString.js +1 -1
- package/es/lib/utils/generateKiwtQueryParams.js +37 -28
- package/es/lib/utils/groupCustomPropertiesByCtx.js +3 -2
- package/es/lib/utils/matchString.js +1 -1
- package/es/lib/utils/parseErrorResponse.js +3 -2
- package/es/lib/utils/selectorSafe.js +3 -2
- package/es/lib/utils/sortByLabel.js +3 -2
- package/es/lib/validators/validators.js +3 -3
- package/package.json +1 -1
- package/src/lib/hooks/useQIndex.js +12 -4
|
@@ -11,6 +11,7 @@ var _CustomPropertyCard = _interopRequireDefault(require("./CustomPropertyCard")
|
|
|
11
11
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
12
12
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
13
13
|
const CustomPropertiesViewCtx = _ref => {
|
|
14
|
+
var _custprops$filter$len, _custprops$filter;
|
|
14
15
|
let {
|
|
15
16
|
ctx,
|
|
16
17
|
customProperties = [],
|
|
@@ -35,7 +36,7 @@ const CustomPropertiesViewCtx = _ref => {
|
|
|
35
36
|
// Chain formatKintMessages together using provided fallbackMessage to
|
|
36
37
|
// allow for "If override or translation exists, use it, else use default"
|
|
37
38
|
return kintIntl.formatKintMessage({
|
|
38
|
-
id:
|
|
39
|
+
id: "customProperties.ctx.".concat(ctx),
|
|
39
40
|
overrideValue: labelOverrides[ctx],
|
|
40
41
|
fallbackMessage: kintIntl.formatKintMessage({
|
|
41
42
|
id: 'customProperties.defaultTitle',
|
|
@@ -79,21 +80,25 @@ const CustomPropertiesViewCtx = _ref => {
|
|
|
79
80
|
closedByDefault: true,
|
|
80
81
|
displayWhenClosed: /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.Spinner, {}),
|
|
81
82
|
displayWhenOpen: /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.Spinner, {}),
|
|
82
|
-
id:
|
|
83
|
+
id: "".concat(id, "-accordion-").concat(ctx),
|
|
83
84
|
label: getAccordionLabel(),
|
|
84
85
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.Spinner, {})
|
|
85
86
|
});
|
|
86
87
|
}
|
|
87
|
-
const countSetProperties = primary =>
|
|
88
|
-
|
|
89
|
-
return (
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
88
|
+
const countSetProperties = primary => {
|
|
89
|
+
var _Object$entries$filte, _Object$entries;
|
|
90
|
+
return (_Object$entries$filte = (_Object$entries = Object.entries(customProperties)) === null || _Object$entries === void 0 || (_Object$entries = _Object$entries.filter(_ref2 => {
|
|
91
|
+
var _cp$, _cp$2, _cp$3;
|
|
92
|
+
let [_key, cp] = _ref2;
|
|
93
|
+
return (((_cp$ = cp[0]) === null || _cp$ === void 0 || (_cp$ = _cp$.type) === null || _cp$ === void 0 ? void 0 : _cp$.ctx) === ctx || ctx === 'isNull' && !((_cp$2 = cp[0]) !== null && _cp$2 !== void 0 && (_cp$2 = _cp$2.type) !== null && _cp$2 !== void 0 && _cp$2.ctx)) &&
|
|
94
|
+
// Either the ctx string matches, or isNull matches blank
|
|
95
|
+
((_cp$3 = cp[0]) === null || _cp$3 === void 0 || (_cp$3 = _cp$3.type) === null || _cp$3 === void 0 ? void 0 : _cp$3.primary) === primary // Only count non-primary set custprops
|
|
96
|
+
;
|
|
97
|
+
})) === null || _Object$entries === void 0 ? void 0 : _Object$entries.length) !== null && _Object$entries$filte !== void 0 ? _Object$entries$filte : 0;
|
|
98
|
+
};
|
|
94
99
|
|
|
95
100
|
// We need to display any set properties, along with any non-set primary properties
|
|
96
|
-
const primaryCount = custprops
|
|
101
|
+
const primaryCount = (_custprops$filter$len = custprops === null || custprops === void 0 || (_custprops$filter = custprops.filter(cp => cp.primary === true)) === null || _custprops$filter === void 0 ? void 0 : _custprops$filter.length) !== null && _custprops$filter$len !== void 0 ? _custprops$filter$len : 0;
|
|
97
102
|
const optionalCount = countSetProperties(false);
|
|
98
103
|
const setPrimaryCount = countSetProperties(true);
|
|
99
104
|
return primaryCount + optionalCount > 0 && /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.Accordion, {
|
|
@@ -104,15 +109,18 @@ const CustomPropertiesViewCtx = _ref => {
|
|
|
104
109
|
displayWhenOpen: /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.Badge, {
|
|
105
110
|
children: setPrimaryCount + optionalCount
|
|
106
111
|
}),
|
|
107
|
-
id:
|
|
112
|
+
id: "".concat(id, "-accordion-").concat(ctx),
|
|
108
113
|
label: getAccordionLabel(),
|
|
109
|
-
children: custprops.map((cp, index) =>
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
114
|
+
children: custprops.map((cp, index) => {
|
|
115
|
+
var _customProperties$cp$;
|
|
116
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_CustomPropertyCard.default, {
|
|
117
|
+
ctx: ctx,
|
|
118
|
+
customProperty: customProperties === null || customProperties === void 0 || (_customProperties$cp$ = customProperties[cp.name]) === null || _customProperties$cp$ === void 0 ? void 0 : _customProperties$cp$[0],
|
|
119
|
+
customPropertyDefinition: cp,
|
|
120
|
+
index: index,
|
|
121
|
+
labelOverrides: labelOverrides
|
|
122
|
+
}, "custom-property-card-".concat(ctx, "[").concat(index, "]"));
|
|
123
|
+
})
|
|
116
124
|
});
|
|
117
125
|
};
|
|
118
126
|
CustomPropertiesViewCtx.propTypes = {
|
|
@@ -30,8 +30,9 @@ const CustomPropertyCard = _ref => {
|
|
|
30
30
|
if (!toDisplay) {
|
|
31
31
|
return null;
|
|
32
32
|
}
|
|
33
|
-
const internalFalse = customProperty
|
|
33
|
+
const internalFalse = (customProperty === null || customProperty === void 0 ? void 0 : customProperty.internal) === false || (customProperty === null || customProperty === void 0 ? void 0 : customProperty.internal) === undefined && customPropertyDefinition.defaultInternal === false;
|
|
34
34
|
const renderValue = () => {
|
|
35
|
+
var _customProperty$value, _customProperty$value2, _customProperty$value3, _customProperty$value4;
|
|
35
36
|
if (!customProperty) {
|
|
36
37
|
return kintIntl.formatKintMessage({
|
|
37
38
|
id: 'notSet',
|
|
@@ -41,11 +42,14 @@ const CustomPropertyCard = _ref => {
|
|
|
41
42
|
switch (customPropertyDefinition.type) {
|
|
42
43
|
case CUSTPROP_TYPES.MULTI_REFDATA_CLASS_NAME:
|
|
43
44
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.List, {
|
|
44
|
-
items: customProperty.value
|
|
45
|
+
items: (_customProperty$value = customProperty.value) === null || _customProperty$value === void 0 ? void 0 : _customProperty$value.map(item => {
|
|
46
|
+
var _item$label;
|
|
47
|
+
return (_item$label = item === null || item === void 0 ? void 0 : item.label) !== null && _item$label !== void 0 ? _item$label : item === null || item === void 0 ? void 0 : item.value;
|
|
48
|
+
}),
|
|
45
49
|
listStyle: "bullets"
|
|
46
50
|
});
|
|
47
51
|
case CUSTPROP_TYPES.REFDATA_CLASS_NAME:
|
|
48
|
-
return customProperty.value
|
|
52
|
+
return (_customProperty$value2 = (_customProperty$value3 = customProperty.value) === null || _customProperty$value3 === void 0 ? void 0 : _customProperty$value3.label) !== null && _customProperty$value2 !== void 0 ? _customProperty$value2 : (_customProperty$value4 = customProperty.value) === null || _customProperty$value4 === void 0 ? void 0 : _customProperty$value4.value;
|
|
49
53
|
case CUSTPROP_TYPES.DECIMAL_CLASS_NAME:
|
|
50
54
|
case CUSTPROP_TYPES.INTEGER_CLASS_NAME:
|
|
51
55
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactIntl.FormattedNumber, {
|
|
@@ -73,7 +77,7 @@ const CustomPropertyCard = _ref => {
|
|
|
73
77
|
content: customPropertyDefinition.description
|
|
74
78
|
}) : null]
|
|
75
79
|
}),
|
|
76
|
-
id:
|
|
80
|
+
id: "customproperty-card-".concat(index),
|
|
77
81
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)(_components.Row, {
|
|
78
82
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_components.Col, {
|
|
79
83
|
xs: 6,
|
|
@@ -84,7 +88,7 @@ const CustomPropertyCard = _ref => {
|
|
|
84
88
|
}),
|
|
85
89
|
children: renderValue()
|
|
86
90
|
})
|
|
87
|
-
}), customProperty
|
|
91
|
+
}), customProperty !== null && customProperty !== void 0 && customProperty.note ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.Col, {
|
|
88
92
|
xs: 6,
|
|
89
93
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.KeyValue, {
|
|
90
94
|
label: kintIntl.formatKintMessage({
|
|
@@ -119,7 +123,7 @@ const CustomPropertyCard = _ref => {
|
|
|
119
123
|
id: 'customProperties.publicNote',
|
|
120
124
|
overrideValue: labelOverrides.publicNote
|
|
121
125
|
}),
|
|
122
|
-
children: customProperty
|
|
126
|
+
children: customProperty !== null && customProperty !== void 0 && customProperty.publicNote ? /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
|
|
123
127
|
style: {
|
|
124
128
|
whiteSpace: 'pre-wrap'
|
|
125
129
|
},
|
|
@@ -128,7 +132,7 @@ const CustomPropertyCard = _ref => {
|
|
|
128
132
|
})
|
|
129
133
|
})]
|
|
130
134
|
})]
|
|
131
|
-
},
|
|
135
|
+
}, "customPropertyCard-".concat(ctx, "[").concat(index, "]"));
|
|
132
136
|
};
|
|
133
137
|
CustomPropertyCard.propTypes = {
|
|
134
138
|
ctx: _propTypes.default.string,
|
|
@@ -35,6 +35,7 @@ const propTypes = {
|
|
|
35
35
|
refdataEndpoint: _propTypes.default.string
|
|
36
36
|
};
|
|
37
37
|
const EditableRefdataCategoryList = /*#__PURE__*/(0, _react.forwardRef)((_ref, ref) => {
|
|
38
|
+
var _deleteModal$refdata2;
|
|
38
39
|
let {
|
|
39
40
|
afterQueryCalls,
|
|
40
41
|
catchQueryCalls,
|
|
@@ -88,10 +89,12 @@ const EditableRefdataCategoryList = /*#__PURE__*/(0, _react.forwardRef)((_ref, r
|
|
|
88
89
|
(0, _react.useEffect)(() => {
|
|
89
90
|
if (!isRefdataLoading) {
|
|
90
91
|
if (searchTerm) {
|
|
91
|
-
|
|
92
|
-
|
|
92
|
+
var _filteredRefdata$sort;
|
|
93
|
+
const filteredRefdata = refdata === null || refdata === void 0 ? void 0 : refdata.filter(rd => rd.desc.toLowerCase().includes(searchTerm.toLowerCase()));
|
|
94
|
+
setContentData((_filteredRefdata$sort = filteredRefdata === null || filteredRefdata === void 0 ? void 0 : filteredRefdata.sort(sortByDesc)) !== null && _filteredRefdata$sort !== void 0 ? _filteredRefdata$sort : []);
|
|
93
95
|
} else {
|
|
94
|
-
|
|
96
|
+
var _refdata$sort;
|
|
97
|
+
setContentData((_refdata$sort = refdata === null || refdata === void 0 ? void 0 : refdata.sort(sortByDesc)) !== null && _refdata$sort !== void 0 ? _refdata$sort : []);
|
|
95
98
|
}
|
|
96
99
|
}
|
|
97
100
|
}, [isRefdataLoading, refdata, searchTerm]);
|
|
@@ -103,12 +106,12 @@ const EditableRefdataCategoryList = /*#__PURE__*/(0, _react.forwardRef)((_ref, r
|
|
|
103
106
|
} = (0, _hooks.useMutateRefdataCategory)({
|
|
104
107
|
afterQueryCalls: {
|
|
105
108
|
delete: json => {
|
|
106
|
-
if (afterQueryCalls
|
|
109
|
+
if (afterQueryCalls !== null && afterQueryCalls !== void 0 && afterQueryCalls.delete) {
|
|
107
110
|
afterQueryCalls.delete(json);
|
|
108
111
|
}
|
|
109
112
|
},
|
|
110
113
|
post: json => {
|
|
111
|
-
if (afterQueryCalls
|
|
114
|
+
if (afterQueryCalls !== null && afterQueryCalls !== void 0 && afterQueryCalls.post) {
|
|
112
115
|
afterQueryCalls.post(json);
|
|
113
116
|
}
|
|
114
117
|
}
|
|
@@ -117,14 +120,15 @@ const EditableRefdataCategoryList = /*#__PURE__*/(0, _react.forwardRef)((_ref, r
|
|
|
117
120
|
// Default delete behaviour is to fire a callout, either with kint-components default message
|
|
118
121
|
// or one provided in labelOverrides, which is passed the error message and refdata in question
|
|
119
122
|
delete: async err => {
|
|
123
|
+
var _deleteModal$refdata;
|
|
120
124
|
const errorResp = await (0, _utils.parseErrorResponse)(err.response);
|
|
121
125
|
callout.sendCallout({
|
|
122
126
|
message: kintIntl.formatKintMessage({
|
|
123
127
|
id: 'refdataCategory.deleteRefdataCategory.errorMessage',
|
|
124
|
-
overrideValue: labelOverrides
|
|
128
|
+
overrideValue: labelOverrides === null || labelOverrides === void 0 ? void 0 : labelOverrides.deleteError
|
|
125
129
|
}, {
|
|
126
|
-
label: deleteModal
|
|
127
|
-
error: errorResp
|
|
130
|
+
label: deleteModal === null || deleteModal === void 0 || (_deleteModal$refdata = deleteModal.refdata) === null || _deleteModal$refdata === void 0 ? void 0 : _deleteModal$refdata.label,
|
|
131
|
+
error: errorResp === null || errorResp === void 0 ? void 0 : errorResp.message
|
|
128
132
|
}),
|
|
129
133
|
type: 'error'
|
|
130
134
|
});
|
|
@@ -132,7 +136,7 @@ const EditableRefdataCategoryList = /*#__PURE__*/(0, _react.forwardRef)((_ref, r
|
|
|
132
136
|
...catchQueryCalls // override defaults here
|
|
133
137
|
},
|
|
134
138
|
endpoint: refdataEndpoint,
|
|
135
|
-
id: refdata
|
|
139
|
+
id: refdata === null || refdata === void 0 ? void 0 : refdata.id,
|
|
136
140
|
queryParams: {
|
|
137
141
|
delete: {
|
|
138
142
|
enabled: !!refdata
|
|
@@ -148,13 +152,14 @@ const EditableRefdataCategoryList = /*#__PURE__*/(0, _react.forwardRef)((_ref, r
|
|
|
148
152
|
|
|
149
153
|
// This is the function which will take a row in the table and assign the relevant actions to it
|
|
150
154
|
const actionAssigner = rowData => {
|
|
155
|
+
var _rowData$values;
|
|
151
156
|
const actionArray = [];
|
|
152
|
-
if (!rowData
|
|
157
|
+
if (!(rowData !== null && rowData !== void 0 && (_rowData$values = rowData.values) !== null && _rowData$values !== void 0 && _rowData$values.length) && deleteCondition) {
|
|
153
158
|
actionArray.push({
|
|
154
159
|
name: 'delete',
|
|
155
160
|
label: kintIntl.formatKintMessage({
|
|
156
161
|
id: 'delete',
|
|
157
|
-
overrideValue: labelOverrides
|
|
162
|
+
overrideValue: labelOverrides === null || labelOverrides === void 0 ? void 0 : labelOverrides.delete
|
|
158
163
|
}),
|
|
159
164
|
icon: 'trash',
|
|
160
165
|
callback: data => setDeleteModal({
|
|
@@ -163,9 +168,9 @@ const EditableRefdataCategoryList = /*#__PURE__*/(0, _react.forwardRef)((_ref, r
|
|
|
163
168
|
}),
|
|
164
169
|
ariaLabel: data => kintIntl.formatKintMessage({
|
|
165
170
|
id: 'refdataCategory.deleteAriaLabel',
|
|
166
|
-
overrideValue: labelOverrides
|
|
171
|
+
overrideValue: labelOverrides === null || labelOverrides === void 0 ? void 0 : labelOverrides.deleteAriaLabel
|
|
167
172
|
}, {
|
|
168
|
-
label: data
|
|
173
|
+
label: data === null || data === void 0 ? void 0 : data.label
|
|
169
174
|
})
|
|
170
175
|
});
|
|
171
176
|
}
|
|
@@ -191,11 +196,11 @@ const EditableRefdataCategoryList = /*#__PURE__*/(0, _react.forwardRef)((_ref, r
|
|
|
191
196
|
columnMapping: {
|
|
192
197
|
desc: kintIntl.formatKintMessage({
|
|
193
198
|
id: 'refdataCategory.refdataCategory',
|
|
194
|
-
overrideValue: labelOverrides
|
|
199
|
+
overrideValue: labelOverrides === null || labelOverrides === void 0 ? void 0 : labelOverrides.refdataCategory
|
|
195
200
|
}),
|
|
196
201
|
values: kintIntl.formatKintMessage({
|
|
197
202
|
id: 'refdataCategory.noOfValues',
|
|
198
|
-
overrideValue: labelOverrides
|
|
203
|
+
overrideValue: labelOverrides === null || labelOverrides === void 0 ? void 0 : labelOverrides.noOfValues
|
|
199
204
|
})
|
|
200
205
|
},
|
|
201
206
|
contentData: contentData,
|
|
@@ -209,15 +214,21 @@ const EditableRefdataCategoryList = /*#__PURE__*/(0, _react.forwardRef)((_ref, r
|
|
|
209
214
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.Button, {
|
|
210
215
|
buttonStyle: "link",
|
|
211
216
|
onClick: () => handleRefdataCategoryClick(rowData),
|
|
212
|
-
children: rowData
|
|
217
|
+
children: rowData === null || rowData === void 0 ? void 0 : rowData.desc
|
|
213
218
|
});
|
|
214
219
|
}
|
|
215
|
-
return rowData
|
|
220
|
+
return rowData === null || rowData === void 0 ? void 0 : rowData.desc;
|
|
216
221
|
},
|
|
217
|
-
values: rowData =>
|
|
222
|
+
values: rowData => {
|
|
223
|
+
var _rowData$values2;
|
|
224
|
+
return rowData === null || rowData === void 0 || (_rowData$values2 = rowData.values) === null || _rowData$values2 === void 0 ? void 0 : _rowData$values2.length;
|
|
225
|
+
}
|
|
218
226
|
}
|
|
219
227
|
/* Hide actions column when no permissions, or no deletable refdata categories */,
|
|
220
|
-
hideActionsColumn: !createCondition && !deleteCondition || !contentData
|
|
228
|
+
hideActionsColumn: !createCondition && !deleteCondition || !(contentData !== null && contentData !== void 0 && contentData.find(cd => {
|
|
229
|
+
var _cd$values;
|
|
230
|
+
return (cd === null || cd === void 0 || (_cd$values = cd.values) === null || _cd$values === void 0 ? void 0 : _cd$values.length) === 0;
|
|
231
|
+
})),
|
|
221
232
|
hideCreateButton: hideCreateButton,
|
|
222
233
|
label: label,
|
|
223
234
|
validateFields: {
|
|
@@ -227,31 +238,32 @@ const EditableRefdataCategoryList = /*#__PURE__*/(0, _react.forwardRef)((_ref, r
|
|
|
227
238
|
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.ConfirmationModal, {
|
|
228
239
|
confirmLabel: kintIntl.formatKintMessage({
|
|
229
240
|
id: 'delete',
|
|
230
|
-
overrideValue: labelOverrides
|
|
241
|
+
overrideValue: labelOverrides === null || labelOverrides === void 0 ? void 0 : labelOverrides.delete
|
|
231
242
|
}),
|
|
232
243
|
heading: kintIntl.formatKintMessage({
|
|
233
244
|
id: 'refdataCategory.deleteRefdataCategory',
|
|
234
|
-
overrideValue: labelOverrides
|
|
245
|
+
overrideValue: labelOverrides === null || labelOverrides === void 0 ? void 0 : labelOverrides.deleteRefdataCategory
|
|
235
246
|
}),
|
|
236
247
|
message: kintIntl.formatKintMessage({
|
|
237
248
|
id: 'refdataCategory.deleteRefdataCategory.confirmMessage',
|
|
238
|
-
overrideValue: labelOverrides
|
|
249
|
+
overrideValue: labelOverrides === null || labelOverrides === void 0 ? void 0 : labelOverrides.deleteRefdataCategoryMessage
|
|
239
250
|
}, {
|
|
240
|
-
name: deleteModal
|
|
251
|
+
name: deleteModal === null || deleteModal === void 0 || (_deleteModal$refdata2 = deleteModal.refdata) === null || _deleteModal$refdata2 === void 0 ? void 0 : _deleteModal$refdata2.desc
|
|
241
252
|
}),
|
|
242
253
|
onCancel: () => setDeleteModal({
|
|
243
254
|
visible: false,
|
|
244
255
|
refdata: null
|
|
245
256
|
}),
|
|
246
257
|
onConfirm: () => {
|
|
247
|
-
|
|
248
|
-
|
|
258
|
+
var _deleteModal$refdata3, _deleteModal$refdata4;
|
|
259
|
+
deleteRefdataCategory(deleteModal === null || deleteModal === void 0 || (_deleteModal$refdata3 = deleteModal.refdata) === null || _deleteModal$refdata3 === void 0 ? void 0 : _deleteModal$refdata3.id);
|
|
260
|
+
onConfirmDelete(deleteModal === null || deleteModal === void 0 || (_deleteModal$refdata4 = deleteModal.refdata) === null || _deleteModal$refdata4 === void 0 ? void 0 : _deleteModal$refdata4.id);
|
|
249
261
|
setDeleteModal({
|
|
250
262
|
visible: false,
|
|
251
263
|
refdata: null
|
|
252
264
|
});
|
|
253
265
|
},
|
|
254
|
-
open: deleteModal
|
|
266
|
+
open: deleteModal === null || deleteModal === void 0 ? void 0 : deleteModal.visible
|
|
255
267
|
})]
|
|
256
268
|
});
|
|
257
269
|
});
|
|
@@ -33,6 +33,7 @@ const propTypes = {
|
|
|
33
33
|
refdataEndpoint: _propTypes.default.string
|
|
34
34
|
};
|
|
35
35
|
const EditableRefdataList = _ref => {
|
|
36
|
+
var _deleteModal$refdata2;
|
|
36
37
|
let {
|
|
37
38
|
afterQueryCalls,
|
|
38
39
|
allowSpecial = false,
|
|
@@ -87,7 +88,8 @@ const EditableRefdataList = _ref => {
|
|
|
87
88
|
const sortByLabel = (a, b) => a.label.localeCompare(b.label);
|
|
88
89
|
(0, _react.useEffect)(() => {
|
|
89
90
|
if (!isRefdataLoading) {
|
|
90
|
-
|
|
91
|
+
var _refdata$values$sort, _refdata$values;
|
|
92
|
+
setContentData((_refdata$values$sort = refdata === null || refdata === void 0 || (_refdata$values = refdata.values) === null || _refdata$values === void 0 ? void 0 : _refdata$values.sort(sortByLabel)) !== null && _refdata$values$sort !== void 0 ? _refdata$values$sort : []);
|
|
91
93
|
}
|
|
92
94
|
}, [isRefdataLoading, refdata]);
|
|
93
95
|
|
|
@@ -98,14 +100,16 @@ const EditableRefdataList = _ref => {
|
|
|
98
100
|
} = (0, _hooks.useMutateRefdataValue)({
|
|
99
101
|
afterQueryCalls: {
|
|
100
102
|
delete: json => {
|
|
101
|
-
|
|
102
|
-
|
|
103
|
+
var _json$values$sort, _json$values;
|
|
104
|
+
setContentData((_json$values$sort = json === null || json === void 0 || (_json$values = json.values) === null || _json$values === void 0 ? void 0 : _json$values.sort(sortByLabel)) !== null && _json$values$sort !== void 0 ? _json$values$sort : []);
|
|
105
|
+
if (afterQueryCalls !== null && afterQueryCalls !== void 0 && afterQueryCalls.delete) {
|
|
103
106
|
afterQueryCalls.delete(json);
|
|
104
107
|
}
|
|
105
108
|
},
|
|
106
109
|
put: json => {
|
|
107
|
-
|
|
108
|
-
|
|
110
|
+
var _json$values$sort2, _json$values2;
|
|
111
|
+
setContentData((_json$values$sort2 = json === null || json === void 0 || (_json$values2 = json.values) === null || _json$values2 === void 0 ? void 0 : _json$values2.sort(sortByLabel)) !== null && _json$values$sort2 !== void 0 ? _json$values$sort2 : []);
|
|
112
|
+
if (afterQueryCalls !== null && afterQueryCalls !== void 0 && afterQueryCalls.put) {
|
|
109
113
|
afterQueryCalls.put(json);
|
|
110
114
|
}
|
|
111
115
|
}
|
|
@@ -114,14 +118,15 @@ const EditableRefdataList = _ref => {
|
|
|
114
118
|
// Default delete behaviour is to fire a callout, either with kint-components default message
|
|
115
119
|
// or one provided in labelOverrides, which is passed the error message and refdata in question
|
|
116
120
|
delete: async err => {
|
|
121
|
+
var _deleteModal$refdata;
|
|
117
122
|
const errorResp = await (0, _utils.parseErrorResponse)(err.response);
|
|
118
123
|
callout.sendCallout({
|
|
119
124
|
message: kintIntl.formatKintMessage({
|
|
120
125
|
id: 'refdata.deleteRefdataValue.errorMessage',
|
|
121
|
-
overrideValue: labelOverrides
|
|
126
|
+
overrideValue: labelOverrides === null || labelOverrides === void 0 ? void 0 : labelOverrides.deleteError
|
|
122
127
|
}, {
|
|
123
|
-
label: deleteModal
|
|
124
|
-
error: errorResp
|
|
128
|
+
label: deleteModal === null || deleteModal === void 0 || (_deleteModal$refdata = deleteModal.refdata) === null || _deleteModal$refdata === void 0 ? void 0 : _deleteModal$refdata.label,
|
|
129
|
+
error: errorResp === null || errorResp === void 0 ? void 0 : errorResp.message
|
|
125
130
|
}),
|
|
126
131
|
type: 'error'
|
|
127
132
|
});
|
|
@@ -129,7 +134,7 @@ const EditableRefdataList = _ref => {
|
|
|
129
134
|
...catchQueryCalls // override defaults here
|
|
130
135
|
},
|
|
131
136
|
endpoint: refdataEndpoint,
|
|
132
|
-
id: refdata
|
|
137
|
+
id: refdata === null || refdata === void 0 ? void 0 : refdata.id,
|
|
133
138
|
queryParams: {
|
|
134
139
|
delete: {
|
|
135
140
|
enabled: !!refdata
|
|
@@ -151,24 +156,24 @@ const EditableRefdataList = _ref => {
|
|
|
151
156
|
name: 'edit',
|
|
152
157
|
label: kintIntl.formatKintMessage({
|
|
153
158
|
id: 'edit',
|
|
154
|
-
overrideValue: labelOverrides
|
|
159
|
+
overrideValue: labelOverrides === null || labelOverrides === void 0 ? void 0 : labelOverrides.edit
|
|
155
160
|
}),
|
|
156
161
|
icon: 'edit',
|
|
157
162
|
callback: data => editRefdataValue(data),
|
|
158
163
|
ariaLabel: data => kintIntl.formatKintMessage({
|
|
159
164
|
id: 'refdata.editAriaLabel',
|
|
160
|
-
overrideValue: labelOverrides
|
|
165
|
+
overrideValue: labelOverrides === null || labelOverrides === void 0 ? void 0 : labelOverrides.editAriaLabel
|
|
161
166
|
}, {
|
|
162
|
-
label: data
|
|
167
|
+
label: data === null || data === void 0 ? void 0 : data.label
|
|
163
168
|
})
|
|
164
169
|
});
|
|
165
170
|
}
|
|
166
|
-
if (!refdata
|
|
171
|
+
if (!(refdata !== null && refdata !== void 0 && refdata.internal) && deleteCondition) {
|
|
167
172
|
actionArray.push({
|
|
168
173
|
name: 'delete',
|
|
169
174
|
label: kintIntl.formatKintMessage({
|
|
170
175
|
id: 'delete',
|
|
171
|
-
overrideValue: labelOverrides
|
|
176
|
+
overrideValue: labelOverrides === null || labelOverrides === void 0 ? void 0 : labelOverrides.delete
|
|
172
177
|
}),
|
|
173
178
|
icon: 'trash',
|
|
174
179
|
callback: data => setDeleteModal({
|
|
@@ -177,9 +182,9 @@ const EditableRefdataList = _ref => {
|
|
|
177
182
|
}),
|
|
178
183
|
ariaLabel: data => kintIntl.formatKintMessage({
|
|
179
184
|
id: 'refdata.deleteAriaLabel',
|
|
180
|
-
overrideValue: labelOverrides
|
|
185
|
+
overrideValue: labelOverrides === null || labelOverrides === void 0 ? void 0 : labelOverrides.deleteAriaLabel
|
|
181
186
|
}, {
|
|
182
|
-
label: data
|
|
187
|
+
label: data === null || data === void 0 ? void 0 : data.label
|
|
183
188
|
})
|
|
184
189
|
});
|
|
185
190
|
}
|
|
@@ -191,24 +196,25 @@ const EditableRefdataList = _ref => {
|
|
|
191
196
|
columnMapping: {
|
|
192
197
|
label: kintIntl.formatKintMessage({
|
|
193
198
|
id: 'refdata.label',
|
|
194
|
-
overrideValue: labelOverrides
|
|
199
|
+
overrideValue: labelOverrides === null || labelOverrides === void 0 ? void 0 : labelOverrides.label
|
|
195
200
|
}),
|
|
196
201
|
value: kintIntl.formatKintMessage({
|
|
197
202
|
id: 'refdata.value',
|
|
198
|
-
overrideValue: labelOverrides
|
|
203
|
+
overrideValue: labelOverrides === null || labelOverrides === void 0 ? void 0 : labelOverrides.value
|
|
199
204
|
})
|
|
200
205
|
},
|
|
201
206
|
contentData: contentData,
|
|
202
207
|
creatableFields: {
|
|
203
208
|
value: () => false
|
|
204
209
|
},
|
|
205
|
-
createCallback: !createCondition || refdata
|
|
210
|
+
createCallback: !createCondition || refdata !== null && refdata !== void 0 && refdata.internal ? null : data => {
|
|
206
211
|
if (allowSpecial) {
|
|
207
212
|
editRefdataValue(data);
|
|
208
213
|
} else {
|
|
214
|
+
var _selectorSafe;
|
|
209
215
|
editRefdataValue({
|
|
210
216
|
...data,
|
|
211
|
-
value: (0, _utils.selectorSafe)(data
|
|
217
|
+
value: (_selectorSafe = (0, _utils.selectorSafe)(data === null || data === void 0 ? void 0 : data.label)) === null || _selectorSafe === void 0 ? void 0 : _selectorSafe.replaceAll('%20', ' ')
|
|
212
218
|
});
|
|
213
219
|
}
|
|
214
220
|
},
|
|
@@ -225,30 +231,31 @@ const EditableRefdataList = _ref => {
|
|
|
225
231
|
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.ConfirmationModal, {
|
|
226
232
|
confirmLabel: kintIntl.formatKintMessage({
|
|
227
233
|
id: 'delete',
|
|
228
|
-
overrideValue: labelOverrides
|
|
234
|
+
overrideValue: labelOverrides === null || labelOverrides === void 0 ? void 0 : labelOverrides.delete
|
|
229
235
|
}),
|
|
230
236
|
heading: kintIntl.formatKintMessage({
|
|
231
237
|
id: 'refdata.deleteRefdataValue',
|
|
232
|
-
overrideValue: labelOverrides
|
|
238
|
+
overrideValue: labelOverrides === null || labelOverrides === void 0 ? void 0 : labelOverrides.deleteRefdataValue
|
|
233
239
|
}),
|
|
234
240
|
message: kintIntl.formatKintMessage({
|
|
235
241
|
id: 'refdata.deleteRefdataValue.confirmMessage',
|
|
236
|
-
overrideValue: labelOverrides
|
|
242
|
+
overrideValue: labelOverrides === null || labelOverrides === void 0 ? void 0 : labelOverrides.deleteRefdataValueMessage
|
|
237
243
|
}, {
|
|
238
|
-
name: deleteModal
|
|
244
|
+
name: deleteModal === null || deleteModal === void 0 || (_deleteModal$refdata2 = deleteModal.refdata) === null || _deleteModal$refdata2 === void 0 ? void 0 : _deleteModal$refdata2.label
|
|
239
245
|
}),
|
|
240
246
|
onCancel: () => setDeleteModal({
|
|
241
247
|
visible: false,
|
|
242
248
|
refdata: null
|
|
243
249
|
}),
|
|
244
250
|
onConfirm: () => {
|
|
245
|
-
|
|
251
|
+
var _deleteModal$refdata3;
|
|
252
|
+
deleteRefdataValue(deleteModal === null || deleteModal === void 0 || (_deleteModal$refdata3 = deleteModal.refdata) === null || _deleteModal$refdata3 === void 0 ? void 0 : _deleteModal$refdata3.id);
|
|
246
253
|
setDeleteModal({
|
|
247
254
|
visible: false,
|
|
248
255
|
refdata: null
|
|
249
256
|
});
|
|
250
257
|
},
|
|
251
|
-
open: deleteModal
|
|
258
|
+
open: deleteModal === null || deleteModal === void 0 ? void 0 : deleteModal.visible
|
|
252
259
|
})]
|
|
253
260
|
});
|
|
254
261
|
};
|
|
@@ -28,7 +28,7 @@ const EditableSettingsListFieldArray = _ref => {
|
|
|
28
28
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactFinalForm.Field, {
|
|
29
29
|
allowEdit: allowEdit,
|
|
30
30
|
component: _SettingField.SettingField,
|
|
31
|
-
"data-testid":
|
|
31
|
+
"data-testid": "editableSettingsListFieldArray[".concat(i, "]"),
|
|
32
32
|
intlKey: passedIntlKey,
|
|
33
33
|
intlNS: passedIntlNS,
|
|
34
34
|
labelOverrides: labelOverrides,
|
|
@@ -25,7 +25,7 @@ const EditSettingValue = props => {
|
|
|
25
25
|
const kintIntl = (0, _hooks.useKintIntl)(passedIntlKey, passedIntlNS);
|
|
26
26
|
const fieldLabel = kintIntl.formatKintMessage({
|
|
27
27
|
id: 'settings.valueFor',
|
|
28
|
-
overrideValue: labelOverrides
|
|
28
|
+
overrideValue: labelOverrides === null || labelOverrides === void 0 ? void 0 : labelOverrides.valueFor
|
|
29
29
|
}, {
|
|
30
30
|
name: setting.key
|
|
31
31
|
});
|
|
@@ -41,14 +41,14 @@ const EditSettingValue = props => {
|
|
|
41
41
|
"aria-label": fieldLabel,
|
|
42
42
|
component: RefdataComponent,
|
|
43
43
|
dataOptions: refdata,
|
|
44
|
-
name:
|
|
44
|
+
name: "".concat(input.name, ".value")
|
|
45
45
|
});
|
|
46
46
|
case 'Password':
|
|
47
47
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactFinalForm.Field, {
|
|
48
48
|
"aria-label": fieldLabel,
|
|
49
49
|
autoFocus: true,
|
|
50
50
|
component: _components.TextField,
|
|
51
|
-
name:
|
|
51
|
+
name: "".concat(input.name, ".value"),
|
|
52
52
|
parse: v => v // Lets us send an empty string instead of 'undefined'
|
|
53
53
|
,
|
|
54
54
|
type: "password"
|
|
@@ -68,7 +68,7 @@ const EditSettingValue = props => {
|
|
|
68
68
|
"aria-label": fieldLabel,
|
|
69
69
|
component: _components.Select,
|
|
70
70
|
dataOptions: selectTemplateValues,
|
|
71
|
-
name:
|
|
71
|
+
name: "".concat(input.name, ".value"),
|
|
72
72
|
parse: v => v
|
|
73
73
|
});
|
|
74
74
|
}
|
|
@@ -78,7 +78,7 @@ const EditSettingValue = props => {
|
|
|
78
78
|
"aria-label": fieldLabel,
|
|
79
79
|
autoFocus: true,
|
|
80
80
|
component: _components.TextField,
|
|
81
|
-
name:
|
|
81
|
+
name: "".concat(input.name, ".value"),
|
|
82
82
|
parse: v => v // Lets us send an empty string instead of 'undefined'
|
|
83
83
|
});
|
|
84
84
|
}
|
|
@@ -20,21 +20,23 @@ const RenderSettingValue = props => {
|
|
|
20
20
|
const kintIntl = (0, _hooks.useKintIntl)(passedIntlKey, passedIntlNS);
|
|
21
21
|
const NoCurrentValue = kintIntl.formatKintMessage({
|
|
22
22
|
id: 'settings.noCurrentValue',
|
|
23
|
-
overrideValue: labelOverrides
|
|
23
|
+
overrideValue: labelOverrides === null || labelOverrides === void 0 ? void 0 : labelOverrides.noCurrentValue
|
|
24
24
|
});
|
|
25
|
-
const defaultText =
|
|
25
|
+
const defaultText = "[".concat(kintIntl.formatKintMessage({
|
|
26
26
|
id: 'settings.default',
|
|
27
|
-
overrideValue: labelOverrides
|
|
28
|
-
})
|
|
27
|
+
overrideValue: labelOverrides === null || labelOverrides === void 0 ? void 0 : labelOverrides.default
|
|
28
|
+
}), "]");
|
|
29
29
|
switch (setting.settingType) {
|
|
30
30
|
case 'Refdata':
|
|
31
31
|
{
|
|
32
32
|
if (setting.value) {
|
|
33
|
-
|
|
33
|
+
var _refdata$filter$0$lab, _refdata$filter$;
|
|
34
|
+
return (_refdata$filter$0$lab = refdata === null || refdata === void 0 || (_refdata$filter$ = refdata.filter(obj => obj.value === setting.value)[0]) === null || _refdata$filter$ === void 0 ? void 0 : _refdata$filter$.label) !== null && _refdata$filter$0$lab !== void 0 ? _refdata$filter$0$lab : null;
|
|
34
35
|
}
|
|
35
36
|
if (setting.defValue) {
|
|
36
|
-
|
|
37
|
-
|
|
37
|
+
var _refdata$filter$2;
|
|
38
|
+
const defValue = refdata === null || refdata === void 0 || (_refdata$filter$2 = refdata.filter(obj => obj.value === setting.defValue)[0]) === null || _refdata$filter$2 === void 0 ? void 0 : _refdata$filter$2.label;
|
|
39
|
+
return "".concat(defaultText, " ").concat(defValue);
|
|
38
40
|
}
|
|
39
41
|
return NoCurrentValue;
|
|
40
42
|
}
|
|
@@ -44,7 +46,7 @@ const RenderSettingValue = props => {
|
|
|
44
46
|
return '********';
|
|
45
47
|
}
|
|
46
48
|
if (setting.defValue) {
|
|
47
|
-
return
|
|
49
|
+
return "".concat(defaultText, " ********");
|
|
48
50
|
}
|
|
49
51
|
return NoCurrentValue;
|
|
50
52
|
}
|
|
@@ -54,7 +56,7 @@ const RenderSettingValue = props => {
|
|
|
54
56
|
const settingId = setting.value || setting.defValue;
|
|
55
57
|
return obj.id === settingId;
|
|
56
58
|
})[0];
|
|
57
|
-
return templateValue
|
|
59
|
+
return (templateValue === null || templateValue === void 0 ? void 0 : templateValue.name) || NoCurrentValue;
|
|
58
60
|
}
|
|
59
61
|
default:
|
|
60
62
|
{
|
|
@@ -62,7 +64,7 @@ const RenderSettingValue = props => {
|
|
|
62
64
|
return setting.value;
|
|
63
65
|
}
|
|
64
66
|
if (setting.defValue) {
|
|
65
|
-
return
|
|
67
|
+
return "".concat(defaultText, " ").concat(setting.defValue);
|
|
66
68
|
}
|
|
67
69
|
return NoCurrentValue;
|
|
68
70
|
}
|
|
@@ -42,14 +42,14 @@ const SettingField = settingFieldProps => {
|
|
|
42
42
|
endpoint: refdataEndpoint,
|
|
43
43
|
desc: currentSetting.vocab,
|
|
44
44
|
queryParams: {
|
|
45
|
-
enabled: !!currentSetting
|
|
45
|
+
enabled: !!(currentSetting !== null && currentSetting !== void 0 && currentSetting.vocab) && currentSetting.settingType === 'Refdata'
|
|
46
46
|
}
|
|
47
47
|
});
|
|
48
48
|
const templates = (0, _hooks.useTemplates)({
|
|
49
49
|
context: currentSetting.vocab,
|
|
50
50
|
endpoint: templateEndpoint,
|
|
51
51
|
queryParams: {
|
|
52
|
-
enabled: !!currentSetting
|
|
52
|
+
enabled: !!(currentSetting !== null && currentSetting !== void 0 && currentSetting.vocab) && currentSetting.settingType === 'Template'
|
|
53
53
|
}
|
|
54
54
|
});
|
|
55
55
|
const renderHelpText = helpTextId => {
|
|
@@ -115,10 +115,10 @@ const SettingField = settingFieldProps => {
|
|
|
115
115
|
} else {
|
|
116
116
|
RenderFunction = _EditSettingValue.default;
|
|
117
117
|
}
|
|
118
|
-
const id =
|
|
118
|
+
const id = "settings.".concat((0, _utils.toCamelCase)(currentSetting.section), ".").concat((0, _utils.toCamelCase)(currentSetting.key), ".help");
|
|
119
119
|
const renderHeaderStart = () => {
|
|
120
120
|
const settingName = Object.keys(currentSetting).length > 0 ? kintIntl.formatKintMessage({
|
|
121
|
-
id:
|
|
121
|
+
id: "settings.".concat((0, _utils.toCamelCase)(currentSetting.section), ".").concat((0, _utils.toCamelCase)(currentSetting.key))
|
|
122
122
|
}) : kintIntl.formatKintMessage({
|
|
123
123
|
id: 'loading'
|
|
124
124
|
});
|