@k-int/stripes-kint-components 3.0.0 → 3.0.2
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 -1
- package/es/lib/CustomProperties/Edit/CustomPropertyField.js +2 -5
- package/es/lib/CustomProperties/View/CustomPropertiesViewCtx.js +10 -8
- package/package.json +1 -1
- package/src/lib/CustomProperties/Edit/CustomPropertyField.js +1 -15
- package/src/lib/CustomProperties/View/CustomPropertiesViewCtx.js +8 -8
package/CHANGELOG.md
CHANGED
|
@@ -1,4 +1,10 @@
|
|
|
1
|
-
## 3.0.
|
|
1
|
+
## 3.0.2 2022-09-29
|
|
2
|
+
* Fixed inconsistency between CustomPropertiesEditCtx and CustomPropertiesViewCtx labelOverrides
|
|
3
|
+
|
|
4
|
+
## 3.0.1 2022-09-22
|
|
5
|
+
* Removed unnecessary validate prop on CustomPropertyField, fixed broken out of range validator
|
|
6
|
+
|
|
7
|
+
## 3.0.0 2022-09-16
|
|
2
8
|
* RichSelect default trigger now uses DropdownButton under the hood -- changed styling
|
|
3
9
|
* ActionList previously added actionListItems directly to cached object--sometimes this caused the react-query cache ITSELF to update, although I'm not sure why here and not anywhere else. Fixed by creating a clone internally in ActionListFieldArray and assigning actionListActions on that.
|
|
4
10
|
* New util function `parseErrorResponse`, used in places where we catch http errors, allows for text only response bodies
|
|
@@ -94,7 +94,7 @@ var CustomPropertyField = function CustomPropertyField(_ref) {
|
|
|
94
94
|
if (customProperty.type === CUSTOM_PROPERTY_TYPES.INTEGER_CLASS_NAME) {
|
|
95
95
|
var min = Number.MIN_SAFE_INTEGER;
|
|
96
96
|
var max = Number.MAX_SAFE_INTEGER;
|
|
97
|
-
return fieldValue &&
|
|
97
|
+
return fieldValue && (fieldValue > max || fieldValue < min) ? kintIntl.formatKintMessage({
|
|
98
98
|
id: 'errors.valueNotInRange',
|
|
99
99
|
overrideValue: labelOverrides.valueNotInRangeError
|
|
100
100
|
}, {
|
|
@@ -226,10 +226,7 @@ var CustomPropertyField = function CustomPropertyField(_ref) {
|
|
|
226
226
|
max: max,
|
|
227
227
|
min: min,
|
|
228
228
|
step: 'any',
|
|
229
|
-
type: 'number'
|
|
230
|
-
validate: function validate(validateValue) {
|
|
231
|
-
return (0, _utils.composeValidatorsWithArgs)(_utils.invalidNumber, _utils.rangeOverflow, _utils.rangeUnderflow)(validateValue, min, max, passedIntlKey, passedIntlNS, labelOverrides);
|
|
232
|
-
}
|
|
229
|
+
type: 'number'
|
|
233
230
|
};
|
|
234
231
|
|
|
235
232
|
handleChange = function handleChange(e) {
|
|
@@ -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
|
@@ -77,7 +77,7 @@ const CustomPropertyField = ({
|
|
|
77
77
|
const min = Number.MIN_SAFE_INTEGER;
|
|
78
78
|
const max = Number.MAX_SAFE_INTEGER;
|
|
79
79
|
|
|
80
|
-
return (fieldValue &&
|
|
80
|
+
return (fieldValue && (fieldValue > max || fieldValue < min)) ?
|
|
81
81
|
kintIntl.formatKintMessage({
|
|
82
82
|
id: 'errors.valueNotInRange',
|
|
83
83
|
overrideValue: labelOverrides.valueNotInRangeError
|
|
@@ -206,20 +206,6 @@ const CustomPropertyField = ({
|
|
|
206
206
|
min,
|
|
207
207
|
step: 'any',
|
|
208
208
|
type: 'number',
|
|
209
|
-
validate: (validateValue) => {
|
|
210
|
-
return composeValidatorsWithArgs(
|
|
211
|
-
invalidNumber,
|
|
212
|
-
rangeOverflow,
|
|
213
|
-
rangeUnderflow
|
|
214
|
-
)(
|
|
215
|
-
validateValue,
|
|
216
|
-
min,
|
|
217
|
-
max,
|
|
218
|
-
passedIntlKey,
|
|
219
|
-
passedIntlNS,
|
|
220
|
-
labelOverrides
|
|
221
|
-
);
|
|
222
|
-
}
|
|
223
209
|
};
|
|
224
210
|
handleChange = e => {
|
|
225
211
|
onChange({
|
|
@@ -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
|
};
|