@beinformed/ui 1.12.0 → 1.13.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 +32 -2
- package/esm/builder/mergeLayoutHintConfigurations.js +3 -3
- package/esm/builder/mergeLayoutHintConfigurations.js.map +1 -1
- package/esm/exceptions/ConfigurationException.js +2 -1
- package/esm/exceptions/ConfigurationException.js.map +1 -1
- package/esm/exceptions/FetchException.js +4 -3
- package/esm/exceptions/FetchException.js.map +1 -1
- package/esm/exceptions/IllegalArgumentException.js +2 -1
- package/esm/exceptions/IllegalArgumentException.js.map +1 -1
- package/esm/exceptions/IllegalReturnException.js +2 -1
- package/esm/exceptions/IllegalReturnException.js.map +1 -1
- package/esm/exceptions/IllegalStateException.js +2 -1
- package/esm/exceptions/IllegalStateException.js.map +1 -1
- package/esm/exceptions/JsonParseException.js +2 -1
- package/esm/exceptions/JsonParseException.js.map +1 -1
- package/esm/exceptions/MissingPropertyException.js +2 -1
- package/esm/exceptions/MissingPropertyException.js.map +1 -1
- package/esm/exceptions/NetworkException.js +2 -1
- package/esm/exceptions/NetworkException.js.map +1 -1
- package/esm/exceptions/NotAllowedUriException.js +2 -1
- package/esm/exceptions/NotAllowedUriException.js.map +1 -1
- package/esm/exceptions/NotFoundException.js +2 -1
- package/esm/exceptions/NotFoundException.js.map +1 -1
- package/esm/exceptions/ServerRequestException.js +2 -1
- package/esm/exceptions/ServerRequestException.js.map +1 -1
- package/esm/exceptions/ThemePropertyException.js +2 -1
- package/esm/exceptions/ThemePropertyException.js.map +1 -1
- package/esm/exceptions/TimeoutException.js +2 -1
- package/esm/exceptions/TimeoutException.js.map +1 -1
- package/esm/exceptions/UnauthorizedException.js +2 -1
- package/esm/exceptions/UnauthorizedException.js.map +1 -1
- package/esm/exceptions/UnsupportedOperationException.js +2 -1
- package/esm/exceptions/UnsupportedOperationException.js.map +1 -1
- package/esm/hooks/useContent.js +2 -2
- package/esm/hooks/useContent.js.map +1 -1
- package/esm/hooks/useDeepCompareEffect.js +2 -1
- package/esm/hooks/useDeepCompareEffect.js.map +1 -1
- package/esm/hooks/useForm.js.map +1 -1
- package/esm/hooks/useModal.js +2 -2
- package/esm/hooks/useModal.js.map +1 -1
- package/esm/hooks/useModularUI.js +0 -1
- package/esm/hooks/useModularUI.js.map +1 -1
- package/esm/hooks/useProgressIndicator.js +2 -2
- package/esm/i18n/Locale.js +11 -4
- package/esm/i18n/Locale.js.map +1 -1
- package/esm/i18n/Locales.js +2 -2
- package/esm/i18n/Message.js +2 -2
- package/esm/i18n/languages.js +2 -1
- package/esm/i18n/languages.js.map +1 -1
- package/esm/models/attributes/AttributeCollection.js +2 -2
- package/esm/models/attributes/AttributeContent.js +58 -30
- package/esm/models/attributes/AttributeContent.js.map +1 -1
- package/esm/models/attributes/AttributeDataHelper.js +3 -3
- package/esm/models/attributes/AttributeDataHelper.js.map +1 -1
- package/esm/models/attributes/BooleanAttributeModel.js +2 -2
- package/esm/models/attributes/ChoiceAttributeModel.js +2 -2
- package/esm/models/attributes/ChoiceAttributeOptionCollection.js +2 -2
- package/esm/models/attributes/CompositeAttributeChildCollection.js +2 -2
- package/esm/models/attributes/HelptextAttributeModel.js +24 -9
- package/esm/models/attributes/HelptextAttributeModel.js.map +1 -1
- package/esm/models/attributes/_createAttribute.js +2 -2
- package/esm/models/base/ResourceModel.js +2 -2
- package/esm/models/caseview/CaseViewModel.js +4 -5
- package/esm/models/caseview/CaseViewModel.js.map +1 -1
- package/esm/models/concepts/ConceptDetailModel.js +2 -2
- package/esm/models/concepts/SourceReferenceModel.js +2 -2
- package/esm/models/content/ContentTOCModel.js +2 -2
- package/esm/models/filters/AssignmentFilterModel.js +2 -2
- package/esm/models/filters/BaseFilterModel.js +2 -2
- package/esm/models/filters/ConceptIndexFilterModel.js +2 -1
- package/esm/models/filters/ConceptIndexFilterModel.js.map +1 -1
- package/esm/models/filters/FilterCollection.js +2 -2
- package/esm/models/filters/FilterModel.js +2 -1
- package/esm/models/filters/FilterModel.js.map +1 -1
- package/esm/models/form/FormModel.js +28 -4
- package/esm/models/form/FormModel.js.map +1 -1
- package/esm/models/form/FormObjectModel.js +5 -7
- package/esm/models/form/FormObjectModel.js.map +1 -1
- package/esm/models/grouping/GroupingModel.js +2 -2
- package/esm/models/links/normalizeLinkJSON.js +2 -2
- package/esm/models/list/ListDetailModel.js +4 -6
- package/esm/models/list/ListDetailModel.js.map +1 -1
- package/esm/models/list/ListItemCollection.js +38 -0
- package/esm/models/list/ListItemCollection.js.map +1 -1
- package/esm/models/list/ListItemModel.js +14 -2
- package/esm/models/list/ListItemModel.js.map +1 -1
- package/esm/models/list/ListModel.js +19 -74
- package/esm/models/list/ListModel.js.map +1 -1
- package/esm/models/lookup/LookupOptionCollection.js +2 -2
- package/esm/models/panels/GroupingPanelModel.js +2 -4
- package/esm/models/panels/GroupingPanelModel.js.map +1 -1
- package/esm/modularui/ModularUIError.js +2 -1
- package/esm/modularui/ModularUIError.js.map +1 -1
- package/esm/modularui/ModularUIRequest.js +71 -49
- package/esm/modularui/ModularUIRequest.js.map +1 -1
- package/esm/react-server/serverUtil.js +2 -2
- package/esm/react-theme/createTheme.js +2 -2
- package/esm/redux/_i18n/reducer.js +2 -2
- package/esm/redux/_modularui/actions.js +2 -2
- package/esm/redux/_modularui/connector.js +2 -2
- package/esm/redux/_modularui/reducer.js +2 -2
- package/esm/redux/_modularui/selectors.js +2 -2
- package/esm/redux/reducers/AuthReducer.js +2 -2
- package/esm/redux/reducers/ModalsReducer.js +2 -2
- package/esm/redux/reducers/NotificationReducer.js +2 -2
- package/esm/redux/reducers/PreferencesReducer.js +2 -2
- package/esm/redux/reducers/ProgressIndicatorReducer.js +2 -2
- package/esm/redux/store/configureStore.js +2 -2
- package/esm/utils/browser/Cookies.js +18 -32
- package/esm/utils/browser/Cookies.js.map +1 -1
- package/esm/utils/fetch/xhr.js +4 -3
- package/esm/utils/fetch/xhr.js.map +1 -1
- package/lib/builder/mergeLayoutHintConfigurations.js +3 -3
- package/lib/builder/mergeLayoutHintConfigurations.js.flow +3 -3
- package/lib/builder/mergeLayoutHintConfigurations.js.map +1 -1
- package/lib/exceptions/ConfigurationException.js +3 -1
- package/lib/exceptions/ConfigurationException.js.map +1 -1
- package/lib/exceptions/FetchException.js +5 -3
- package/lib/exceptions/FetchException.js.map +1 -1
- package/lib/exceptions/IllegalArgumentException.js +3 -1
- package/lib/exceptions/IllegalArgumentException.js.map +1 -1
- package/lib/exceptions/IllegalReturnException.js +3 -1
- package/lib/exceptions/IllegalReturnException.js.map +1 -1
- package/lib/exceptions/IllegalStateException.js +3 -1
- package/lib/exceptions/IllegalStateException.js.map +1 -1
- package/lib/exceptions/JsonParseException.js +3 -1
- package/lib/exceptions/JsonParseException.js.map +1 -1
- package/lib/exceptions/MissingPropertyException.js +3 -1
- package/lib/exceptions/MissingPropertyException.js.map +1 -1
- package/lib/exceptions/NetworkException.js +3 -1
- package/lib/exceptions/NetworkException.js.map +1 -1
- package/lib/exceptions/NotAllowedUriException.js +3 -1
- package/lib/exceptions/NotAllowedUriException.js.map +1 -1
- package/lib/exceptions/NotFoundException.js +3 -1
- package/lib/exceptions/NotFoundException.js.map +1 -1
- package/lib/exceptions/ServerRequestException.js +3 -1
- package/lib/exceptions/ServerRequestException.js.map +1 -1
- package/lib/exceptions/ThemePropertyException.js +3 -1
- package/lib/exceptions/ThemePropertyException.js.map +1 -1
- package/lib/exceptions/TimeoutException.js +3 -1
- package/lib/exceptions/TimeoutException.js.map +1 -1
- package/lib/exceptions/UnauthorizedException.js +3 -1
- package/lib/exceptions/UnauthorizedException.js.map +1 -1
- package/lib/exceptions/UnsupportedOperationException.js +3 -1
- package/lib/exceptions/UnsupportedOperationException.js.map +1 -1
- package/lib/hooks/useContent.js +2 -2
- package/lib/hooks/useContent.js.flow +2 -2
- package/lib/hooks/useContent.js.map +1 -1
- package/lib/hooks/useDeepCompareEffect.js +2 -1
- package/lib/hooks/useDeepCompareEffect.js.flow +1 -1
- package/lib/hooks/useDeepCompareEffect.js.map +1 -1
- package/lib/hooks/useForm.js.flow +1 -2
- package/lib/hooks/useForm.js.map +1 -1
- package/lib/hooks/useModal.js +2 -2
- package/lib/hooks/useModal.js.flow +1 -1
- package/lib/hooks/useModal.js.map +1 -1
- package/lib/hooks/useModularUI.js +0 -1
- package/lib/hooks/useModularUI.js.flow +0 -2
- package/lib/hooks/useModularUI.js.map +1 -1
- package/lib/hooks/useProgressIndicator.js +2 -2
- package/lib/i18n/Locale.js +11 -5
- package/lib/i18n/Locale.js.flow +7 -0
- package/lib/i18n/Locale.js.map +1 -1
- package/lib/i18n/Locales.js +2 -2
- package/lib/i18n/Message.js +2 -2
- package/lib/i18n/__tests__/Locale.spec.js.flow +14 -0
- package/lib/i18n/languages.js +2 -1
- package/lib/i18n/languages.js.flow +1 -0
- package/lib/i18n/languages.js.map +1 -1
- package/lib/i18n/types.js.flow +1 -0
- package/lib/models/attributes/AttributeCollection.js +2 -2
- package/lib/models/attributes/AttributeContent.js +59 -31
- package/lib/models/attributes/AttributeContent.js.flow +63 -16
- package/lib/models/attributes/AttributeContent.js.map +1 -1
- package/lib/models/attributes/AttributeDataHelper.js +3 -3
- package/lib/models/attributes/AttributeDataHelper.js.flow +1 -0
- package/lib/models/attributes/AttributeDataHelper.js.map +1 -1
- package/lib/models/attributes/BooleanAttributeModel.js +2 -2
- package/lib/models/attributes/ChoiceAttributeModel.js +2 -2
- package/lib/models/attributes/ChoiceAttributeOptionCollection.js +2 -2
- package/lib/models/attributes/CompositeAttributeChildCollection.js +2 -2
- package/lib/models/attributes/HelptextAttributeModel.js +24 -9
- package/lib/models/attributes/HelptextAttributeModel.js.flow +18 -5
- package/lib/models/attributes/HelptextAttributeModel.js.map +1 -1
- package/lib/models/attributes/__tests__/AttributeCollection.spec.js.flow +4 -4
- package/lib/models/attributes/__tests__/AttributeContent.spec.js.flow +13 -19
- package/lib/models/attributes/__tests__/HelptextAttributeModel.spec.js.flow +18 -10
- package/lib/models/attributes/_createAttribute.js +2 -2
- package/lib/models/base/ResourceModel.js +2 -2
- package/lib/models/caseview/CaseViewModel.js +5 -5
- package/lib/models/caseview/CaseViewModel.js.flow +5 -3
- package/lib/models/caseview/CaseViewModel.js.map +1 -1
- package/lib/models/caseview/__tests__/CaseViewModel.spec.js.flow +43 -4
- package/lib/models/concepts/ConceptDetailModel.js +2 -2
- package/lib/models/concepts/SourceReferenceModel.js +2 -2
- package/lib/models/content/ContentTOCModel.js +2 -2
- package/lib/models/filters/AssignmentFilterModel.js +2 -2
- package/lib/models/filters/BaseFilterModel.js +2 -2
- package/lib/models/filters/ConceptIndexFilterModel.js +3 -1
- package/lib/models/filters/ConceptIndexFilterModel.js.map +1 -1
- package/lib/models/filters/FilterCollection.js +2 -2
- package/lib/models/filters/FilterModel.js +3 -1
- package/lib/models/filters/FilterModel.js.map +1 -1
- package/lib/models/form/FormModel.js +28 -4
- package/lib/models/form/FormModel.js.flow +18 -1
- package/lib/models/form/FormModel.js.map +1 -1
- package/lib/models/form/FormObjectModel.js +5 -7
- package/lib/models/form/FormObjectModel.js.flow +2 -4
- package/lib/models/form/FormObjectModel.js.map +1 -1
- package/lib/models/form/__tests__/FormModel.getters.spec.js.flow +15 -0
- package/lib/models/form/__tests__/FormObjectModel.spec.js.flow +29 -3
- package/lib/models/grouping/GroupingModel.js +2 -2
- package/lib/models/links/normalizeLinkJSON.js +2 -2
- package/lib/models/list/ListDetailModel.js +4 -6
- package/lib/models/list/ListDetailModel.js.flow +2 -2
- package/lib/models/list/ListDetailModel.js.map +1 -1
- package/lib/models/list/ListItemCollection.js +40 -0
- package/lib/models/list/ListItemCollection.js.flow +38 -1
- package/lib/models/list/ListItemCollection.js.map +1 -1
- package/lib/models/list/ListItemModel.js +14 -2
- package/lib/models/list/ListItemModel.js.flow +15 -0
- package/lib/models/list/ListItemModel.js.map +1 -1
- package/lib/models/list/ListModel.js +18 -75
- package/lib/models/list/ListModel.js.flow +3 -47
- package/lib/models/list/ListModel.js.map +1 -1
- package/lib/models/list/__tests__/ListDetailModel.spec.js.flow +5 -3
- package/lib/models/list/__tests__/ListItemCollection.spec.js.flow +22 -0
- package/lib/models/list/__tests__/ListModel.spec.js.flow +5 -5
- package/lib/models/lookup/LookupOptionCollection.js +2 -2
- package/lib/models/panels/GroupingPanelModel.js +2 -4
- package/lib/models/panels/GroupingPanelModel.js.flow +2 -2
- package/lib/models/panels/GroupingPanelModel.js.map +1 -1
- package/lib/models/panels/__tests__/GroupingPanelModel.spec.js.flow +43 -24
- package/lib/models/process/__tests__/ProcessStatusSettingsModel.spec.js.flow +11 -0
- package/lib/models/types.js.flow +3 -3
- package/lib/modularui/ModularUIError.js +3 -1
- package/lib/modularui/ModularUIError.js.map +1 -1
- package/lib/modularui/ModularUIRequest.js +69 -49
- package/lib/modularui/ModularUIRequest.js.flow +38 -22
- package/lib/modularui/ModularUIRequest.js.map +1 -1
- package/lib/react-server/serverUtil.js +2 -2
- package/lib/react-theme/createTheme.js +2 -2
- package/lib/redux/_i18n/reducer.js +2 -2
- package/lib/redux/_modularui/actions.js +2 -2
- package/lib/redux/_modularui/connector.js +2 -2
- package/lib/redux/_modularui/reducer.js +2 -2
- package/lib/redux/_modularui/selectors.js +2 -2
- package/lib/redux/reducers/AuthReducer.js +2 -2
- package/lib/redux/reducers/ModalsReducer.js +2 -2
- package/lib/redux/reducers/NotificationReducer.js +2 -2
- package/lib/redux/reducers/PreferencesReducer.js +2 -2
- package/lib/redux/reducers/ProgressIndicatorReducer.js +2 -2
- package/lib/redux/store/configureStore.js +2 -2
- package/lib/utils/browser/Cookies.js +18 -31
- package/lib/utils/browser/Cookies.js.flow +22 -28
- package/lib/utils/browser/Cookies.js.map +1 -1
- package/lib/utils/browser/__tests__/Cookies.spec.js.flow +51 -0
- package/lib/utils/fetch/xhr.js +4 -3
- package/lib/utils/fetch/xhr.js.flow +3 -1
- package/lib/utils/fetch/xhr.js.map +1 -1
- package/package.json +36 -34
- package/src/builder/mergeLayoutHintConfigurations.js +3 -3
- package/src/hooks/useContent.js +2 -2
- package/src/hooks/useDeepCompareEffect.js +1 -1
- package/src/hooks/useForm.js +1 -2
- package/src/hooks/useModal.js +1 -1
- package/src/hooks/useModularUI.js +0 -2
- package/src/i18n/Locale.js +7 -0
- package/src/i18n/__tests__/Locale.spec.js +14 -0
- package/src/i18n/languages.js +1 -0
- package/src/i18n/types.js +1 -0
- package/src/models/attributes/AttributeContent.js +63 -16
- package/src/models/attributes/AttributeDataHelper.js +1 -0
- package/src/models/attributes/HelptextAttributeModel.js +18 -5
- package/src/models/attributes/__mock__/_FormCollectionContribution.json +9 -0
- package/src/models/attributes/__mock__/_FormCollectionData.json +12 -3
- package/src/models/attributes/__tests__/AttributeCollection.spec.js +4 -4
- package/src/models/attributes/__tests__/AttributeContent.spec.js +13 -19
- package/src/models/attributes/__tests__/HelptextAttributeModel.spec.js +18 -10
- package/src/models/caseview/CaseViewModel.js +5 -3
- package/src/models/caseview/__tests__/CaseViewModel.spec.js +43 -4
- package/src/models/caseview/__tests__/caseview.json +14 -3
- package/src/models/caseview/__tests__/caseviewContributions.json +48 -77
- package/src/models/caseview/__tests__/caseview_local_taskgroup.json +57 -0
- package/src/models/form/FormModel.js +18 -1
- package/src/models/form/FormObjectModel.js +2 -4
- package/src/models/form/__tests__/FormModel.getters.spec.js +15 -0
- package/src/models/form/__tests__/FormObjectModel.spec.js +29 -3
- package/src/models/list/ListDetailModel.js +2 -2
- package/src/models/list/ListItemCollection.js +38 -1
- package/src/models/list/ListItemModel.js +15 -0
- package/src/models/list/ListModel.js +3 -47
- package/src/models/list/__tests__/ListDetailModel.spec.js +5 -3
- package/src/models/list/__tests__/ListItemCollection.spec.js +22 -0
- package/src/models/list/__tests__/ListModel.spec.js +5 -5
- package/src/models/panels/GroupingPanelModel.js +2 -2
- package/src/models/panels/__tests__/GroupingPanelModel.spec.js +43 -24
- package/src/models/panels/__tests__/groupingPanel.json +20 -1
- package/src/models/panels/__tests__/groupingPanelContributions.json +14 -1
- package/src/models/process/__tests__/ProcessStatusSettingsModel.spec.js +11 -0
- package/src/models/types.js +3 -3
- package/src/modularui/ModularUIRequest.js +38 -22
- package/src/utils/browser/Cookies.js +22 -28
- package/src/utils/browser/__tests__/Cookies.spec.js +51 -0
- package/src/utils/fetch/xhr.js +3 -1
|
@@ -2,13 +2,14 @@ import GroupingPanelModel from "../GroupingPanelModel";
|
|
|
2
2
|
|
|
3
3
|
import panelJson from "./groupingPanel.json";
|
|
4
4
|
import panelContributionsJson from "./groupingPanelContributions.json";
|
|
5
|
-
import CaseViewModel from "../../caseview/CaseViewModel";
|
|
6
5
|
|
|
7
6
|
describe("groupingPanelModel", () => {
|
|
8
7
|
it("should be able to create an empty GroupingPanelModel object", () => {
|
|
9
8
|
const groupingPanel = new GroupingPanelModel();
|
|
10
9
|
|
|
11
10
|
expect(groupingPanel).toBeInstanceOf(GroupingPanelModel);
|
|
11
|
+
expect(groupingPanel.type).toBe("GroupingPanel");
|
|
12
|
+
expect(groupingPanel.introtext).toBe("");
|
|
12
13
|
|
|
13
14
|
expect(
|
|
14
15
|
GroupingPanelModel.isApplicableModel({
|
|
@@ -51,10 +52,24 @@ describe("groupingPanelModel", () => {
|
|
|
51
52
|
expect(groupingPanel.panelLinks).toHaveLength(1);
|
|
52
53
|
|
|
53
54
|
expect(groupingPanel.hasIntroText()).toBe(true);
|
|
55
|
+
|
|
56
|
+
expect(groupingPanel.getInitialChildModelLinks()).toHaveLength(4);
|
|
57
|
+
});
|
|
58
|
+
|
|
59
|
+
it("can handle local taskgroups", () => {
|
|
60
|
+
const groupingPanel = new GroupingPanelModel({
|
|
61
|
+
key: "AskingQuestions",
|
|
62
|
+
data: panelJson,
|
|
63
|
+
contributions: panelContributionsJson,
|
|
64
|
+
});
|
|
65
|
+
|
|
66
|
+
expect(groupingPanel.hasTaskGroups()).toBe(true);
|
|
67
|
+
expect(groupingPanel.hasTasks()).toBe(true);
|
|
68
|
+
expect(groupingPanel.taskGroupCollection).toHaveLength(1);
|
|
54
69
|
});
|
|
55
70
|
|
|
56
71
|
it("should be able to handle different kind of introtext", () => {
|
|
57
|
-
const groupingPanelOldStructure = new
|
|
72
|
+
const groupingPanelOldStructure = new GroupingPanelModel({
|
|
58
73
|
key: "Book",
|
|
59
74
|
data: panelJson,
|
|
60
75
|
contributions: panelContributionsJson,
|
|
@@ -64,10 +79,10 @@ describe("groupingPanelModel", () => {
|
|
|
64
79
|
"<p>This is introtext</p>"
|
|
65
80
|
);
|
|
66
81
|
|
|
67
|
-
const groupingPanelFromDataPlain = new
|
|
82
|
+
const groupingPanelFromDataPlain = new GroupingPanelModel({
|
|
68
83
|
key: "Book",
|
|
69
84
|
data: {
|
|
70
|
-
|
|
85
|
+
_content: { text: { message: "<p>This is introtext</p>" } },
|
|
71
86
|
...panelJson,
|
|
72
87
|
},
|
|
73
88
|
contributions: panelContributionsJson,
|
|
@@ -77,12 +92,14 @@ describe("groupingPanelModel", () => {
|
|
|
77
92
|
"<p>This is introtext</p>"
|
|
78
93
|
);
|
|
79
94
|
|
|
80
|
-
const groupingPanelFromDataApplicationMessage = new
|
|
95
|
+
const groupingPanelFromDataApplicationMessage = new GroupingPanelModel({
|
|
81
96
|
key: "Book",
|
|
82
97
|
data: {
|
|
83
98
|
...panelJson,
|
|
84
|
-
|
|
85
|
-
|
|
99
|
+
_content: {
|
|
100
|
+
text: {
|
|
101
|
+
message: "<p>This is introtext</p>",
|
|
102
|
+
},
|
|
86
103
|
},
|
|
87
104
|
},
|
|
88
105
|
contributions: panelContributionsJson,
|
|
@@ -92,29 +109,31 @@ describe("groupingPanelModel", () => {
|
|
|
92
109
|
"<p>This is introtext</p>"
|
|
93
110
|
);
|
|
94
111
|
|
|
95
|
-
const groupingPanelFromNewContributionsRawTextMessage =
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
112
|
+
const groupingPanelFromNewContributionsRawTextMessage =
|
|
113
|
+
new GroupingPanelModel({
|
|
114
|
+
key: "Book",
|
|
115
|
+
data: panelJson,
|
|
116
|
+
contributions: {
|
|
117
|
+
...panelContributionsJson,
|
|
118
|
+
text: {
|
|
119
|
+
message: "<p>This is introtext</p>",
|
|
120
|
+
},
|
|
102
121
|
},
|
|
103
|
-
}
|
|
104
|
-
});
|
|
122
|
+
});
|
|
105
123
|
|
|
106
124
|
expect(groupingPanelFromNewContributionsRawTextMessage.introtext).toBe(
|
|
107
125
|
"<p>This is introtext</p>"
|
|
108
126
|
);
|
|
109
127
|
|
|
110
|
-
const groupingPanelFromNewContributionsSimpleMessage =
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
128
|
+
const groupingPanelFromNewContributionsSimpleMessage =
|
|
129
|
+
new GroupingPanelModel({
|
|
130
|
+
key: "Book",
|
|
131
|
+
data: panelJson,
|
|
132
|
+
contributions: {
|
|
133
|
+
...panelContributionsJson,
|
|
134
|
+
text: "<p>This is introtext</p>",
|
|
135
|
+
},
|
|
136
|
+
});
|
|
118
137
|
|
|
119
138
|
expect(groupingPanelFromNewContributionsSimpleMessage.introtext).toBe(
|
|
120
139
|
"<p>This is introtext</p>"
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import ProcessStatusSettingsModel from "../ProcessStatusSettingsModel";
|
|
2
|
+
import { DateUtil } from "../../../utils";
|
|
2
3
|
|
|
3
4
|
describe("processStatusSettingsModel", () => {
|
|
4
5
|
it("should be able to create an empty ProcessStatusSettingsModel object", () => {
|
|
@@ -37,5 +38,15 @@ describe("processStatusSettingsModel", () => {
|
|
|
37
38
|
expect(processStatus.isApplicable).toBeTruthy();
|
|
38
39
|
expect(processStatus.isCompleted).toBeFalsy();
|
|
39
40
|
expect(processStatus.isNeeded).toBeTruthy();
|
|
41
|
+
|
|
42
|
+
expect(processStatus.state).toBeNull();
|
|
43
|
+
expect(processStatus.canComplete).toBeNull();
|
|
44
|
+
|
|
45
|
+
expect(processStatus.referenceDate).toBe(DateUtil.now());
|
|
46
|
+
|
|
47
|
+
expect(processStatus.links).toHaveLength(1);
|
|
48
|
+
expect(processStatus.conceptLink.href.path).toBe(
|
|
49
|
+
"/concepts/Research grant/Business design/Constraints/Eligible for research grant.bixml/EligibleResearchGrant"
|
|
50
|
+
);
|
|
40
51
|
});
|
|
41
52
|
});
|
package/lib/models/types.js.flow
CHANGED
|
@@ -215,21 +215,21 @@ export type ContentElement = {
|
|
|
215
215
|
},
|
|
216
216
|
};
|
|
217
217
|
|
|
218
|
-
type PropertyElementMapped = {
|
|
218
|
+
export type PropertyElementMapped = {
|
|
219
219
|
propertyElement: {
|
|
220
220
|
label: string,
|
|
221
221
|
layouthint: LayoutHintCollection,
|
|
222
222
|
properties: Array<PropertyData>,
|
|
223
223
|
},
|
|
224
224
|
};
|
|
225
|
-
type TextFragmentElementMapped = {
|
|
225
|
+
export type TextFragmentElementMapped = {
|
|
226
226
|
textFragmentElement: {
|
|
227
227
|
label: string,
|
|
228
228
|
layouthint: LayoutHintCollection,
|
|
229
229
|
textfragments: Array<TextFragmentData>,
|
|
230
230
|
},
|
|
231
231
|
};
|
|
232
|
-
type ContentElementMapped = {
|
|
232
|
+
export type ContentElementMapped = {
|
|
233
233
|
contentElement: {
|
|
234
234
|
label: string,
|
|
235
235
|
layouthint: LayoutHintCollection,
|
|
@@ -9,6 +9,8 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
9
9
|
});
|
|
10
10
|
exports.default = void 0;
|
|
11
11
|
|
|
12
|
+
var _createClass2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/createClass"));
|
|
13
|
+
|
|
12
14
|
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/classCallCheck"));
|
|
13
15
|
|
|
14
16
|
var _assertThisInitialized2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/assertThisInitialized"));
|
|
@@ -55,7 +57,7 @@ var ModularUIError = /*#__PURE__*/function (_Error) {
|
|
|
55
57
|
return _this;
|
|
56
58
|
}
|
|
57
59
|
|
|
58
|
-
return ModularUIError;
|
|
60
|
+
return (0, _createClass2.default)(ModularUIError);
|
|
59
61
|
}( /*#__PURE__*/(0, _wrapNativeSuper2.default)(Error));
|
|
60
62
|
|
|
61
63
|
var _default = ModularUIError;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/modularui/ModularUIError.js"],"names":["ModularUIError","message","response","resource","Error","captureStackTrace"],"mappings":"
|
|
1
|
+
{"version":3,"sources":["../../src/modularui/ModularUIError.js"],"names":["ModularUIError","message","response","resource","Error","captureStackTrace"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA;AACA;IACMA,c;;;;;AAIJ;AACF;AACE,0BAAYC,OAAZ,EAA6BC,QAA7B,EAA+CC,QAA/C,EAAiE;AAAA;;AAAA;AAC/D,8BAAMF,OAAN;AAD+D;AAAA;AAG/D,UAAKC,QAAL,GAAgBA,QAAhB;AACA,UAAKC,QAAL,GAAgBA,QAAhB,CAJ+D,CAM/D;AACA;AACA;;AACA,QAAIC,KAAK,CAACC,iBAAV,EAA6B;AAC3BD,MAAAA,KAAK,CAACC,iBAAN,8CAA8BL,cAA9B;AACD;;AAX8D;AAYhE;;;+CAlB0BI,K;;eAqBdJ,c","sourcesContent":["// @flow\n/**\n */\nclass ModularUIError extends Error {\n response: Object;\n resource: string;\n\n /**\n */\n constructor(message: string, response: Object, resource: string) {\n super(message);\n\n this.response = response;\n this.resource = resource;\n\n // Without passing ModularUIError to captureStackTrace, the ModularUIError\n // frame would show up in the .stack property. By passing\n // the constructor, we omit that frame, and retain all frames below it.\n if (Error.captureStackTrace) {\n Error.captureStackTrace(this, ModularUIError);\n }\n }\n}\n\nexport default ModularUIError;\n"],"file":"ModularUIError.js"}
|
|
@@ -87,9 +87,9 @@ function _unsupportedIterableToArray(o, minLen) { var _context9; if (!o) return;
|
|
|
87
87
|
|
|
88
88
|
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
|
|
89
89
|
|
|
90
|
-
function ownKeys(object, enumerableOnly) { var keys = _Object$keys10(object); if (_Object$getOwnPropertySymbols) { var symbols = _Object$getOwnPropertySymbols(object);
|
|
90
|
+
function ownKeys(object, enumerableOnly) { var keys = _Object$keys10(object); if (_Object$getOwnPropertySymbols) { var symbols = _Object$getOwnPropertySymbols(object); enumerableOnly && (symbols = _filterInstanceProperty2(symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
91
91
|
|
|
92
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]
|
|
92
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { (0, _defineProperty2.default)(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors ? Object.defineProperties(target, _Object$getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, _Object$getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
93
93
|
|
|
94
94
|
/**
|
|
95
95
|
* Helper for fetching data and contributions from the Be Informed modular ui
|
|
@@ -540,6 +540,35 @@ var ModularUIRequest = /*#__PURE__*/function () {
|
|
|
540
540
|
|
|
541
541
|
return _promise.default.resolve();
|
|
542
542
|
}
|
|
543
|
+
/**
|
|
544
|
+
* Retrieve an object of key: link
|
|
545
|
+
*/
|
|
546
|
+
|
|
547
|
+
}, {
|
|
548
|
+
key: "dataLinksPerName",
|
|
549
|
+
value: function dataLinksPerName(dataLinks) {
|
|
550
|
+
if (Array.isArray(dataLinks)) {
|
|
551
|
+
var links = {};
|
|
552
|
+
|
|
553
|
+
var _iterator2 = _createForOfIteratorHelper(dataLinks),
|
|
554
|
+
_step2;
|
|
555
|
+
|
|
556
|
+
try {
|
|
557
|
+
for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
|
|
558
|
+
var dataLink = _step2.value;
|
|
559
|
+
links[dataLink.name] = dataLink;
|
|
560
|
+
}
|
|
561
|
+
} catch (err) {
|
|
562
|
+
_iterator2.e(err);
|
|
563
|
+
} finally {
|
|
564
|
+
_iterator2.f();
|
|
565
|
+
}
|
|
566
|
+
|
|
567
|
+
return links;
|
|
568
|
+
}
|
|
569
|
+
|
|
570
|
+
return dataLinks;
|
|
571
|
+
}
|
|
543
572
|
/**
|
|
544
573
|
* Check if links are empty and hide them when hide-when-empty hint exists
|
|
545
574
|
*/
|
|
@@ -547,53 +576,44 @@ var ModularUIRequest = /*#__PURE__*/function () {
|
|
|
547
576
|
}, {
|
|
548
577
|
key: "processLinks",
|
|
549
578
|
value: function processLinks(dataLinks, contributionLinks) {
|
|
550
|
-
var
|
|
579
|
+
var linksPerName = this.dataLinksPerName(dataLinks);
|
|
580
|
+
var hideWhenEmptyLinks = (0, _filter.default)(contributionLinks).call(contributionLinks, function (contributionLink) {
|
|
581
|
+
var _contributionLink$lay;
|
|
551
582
|
|
|
583
|
+
return (_contributionLink$lay = contributionLink.layouthint) === null || _contributionLink$lay === void 0 ? void 0 : (0, _includes.default)(_contributionLink$lay).call(_contributionLink$lay, _LayoutHints.HIDE_WHEN_EMPTY);
|
|
584
|
+
});
|
|
552
585
|
var isHiddenListChecks = [];
|
|
553
586
|
|
|
554
|
-
var
|
|
555
|
-
|
|
587
|
+
var _iterator3 = _createForOfIteratorHelper(hideWhenEmptyLinks),
|
|
588
|
+
_step3;
|
|
556
589
|
|
|
557
590
|
try {
|
|
558
|
-
|
|
559
|
-
var
|
|
560
|
-
|
|
561
|
-
var contributionLink = _step2.value;
|
|
562
|
-
|
|
563
|
-
if ((_contributionLink$lay = contributionLink.layouthint) !== null && _contributionLink$lay !== void 0 && (0, _includes.default)(_contributionLink$lay).call(_contributionLink$lay, _LayoutHints.HIDE_WHEN_EMPTY)) {
|
|
564
|
-
var dataLink = Array.isArray(dataLinks) ? (0, _find.default)(dataLinks).call(dataLinks, function (link) {
|
|
565
|
-
return link.name === contributionLink.name;
|
|
566
|
-
}) : dataLinks[contributionLink.name];
|
|
591
|
+
for (_iterator3.s(); !(_step3 = _iterator3.n()).done;) {
|
|
592
|
+
var contributionLink = _step3.value;
|
|
593
|
+
var dataLink = linksPerName[contributionLink.name];
|
|
567
594
|
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
}
|
|
595
|
+
if (dataLink !== null && dataLink !== void 0 && dataLink.href) {
|
|
596
|
+
isHiddenListChecks.push(this.isHiddenList(contributionLink.name, dataLink.href));
|
|
571
597
|
}
|
|
572
|
-
};
|
|
573
|
-
|
|
574
|
-
for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
|
|
575
|
-
_loop2();
|
|
576
598
|
}
|
|
577
599
|
} catch (err) {
|
|
578
|
-
|
|
600
|
+
_iterator3.e(err);
|
|
579
601
|
} finally {
|
|
580
|
-
|
|
602
|
+
_iterator3.f();
|
|
581
603
|
}
|
|
582
604
|
|
|
583
605
|
return _promise.default.all(isHiddenListChecks).then(function (hiddenLinks) {
|
|
584
|
-
var newDataLinks;
|
|
585
|
-
|
|
586
606
|
if (Array.isArray(dataLinks)) {
|
|
587
|
-
|
|
607
|
+
return (0, _filter.default)(dataLinks).call(dataLinks, function (dataLink) {
|
|
588
608
|
return !(0, _includes.default)(hiddenLinks).call(hiddenLinks, dataLink.name);
|
|
589
609
|
});
|
|
590
|
-
}
|
|
591
|
-
newDataLinks = {};
|
|
610
|
+
}
|
|
592
611
|
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
612
|
+
var newDataLinks = {};
|
|
613
|
+
|
|
614
|
+
for (var dataLinkKey in dataLinks) {
|
|
615
|
+
if (!(0, _includes.default)(hiddenLinks).call(hiddenLinks, dataLinkKey)) {
|
|
616
|
+
newDataLinks[dataLinkKey] = dataLinks[dataLinkKey];
|
|
597
617
|
}
|
|
598
618
|
}
|
|
599
619
|
|
|
@@ -703,31 +723,31 @@ var ModularUIRequest = /*#__PURE__*/function () {
|
|
|
703
723
|
}, {
|
|
704
724
|
key: "fetch",
|
|
705
725
|
value: function fetch() {
|
|
706
|
-
var
|
|
726
|
+
var _this4 = this;
|
|
707
727
|
|
|
708
728
|
return this.fetchDataService().then(function (data) {
|
|
709
729
|
if (data == null) {
|
|
710
|
-
throw new Error("No data received for ".concat(
|
|
730
|
+
throw new Error("No data received for ".concat(_this4.href.toString()));
|
|
711
731
|
}
|
|
712
732
|
|
|
713
|
-
|
|
733
|
+
_this4.processDataService(data);
|
|
714
734
|
|
|
715
|
-
return
|
|
735
|
+
return _this4.fetchContributionsService();
|
|
716
736
|
}).then(function (contributionsData) {
|
|
717
737
|
if (contributionsData == null) {
|
|
718
|
-
throw new Error("No contributions data received for ".concat(
|
|
738
|
+
throw new Error("No contributions data received for ".concat(_this4.contributionsHref));
|
|
719
739
|
}
|
|
720
740
|
|
|
721
|
-
|
|
741
|
+
_this4.processContributionsService(contributionsData);
|
|
722
742
|
|
|
723
|
-
return
|
|
743
|
+
return _this4.processAsyncLayoutHints();
|
|
724
744
|
}).then(function () {
|
|
725
|
-
return _promise.default.resolve(
|
|
745
|
+
return _promise.default.resolve(_this4.createModel());
|
|
726
746
|
}).then(function (model) {
|
|
727
|
-
return
|
|
747
|
+
return _this4.loadDynamicValidations(model);
|
|
728
748
|
}).then(function (model) {
|
|
729
|
-
if (
|
|
730
|
-
return
|
|
749
|
+
if (_this4.withChildModels) {
|
|
750
|
+
return _this4.fetchChildModels(model);
|
|
731
751
|
}
|
|
732
752
|
|
|
733
753
|
return _promise.default.resolve(model);
|
|
@@ -750,12 +770,12 @@ var ModularUIRequest = /*#__PURE__*/function () {
|
|
|
750
770
|
}, {
|
|
751
771
|
key: "fetchChildModels",
|
|
752
772
|
value: function fetchChildModels(model) {
|
|
753
|
-
var
|
|
773
|
+
var _this5 = this;
|
|
754
774
|
|
|
755
775
|
var childModelLinks = model.getInitialChildModelLinks();
|
|
756
776
|
var childModelRequests = (0, _map.default)(childModelLinks).call(childModelLinks, function (childModelLink) {
|
|
757
777
|
var request = new ModularUIRequest(childModelLink.href, {
|
|
758
|
-
locale:
|
|
778
|
+
locale: _this5.locale
|
|
759
779
|
});
|
|
760
780
|
|
|
761
781
|
if (childModelLink.targetModel) {
|
|
@@ -791,11 +811,11 @@ var ModularUIRequest = /*#__PURE__*/function () {
|
|
|
791
811
|
}, {
|
|
792
812
|
key: "fetchContent",
|
|
793
813
|
value: function fetchContent(withChildSections) {
|
|
794
|
-
var
|
|
814
|
+
var _this6 = this;
|
|
795
815
|
|
|
796
816
|
return this.fetchFromCache().then(function (model) {
|
|
797
817
|
if (withChildSections && model instanceof _ContentModel.default && model.childSectionLinks.length > 0) {
|
|
798
|
-
return
|
|
818
|
+
return _this6.fetchContentChildSections(model);
|
|
799
819
|
}
|
|
800
820
|
|
|
801
821
|
return _promise.default.resolve(model);
|
|
@@ -809,13 +829,13 @@ var ModularUIRequest = /*#__PURE__*/function () {
|
|
|
809
829
|
key: "fetchContentChildSections",
|
|
810
830
|
value: function fetchContentChildSections(contentModel) {
|
|
811
831
|
var _context8,
|
|
812
|
-
|
|
832
|
+
_this7 = this;
|
|
813
833
|
|
|
814
834
|
var newContentModel = contentModel.clone();
|
|
815
835
|
return _promise.default.all((0, _map.default)(_context8 = contentModel.childSectionLinks).call(_context8, function (childSectionLink) {
|
|
816
836
|
var contentHrefWithEntryDate = childSectionLink.selfhref.addParameter(_Constants.TIMEVERSION_FILTER_NAME, contentModel.entryDate);
|
|
817
837
|
var request = new ModularUIRequest(contentHrefWithEntryDate, {
|
|
818
|
-
locale:
|
|
838
|
+
locale: _this7.locale
|
|
819
839
|
});
|
|
820
840
|
return request.fetchContent(true);
|
|
821
841
|
})).then(function (sectionModels) {
|
|
@@ -386,6 +386,20 @@ class ModularUIRequest {
|
|
|
386
386
|
return Promise.resolve();
|
|
387
387
|
}
|
|
388
388
|
|
|
389
|
+
/**
|
|
390
|
+
* Retrieve an object of key: link
|
|
391
|
+
*/
|
|
392
|
+
dataLinksPerName(dataLinks: any): { [linkName: string]: any } {
|
|
393
|
+
if (Array.isArray(dataLinks)) {
|
|
394
|
+
const links = {};
|
|
395
|
+
for (const dataLink of dataLinks) {
|
|
396
|
+
links[dataLink.name] = dataLink;
|
|
397
|
+
}
|
|
398
|
+
return links;
|
|
399
|
+
}
|
|
400
|
+
return dataLinks;
|
|
401
|
+
}
|
|
402
|
+
|
|
389
403
|
/**
|
|
390
404
|
* Check if links are empty and hide them when hide-when-empty hint exists
|
|
391
405
|
*/
|
|
@@ -393,42 +407,44 @@ class ModularUIRequest {
|
|
|
393
407
|
dataLinks: any,
|
|
394
408
|
contributionLinks: any
|
|
395
409
|
): Promise<Object | Array<Object>> {
|
|
410
|
+
const linksPerName = this.dataLinksPerName(dataLinks);
|
|
411
|
+
const hideWhenEmptyLinks = contributionLinks.filter((contributionLink) =>
|
|
412
|
+
contributionLink.layouthint?.includes(HIDE_WHEN_EMPTY)
|
|
413
|
+
);
|
|
414
|
+
|
|
396
415
|
const isHiddenListChecks = [];
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
isHiddenListChecks.push(
|
|
405
|
-
this.isHiddenList(contributionLink.name, dataLink.href)
|
|
406
|
-
);
|
|
407
|
-
}
|
|
416
|
+
|
|
417
|
+
for (const contributionLink of hideWhenEmptyLinks) {
|
|
418
|
+
const dataLink = linksPerName[contributionLink.name];
|
|
419
|
+
if (dataLink?.href) {
|
|
420
|
+
isHiddenListChecks.push(
|
|
421
|
+
this.isHiddenList(contributionLink.name, dataLink.href)
|
|
422
|
+
);
|
|
408
423
|
}
|
|
409
424
|
}
|
|
410
425
|
|
|
411
|
-
return Promise.all(isHiddenListChecks).then(
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
426
|
+
return Promise.all(isHiddenListChecks).then(
|
|
427
|
+
(hiddenLinks: Array<string>) => {
|
|
428
|
+
if (Array.isArray(dataLinks)) {
|
|
429
|
+
return dataLinks.filter(
|
|
430
|
+
(dataLink) => !hiddenLinks.includes(dataLink.name)
|
|
431
|
+
);
|
|
432
|
+
}
|
|
433
|
+
|
|
434
|
+
const newDataLinks = {};
|
|
419
435
|
for (const dataLinkKey in dataLinks) {
|
|
420
436
|
if (!hiddenLinks.includes(dataLinkKey)) {
|
|
421
437
|
newDataLinks[dataLinkKey] = dataLinks[dataLinkKey];
|
|
422
438
|
}
|
|
423
439
|
}
|
|
440
|
+
return newDataLinks;
|
|
424
441
|
}
|
|
425
|
-
|
|
426
|
-
});
|
|
442
|
+
);
|
|
427
443
|
}
|
|
428
444
|
|
|
429
445
|
/**
|
|
430
446
|
*/
|
|
431
|
-
isHiddenList(name: string, href: string): Promise
|
|
447
|
+
isHiddenList(name: string, href: string): Promise<string> {
|
|
432
448
|
return universalFetch({
|
|
433
449
|
...this.options,
|
|
434
450
|
url: `${BASE}${href}`,
|