@beinformed/ui 1.25.2 → 1.25.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +18 -0
- package/esm/constants/Constants.js +5 -0
- package/esm/constants/Constants.js.map +1 -1
- package/esm/hooks/useAuthentication.js +5 -5
- package/esm/hooks/useAuthentication.js.map +1 -1
- package/esm/hooks/useModularUI.js.map +1 -1
- package/esm/hooks/useModularUIBasic.js +7 -1
- package/esm/hooks/useModularUIBasic.js.map +1 -1
- package/esm/hooks/useModularUIModel.js +9 -1
- package/esm/hooks/useModularUIModel.js.map +1 -1
- package/esm/hooks/useModularUIRequest.js +5 -7
- package/esm/hooks/useModularUIRequest.js.map +1 -1
- package/esm/models/application/ApplicationModel.js +9 -1
- package/esm/models/application/ApplicationModel.js.map +1 -1
- package/esm/models/base/ResourceModel.js +7 -0
- package/esm/models/base/ResourceModel.js.map +1 -1
- package/esm/models/caseview/CaseViewModel.js +6 -0
- package/esm/models/caseview/CaseViewModel.js.map +1 -1
- package/esm/models/concepts/BusinessScenarioModel.js +6 -0
- package/esm/models/concepts/BusinessScenarioModel.js.map +1 -1
- package/esm/models/concepts/ConceptDetailModel.js +6 -0
- package/esm/models/concepts/ConceptDetailModel.js.map +1 -1
- package/esm/models/concepts/ConceptIndexModel.js +6 -0
- package/esm/models/concepts/ConceptIndexModel.js.map +1 -1
- package/esm/models/concepts/ConceptTypeDetailModel.js +6 -0
- package/esm/models/concepts/ConceptTypeDetailModel.js.map +1 -1
- package/esm/models/content/ContentIndexModel.js +6 -0
- package/esm/models/content/ContentIndexModel.js.map +1 -1
- package/esm/models/content/ContentModel.js +6 -0
- package/esm/models/content/ContentModel.js.map +1 -1
- package/esm/models/content/ContentTOCModel.js +6 -0
- package/esm/models/content/ContentTOCModel.js.map +1 -1
- package/esm/models/content/ContentTypeModel.js +6 -0
- package/esm/models/content/ContentTypeModel.js.map +1 -1
- package/esm/models/detail/DetailModel.js +6 -0
- package/esm/models/detail/DetailModel.js.map +1 -1
- package/esm/models/form/FormModel.js +6 -0
- package/esm/models/form/FormModel.js.map +1 -1
- package/esm/models/list/ListDetailModel.js +6 -0
- package/esm/models/list/ListDetailModel.js.map +1 -1
- package/esm/models/list/ListModel.js +6 -0
- package/esm/models/list/ListModel.js.map +1 -1
- package/esm/models/lookup/LookupOptionsModel.js +6 -0
- package/esm/models/lookup/LookupOptionsModel.js.map +1 -1
- package/esm/models/modelcatalog/ModelCatalogModel.js +6 -0
- package/esm/models/modelcatalog/ModelCatalogModel.js.map +1 -1
- package/esm/models/panels/GroupingPanelModel.js +6 -0
- package/esm/models/panels/GroupingPanelModel.js.map +1 -1
- package/esm/models/resolveModel.js +4 -4
- package/esm/models/resolveModel.js.map +1 -1
- package/esm/models/search/CaseSearchModel.js +6 -0
- package/esm/models/search/CaseSearchModel.js.map +1 -1
- package/esm/models/tab/TabModel.js +6 -0
- package/esm/models/tab/TabModel.js.map +1 -1
- package/esm/models/taskgroup/TaskGroupModel.js +6 -0
- package/esm/models/taskgroup/TaskGroupModel.js.map +1 -1
- package/esm/models/types.js.map +1 -1
- package/esm/models/user/UserModel.js +6 -0
- package/esm/models/user/UserModel.js.map +1 -1
- package/esm/models/user/UserProfileModel.js +6 -0
- package/esm/models/user/UserProfileModel.js.map +1 -1
- package/esm/models/user/UserServicesModel.js +6 -0
- package/esm/models/user/UserServicesModel.js.map +1 -1
- package/esm/modularui/ModularUIRequest.js +54 -10
- package/esm/modularui/ModularUIRequest.js.map +1 -1
- package/esm/modularui/types.js +2 -0
- package/esm/modularui/types.js.map +1 -0
- package/esm/redux/_modularui/ModularUIActions.js +2 -0
- package/esm/redux/_modularui/ModularUIActions.js.map +1 -1
- package/esm/redux/_modularui/ModularUIMiddleware.js +1 -0
- package/esm/redux/_modularui/ModularUIMiddleware.js.map +1 -1
- package/esm/redux/_modularui/types.js.map +1 -1
- package/esm/redux/_modularui/withModularUI.js.map +1 -1
- package/esm/utils/fetch/types.js.map +1 -1
- package/lib/constants/Constants.js +7 -1
- package/lib/constants/Constants.js.flow +6 -0
- package/lib/constants/Constants.js.map +1 -1
- package/lib/hooks/__tests__/UseModularUIModel.spec.js.flow +1 -1
- package/lib/hooks/__tests__/useModelCatalog.spec.js.flow +1 -1
- package/lib/hooks/__tests__/useModularUIBasic.spec.js.flow +2 -2
- package/lib/hooks/useAuthentication.js +4 -4
- package/lib/hooks/useAuthentication.js.flow +17 -5
- package/lib/hooks/useAuthentication.js.map +1 -1
- package/lib/hooks/useModularUI.js.flow +2 -2
- package/lib/hooks/useModularUI.js.map +1 -1
- package/lib/hooks/useModularUIBasic.js +7 -1
- package/lib/hooks/useModularUIBasic.js.flow +14 -4
- package/lib/hooks/useModularUIBasic.js.map +1 -1
- package/lib/hooks/useModularUIModel.js +11 -2
- package/lib/hooks/useModularUIModel.js.flow +19 -10
- package/lib/hooks/useModularUIModel.js.map +1 -1
- package/lib/hooks/useModularUIRequest.js +5 -7
- package/lib/hooks/useModularUIRequest.js.flow +12 -11
- package/lib/hooks/useModularUIRequest.js.map +1 -1
- package/lib/models/application/ApplicationModel.js +8 -1
- package/lib/models/application/ApplicationModel.js.flow +10 -1
- package/lib/models/application/ApplicationModel.js.map +1 -1
- package/lib/models/base/ResourceModel.js +7 -0
- package/lib/models/base/ResourceModel.js.flow +7 -0
- package/lib/models/base/ResourceModel.js.map +1 -1
- package/lib/models/caseview/CaseViewModel.js +6 -0
- package/lib/models/caseview/CaseViewModel.js.flow +6 -0
- package/lib/models/caseview/CaseViewModel.js.map +1 -1
- package/lib/models/concepts/BusinessScenarioModel.js +6 -0
- package/lib/models/concepts/BusinessScenarioModel.js.flow +6 -0
- package/lib/models/concepts/BusinessScenarioModel.js.map +1 -1
- package/lib/models/concepts/ConceptDetailModel.js +6 -0
- package/lib/models/concepts/ConceptDetailModel.js.flow +6 -0
- package/lib/models/concepts/ConceptDetailModel.js.map +1 -1
- package/lib/models/concepts/ConceptIndexModel.js +6 -0
- package/lib/models/concepts/ConceptIndexModel.js.flow +6 -0
- package/lib/models/concepts/ConceptIndexModel.js.map +1 -1
- package/lib/models/concepts/ConceptTypeDetailModel.js +6 -0
- package/lib/models/concepts/ConceptTypeDetailModel.js.flow +6 -0
- package/lib/models/concepts/ConceptTypeDetailModel.js.map +1 -1
- package/lib/models/content/ContentIndexModel.js +6 -0
- package/lib/models/content/ContentIndexModel.js.flow +6 -0
- package/lib/models/content/ContentIndexModel.js.map +1 -1
- package/lib/models/content/ContentModel.js +6 -0
- package/lib/models/content/ContentModel.js.flow +6 -0
- package/lib/models/content/ContentModel.js.map +1 -1
- package/lib/models/content/ContentTOCModel.js +6 -0
- package/lib/models/content/ContentTOCModel.js.flow +6 -0
- package/lib/models/content/ContentTOCModel.js.map +1 -1
- package/lib/models/content/ContentTypeModel.js +6 -0
- package/lib/models/content/ContentTypeModel.js.flow +6 -0
- package/lib/models/content/ContentTypeModel.js.map +1 -1
- package/lib/models/detail/DetailModel.js +6 -0
- package/lib/models/detail/DetailModel.js.flow +6 -0
- package/lib/models/detail/DetailModel.js.map +1 -1
- package/lib/models/form/FormModel.js +6 -0
- package/lib/models/form/FormModel.js.flow +6 -0
- package/lib/models/form/FormModel.js.map +1 -1
- package/lib/models/list/ListDetailModel.js +6 -0
- package/lib/models/list/ListDetailModel.js.flow +6 -0
- package/lib/models/list/ListDetailModel.js.map +1 -1
- package/lib/models/list/ListModel.js +6 -0
- package/lib/models/list/ListModel.js.flow +6 -0
- package/lib/models/list/ListModel.js.map +1 -1
- package/lib/models/lookup/LookupOptionsModel.js +6 -0
- package/lib/models/lookup/LookupOptionsModel.js.flow +6 -0
- package/lib/models/lookup/LookupOptionsModel.js.map +1 -1
- package/lib/models/modelcatalog/ModelCatalogModel.js +6 -0
- package/lib/models/modelcatalog/ModelCatalogModel.js.flow +6 -0
- package/lib/models/modelcatalog/ModelCatalogModel.js.map +1 -1
- package/lib/models/panels/GroupingPanelModel.js +6 -0
- package/lib/models/panels/GroupingPanelModel.js.flow +6 -0
- package/lib/models/panels/GroupingPanelModel.js.map +1 -1
- package/lib/models/resolveModel.js +4 -3
- package/lib/models/resolveModel.js.flow +6 -4
- package/lib/models/resolveModel.js.map +1 -1
- package/lib/models/search/CaseSearchModel.js +6 -0
- package/lib/models/search/CaseSearchModel.js.flow +6 -0
- package/lib/models/search/CaseSearchModel.js.map +1 -1
- package/lib/models/tab/TabModel.js +6 -0
- package/lib/models/tab/TabModel.js.flow +6 -0
- package/lib/models/tab/TabModel.js.map +1 -1
- package/lib/models/taskgroup/TaskGroupModel.js +6 -0
- package/lib/models/taskgroup/TaskGroupModel.js.flow +6 -0
- package/lib/models/taskgroup/TaskGroupModel.js.map +1 -1
- package/lib/models/types.js.flow +1 -1
- package/lib/models/types.js.map +1 -1
- package/lib/models/user/UserModel.js +6 -0
- package/lib/models/user/UserModel.js.flow +6 -0
- package/lib/models/user/UserModel.js.map +1 -1
- package/lib/models/user/UserProfileModel.js +6 -0
- package/lib/models/user/UserProfileModel.js.flow +6 -0
- package/lib/models/user/UserProfileModel.js.map +1 -1
- package/lib/models/user/UserServicesModel.js +6 -0
- package/lib/models/user/UserServicesModel.js.flow +6 -0
- package/lib/models/user/UserServicesModel.js.map +1 -1
- package/lib/modularui/ModularUIRequest.js +54 -10
- package/lib/modularui/ModularUIRequest.js.flow +83 -17
- package/lib/modularui/ModularUIRequest.js.map +1 -1
- package/lib/modularui/__tests__/ModularUIRequest.spec.js.flow +4 -9
- package/lib/modularui/types.js +2 -0
- package/lib/modularui/types.js.flow +4 -0
- package/lib/modularui/types.js.map +1 -0
- package/lib/redux/_modularui/ModularUIActions.js +2 -0
- package/lib/redux/_modularui/ModularUIActions.js.flow +6 -4
- package/lib/redux/_modularui/ModularUIActions.js.map +1 -1
- package/lib/redux/_modularui/ModularUIMiddleware.js +1 -0
- package/lib/redux/_modularui/ModularUIMiddleware.js.flow +5 -2
- package/lib/redux/_modularui/ModularUIMiddleware.js.map +1 -1
- package/lib/redux/_modularui/types.js.flow +5 -3
- package/lib/redux/_modularui/types.js.map +1 -1
- package/lib/redux/_modularui/withModularUI.js.flow +2 -2
- package/lib/redux/_modularui/withModularUI.js.map +1 -1
- package/lib/utils/fetch/types.js.flow +12 -4
- package/lib/utils/fetch/types.js.map +1 -1
- package/package.json +7 -7
- package/src/constants/Constants.js +6 -0
- package/src/hooks/__tests__/UseModularUIModel.spec.js +1 -1
- package/src/hooks/__tests__/useModelCatalog.spec.js +1 -1
- package/src/hooks/__tests__/useModularUIBasic.spec.js +2 -2
- package/src/hooks/useAuthentication.js +17 -5
- package/src/hooks/useModularUI.js +2 -2
- package/src/hooks/useModularUIBasic.js +14 -4
- package/src/hooks/useModularUIModel.js +19 -10
- package/src/hooks/useModularUIRequest.js +12 -11
- package/src/models/application/ApplicationModel.js +10 -1
- package/src/models/base/ResourceModel.js +7 -0
- package/src/models/caseview/CaseViewModel.js +6 -0
- package/src/models/concepts/BusinessScenarioModel.js +6 -0
- package/src/models/concepts/ConceptDetailModel.js +6 -0
- package/src/models/concepts/ConceptIndexModel.js +6 -0
- package/src/models/concepts/ConceptTypeDetailModel.js +6 -0
- package/src/models/content/ContentIndexModel.js +6 -0
- package/src/models/content/ContentModel.js +6 -0
- package/src/models/content/ContentTOCModel.js +6 -0
- package/src/models/content/ContentTypeModel.js +6 -0
- package/src/models/detail/DetailModel.js +6 -0
- package/src/models/form/FormModel.js +6 -0
- package/src/models/list/ListDetailModel.js +6 -0
- package/src/models/list/ListModel.js +6 -0
- package/src/models/lookup/LookupOptionsModel.js +6 -0
- package/src/models/modelcatalog/ModelCatalogModel.js +6 -0
- package/src/models/panels/GroupingPanelModel.js +6 -0
- package/src/models/resolveModel.js +6 -4
- package/src/models/search/CaseSearchModel.js +6 -0
- package/src/models/tab/TabModel.js +6 -0
- package/src/models/taskgroup/TaskGroupModel.js +6 -0
- package/src/models/types.js +1 -1
- package/src/models/user/UserModel.js +6 -0
- package/src/models/user/UserProfileModel.js +6 -0
- package/src/models/user/UserServicesModel.js +6 -0
- package/src/modularui/ModularUIRequest.js +83 -17
- package/src/modularui/__tests__/ModularUIRequest.spec.js +4 -9
- package/src/modularui/types.js +4 -0
- package/src/redux/_modularui/ModularUIActions.js +6 -4
- package/src/redux/_modularui/ModularUIMiddleware.js +5 -2
- package/src/redux/_modularui/types.js +5 -3
- package/src/redux/_modularui/withModularUI.js +2 -2
- package/src/utils/fetch/types.js +12 -4
- package/types/constants/Constants.d.ts +5 -0
- package/types/models/base/ResourceModel.d.ts +4 -0
- package/types/models/form/FormObjectModel.d.ts +28 -2
- package/types/models/resolveModel.d.ts +1 -1
- package/types/models/types.d.ts +1 -1
- package/types/modularui/ModularUIRequest.d.ts +15 -7
- package/types/modularui/types.d.ts +2 -0
- package/types/redux/_modularui/types.d.ts +2 -2
- package/types/utils/fetch/types.d.ts +8 -5
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GroupingPanelModel.js","names":["ResourceModel","TaskGroupCollection","TaskGroupModel","GroupingPanelModel","constructor","modularuiResponse","createTaskGroupCollection","type","isApplicableModel","data","contributions","resourcetype","label","getInitialChildModelLinks","links","getLinksByGroup","all","panelLinks","setChildModels","models","taskGroups","i","length","push","taskGroupCollection","add","hasIntroText","introtext","_content","text","message","Array","isArray","texts","allTaskgroupsData","getData","allTaskgroupsContributions","getContribution","taskgroup","some","taskgroupContribution","name","taskgroupContributions","create","taskgroups","_taskGroupCollection","hasTaskGroups","hasItems","hasTasks"],"sources":["../../../src/models/panels/GroupingPanelModel.js"],"sourcesContent":["// @flow\nimport ResourceModel from \"../base/ResourceModel\";\nimport TaskGroupCollection from \"../taskgroup/TaskGroupCollection\";\n\nimport TaskGroupModel from \"../taskgroup/TaskGroupModel\";\n\nimport type { ModularUIResponse } from \"../../modularui\";\nimport type { ModularUIModel } from \"../types\";\nimport type LinkModel from \"../links/LinkModel\";\nimport type LinkCollection from \"../links/LinkCollection\";\n\n/**\n * Panel that groups other panels\n */\nexport default class GroupingPanelModel extends ResourceModel {\n _taskGroupCollection: TaskGroupCollection;\n\n /**\n * Constructs GroupingPanel\n */\n constructor(modularuiResponse: ModularUIResponse) {\n super(modularuiResponse);\n\n this.createTaskGroupCollection();\n }\n\n /**\n */\n get type(): string {\n return \"GroupingPanel\";\n }\n\n /**\n */\n static isApplicableModel(data: ModularUIResponse): boolean {\n return (\n data.contributions.resourcetype &&\n [\"GroupingPanel\", \"CaseTabGroupingPanel\", \"TabGroupingPanel\"].includes(\n data.contributions.resourcetype\n )\n );\n }\n\n /**\n * Getting the label of the panel\n */\n get label(): string {\n return this.contributions.label;\n }\n\n /**\n */\n getInitialChildModelLinks(): Array<LinkModel> {\n return this.links.getLinksByGroup(\"taskgroup\").all;\n }\n\n /**\n */\n get panelLinks(): LinkCollection {\n return this.links.getLinksByGroup(\"panel\");\n }\n\n /**\n */\n setChildModels(models: Array<ModularUIModel>) {\n const taskGroups = [];\n\n for (let i = 0; i < models.length; i++) {\n if (models[i] instanceof TaskGroupModel) {\n taskGroups.push(models[i]);\n }\n }\n\n this.taskGroupCollection.add(taskGroups);\n }\n\n /**\n * Check if an introtext exists for this caseview\n */\n hasIntroText(): boolean {\n return this.introtext !== \"\";\n }\n\n /**\n * Getting the introduction text configured on the grouping panel\n */\n get introtext(): string {\n if (this.data._content) {\n return this.data._content.text.message;\n }\n\n if (this.contributions.text) {\n return this.contributions.text.message ?? this.contributions.text;\n }\n\n if (Array.isArray(this.contributions.texts)) {\n return this.contributions.texts[0].text;\n }\n\n return \"\";\n }\n\n /**\n */\n createTaskGroupCollection() {\n const allTaskgroupsData = this.getData(\"taskgroups\", []);\n const allTaskgroupsContributions = this.getContribution(\"taskgroups\", []);\n\n this.taskGroupCollection = allTaskgroupsData\n .filter((taskgroup) =>\n allTaskgroupsContributions.some(\n (taskgroupContribution) =>\n taskgroupContribution.name === taskgroup.name\n )\n )\n .map((taskgroup) => {\n const taskgroupContributions = allTaskgroupsContributions.find(\n (taskgroupContribution) =>\n taskgroupContribution.name === taskgroup.name\n );\n\n return TaskGroupModel.create(\n taskgroup.name,\n taskgroup,\n taskgroupContributions\n );\n });\n }\n\n /**\n * Setting the taskgroup panel collection\n */\n set taskGroupCollection(taskgroups: Array<TaskGroupModel>) {\n this._taskGroupCollection = new TaskGroupCollection(taskgroups);\n }\n\n /**\n * Getting the taskgrouppanels on the tab\n */\n get taskGroupCollection(): TaskGroupCollection {\n return this._taskGroupCollection;\n }\n\n /**\n * Has taskgroups\n */\n hasTaskGroups(): boolean {\n return this.taskGroupCollection && this.taskGroupCollection.hasItems;\n }\n\n /**\n * Has tasks\n */\n hasTasks(): boolean {\n return this.taskGroupCollection.hasTasks();\n }\n}\n"],"mappings":";;;;;AACA,OAAOA,aAAa,MAAM,uBAAuB;AACjD,OAAOC,mBAAmB,MAAM,kCAAkC;AAElE,OAAOC,cAAc,MAAM,6BAA6B;AAOxD;AACA;AACA;AACA,eAAe,MAAMC,kBAAkB,SAASH,aAAa,CAAC;EAG5D;AACF;AACA;EACEI,WAAW,CAACC,iBAAoC,EAAE;IAChD,KAAK,CAACA,iBAAiB,CAAC;IAAC;IAEzB,IAAI,CAACC,yBAAyB,EAAE;EAClC;;EAEA;AACF;EACE,IAAIC,IAAI,GAAW;IACjB,OAAO,eAAe;EACxB;;EAEA;AACF;EACE,OAAOC,iBAAiB,CAACC,IAAuB,EAAW;IAAA;IACzD,OACEA,IAAI,CAACC,aAAa,CAACC,YAAY,IAC/B,sCAAC,eAAe,EAAE,sBAAsB,EAAE,kBAAkB,CAAC,iBAC3DF,IAAI,CAACC,aAAa,CAACC,YAAY,CAChC;EAEL;;EAEA;AACF;AACA;EACE,IAAIC,KAAK,GAAW;IAClB,OAAO,IAAI,CAACF,aAAa,CAACE,KAAK;EACjC;;EAEA;AACF;EACEC,yBAAyB,GAAqB;IAC5C,OAAO,IAAI,CAACC,KAAK,CAACC,eAAe,CAAC,WAAW,CAAC,CAACC,GAAG;EACpD;;EAEA;AACF;EACE,IAAIC,UAAU,GAAmB;IAC/B,OAAO,IAAI,CAACH,KAAK,CAACC,eAAe,CAAC,OAAO,CAAC;EAC5C;;EAEA;AACF;EACEG,cAAc,CAACC,MAA6B,EAAE;IAC5C,MAAMC,UAAU,GAAG,EAAE;IAErB,KAAK,IAAIC,CAAC,GAAG,CAAC,EAAEA,CAAC,GAAGF,MAAM,CAACG,MAAM,EAAED,CAAC,EAAE,EAAE;MACtC,IAAIF,MAAM,CAACE,CAAC,CAAC,
|
|
1
|
+
{"version":3,"file":"GroupingPanelModel.js","names":["ResourceModel","TaskGroupCollection","TaskGroupModel","GroupingPanelModel","constructor","modularuiResponse","createTaskGroupCollection","type","modelName","isApplicableModel","data","contributions","resourcetype","label","getInitialChildModelLinks","links","getLinksByGroup","all","panelLinks","setChildModels","models","taskGroups","i","length","push","taskGroupCollection","add","hasIntroText","introtext","_content","text","message","Array","isArray","texts","allTaskgroupsData","getData","allTaskgroupsContributions","getContribution","taskgroup","some","taskgroupContribution","name","taskgroupContributions","create","taskgroups","_taskGroupCollection","hasTaskGroups","hasItems","hasTasks"],"sources":["../../../src/models/panels/GroupingPanelModel.js"],"sourcesContent":["// @flow\nimport ResourceModel from \"../base/ResourceModel\";\nimport TaskGroupCollection from \"../taskgroup/TaskGroupCollection\";\n\nimport TaskGroupModel from \"../taskgroup/TaskGroupModel\";\n\nimport type { ModularUIResponse } from \"../../modularui\";\nimport type { ModularUIModel } from \"../types\";\nimport type LinkModel from \"../links/LinkModel\";\nimport type LinkCollection from \"../links/LinkCollection\";\n\n/**\n * Panel that groups other panels\n */\nexport default class GroupingPanelModel extends ResourceModel {\n _taskGroupCollection: TaskGroupCollection;\n\n /**\n * Constructs GroupingPanel\n */\n constructor(modularuiResponse: ModularUIResponse) {\n super(modularuiResponse);\n\n this.createTaskGroupCollection();\n }\n\n /**\n */\n get type(): string {\n return \"GroupingPanel\";\n }\n\n /**\n */\n static get modelName(): string {\n return \"GroupingPanelModel\";\n }\n\n /**\n */\n static isApplicableModel(data: ModularUIResponse): boolean {\n return (\n data.contributions.resourcetype &&\n [\"GroupingPanel\", \"CaseTabGroupingPanel\", \"TabGroupingPanel\"].includes(\n data.contributions.resourcetype\n )\n );\n }\n\n /**\n * Getting the label of the panel\n */\n get label(): string {\n return this.contributions.label;\n }\n\n /**\n */\n getInitialChildModelLinks(): Array<LinkModel> {\n return this.links.getLinksByGroup(\"taskgroup\").all;\n }\n\n /**\n */\n get panelLinks(): LinkCollection {\n return this.links.getLinksByGroup(\"panel\");\n }\n\n /**\n */\n setChildModels(models: Array<ModularUIModel>) {\n const taskGroups = [];\n\n for (let i = 0; i < models.length; i++) {\n if (models[i] instanceof TaskGroupModel) {\n taskGroups.push(models[i]);\n }\n }\n\n this.taskGroupCollection.add(taskGroups);\n }\n\n /**\n * Check if an introtext exists for this caseview\n */\n hasIntroText(): boolean {\n return this.introtext !== \"\";\n }\n\n /**\n * Getting the introduction text configured on the grouping panel\n */\n get introtext(): string {\n if (this.data._content) {\n return this.data._content.text.message;\n }\n\n if (this.contributions.text) {\n return this.contributions.text.message ?? this.contributions.text;\n }\n\n if (Array.isArray(this.contributions.texts)) {\n return this.contributions.texts[0].text;\n }\n\n return \"\";\n }\n\n /**\n */\n createTaskGroupCollection() {\n const allTaskgroupsData = this.getData(\"taskgroups\", []);\n const allTaskgroupsContributions = this.getContribution(\"taskgroups\", []);\n\n this.taskGroupCollection = allTaskgroupsData\n .filter((taskgroup) =>\n allTaskgroupsContributions.some(\n (taskgroupContribution) =>\n taskgroupContribution.name === taskgroup.name\n )\n )\n .map((taskgroup) => {\n const taskgroupContributions = allTaskgroupsContributions.find(\n (taskgroupContribution) =>\n taskgroupContribution.name === taskgroup.name\n );\n\n return TaskGroupModel.create(\n taskgroup.name,\n taskgroup,\n taskgroupContributions\n );\n });\n }\n\n /**\n * Setting the taskgroup panel collection\n */\n set taskGroupCollection(taskgroups: Array<TaskGroupModel>) {\n this._taskGroupCollection = new TaskGroupCollection(taskgroups);\n }\n\n /**\n * Getting the taskgrouppanels on the tab\n */\n get taskGroupCollection(): TaskGroupCollection {\n return this._taskGroupCollection;\n }\n\n /**\n * Has taskgroups\n */\n hasTaskGroups(): boolean {\n return this.taskGroupCollection && this.taskGroupCollection.hasItems;\n }\n\n /**\n * Has tasks\n */\n hasTasks(): boolean {\n return this.taskGroupCollection.hasTasks();\n }\n}\n"],"mappings":"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"}
|
|
@@ -24,7 +24,6 @@ import ContentModel from "./content/ContentModel";
|
|
|
24
24
|
import ContentTypeModel from "./content/ContentTypeModel";
|
|
25
25
|
import LookupOptionsModel from "./lookup/LookupOptionsModel";
|
|
26
26
|
import { IllegalArgumentException } from "../exceptions";
|
|
27
|
-
|
|
28
27
|
/**
|
|
29
28
|
* Mapping of models and resourcetypes
|
|
30
29
|
*/
|
|
@@ -33,14 +32,15 @@ const RESOURCE_MODELS = [ApplicationModel, TabModel, ListDetailModel, ListModel,
|
|
|
33
32
|
/**
|
|
34
33
|
* Resolve a model by resource
|
|
35
34
|
*/
|
|
36
|
-
const resolveModel = data
|
|
35
|
+
const resolveModel = function (data) {
|
|
36
|
+
let availableModels = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : RESOURCE_MODELS;
|
|
37
37
|
if (!data) {
|
|
38
38
|
throw new IllegalArgumentException("No data or contribution available, cannot resolve model");
|
|
39
39
|
}
|
|
40
40
|
if (!has(data.contributions, "resourcetype")) {
|
|
41
|
-
throw new IllegalArgumentException("Data has wrong format, missing resourcetype in contributions, cannot resolve model");
|
|
41
|
+
throw new IllegalArgumentException("Data has wrong format, missing resourcetype property in contributions, cannot resolve model");
|
|
42
42
|
}
|
|
43
|
-
const resourceTypeModel = _findInstanceProperty(
|
|
43
|
+
const resourceTypeModel = _findInstanceProperty(availableModels).call(availableModels, resourceModel => resourceModel.isApplicableModel(data));
|
|
44
44
|
if (resourceTypeModel) {
|
|
45
45
|
return resourceTypeModel;
|
|
46
46
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"resolveModel.js","names":["has","ApplicationModel","CaseSearchModel","CaseViewModel","DetailModel","FormModel","GroupingPanelModel","ListModel","ListDetailModel","TabModel","TaskGroupModel","UserModel","UserProfileModel","UserServicesModel","ModelCatalogModel","ConceptIndexModel","BusinessScenarioModel","ConceptDetailModel","ConceptTypeDetailModel","ContentIndexModel","ContentTOCModel","ContentModel","ContentTypeModel","LookupOptionsModel","IllegalArgumentException","RESOURCE_MODELS","resolveModel","data","contributions","resourceTypeModel","resourceModel","isApplicableModel"],"sources":["../../src/models/resolveModel.js"],"sourcesContent":["// @flow\nimport { has } from \"../utils/helpers/objects\";\n\nimport ApplicationModel from \"./application/ApplicationModel\";\nimport CaseSearchModel from \"./search/CaseSearchModel\";\nimport CaseViewModel from \"./caseview/CaseViewModel\";\nimport DetailModel from \"./detail/DetailModel\";\nimport FormModel from \"./form/FormModel\";\nimport GroupingPanelModel from \"./panels/GroupingPanelModel\";\nimport ListModel from \"./list/ListModel\";\nimport ListDetailModel from \"./list/ListDetailModel\";\nimport TabModel from \"./tab/TabModel\";\nimport TaskGroupModel from \"./taskgroup/TaskGroupModel\";\nimport UserModel from \"./user/UserModel\";\nimport UserProfileModel from \"./user/UserProfileModel\";\nimport UserServicesModel from \"./user/UserServicesModel\";\nimport ModelCatalogModel from \"./modelcatalog/ModelCatalogModel\";\nimport ConceptIndexModel from \"./concepts/ConceptIndexModel\";\nimport BusinessScenarioModel from \"./concepts/BusinessScenarioModel\";\nimport ConceptDetailModel from \"./concepts/ConceptDetailModel\";\nimport ConceptTypeDetailModel from \"./concepts/ConceptTypeDetailModel\";\nimport ContentIndexModel from \"./content/ContentIndexModel\";\nimport ContentTOCModel from \"./content/ContentTOCModel\";\nimport ContentModel from \"./content/ContentModel\";\nimport ContentTypeModel from \"./content/ContentTypeModel\";\nimport LookupOptionsModel from \"./lookup/LookupOptionsModel\";\n\nimport
|
|
1
|
+
{"version":3,"file":"resolveModel.js","names":["has","ApplicationModel","CaseSearchModel","CaseViewModel","DetailModel","FormModel","GroupingPanelModel","ListModel","ListDetailModel","TabModel","TaskGroupModel","UserModel","UserProfileModel","UserServicesModel","ModelCatalogModel","ConceptIndexModel","BusinessScenarioModel","ConceptDetailModel","ConceptTypeDetailModel","ContentIndexModel","ContentTOCModel","ContentModel","ContentTypeModel","LookupOptionsModel","IllegalArgumentException","RESOURCE_MODELS","resolveModel","data","availableModels","contributions","resourceTypeModel","resourceModel","isApplicableModel"],"sources":["../../src/models/resolveModel.js"],"sourcesContent":["// @flow\nimport { has } from \"../utils/helpers/objects\";\n\nimport ApplicationModel from \"./application/ApplicationModel\";\nimport CaseSearchModel from \"./search/CaseSearchModel\";\nimport CaseViewModel from \"./caseview/CaseViewModel\";\nimport DetailModel from \"./detail/DetailModel\";\nimport FormModel from \"./form/FormModel\";\nimport GroupingPanelModel from \"./panels/GroupingPanelModel\";\nimport ListModel from \"./list/ListModel\";\nimport ListDetailModel from \"./list/ListDetailModel\";\nimport TabModel from \"./tab/TabModel\";\nimport TaskGroupModel from \"./taskgroup/TaskGroupModel\";\nimport UserModel from \"./user/UserModel\";\nimport UserProfileModel from \"./user/UserProfileModel\";\nimport UserServicesModel from \"./user/UserServicesModel\";\nimport ModelCatalogModel from \"./modelcatalog/ModelCatalogModel\";\nimport ConceptIndexModel from \"./concepts/ConceptIndexModel\";\nimport BusinessScenarioModel from \"./concepts/BusinessScenarioModel\";\nimport ConceptDetailModel from \"./concepts/ConceptDetailModel\";\nimport ConceptTypeDetailModel from \"./concepts/ConceptTypeDetailModel\";\nimport ContentIndexModel from \"./content/ContentIndexModel\";\nimport ContentTOCModel from \"./content/ContentTOCModel\";\nimport ContentModel from \"./content/ContentModel\";\nimport ContentTypeModel from \"./content/ContentTypeModel\";\nimport LookupOptionsModel from \"./lookup/LookupOptionsModel\";\n\nimport { IllegalArgumentException } from \"../exceptions\";\n\nimport type ModularUIResponse from \"../modularui/ModularUIResponse\";\nimport type { ModularUIModel } from \"./types\";\n\n/**\n * Mapping of models and resourcetypes\n */\nconst RESOURCE_MODELS = [\n ApplicationModel,\n TabModel,\n ListDetailModel,\n ListModel,\n GroupingPanelModel,\n CaseSearchModel,\n CaseViewModel,\n DetailModel,\n TaskGroupModel,\n FormModel,\n UserModel,\n UserProfileModel,\n UserServicesModel,\n ModelCatalogModel,\n ConceptIndexModel,\n BusinessScenarioModel,\n ConceptDetailModel,\n ConceptTypeDetailModel,\n ContentIndexModel,\n ContentTOCModel,\n ContentModel,\n ContentTypeModel,\n LookupOptionsModel,\n];\n\n/**\n * Resolve a model by resource\n */\nconst resolveModel = (\n data: ModularUIResponse,\n availableModels: Array<Class<ModularUIModel>> = RESOURCE_MODELS\n): Class<ModularUIModel> | null => {\n if (!data) {\n throw new IllegalArgumentException(\n \"No data or contribution available, cannot resolve model\"\n );\n }\n\n if (!has(data.contributions, \"resourcetype\")) {\n throw new IllegalArgumentException(\n \"Data has wrong format, missing resourcetype property in contributions, cannot resolve model\"\n );\n }\n\n const resourceTypeModel = availableModels.find((resourceModel) =>\n resourceModel.isApplicableModel(data)\n );\n\n if (resourceTypeModel) {\n return resourceTypeModel;\n }\n\n return null;\n};\n\nexport default resolveModel;\n"],"mappings":";AACA,SAASA,GAAG,QAAQ,0BAA0B;AAE9C,OAAOC,gBAAgB,MAAM,gCAAgC;AAC7D,OAAOC,eAAe,MAAM,0BAA0B;AACtD,OAAOC,aAAa,MAAM,0BAA0B;AACpD,OAAOC,WAAW,MAAM,sBAAsB;AAC9C,OAAOC,SAAS,MAAM,kBAAkB;AACxC,OAAOC,kBAAkB,MAAM,6BAA6B;AAC5D,OAAOC,SAAS,MAAM,kBAAkB;AACxC,OAAOC,eAAe,MAAM,wBAAwB;AACpD,OAAOC,QAAQ,MAAM,gBAAgB;AACrC,OAAOC,cAAc,MAAM,4BAA4B;AACvD,OAAOC,SAAS,MAAM,kBAAkB;AACxC,OAAOC,gBAAgB,MAAM,yBAAyB;AACtD,OAAOC,iBAAiB,MAAM,0BAA0B;AACxD,OAAOC,iBAAiB,MAAM,kCAAkC;AAChE,OAAOC,iBAAiB,MAAM,8BAA8B;AAC5D,OAAOC,qBAAqB,MAAM,kCAAkC;AACpE,OAAOC,kBAAkB,MAAM,+BAA+B;AAC9D,OAAOC,sBAAsB,MAAM,mCAAmC;AACtE,OAAOC,iBAAiB,MAAM,6BAA6B;AAC3D,OAAOC,eAAe,MAAM,2BAA2B;AACvD,OAAOC,YAAY,MAAM,wBAAwB;AACjD,OAAOC,gBAAgB,MAAM,4BAA4B;AACzD,OAAOC,kBAAkB,MAAM,6BAA6B;AAE5D,SAASC,wBAAwB,QAAQ,eAAe;AAKxD;AACA;AACA;AACA,MAAMC,eAAe,GAAG,CACtBxB,gBAAgB,EAChBQ,QAAQ,EACRD,eAAe,EACfD,SAAS,EACTD,kBAAkB,EAClBJ,eAAe,EACfC,aAAa,EACbC,WAAW,EACXM,cAAc,EACdL,SAAS,EACTM,SAAS,EACTC,gBAAgB,EAChBC,iBAAiB,EACjBC,iBAAiB,EACjBC,iBAAiB,EACjBC,qBAAqB,EACrBC,kBAAkB,EAClBC,sBAAsB,EACtBC,iBAAiB,EACjBC,eAAe,EACfC,YAAY,EACZC,gBAAgB,EAChBC,kBAAkB,CACnB;;AAED;AACA;AACA;AACA,MAAMG,YAAY,GAAG,UACnBC,IAAuB,EAEU;EAAA,IADjCC,eAA6C,uEAAGH,eAAe;EAE/D,IAAI,CAACE,IAAI,EAAE;IACT,MAAM,IAAIH,wBAAwB,CAChC,yDAAyD,CAC1D;EACH;EAEA,IAAI,CAACxB,GAAG,CAAC2B,IAAI,CAACE,aAAa,EAAE,cAAc,CAAC,EAAE;IAC5C,MAAM,IAAIL,wBAAwB,CAChC,6FAA6F,CAC9F;EACH;EAEA,MAAMM,iBAAiB,GAAG,sBAAAF,eAAe,OAAfA,eAAe,EAAOG,aAAa,IAC3DA,aAAa,CAACC,iBAAiB,CAACL,IAAI,CAAC,CACtC;EAED,IAAIG,iBAAiB,EAAE;IACrB,OAAOA,iBAAiB;EAC1B;EAEA,OAAO,IAAI;AACb,CAAC;AAED,eAAeJ,YAAY"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CaseSearchModel.js","names":["ListModel","CaseSearchModel","type","isApplicableModel","data","contributions","resourcetype","getQuickSearchFilters","filterCollection","filter","isQuickSearch","hasQuickSearchFilters","length"],"sources":["../../../src/models/search/CaseSearchModel.js"],"sourcesContent":["// @flow\nimport ListModel from \"../list/ListModel\";\n\nimport type { ModularUIResponse } from \"../../modularui\";\nimport type { FilterType } from \"../types\";\n\n/**\n * Case search model\n */\nexport default class CaseSearchModel extends ListModel {\n /**\n */\n get type(): string {\n return \"CaseSearch\";\n }\n\n /**\n */\n static isApplicableModel(data: ModularUIResponse): boolean {\n return (\n data.contributions.resourcetype &&\n data.contributions.resourcetype === \"CaseSearch\"\n );\n }\n\n /**\n * Retrieve quick search filters\n */\n getQuickSearchFilters(): Array<FilterType> {\n return this.filterCollection\n ? this.filterCollection.filter((filter) => filter.isQuickSearch())\n : [];\n }\n\n /**\n */\n hasQuickSearchFilters(): boolean {\n return this.getQuickSearchFilters().length > 0;\n }\n}\n"],"mappings":";AACA,OAAOA,SAAS,MAAM,mBAAmB;AAKzC;AACA;AACA;AACA,eAAe,MAAMC,eAAe,SAASD,SAAS,CAAC;EACrD;AACF;EACE,IAAIE,IAAI,GAAW;IACjB,OAAO,YAAY;EACrB;;EAEA;AACF;EACE,OAAOC,iBAAiB,CAACC,IAAuB,EAAW;IACzD,OACEA,IAAI,CAACC,aAAa,CAACC,YAAY,IAC/BF,IAAI,CAACC,aAAa,CAACC,YAAY,KAAK,YAAY;EAEpD;;EAEA;AACF;AACA;EACEC,qBAAqB,GAAsB;IAAA;IACzC,OAAO,IAAI,CAACC,gBAAgB,GACxB,uCAAI,CAACA,gBAAgB,iBAASC,MAAM,IAAKA,MAAM,CAACC,aAAa,EAAE,CAAC,GAChE,EAAE;EACR;;EAEA;AACF;EACEC,qBAAqB,GAAY;IAC/B,OAAO,IAAI,CAACJ,qBAAqB,EAAE,CAACK,MAAM,GAAG,CAAC;EAChD;AACF"}
|
|
1
|
+
{"version":3,"file":"CaseSearchModel.js","names":["ListModel","CaseSearchModel","type","modelName","isApplicableModel","data","contributions","resourcetype","getQuickSearchFilters","filterCollection","filter","isQuickSearch","hasQuickSearchFilters","length"],"sources":["../../../src/models/search/CaseSearchModel.js"],"sourcesContent":["// @flow\nimport ListModel from \"../list/ListModel\";\n\nimport type { ModularUIResponse } from \"../../modularui\";\nimport type { FilterType } from \"../types\";\n\n/**\n * Case search model\n */\nexport default class CaseSearchModel extends ListModel {\n /**\n */\n get type(): string {\n return \"CaseSearch\";\n }\n\n /**\n */\n static get modelName(): string {\n return \"CaseSearchModel\";\n }\n\n /**\n */\n static isApplicableModel(data: ModularUIResponse): boolean {\n return (\n data.contributions.resourcetype &&\n data.contributions.resourcetype === \"CaseSearch\"\n );\n }\n\n /**\n * Retrieve quick search filters\n */\n getQuickSearchFilters(): Array<FilterType> {\n return this.filterCollection\n ? this.filterCollection.filter((filter) => filter.isQuickSearch())\n : [];\n }\n\n /**\n */\n hasQuickSearchFilters(): boolean {\n return this.getQuickSearchFilters().length > 0;\n }\n}\n"],"mappings":";AACA,OAAOA,SAAS,MAAM,mBAAmB;AAKzC;AACA;AACA;AACA,eAAe,MAAMC,eAAe,SAASD,SAAS,CAAC;EACrD;AACF;EACE,IAAIE,IAAI,GAAW;IACjB,OAAO,YAAY;EACrB;;EAEA;AACF;EACE,WAAWC,SAAS,GAAW;IAC7B,OAAO,iBAAiB;EAC1B;;EAEA;AACF;EACE,OAAOC,iBAAiB,CAACC,IAAuB,EAAW;IACzD,OACEA,IAAI,CAACC,aAAa,CAACC,YAAY,IAC/BF,IAAI,CAACC,aAAa,CAACC,YAAY,KAAK,YAAY;EAEpD;;EAEA;AACF;AACA;EACEC,qBAAqB,GAAsB;IAAA;IACzC,OAAO,IAAI,CAACC,gBAAgB,GACxB,uCAAI,CAACA,gBAAgB,iBAASC,MAAM,IAAKA,MAAM,CAACC,aAAa,EAAE,CAAC,GAChE,EAAE;EACR;;EAEA;AACF;EACEC,qBAAqB,GAAY;IAC/B,OAAO,IAAI,CAACJ,qBAAqB,EAAE,CAACK,MAAM,GAAG,CAAC;EAChD;AACF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TabModel.js","names":["TaskGroupCollection","ResourceModel","TaskGroupModel","ActionCollection","TabModel","constructor","modularuiResponse","createTaskGroupCollection","_actionCollection","data","actions","contributions","type","isApplicableModel","resourcetype","getInitialChildModelLinks","links","getLinksByGroup","all","setChildModels","models","taskGroups","i","length","push","taskGroupCollection","add","searchLink","first","taskgroups","taskgroup","taskgroupContributions","taskgroupContribution","name","create","_taskGroupCollection","label","getContribution","components","actionCollection","hasComponents","size","hasTaskGroups","hasItems","hasActions"],"sources":["../../../src/models/tab/TabModel.js"],"sourcesContent":["// @flow\nimport TaskGroupCollection from \"../taskgroup/TaskGroupCollection\";\nimport ResourceModel from \"../base/ResourceModel\";\nimport TaskGroupModel from \"../taskgroup/TaskGroupModel\";\nimport ActionCollection from \"../actions/ActionCollection\";\n\nimport type { ModularUIModel } from \"../types\";\nimport type { ModularUIResponse } from \"../../modularui\";\nimport type LinkModel from \"../links/LinkModel\";\nimport type LinkCollection from \"../links/LinkCollection\";\n\n/**\n * Describes a TabModel\n */\nexport default class TabModel extends ResourceModel {\n _actionCollection: ActionCollection;\n _taskGroupCollection: TaskGroupCollection;\n\n /**\n */\n constructor(modularuiResponse: ModularUIResponse) {\n super(modularuiResponse);\n\n this.createTaskGroupCollection();\n\n this._actionCollection = new ActionCollection(\n this.data.actions,\n this.contributions.actions\n );\n }\n\n /**\n */\n get type(): string {\n return \"Tab\";\n }\n\n /**\n */\n static isApplicableModel(data: ModularUIResponse): boolean {\n return (\n data.contributions.resourcetype &&\n (data.contributions.resourcetype.endsWith(\"Tab\") ||\n data.contributions.resourcetype.endsWith(\"KnowledgeBank\"))\n );\n }\n\n /**\n */\n getInitialChildModelLinks(): Array<LinkModel> {\n return this.links.getLinksByGroup(\"taskgroup\", \"actions\").all;\n }\n\n /**\n */\n setChildModels(models: Array<ModularUIModel>) {\n const taskGroups = [];\n\n for (let i = 0; i < models.length; i++) {\n if (models[i] instanceof TaskGroupModel) {\n taskGroups.push(models[i]);\n }\n }\n\n this.taskGroupCollection.add(taskGroups);\n }\n\n /**\n */\n get searchLink(): ?LinkModel {\n return this.links.getLinksByGroup(\"search\").first;\n }\n\n /**\n */\n createTaskGroupCollection() {\n this.taskGroupCollection = this.data.taskgroups\n ? this.data.taskgroups\n .map((taskgroup) => {\n const taskgroupContributions = this.contributions.taskgroups.find(\n (taskgroupContribution) =>\n taskgroupContribution.name === taskgroup.name\n );\n\n if (taskgroupContributions) {\n return TaskGroupModel.create(\n taskgroup.name,\n taskgroup,\n taskgroupContributions\n );\n }\n\n return null;\n })\n .filter((taskgroup) => taskgroup != null)\n : [];\n }\n\n /**\n * Getting the taskgrouppanels on the tab\n */\n get taskGroupCollection(): TaskGroupCollection {\n return this._taskGroupCollection;\n }\n\n /**\n * Setting the taskgroup panel collection\n */\n set taskGroupCollection(taskgroups: Array<TaskGroupModel>) {\n this._taskGroupCollection = new TaskGroupCollection(taskgroups);\n }\n\n /**\n * Getting the label of the tab\n */\n get label(): string {\n return this.getContribution(\"label\", \"\");\n }\n\n /**\n * Getting the component links on the tab\n */\n get components(): LinkCollection {\n return this.links.getLinksByGroup(\"component\", \"search\");\n }\n\n /**\n */\n get actionCollection(): ActionCollection {\n return this._actionCollection;\n }\n\n /**\n * Has component links\n */\n hasComponents(): boolean {\n return this.components.size > 0;\n }\n\n /**\n * Has taskgroups\n */\n hasTaskGroups(): boolean {\n return this.taskGroupCollection && this.taskGroupCollection?.hasItems;\n }\n\n /**\n */\n hasActions(): boolean {\n return this.actionCollection && this.actionCollection.hasItems;\n }\n}\n"],"mappings":";;;;;AACA,OAAOA,mBAAmB,MAAM,kCAAkC;AAClE,OAAOC,aAAa,MAAM,uBAAuB;AACjD,OAAOC,cAAc,MAAM,6BAA6B;AACxD,OAAOC,gBAAgB,MAAM,6BAA6B;AAO1D;AACA;AACA;AACA,eAAe,MAAMC,QAAQ,SAASH,aAAa,CAAC;EAIlD;AACF;EACEI,WAAW,CAACC,iBAAoC,EAAE;IAChD,KAAK,CAACA,iBAAiB,CAAC;IAAC;IAAA;IAEzB,IAAI,CAACC,yBAAyB,EAAE;IAEhC,IAAI,CAACC,iBAAiB,GAAG,IAAIL,gBAAgB,CAC3C,IAAI,CAACM,IAAI,CAACC,OAAO,EACjB,IAAI,CAACC,aAAa,CAACD,OAAO,CAC3B;EACH;;EAEA;AACF;EACE,IAAIE,IAAI,GAAW;IACjB,OAAO,KAAK;EACd;;EAEA;AACF;EACE,OAAOC,iBAAiB,
|
|
1
|
+
{"version":3,"file":"TabModel.js","names":["TaskGroupCollection","ResourceModel","TaskGroupModel","ActionCollection","TabModel","constructor","modularuiResponse","createTaskGroupCollection","_actionCollection","data","actions","contributions","type","modelName","isApplicableModel","resourcetype","getInitialChildModelLinks","links","getLinksByGroup","all","setChildModels","models","taskGroups","i","length","push","taskGroupCollection","add","searchLink","first","taskgroups","taskgroup","taskgroupContributions","taskgroupContribution","name","create","_taskGroupCollection","label","getContribution","components","actionCollection","hasComponents","size","hasTaskGroups","hasItems","hasActions"],"sources":["../../../src/models/tab/TabModel.js"],"sourcesContent":["// @flow\nimport TaskGroupCollection from \"../taskgroup/TaskGroupCollection\";\nimport ResourceModel from \"../base/ResourceModel\";\nimport TaskGroupModel from \"../taskgroup/TaskGroupModel\";\nimport ActionCollection from \"../actions/ActionCollection\";\n\nimport type { ModularUIModel } from \"../types\";\nimport type { ModularUIResponse } from \"../../modularui\";\nimport type LinkModel from \"../links/LinkModel\";\nimport type LinkCollection from \"../links/LinkCollection\";\n\n/**\n * Describes a TabModel\n */\nexport default class TabModel extends ResourceModel {\n _actionCollection: ActionCollection;\n _taskGroupCollection: TaskGroupCollection;\n\n /**\n */\n constructor(modularuiResponse: ModularUIResponse) {\n super(modularuiResponse);\n\n this.createTaskGroupCollection();\n\n this._actionCollection = new ActionCollection(\n this.data.actions,\n this.contributions.actions\n );\n }\n\n /**\n */\n get type(): string {\n return \"Tab\";\n }\n\n /**\n */\n static get modelName(): string {\n return \"TabModel\";\n }\n\n /**\n */\n static isApplicableModel(data: ModularUIResponse): boolean {\n return (\n data.contributions.resourcetype &&\n (data.contributions.resourcetype.endsWith(\"Tab\") ||\n data.contributions.resourcetype.endsWith(\"KnowledgeBank\"))\n );\n }\n\n /**\n */\n getInitialChildModelLinks(): Array<LinkModel> {\n return this.links.getLinksByGroup(\"taskgroup\", \"actions\").all;\n }\n\n /**\n */\n setChildModels(models: Array<ModularUIModel>) {\n const taskGroups = [];\n\n for (let i = 0; i < models.length; i++) {\n if (models[i] instanceof TaskGroupModel) {\n taskGroups.push(models[i]);\n }\n }\n\n this.taskGroupCollection.add(taskGroups);\n }\n\n /**\n */\n get searchLink(): ?LinkModel {\n return this.links.getLinksByGroup(\"search\").first;\n }\n\n /**\n */\n createTaskGroupCollection() {\n this.taskGroupCollection = this.data.taskgroups\n ? this.data.taskgroups\n .map((taskgroup) => {\n const taskgroupContributions = this.contributions.taskgroups.find(\n (taskgroupContribution) =>\n taskgroupContribution.name === taskgroup.name\n );\n\n if (taskgroupContributions) {\n return TaskGroupModel.create(\n taskgroup.name,\n taskgroup,\n taskgroupContributions\n );\n }\n\n return null;\n })\n .filter((taskgroup) => taskgroup != null)\n : [];\n }\n\n /**\n * Getting the taskgrouppanels on the tab\n */\n get taskGroupCollection(): TaskGroupCollection {\n return this._taskGroupCollection;\n }\n\n /**\n * Setting the taskgroup panel collection\n */\n set taskGroupCollection(taskgroups: Array<TaskGroupModel>) {\n this._taskGroupCollection = new TaskGroupCollection(taskgroups);\n }\n\n /**\n * Getting the label of the tab\n */\n get label(): string {\n return this.getContribution(\"label\", \"\");\n }\n\n /**\n * Getting the component links on the tab\n */\n get components(): LinkCollection {\n return this.links.getLinksByGroup(\"component\", \"search\");\n }\n\n /**\n */\n get actionCollection(): ActionCollection {\n return this._actionCollection;\n }\n\n /**\n * Has component links\n */\n hasComponents(): boolean {\n return this.components.size > 0;\n }\n\n /**\n * Has taskgroups\n */\n hasTaskGroups(): boolean {\n return this.taskGroupCollection && this.taskGroupCollection?.hasItems;\n }\n\n /**\n */\n hasActions(): boolean {\n return this.actionCollection && this.actionCollection.hasItems;\n }\n}\n"],"mappings":"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"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TaskGroupModel.js","names":["ActionCollection","ResourceModel","ModularUIResponse","TaskGroupModel","constructor","modularuiResponse","_actionCollection","data","actions","contributions","selfHref","links","getLinkByKey","selflink","href","_key","substring","lastIndexOf","name","create","key","taskgroup","type","isApplicableModel","resourcetype","label","actionCollection"],"sources":["../../../src/models/taskgroup/TaskGroupModel.js"],"sourcesContent":["// @flow\nimport ActionCollection from \"../actions/ActionCollection\";\nimport ResourceModel from \"../base/ResourceModel\";\n\nimport ModularUIResponse from \"../../modularui/ModularUIResponse\";\n\n/**\n * TaskGroupModel\n */\nexport default class TaskGroupModel extends ResourceModel {\n _key: string;\n _actionCollection: ActionCollection;\n\n /**\n */\n constructor(modularuiResponse: ModularUIResponse) {\n super(modularuiResponse);\n\n this._actionCollection = new ActionCollection(\n this.data.actions,\n this.contributions.actions\n );\n\n const selfHref = this.links.getLinkByKey(\"self\")\n ? this.selflink.href.href\n : null;\n\n this._key = selfHref\n ? selfHref.substring(selfHref.lastIndexOf(\"/\") + 1)\n : this.data.name;\n }\n\n /**\n */\n static create(\n key: string,\n data: Object,\n contributions: Object\n ): TaskGroupModel {\n const taskgroup = new ModularUIResponse();\n taskgroup.key = key;\n taskgroup.data = data;\n taskgroup.contributions = contributions;\n\n return new TaskGroupModel(taskgroup);\n }\n\n /**\n */\n get type(): string {\n return \"TaskGroup\";\n }\n\n /**\n */\n static isApplicableModel(data: ModularUIResponse): boolean {\n return (\n data.contributions.resourcetype &&\n data.contributions.resourcetype === \"TaskGroup\"\n );\n }\n\n /**\n * Get the key of the TaskGroup\n */\n get key(): string {\n return this._key;\n }\n\n /**\n * Get the label of the TaskGroup\n */\n get label(): string {\n return this.contributions.label;\n }\n\n /**\n * Retrieve actions of taskgroup\n */\n get actionCollection(): ActionCollection {\n return this._actionCollection;\n }\n}\n"],"mappings":";AACA,OAAOA,gBAAgB,MAAM,6BAA6B;AAC1D,OAAOC,aAAa,MAAM,uBAAuB;AAEjD,OAAOC,iBAAiB,MAAM,mCAAmC;;AAEjE;AACA;AACA;AACA,eAAe,MAAMC,cAAc,SAASF,aAAa,CAAC;EAIxD;AACF;EACEG,WAAW,CAACC,iBAAoC,EAAE;IAChD,KAAK,CAACA,iBAAiB,CAAC;IAAC;IAAA;IAEzB,IAAI,CAACC,iBAAiB,GAAG,IAAIN,gBAAgB,CAC3C,IAAI,CAACO,IAAI,CAACC,OAAO,EACjB,IAAI,CAACC,aAAa,CAACD,OAAO,CAC3B;IAED,MAAME,QAAQ,GAAG,IAAI,CAACC,KAAK,CAACC,YAAY,CAAC,MAAM,CAAC,GAC5C,IAAI,CAACC,QAAQ,CAACC,IAAI,CAACA,IAAI,GACvB,IAAI;IAER,IAAI,CAACC,IAAI,GAAGL,QAAQ,GAChBA,QAAQ,CAACM,SAAS,CAACN,QAAQ,CAACO,WAAW,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,GACjD,IAAI,CAACV,IAAI,CAACW,IAAI;EACpB;;EAEA;AACF;EACE,OAAOC,MAAM,CACXC,GAAW,EACXb,IAAY,EACZE,aAAqB,EACL;IAChB,MAAMY,SAAS,GAAG,IAAInB,iBAAiB,EAAE;IACzCmB,SAAS,CAACD,GAAG,GAAGA,GAAG;IACnBC,SAAS,CAACd,IAAI,GAAGA,IAAI;IACrBc,SAAS,CAACZ,aAAa,GAAGA,aAAa;IAEvC,OAAO,IAAIN,cAAc,CAACkB,SAAS,CAAC;EACtC;;EAEA;AACF;EACE,IAAIC,IAAI,GAAW;IACjB,OAAO,WAAW;EACpB;;EAEA;AACF;EACE,OAAOC,iBAAiB,
|
|
1
|
+
{"version":3,"file":"TaskGroupModel.js","names":["ActionCollection","ResourceModel","ModularUIResponse","TaskGroupModel","constructor","modularuiResponse","_actionCollection","data","actions","contributions","selfHref","links","getLinkByKey","selflink","href","_key","substring","lastIndexOf","name","create","key","taskgroup","type","modelName","isApplicableModel","resourcetype","label","actionCollection"],"sources":["../../../src/models/taskgroup/TaskGroupModel.js"],"sourcesContent":["// @flow\nimport ActionCollection from \"../actions/ActionCollection\";\nimport ResourceModel from \"../base/ResourceModel\";\n\nimport ModularUIResponse from \"../../modularui/ModularUIResponse\";\n\n/**\n * TaskGroupModel\n */\nexport default class TaskGroupModel extends ResourceModel {\n _key: string;\n _actionCollection: ActionCollection;\n\n /**\n */\n constructor(modularuiResponse: ModularUIResponse) {\n super(modularuiResponse);\n\n this._actionCollection = new ActionCollection(\n this.data.actions,\n this.contributions.actions\n );\n\n const selfHref = this.links.getLinkByKey(\"self\")\n ? this.selflink.href.href\n : null;\n\n this._key = selfHref\n ? selfHref.substring(selfHref.lastIndexOf(\"/\") + 1)\n : this.data.name;\n }\n\n /**\n */\n static create(\n key: string,\n data: Object,\n contributions: Object\n ): TaskGroupModel {\n const taskgroup = new ModularUIResponse();\n taskgroup.key = key;\n taskgroup.data = data;\n taskgroup.contributions = contributions;\n\n return new TaskGroupModel(taskgroup);\n }\n\n /**\n */\n get type(): string {\n return \"TaskGroup\";\n }\n\n /**\n */\n static get modelName(): string {\n return \"TaskGroupModel\";\n }\n\n /**\n */\n static isApplicableModel(data: ModularUIResponse): boolean {\n return (\n data.contributions.resourcetype &&\n data.contributions.resourcetype === \"TaskGroup\"\n );\n }\n\n /**\n * Get the key of the TaskGroup\n */\n get key(): string {\n return this._key;\n }\n\n /**\n * Get the label of the TaskGroup\n */\n get label(): string {\n return this.contributions.label;\n }\n\n /**\n * Retrieve actions of taskgroup\n */\n get actionCollection(): ActionCollection {\n return this._actionCollection;\n }\n}\n"],"mappings":";AACA,OAAOA,gBAAgB,MAAM,6BAA6B;AAC1D,OAAOC,aAAa,MAAM,uBAAuB;AAEjD,OAAOC,iBAAiB,MAAM,mCAAmC;;AAEjE;AACA;AACA;AACA,eAAe,MAAMC,cAAc,SAASF,aAAa,CAAC;EAIxD;AACF;EACEG,WAAW,CAACC,iBAAoC,EAAE;IAChD,KAAK,CAACA,iBAAiB,CAAC;IAAC;IAAA;IAEzB,IAAI,CAACC,iBAAiB,GAAG,IAAIN,gBAAgB,CAC3C,IAAI,CAACO,IAAI,CAACC,OAAO,EACjB,IAAI,CAACC,aAAa,CAACD,OAAO,CAC3B;IAED,MAAME,QAAQ,GAAG,IAAI,CAACC,KAAK,CAACC,YAAY,CAAC,MAAM,CAAC,GAC5C,IAAI,CAACC,QAAQ,CAACC,IAAI,CAACA,IAAI,GACvB,IAAI;IAER,IAAI,CAACC,IAAI,GAAGL,QAAQ,GAChBA,QAAQ,CAACM,SAAS,CAACN,QAAQ,CAACO,WAAW,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,GACjD,IAAI,CAACV,IAAI,CAACW,IAAI;EACpB;;EAEA;AACF;EACE,OAAOC,MAAM,CACXC,GAAW,EACXb,IAAY,EACZE,aAAqB,EACL;IAChB,MAAMY,SAAS,GAAG,IAAInB,iBAAiB,EAAE;IACzCmB,SAAS,CAACD,GAAG,GAAGA,GAAG;IACnBC,SAAS,CAACd,IAAI,GAAGA,IAAI;IACrBc,SAAS,CAACZ,aAAa,GAAGA,aAAa;IAEvC,OAAO,IAAIN,cAAc,CAACkB,SAAS,CAAC;EACtC;;EAEA;AACF;EACE,IAAIC,IAAI,GAAW;IACjB,OAAO,WAAW;EACpB;;EAEA;AACF;EACE,WAAWC,SAAS,GAAW;IAC7B,OAAO,gBAAgB;EACzB;;EAEA;AACF;EACE,OAAOC,iBAAiB,CAACjB,IAAuB,EAAW;IACzD,OACEA,IAAI,CAACE,aAAa,CAACgB,YAAY,IAC/BlB,IAAI,CAACE,aAAa,CAACgB,YAAY,KAAK,WAAW;EAEnD;;EAEA;AACF;AACA;EACE,IAAIL,GAAG,GAAW;IAChB,OAAO,IAAI,CAACL,IAAI;EAClB;;EAEA;AACF;AACA;EACE,IAAIW,KAAK,GAAW;IAClB,OAAO,IAAI,CAACjB,aAAa,CAACiB,KAAK;EACjC;;EAEA;AACF;AACA;EACE,IAAIC,gBAAgB,GAAqB;IACvC,OAAO,IAAI,CAACrB,iBAAiB;EAC/B;AACF"}
|
package/esm/models/types.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","names":[],"sources":["../../src/models/types.js"],"sourcesContent":["// @flow\nimport type ApplicationModel from \"./application/ApplicationModel\";\nimport type BooleanAttributeModel from \"./attributes/BooleanAttributeModel\";\nimport type CaptchaAttributeModel from \"./attributes/CaptchaAttributeModel\";\nimport type ChoiceAttributeModel from \"./attributes/ChoiceAttributeModel\";\nimport type CompositeAttributeModel from \"./attributes/CompositeAttributeModel\";\nimport type DatetimeAttributeModel from \"./attributes/DatetimeAttributeModel\";\nimport type HelptextAttributeModel from \"./attributes/HelptextAttributeModel\";\nimport type LabelAttributeModel from \"./attributes/LabelAttributeModel\";\nimport type MemoAttributeModel from \"./attributes/MemoAttributeModel\";\nimport type MoneyAttributeModel from \"./attributes/MoneyAttributeModel\";\nimport type NumberAttributeModel from \"./attributes/NumberAttributeModel\";\nimport type PasswordAttributeModel from \"./attributes/PasswordAttributeModel\";\nimport type StringAttributeModel from \"./attributes/StringAttributeModel\";\nimport type UploadAttributeModel from \"./attributes/UploadAttributeModel\";\nimport type XMLAttributeModel from \"./attributes/XMLAttributeModel\";\nimport type CaseViewModel from \"./caseview/CaseViewModel\";\nimport type BusinessScenarioModel from \"./concepts/BusinessScenarioModel\";\nimport type ConceptDetailModel from \"./concepts/ConceptDetailModel\";\nimport type ConceptIndexModel from \"./concepts/ConceptIndexModel\";\nimport type ConceptTypeDetailModel from \"./concepts/ConceptTypeDetailModel\";\nimport type ContentIndexModel from \"./content/ContentIndexModel\";\nimport type ContentModel from \"./content/ContentModel\";\nimport type SectionModel from \"./content/SectionModel\";\nimport type ContentTOCModel from \"./content/ContentTOCModel\";\nimport type ContentTypeModel from \"./content/ContentTypeModel\";\nimport type DetailModel from \"./detail/DetailModel\";\nimport type AssignmentFilterModel from \"./filters/AssignmentFilterModel\";\nimport type FilterModel from \"./filters/FilterModel\";\nimport type RangeFilterModel from \"./filters/RangeFilterModel\";\nimport type ConceptIndexFilterModel from \"./filters/ConceptIndexFilterModel\";\nimport type FormModel from \"./form/FormModel\";\nimport type ListDetailModel from \"./list/ListDetailModel\";\nimport type ListModel from \"./list/ListModel\";\nimport type ModelCatalogModel from \"./modelcatalog/ModelCatalogModel\";\nimport type GroupingPanelModel from \"./panels/GroupingPanelModel\";\nimport type CaseSearchModel from \"./search/CaseSearchModel\";\nimport type TabModel from \"./tab/TabModel\";\nimport type TaskGroupModel from \"./taskgroup/TaskGroupModel\";\nimport type UserModel from \"./user/UserModel\";\nimport type UserServicesModel from \"./user/UserServicesModel\";\nimport type LinkModel from \"./links/LinkModel\";\nimport type LookupOptionsModel from \"./lookup/LookupOptionsModel\";\nimport type BaseFilterModel from \"./filters/BaseFilterModel\";\nimport type AttributeCollection from \"./attributes/AttributeCollection\";\nimport type AttributeModel from \"./attributes/AttributeModel\";\nimport type LayoutHintCollection from \"./layouthint/LayoutHintCollection\";\n\nexport type ModularUIModel =\n | ApplicationModel\n | CaseSearchModel\n | CaseViewModel\n | ListDetailModel\n | DetailModel\n | FormModel\n | GroupingPanelModel\n | ListModel\n | TabModel\n | TaskGroupModel\n | UserModel\n | UserServicesModel\n | ModelCatalogModel\n | ConceptIndexModel\n | ConceptDetailModel\n | BusinessScenarioModel\n | ConceptTypeDetailModel\n | ContentIndexModel\n | ContentTOCModel\n | ContentModel\n | ContentTypeModel\n | LookupOptionsModel;\n\nexport type AttributeType =\n | BooleanAttributeModel\n | CaptchaAttributeModel\n | ChoiceAttributeModel\n | DatetimeAttributeModel\n | HelptextAttributeModel\n | LabelAttributeModel\n | MemoAttributeModel\n | MoneyAttributeModel\n | NumberAttributeModel\n | PasswordAttributeModel\n | CompositeAttributeModel\n | StringAttributeModel\n | UploadAttributeModel\n | XMLAttributeModel;\n\nexport type RangeChildAttributeType =\n | NumberAttributeModel\n | DatetimeAttributeModel;\n\nexport type FilterType =\n | BaseFilterModel\n | FilterModel\n | AssignmentFilterModel\n | RangeFilterModel\n | ConceptIndexFilterModel;\n\nexport type FormErrorAnchor = {\n id: string,\n properties?: {\n [propertyName: string]: string | number,\n },\n anchor?: {\n objectid: string,\n elementid?: string,\n _links?: Object,\n index?: number,\n \"index-identifier\"?: string,\n },\n layouthint: LayoutHintCollection,\n message: string,\n param?: {\n name: string,\n },\n};\n\nexport type labelsJSON = {\n _id: string,\n label: string,\n value: string,\n};\n\nexport type propertyJSON = {\n _id: string,\n type: string,\n mandatory: string,\n label: string,\n value: string,\n};\n\nexport type textfragmentJSON = {\n label: string,\n text: string,\n type: string,\n};\n\nexport interface IConstraintModel {\n +id: string;\n +defaultMessage: string;\n +parameters: Object;\n +isMandatoryConstraint: boolean;\n validate(value: any): boolean;\n hasValidation(): boolean;\n}\n\nexport interface ILayoutHintRule {\n process(attribute: AttributeModel, attributes: AttributeCollection): void;\n}\n\nexport interface IModelWithChildModels {\n getInitialChildModelLinks(): Array<LinkModel>;\n setChildModels(models: Array<ModularUIModel>): void;\n}\n\nexport type AuthenticationType = {\n name: string,\n authentication: string,\n redirectUri
|
|
1
|
+
{"version":3,"file":"types.js","names":[],"sources":["../../src/models/types.js"],"sourcesContent":["// @flow\nimport type ApplicationModel from \"./application/ApplicationModel\";\nimport type BooleanAttributeModel from \"./attributes/BooleanAttributeModel\";\nimport type CaptchaAttributeModel from \"./attributes/CaptchaAttributeModel\";\nimport type ChoiceAttributeModel from \"./attributes/ChoiceAttributeModel\";\nimport type CompositeAttributeModel from \"./attributes/CompositeAttributeModel\";\nimport type DatetimeAttributeModel from \"./attributes/DatetimeAttributeModel\";\nimport type HelptextAttributeModel from \"./attributes/HelptextAttributeModel\";\nimport type LabelAttributeModel from \"./attributes/LabelAttributeModel\";\nimport type MemoAttributeModel from \"./attributes/MemoAttributeModel\";\nimport type MoneyAttributeModel from \"./attributes/MoneyAttributeModel\";\nimport type NumberAttributeModel from \"./attributes/NumberAttributeModel\";\nimport type PasswordAttributeModel from \"./attributes/PasswordAttributeModel\";\nimport type StringAttributeModel from \"./attributes/StringAttributeModel\";\nimport type UploadAttributeModel from \"./attributes/UploadAttributeModel\";\nimport type XMLAttributeModel from \"./attributes/XMLAttributeModel\";\nimport type CaseViewModel from \"./caseview/CaseViewModel\";\nimport type BusinessScenarioModel from \"./concepts/BusinessScenarioModel\";\nimport type ConceptDetailModel from \"./concepts/ConceptDetailModel\";\nimport type ConceptIndexModel from \"./concepts/ConceptIndexModel\";\nimport type ConceptTypeDetailModel from \"./concepts/ConceptTypeDetailModel\";\nimport type ContentIndexModel from \"./content/ContentIndexModel\";\nimport type ContentModel from \"./content/ContentModel\";\nimport type SectionModel from \"./content/SectionModel\";\nimport type ContentTOCModel from \"./content/ContentTOCModel\";\nimport type ContentTypeModel from \"./content/ContentTypeModel\";\nimport type DetailModel from \"./detail/DetailModel\";\nimport type AssignmentFilterModel from \"./filters/AssignmentFilterModel\";\nimport type FilterModel from \"./filters/FilterModel\";\nimport type RangeFilterModel from \"./filters/RangeFilterModel\";\nimport type ConceptIndexFilterModel from \"./filters/ConceptIndexFilterModel\";\nimport type FormModel from \"./form/FormModel\";\nimport type ListDetailModel from \"./list/ListDetailModel\";\nimport type ListModel from \"./list/ListModel\";\nimport type ModelCatalogModel from \"./modelcatalog/ModelCatalogModel\";\nimport type GroupingPanelModel from \"./panels/GroupingPanelModel\";\nimport type CaseSearchModel from \"./search/CaseSearchModel\";\nimport type TabModel from \"./tab/TabModel\";\nimport type TaskGroupModel from \"./taskgroup/TaskGroupModel\";\nimport type UserModel from \"./user/UserModel\";\nimport type UserServicesModel from \"./user/UserServicesModel\";\nimport type LinkModel from \"./links/LinkModel\";\nimport type LookupOptionsModel from \"./lookup/LookupOptionsModel\";\nimport type BaseFilterModel from \"./filters/BaseFilterModel\";\nimport type AttributeCollection from \"./attributes/AttributeCollection\";\nimport type AttributeModel from \"./attributes/AttributeModel\";\nimport type LayoutHintCollection from \"./layouthint/LayoutHintCollection\";\n\nexport type ModularUIModel =\n | ApplicationModel\n | CaseSearchModel\n | CaseViewModel\n | ListDetailModel\n | DetailModel\n | FormModel\n | GroupingPanelModel\n | ListModel\n | TabModel\n | TaskGroupModel\n | UserModel\n | UserServicesModel\n | ModelCatalogModel\n | ConceptIndexModel\n | ConceptDetailModel\n | BusinessScenarioModel\n | ConceptTypeDetailModel\n | ContentIndexModel\n | ContentTOCModel\n | ContentModel\n | ContentTypeModel\n | LookupOptionsModel;\n\nexport type AttributeType =\n | BooleanAttributeModel\n | CaptchaAttributeModel\n | ChoiceAttributeModel\n | DatetimeAttributeModel\n | HelptextAttributeModel\n | LabelAttributeModel\n | MemoAttributeModel\n | MoneyAttributeModel\n | NumberAttributeModel\n | PasswordAttributeModel\n | CompositeAttributeModel\n | StringAttributeModel\n | UploadAttributeModel\n | XMLAttributeModel;\n\nexport type RangeChildAttributeType =\n | NumberAttributeModel\n | DatetimeAttributeModel;\n\nexport type FilterType =\n | BaseFilterModel\n | FilterModel\n | AssignmentFilterModel\n | RangeFilterModel\n | ConceptIndexFilterModel;\n\nexport type FormErrorAnchor = {\n id: string,\n properties?: {\n [propertyName: string]: string | number,\n },\n anchor?: {\n objectid: string,\n elementid?: string,\n _links?: Object,\n index?: number,\n \"index-identifier\"?: string,\n },\n layouthint: LayoutHintCollection,\n message: string,\n param?: {\n name: string,\n },\n};\n\nexport type labelsJSON = {\n _id: string,\n label: string,\n value: string,\n};\n\nexport type propertyJSON = {\n _id: string,\n type: string,\n mandatory: string,\n label: string,\n value: string,\n};\n\nexport type textfragmentJSON = {\n label: string,\n text: string,\n type: string,\n};\n\nexport interface IConstraintModel {\n +id: string;\n +defaultMessage: string;\n +parameters: Object;\n +isMandatoryConstraint: boolean;\n validate(value: any): boolean;\n hasValidation(): boolean;\n}\n\nexport interface ILayoutHintRule {\n process(attribute: AttributeModel, attributes: AttributeCollection): void;\n}\n\nexport interface IModelWithChildModels {\n getInitialChildModelLinks(): Array<LinkModel>;\n setChildModels(models: Array<ModularUIModel>): void;\n}\n\nexport type AuthenticationType = {\n name: string,\n authentication: string,\n redirectUri?: string,\n isPrimary: boolean,\n};\n\nexport type FileEntryType = {\n name: string,\n size?: number,\n progress: number,\n error?: string,\n token?: string,\n};\n\nexport type FilesType = {\n [filename: string]: FileEntryType,\n};\n\nexport type FiletypeConstraintsType = Array<{|\n extensions: Array<string>,\n mimeTypes: Array<string>,\n|}>;\n\nexport type FilesizeConstraintsType = {\n fileSize: ?number,\n maxTotalFileSize: ?number,\n isMaxTotal: boolean,\n};\n\nexport type PropertyData = { type: string, label: string, value: string };\nexport type TextFragmentData = {\n type: string,\n label: string,\n text: string | { id?: string, message: string, properties?: Object },\n};\nexport type SectionData = {\n id: string,\n type: string,\n label?: string,\n number?: string,\n body: string | { id?: string, message: string, properties?: Object },\n _links: { self: { href: string } },\n childSections: Array<SectionData>,\n subSections: Array<SectionData>,\n};\n\nexport type PropertyElement = {\n propertyElement: {\n label: string,\n layouthint: Array<string>,\n properties: Array<PropertyData>,\n },\n};\nexport type TextFragmentElement = {\n textFragmentElement: {\n label: string,\n layouthint: Array<string>,\n textfragments: Array<TextFragmentData>,\n },\n};\nexport type ContentElement = {\n contentElement: {\n label: string,\n layouthint: Array<string>,\n sections: Array<SectionData>,\n },\n};\n\nexport type PropertyElementMapped = {\n propertyElement: {\n label: string,\n layouthint: LayoutHintCollection,\n properties: Array<PropertyData>,\n },\n};\nexport type TextFragmentElementMapped = {\n textFragmentElement: {\n label: string,\n layouthint: LayoutHintCollection,\n textfragments: Array<TextFragmentData>,\n },\n};\nexport type ContentElementMapped = {\n contentElement: {\n label: string,\n layouthint: LayoutHintCollection,\n sections: Array<SectionModel>,\n },\n};\n\nexport type ContentAll = Array<\n PropertyElementMapped | TextFragmentElementMapped | ContentElementMapped\n>;\n\nexport type ContentData = {\n header: {\n label?: string,\n description?: { id?: string, message: string, properties?: Object },\n },\n label?: string,\n elements: Array<PropertyElement | TextFragmentElement | ContentElement>,\n};\n"],"mappings":""}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"UserModel.js","names":["ResourceModel","UserModel","type","isApplicableModel","data","contributions","resourcetype","username","Username","fullname","Fullname","label"],"sources":["../../../src/models/user/UserModel.js"],"sourcesContent":["// @flow\nimport ResourceModel from \"../base/ResourceModel\";\n\nimport type { ModularUIResponse } from \"../../modularui\";\n\n/**\n * User model\n */\nexport default class UserModel extends ResourceModel {\n /**\n */\n get type(): string {\n return \"User\";\n }\n\n /**\n */\n static isApplicableModel(data: ModularUIResponse): boolean {\n return (\n data.contributions.resourcetype &&\n data.contributions.resourcetype === \"userdata\"\n );\n }\n\n /**\n * Retrieve username of user\n */\n get username(): string {\n return this.data.Username || \"Guest\";\n }\n\n /**\n * retrieve the fullname of the user\n */\n get fullname(): string {\n return this.data.Fullname || \"Guest\";\n }\n\n /**\n */\n get label(): string {\n return this.contributions.label;\n }\n}\n"],"mappings":"AACA,OAAOA,aAAa,MAAM,uBAAuB;AAIjD;AACA;AACA;AACA,eAAe,MAAMC,SAAS,SAASD,aAAa,CAAC;EACnD;AACF;EACE,IAAIE,IAAI,GAAW;IACjB,OAAO,MAAM;EACf;;EAEA;AACF;EACE,OAAOC,iBAAiB,CAACC,IAAuB,EAAW;IACzD,OACEA,IAAI,CAACC,aAAa,CAACC,YAAY,IAC/BF,IAAI,CAACC,aAAa,CAACC,YAAY,KAAK,UAAU;EAElD;;EAEA;AACF;AACA;EACE,IAAIC,QAAQ,GAAW;IACrB,OAAO,IAAI,CAACH,IAAI,CAACI,QAAQ,IAAI,OAAO;EACtC;;EAEA;AACF;AACA;EACE,IAAIC,QAAQ,GAAW;IACrB,OAAO,IAAI,CAACL,IAAI,CAACM,QAAQ,IAAI,OAAO;EACtC;;EAEA;AACF;EACE,IAAIC,KAAK,GAAW;IAClB,OAAO,IAAI,CAACN,aAAa,CAACM,KAAK;EACjC;AACF"}
|
|
1
|
+
{"version":3,"file":"UserModel.js","names":["ResourceModel","UserModel","type","modelName","isApplicableModel","data","contributions","resourcetype","username","Username","fullname","Fullname","label"],"sources":["../../../src/models/user/UserModel.js"],"sourcesContent":["// @flow\nimport ResourceModel from \"../base/ResourceModel\";\n\nimport type { ModularUIResponse } from \"../../modularui\";\n\n/**\n * User model\n */\nexport default class UserModel extends ResourceModel {\n /**\n */\n get type(): string {\n return \"User\";\n }\n\n /**\n */\n static get modelName(): string {\n return \"UserModel\";\n }\n\n /**\n */\n static isApplicableModel(data: ModularUIResponse): boolean {\n return (\n data.contributions.resourcetype &&\n data.contributions.resourcetype === \"userdata\"\n );\n }\n\n /**\n * Retrieve username of user\n */\n get username(): string {\n return this.data.Username || \"Guest\";\n }\n\n /**\n * retrieve the fullname of the user\n */\n get fullname(): string {\n return this.data.Fullname || \"Guest\";\n }\n\n /**\n */\n get label(): string {\n return this.contributions.label;\n }\n}\n"],"mappings":"AACA,OAAOA,aAAa,MAAM,uBAAuB;AAIjD;AACA;AACA;AACA,eAAe,MAAMC,SAAS,SAASD,aAAa,CAAC;EACnD;AACF;EACE,IAAIE,IAAI,GAAW;IACjB,OAAO,MAAM;EACf;;EAEA;AACF;EACE,WAAWC,SAAS,GAAW;IAC7B,OAAO,WAAW;EACpB;;EAEA;AACF;EACE,OAAOC,iBAAiB,CAACC,IAAuB,EAAW;IACzD,OACEA,IAAI,CAACC,aAAa,CAACC,YAAY,IAC/BF,IAAI,CAACC,aAAa,CAACC,YAAY,KAAK,UAAU;EAElD;;EAEA;AACF;AACA;EACE,IAAIC,QAAQ,GAAW;IACrB,OAAO,IAAI,CAACH,IAAI,CAACI,QAAQ,IAAI,OAAO;EACtC;;EAEA;AACF;AACA;EACE,IAAIC,QAAQ,GAAW;IACrB,OAAO,IAAI,CAACL,IAAI,CAACM,QAAQ,IAAI,OAAO;EACtC;;EAEA;AACF;EACE,IAAIC,KAAK,GAAW;IAClB,OAAO,IAAI,CAACN,aAAa,CAACM,KAAK;EACjC;AACF"}
|
|
@@ -34,5 +34,11 @@ export default class UserProfileModel extends UserModel {
|
|
|
34
34
|
get attributeCollection() {
|
|
35
35
|
return this._attributeCollection;
|
|
36
36
|
}
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
*/
|
|
40
|
+
static get modelName() {
|
|
41
|
+
return "UserProfileModel";
|
|
42
|
+
}
|
|
37
43
|
}
|
|
38
44
|
//# sourceMappingURL=UserProfileModel.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"UserProfileModel.js","names":["has","AttributeCollection","UserModel","UserProfileModel","constructor","modularuiResponse","attributeContributions","contributions","attributes","contribution","key","data","_attributeCollection","type","attributeCollection"],"sources":["../../../src/models/user/UserProfileModel.js"],"sourcesContent":["// @flow\nimport { has } from \"../../utils/helpers/objects\";\n\nimport AttributeCollection from \"../attributes/AttributeCollection\";\n\nimport UserModel from \"./UserModel\";\n\nimport type { ModularUIResponse } from \"../../modularui\";\n\n/**\n * User model\n */\nexport default class UserProfileModel extends UserModel {\n _attributeCollection: AttributeCollection;\n\n /**\n * constructor\n */\n constructor(modularuiResponse: ModularUIResponse) {\n super(modularuiResponse);\n\n const attributeContributions = this.contributions.attributes\n ? this.contributions.attributes.filter((contribution) => {\n const [key] = Object.keys(contribution);\n return key !== \"sessiondata\" && has(this.data, key);\n })\n : [];\n\n this._attributeCollection = new AttributeCollection(\n this.data,\n attributeContributions\n );\n }\n\n /**\n */\n get type(): string {\n return \"UserProfile\";\n }\n\n /**\n * returns all the attributes from the attribute collection\n */\n get attributeCollection(): AttributeCollection {\n return this._attributeCollection;\n }\n}\n"],"mappings":";;;AACA,SAASA,GAAG,QAAQ,6BAA6B;AAEjD,OAAOC,mBAAmB,MAAM,mCAAmC;AAEnE,OAAOC,SAAS,MAAM,aAAa;AAInC;AACA;AACA;AACA,eAAe,MAAMC,gBAAgB,SAASD,SAAS,CAAC;EAGtD;AACF;AACA;EACEE,WAAW,CAACC,iBAAoC,EAAE;IAAA;IAChD,KAAK,CAACA,iBAAiB,CAAC;IAAC;IAEzB,MAAMC,sBAAsB,GAAG,IAAI,CAACC,aAAa,CAACC,UAAU,GACxD,uCAAI,CAACD,aAAa,CAACC,UAAU,iBAASC,YAAY,IAAK;MACrD,MAAM,CAACC,GAAG,CAAC,GAAG,aAAYD,YAAY,CAAC;MACvC,OAAOC,GAAG,KAAK,aAAa,IAAIV,GAAG,CAAC,IAAI,CAACW,IAAI,EAAED,GAAG,CAAC;IACrD,CAAC,CAAC,GACF,EAAE;IAEN,IAAI,CAACE,oBAAoB,GAAG,IAAIX,mBAAmB,CACjD,IAAI,CAACU,IAAI,EACTL,sBAAsB,CACvB;EACH;;EAEA;AACF;EACE,IAAIO,IAAI,GAAW;IACjB,OAAO,aAAa;EACtB;;EAEA;AACF;AACA;EACE,IAAIC,mBAAmB,GAAwB;IAC7C,OAAO,IAAI,CAACF,oBAAoB;EAClC;AACF"}
|
|
1
|
+
{"version":3,"file":"UserProfileModel.js","names":["has","AttributeCollection","UserModel","UserProfileModel","constructor","modularuiResponse","attributeContributions","contributions","attributes","contribution","key","data","_attributeCollection","type","attributeCollection","modelName"],"sources":["../../../src/models/user/UserProfileModel.js"],"sourcesContent":["// @flow\nimport { has } from \"../../utils/helpers/objects\";\n\nimport AttributeCollection from \"../attributes/AttributeCollection\";\n\nimport UserModel from \"./UserModel\";\n\nimport type { ModularUIResponse } from \"../../modularui\";\n\n/**\n * User model\n */\nexport default class UserProfileModel extends UserModel {\n _attributeCollection: AttributeCollection;\n\n /**\n * constructor\n */\n constructor(modularuiResponse: ModularUIResponse) {\n super(modularuiResponse);\n\n const attributeContributions = this.contributions.attributes\n ? this.contributions.attributes.filter((contribution) => {\n const [key] = Object.keys(contribution);\n return key !== \"sessiondata\" && has(this.data, key);\n })\n : [];\n\n this._attributeCollection = new AttributeCollection(\n this.data,\n attributeContributions\n );\n }\n\n /**\n */\n get type(): string {\n return \"UserProfile\";\n }\n\n /**\n * returns all the attributes from the attribute collection\n */\n get attributeCollection(): AttributeCollection {\n return this._attributeCollection;\n }\n\n /**\n */\n static get modelName(): string {\n return \"UserProfileModel\";\n }\n}\n"],"mappings":";;;AACA,SAASA,GAAG,QAAQ,6BAA6B;AAEjD,OAAOC,mBAAmB,MAAM,mCAAmC;AAEnE,OAAOC,SAAS,MAAM,aAAa;AAInC;AACA;AACA;AACA,eAAe,MAAMC,gBAAgB,SAASD,SAAS,CAAC;EAGtD;AACF;AACA;EACEE,WAAW,CAACC,iBAAoC,EAAE;IAAA;IAChD,KAAK,CAACA,iBAAiB,CAAC;IAAC;IAEzB,MAAMC,sBAAsB,GAAG,IAAI,CAACC,aAAa,CAACC,UAAU,GACxD,uCAAI,CAACD,aAAa,CAACC,UAAU,iBAASC,YAAY,IAAK;MACrD,MAAM,CAACC,GAAG,CAAC,GAAG,aAAYD,YAAY,CAAC;MACvC,OAAOC,GAAG,KAAK,aAAa,IAAIV,GAAG,CAAC,IAAI,CAACW,IAAI,EAAED,GAAG,CAAC;IACrD,CAAC,CAAC,GACF,EAAE;IAEN,IAAI,CAACE,oBAAoB,GAAG,IAAIX,mBAAmB,CACjD,IAAI,CAACU,IAAI,EACTL,sBAAsB,CACvB;EACH;;EAEA;AACF;EACE,IAAIO,IAAI,GAAW;IACjB,OAAO,aAAa;EACtB;;EAEA;AACF;AACA;EACE,IAAIC,mBAAmB,GAAwB;IAC7C,OAAO,IAAI,CAACF,oBAAoB;EAClC;;EAEA;AACF;EACE,WAAWG,SAAS,GAAW;IAC7B,OAAO,kBAAkB;EAC3B;AACF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"UserServicesModel.js","names":["ResourceModel","UserModel","UserServicesModel","type","isApplicableModel","data","contributions","resourcetype","getInitialChildModelLinks","userData","userLink","setChildModels","models","user","model","links","getLinkByKey","_user","label","getContribution","changePassword","changePasswordLink","href","isLoggedIn","hasUser","UNSECURE_LINK_COUNT","length"],"sources":["../../../src/models/user/UserServicesModel.js"],"sourcesContent":["// @flow\nimport ResourceModel from \"../base/ResourceModel\";\nimport UserModel from \"../user/UserModel\";\n\nimport type { ModularUIModel } from \"../types\";\nimport type { ModularUIResponse } from \"../../modularui\";\nimport type LinkModel from \"../links/LinkModel\";\nimport type Href from \"../href/Href\";\n\n/**\n * UserServicesModel model\n */\nclass UserServicesModel extends ResourceModel {\n _user: ?UserModel;\n\n /**\n */\n get type(): string {\n return \"UserServices\";\n }\n\n /**\n */\n static isApplicableModel(data: ModularUIResponse): boolean {\n return (\n data.contributions.resourcetype &&\n data.contributions.resourcetype === \"user_services\"\n );\n }\n\n /**\n */\n getInitialChildModelLinks(): Array<LinkModel> {\n const userData = this.userLink;\n return userData ? [userData] : [];\n }\n\n /**\n */\n setChildModels(models: Array<ModularUIModel>) {\n this.user = models.find((model) => model.type === \"User\");\n }\n\n /**\n */\n get userLink(): LinkModel | null {\n return this.links.getLinkByKey(\"Userdata\");\n }\n\n /**\n * return the user model for the current user\n */\n get user(): UserModel | null {\n return this._user || null;\n }\n\n /**\n * Set user data\n */\n set user(model: ?ModularUIModel) {\n this._user = model instanceof UserModel ? model : null;\n }\n\n /**\n * Getting the label of the application\n */\n get label(): string {\n return this.getContribution(\"label\", \"\");\n }\n\n /**\n */\n get changePassword(): Href | null {\n const changePasswordLink = this.links.getLinkByKey(\"ChangePassword\");\n\n if (changePasswordLink) {\n return changePasswordLink.href;\n }\n\n return null;\n }\n\n // when more than three unsecure links are present (always present: self, contributions and api-docs),\n // the userservice is permitted and thus we have an indication the user is probably\n // logged in\n /**\n */\n get isLoggedIn(): boolean {\n const hasUser = this.user instanceof UserModel;\n\n const UNSECURE_LINK_COUNT = 3;\n return this.links.length > UNSECURE_LINK_COUNT || hasUser;\n }\n}\n\nexport default UserServicesModel;\n"],"mappings":";;AACA,OAAOA,aAAa,MAAM,uBAAuB;AACjD,OAAOC,SAAS,MAAM,mBAAmB;AAOzC;AACA;AACA;AACA,MAAMC,iBAAiB,SAASF,aAAa,CAAC;EAAA;IAAA;IAAA;EAAA;EAG5C;AACF;EACE,IAAIG,IAAI,GAAW;IACjB,OAAO,cAAc;EACvB;;EAEA;AACF;EACE,OAAOC,iBAAiB,CAACC,IAAuB,EAAW;IACzD,OACEA,IAAI,CAACC,aAAa,CAACC,YAAY,IAC/BF,IAAI,CAACC,aAAa,CAACC,YAAY,KAAK,eAAe;EAEvD;;EAEA;AACF;EACEC,yBAAyB,GAAqB;IAC5C,MAAMC,QAAQ,GAAG,IAAI,CAACC,QAAQ;IAC9B,OAAOD,QAAQ,GAAG,CAACA,QAAQ,CAAC,GAAG,EAAE;EACnC;;EAEA;AACF;EACEE,cAAc,CAACC,MAA6B,EAAE;IAC5C,IAAI,CAACC,IAAI,GAAG,sBAAAD,MAAM,OAANA,MAAM,EAAOE,KAAK,IAAKA,KAAK,
|
|
1
|
+
{"version":3,"file":"UserServicesModel.js","names":["ResourceModel","UserModel","UserServicesModel","type","modelName","isApplicableModel","data","contributions","resourcetype","getInitialChildModelLinks","userData","userLink","setChildModels","models","user","model","links","getLinkByKey","_user","label","getContribution","changePassword","changePasswordLink","href","isLoggedIn","hasUser","UNSECURE_LINK_COUNT","length"],"sources":["../../../src/models/user/UserServicesModel.js"],"sourcesContent":["// @flow\nimport ResourceModel from \"../base/ResourceModel\";\nimport UserModel from \"../user/UserModel\";\n\nimport type { ModularUIModel } from \"../types\";\nimport type { ModularUIResponse } from \"../../modularui\";\nimport type LinkModel from \"../links/LinkModel\";\nimport type Href from \"../href/Href\";\n\n/**\n * UserServicesModel model\n */\nclass UserServicesModel extends ResourceModel {\n _user: ?UserModel;\n\n /**\n */\n get type(): string {\n return \"UserServices\";\n }\n\n /**\n */\n static get modelName(): string {\n return \"UserServicesModel\";\n }\n\n /**\n */\n static isApplicableModel(data: ModularUIResponse): boolean {\n return (\n data.contributions.resourcetype &&\n data.contributions.resourcetype === \"user_services\"\n );\n }\n\n /**\n */\n getInitialChildModelLinks(): Array<LinkModel> {\n const userData = this.userLink;\n return userData ? [userData] : [];\n }\n\n /**\n */\n setChildModels(models: Array<ModularUIModel>) {\n this.user = models.find((model) => model.type === \"User\");\n }\n\n /**\n */\n get userLink(): LinkModel | null {\n return this.links.getLinkByKey(\"Userdata\");\n }\n\n /**\n * return the user model for the current user\n */\n get user(): UserModel | null {\n return this._user || null;\n }\n\n /**\n * Set user data\n */\n set user(model: ?ModularUIModel) {\n this._user = model instanceof UserModel ? model : null;\n }\n\n /**\n * Getting the label of the application\n */\n get label(): string {\n return this.getContribution(\"label\", \"\");\n }\n\n /**\n */\n get changePassword(): Href | null {\n const changePasswordLink = this.links.getLinkByKey(\"ChangePassword\");\n\n if (changePasswordLink) {\n return changePasswordLink.href;\n }\n\n return null;\n }\n\n // when more than three unsecure links are present (always present: self, contributions and api-docs),\n // the userservice is permitted and thus we have an indication the user is probably\n // logged in\n /**\n */\n get isLoggedIn(): boolean {\n const hasUser = this.user instanceof UserModel;\n\n const UNSECURE_LINK_COUNT = 3;\n return this.links.length > UNSECURE_LINK_COUNT || hasUser;\n }\n}\n\nexport default UserServicesModel;\n"],"mappings":";;AACA,OAAOA,aAAa,MAAM,uBAAuB;AACjD,OAAOC,SAAS,MAAM,mBAAmB;AAOzC;AACA;AACA;AACA,MAAMC,iBAAiB,SAASF,aAAa,CAAC;EAAA;IAAA;IAAA;EAAA;EAG5C;AACF;EACE,IAAIG,IAAI,GAAW;IACjB,OAAO,cAAc;EACvB;;EAEA;AACF;EACE,WAAWC,SAAS,GAAW;IAC7B,OAAO,mBAAmB;EAC5B;;EAEA;AACF;EACE,OAAOC,iBAAiB,CAACC,IAAuB,EAAW;IACzD,OACEA,IAAI,CAACC,aAAa,CAACC,YAAY,IAC/BF,IAAI,CAACC,aAAa,CAACC,YAAY,KAAK,eAAe;EAEvD;;EAEA;AACF;EACEC,yBAAyB,GAAqB;IAC5C,MAAMC,QAAQ,GAAG,IAAI,CAACC,QAAQ;IAC9B,OAAOD,QAAQ,GAAG,CAACA,QAAQ,CAAC,GAAG,EAAE;EACnC;;EAEA;AACF;EACEE,cAAc,CAACC,MAA6B,EAAE;IAC5C,IAAI,CAACC,IAAI,GAAG,sBAAAD,MAAM,OAANA,MAAM,EAAOE,KAAK,IAAKA,KAAK,CAACZ,IAAI,KAAK,MAAM,CAAC;EAC3D;;EAEA;AACF;EACE,IAAIQ,QAAQ,GAAqB;IAC/B,OAAO,IAAI,CAACK,KAAK,CAACC,YAAY,CAAC,UAAU,CAAC;EAC5C;;EAEA;AACF;AACA;EACE,IAAIH,IAAI,GAAqB;IAC3B,OAAO,IAAI,CAACI,KAAK,IAAI,IAAI;EAC3B;;EAEA;AACF;AACA;EACE,IAAIJ,IAAI,CAACC,KAAsB,EAAE;IAC/B,IAAI,CAACG,KAAK,GAAGH,KAAK,YAAYd,SAAS,GAAGc,KAAK,GAAG,IAAI;EACxD;;EAEA;AACF;AACA;EACE,IAAII,KAAK,GAAW;IAClB,OAAO,IAAI,CAACC,eAAe,CAAC,OAAO,EAAE,EAAE,CAAC;EAC1C;;EAEA;AACF;EACE,IAAIC,cAAc,GAAgB;IAChC,MAAMC,kBAAkB,GAAG,IAAI,CAACN,KAAK,CAACC,YAAY,CAAC,gBAAgB,CAAC;IAEpE,IAAIK,kBAAkB,EAAE;MACtB,OAAOA,kBAAkB,CAACC,IAAI;IAChC;IAEA,OAAO,IAAI;EACb;;EAEA;EACA;EACA;EACA;AACF;EACE,IAAIC,UAAU,GAAY;IACxB,MAAMC,OAAO,GAAG,IAAI,CAACX,IAAI,YAAYb,SAAS;IAE9C,MAAMyB,mBAAmB,GAAG,CAAC;IAC7B,OAAO,IAAI,CAACV,KAAK,CAACW,MAAM,GAAGD,mBAAmB,IAAID,OAAO;EAC3D;AACF;AAEA,eAAevB,iBAAiB"}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import _defineProperty from "@babel/runtime-corejs3/helpers/esm/defineProperty";
|
|
2
|
+
import _mapInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/map";
|
|
2
3
|
import _JSON$stringify from "@babel/runtime-corejs3/core-js-stable/json/stringify";
|
|
3
4
|
import _Object$keys from "@babel/runtime-corejs3/core-js-stable/object/keys";
|
|
4
5
|
import _Promise from "@babel/runtime-corejs3/core-js-stable/promise";
|
|
5
6
|
import _findInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/find";
|
|
6
|
-
import _mapInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/map";
|
|
7
7
|
import _filterInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/filter";
|
|
8
8
|
import _includesInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/includes";
|
|
9
9
|
import deepmerge from "deepmerge";
|
|
@@ -32,6 +32,7 @@ class ModularUIRequest {
|
|
|
32
32
|
_defineProperty(this, "_href", void 0);
|
|
33
33
|
_defineProperty(this, "_options", void 0);
|
|
34
34
|
_defineProperty(this, "_targetModel", void 0);
|
|
35
|
+
_defineProperty(this, "_forceTargetModel", false);
|
|
35
36
|
_defineProperty(this, "_contributionsHref", void 0);
|
|
36
37
|
_defineProperty(this, "_locale", void 0);
|
|
37
38
|
_defineProperty(this, "_method", HTTP_METHODS.GET);
|
|
@@ -122,6 +123,23 @@ class ModularUIRequest {
|
|
|
122
123
|
};
|
|
123
124
|
}
|
|
124
125
|
|
|
126
|
+
/**
|
|
127
|
+
*/
|
|
128
|
+
get requestOptions() {
|
|
129
|
+
/* eslint-disable no-unused-vars */
|
|
130
|
+
const {
|
|
131
|
+
targetModel,
|
|
132
|
+
forceTargetModel,
|
|
133
|
+
updateModel,
|
|
134
|
+
childmodels,
|
|
135
|
+
isValidationRequest,
|
|
136
|
+
removeOnUnmount,
|
|
137
|
+
...requestOptions
|
|
138
|
+
} = this.options;
|
|
139
|
+
/* eslint-enable no-unused-vars */
|
|
140
|
+
return requestOptions;
|
|
141
|
+
}
|
|
142
|
+
|
|
125
143
|
/**
|
|
126
144
|
*/
|
|
127
145
|
set options(options) {
|
|
@@ -148,14 +166,41 @@ class ModularUIRequest {
|
|
|
148
166
|
|
|
149
167
|
/**
|
|
150
168
|
*/
|
|
151
|
-
|
|
152
|
-
|
|
169
|
+
set forceTargetModel(forceTargetModel) {
|
|
170
|
+
this._forceTargetModel = forceTargetModel ?? false;
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
/**
|
|
174
|
+
*/
|
|
175
|
+
get forceTargetModel() {
|
|
176
|
+
return this._forceTargetModel;
|
|
177
|
+
}
|
|
153
178
|
|
|
154
|
-
|
|
179
|
+
/**
|
|
180
|
+
*/
|
|
181
|
+
resolveModel() {
|
|
182
|
+
let availableModels;
|
|
183
|
+
if (this.targetModel) {
|
|
184
|
+
availableModels = Array.isArray(this.targetModel) ? [...this.targetModel] : [this.targetModel];
|
|
185
|
+
if (this.forceTargetModel) {
|
|
186
|
+
return availableModels[0];
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
const Model = resolveModel(this.response, availableModels);
|
|
155
190
|
if (Model && Model.isApplicableModel) {
|
|
156
|
-
return
|
|
191
|
+
return Model;
|
|
192
|
+
}
|
|
193
|
+
if (availableModels) {
|
|
194
|
+
throw new IllegalStateException(`data for ${this.href.toString()} is not applicable for model(s): ${_mapInstanceProperty(availableModels).call(availableModels, m => m.modelName).join(", ")}, received response: ${_JSON$stringify(this.response)}`);
|
|
157
195
|
}
|
|
158
|
-
throw new IllegalStateException(`
|
|
196
|
+
throw new IllegalStateException(`no javascript model is applicable for received request of ${this.href.toString()}, with response: ${_JSON$stringify(this.response)}`);
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
/**
|
|
200
|
+
*/
|
|
201
|
+
createModel() {
|
|
202
|
+
const Model = this.resolveModel();
|
|
203
|
+
return new Model(this.response);
|
|
159
204
|
}
|
|
160
205
|
|
|
161
206
|
/**
|
|
@@ -239,7 +284,7 @@ class ModularUIRequest {
|
|
|
239
284
|
*/
|
|
240
285
|
fetchDataService() {
|
|
241
286
|
return universalFetch({
|
|
242
|
-
...this.
|
|
287
|
+
...this.requestOptions,
|
|
243
288
|
url: `${BASE}${this.href.path}`,
|
|
244
289
|
params: this.href.getQuerystringForModularUI(),
|
|
245
290
|
locale: this.options.locale,
|
|
@@ -374,7 +419,7 @@ class ModularUIRequest {
|
|
|
374
419
|
isHiddenList(name, href) {
|
|
375
420
|
const HIDE_WHEN_EMPTY_IGNORE_TASKS = getSetting("HIDE_WHEN_EMPTY_IGNORE_TASKS", false);
|
|
376
421
|
return universalFetch({
|
|
377
|
-
...this.
|
|
422
|
+
...this.requestOptions,
|
|
378
423
|
url: `${BASE}${href}`
|
|
379
424
|
}).then(response => {
|
|
380
425
|
if (isPlainObject(response)) {
|
|
@@ -430,10 +475,9 @@ class ModularUIRequest {
|
|
|
430
475
|
if (!this.options.isValidationRequest && getSetting("USE_INSTANT_SERVER_VALIDATION") && model instanceof FormModel && model.currentFormObject && model.currentFormObject.hasDynamicValidations) {
|
|
431
476
|
const validationHref = this.href.setParameter("commit", "false");
|
|
432
477
|
return universalFetch({
|
|
433
|
-
...this.
|
|
478
|
+
...this.requestOptions,
|
|
434
479
|
url: `${BASE}${this.href.path}`,
|
|
435
480
|
params: validationHref.getQuerystringForModularUI(),
|
|
436
|
-
childmodels: false,
|
|
437
481
|
data: this.getDynamicValidationData(model)
|
|
438
482
|
}).then(data => {
|
|
439
483
|
if (data == null || typeof data !== "object") {
|