@beinformed/ui 1.20.4 → 1.20.7
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 +18 -0
- package/esm/constants/Settings.js +2 -1
- package/esm/constants/Settings.js.map +1 -1
- package/esm/models/attributes/AttributeContent.js +17 -15
- package/esm/models/attributes/AttributeContent.js.map +1 -1
- package/esm/models/form/FormModel.js +7 -6
- package/esm/models/form/FormModel.js.map +1 -1
- package/esm/modularui/ModularUIRequest.js +4 -1
- package/esm/modularui/ModularUIRequest.js.map +1 -1
- package/esm/redux/index.js +3 -1
- package/esm/redux/index.js.map +1 -1
- package/esm/redux/selectors/index.js +2 -0
- package/esm/redux/selectors/index.js.map +1 -0
- package/lib/constants/Settings.js +2 -1
- package/lib/constants/Settings.js.flow +2 -0
- package/lib/constants/Settings.js.map +1 -1
- package/lib/models/attributes/AttributeContent.js +17 -15
- package/lib/models/attributes/AttributeContent.js.flow +46 -44
- package/lib/models/attributes/AttributeContent.js.map +1 -1
- package/lib/models/form/FormModel.js +7 -7
- package/lib/models/form/FormModel.js.flow +2 -3
- package/lib/models/form/FormModel.js.map +1 -1
- package/lib/modularui/ModularUIRequest.js +4 -1
- package/lib/modularui/ModularUIRequest.js.flow +9 -1
- package/lib/modularui/ModularUIRequest.js.map +1 -1
- package/lib/redux/index.js +14 -0
- package/lib/redux/index.js.flow +3 -0
- package/lib/redux/index.js.map +1 -1
- package/lib/redux/selectors/index.js +21 -0
- package/lib/redux/selectors/index.js.flow +2 -0
- package/lib/redux/selectors/index.js.map +1 -0
- package/package.json +7 -6
- package/src/constants/Settings.js +2 -0
- package/src/models/attributes/AttributeContent.js +46 -44
- package/src/models/form/FormModel.js +2 -3
- package/src/modularui/ModularUIRequest.js +9 -1
- package/src/redux/index.js +3 -0
- package/src/redux/selectors/index.js +2 -0
|
@@ -62,50 +62,52 @@ class AttributeContent {
|
|
|
62
62
|
*/
|
|
63
63
|
get elements(): ContentAll {
|
|
64
64
|
if (this._content?.elements) {
|
|
65
|
-
return this._content.elements
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
65
|
+
return this._content.elements
|
|
66
|
+
.filter((element) => element !== null)
|
|
67
|
+
.map((element) => {
|
|
68
|
+
if (element.propertyElement) {
|
|
69
|
+
const { label, layouthint, properties } = element.propertyElement;
|
|
70
|
+
|
|
71
|
+
return {
|
|
72
|
+
propertyElement: {
|
|
73
|
+
label,
|
|
74
|
+
layouthint: new LayoutHintCollection(layouthint),
|
|
75
|
+
properties,
|
|
76
|
+
},
|
|
77
|
+
};
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
if (element.textFragmentElement) {
|
|
81
|
+
const { label, layouthint, textfragments } =
|
|
82
|
+
element.textFragmentElement;
|
|
83
|
+
return {
|
|
84
|
+
textFragmentElement: {
|
|
85
|
+
label,
|
|
86
|
+
layouthint: new LayoutHintCollection(layouthint),
|
|
87
|
+
textfragments: textfragments.map((textfragment) => ({
|
|
88
|
+
...textfragment,
|
|
89
|
+
text: retrieveText(textfragment.text),
|
|
90
|
+
})),
|
|
91
|
+
},
|
|
92
|
+
};
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
if (element.contentElement) {
|
|
96
|
+
const { label, layouthint, sections } = element.contentElement;
|
|
97
|
+
return {
|
|
98
|
+
contentElement: {
|
|
99
|
+
label,
|
|
100
|
+
layouthint: new LayoutHintCollection(layouthint),
|
|
101
|
+
sections: sections.map(
|
|
102
|
+
(section) => new SectionModel(section, null)
|
|
103
|
+
),
|
|
104
|
+
},
|
|
105
|
+
};
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
// $FlowIssue
|
|
109
|
+
return element;
|
|
110
|
+
});
|
|
109
111
|
}
|
|
110
112
|
|
|
111
113
|
return [];
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
// @flow
|
|
2
2
|
import flattenDeep from "lodash/flattenDeep";
|
|
3
3
|
import deepmerge from "deepmerge";
|
|
4
|
-
import { get } from "lodash";
|
|
5
4
|
|
|
6
5
|
import { has } from "../../utils/helpers/objects";
|
|
7
6
|
|
|
@@ -156,11 +155,11 @@ class FormModel extends ResourceModel {
|
|
|
156
155
|
): string | null {
|
|
157
156
|
// cancel button labels are defined on the form
|
|
158
157
|
if (buttonType === "cancel") {
|
|
159
|
-
return
|
|
158
|
+
return this.buttonLabels?.cancel ?? null;
|
|
160
159
|
}
|
|
161
160
|
|
|
162
161
|
// all other form related button labels are defined on the object
|
|
163
|
-
return
|
|
162
|
+
return this.currentFormObject?.buttonLabels?.[buttonType] ?? null;
|
|
164
163
|
}
|
|
165
164
|
|
|
166
165
|
/**
|
|
@@ -445,6 +445,11 @@ class ModularUIRequest {
|
|
|
445
445
|
/**
|
|
446
446
|
*/
|
|
447
447
|
isHiddenList(name: string, href: string): Promise<string> {
|
|
448
|
+
const HIDE_WHEN_EMPTY_IGNORE_TASKS = getSetting(
|
|
449
|
+
"HIDE_WHEN_EMPTY_IGNORE_TASKS",
|
|
450
|
+
false
|
|
451
|
+
);
|
|
452
|
+
|
|
448
453
|
return universalFetch({
|
|
449
454
|
...this.options,
|
|
450
455
|
url: `${BASE}${href}`,
|
|
@@ -454,7 +459,10 @@ class ModularUIRequest {
|
|
|
454
459
|
const [key] = Object.keys(response);
|
|
455
460
|
const { _embedded, actions } = response[key];
|
|
456
461
|
|
|
457
|
-
const
|
|
462
|
+
const noListItems = _embedded == null;
|
|
463
|
+
const noActions = actions == null || HIDE_WHEN_EMPTY_IGNORE_TASKS;
|
|
464
|
+
|
|
465
|
+
const isHidden = noListItems && noActions;
|
|
458
466
|
if (isHidden) {
|
|
459
467
|
return name;
|
|
460
468
|
}
|
package/src/redux/index.js
CHANGED