@beinformed/ui 1.41.7 → 1.42.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 +30 -0
- package/esm/models/attributes/ChoiceAttributeModel.js +18 -17
- package/esm/models/attributes/ChoiceAttributeModel.js.map +1 -1
- package/esm/models/concepts/BusinessScenarioModel.js +2 -1
- package/esm/models/concepts/BusinessScenarioModel.js.map +1 -1
- package/lib/models/actions/__tests__/ActionModel.spec.js.flow +1 -1
- package/lib/models/attributes/ChoiceAttributeModel.js +18 -17
- package/lib/models/attributes/ChoiceAttributeModel.js.flow +2 -1
- package/lib/models/attributes/ChoiceAttributeModel.js.map +1 -1
- package/lib/models/attributes/__tests__/AttributeDataHelper.spec.js.flow +1 -1
- package/lib/models/attributes/__tests__/AttributeModel.spec.js.flow +4 -4
- package/lib/models/concepts/BusinessScenarioModel.js +2 -1
- package/lib/models/concepts/BusinessScenarioModel.js.flow +2 -1
- package/lib/models/concepts/BusinessScenarioModel.js.map +1 -1
- package/package.json +11 -11
- package/src/models/actions/__tests__/ActionModel.spec.js +1 -1
- package/src/models/attributes/ChoiceAttributeModel.js +2 -1
- package/src/models/attributes/__mock__/_InstrumentQuestionContributions.json +1 -1
- package/src/models/attributes/__mock__/_TreeFormAttributeContribution.json +1 -1
- package/src/models/attributes/__tests__/AttributeDataHelper.spec.js +1 -1
- package/src/models/attributes/__tests__/AttributeModel.spec.js +4 -4
- package/src/models/concepts/BusinessScenarioModel.js +2 -1
- package/src/models/concepts/__mock__/business_scenario_data.json +4 -4
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,36 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to this project will be documented in this file. See [commit-and-tag-version](https://github.com/absolute-version/commit-and-tag-version) for commit guidelines.
|
|
4
4
|
|
|
5
|
+
## [1.42.0](https://git.beinformed.com/public/nl.beinformed.bi.layout.lib.ui/compare/v1.41.0...v1.42.0) (2024-03-05)
|
|
6
|
+
|
|
7
|
+
## [1.41.8](https://git.beinformed.com/public/nl.beinformed.bi.layout.lib.ui/compare/v1.41.7...v1.41.8) (2024-03-04)
|
|
8
|
+
|
|
9
|
+
## [1.41.7](https://git.beinformed.com/public/nl.beinformed.bi.layout.lib.ui/compare/v1.41.6...v1.41.7) (2024-03-04)
|
|
10
|
+
|
|
11
|
+
## [1.41.6](https://git.beinformed.com/public/nl.beinformed.bi.layout.lib.ui/compare/v1.41.5...v1.41.6) (2024-03-04)
|
|
12
|
+
|
|
13
|
+
## [1.41.5](https://git.beinformed.com/public/nl.beinformed.bi.layout.lib.ui/compare/v1.41.4...v1.41.5) (2024-03-04)
|
|
14
|
+
|
|
15
|
+
## [1.41.4](https://git.beinformed.com/public/nl.beinformed.bi.layout.lib.ui/compare/v1.41.3...v1.41.4) (2024-02-28)
|
|
16
|
+
|
|
17
|
+
## [1.41.3](https://git.beinformed.com/public/nl.beinformed.bi.layout.lib.ui/compare/v1.41.2...v1.41.3) (2024-02-20)
|
|
18
|
+
|
|
19
|
+
## [1.41.2](https://git.beinformed.com/public/nl.beinformed.bi.layout.lib.ui/compare/v1.41.1...v1.41.2) (2024-02-20)
|
|
20
|
+
|
|
21
|
+
## [1.41.1](https://git.beinformed.com/public/nl.beinformed.bi.layout.lib.ui/compare/v1.40.0...v1.41.1) (2024-02-19)
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
### Features
|
|
25
|
+
|
|
26
|
+
* **avatarForTitleAttribute:** added avatarForTitleAttribute ([319e1e9](https://git.beinformed.com/public/nl.beinformed.bi.layout.lib.ui/commit/319e1e9e91615bc86aec7b5efae5b46cb41684f4))
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
### Bug Fixes
|
|
30
|
+
|
|
31
|
+
* **avatarForTitleAttribute:** changed LayoutHint AVATAR_FOR_TITLE to AVATAR_IN_TITLE ([2a87110](https://git.beinformed.com/public/nl.beinformed.bi.layout.lib.ui/commit/2a87110bcbe3d9d1c08551afcd8b6ebbe3f94042))
|
|
32
|
+
|
|
33
|
+
## [1.41.8](https://git.beinformed.com/public/nl.beinformed.bi.layout.lib.ui/compare/v1.41.7...v1.41.8) (2024-03-04)
|
|
34
|
+
|
|
5
35
|
## [1.41.7](https://git.beinformed.com/public/nl.beinformed.bi.layout.lib.ui/compare/v1.41.6...v1.41.7) (2024-03-04)
|
|
6
36
|
|
|
7
37
|
## [1.41.6](https://git.beinformed.com/public/nl.beinformed.bi.layout.lib.ui/compare/v1.41.5...v1.41.6) (2024-03-04)
|
|
@@ -93,7 +93,8 @@ export default class ChoiceAttributeModel extends AttributeModel {
|
|
|
93
93
|
*
|
|
94
94
|
*/
|
|
95
95
|
get avatarLink() {
|
|
96
|
-
|
|
96
|
+
var _context;
|
|
97
|
+
return _findInstanceProperty(_context = this.options.collection).call(_context, option => option.code === this.value)?.avatarLink || null;
|
|
97
98
|
}
|
|
98
99
|
|
|
99
100
|
/**
|
|
@@ -129,17 +130,17 @@ export default class ChoiceAttributeModel extends AttributeModel {
|
|
|
129
130
|
* Getting all enabled options
|
|
130
131
|
*/
|
|
131
132
|
get selected() {
|
|
132
|
-
var
|
|
133
|
+
var _context2;
|
|
133
134
|
// $FlowFixMe[incompatible-call]
|
|
134
|
-
return _mapInstanceProperty(
|
|
135
|
+
return _mapInstanceProperty(_context2 = this.options.selected).call(_context2, option => option.code);
|
|
135
136
|
}
|
|
136
137
|
|
|
137
138
|
/**
|
|
138
139
|
* Flatten options and filter out the options that are not selected
|
|
139
140
|
*/
|
|
140
141
|
get readonlyvalue() {
|
|
141
|
-
var
|
|
142
|
-
return _mapInstanceProperty(
|
|
142
|
+
var _context3;
|
|
143
|
+
return _mapInstanceProperty(_context3 = this.options.selected).call(_context3, option => option.label).join(", ");
|
|
143
144
|
}
|
|
144
145
|
|
|
145
146
|
/**
|
|
@@ -155,8 +156,8 @@ export default class ChoiceAttributeModel extends AttributeModel {
|
|
|
155
156
|
* Retrieve list of selected options, joined with comma
|
|
156
157
|
*/
|
|
157
158
|
getValue() {
|
|
158
|
-
var
|
|
159
|
-
return this.options.selected.length > 0 ? _mapInstanceProperty(
|
|
159
|
+
var _context4;
|
|
160
|
+
return this.options.selected.length > 0 ? _mapInstanceProperty(_context4 = this.options.selected).call(_context4, option => option.code).join(",") : null;
|
|
160
161
|
}
|
|
161
162
|
|
|
162
163
|
/**
|
|
@@ -176,8 +177,8 @@ export default class ChoiceAttributeModel extends AttributeModel {
|
|
|
176
177
|
* Setting an option selected or unselected based on the current state
|
|
177
178
|
*/
|
|
178
179
|
toggleOption(code) {
|
|
179
|
-
var
|
|
180
|
-
if (_includesInstanceProperty(
|
|
180
|
+
var _context5;
|
|
181
|
+
if (_includesInstanceProperty(_context5 = this.selected).call(_context5, code)) {
|
|
181
182
|
this.disableOption(code);
|
|
182
183
|
} else {
|
|
183
184
|
this.enableOption(code);
|
|
@@ -207,11 +208,11 @@ export default class ChoiceAttributeModel extends AttributeModel {
|
|
|
207
208
|
* Add a new option to the collection of lookup options
|
|
208
209
|
*/
|
|
209
210
|
addOption(option) {
|
|
210
|
-
var
|
|
211
|
+
var _context6;
|
|
211
212
|
if (!this.isMultiple) {
|
|
212
213
|
this.options.deselectAll();
|
|
213
214
|
}
|
|
214
|
-
if (_findInstanceProperty(
|
|
215
|
+
if (_findInstanceProperty(_context6 = this.options).call(_context6, opt => opt.code === option.code) === null) {
|
|
215
216
|
this.options.addOption(option.code, option);
|
|
216
217
|
}
|
|
217
218
|
}
|
|
@@ -220,8 +221,8 @@ export default class ChoiceAttributeModel extends AttributeModel {
|
|
|
220
221
|
* Getting the type of choice filter. For instance checkbox, radiobutton, combobox.
|
|
221
222
|
*/
|
|
222
223
|
get choicetype() {
|
|
223
|
-
var
|
|
224
|
-
return _findInstanceProperty(
|
|
224
|
+
var _context7;
|
|
225
|
+
return _findInstanceProperty(_context7 = ["checkbox", "radiobutton", "combobox", "list", "listview", "table", "longlist", "toggle"]).call(_context7, hint => this.layouthint.has(hint)) || "checkbox";
|
|
225
226
|
}
|
|
226
227
|
|
|
227
228
|
/**
|
|
@@ -307,13 +308,13 @@ export default class ChoiceAttributeModel extends AttributeModel {
|
|
|
307
308
|
* content configuration for instrument questions is available on the form object
|
|
308
309
|
*/
|
|
309
310
|
get contentConfiguration() {
|
|
310
|
-
var
|
|
311
|
+
var _context8;
|
|
311
312
|
if (!this.contributions.content || !this.contributions.content.optionElements) {
|
|
312
313
|
return null;
|
|
313
314
|
}
|
|
314
315
|
|
|
315
316
|
// Add RENDER_SECTION_LABEL to all content configuration to make sure the label of a section is always rendered on taxonomy and knowlege codemaps
|
|
316
|
-
const optionElementConfig = _mapInstanceProperty(
|
|
317
|
+
const optionElementConfig = _mapInstanceProperty(_context8 = this.contributions.content.optionElements).call(_context8, optionElement => {
|
|
317
318
|
if ("contentElement" in optionElement) {
|
|
318
319
|
return {
|
|
319
320
|
contentElement: {
|
|
@@ -346,9 +347,9 @@ export default class ChoiceAttributeModel extends AttributeModel {
|
|
|
346
347
|
} = error;
|
|
347
348
|
const ANSWER_OPTION_KEY = "answer-option-key";
|
|
348
349
|
if (properties && has(properties, ANSWER_OPTION_KEY)) {
|
|
349
|
-
var
|
|
350
|
+
var _context9;
|
|
350
351
|
const optionKey = properties[ANSWER_OPTION_KEY];
|
|
351
|
-
const foundOption = _findInstanceProperty(
|
|
352
|
+
const foundOption = _findInstanceProperty(_context9 = this.options).call(_context9, option => option.code === optionKey);
|
|
352
353
|
if (foundOption) {
|
|
353
354
|
properties[ANSWER_OPTION_KEY] = foundOption.getContentConfiguredLabel(this.contentConfiguration);
|
|
354
355
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ChoiceAttributeModel.js","names":["has","DateUtil","AttributeModel","ChoiceAttributeOptionCollection","ChoiceAttributeOptionModel","ContentConfigurationElements","RENDER_SECTION_LABEL","SORT_OPTIONS","ATTRIBUTE_WIDTH","ChoiceAttributeModel","constructor","attribute","attributeContributions","_defineProperty","_referenceDate","getData","now","_options","create","referenceDate","layouthint","sortOptions","isApplicableModel","contributions","type","optionMode","getContribution","hasLookupLink","lookupLink","lookupListLink","getInitialChildModelLinks","links","hasContentConfiguration","hasContentFromData","conceptLink","push","options","setChildModels","models","conceptLinkHref","href","concept","_findInstanceProperty","call","model","selfhref","equalsWithParameters","getLinkByKey","lookupListLabel","lookupList","label","avatarLink","first","find","link","key","isAvatar","optionType","date","selected","_context","_mapInstanceProperty","option","code","readonlyvalue","_context2","join","initvalue","Array","isArray","_initvalue","length","getValue","_context3","hasValue","getInputValue","toggleOption","_context4","_includesInstanceProperty","disableOption","enableOption","isMultiple","deselectAll","select","inputvalue","deselect","addOption","_context5","opt","choicetype","_context6","hint","multiplechoice","isTree","some","reset","mergeAttribute","oldAttribute","readonly","mergeOptions","isValid","update","value","updateLastModification","values","split","forEach","val","isChoiceAttributeOptionModel","equals","add","toString","_hasContentConfiguration","contentConfiguration","_context7","content","optionElements","optionElementConfig","optionElement","contentElement","placeholder","addServerError","error","id","message","properties","ANSWER_OPTION_KEY","_context8","optionKey","foundOption","getContentConfiguredLabel","_errorCollection","readonlyWidth","SMALL","MEDIUM"],"sources":["../../../src/models/attributes/ChoiceAttributeModel.js"],"sourcesContent":["// @flow\nimport { has } from \"../../utils/helpers/objects\";\nimport { DateUtil } from \"../../utils/datetime/DateTimeUtil\";\n\nimport AttributeModel from \"./AttributeModel\";\nimport ChoiceAttributeOptionCollection from \"./ChoiceAttributeOptionCollection\";\nimport ChoiceAttributeOptionModel from \"./ChoiceAttributeOptionModel\";\nimport ContentConfigurationElements from \"../contentconfiguration/ContentConfigurationElements\";\n\nimport {\n RENDER_SECTION_LABEL,\n SORT_OPTIONS,\n} from \"../../constants/LayoutHints\";\nimport { ATTRIBUTE_WIDTH } from \"../../constants\";\n\nimport type { ModularUIModel, AttributeType, FormErrorAnchor } from \"../types\";\nimport type LinkModel from \"../links/LinkModel\";\n\n/**\n * Model for a choice attribute\n */\nexport default class ChoiceAttributeModel extends AttributeModel {\n _referenceDate: ISO_DATE;\n _options: ChoiceAttributeOptionCollection;\n _hasContentConfiguration: boolean;\n\n /**\n * Constructs a choice attribute\n */\n constructor(attribute: Object, attributeContributions: Object) {\n super(attribute, attributeContributions);\n\n this._referenceDate = this.getData(\"referenceDate\", DateUtil.now());\n this._options = ChoiceAttributeOptionCollection.create(\n attribute,\n attributeContributions,\n this.referenceDate,\n );\n\n if (this.layouthint.has(SORT_OPTIONS)) {\n this._options.sortOptions = true;\n }\n }\n\n /**\n */\n static isApplicableModel(contributions: Object): boolean {\n return (\n contributions.type !== \"composite\" &&\n contributions.type !== \"boolean\" &&\n (contributions.type === \"choice\" ||\n contributions.type === \"array\" ||\n has(contributions, \"enumerated\") ||\n has(contributions, \"options\"))\n );\n }\n\n /**\n */\n get type(): string {\n const optionMode = this.getContribution(\"optionMode\", \"\");\n const hasLookupLink = this.lookupLink || this.lookupListLink;\n\n if (\n optionMode === \"lookup\" ||\n (optionMode === \"dynamicWithThreshold\" && hasLookupLink)\n ) {\n return \"lookup\";\n }\n\n return \"choice\";\n }\n\n /**\n */\n getInitialChildModelLinks(): Array<LinkModel> {\n const links = [];\n\n if (this.hasContentConfiguration) {\n if (!this.hasContentFromData && this.conceptLink) {\n links.push(this.conceptLink);\n }\n\n links.push(...this.options.getInitialChildModelLinks());\n }\n\n return links;\n }\n\n /**\n */\n setChildModels(models: Array<ModularUIModel>) {\n const conceptLinkHref = this.conceptLink?.href;\n if (conceptLinkHref) {\n this.concept = models.find(\n (model) =>\n model.type === \"ConceptDetail\" &&\n model.selfhref.equalsWithParameters(conceptLinkHref),\n );\n }\n\n this.options.setChildModels(models);\n }\n\n /**\n * Retrieve lookup service link\n */\n get lookupLink(): LinkModel | null {\n return this.links.getLinkByKey(\"lookupOptions\");\n }\n\n /**\n * Retrieve lookup service as list link\n */\n get lookupListLink(): LinkModel | null {\n return this.links.getLinkByKey(\"lookupList\");\n }\n\n /**\n */\n get lookupListLabel(): string {\n return this.contributions.lookupList?.label ?? \"\";\n }\n\n /**\n *\n */\n get avatarLink(): LinkModel | null {\n return (\n this.options.first?.links?.find((link) => link.key === \"avatar\") || null\n );\n }\n\n /**\n *\n */\n get isAvatar(): boolean {\n return this.contributions?.optionType === \"user\" ?? false;\n }\n\n /**\n * Retrieve reference date of attribute which can be used as entryDate for content\n */\n get referenceDate(): ISO_DATE {\n return this._referenceDate;\n }\n\n /**\n * Set reference date for concepts and content\n */\n set referenceDate(date: string) {\n this._referenceDate = date;\n\n this.options.referenceDate = date;\n }\n\n /**\n * Retrieve available choice options\n */\n get options(): ChoiceAttributeOptionCollection {\n return this._options;\n }\n\n /**\n * Getting all enabled options\n */\n get selected(): Array<string> {\n // $FlowFixMe[incompatible-call]\n return this.options.selected.map<string, ChoiceAttributeOptionModel>(\n (option: ChoiceAttributeOptionModel) => option.code,\n );\n }\n\n /**\n * Flatten options and filter out the options that are not selected\n */\n get readonlyvalue(): string {\n return this.options.selected.map((option) => option.label).join(\", \");\n }\n\n /**\n */\n get initvalue(): any {\n if (Array.isArray(this._initvalue) && this._initvalue.length === 0) {\n return null;\n }\n\n return this._initvalue;\n }\n\n /**\n * Retrieve list of selected options, joined with comma\n */\n getValue(): string | null {\n return this.options.selected.length > 0\n ? this.options.selected.map((option) => option.code).join(\",\")\n : null;\n }\n\n /**\n */\n hasValue(): boolean {\n return this.options.selected.length > 0;\n }\n\n /**\n * Get input value of attribute\n */\n getInputValue(): string {\n return this.selected.join(\",\");\n }\n\n /**\n * Setting an option selected or unselected based on the current state\n */\n toggleOption(code: string) {\n if (this.selected.includes(code)) {\n this.disableOption(code);\n } else {\n this.enableOption(code);\n }\n }\n\n /**\n * Enable a option\n */\n enableOption(code: string) {\n if (!this.isMultiple) {\n this.options.deselectAll();\n }\n\n this.options.select(code);\n this.inputvalue = this.getInputValue();\n }\n\n /**\n * Disable a option\n */\n disableOption(code: string) {\n this.options.deselect(code);\n this.inputvalue = this.getInputValue();\n }\n\n /**\n * Add a new option to the collection of lookup options\n */\n addOption(option: Object) {\n if (!this.isMultiple) {\n this.options.deselectAll();\n }\n\n if (this.options.find((opt) => opt.code === option.code) === null) {\n this.options.addOption(option.code, option);\n }\n }\n\n /**\n * Getting the type of choice filter. For instance checkbox, radiobutton, combobox.\n */\n get choicetype():\n | \"checkbox\"\n | \"radiobutton\"\n | \"combobox\"\n | \"list\"\n | \"listview\"\n | \"table\"\n | \"longlist\"\n | \"toggle\" {\n return (\n [\n \"checkbox\",\n \"radiobutton\",\n \"combobox\",\n \"list\",\n \"listview\",\n \"table\",\n \"longlist\",\n \"toggle\",\n ].find((hint) => this.layouthint.has(hint)) || \"checkbox\"\n );\n }\n\n /**\n * Can multiple options be selected\n */\n get isMultiple(): boolean {\n return this.contributions.multiplechoice || this.choicetype === \"checkbox\";\n }\n\n /**\n * Check if options need to be rendered as tree\n */\n get isTree(): boolean {\n return (\n has(this.contributions, \"options\") &&\n this.contributions.options.some((option) => has(option, \"children\"))\n );\n }\n\n /**\n * Reset choice attribute to unselected list\n */\n reset() {\n this.options.deselectAll();\n }\n\n /**\n */\n mergeAttribute(oldAttribute: AttributeType) {\n // when attribute is readonly, don't merge the options no modifications necessary\n if (!this.readonly && oldAttribute instanceof ChoiceAttributeModel) {\n this.concept = oldAttribute.concept;\n this.options.mergeOptions(oldAttribute.options, this.type === \"lookup\");\n this.options.deselectAll();\n\n if (oldAttribute.isValid && oldAttribute.inputvalue !== null) {\n this.update(oldAttribute.inputvalue);\n }\n }\n }\n\n /**\n * Update attribute by name and value\n */\n update(value: any): ChoiceAttributeModel {\n if (this.readonly) {\n return this;\n }\n\n this.updateLastModification();\n\n let values;\n\n if (Array.isArray(value)) {\n values = value;\n } else if (typeof value === \"string\" && this.isMultiple) {\n values = value.split(\",\");\n } else {\n values = [value];\n }\n values.forEach((val) => {\n if (typeof val === \"object\" && val.isChoiceAttributeOptionModel) {\n // option does not exist in existing options, add it. This can happen when lookup list has other options then lookup options\n if (!this.options.some((option) => option.equals(val))) {\n this.options.add(val);\n }\n\n this.toggleOption(val.code);\n } else if (\n typeof val === \"string\" &&\n this.options.some((option) => option.code.toString() === val)\n ) {\n this.toggleOption(val);\n }\n });\n\n return this;\n }\n\n /**\n */\n set hasContentConfiguration(hasContentConfiguration: boolean) {\n this._hasContentConfiguration =\n this.contentConfiguration !== null || hasContentConfiguration;\n }\n\n /**\n */\n get hasContentConfiguration(): boolean {\n return this._hasContentConfiguration;\n }\n\n /**\n * Get content configuration configured on the attribute.\n * Only applicable for taxonomy element and knowledge codemaps,\n * content configuration for instrument questions is available on the form object\n */\n get contentConfiguration(): ContentConfigurationElements | null {\n if (\n !this.contributions.content ||\n !this.contributions.content.optionElements\n ) {\n return null;\n }\n\n // Add RENDER_SECTION_LABEL to all content configuration to make sure the label of a section is always rendered on taxonomy and knowlege codemaps\n const optionElementConfig = this.contributions.content.optionElements.map(\n (optionElement) => {\n if (\"contentElement\" in optionElement) {\n return {\n contentElement: {\n ...optionElement.contentElement,\n layouthint: [RENDER_SECTION_LABEL],\n },\n };\n }\n\n return optionElement;\n },\n );\n\n return new ContentConfigurationElements(optionElementConfig);\n }\n\n /**\n * Get placeholder text\n */\n get placeholder(): string {\n return this.getContribution(\"placeholder\", \"\");\n }\n\n /**\n * Registers an error that was received from a server response\n */\n addServerError(error: FormErrorAnchor) {\n const { id, message, properties, layouthint } = error;\n\n const ANSWER_OPTION_KEY = \"answer-option-key\";\n\n if (properties && has(properties, ANSWER_OPTION_KEY)) {\n const optionKey = properties[ANSWER_OPTION_KEY];\n const foundOption = this.options.find(\n (option) => option.code === optionKey,\n );\n if (foundOption) {\n properties[ANSWER_OPTION_KEY] = foundOption.getContentConfiguredLabel(\n this.contentConfiguration,\n );\n }\n }\n\n this._errorCollection.addServerError(id, message, properties, layouthint);\n }\n\n /**\n */\n get readonlyWidth(): $Keys<typeof ATTRIBUTE_WIDTH> {\n if (this.type === \"lookup\") {\n return ATTRIBUTE_WIDTH.SMALL;\n }\n\n return ATTRIBUTE_WIDTH.MEDIUM;\n }\n}\n"],"mappings":";;;;AACA,SA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H,KAAK;IAC9B;IAEA,OAAO7H,eAAe,CAAC8H,MAAM;EAC/B;AACF"}
|
|
1
|
+
{"version":3,"file":"ChoiceAttributeModel.js","names":["has","DateUtil","AttributeModel","ChoiceAttributeOptionCollection","ChoiceAttributeOptionModel","ContentConfigurationElements","RENDER_SECTION_LABEL","SORT_OPTIONS","ATTRIBUTE_WIDTH","ChoiceAttributeModel","constructor","attribute","attributeContributions","_defineProperty","_referenceDate","getData","now","_options","create","referenceDate","layouthint","sortOptions","isApplicableModel","contributions","type","optionMode","getContribution","hasLookupLink","lookupLink","lookupListLink","getInitialChildModelLinks","links","hasContentConfiguration","hasContentFromData","conceptLink","push","options","setChildModels","models","conceptLinkHref","href","concept","_findInstanceProperty","call","model","selfhref","equalsWithParameters","getLinkByKey","lookupListLabel","lookupList","label","avatarLink","_context","collection","option","code","value","isAvatar","optionType","date","selected","_context2","_mapInstanceProperty","readonlyvalue","_context3","join","initvalue","Array","isArray","_initvalue","length","getValue","_context4","hasValue","getInputValue","toggleOption","_context5","_includesInstanceProperty","disableOption","enableOption","isMultiple","deselectAll","select","inputvalue","deselect","addOption","_context6","opt","choicetype","_context7","hint","multiplechoice","isTree","some","reset","mergeAttribute","oldAttribute","readonly","mergeOptions","isValid","update","updateLastModification","values","split","forEach","val","isChoiceAttributeOptionModel","equals","add","toString","_hasContentConfiguration","contentConfiguration","_context8","content","optionElements","optionElementConfig","optionElement","contentElement","placeholder","addServerError","error","id","message","properties","ANSWER_OPTION_KEY","_context9","optionKey","foundOption","getContentConfiguredLabel","_errorCollection","readonlyWidth","SMALL","MEDIUM"],"sources":["../../../src/models/attributes/ChoiceAttributeModel.js"],"sourcesContent":["// @flow\nimport { has } from \"../../utils/helpers/objects\";\nimport { DateUtil } from \"../../utils/datetime/DateTimeUtil\";\n\nimport AttributeModel from \"./AttributeModel\";\nimport ChoiceAttributeOptionCollection from \"./ChoiceAttributeOptionCollection\";\nimport ChoiceAttributeOptionModel from \"./ChoiceAttributeOptionModel\";\nimport ContentConfigurationElements from \"../contentconfiguration/ContentConfigurationElements\";\n\nimport {\n RENDER_SECTION_LABEL,\n SORT_OPTIONS,\n} from \"../../constants/LayoutHints\";\nimport { ATTRIBUTE_WIDTH } from \"../../constants\";\n\nimport type { ModularUIModel, AttributeType, FormErrorAnchor } from \"../types\";\nimport type LinkModel from \"../links/LinkModel\";\n\n/**\n * Model for a choice attribute\n */\nexport default class ChoiceAttributeModel extends AttributeModel {\n _referenceDate: ISO_DATE;\n _options: ChoiceAttributeOptionCollection;\n _hasContentConfiguration: boolean;\n\n /**\n * Constructs a choice attribute\n */\n constructor(attribute: Object, attributeContributions: Object) {\n super(attribute, attributeContributions);\n\n this._referenceDate = this.getData(\"referenceDate\", DateUtil.now());\n this._options = ChoiceAttributeOptionCollection.create(\n attribute,\n attributeContributions,\n this.referenceDate,\n );\n\n if (this.layouthint.has(SORT_OPTIONS)) {\n this._options.sortOptions = true;\n }\n }\n\n /**\n */\n static isApplicableModel(contributions: Object): boolean {\n return (\n contributions.type !== \"composite\" &&\n contributions.type !== \"boolean\" &&\n (contributions.type === \"choice\" ||\n contributions.type === \"array\" ||\n has(contributions, \"enumerated\") ||\n has(contributions, \"options\"))\n );\n }\n\n /**\n */\n get type(): string {\n const optionMode = this.getContribution(\"optionMode\", \"\");\n const hasLookupLink = this.lookupLink || this.lookupListLink;\n\n if (\n optionMode === \"lookup\" ||\n (optionMode === \"dynamicWithThreshold\" && hasLookupLink)\n ) {\n return \"lookup\";\n }\n\n return \"choice\";\n }\n\n /**\n */\n getInitialChildModelLinks(): Array<LinkModel> {\n const links = [];\n\n if (this.hasContentConfiguration) {\n if (!this.hasContentFromData && this.conceptLink) {\n links.push(this.conceptLink);\n }\n\n links.push(...this.options.getInitialChildModelLinks());\n }\n\n return links;\n }\n\n /**\n */\n setChildModels(models: Array<ModularUIModel>) {\n const conceptLinkHref = this.conceptLink?.href;\n if (conceptLinkHref) {\n this.concept = models.find(\n (model) =>\n model.type === \"ConceptDetail\" &&\n model.selfhref.equalsWithParameters(conceptLinkHref),\n );\n }\n\n this.options.setChildModels(models);\n }\n\n /**\n * Retrieve lookup service link\n */\n get lookupLink(): LinkModel | null {\n return this.links.getLinkByKey(\"lookupOptions\");\n }\n\n /**\n * Retrieve lookup service as list link\n */\n get lookupListLink(): LinkModel | null {\n return this.links.getLinkByKey(\"lookupList\");\n }\n\n /**\n */\n get lookupListLabel(): string {\n return this.contributions.lookupList?.label ?? \"\";\n }\n\n /**\n *\n */\n get avatarLink(): LinkModel | null {\n return (\n this.options.collection.find((option) => option.code === this.value)\n ?.avatarLink || null\n );\n }\n\n /**\n *\n */\n get isAvatar(): boolean {\n return this.contributions?.optionType === \"user\" ?? false;\n }\n\n /**\n * Retrieve reference date of attribute which can be used as entryDate for content\n */\n get referenceDate(): ISO_DATE {\n return this._referenceDate;\n }\n\n /**\n * Set reference date for concepts and content\n */\n set referenceDate(date: string) {\n this._referenceDate = date;\n\n this.options.referenceDate = date;\n }\n\n /**\n * Retrieve available choice options\n */\n get options(): ChoiceAttributeOptionCollection {\n return this._options;\n }\n\n /**\n * Getting all enabled options\n */\n get selected(): Array<string> {\n // $FlowFixMe[incompatible-call]\n return this.options.selected.map<string, ChoiceAttributeOptionModel>(\n (option: ChoiceAttributeOptionModel) => option.code,\n );\n }\n\n /**\n * Flatten options and filter out the options that are not selected\n */\n get readonlyvalue(): string {\n return this.options.selected.map((option) => option.label).join(\", \");\n }\n\n /**\n */\n get initvalue(): any {\n if (Array.isArray(this._initvalue) && this._initvalue.length === 0) {\n return null;\n }\n\n return this._initvalue;\n }\n\n /**\n * Retrieve list of selected options, joined with comma\n */\n getValue(): string | null {\n return this.options.selected.length > 0\n ? this.options.selected.map((option) => option.code).join(\",\")\n : null;\n }\n\n /**\n */\n hasValue(): boolean {\n return this.options.selected.length > 0;\n }\n\n /**\n * Get input value of attribute\n */\n getInputValue(): string {\n return this.selected.join(\",\");\n }\n\n /**\n * Setting an option selected or unselected based on the current state\n */\n toggleOption(code: string) {\n if (this.selected.includes(code)) {\n this.disableOption(code);\n } else {\n this.enableOption(code);\n }\n }\n\n /**\n * Enable a option\n */\n enableOption(code: string) {\n if (!this.isMultiple) {\n this.options.deselectAll();\n }\n\n this.options.select(code);\n this.inputvalue = this.getInputValue();\n }\n\n /**\n * Disable a option\n */\n disableOption(code: string) {\n this.options.deselect(code);\n this.inputvalue = this.getInputValue();\n }\n\n /**\n * Add a new option to the collection of lookup options\n */\n addOption(option: Object) {\n if (!this.isMultiple) {\n this.options.deselectAll();\n }\n\n if (this.options.find((opt) => opt.code === option.code) === null) {\n this.options.addOption(option.code, option);\n }\n }\n\n /**\n * Getting the type of choice filter. For instance checkbox, radiobutton, combobox.\n */\n get choicetype():\n | \"checkbox\"\n | \"radiobutton\"\n | \"combobox\"\n | \"list\"\n | \"listview\"\n | \"table\"\n | \"longlist\"\n | \"toggle\" {\n return (\n [\n \"checkbox\",\n \"radiobutton\",\n \"combobox\",\n \"list\",\n \"listview\",\n \"table\",\n \"longlist\",\n \"toggle\",\n ].find((hint) => this.layouthint.has(hint)) || \"checkbox\"\n );\n }\n\n /**\n * Can multiple options be selected\n */\n get isMultiple(): boolean {\n return this.contributions.multiplechoice || this.choicetype === \"checkbox\";\n }\n\n /**\n * Check if options need to be rendered as tree\n */\n get isTree(): boolean {\n return (\n has(this.contributions, \"options\") &&\n this.contributions.options.some((option) => has(option, \"children\"))\n );\n }\n\n /**\n * Reset choice attribute to unselected list\n */\n reset() {\n this.options.deselectAll();\n }\n\n /**\n */\n mergeAttribute(oldAttribute: AttributeType) {\n // when attribute is readonly, don't merge the options no modifications necessary\n if (!this.readonly && oldAttribute instanceof ChoiceAttributeModel) {\n this.concept = oldAttribute.concept;\n this.options.mergeOptions(oldAttribute.options, this.type === \"lookup\");\n this.options.deselectAll();\n\n if (oldAttribute.isValid && oldAttribute.inputvalue !== null) {\n this.update(oldAttribute.inputvalue);\n }\n }\n }\n\n /**\n * Update attribute by name and value\n */\n update(value: any): ChoiceAttributeModel {\n if (this.readonly) {\n return this;\n }\n\n this.updateLastModification();\n\n let values;\n\n if (Array.isArray(value)) {\n values = value;\n } else if (typeof value === \"string\" && this.isMultiple) {\n values = value.split(\",\");\n } else {\n values = [value];\n }\n values.forEach((val) => {\n if (typeof val === \"object\" && val.isChoiceAttributeOptionModel) {\n // option does not exist in existing options, add it. This can happen when lookup list has other options then lookup options\n if (!this.options.some((option) => option.equals(val))) {\n this.options.add(val);\n }\n\n this.toggleOption(val.code);\n } else if (\n typeof val === \"string\" &&\n this.options.some((option) => option.code.toString() === val)\n ) {\n this.toggleOption(val);\n }\n });\n\n return this;\n }\n\n /**\n */\n set hasContentConfiguration(hasContentConfiguration: boolean) {\n this._hasContentConfiguration =\n this.contentConfiguration !== null || hasContentConfiguration;\n }\n\n /**\n */\n get hasContentConfiguration(): boolean {\n return this._hasContentConfiguration;\n }\n\n /**\n * Get content configuration configured on the attribute.\n * Only applicable for taxonomy element and knowledge codemaps,\n * content configuration for instrument questions is available on the form object\n */\n get contentConfiguration(): ContentConfigurationElements | null {\n if (\n !this.contributions.content ||\n !this.contributions.content.optionElements\n ) {\n return null;\n }\n\n // Add RENDER_SECTION_LABEL to all content configuration to make sure the label of a section is always rendered on taxonomy and knowlege codemaps\n const optionElementConfig = this.contributions.content.optionElements.map(\n (optionElement) => {\n if (\"contentElement\" in optionElement) {\n return {\n contentElement: {\n ...optionElement.contentElement,\n layouthint: [RENDER_SECTION_LABEL],\n },\n };\n }\n\n return optionElement;\n },\n );\n\n return new ContentConfigurationElements(optionElementConfig);\n }\n\n /**\n * Get placeholder text\n */\n get placeholder(): string {\n return this.getContribution(\"placeholder\", \"\");\n }\n\n /**\n * Registers an error that was received from a server response\n */\n addServerError(error: FormErrorAnchor) {\n const { id, message, properties, layouthint } = error;\n\n const ANSWER_OPTION_KEY = \"answer-option-key\";\n\n if (properties && has(properties, ANSWER_OPTION_KEY)) {\n const optionKey = properties[ANSWER_OPTION_KEY];\n const foundOption = this.options.find(\n (option) => option.code === optionKey,\n );\n if (foundOption) {\n properties[ANSWER_OPTION_KEY] = foundOption.getContentConfiguredLabel(\n this.contentConfiguration,\n );\n }\n }\n\n this._errorCollection.addServerError(id, message, properties, layouthint);\n }\n\n /**\n */\n get readonlyWidth(): $Keys<typeof ATTRIBUTE_WIDTH> {\n if (this.type === \"lookup\") {\n return ATTRIBUTE_WIDTH.SMALL;\n }\n\n return ATTRIBUTE_WIDTH.MEDIUM;\n }\n}\n"],"mappings":";;;;AACA,SAASA,GAAG,QAAQ,6BAA6B;AACjD,SAASC,QAAQ,QAAQ,mCAAmC;AAE5D,OAAOC,cAAc,MAAM,kBAAkB;AAC7C,OAAOC,+BAA+B,MAAM,mCAAmC;AAC/E,OAAOC,0BAA0B,MAAM,8BAA8B;AACrE,OAAOC,4BAA4B,MAAM,sDAAsD;AAE/F,SACEC,oBAAoB,EACpBC,YAAY,QACP,6BAA6B;AACpC,SAASC,eAAe,QAAQ,iBAAiB;AAKjD;AACA;AACA;AACA,eAAe,MAAMC,oBAAoB,SAASP,cAAc,CAAC;EAK/D;AACF;AACA;EACEQ,WAAWA,CAACC,SAAiB,EAAEC,sBAA8B,EAAE;IAC7D,KAAK,CAACD,SAAS,EAAEC,sBAAsB,CAAC;IAACC,eAAA;IAAAA,eAAA;IAAAA,eAAA;IAEzC,IAAI,CAACC,cAAc,GAAG,IAAI,CAACC,OAAO,CAAC,eAAe,EAAEd,QAAQ,CAACe,GAAG,CAAC,CAAC,CAAC;IACnE,IAAI,CAACC,QAAQ,GAAGd,+BAA+B,CAACe,MAAM,CACpDP,SAAS,EACTC,sBAAsB,EACtB,IAAI,CAACO,aACP,CAAC;IAED,IAAI,IAAI,CAACC,UAAU,CAACpB,GAAG,CAACO,YAAY,CAAC,EAAE;MACrC,IAAI,CAACU,QAAQ,CAACI,WAAW,GAAG,IAAI;IAClC;EACF;;EAEA;AACF;EACE,OAAOC,iBAAiBA,CAACC,aAAqB,EAAW;IACvD,OACEA,aAAa,CAACC,IAAI,KA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,KAAKuE,SAC9B,CAAC;MACD,IAAIC,WAAW,EAAE;QACfJ,UAAU,CAACC,iBAAiB,CAAC,GAAGG,WAAW,CAACC,yBAAyB,CACnE,IAAI,CAACjB,oBACP,CAAC;MACH;IACF;IAEA,IAAI,CAACkB,gBAAgB,CAACV,cAAc,CAACE,EAAE,EAAEC,OAAO,EAAEC,UAAU,EAAEvG,UAAU,CAAC;EAC3E;;EAEA;AACF;EACE,IAAI8G,aAAaA,CAAA,EAAkC;IACjD,IAAI,IAAI,CAAC1G,IAAI,KAAK,QAAQ,EAAE;MAC1B,OAAOhB,eAAe,CAAC2H,KAAK;IAC9B;IAEA,OAAO3H,eAAe,CAAC4H,MAAM;EAC/B;AACF"}
|
|
@@ -43,7 +43,8 @@ class BusinessScenarioModel extends ConceptDetailModel {
|
|
|
43
43
|
PERSONA: getSetting("BUSINESS_SCENARIO_PERSONA_CONCEPT_TYPE", [`${pathToKmt}/Persona`]),
|
|
44
44
|
SCENARIO: getSetting("BUSINESS_SCENARIO_CONCEPT_TYPE", [`${pathToKmt}/BusinessScenario`])
|
|
45
45
|
};
|
|
46
|
-
|
|
46
|
+
const decodedConceptTypeHref = decodeURIComponent(conceptTypeHref);
|
|
47
|
+
return Array.isArray(conceptTypeSettings[settingName]) && conceptTypeSettings[settingName].some(conceptTypeSetting => _endsWithInstanceProperty(decodedConceptTypeHref).call(decodedConceptTypeHref, conceptTypeSetting));
|
|
47
48
|
}
|
|
48
49
|
|
|
49
50
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BusinessScenarioModel.js","names":["ConceptDetailModel","ConceptTypeDetailModel","getSetting","BusinessScenarioModel","constructor","arguments","_defineProperty","type","modelName","isApplicableModel","data","isOfConceptType","_links","concepttype","href","conceptTypeHref","settingName","pathToKmt","conceptTypeSettings","STEP","PERSONA","SCENARIO","Array","isArray","some","conceptTypeSetting","_endsWithInstanceProperty","call","getInitialChildModelLinks","_context","_context2","childModelLinks","scenarioStepLinks","_mapInstanceProperty","_filterInstanceProperty","relationsCollection","all","relation","direction","concept","concepttypeHref","path","asLinkModel","length","push","setChildModels","models","conceptTypeModel","_findInstanceProperty","model","conceptType","scenarioSteps","i","selfhref","_scenarioSteps","actors","forEach","scenarioStep","_context3","relationsToActor","newRelationToActor","actor","key"],"sources":["../../../src/models/concepts/BusinessScenarioModel.js"],"sourcesContent":["// @flow\nimport ConceptDetailModel from \"./ConceptDetailModel\";\nimport ConceptTypeDetailModel from \"./ConceptTypeDetailModel\";\nimport { getSetting } from \"../../constants/Settings\";\n\nimport type { ModularUIResponse } from \"../../modularui\";\nimport type { ModularUIModel } from \"../types\";\nimport type LinkModel from \"../links/LinkModel\";\nimport type ConceptLinkModel from \"./ConceptLinkModel\";\n\n/**\n */\nclass BusinessScenarioModel extends ConceptDetailModel {\n _scenarioSteps: Array<ConceptDetailModel>;\n\n /**\n */\n get type(): string {\n return \"BusinessScenario\";\n }\n\n /**\n */\n static get modelName(): string {\n return \"BusinessScenario\";\n }\n\n /**\n */\n static isApplicableModel(data: ModularUIResponse): boolean {\n return BusinessScenarioModel.isOfConceptType(\n data?.data?._links?.concepttype?.href,\n \"SCENARIO\",\n );\n }\n\n /**\n */\n static isOfConceptType(\n conceptTypeHref: ?string,\n settingName: \"STEP\" | \"PERSONA\" | \"SCENARIO\",\n ): boolean {\n if (!conceptTypeHref) {\n return false;\n }\n\n const pathToKmt = \"/Library/KMTs/Business scenarios.bixml\";\n\n const conceptTypeSettings = {\n STEP: getSetting(\"BUSINESS_SCENARIO_STEP_CONCEPT_TYPE\", [\n `${pathToKmt}/ScenarioStep`,\n ]),\n PERSONA: getSetting(\"BUSINESS_SCENARIO_PERSONA_CONCEPT_TYPE\", [\n `${pathToKmt}/Persona`,\n ]),\n SCENARIO: getSetting(\"BUSINESS_SCENARIO_CONCEPT_TYPE\", [\n `${pathToKmt}/BusinessScenario`,\n ]),\n };\n\n return (\n Array.isArray(conceptTypeSettings[settingName]) &&\n conceptTypeSettings[settingName].some((conceptTypeSetting) =>\n
|
|
1
|
+
{"version":3,"file":"BusinessScenarioModel.js","names":["ConceptDetailModel","ConceptTypeDetailModel","getSetting","BusinessScenarioModel","constructor","arguments","_defineProperty","type","modelName","isApplicableModel","data","isOfConceptType","_links","concepttype","href","conceptTypeHref","settingName","pathToKmt","conceptTypeSettings","STEP","PERSONA","SCENARIO","decodedConceptTypeHref","decodeURIComponent","Array","isArray","some","conceptTypeSetting","_endsWithInstanceProperty","call","getInitialChildModelLinks","_context","_context2","childModelLinks","scenarioStepLinks","_mapInstanceProperty","_filterInstanceProperty","relationsCollection","all","relation","direction","concept","concepttypeHref","path","asLinkModel","length","push","setChildModels","models","conceptTypeModel","_findInstanceProperty","model","conceptType","scenarioSteps","i","selfhref","_scenarioSteps","actors","forEach","scenarioStep","_context3","relationsToActor","newRelationToActor","actor","key"],"sources":["../../../src/models/concepts/BusinessScenarioModel.js"],"sourcesContent":["// @flow\nimport ConceptDetailModel from \"./ConceptDetailModel\";\nimport ConceptTypeDetailModel from \"./ConceptTypeDetailModel\";\nimport { getSetting } from \"../../constants/Settings\";\n\nimport type { ModularUIResponse } from \"../../modularui\";\nimport type { ModularUIModel } from \"../types\";\nimport type LinkModel from \"../links/LinkModel\";\nimport type ConceptLinkModel from \"./ConceptLinkModel\";\n\n/**\n */\nclass BusinessScenarioModel extends ConceptDetailModel {\n _scenarioSteps: Array<ConceptDetailModel>;\n\n /**\n */\n get type(): string {\n return \"BusinessScenario\";\n }\n\n /**\n */\n static get modelName(): string {\n return \"BusinessScenario\";\n }\n\n /**\n */\n static isApplicableModel(data: ModularUIResponse): boolean {\n return BusinessScenarioModel.isOfConceptType(\n data?.data?._links?.concepttype?.href,\n \"SCENARIO\",\n );\n }\n\n /**\n */\n static isOfConceptType(\n conceptTypeHref: ?string,\n settingName: \"STEP\" | \"PERSONA\" | \"SCENARIO\",\n ): boolean {\n if (!conceptTypeHref) {\n return false;\n }\n\n const pathToKmt = \"/Library/KMTs/Business scenarios.bixml\";\n\n const conceptTypeSettings = {\n STEP: getSetting(\"BUSINESS_SCENARIO_STEP_CONCEPT_TYPE\", [\n `${pathToKmt}/ScenarioStep`,\n ]),\n PERSONA: getSetting(\"BUSINESS_SCENARIO_PERSONA_CONCEPT_TYPE\", [\n `${pathToKmt}/Persona`,\n ]),\n SCENARIO: getSetting(\"BUSINESS_SCENARIO_CONCEPT_TYPE\", [\n `${pathToKmt}/BusinessScenario`,\n ]),\n };\n\n const decodedConceptTypeHref = decodeURIComponent(conceptTypeHref);\n return (\n Array.isArray(conceptTypeSettings[settingName]) &&\n conceptTypeSettings[settingName].some((conceptTypeSetting) =>\n decodedConceptTypeHref.endsWith(conceptTypeSetting),\n )\n );\n }\n\n /**\n */\n getInitialChildModelLinks(): Array<LinkModel> {\n const childModelLinks = super.getInitialChildModelLinks();\n\n const scenarioStepLinks = this.relationsCollection.all\n .filter(\n (relation) =>\n relation.direction === \"outgoing\" &&\n BusinessScenarioModel.isOfConceptType(\n relation.concept.concepttypeHref?.path,\n \"STEP\",\n ),\n )\n .map((relation) => relation.concept.asLinkModel());\n\n if (scenarioStepLinks.length > 0) {\n childModelLinks.push(...scenarioStepLinks);\n }\n\n return childModelLinks;\n }\n\n /**\n */\n setChildModels(models: Array<ModularUIModel>) {\n // $FlowExpectedError[incompatible-type]\n const conceptTypeModel: ?ConceptTypeDetailModel = models.find(\n (model) => model instanceof ConceptTypeDetailModel,\n );\n\n if (conceptTypeModel) {\n this.conceptType = conceptTypeModel;\n }\n\n this.relationsCollection.setChildModels(models);\n\n const scenarioSteps = [];\n for (let i = 0; i < models.length; i++) {\n const model = models[i];\n\n if (\n model instanceof ConceptDetailModel &&\n BusinessScenarioModel.isOfConceptType(\n model.conceptType?.selfhref.path,\n \"STEP\",\n )\n ) {\n scenarioSteps.push(model);\n }\n }\n\n this.scenarioSteps = scenarioSteps;\n }\n\n /**\n */\n set scenarioSteps(models: Array<ConceptDetailModel>) {\n this._scenarioSteps = models;\n }\n\n /**\n */\n get scenarioSteps(): Array<ConceptDetailModel> {\n return this._scenarioSteps;\n }\n\n /**\n */\n get actors(): Array<ConceptLinkModel> {\n const actors = [];\n\n this.scenarioSteps.forEach((scenarioStep) => {\n const relationsToActor = scenarioStep.relationsCollection.find(\n (relation) =>\n relation.direction === \"outgoing\" &&\n BusinessScenarioModel.isOfConceptType(\n relation.concept.concepttypeHref?.path,\n \"PERSONA\",\n ),\n );\n\n const newRelationToActor =\n relationsToActor &&\n !actors.some((actor) => actor.key === relationsToActor.concept.key);\n\n if (relationsToActor && newRelationToActor) {\n actors.push(relationsToActor.concept);\n }\n });\n\n return actors;\n }\n}\n\nexport default BusinessScenarioModel;\n"],"mappings":";;;;;AACA,OAAOA,kBAAkB,MAAM,sBAAsB;AACrD,OAAOC,sBAAsB,MAAM,0BAA0B;AAC7D,SAASC,UAAU,QAAQ,0BAA0B;AAOrD;AACA;AACA,MAAMC,qBAAqB,SAASH,kBAAkB,CAAC;EAAAI,YAAA;IAAA,SAAAC,SAAA;IAAAC,eAAA;EAAA;EAGrD;AACF;EACE,IAAIC,IAAIA,CAAA,EAAW;IACjB,OAAO,kBAAkB;EAC3B;;EAEA;AACF;EACE,WAAWC,SAASA,CAAA,EAAW;IAC7B,OAAO,kBAAkB;EAC3B;;EAEA;AACF;EACE,OAAOC,iBAAiBA,CAACC,IAAuB,EAAW;IACzD,OAAOP,qBAAqB,CAACQ,eAAe,CAC1CD,IAAI,EAAEA,IAAI,EAAEE,MAAM,EAAEC,WAAW,EAAEC,IAAI,EACrC,UACF,CAAC;EACH;;EAEA;AACF;EACE,OAAOH,eAAeA,CACpBI,eAAwB,EACxBC,WAA4C,EACnC;IACT,IAAI,CAACD,eAAe,EAAE;MACpB,OAAO,KAAK;IACd;IAEA,MAAME,SAAS,GAAG,wCAAwC;IAE1D,MAAMC,mBAAmB,GAAG;MAC1BC,IAAI,EAAEjB,UAAU,CAAC,qCAAqC,EAAE,CACrD,GAAEe,SAAU,eAAc,CAC5B,CAAC;MACFG,O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,GACtBD,gBAAgB,IAChB,CAACJ,MAAM,CAAC/B,IAAI,CAAEqC,KAAK,IAAKA,KAAK,CAACC,GAAG,KAAKH,gBAAgB,CAACpB,OAAO,CAACuB,GAAG,CAAC;MAErE,IAAIH,gBAAgB,IAAIC,kBAAkB,EAAE;QAC1CL,MAAM,CAACX,IAAI,CAACe,gBAAgB,CAACpB,OAAO,CAAC;MACvC;IACF,CAAC,CAAC;IAEF,OAAOgB,MAAM;EACf;AACF;AAEA,eAAetD,qBAAqB"}
|
|
@@ -45,7 +45,7 @@ describe("actionModel", () => {
|
|
|
45
45
|
processTask: {
|
|
46
46
|
_links: {
|
|
47
47
|
concept: {
|
|
48
|
-
href: "/concepts
|
|
48
|
+
href: "/concepts/%2FResearch%20grant%2FBusiness%20design%2FConstraints%2FEligible%20for%20research%20grant.bixml/EligibleResearchGrant",
|
|
49
49
|
},
|
|
50
50
|
},
|
|
51
51
|
consequenceType: "Decision",
|
|
@@ -100,7 +100,8 @@ class ChoiceAttributeModel extends _AttributeModel.default {
|
|
|
100
100
|
*
|
|
101
101
|
*/
|
|
102
102
|
get avatarLink() {
|
|
103
|
-
|
|
103
|
+
var _context;
|
|
104
|
+
return (0, _find.default)(_context = this.options.collection).call(_context, option => option.code === this.value)?.avatarLink || null;
|
|
104
105
|
}
|
|
105
106
|
|
|
106
107
|
/**
|
|
@@ -136,17 +137,17 @@ class ChoiceAttributeModel extends _AttributeModel.default {
|
|
|
136
137
|
* Getting all enabled options
|
|
137
138
|
*/
|
|
138
139
|
get selected() {
|
|
139
|
-
var
|
|
140
|
+
var _context2;
|
|
140
141
|
// $FlowFixMe[incompatible-call]
|
|
141
|
-
return (0, _map.default)(
|
|
142
|
+
return (0, _map.default)(_context2 = this.options.selected).call(_context2, option => option.code);
|
|
142
143
|
}
|
|
143
144
|
|
|
144
145
|
/**
|
|
145
146
|
* Flatten options and filter out the options that are not selected
|
|
146
147
|
*/
|
|
147
148
|
get readonlyvalue() {
|
|
148
|
-
var
|
|
149
|
-
return (0, _map.default)(
|
|
149
|
+
var _context3;
|
|
150
|
+
return (0, _map.default)(_context3 = this.options.selected).call(_context3, option => option.label).join(", ");
|
|
150
151
|
}
|
|
151
152
|
|
|
152
153
|
/**
|
|
@@ -162,8 +163,8 @@ class ChoiceAttributeModel extends _AttributeModel.default {
|
|
|
162
163
|
* Retrieve list of selected options, joined with comma
|
|
163
164
|
*/
|
|
164
165
|
getValue() {
|
|
165
|
-
var
|
|
166
|
-
return this.options.selected.length > 0 ? (0, _map.default)(
|
|
166
|
+
var _context4;
|
|
167
|
+
return this.options.selected.length > 0 ? (0, _map.default)(_context4 = this.options.selected).call(_context4, option => option.code).join(",") : null;
|
|
167
168
|
}
|
|
168
169
|
|
|
169
170
|
/**
|
|
@@ -183,8 +184,8 @@ class ChoiceAttributeModel extends _AttributeModel.default {
|
|
|
183
184
|
* Setting an option selected or unselected based on the current state
|
|
184
185
|
*/
|
|
185
186
|
toggleOption(code) {
|
|
186
|
-
var
|
|
187
|
-
if ((0, _includes.default)(
|
|
187
|
+
var _context5;
|
|
188
|
+
if ((0, _includes.default)(_context5 = this.selected).call(_context5, code)) {
|
|
188
189
|
this.disableOption(code);
|
|
189
190
|
} else {
|
|
190
191
|
this.enableOption(code);
|
|
@@ -214,11 +215,11 @@ class ChoiceAttributeModel extends _AttributeModel.default {
|
|
|
214
215
|
* Add a new option to the collection of lookup options
|
|
215
216
|
*/
|
|
216
217
|
addOption(option) {
|
|
217
|
-
var
|
|
218
|
+
var _context6;
|
|
218
219
|
if (!this.isMultiple) {
|
|
219
220
|
this.options.deselectAll();
|
|
220
221
|
}
|
|
221
|
-
if ((0, _find.default)(
|
|
222
|
+
if ((0, _find.default)(_context6 = this.options).call(_context6, opt => opt.code === option.code) === null) {
|
|
222
223
|
this.options.addOption(option.code, option);
|
|
223
224
|
}
|
|
224
225
|
}
|
|
@@ -227,8 +228,8 @@ class ChoiceAttributeModel extends _AttributeModel.default {
|
|
|
227
228
|
* Getting the type of choice filter. For instance checkbox, radiobutton, combobox.
|
|
228
229
|
*/
|
|
229
230
|
get choicetype() {
|
|
230
|
-
var
|
|
231
|
-
return (0, _find.default)(
|
|
231
|
+
var _context7;
|
|
232
|
+
return (0, _find.default)(_context7 = ["checkbox", "radiobutton", "combobox", "list", "listview", "table", "longlist", "toggle"]).call(_context7, hint => this.layouthint.has(hint)) || "checkbox";
|
|
232
233
|
}
|
|
233
234
|
|
|
234
235
|
/**
|
|
@@ -314,13 +315,13 @@ class ChoiceAttributeModel extends _AttributeModel.default {
|
|
|
314
315
|
* content configuration for instrument questions is available on the form object
|
|
315
316
|
*/
|
|
316
317
|
get contentConfiguration() {
|
|
317
|
-
var
|
|
318
|
+
var _context8;
|
|
318
319
|
if (!this.contributions.content || !this.contributions.content.optionElements) {
|
|
319
320
|
return null;
|
|
320
321
|
}
|
|
321
322
|
|
|
322
323
|
// Add RENDER_SECTION_LABEL to all content configuration to make sure the label of a section is always rendered on taxonomy and knowlege codemaps
|
|
323
|
-
const optionElementConfig = (0, _map.default)(
|
|
324
|
+
const optionElementConfig = (0, _map.default)(_context8 = this.contributions.content.optionElements).call(_context8, optionElement => {
|
|
324
325
|
if ("contentElement" in optionElement) {
|
|
325
326
|
return {
|
|
326
327
|
contentElement: {
|
|
@@ -353,9 +354,9 @@ class ChoiceAttributeModel extends _AttributeModel.default {
|
|
|
353
354
|
} = error;
|
|
354
355
|
const ANSWER_OPTION_KEY = "answer-option-key";
|
|
355
356
|
if (properties && (0, _objects.has)(properties, ANSWER_OPTION_KEY)) {
|
|
356
|
-
var
|
|
357
|
+
var _context9;
|
|
357
358
|
const optionKey = properties[ANSWER_OPTION_KEY];
|
|
358
|
-
const foundOption = (0, _find.default)(
|
|
359
|
+
const foundOption = (0, _find.default)(_context9 = this.options).call(_context9, option => option.code === optionKey);
|
|
359
360
|
if (foundOption) {
|
|
360
361
|
properties[ANSWER_OPTION_KEY] = foundOption.getContentConfiguredLabel(this.contentConfiguration);
|
|
361
362
|
}
|
|
@@ -127,7 +127,8 @@ export default class ChoiceAttributeModel extends AttributeModel {
|
|
|
127
127
|
*/
|
|
128
128
|
get avatarLink(): LinkModel | null {
|
|
129
129
|
return (
|
|
130
|
-
this.options.
|
|
130
|
+
this.options.collection.find((option) => option.code === this.value)
|
|
131
|
+
?.avatarLink || null
|
|
131
132
|
);
|
|
132
133
|
}
|
|
133
134
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ChoiceAttributeModel.js","names":["_objects","require","_DateTimeUtil","_AttributeModel","_interopRequireDefault","_ChoiceAttributeOptionCollection","_ChoiceAttributeOptionModel","_ContentConfigurationElements","_LayoutHints","_constants","ChoiceAttributeModel","AttributeModel","constructor","attribute","attributeContributions","_defineProperty2","default","_referenceDate","getData","DateUtil","now","_options","ChoiceAttributeOptionCollection","create","referenceDate","layouthint","has","SORT_OPTIONS","sortOptions","isApplicableModel","contributions","type","optionMode","getContribution","hasLookupLink","lookupLink","lookupListLink","getInitialChildModelLinks","links","hasContentConfiguration","hasContentFromData","conceptLink","push","options","setChildModels","models","conceptLinkHref","href","concept","_find","call","model","selfhref","equalsWithParameters","getLinkByKey","lookupListLabel","lookupList","label","avatarLink","first","find","link","key","isAvatar","optionType","date","selected","_context","_map","option","code","readonlyvalue","_context2","join","initvalue","Array","isArray","_initvalue","length","getValue","_context3","hasValue","getInputValue","toggleOption","_context4","_includes","disableOption","enableOption","isMultiple","deselectAll","select","inputvalue","deselect","addOption","_context5","opt","choicetype","_context6","hint","multiplechoice","isTree","some","reset","mergeAttribute","oldAttribute","readonly","mergeOptions","isValid","update","value","updateLastModification","values","split","forEach","val","isChoiceAttributeOptionModel","equals","add","toString","_hasContentConfiguration","contentConfiguration","_context7","content","optionElements","optionElementConfig","optionElement","contentElement","RENDER_SECTION_LABEL","ContentConfigurationElements","placeholder","addServerError","error","id","message","properties","ANSWER_OPTION_KEY","_context8","optionKey","foundOption","getContentConfiguredLabel","_errorCollection","readonlyWidth","ATTRIBUTE_WIDTH","SMALL","MEDIUM","exports"],"sources":["../../../src/models/attributes/ChoiceAttributeModel.js"],"sourcesContent":["// @flow\nimport { has } from \"../../utils/helpers/objects\";\nimport { DateUtil } from \"../../utils/datetime/DateTimeUtil\";\n\nimport AttributeModel from \"./AttributeModel\";\nimport ChoiceAttributeOptionCollection from \"./ChoiceAttributeOptionCollection\";\nimport ChoiceAttributeOptionModel from \"./ChoiceAttributeOptionModel\";\nimport ContentConfigurationElements from \"../contentconfiguration/ContentConfigurationElements\";\n\nimport {\n RENDER_SECTION_LABEL,\n SORT_OPTIONS,\n} from \"../../constants/LayoutHints\";\nimport { ATTRIBUTE_WIDTH } from \"../../constants\";\n\nimport type { ModularUIModel, AttributeType, FormErrorAnchor } from \"../types\";\nimport type LinkModel from \"../links/LinkModel\";\n\n/**\n * Model for a choice attribute\n */\nexport default class ChoiceAttributeModel extends AttributeModel {\n _referenceDate: ISO_DATE;\n _options: ChoiceAttributeOptionCollection;\n _hasContentConfiguration: boolean;\n\n /**\n * Constructs a choice attribute\n */\n constructor(attribute: Object, attributeContributions: Object) {\n super(attribute, attributeContributions);\n\n this._referenceDate = this.getData(\"referenceDate\", DateUtil.now());\n this._options = ChoiceAttributeOptionCollection.create(\n attribute,\n attributeContributions,\n this.referenceDate,\n );\n\n if (this.layouthint.has(SORT_OPTIONS)) {\n this._options.sortOptions = true;\n }\n }\n\n /**\n */\n static isApplicableModel(contributions: Object): boolean {\n return (\n contributions.type !== \"composite\" &&\n contributions.type !== \"boolean\" &&\n (contributions.type === \"choice\" ||\n contributions.type === \"array\" ||\n has(contributions, \"enumerated\") ||\n has(contributions, \"options\"))\n );\n }\n\n /**\n */\n get type(): string {\n const optionMode = this.getContribution(\"optionMode\", \"\");\n const hasLookupLink = this.lookupLink || this.lookupListLink;\n\n if (\n optionMode === \"lookup\" ||\n (optionMode === \"dynamicWithThreshold\" && hasLookupLink)\n ) {\n return \"lookup\";\n }\n\n return \"choice\";\n }\n\n /**\n */\n getInitialChildModelLinks(): Array<LinkModel> {\n const links = [];\n\n if (this.hasContentConfiguration) {\n if (!this.hasContentFromData && this.conceptLink) {\n links.push(this.conceptLink);\n }\n\n links.push(...this.options.getInitialChildModelLinks());\n }\n\n return links;\n }\n\n /**\n */\n setChildModels(models: Array<ModularUIModel>) {\n const conceptLinkHref = this.conceptLink?.href;\n if (conceptLinkHref) {\n this.concept = models.find(\n (model) =>\n model.type === \"ConceptDetail\" &&\n model.selfhref.equalsWithParameters(conceptLinkHref),\n );\n }\n\n this.options.setChildModels(models);\n }\n\n /**\n * Retrieve lookup service link\n */\n get lookupLink(): LinkModel | null {\n return this.links.getLinkByKey(\"lookupOptions\");\n }\n\n /**\n * Retrieve lookup service as list link\n */\n get lookupListLink(): LinkModel | null {\n return this.links.getLinkByKey(\"lookupList\");\n }\n\n /**\n */\n get lookupListLabel(): string {\n return this.contributions.lookupList?.label ?? \"\";\n }\n\n /**\n *\n */\n get avatarLink(): LinkModel | null {\n return (\n this.options.first?.links?.find((link) => link.key === \"avatar\") || null\n );\n }\n\n /**\n *\n */\n get isAvatar(): boolean {\n return this.contributions?.optionType === \"user\" ?? false;\n }\n\n /**\n * Retrieve reference date of attribute which can be used as entryDate for content\n */\n get referenceDate(): ISO_DATE {\n return this._referenceDate;\n }\n\n /**\n * Set reference date for concepts and content\n */\n set referenceDate(date: string) {\n this._referenceDate = date;\n\n this.options.referenceDate = date;\n }\n\n /**\n * Retrieve available choice options\n */\n get options(): ChoiceAttributeOptionCollection {\n return this._options;\n }\n\n /**\n * Getting all enabled options\n */\n get selected(): Array<string> {\n // $FlowFixMe[incompatible-call]\n return this.options.selected.map<string, ChoiceAttributeOptionModel>(\n (option: ChoiceAttributeOptionModel) => option.code,\n );\n }\n\n /**\n * Flatten options and filter out the options that are not selected\n */\n get readonlyvalue(): string {\n return this.options.selected.map((option) => option.label).join(\", \");\n }\n\n /**\n */\n get initvalue(): any {\n if (Array.isArray(this._initvalue) && this._initvalue.length === 0) {\n return null;\n }\n\n return this._initvalue;\n }\n\n /**\n * Retrieve list of selected options, joined with comma\n */\n getValue(): string | null {\n return this.options.selected.length > 0\n ? this.options.selected.map((option) => option.code).join(\",\")\n : null;\n }\n\n /**\n */\n hasValue(): boolean {\n return this.options.selected.length > 0;\n }\n\n /**\n * Get input value of attribute\n */\n getInputValue(): string {\n return this.selected.join(\",\");\n }\n\n /**\n * Setting an option selected or unselected based on the current state\n */\n toggleOption(code: string) {\n if (this.selected.includes(code)) {\n this.disableOption(code);\n } else {\n this.enableOption(code);\n }\n }\n\n /**\n * Enable a option\n */\n enableOption(code: string) {\n if (!this.isMultiple) {\n this.options.deselectAll();\n }\n\n this.options.select(code);\n this.inputvalue = this.getInputValue();\n }\n\n /**\n * Disable a option\n */\n disableOption(code: string) {\n this.options.deselect(code);\n this.inputvalue = this.getInputValue();\n }\n\n /**\n * Add a new option to the collection of lookup options\n */\n addOption(option: Object) {\n if (!this.isMultiple) {\n this.options.deselectAll();\n }\n\n if (this.options.find((opt) => opt.code === option.code) === null) {\n this.options.addOption(option.code, option);\n }\n }\n\n /**\n * Getting the type of choice filter. For instance checkbox, radiobutton, combobox.\n */\n get choicetype():\n | \"checkbox\"\n | \"radiobutton\"\n | \"combobox\"\n | \"list\"\n | \"listview\"\n | \"table\"\n | \"longlist\"\n | \"toggle\" {\n return (\n [\n \"checkbox\",\n \"radiobutton\",\n \"combobox\",\n \"list\",\n \"listview\",\n \"table\",\n \"longlist\",\n \"toggle\",\n ].find((hint) => this.layouthint.has(hint)) || \"checkbox\"\n );\n }\n\n /**\n * Can multiple options be selected\n */\n get isMultiple(): boolean {\n return this.contributions.multiplechoice || this.choicetype === \"checkbox\";\n }\n\n /**\n * Check if options need to be rendered as tree\n */\n get isTree(): boolean {\n return (\n has(this.contributions, \"options\") &&\n this.contributions.options.some((option) => has(option, \"children\"))\n );\n }\n\n /**\n * Reset choice attribute to unselected list\n */\n reset() {\n this.options.deselectAll();\n }\n\n /**\n */\n mergeAttribute(oldAttribute: AttributeType) {\n // when attribute is readonly, don't merge the options no modifications necessary\n if (!this.readonly && oldAttribute instanceof ChoiceAttributeModel) {\n this.concept = oldAttribute.concept;\n this.options.mergeOptions(oldAttribute.options, this.type === \"lookup\");\n this.options.deselectAll();\n\n if (oldAttribute.isValid && oldAttribute.inputvalue !== null) {\n this.update(oldAttribute.inputvalue);\n }\n }\n }\n\n /**\n * Update attribute by name and value\n */\n update(value: any): ChoiceAttributeModel {\n if (this.readonly) {\n return this;\n }\n\n this.updateLastModification();\n\n let values;\n\n if (Array.isArray(value)) {\n values = value;\n } else if (typeof value === \"string\" && this.isMultiple) {\n values = value.split(\",\");\n } else {\n values = [value];\n }\n values.forEach((val) => {\n if (typeof val === \"object\" && val.isChoiceAttributeOptionModel) {\n // option does not exist in existing options, add it. This can happen when lookup list has other options then lookup options\n if (!this.options.some((option) => option.equals(val))) {\n this.options.add(val);\n }\n\n this.toggleOption(val.code);\n } else if (\n typeof val === \"string\" &&\n this.options.some((option) => option.code.toString() === val)\n ) {\n this.toggleOption(val);\n }\n });\n\n return this;\n }\n\n /**\n */\n set hasContentConfiguration(hasContentConfiguration: boolean) {\n this._hasContentConfiguration =\n this.contentConfiguration !== null || hasContentConfiguration;\n }\n\n /**\n */\n get hasContentConfiguration(): boolean {\n return this._hasContentConfiguration;\n }\n\n /**\n * Get content configuration configured on the attribute.\n * Only applicable for taxonomy element and knowledge codemaps,\n * content configuration for instrument questions is available on the form object\n */\n get contentConfiguration(): ContentConfigurationElements | null {\n if (\n !this.contributions.content ||\n !this.contributions.content.optionElements\n ) {\n return null;\n }\n\n // Add RENDER_SECTION_LABEL to all content configuration to make sure the label of a section is always rendered on taxonomy and knowlege codemaps\n const optionElementConfig = this.contributions.content.optionElements.map(\n (optionElement) => {\n if (\"contentElement\" in optionElement) {\n return {\n contentElement: {\n ...optionElement.contentElement,\n layouthint: [RENDER_SECTION_LABEL],\n },\n };\n }\n\n return optionElement;\n },\n );\n\n return new ContentConfigurationElements(optionElementConfig);\n }\n\n /**\n * Get placeholder text\n */\n get placeholder(): string {\n return this.getContribution(\"placeholder\", \"\");\n }\n\n /**\n * Registers an error that was received from a server response\n */\n addServerError(error: FormErrorAnchor) {\n const { id, message, properties, layouthint } = error;\n\n const ANSWER_OPTION_KEY = \"answer-option-key\";\n\n if (properties && has(properties, ANSWER_OPTION_KEY)) {\n const optionKey = properties[ANSWER_OPTION_KEY];\n const foundOption = this.options.find(\n (option) => option.code === optionKey,\n );\n if (foundOption) {\n properties[ANSWER_OPTION_KEY] = foundOption.getContentConfiguredLabel(\n this.contentConfiguration,\n );\n }\n }\n\n this._errorCollection.addServerError(id, message, properties, layouthint);\n }\n\n /**\n */\n get readonlyWidth(): $Keys<typeof ATTRIBUTE_WIDTH> {\n if (this.type === \"lookup\") {\n return ATTRIBUTE_WIDTH.SMALL;\n }\n\n return ATTRIBUTE_WIDTH.MEDIUM;\n }\n}\n"],"mappings":";;;;;;;;;;;AACA,IAAAA,QAAA,GAAAC,OAAA;AACA,IAAAC,aAAA,GAAAD,OAAA;AAEA,IAAAE,eAAA,GAAAC,sBAAA,CAAAH,OAAA;AACA,IAAAI,gCAAA,GAAAD,sBAAA,CAAAH,OAAA;AACA,IAAAK,2BAAA,GAAAF,sBAAA,CAAAH,OAAA;AACA,IAAAM,6BAAA,GAAAH,sBAAA,CAAAH,OAAA;AAEA,IAAAO,YAAA,GAAAP,OAAA;AAIA,IAAAQ,UAAA,GAAAR,OAAA;AAKA;AACA;AACA;AACe,MAAMS,oBAAoB,SAASC,uBAAc,CAAC;EAK/D;AACF;AACA;EACEC,WAAWA,CAACC,SAAiB,EAAEC,sBAA8B,EAAE;IAC7D,KAAK,CAACD,SAAS,EAAEC,sBAAsB,CAAC;IAAC,IAAAC,gBAAA,CAAAC,OAAA;IAAA,IAAAD,gBAAA,CAAAC,OAAA;IAAA,IAAAD,gBAAA,CAAAC,OAAA;IAEzC,IAAI,CAACC,cAAc,GAAG,IAAI,CAACC,OAAO,CAAC,eAAe,EAAEC,sBAAQ,CAACC,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,cAAcA,CAACC,KAAsB,EAAE;IACrC,MAAM;MAAEC,EAAE;MAAEC,OAAO;MAAEC,UAAU;MAAE7G;IAAW,CAAC,GAAG0G,KAAK;IAErD,MAAMI,iBAAiB,GAAG,mBAAmB;IAE7C,IAAID,UAAU,IAAI,IAAA5G,YAAG,EAAC4G,UAAU,EAAEC,iBAAiB,CAAC,EAAE;MAAA,IAAAC,SAAA;MACpD,MAAMC,SAAS,GAAGH,UAAU,CAACC,iBAAiB,CAAC;MAC/C,MAAMG,WAAW,GAAG,IAAAzF,KAAA,CAAAjC,OAAA,EAAAwH,SAAA,OAAI,CAAC7F,OAAO,EAAAO,IAAA,CAAAsF,SAAA,EAC7BnE,MAAM,IAAKA,MAAM,CAACC,IAAI,KAAKmE,SAC9B,CAAC;MACD,IAAIC,WAAW,EAAE;QACfJ,UAAU,CAACC,iBAAiB,CAAC,GAAGG,WAAW,CAACC,yBAAyB,CACnE,IAAI,CAACnB,oBACP,CAAC;MACH;IACF;IAEA,IAAI,CAACoB,gBAAgB,CAACV,cAAc,CAACE,EAAE,EAAEC,OAAO,EAAEC,UAAU,EAAE7G,UAAU,CAAC;EAC3E;;EAEA;AACF;EACE,IAAIoH,aAAaA,CAAA,EAAkC;IACjD,IAAI,IAAI,CAAC9G,IAAI,KAAK,QAAQ,EAAE;MAC1B,OAAO+G,0BAAe,CAACC,KAAK;IAC9B;IAEA,OAAOD,0BAAe,CAACE,MAAM;EAC/B;AACF;AAACC,OAAA,CAAAjI,OAAA,GAAAN,oBAAA"}
|
|
1
|
+
{"version":3,"file":"ChoiceAttributeModel.js","names":["_objects","require","_DateTimeUtil","_AttributeModel","_interopRequireDefault","_ChoiceAttributeOptionCollection","_ChoiceAttributeOptionModel","_ContentConfigurationElements","_LayoutHints","_constants","ChoiceAttributeModel","AttributeModel","constructor","attribute","attributeContributions","_defineProperty2","default","_referenceDate","getData","DateUtil","now","_options","ChoiceAttributeOptionCollection","create","referenceDate","layouthint","has","SORT_OPTIONS","sortOptions","isApplicableModel","contributions","type","optionMode","getContribution","hasLookupLink","lookupLink","lookupListLink","getInitialChildModelLinks","links","hasContentConfiguration","hasContentFromData","conceptLink","push","options","setChildModels","models","conceptLinkHref","href","concept","_find","call","model","selfhref","equalsWithParameters","getLinkByKey","lookupListLabel","lookupList","label","avatarLink","_context","collection","option","code","value","isAvatar","optionType","date","selected","_context2","_map","readonlyvalue","_context3","join","initvalue","Array","isArray","_initvalue","length","getValue","_context4","hasValue","getInputValue","toggleOption","_context5","_includes","disableOption","enableOption","isMultiple","deselectAll","select","inputvalue","deselect","addOption","_context6","opt","choicetype","_context7","hint","multiplechoice","isTree","some","reset","mergeAttribute","oldAttribute","readonly","mergeOptions","isValid","update","updateLastModification","values","split","forEach","val","isChoiceAttributeOptionModel","equals","add","toString","_hasContentConfiguration","contentConfiguration","_context8","content","optionElements","optionElementConfig","optionElement","contentElement","RENDER_SECTION_LABEL","ContentConfigurationElements","placeholder","addServerError","error","id","message","properties","ANSWER_OPTION_KEY","_context9","optionKey","foundOption","getContentConfiguredLabel","_errorCollection","readonlyWidth","ATTRIBUTE_WIDTH","SMALL","MEDIUM","exports"],"sources":["../../../src/models/attributes/ChoiceAttributeModel.js"],"sourcesContent":["// @flow\nimport { has } from \"../../utils/helpers/objects\";\nimport { DateUtil } from \"../../utils/datetime/DateTimeUtil\";\n\nimport AttributeModel from \"./AttributeModel\";\nimport ChoiceAttributeOptionCollection from \"./ChoiceAttributeOptionCollection\";\nimport ChoiceAttributeOptionModel from \"./ChoiceAttributeOptionModel\";\nimport ContentConfigurationElements from \"../contentconfiguration/ContentConfigurationElements\";\n\nimport {\n RENDER_SECTION_LABEL,\n SORT_OPTIONS,\n} from \"../../constants/LayoutHints\";\nimport { ATTRIBUTE_WIDTH } from \"../../constants\";\n\nimport type { ModularUIModel, AttributeType, FormErrorAnchor } from \"../types\";\nimport type LinkModel from \"../links/LinkModel\";\n\n/**\n * Model for a choice attribute\n */\nexport default class ChoiceAttributeModel extends AttributeModel {\n _referenceDate: ISO_DATE;\n _options: ChoiceAttributeOptionCollection;\n _hasContentConfiguration: boolean;\n\n /**\n * Constructs a choice attribute\n */\n constructor(attribute: Object, attributeContributions: Object) {\n super(attribute, attributeContributions);\n\n this._referenceDate = this.getData(\"referenceDate\", DateUtil.now());\n this._options = ChoiceAttributeOptionCollection.create(\n attribute,\n attributeContributions,\n this.referenceDate,\n );\n\n if (this.layouthint.has(SORT_OPTIONS)) {\n this._options.sortOptions = true;\n }\n }\n\n /**\n */\n static isApplicableModel(contributions: Object): boolean {\n return (\n contributions.type !== \"composite\" &&\n contributions.type !== \"boolean\" &&\n (contributions.type === \"choice\" ||\n contributions.type === \"array\" ||\n has(contributions, \"enumerated\") ||\n has(contributions, \"options\"))\n );\n }\n\n /**\n */\n get type(): string {\n const optionMode = this.getContribution(\"optionMode\", \"\");\n const hasLookupLink = this.lookupLink || this.lookupListLink;\n\n if (\n optionMode === \"lookup\" ||\n (optionMode === \"dynamicWithThreshold\" && hasLookupLink)\n ) {\n return \"lookup\";\n }\n\n return \"choice\";\n }\n\n /**\n */\n getInitialChildModelLinks(): Array<LinkModel> {\n const links = [];\n\n if (this.hasContentConfiguration) {\n if (!this.hasContentFromData && this.conceptLink) {\n links.push(this.conceptLink);\n }\n\n links.push(...this.options.getInitialChildModelLinks());\n }\n\n return links;\n }\n\n /**\n */\n setChildModels(models: Array<ModularUIModel>) {\n const conceptLinkHref = this.conceptLink?.href;\n if (conceptLinkHref) {\n this.concept = models.find(\n (model) =>\n model.type === \"ConceptDetail\" &&\n model.selfhref.equalsWithParameters(conceptLinkHref),\n );\n }\n\n this.options.setChildModels(models);\n }\n\n /**\n * Retrieve lookup service link\n */\n get lookupLink(): LinkModel | null {\n return this.links.getLinkByKey(\"lookupOptions\");\n }\n\n /**\n * Retrieve lookup service as list link\n */\n get lookupListLink(): LinkModel | null {\n return this.links.getLinkByKey(\"lookupList\");\n }\n\n /**\n */\n get lookupListLabel(): string {\n return this.contributions.lookupList?.label ?? \"\";\n }\n\n /**\n *\n */\n get avatarLink(): LinkModel | null {\n return (\n this.options.collection.find((option) => option.code === this.value)\n ?.avatarLink || null\n );\n }\n\n /**\n *\n */\n get isAvatar(): boolean {\n return this.contributions?.optionType === \"user\" ?? false;\n }\n\n /**\n * Retrieve reference date of attribute which can be used as entryDate for content\n */\n get referenceDate(): ISO_DATE {\n return this._referenceDate;\n }\n\n /**\n * Set reference date for concepts and content\n */\n set referenceDate(date: string) {\n this._referenceDate = date;\n\n this.options.referenceDate = date;\n }\n\n /**\n * Retrieve available choice options\n */\n get options(): ChoiceAttributeOptionCollection {\n return this._options;\n }\n\n /**\n * Getting all enabled options\n */\n get selected(): Array<string> {\n // $FlowFixMe[incompatible-call]\n return this.options.selected.map<string, ChoiceAttributeOptionModel>(\n (option: ChoiceAttributeOptionModel) => option.code,\n );\n }\n\n /**\n * Flatten options and filter out the options that are not selected\n */\n get readonlyvalue(): string {\n return this.options.selected.map((option) => option.label).join(\", \");\n }\n\n /**\n */\n get initvalue(): any {\n if (Array.isArray(this._initvalue) && this._initvalue.length === 0) {\n return null;\n }\n\n return this._initvalue;\n }\n\n /**\n * Retrieve list of selected options, joined with comma\n */\n getValue(): string | null {\n return this.options.selected.length > 0\n ? this.options.selected.map((option) => option.code).join(\",\")\n : null;\n }\n\n /**\n */\n hasValue(): boolean {\n return this.options.selected.length > 0;\n }\n\n /**\n * Get input value of attribute\n */\n getInputValue(): string {\n return this.selected.join(\",\");\n }\n\n /**\n * Setting an option selected or unselected based on the current state\n */\n toggleOption(code: string) {\n if (this.selected.includes(code)) {\n this.disableOption(code);\n } else {\n this.enableOption(code);\n }\n }\n\n /**\n * Enable a option\n */\n enableOption(code: string) {\n if (!this.isMultiple) {\n this.options.deselectAll();\n }\n\n this.options.select(code);\n this.inputvalue = this.getInputValue();\n }\n\n /**\n * Disable a option\n */\n disableOption(code: string) {\n this.options.deselect(code);\n this.inputvalue = this.getInputValue();\n }\n\n /**\n * Add a new option to the collection of lookup options\n */\n addOption(option: Object) {\n if (!this.isMultiple) {\n this.options.deselectAll();\n }\n\n if (this.options.find((opt) => opt.code === option.code) === null) {\n this.options.addOption(option.code, option);\n }\n }\n\n /**\n * Getting the type of choice filter. For instance checkbox, radiobutton, combobox.\n */\n get choicetype():\n | \"checkbox\"\n | \"radiobutton\"\n | \"combobox\"\n | \"list\"\n | \"listview\"\n | \"table\"\n | \"longlist\"\n | \"toggle\" {\n return (\n [\n \"checkbox\",\n \"radiobutton\",\n \"combobox\",\n \"list\",\n \"listview\",\n \"table\",\n \"longlist\",\n \"toggle\",\n ].find((hint) => this.layouthint.has(hint)) || \"checkbox\"\n );\n }\n\n /**\n * Can multiple options be selected\n */\n get isMultiple(): boolean {\n return this.contributions.multiplechoice || this.choicetype === \"checkbox\";\n }\n\n /**\n * Check if options need to be rendered as tree\n */\n get isTree(): boolean {\n return (\n has(this.contributions, \"options\") &&\n this.contributions.options.some((option) => has(option, \"children\"))\n );\n }\n\n /**\n * Reset choice attribute to unselected list\n */\n reset() {\n this.options.deselectAll();\n }\n\n /**\n */\n mergeAttribute(oldAttribute: AttributeType) {\n // when attribute is readonly, don't merge the options no modifications necessary\n if (!this.readonly && oldAttribute instanceof ChoiceAttributeModel) {\n this.concept = oldAttribute.concept;\n this.options.mergeOptions(oldAttribute.options, this.type === \"lookup\");\n this.options.deselectAll();\n\n if (oldAttribute.isValid && oldAttribute.inputvalue !== null) {\n this.update(oldAttribute.inputvalue);\n }\n }\n }\n\n /**\n * Update attribute by name and value\n */\n update(value: any): ChoiceAttributeModel {\n if (this.readonly) {\n return this;\n }\n\n this.updateLastModification();\n\n let values;\n\n if (Array.isArray(value)) {\n values = value;\n } else if (typeof value === \"string\" && this.isMultiple) {\n values = value.split(\",\");\n } else {\n values = [value];\n }\n values.forEach((val) => {\n if (typeof val === \"object\" && val.isChoiceAttributeOptionModel) {\n // option does not exist in existing options, add it. This can happen when lookup list has other options then lookup options\n if (!this.options.some((option) => option.equals(val))) {\n this.options.add(val);\n }\n\n this.toggleOption(val.code);\n } else if (\n typeof val === \"string\" &&\n this.options.some((option) => option.code.toString() === val)\n ) {\n this.toggleOption(val);\n }\n });\n\n return this;\n }\n\n /**\n */\n set hasContentConfiguration(hasContentConfiguration: boolean) {\n this._hasContentConfiguration =\n this.contentConfiguration !== null || hasContentConfiguration;\n }\n\n /**\n */\n get hasContentConfiguration(): boolean {\n return this._hasContentConfiguration;\n }\n\n /**\n * Get content configuration configured on the attribute.\n * Only applicable for taxonomy element and knowledge codemaps,\n * content configuration for instrument questions is available on the form object\n */\n get contentConfiguration(): ContentConfigurationElements | null {\n if (\n !this.contributions.content ||\n !this.contributions.content.optionElements\n ) {\n return null;\n }\n\n // Add RENDER_SECTION_LABEL to all content configuration to make sure the label of a section is always rendered on taxonomy and knowlege codemaps\n const optionElementConfig = this.contributions.content.optionElements.map(\n (optionElement) => {\n if (\"contentElement\" in optionElement) {\n return {\n contentElement: {\n ...optionElement.contentElement,\n layouthint: [RENDER_SECTION_LABEL],\n },\n };\n }\n\n return optionElement;\n },\n );\n\n return new ContentConfigurationElements(optionElementConfig);\n }\n\n /**\n * Get placeholder text\n */\n get placeholder(): string {\n return this.getContribution(\"placeholder\", \"\");\n }\n\n /**\n * Registers an error that was received from a server response\n */\n addServerError(error: FormErrorAnchor) {\n const { id, message, properties, layouthint } = error;\n\n const ANSWER_OPTION_KEY = \"answer-option-key\";\n\n if (properties && has(properties, ANSWER_OPTION_KEY)) {\n const optionKey = properties[ANSWER_OPTION_KEY];\n const foundOption = this.options.find(\n (option) => option.code === optionKey,\n );\n if (foundOption) {\n properties[ANSWER_OPTION_KEY] = foundOption.getContentConfiguredLabel(\n this.contentConfiguration,\n );\n }\n }\n\n this._errorCollection.addServerError(id, message, properties, layouthint);\n }\n\n /**\n */\n get readonlyWidth(): $Keys<typeof ATTRIBUTE_WIDTH> {\n if (this.type === \"lookup\") {\n return ATTRIBUTE_WIDTH.SMALL;\n }\n\n return ATTRIBUTE_WIDTH.MEDIUM;\n }\n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A,MAAM,CAACC,IAAI,KAAKyE,SAC9B,CAAC;MACD,IAAIC,WAAW,EAAE;QACfJ,UAAU,CAACC,iBAAiB,CAAC,GAAGG,WAAW,CAACC,yBAAyB,CACnE,IAAI,CAACnB,oBACP,CAAC;MACH;IACF;IAEA,IAAI,CAACoB,gBAAgB,CAACV,cAAc,CAACE,EAAE,EAAEC,OAAO,EAAEC,UAAU,EAAE3G,UAAU,CAAC;EAC3E;;EAEA;AACF;EACE,IAAIkH,aAAaA,CAAA,EAAkC;IACjD,IAAI,IAAI,CAAC5G,IAAI,KAAK,QAAQ,EAAE;MAC1B,OAAO6G,0BAAe,CAACC,KAAK;IAC9B;IAEA,OAAOD,0BAAe,CAACE,MAAM;EAC/B;AACF;AAACC,OAAA,CAAA/H,OAAA,GAAAN,oBAAA"}
|
|
@@ -395,7 +395,7 @@ describe("attributeDataHelper", () => {
|
|
|
395
395
|
label: "Driving ban",
|
|
396
396
|
_links: {
|
|
397
397
|
concept: {
|
|
398
|
-
href: "/concepts
|
|
398
|
+
href: "/concepts/%2F_Context%2FPolice incident%20decisions%2FModels%2FSanctions%2FSanctions.bixml/DrivingBan",
|
|
399
399
|
},
|
|
400
400
|
},
|
|
401
401
|
content: {
|
|
@@ -177,7 +177,7 @@ describe("attributeModel", () => {
|
|
|
177
177
|
{
|
|
178
178
|
_links: {
|
|
179
179
|
concept: {
|
|
180
|
-
href: "/concepts
|
|
180
|
+
href: "/concepts/%2FIncident%2FBusiness%20design%2FProcess%20elementen%2FEerste%20contact.bixml/UitslagBlaastestType",
|
|
181
181
|
},
|
|
182
182
|
},
|
|
183
183
|
},
|
|
@@ -190,7 +190,7 @@ describe("attributeModel", () => {
|
|
|
190
190
|
setSetting(ALL_CONTENT_IN_DATA_SETTING, true);
|
|
191
191
|
|
|
192
192
|
expect(attribute.conceptLink.href.path).toBe(
|
|
193
|
-
"/concepts
|
|
193
|
+
"/concepts/%2FIncident%2FBusiness design%2FProcess elementen%2FEerste contact.bixml/UitslagBlaastestType",
|
|
194
194
|
);
|
|
195
195
|
|
|
196
196
|
expect(attribute.referenceDate).toBe("2010-09-10");
|
|
@@ -216,7 +216,7 @@ describe("attributeModel", () => {
|
|
|
216
216
|
{
|
|
217
217
|
_links: {
|
|
218
218
|
concept: {
|
|
219
|
-
href: "/concepts
|
|
219
|
+
href: "/concepts/%2FIncident%2FBusiness%20design%2FProcess%20elementen%2FEerste%20contact.bixml/UitslagBlaastestType",
|
|
220
220
|
},
|
|
221
221
|
},
|
|
222
222
|
},
|
|
@@ -226,7 +226,7 @@ describe("attributeModel", () => {
|
|
|
226
226
|
data: {
|
|
227
227
|
_links: {
|
|
228
228
|
self: {
|
|
229
|
-
href: "/concepts
|
|
229
|
+
href: "/concepts/%2FIncident%2FBusiness%20design%2FProcess%20elementen%2FEerste%20contact.bixml/UitslagBlaastestType",
|
|
230
230
|
},
|
|
231
231
|
},
|
|
232
232
|
filter: {
|
|
@@ -50,7 +50,8 @@ class BusinessScenarioModel extends _ConceptDetailModel.default {
|
|
|
50
50
|
PERSONA: (0, _Settings.getSetting)("BUSINESS_SCENARIO_PERSONA_CONCEPT_TYPE", [`${pathToKmt}/Persona`]),
|
|
51
51
|
SCENARIO: (0, _Settings.getSetting)("BUSINESS_SCENARIO_CONCEPT_TYPE", [`${pathToKmt}/BusinessScenario`])
|
|
52
52
|
};
|
|
53
|
-
|
|
53
|
+
const decodedConceptTypeHref = decodeURIComponent(conceptTypeHref);
|
|
54
|
+
return Array.isArray(conceptTypeSettings[settingName]) && conceptTypeSettings[settingName].some(conceptTypeSetting => (0, _endsWith.default)(decodedConceptTypeHref).call(decodedConceptTypeHref, conceptTypeSetting));
|
|
54
55
|
}
|
|
55
56
|
|
|
56
57
|
/**
|
|
@@ -58,10 +58,11 @@ class BusinessScenarioModel extends ConceptDetailModel {
|
|
|
58
58
|
]),
|
|
59
59
|
};
|
|
60
60
|
|
|
61
|
+
const decodedConceptTypeHref = decodeURIComponent(conceptTypeHref);
|
|
61
62
|
return (
|
|
62
63
|
Array.isArray(conceptTypeSettings[settingName]) &&
|
|
63
64
|
conceptTypeSettings[settingName].some((conceptTypeSetting) =>
|
|
64
|
-
|
|
65
|
+
decodedConceptTypeHref.endsWith(conceptTypeSetting),
|
|
65
66
|
)
|
|
66
67
|
);
|
|
67
68
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BusinessScenarioModel.js","names":["_ConceptDetailModel","_interopRequireDefault","require","_ConceptTypeDetailModel","_Settings","BusinessScenarioModel","ConceptDetailModel","constructor","arguments","_defineProperty2","default","type","modelName","isApplicableModel","data","isOfConceptType","_links","concepttype","href","conceptTypeHref","settingName","pathToKmt","conceptTypeSettings","STEP","getSetting","PERSONA","SCENARIO","Array","isArray","some","conceptTypeSetting","_endsWith","call","getInitialChildModelLinks","_context","_context2","childModelLinks","scenarioStepLinks","_map","_filter","relationsCollection","all","relation","direction","concept","concepttypeHref","path","asLinkModel","length","push","setChildModels","models","conceptTypeModel","_find","model","ConceptTypeDetailModel","conceptType","scenarioSteps","i","selfhref","_scenarioSteps","actors","forEach","scenarioStep","_context3","relationsToActor","newRelationToActor","actor","key","_default","exports"],"sources":["../../../src/models/concepts/BusinessScenarioModel.js"],"sourcesContent":["// @flow\nimport ConceptDetailModel from \"./ConceptDetailModel\";\nimport ConceptTypeDetailModel from \"./ConceptTypeDetailModel\";\nimport { getSetting } from \"../../constants/Settings\";\n\nimport type { ModularUIResponse } from \"../../modularui\";\nimport type { ModularUIModel } from \"../types\";\nimport type LinkModel from \"../links/LinkModel\";\nimport type ConceptLinkModel from \"./ConceptLinkModel\";\n\n/**\n */\nclass BusinessScenarioModel extends ConceptDetailModel {\n _scenarioSteps: Array<ConceptDetailModel>;\n\n /**\n */\n get type(): string {\n return \"BusinessScenario\";\n }\n\n /**\n */\n static get modelName(): string {\n return \"BusinessScenario\";\n }\n\n /**\n */\n static isApplicableModel(data: ModularUIResponse): boolean {\n return BusinessScenarioModel.isOfConceptType(\n data?.data?._links?.concepttype?.href,\n \"SCENARIO\",\n );\n }\n\n /**\n */\n static isOfConceptType(\n conceptTypeHref: ?string,\n settingName: \"STEP\" | \"PERSONA\" | \"SCENARIO\",\n ): boolean {\n if (!conceptTypeHref) {\n return false;\n }\n\n const pathToKmt = \"/Library/KMTs/Business scenarios.bixml\";\n\n const conceptTypeSettings = {\n STEP: getSetting(\"BUSINESS_SCENARIO_STEP_CONCEPT_TYPE\", [\n `${pathToKmt}/ScenarioStep`,\n ]),\n PERSONA: getSetting(\"BUSINESS_SCENARIO_PERSONA_CONCEPT_TYPE\", [\n `${pathToKmt}/Persona`,\n ]),\n SCENARIO: getSetting(\"BUSINESS_SCENARIO_CONCEPT_TYPE\", [\n `${pathToKmt}/BusinessScenario`,\n ]),\n };\n\n return (\n Array.isArray(conceptTypeSettings[settingName]) &&\n conceptTypeSettings[settingName].some((conceptTypeSetting) =>\n
|
|
1
|
+
{"version":3,"file":"BusinessScenarioModel.js","names":["_ConceptDetailModel","_interopRequireDefault","require","_ConceptTypeDetailModel","_Settings","BusinessScenarioModel","ConceptDetailModel","constructor","arguments","_defineProperty2","default","type","modelName","isApplicableModel","data","isOfConceptType","_links","concepttype","href","conceptTypeHref","settingName","pathToKmt","conceptTypeSettings","STEP","getSetting","PERSONA","SCENARIO","decodedConceptTypeHref","decodeURIComponent","Array","isArray","some","conceptTypeSetting","_endsWith","call","getInitialChildModelLinks","_context","_context2","childModelLinks","scenarioStepLinks","_map","_filter","relationsCollection","all","relation","direction","concept","concepttypeHref","path","asLinkModel","length","push","setChildModels","models","conceptTypeModel","_find","model","ConceptTypeDetailModel","conceptType","scenarioSteps","i","selfhref","_scenarioSteps","actors","forEach","scenarioStep","_context3","relationsToActor","newRelationToActor","actor","key","_default","exports"],"sources":["../../../src/models/concepts/BusinessScenarioModel.js"],"sourcesContent":["// @flow\nimport ConceptDetailModel from \"./ConceptDetailModel\";\nimport ConceptTypeDetailModel from \"./ConceptTypeDetailModel\";\nimport { getSetting } from \"../../constants/Settings\";\n\nimport type { ModularUIResponse } from \"../../modularui\";\nimport type { ModularUIModel } from \"../types\";\nimport type LinkModel from \"../links/LinkModel\";\nimport type ConceptLinkModel from \"./ConceptLinkModel\";\n\n/**\n */\nclass BusinessScenarioModel extends ConceptDetailModel {\n _scenarioSteps: Array<ConceptDetailModel>;\n\n /**\n */\n get type(): string {\n return \"BusinessScenario\";\n }\n\n /**\n */\n static get modelName(): string {\n return \"BusinessScenario\";\n }\n\n /**\n */\n static isApplicableModel(data: ModularUIResponse): boolean {\n return BusinessScenarioModel.isOfConceptType(\n data?.data?._links?.concepttype?.href,\n \"SCENARIO\",\n );\n }\n\n /**\n */\n static isOfConceptType(\n conceptTypeHref: ?string,\n settingName: \"STEP\" | \"PERSONA\" | \"SCENARIO\",\n ): boolean {\n if (!conceptTypeHref) {\n return false;\n }\n\n const pathToKmt = \"/Library/KMTs/Business scenarios.bixml\";\n\n const conceptTypeSettings = {\n STEP: getSetting(\"BUSINESS_SCENARIO_STEP_CONCEPT_TYPE\", [\n `${pathToKmt}/ScenarioStep`,\n ]),\n PERSONA: getSetting(\"BUSINESS_SCENARIO_PERSONA_CONCEPT_TYPE\", [\n `${pathToKmt}/Persona`,\n ]),\n SCENARIO: getSetting(\"BUSINESS_SCENARIO_CONCEPT_TYPE\", [\n `${pathToKmt}/BusinessScenario`,\n ]),\n };\n\n const decodedConceptTypeHref = decodeURIComponent(conceptTypeHref);\n return (\n Array.isArray(conceptTypeSettings[settingName]) &&\n conceptTypeSettings[settingName].some((conceptTypeSetting) =>\n decodedConceptTypeHref.endsWith(conceptTypeSetting),\n )\n );\n }\n\n /**\n */\n getInitialChildModelLinks(): Array<LinkModel> {\n const childModelLinks = super.getInitialChildModelLinks();\n\n const scenarioStepLinks = this.relationsCollection.all\n .filter(\n (relation) =>\n relation.direction === \"outgoing\" &&\n BusinessScenarioModel.isOfConceptType(\n relation.concept.concepttypeHref?.path,\n \"STEP\",\n ),\n )\n .map((relation) => relation.concept.asLinkModel());\n\n if (scenarioStepLinks.length > 0) {\n childModelLinks.push(...scenarioStepLinks);\n }\n\n return childModelLinks;\n }\n\n /**\n */\n setChildModels(models: Array<ModularUIModel>) {\n // $FlowExpectedError[incompatible-type]\n const conceptTypeModel: ?ConceptTypeDetailModel = models.find(\n (model) => model instanceof ConceptTypeDetailModel,\n );\n\n if (conceptTypeModel) {\n this.conceptType = conceptTypeModel;\n }\n\n this.relationsCollection.setChildModels(models);\n\n const scenarioSteps = [];\n for (let i = 0; i < models.length; i++) {\n const model = models[i];\n\n if (\n model instanceof ConceptDetailModel &&\n BusinessScenarioModel.isOfConceptType(\n model.conceptType?.selfhref.path,\n \"STEP\",\n )\n ) {\n scenarioSteps.push(model);\n }\n }\n\n this.scenarioSteps = scenarioSteps;\n }\n\n /**\n */\n set scenarioSteps(models: Array<ConceptDetailModel>) {\n this._scenarioSteps = models;\n }\n\n /**\n */\n get scenarioSteps(): Array<ConceptDetailModel> {\n return this._scenarioSteps;\n }\n\n /**\n */\n get actors(): Array<ConceptLinkModel> {\n const actors = [];\n\n this.scenarioSteps.forEach((scenarioStep) => {\n const relationsToActor = scenarioStep.relationsCollection.find(\n (relation) =>\n relation.direction === \"outgoing\" &&\n BusinessScenarioModel.isOfConceptType(\n relation.concept.concepttypeHref?.path,\n \"PERSONA\",\n ),\n );\n\n const newRelationToActor =\n relationsToActor &&\n !actors.some((actor) => actor.key === relationsToActor.concept.key);\n\n if (relationsToActor && newRelationToActor) {\n actors.push(relationsToActor.concept);\n }\n });\n\n return actors;\n }\n}\n\nexport default BusinessScenarioModel;\n"],"mappings":";;;;;;;;;;;;AACA,IAAAA,mBAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,uBAAA,GAAAF,sBAAA,CAAAC,OAAA;AACA,IAAAE,SAAA,GAAAF,OAAA;AAOA;AACA;AACA,MAAMG,qBAAqB,SAASC,2BAAkB,CAAC;EAAAC,YAAA;IAAA,SAAAC,SAAA;IAAA,IAAAC,gBAAA,CAAAC,OAA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,CAACK,KAAK,CAAC;MAC3B;IACF;IAEA,IAAI,CAACG,aAAa,GAAGA,aAAa;EACpC;;EAEA;AACF;EACE,IAAIA,aAAaA,CAACN,MAAiC,EAAE;IACnD,IAAI,CAACS,cAAc,GAAGT,MAAM;EAC9B;;EAEA;AACF;EACE,IAAIM,aAAaA,CAAA,EAA8B;IAC7C,OAAO,IAAI,CAACG,cAAc;EAC5B;;EAEA;AACF;EACE,IAAIC,MAAMA,CAAA,EAA4B;IACpC,MAAMA,MAAM,GAAG,EAAE;IAEjB,IAAI,CAACJ,aAAa,CAACK,OAAO,CAAEC,YAAY,IAAK;MAAA,IAAAC,SAAA;MAC3C,MAAMC,gBAAgB,GAAG,IAAAZ,KAAA,CAAA7C,OAAA,EAAAwD,SAAA,GAAAD,YAAY,CAACvB,mBAAmB,EAAAR,IAAA,CAAAgC,SAAA,EACtDtB,QAAQ,IACPA,QAAQ,CAACC,SAAS,KAAK,UAAU,IACjCxC,qBAAqB,CAACU,eAAe,CACnC6B,QAAQ,CAACE,OAAO,CAACC,eAAe,EAAEC,IAAI,EACtC,SACF,CACJ,CAAC;MAED,MAAMoB,kBAAkB,GACtBD,gBAAgB,IAChB,CAACJ,MAAM,CAAChC,IAAI,CAAEsC,KAAK,IAAKA,KAAK,CAACC,GAAG,KAAKH,gBAAgB,CAACrB,OAAO,CAACwB,GAAG,CAAC;MAErE,IAAIH,gBAAgB,IAAIC,kBAAkB,EAAE;QAC1CL,MAAM,CAACZ,IAAI,CAACgB,gBAAgB,CAACrB,OAAO,CAAC;MACvC;IACF,CAAC,CAAC;IAEF,OAAOiB,MAAM;EACf;AACF;AAAC,IAAAQ,QAAA,GAAAC,OAAA,CAAA9D,OAAA,GAEcL,qBAAqB"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@beinformed/ui",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.42.0",
|
|
4
4
|
"description": "Toolbox for be informed javascript layouts",
|
|
5
5
|
"license": "SEE LICENSE IN LICENSE.md",
|
|
6
6
|
"bugs": "http://support.beinformed.com",
|
|
@@ -82,14 +82,14 @@
|
|
|
82
82
|
"styled-components": "^5.0.0"
|
|
83
83
|
},
|
|
84
84
|
"dependencies": {
|
|
85
|
-
"@babel/runtime-corejs3": "^7.
|
|
85
|
+
"@babel/runtime-corejs3": "^7.24.0",
|
|
86
86
|
"big.js": "^6.2.1",
|
|
87
87
|
"date-fns": "^3.3.1",
|
|
88
88
|
"deepmerge": "^4.3.1",
|
|
89
89
|
"dequal": "^2.0.3",
|
|
90
90
|
"file-size": "^1.0.0",
|
|
91
91
|
"format-message": "^6.2.4",
|
|
92
|
-
"html-entities": "^2.
|
|
92
|
+
"html-entities": "^2.5.2",
|
|
93
93
|
"iban": "^0.0.14",
|
|
94
94
|
"js-cookie": "^3.0.5",
|
|
95
95
|
"klona": "^2.0.6",
|
|
@@ -99,14 +99,14 @@
|
|
|
99
99
|
},
|
|
100
100
|
"devDependencies": {
|
|
101
101
|
"@babel/cli": "^7.23.4",
|
|
102
|
-
"@babel/core": "^7.
|
|
102
|
+
"@babel/core": "^7.24.0",
|
|
103
103
|
"@babel/eslint-parser": "^7.23.3",
|
|
104
104
|
"@babel/eslint-plugin": "^7.23.5",
|
|
105
105
|
"@babel/plugin-proposal-class-properties": "^7.18.6",
|
|
106
106
|
"@babel/plugin-syntax-dynamic-import": "^7.8.3",
|
|
107
|
-
"@babel/plugin-transform-runtime": "^7.
|
|
108
|
-
"@babel/preset-env": "^7.
|
|
109
|
-
"@babel/preset-flow": "^7.
|
|
107
|
+
"@babel/plugin-transform-runtime": "^7.24.0",
|
|
108
|
+
"@babel/preset-env": "^7.24.0",
|
|
109
|
+
"@babel/preset-flow": "^7.24.0",
|
|
110
110
|
"@babel/preset-react": "^7.23.3",
|
|
111
111
|
"@commitlint/cli": "^18.5.0",
|
|
112
112
|
"@commitlint/config-conventional": "^18.5.0",
|
|
@@ -118,14 +118,14 @@
|
|
|
118
118
|
"commit-and-tag-version": "^12.2.0",
|
|
119
119
|
"cross-env": "^7.0.3",
|
|
120
120
|
"documentation": "^14.0.2",
|
|
121
|
-
"eslint": "^8.
|
|
121
|
+
"eslint": "^8.57.0",
|
|
122
122
|
"eslint-config-prettier": "^9.1.0",
|
|
123
123
|
"eslint-plugin-babel": "^5.3.1",
|
|
124
|
-
"eslint-plugin-ft-flow": "^3.0.
|
|
124
|
+
"eslint-plugin-ft-flow": "^3.0.7",
|
|
125
125
|
"eslint-plugin-import": "^2.29.1",
|
|
126
|
-
"eslint-plugin-jest": "^27.
|
|
126
|
+
"eslint-plugin-jest": "^27.9.0",
|
|
127
127
|
"eslint-plugin-jsdoc": "^46.9.0",
|
|
128
|
-
"eslint-plugin-react": "^7.
|
|
128
|
+
"eslint-plugin-react": "^7.34.0",
|
|
129
129
|
"eslint-plugin-react-hooks": "^4.5.0",
|
|
130
130
|
"eslint-plugin-you-dont-need-lodash-underscore": "^6.13.0",
|
|
131
131
|
"flow-bin": "^0.200.1",
|
|
@@ -45,7 +45,7 @@ describe("actionModel", () => {
|
|
|
45
45
|
processTask: {
|
|
46
46
|
_links: {
|
|
47
47
|
concept: {
|
|
48
|
-
href: "/concepts
|
|
48
|
+
href: "/concepts/%2FResearch%20grant%2FBusiness%20design%2FConstraints%2FEligible%20for%20research%20grant.bixml/EligibleResearchGrant",
|
|
49
49
|
},
|
|
50
50
|
},
|
|
51
51
|
consequenceType: "Decision",
|
|
@@ -127,7 +127,8 @@ export default class ChoiceAttributeModel extends AttributeModel {
|
|
|
127
127
|
*/
|
|
128
128
|
get avatarLink(): LinkModel | null {
|
|
129
129
|
return (
|
|
130
|
-
this.options.
|
|
130
|
+
this.options.collection.find((option) => option.code === this.value)
|
|
131
|
+
?.avatarLink || null
|
|
131
132
|
);
|
|
132
133
|
}
|
|
133
134
|
|
|
@@ -40,7 +40,7 @@
|
|
|
40
40
|
"multiplechoice": true,
|
|
41
41
|
"_links": {
|
|
42
42
|
"concept": {
|
|
43
|
-
"href": "/concepts
|
|
43
|
+
"href": "/concepts/%2FIncident%2FBusiness%20design%2FUrgenties%2FLevensbedreigende%20situaties.bixml/LevensbedreigendeSituaties"
|
|
44
44
|
}
|
|
45
45
|
},
|
|
46
46
|
"layouthint": ["checkbox"],
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
"decimalSeparator": ",",
|
|
9
9
|
"_links": {
|
|
10
10
|
"concept": {
|
|
11
|
-
"href": "/concepts
|
|
11
|
+
"href": "/concepts/%2FIncident%2FBusiness%20design%2FProcess%20elementen%2FBoete%20berekenen.bixml/TotaleBoeteBedrag"
|
|
12
12
|
}
|
|
13
13
|
},
|
|
14
14
|
"format": "#.##",
|
|
@@ -395,7 +395,7 @@ describe("attributeDataHelper", () => {
|
|
|
395
395
|
label: "Driving ban",
|
|
396
396
|
_links: {
|
|
397
397
|
concept: {
|
|
398
|
-
href: "/concepts
|
|
398
|
+
href: "/concepts/%2F_Context%2FPolice incident%20decisions%2FModels%2FSanctions%2FSanctions.bixml/DrivingBan",
|
|
399
399
|
},
|
|
400
400
|
},
|
|
401
401
|
content: {
|
|
@@ -177,7 +177,7 @@ describe("attributeModel", () => {
|
|
|
177
177
|
{
|
|
178
178
|
_links: {
|
|
179
179
|
concept: {
|
|
180
|
-
href: "/concepts
|
|
180
|
+
href: "/concepts/%2FIncident%2FBusiness%20design%2FProcess%20elementen%2FEerste%20contact.bixml/UitslagBlaastestType",
|
|
181
181
|
},
|
|
182
182
|
},
|
|
183
183
|
},
|
|
@@ -190,7 +190,7 @@ describe("attributeModel", () => {
|
|
|
190
190
|
setSetting(ALL_CONTENT_IN_DATA_SETTING, true);
|
|
191
191
|
|
|
192
192
|
expect(attribute.conceptLink.href.path).toBe(
|
|
193
|
-
"/concepts
|
|
193
|
+
"/concepts/%2FIncident%2FBusiness design%2FProcess elementen%2FEerste contact.bixml/UitslagBlaastestType",
|
|
194
194
|
);
|
|
195
195
|
|
|
196
196
|
expect(attribute.referenceDate).toBe("2010-09-10");
|
|
@@ -216,7 +216,7 @@ describe("attributeModel", () => {
|
|
|
216
216
|
{
|
|
217
217
|
_links: {
|
|
218
218
|
concept: {
|
|
219
|
-
href: "/concepts
|
|
219
|
+
href: "/concepts/%2FIncident%2FBusiness%20design%2FProcess%20elementen%2FEerste%20contact.bixml/UitslagBlaastestType",
|
|
220
220
|
},
|
|
221
221
|
},
|
|
222
222
|
},
|
|
@@ -226,7 +226,7 @@ describe("attributeModel", () => {
|
|
|
226
226
|
data: {
|
|
227
227
|
_links: {
|
|
228
228
|
self: {
|
|
229
|
-
href: "/concepts
|
|
229
|
+
href: "/concepts/%2FIncident%2FBusiness%20design%2FProcess%20elementen%2FEerste%20contact.bixml/UitslagBlaastestType",
|
|
230
230
|
},
|
|
231
231
|
},
|
|
232
232
|
filter: {
|
|
@@ -58,10 +58,11 @@ class BusinessScenarioModel extends ConceptDetailModel {
|
|
|
58
58
|
]),
|
|
59
59
|
};
|
|
60
60
|
|
|
61
|
+
const decodedConceptTypeHref = decodeURIComponent(conceptTypeHref);
|
|
61
62
|
return (
|
|
62
63
|
Array.isArray(conceptTypeSettings[settingName]) &&
|
|
63
64
|
conceptTypeSettings[settingName].some((conceptTypeSetting) =>
|
|
64
|
-
|
|
65
|
+
decodedConceptTypeHref.endsWith(conceptTypeSetting),
|
|
65
66
|
)
|
|
66
67
|
);
|
|
67
68
|
}
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"_id": "ScenarioIncident",
|
|
4
4
|
"_links": {
|
|
5
5
|
"self": {
|
|
6
|
-
"href": "/concepts
|
|
6
|
+
"href": "/concepts/%2FIncident%2FBusiness+design%2FBusiness+scenario%2FScenario incident.bixml/ScenarioIncident"
|
|
7
7
|
},
|
|
8
8
|
"api_doc": {
|
|
9
9
|
"href": "/api-docs/v3/concepts/(knowledge-model-identifier)/(concept-identifier)"
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
"href": "/contributions/concepts/(knowledge-model-identifier)/(concept-identifier)"
|
|
13
13
|
},
|
|
14
14
|
"concepttype": {
|
|
15
|
-
"href": "/concepttypes
|
|
15
|
+
"href": "/concepttypes/%2FLibrary%2FKMTs%2FBusiness%20scenarios.bixml/BusinessScenario"
|
|
16
16
|
}
|
|
17
17
|
},
|
|
18
18
|
"filter": {
|
|
@@ -32,10 +32,10 @@
|
|
|
32
32
|
"concept": {
|
|
33
33
|
"_links": {
|
|
34
34
|
"self": {
|
|
35
|
-
"href": "/concepts
|
|
35
|
+
"href": "/concepts/%2FIncident%2FBusiness+design%2FBusiness+scenario%2FScenario+incident.bixml/StaandehoudingScSt"
|
|
36
36
|
},
|
|
37
37
|
"concepttype": {
|
|
38
|
-
"href": "/concepttypes
|
|
38
|
+
"href": "/concepttypes/%2FLibrary%2FKMTs%2FBusiness%20scenarios.bixml/ScenarioStep"
|
|
39
39
|
}
|
|
40
40
|
},
|
|
41
41
|
"conceptLabel": "Staandehouding",
|