@k-int/stripes-kint-components 3.0.1 → 3.0.3
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 +6 -0
- package/es/lib/CustomProperties/Config/CustomPropertiesSettings.js +2 -2
- package/es/lib/CustomProperties/View/CustomPropertiesViewCtx.js +10 -8
- package/package.json +1 -1
- package/src/lib/CustomProperties/Config/CustomPropertiesSettings.js +1 -1
- package/src/lib/CustomProperties/View/CustomPropertiesViewCtx.js +8 -8
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,9 @@
|
|
|
1
|
+
## 3.0.3 2022-10-04
|
|
2
|
+
* Fixed issue where custom property ctx is not removable
|
|
3
|
+
|
|
4
|
+
## 3.0.2 2022-09-29
|
|
5
|
+
* Fixed inconsistency between CustomPropertiesEditCtx and CustomPropertiesViewCtx labelOverrides
|
|
6
|
+
|
|
1
7
|
## 3.0.1 2022-09-22
|
|
2
8
|
* Removed unnecessary validate prop on CustomPropertyField, fixed broken out of range validator
|
|
3
9
|
|
|
@@ -197,10 +197,10 @@ var CustomPropertiesSettings = function CustomPropertiesSettings(_ref) {
|
|
|
197
197
|
deleteCustProp = _useMutateCustomPrope.delete;
|
|
198
198
|
|
|
199
199
|
var handeContextSubmit = function handeContextSubmit(submitData) {
|
|
200
|
-
var _submitData$ctx, _submitData$ctx$;
|
|
200
|
+
var _submitData$ctx$0$val, _submitData$ctx, _submitData$ctx$;
|
|
201
201
|
|
|
202
202
|
return _objectSpread(_objectSpread({}, submitData), {}, {
|
|
203
|
-
ctx: submitData === null || submitData === void 0 ? void 0 : (_submitData$ctx = submitData.ctx) === null || _submitData$ctx === void 0 ? void 0 : (_submitData$ctx$ = _submitData$ctx[0]) === null || _submitData$ctx$ === void 0 ? void 0 : _submitData$ctx$.value
|
|
203
|
+
ctx: (_submitData$ctx$0$val = submitData === null || submitData === void 0 ? void 0 : (_submitData$ctx = submitData.ctx) === null || _submitData$ctx === void 0 ? void 0 : (_submitData$ctx$ = _submitData$ctx[0]) === null || _submitData$ctx$ === void 0 ? void 0 : _submitData$ctx$.value) !== null && _submitData$ctx$0$val !== void 0 ? _submitData$ctx$0$val : ''
|
|
204
204
|
});
|
|
205
205
|
}; // When POSTing a custom property, the backend expects a shorthand "Integer" or "LocalDate"
|
|
206
206
|
// When PUTing a custom property, the backend needs the full class name
|
|
@@ -50,17 +50,19 @@ var CustomPropertiesViewCtx = function CustomPropertiesViewCtx(_ref) {
|
|
|
50
50
|
id: 'customProperties',
|
|
51
51
|
overrideValue: labelOverrides.noContext
|
|
52
52
|
});
|
|
53
|
-
} //
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
if (labelOverrides[ctx]) {
|
|
57
|
-
return labelOverrides[ctx];
|
|
58
|
-
} // Label override for default title or finally built in default
|
|
53
|
+
} // Chain formatKintMessages together using provided fallbackMessage to
|
|
54
|
+
// allow for "If override or translation exists, use it, else use default"
|
|
59
55
|
|
|
60
56
|
|
|
61
57
|
return kintIntl.formatKintMessage({
|
|
62
|
-
id:
|
|
63
|
-
overrideValue: labelOverrides
|
|
58
|
+
id: "customProperties.ctx.".concat(ctx),
|
|
59
|
+
overrideValue: labelOverrides[ctx],
|
|
60
|
+
fallbackMessage: kintIntl.formatKintMessage({
|
|
61
|
+
id: 'customProperties.defaultTitle',
|
|
62
|
+
overrideValue: labelOverrides.defaultTitle
|
|
63
|
+
}, {
|
|
64
|
+
ctx: ctx
|
|
65
|
+
})
|
|
64
66
|
}, {
|
|
65
67
|
ctx: ctx
|
|
66
68
|
});
|
package/package.json
CHANGED
|
@@ -28,16 +28,16 @@ const CustomPropertiesViewCtx = ({
|
|
|
28
28
|
);
|
|
29
29
|
}
|
|
30
30
|
|
|
31
|
-
//
|
|
32
|
-
|
|
33
|
-
return labelOverrides[ctx];
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
// Label override for default title or finally built in default
|
|
31
|
+
// Chain formatKintMessages together using provided fallbackMessage to
|
|
32
|
+
// allow for "If override or translation exists, use it, else use default"
|
|
37
33
|
return (
|
|
38
34
|
kintIntl.formatKintMessage({
|
|
39
|
-
id:
|
|
40
|
-
overrideValue: labelOverrides
|
|
35
|
+
id: `customProperties.ctx.${ctx}`,
|
|
36
|
+
overrideValue: labelOverrides[ctx],
|
|
37
|
+
fallbackMessage: kintIntl.formatKintMessage({
|
|
38
|
+
id: 'customProperties.defaultTitle',
|
|
39
|
+
overrideValue: labelOverrides.defaultTitle
|
|
40
|
+
}, { ctx })
|
|
41
41
|
}, { ctx })
|
|
42
42
|
);
|
|
43
43
|
};
|