@beinformed/ui 1.11.0 → 1.13.0
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 +29 -0
- 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/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 +2 -4
- 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 +30 -6
- 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/ListModel.js +4 -6
- 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 +2 -2
- 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/fetch/xhr.js +2 -2
- 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/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 +2 -4
- package/lib/models/caseview/CaseViewModel.js.flow +2 -2
- package/lib/models/caseview/CaseViewModel.js.map +1 -1
- package/lib/models/caseview/__tests__/CaseViewModel.spec.js.flow +5 -3
- 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 +30 -6
- package/lib/models/form/FormModel.js.flow +21 -4
- 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/ListModel.js +4 -6
- package/lib/models/list/ListModel.js.flow +2 -2
- 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__/ListModel.spec.js.flow +5 -3
- 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 +5 -3
- 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 +2 -2
- 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/fetch/xhr.js +2 -2
- package/package.json +28 -28
- 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 +2 -2
- package/src/models/caseview/__tests__/CaseViewModel.spec.js +5 -3
- package/src/models/form/FormModel.js +21 -4
- 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/ListModel.js +2 -2
- package/src/models/list/__tests__/ListDetailModel.spec.js +5 -3
- package/src/models/list/__tests__/ListModel.spec.js +5 -3
- package/src/models/panels/GroupingPanelModel.js +2 -2
- package/src/models/panels/__tests__/GroupingPanelModel.spec.js +5 -3
- package/src/models/types.js +3 -3
|
@@ -39,7 +39,7 @@ describe("caseViewModel", () => {
|
|
|
39
39
|
const caseviewFromDataPlain = new CaseViewModel({
|
|
40
40
|
key: "Book",
|
|
41
41
|
data: {
|
|
42
|
-
|
|
42
|
+
_content: { text: { message: "<p>This is introtext</p>" } },
|
|
43
43
|
...caseviewJson,
|
|
44
44
|
},
|
|
45
45
|
contributions: caseviewContributionsJson,
|
|
@@ -51,8 +51,10 @@ describe("caseViewModel", () => {
|
|
|
51
51
|
key: "Book",
|
|
52
52
|
data: {
|
|
53
53
|
...caseviewJson,
|
|
54
|
-
|
|
55
|
-
|
|
54
|
+
_content: {
|
|
55
|
+
text: {
|
|
56
|
+
message: "<p>This is introtext</p>",
|
|
57
|
+
},
|
|
56
58
|
},
|
|
57
59
|
},
|
|
58
60
|
contributions: caseviewContributionsJson,
|
|
@@ -153,14 +153,14 @@ class FormModel extends ResourceModel {
|
|
|
153
153
|
*/
|
|
154
154
|
getButtonLabel(
|
|
155
155
|
buttonType: "cancel" | "previous" | "next" | "finish"
|
|
156
|
-
): string {
|
|
156
|
+
): string | null {
|
|
157
157
|
// cancel button labels are defined on the form
|
|
158
158
|
if (buttonType === "cancel") {
|
|
159
|
-
return get(this.buttonLabels, "cancel",
|
|
159
|
+
return get(this.buttonLabels, "cancel", null);
|
|
160
160
|
}
|
|
161
161
|
|
|
162
162
|
// all other form related button labels are defined on the object
|
|
163
|
-
return get(this.currentFormObject?.buttonLabels, buttonType,
|
|
163
|
+
return get(this.currentFormObject?.buttonLabels, buttonType, null);
|
|
164
164
|
}
|
|
165
165
|
|
|
166
166
|
/**
|
|
@@ -598,6 +598,12 @@ class FormModel extends ResourceModel {
|
|
|
598
598
|
return this._redirectLocation || this.successRedirect;
|
|
599
599
|
}
|
|
600
600
|
|
|
601
|
+
/**
|
|
602
|
+
*/
|
|
603
|
+
getSuccessData(): Object {
|
|
604
|
+
return this.data.success?.data;
|
|
605
|
+
}
|
|
606
|
+
|
|
601
607
|
/**
|
|
602
608
|
* Href handling
|
|
603
609
|
*/
|
|
@@ -664,15 +670,26 @@ class FormModel extends ResourceModel {
|
|
|
664
670
|
* Handle form tokens to indicate concurrent form use
|
|
665
671
|
*/
|
|
666
672
|
get tokens(): Array<string> {
|
|
667
|
-
|
|
673
|
+
if (!this._tokens) {
|
|
674
|
+
this._tokens = this.data.tokens ?? [];
|
|
675
|
+
}
|
|
676
|
+
return this._tokens;
|
|
668
677
|
}
|
|
669
678
|
|
|
670
679
|
/**
|
|
680
|
+
* Replaces all tokens with the given collection of tokens
|
|
671
681
|
*/
|
|
672
682
|
set tokens(tokens: Array<string>) {
|
|
673
683
|
this._tokens = tokens;
|
|
674
684
|
}
|
|
675
685
|
|
|
686
|
+
/**
|
|
687
|
+
* Removes all tokens from the form
|
|
688
|
+
*/
|
|
689
|
+
removeTokens() {
|
|
690
|
+
this._tokens = [];
|
|
691
|
+
}
|
|
692
|
+
|
|
676
693
|
/**
|
|
677
694
|
* Keep track of changed form
|
|
678
695
|
*/
|
|
@@ -296,16 +296,14 @@ export default class FormObjectModel extends BaseModel {
|
|
|
296
296
|
*/
|
|
297
297
|
get introText(): string {
|
|
298
298
|
if (this.data.content?.text) {
|
|
299
|
-
return this.data.content.text.message
|
|
299
|
+
return this.data.content.text.message;
|
|
300
300
|
}
|
|
301
301
|
|
|
302
302
|
if (this.contributions.text?.message) {
|
|
303
303
|
return this.contributions.text.message;
|
|
304
304
|
}
|
|
305
305
|
|
|
306
|
-
return
|
|
307
|
-
this.contributions.introText?.message ?? this.contributions.introText
|
|
308
|
-
);
|
|
306
|
+
return this.contributions.introText;
|
|
309
307
|
}
|
|
310
308
|
|
|
311
309
|
/**
|
|
@@ -73,6 +73,21 @@ describe("formModel getters", () => {
|
|
|
73
73
|
|
|
74
74
|
form.tokens = ["Token"];
|
|
75
75
|
expect(form.tokens).toHaveLength(1);
|
|
76
|
+
|
|
77
|
+
const formJSON = {
|
|
78
|
+
formresponse: {
|
|
79
|
+
tokens: ["form-token"],
|
|
80
|
+
},
|
|
81
|
+
};
|
|
82
|
+
|
|
83
|
+
const formData = ModularUIResponse.create({
|
|
84
|
+
data: formJSON,
|
|
85
|
+
contributions: FormContributionsJSON,
|
|
86
|
+
});
|
|
87
|
+
const formWithToken = new FormModel(formData);
|
|
88
|
+
expect(formWithToken.tokens).toStrictEqual(["form-token"]);
|
|
89
|
+
formWithToken.removeTokens();
|
|
90
|
+
expect(formWithToken.tokens).toHaveLength(0);
|
|
76
91
|
});
|
|
77
92
|
|
|
78
93
|
it("can handle last modification", () => {
|
|
@@ -19,7 +19,7 @@ const data = {
|
|
|
19
19
|
const contributions = {
|
|
20
20
|
repeatable: false,
|
|
21
21
|
label: "Create person",
|
|
22
|
-
|
|
22
|
+
text: { id: "IntroTextID", message: "This is introtext" },
|
|
23
23
|
attributes: [
|
|
24
24
|
{
|
|
25
25
|
Name: {
|
|
@@ -122,13 +122,15 @@ describe("formObjectModel", () => {
|
|
|
122
122
|
const contributions2 = {
|
|
123
123
|
repeatable: false,
|
|
124
124
|
label: "Create person",
|
|
125
|
-
introText: { id: "IntroTextID", message: "This is new introtext" },
|
|
126
125
|
attributes: [],
|
|
127
126
|
};
|
|
128
127
|
|
|
129
128
|
const data2 = {};
|
|
130
129
|
|
|
131
|
-
const formObject = new FormObjectModel(data2,
|
|
130
|
+
const formObject = new FormObjectModel(data2, {
|
|
131
|
+
...contributions2,
|
|
132
|
+
text: { id: "IntroTextID", message: "This is new introtext" },
|
|
133
|
+
});
|
|
132
134
|
expect(formObject.introText).toBe("This is new introtext");
|
|
133
135
|
|
|
134
136
|
const formObject2 = new FormObjectModel(data2, {
|
|
@@ -151,4 +153,28 @@ describe("formObjectModel", () => {
|
|
|
151
153
|
const formObject = new FormObjectModel(data2, contributions2);
|
|
152
154
|
expect(formObject.introText).toBe("This is new text");
|
|
153
155
|
});
|
|
156
|
+
|
|
157
|
+
it("can handle new text in data", () => {
|
|
158
|
+
const contributions2 = {
|
|
159
|
+
repeatable: false,
|
|
160
|
+
label: "Create person",
|
|
161
|
+
text: { id: "IntroTextID", message: "This is new text ${USER.ID}" },
|
|
162
|
+
attributes: [],
|
|
163
|
+
};
|
|
164
|
+
|
|
165
|
+
const data2 = {
|
|
166
|
+
content: {
|
|
167
|
+
text: {
|
|
168
|
+
id: "IntroTextID",
|
|
169
|
+
message: "This is new text 1",
|
|
170
|
+
properties: {
|
|
171
|
+
"USER.ID": "1",
|
|
172
|
+
},
|
|
173
|
+
},
|
|
174
|
+
},
|
|
175
|
+
};
|
|
176
|
+
|
|
177
|
+
const formObject = new FormObjectModel(data2, contributions2);
|
|
178
|
+
expect(formObject.introText).toBe("This is new text 1");
|
|
179
|
+
});
|
|
154
180
|
});
|
|
@@ -137,8 +137,8 @@ export default class ListDetailModel extends DetailModel {
|
|
|
137
137
|
* Getting the introduction text configured on the case view
|
|
138
138
|
*/
|
|
139
139
|
get introtext(): string {
|
|
140
|
-
if (this.data.
|
|
141
|
-
return this.data.
|
|
140
|
+
if (this.data._content) {
|
|
141
|
+
return this.data._content.text.message;
|
|
142
142
|
}
|
|
143
143
|
|
|
144
144
|
if (this.contributions.text) {
|
|
@@ -98,8 +98,8 @@ export default class ListModel extends ResourceModel {
|
|
|
98
98
|
* Getting the introduction text
|
|
99
99
|
*/
|
|
100
100
|
get introtext(): string {
|
|
101
|
-
if (this.data.
|
|
102
|
-
return this.data.text.message
|
|
101
|
+
if (this.data.content) {
|
|
102
|
+
return this.data.content.text.message;
|
|
103
103
|
}
|
|
104
104
|
|
|
105
105
|
if (this.contributions.text) {
|
|
@@ -40,7 +40,7 @@ describe("listDetailModel", () => {
|
|
|
40
40
|
const listdetailFromDataPlain = new ListDetailModel({
|
|
41
41
|
key: "Book",
|
|
42
42
|
data: {
|
|
43
|
-
|
|
43
|
+
_content: { text: { message: "<p>This is introtext</p>" } },
|
|
44
44
|
...data.Book,
|
|
45
45
|
},
|
|
46
46
|
contributions: contributions.Book,
|
|
@@ -52,8 +52,10 @@ describe("listDetailModel", () => {
|
|
|
52
52
|
key: "Book",
|
|
53
53
|
data: {
|
|
54
54
|
...data.Book,
|
|
55
|
-
|
|
56
|
-
|
|
55
|
+
_content: {
|
|
56
|
+
text: {
|
|
57
|
+
message: "<p>This is introtext</p>",
|
|
58
|
+
},
|
|
57
59
|
},
|
|
58
60
|
},
|
|
59
61
|
contributions: contributions.Book,
|
|
@@ -69,7 +69,7 @@ describe("listModel spec", () => {
|
|
|
69
69
|
const listFromDataPlain = new ListModel({
|
|
70
70
|
key: "Books",
|
|
71
71
|
data: {
|
|
72
|
-
text: "<p>This is introtext</p>",
|
|
72
|
+
content: { text: { message: "<p>This is introtext</p>" } },
|
|
73
73
|
...mockList.Books,
|
|
74
74
|
},
|
|
75
75
|
contributions: mockListContributions.Books,
|
|
@@ -81,8 +81,10 @@ describe("listModel spec", () => {
|
|
|
81
81
|
key: "Books",
|
|
82
82
|
data: {
|
|
83
83
|
...mockList.Books,
|
|
84
|
-
|
|
85
|
-
|
|
84
|
+
content: {
|
|
85
|
+
text: {
|
|
86
|
+
message: "<p>This is introtext</p>",
|
|
87
|
+
},
|
|
86
88
|
},
|
|
87
89
|
},
|
|
88
90
|
contributions: mockListContributions.Books,
|
|
@@ -85,8 +85,8 @@ export default class GroupingPanelModel extends ResourceModel {
|
|
|
85
85
|
* Getting the introduction text configured on the grouping panel
|
|
86
86
|
*/
|
|
87
87
|
get introtext(): string {
|
|
88
|
-
if (this.data.
|
|
89
|
-
return this.data.
|
|
88
|
+
if (this.data._content) {
|
|
89
|
+
return this.data._content.text.message;
|
|
90
90
|
}
|
|
91
91
|
|
|
92
92
|
if (this.contributions.text) {
|
|
@@ -67,7 +67,7 @@ describe("groupingPanelModel", () => {
|
|
|
67
67
|
const groupingPanelFromDataPlain = new CaseViewModel({
|
|
68
68
|
key: "Book",
|
|
69
69
|
data: {
|
|
70
|
-
|
|
70
|
+
_content: { text: { message: "<p>This is introtext</p>" } },
|
|
71
71
|
...panelJson,
|
|
72
72
|
},
|
|
73
73
|
contributions: panelContributionsJson,
|
|
@@ -81,8 +81,10 @@ describe("groupingPanelModel", () => {
|
|
|
81
81
|
key: "Book",
|
|
82
82
|
data: {
|
|
83
83
|
...panelJson,
|
|
84
|
-
|
|
85
|
-
|
|
84
|
+
_content: {
|
|
85
|
+
text: {
|
|
86
|
+
message: "<p>This is introtext</p>",
|
|
87
|
+
},
|
|
86
88
|
},
|
|
87
89
|
},
|
|
88
90
|
contributions: panelContributionsJson,
|
package/src/models/types.js
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,
|