@beinformed/ui 1.40.0 → 1.41.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 +7 -0
- package/esm/constants/LayoutHintConfig.js +18 -0
- package/esm/constants/LayoutHintConfig.js.map +1 -1
- package/esm/constants/LayoutHints.js +6 -0
- package/esm/constants/LayoutHints.js.map +1 -1
- package/esm/models/detail/DetailModel.js +22 -3
- package/esm/models/detail/DetailModel.js.map +1 -1
- package/lib/constants/LayoutHintConfig.js +18 -0
- package/lib/constants/LayoutHintConfig.js.flow +56 -0
- package/lib/constants/LayoutHintConfig.js.map +1 -1
- package/lib/constants/LayoutHints.js +7 -1
- package/lib/constants/LayoutHints.js.flow +7 -0
- package/lib/constants/LayoutHints.js.map +1 -1
- package/lib/models/detail/DetailModel.js +21 -2
- package/lib/models/detail/DetailModel.js.flow +35 -5
- package/lib/models/detail/DetailModel.js.map +1 -1
- package/package.json +1 -1
- package/src/constants/LayoutHintConfig.js +56 -0
- package/src/constants/LayoutHints.js +7 -0
- package/src/models/detail/DetailModel.js +35 -5
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,13 @@
|
|
|
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.41.0](https://git.beinformed.com/public/nl.beinformed.bi.layout.lib.ui/compare/v1.40.0...v1.41.0) (2024-02-11)
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
### Features
|
|
9
|
+
|
|
10
|
+
* **avatarForTitleAttribute:** added avatarForTitleAttribute ([319e1e9](https://git.beinformed.com/public/nl.beinformed.bi.layout.lib.ui/commit/319e1e9e91615bc86aec7b5efae5b46cb41684f4))
|
|
11
|
+
|
|
5
12
|
## [1.40.0](https://git.beinformed.com/public/nl.beinformed.bi.layout.lib.ui/compare/v1.39.0...v1.40.0) (2024-02-08)
|
|
6
13
|
|
|
7
14
|
|
|
@@ -146,6 +146,24 @@ export const LayoutHintConfiguration = {
|
|
|
146
146
|
},
|
|
147
147
|
link: "",
|
|
148
148
|
component: ["tab"]
|
|
149
|
+
},
|
|
150
|
+
AVATAR_FOR_TITLE: {
|
|
151
|
+
hint: "avatar-for-title",
|
|
152
|
+
description: {
|
|
153
|
+
NL: "Markeert een attribuut als een avatar voor het titelattribuut.",
|
|
154
|
+
EN: "Marks an attribute as an avatar for the title attribute."
|
|
155
|
+
},
|
|
156
|
+
link: "",
|
|
157
|
+
component: ["caseview_table", "codemap", "list/appointment_table", "list/assignment_table", "list/caseproperties_table", "list/document_table", "list/timelimit_table", "list/eventhistory_table", "list/note_table", "list/record_table", "list/case_table", "list/casesearch_table", "list/datastore_table", "list/datastoreview_table", "list/instrumentresult_table", "list/event_table", "list/user_table", "list/organization_table"]
|
|
158
|
+
},
|
|
159
|
+
AVATAR: {
|
|
160
|
+
hint: "avatar",
|
|
161
|
+
description: {
|
|
162
|
+
NL: "Geef het attribuut weer als de avatar van de gebruiker.",
|
|
163
|
+
EN: "Render the attribute as the user's avatar."
|
|
164
|
+
},
|
|
165
|
+
link: "",
|
|
166
|
+
component: ["caseview_table", "codemap", "list/appointment_table", "list/assignment_table", "list/caseproperties_table", "list/document_table", "list/timelimit_table", "list/eventhistory_table", "list/note_table", "list/record_table", "list/case_table", "list/casesearch_table", "list/datastore_table", "list/datastoreview_table", "list/instrumentresult_table", "list/event_table", "list/user_table", "list/organization_table"]
|
|
149
167
|
}
|
|
150
168
|
};
|
|
151
169
|
//# sourceMappingURL=LayoutHintConfig.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LayoutHintConfig.js","names":["LayoutHintConfiguration","MANDATORY","hint","description","NL","EN","link","component","DEPENDENT_ATTRIBUTE_CONTROL","DEPENDENT_ATTRIBUTE_ACTION","SHOW_ONE_RESULT_AS_DETAIL","HIDE_WHEN_EMPTY","INITIAL_FILTER","CONFIRM_PASSWORD","TITLE","INITIAL_TOTAL_FILESIZE","MAX_TOTAL_FILESIZE","CREATE_ACTION","UPDATE_ACTION","DELETE_ACTION","SORT_OPTIONS","CASEVIEW_LINK","DISABLED","HIDE_IN_USER_INTERFACE"],"sources":["../../src/constants/LayoutHintConfig.js"],"sourcesContent":["// @flow\nexport const LayoutHintConfiguration = {\n MANDATORY: {\n hint: \"mandatory\",\n description: {\n NL: \"Geeft aan of een attribuut verplicht is. Dient samen met de dependency hint gebruikt te worden.\",\n EN: \"Indicates a mandatory attribute.\\nShould be used together with the dependency hint.\",\n },\n link: \"\",\n component: [\"attribute\"],\n },\n DEPENDENT_ATTRIBUTE_CONTROL: {\n hint: \"dependent-control:${unique-control-id}\",\n description: {\n NL: \"Geeft aan dat dit het attribuut is waar attributen van afhankelijk zijn. Het unique-control-id is een uniek id dat kan worden gebruikt in the hint voor de show|hide actie op het afhankelijke attribuut.\",\n EN: \"Marks the choice attribute where other attributes depend on. The unique control id is a unique id that can be used in the hint for the show|hide action on the dependent attribute.\",\n },\n link: \"\",\n component: [\"attribute/boolean\", \"attribute/choice\"],\n },\n DEPENDENT_ATTRIBUTE_ACTION: {\n hint: \"dependent-attribute:(show|hide) when dependent-control:${unique-control-id} (equals|includes|notEquals|notIncludes) [${codemaps}]\",\n description: {\n NL: \"Toon of verberg een attribute dat afhankelijk is van de geselecteerde opties van een keuze attribute\",\n EN: \"To show or hide an attribute dependent on options of the choice control codemap that are selected or not selected.\",\n },\n link: \"\",\n component: [\"attribute\"],\n },\n SHOW_ONE_RESULT_AS_DETAIL: {\n hint: \"show-one-result-as-detail\",\n description: {\n NL: \"Een lijst met maar één item mag direct als detail getoond worden.\",\n EN: \"A list with only one detail must be shown as a detail.\",\n },\n link: \"\",\n component: [\"list\"],\n },\n HIDE_WHEN_EMPTY: {\n hint: \"hide-when-empty\",\n description: {\n NL: \"Een lijst zonder lijst-items en lijst-taken dient niet getoond worden.\",\n EN: \"A list without list-items and list-tasks should not be shown.\",\n },\n link: \"\",\n component: [\"list\"],\n },\n INITIAL_FILTER: {\n hint: \"initial-filter:${filter-name}=${initial-value}\",\n description: {\n NL: \"Laad de lijst met een standaardwaarde voor een filter, er is geen controle op het bestaan van het filter. Als het filter niet is geconfigureerd, treedt er een fout op. Houd er rekening mee dat filters hoofdlettergevoelig zijn.\",\n EN: \"Load the list with a default value for a filter, there is no check for the existence of the filter. If the filter is not configured, an error occurs. Keep in mind that filters are case sensitive.\",\n },\n link: \"\",\n component: [\"list\"],\n },\n CONFIRM_PASSWORD: {\n hint: \"confirm-password\",\n description: {\n NL: \"Wachtwoord attribuut moet bevestigd worden dmv een tweede wachtwoord attribuut.\",\n EN: \"Password attribute must be confirmed using a second password attribute.\",\n },\n link: \"\",\n component: [\"attribute/password\"],\n },\n TITLE: {\n hint: \"title\",\n description: {\n NL: \"Markeert een attribuut als een titel attribuut\",\n EN: \"Marks an attribute as a title attribute\",\n },\n link: \"\",\n component: [\n \"caseview_table\",\n \"codemap\",\n \"list/appointment_table\",\n \"list/assignment_table\",\n \"list/caseproperties_table\",\n \"list/document_table\",\n \"list/timelimit_table\",\n \"list/eventhistory_table\",\n \"list/note_table\",\n \"list/record_table\",\n \"list/case_table\",\n \"list/casesearch_table\",\n \"list/datastore_table\",\n \"list/datastoreview_table\",\n \"list/instrumentresult_table\",\n \"list/event_table\",\n \"list/user_table\",\n \"list/organization_table\",\n ],\n },\n INITIAL_TOTAL_FILESIZE: {\n hint: \"initial-total-file-size\",\n description: {\n NL: \"Wordt gebruikt in samenwerking met een upload attribuut, deze hint moet worden gezet op een readonly attribuut dat de reeds gebruikte file grootte bevat.\",\n EN: \"Used in conjunction with an upload attribute, this hint is set on a read only attribute containing the file size currently used.\",\n },\n link: \"\",\n component: [\"attribute/number\"],\n },\n MAX_TOTAL_FILESIZE: {\n hint: \"max-total-file-size\",\n description: {\n NL: \"Wordt gebruikt in samenwerking met een upload attribuut, deze hint moet worden gezet op een readonly attribuut dat de maximaal toegestane file grootte bevat.\",\n EN: \"Used in conjunction with an upload attribute, this hint is set on a read only attribute containing the maximum allowed total file size.\",\n },\n link: \"\",\n component: [\"attribute/number\"],\n },\n CREATE_ACTION: {\n hint: \"create\",\n description: {\n NL: \"Markeer taak als creëer taak.\",\n EN: \"Mark task as create task\",\n },\n component: [\"form\"],\n },\n UPDATE_ACTION: {\n hint: \"update\",\n description: {\n NL: \"Markeer taak als bewerk taak.\",\n EN: \"Mark task as update task\",\n },\n component: [\"form\"],\n },\n DELETE_ACTION: {\n hint: \"delete\",\n description: {\n NL: \"Markeer taak als verwijder taak.\",\n EN: \"Mark task as delete task\",\n },\n component: [\"form\"],\n },\n SORT_OPTIONS: {\n hint: \"sort-options\",\n description: {\n NL: \"Sorteer opties alfabetisch\",\n EN: \"Sort options alphabetically\",\n },\n component: [\"attribute/choice\"],\n },\n CASEVIEW_LINK: {\n hint: \"case-view-link\",\n description: {\n NL: \"Markeer een case id reference attribute als de referentie naar de case view. Vervangt de self link van een lijst item\",\n EN: \"Mark a case id reference attribute as the reference to the case view. Replaces the self link of a list item\",\n },\n component: [\"attribute/reference\", \"list/datastore_table\"],\n },\n DISABLED: {\n hint: \"disabled\",\n description: {\n NL: \"Geeft aan of een attribuut uitgeschakeld is.\",\n EN: \"Indicates a disabled attribute.\",\n },\n link: \"\",\n component: [\"attribute\"],\n },\n HIDE_IN_USER_INTERFACE: {\n hint: \"hide-in-user-interface\",\n description: {\n NL: \"Verberg een tab in de user interface.\",\n EN: \"Hide a tab in the user interface.\",\n },\n link: \"\",\n component: [\"tab\"],\n },\n};\n"],"mappings":"AACA,OAAO,MAAMA,uBAAuB,GAAG;EACrCC,SAAS,EAAE;IACTC,IAAI,EAAE,WAAW;IACjBC,WAAW,EAAE;MACXC,EAAE,EAAE,iGAAiG;MACrGC,EAAE,EAAE;IACN,CAAC;IACDC,IAAI,EAAE,EAAE;IACRC,SAAS,EAAE,CAAC,WAAW;EACzB,CAAC;EACDC,2BAA2B,EAAE;IAC3BN,IAAI,EAA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AAc;IACpBC,WAAW,EAAE;MACXC,EAAE,EAAE,4BAA4B;MAChCC,EAAE,EAAE;IACN,CAAC;IACDE,SAAS,EAAE,CAAC,kBAAkB;EAChC,CAAC;EACDc,aAAa,EAAE;IACbnB,IAAI,EAAE,gBAAgB;IACtBC,WAAW,EAAE;MACXC,EAAE,EAAE,uHAAuH;MAC3HC,EAAE,EAAE;IACN,CAAC;IACDE,SAAS,EAAE,CAAC,qBAAqB,EAAE,sBAAsB;EAC3D,CAAC;EACDe,QAAQ,EAAE;IACRpB,IAAI,EAAE,UAAU;IAChBC,WAAW,EAAE;MACXC,EAAE,EAAE,8CAA8C;MAClDC,EAAE,EAAE;IACN,CAAC;IACDC,IAAI,EAAE,EAAE;IACRC,SAAS,EAAE,CAAC,WAAW;EACzB,CAAC;EACDgB,sBAAsB,EAAE;IACtBrB,IAAI,EAAE,wBAAwB;IAC9BC,WAAW,EAAE;MACXC,EAAE,EAAE,uCAAuC;MAC3CC,EAAE,EAAE;IACN,CAAC;IACDC,IAAI,EAAE,EAAE;IACRC,SAAS,EAAE,CAAC,KAAK;EACnB;AACF,CAAC"}
|
|
1
|
+
{"version":3,"file":"LayoutHintConfig.js","names":["LayoutHintConfiguration","MANDATORY","hint","description","NL","EN","link","component","DEPENDENT_ATTRIBUTE_CONTROL","DEPENDENT_ATTRIBUTE_ACTION","SHOW_ONE_RESULT_AS_DETAIL","HIDE_WHEN_EMPTY","INITIAL_FILTER","CONFIRM_PASSWORD","TITLE","INITIAL_TOTAL_FILESIZE","MAX_TOTAL_FILESIZE","CREATE_ACTION","UPDATE_ACTION","DELETE_ACTION","SORT_OPTIONS","CASEVIEW_LINK","DISABLED","HIDE_IN_USER_INTERFACE","AVATAR_FOR_TITLE","AVATAR"],"sources":["../../src/constants/LayoutHintConfig.js"],"sourcesContent":["// @flow\nexport const LayoutHintConfiguration = {\n MANDATORY: {\n hint: \"mandatory\",\n description: {\n NL: \"Geeft aan of een attribuut verplicht is. Dient samen met de dependency hint gebruikt te worden.\",\n EN: \"Indicates a mandatory attribute.\\nShould be used together with the dependency hint.\",\n },\n link: \"\",\n component: [\"attribute\"],\n },\n DEPENDENT_ATTRIBUTE_CONTROL: {\n hint: \"dependent-control:${unique-control-id}\",\n description: {\n NL: \"Geeft aan dat dit het attribuut is waar attributen van afhankelijk zijn. Het unique-control-id is een uniek id dat kan worden gebruikt in the hint voor de show|hide actie op het afhankelijke attribuut.\",\n EN: \"Marks the choice attribute where other attributes depend on. The unique control id is a unique id that can be used in the hint for the show|hide action on the dependent attribute.\",\n },\n link: \"\",\n component: [\"attribute/boolean\", \"attribute/choice\"],\n },\n DEPENDENT_ATTRIBUTE_ACTION: {\n hint: \"dependent-attribute:(show|hide) when dependent-control:${unique-control-id} (equals|includes|notEquals|notIncludes) [${codemaps}]\",\n description: {\n NL: \"Toon of verberg een attribute dat afhankelijk is van de geselecteerde opties van een keuze attribute\",\n EN: \"To show or hide an attribute dependent on options of the choice control codemap that are selected or not selected.\",\n },\n link: \"\",\n component: [\"attribute\"],\n },\n SHOW_ONE_RESULT_AS_DETAIL: {\n hint: \"show-one-result-as-detail\",\n description: {\n NL: \"Een lijst met maar één item mag direct als detail getoond worden.\",\n EN: \"A list with only one detail must be shown as a detail.\",\n },\n link: \"\",\n component: [\"list\"],\n },\n HIDE_WHEN_EMPTY: {\n hint: \"hide-when-empty\",\n description: {\n NL: \"Een lijst zonder lijst-items en lijst-taken dient niet getoond worden.\",\n EN: \"A list without list-items and list-tasks should not be shown.\",\n },\n link: \"\",\n component: [\"list\"],\n },\n INITIAL_FILTER: {\n hint: \"initial-filter:${filter-name}=${initial-value}\",\n description: {\n NL: \"Laad de lijst met een standaardwaarde voor een filter, er is geen controle op het bestaan van het filter. Als het filter niet is geconfigureerd, treedt er een fout op. Houd er rekening mee dat filters hoofdlettergevoelig zijn.\",\n EN: \"Load the list with a default value for a filter, there is no check for the existence of the filter. If the filter is not configured, an error occurs. Keep in mind that filters are case sensitive.\",\n },\n link: \"\",\n component: [\"list\"],\n },\n CONFIRM_PASSWORD: {\n hint: \"confirm-password\",\n description: {\n NL: \"Wachtwoord attribuut moet bevestigd worden dmv een tweede wachtwoord attribuut.\",\n EN: \"Password attribute must be confirmed using a second password attribute.\",\n },\n link: \"\",\n component: [\"attribute/password\"],\n },\n TITLE: {\n hint: \"title\",\n description: {\n NL: \"Markeert een attribuut als een titel attribuut\",\n EN: \"Marks an attribute as a title attribute\",\n },\n link: \"\",\n component: [\n \"caseview_table\",\n \"codemap\",\n \"list/appointment_table\",\n \"list/assignment_table\",\n \"list/caseproperties_table\",\n \"list/document_table\",\n \"list/timelimit_table\",\n \"list/eventhistory_table\",\n \"list/note_table\",\n \"list/record_table\",\n \"list/case_table\",\n \"list/casesearch_table\",\n \"list/datastore_table\",\n \"list/datastoreview_table\",\n \"list/instrumentresult_table\",\n \"list/event_table\",\n \"list/user_table\",\n \"list/organization_table\",\n ],\n },\n INITIAL_TOTAL_FILESIZE: {\n hint: \"initial-total-file-size\",\n description: {\n NL: \"Wordt gebruikt in samenwerking met een upload attribuut, deze hint moet worden gezet op een readonly attribuut dat de reeds gebruikte file grootte bevat.\",\n EN: \"Used in conjunction with an upload attribute, this hint is set on a read only attribute containing the file size currently used.\",\n },\n link: \"\",\n component: [\"attribute/number\"],\n },\n MAX_TOTAL_FILESIZE: {\n hint: \"max-total-file-size\",\n description: {\n NL: \"Wordt gebruikt in samenwerking met een upload attribuut, deze hint moet worden gezet op een readonly attribuut dat de maximaal toegestane file grootte bevat.\",\n EN: \"Used in conjunction with an upload attribute, this hint is set on a read only attribute containing the maximum allowed total file size.\",\n },\n link: \"\",\n component: [\"attribute/number\"],\n },\n CREATE_ACTION: {\n hint: \"create\",\n description: {\n NL: \"Markeer taak als creëer taak.\",\n EN: \"Mark task as create task\",\n },\n component: [\"form\"],\n },\n UPDATE_ACTION: {\n hint: \"update\",\n description: {\n NL: \"Markeer taak als bewerk taak.\",\n EN: \"Mark task as update task\",\n },\n component: [\"form\"],\n },\n DELETE_ACTION: {\n hint: \"delete\",\n description: {\n NL: \"Markeer taak als verwijder taak.\",\n EN: \"Mark task as delete task\",\n },\n component: [\"form\"],\n },\n SORT_OPTIONS: {\n hint: \"sort-options\",\n description: {\n NL: \"Sorteer opties alfabetisch\",\n EN: \"Sort options alphabetically\",\n },\n component: [\"attribute/choice\"],\n },\n CASEVIEW_LINK: {\n hint: \"case-view-link\",\n description: {\n NL: \"Markeer een case id reference attribute als de referentie naar de case view. Vervangt de self link van een lijst item\",\n EN: \"Mark a case id reference attribute as the reference to the case view. Replaces the self link of a list item\",\n },\n component: [\"attribute/reference\", \"list/datastore_table\"],\n },\n DISABLED: {\n hint: \"disabled\",\n description: {\n NL: \"Geeft aan of een attribuut uitgeschakeld is.\",\n EN: \"Indicates a disabled attribute.\",\n },\n link: \"\",\n component: [\"attribute\"],\n },\n HIDE_IN_USER_INTERFACE: {\n hint: \"hide-in-user-interface\",\n description: {\n NL: \"Verberg een tab in de user interface.\",\n EN: \"Hide a tab in the user interface.\",\n },\n link: \"\",\n component: [\"tab\"],\n },\n AVATAR_FOR_TITLE: {\n hint: \"avatar-for-title\",\n description: {\n NL: \"Markeert een attribuut als een avatar voor het titelattribuut.\",\n EN: \"Marks an attribute as an avatar for the title attribute.\",\n },\n link: \"\",\n component: [\n \"caseview_table\",\n \"codemap\",\n \"list/appointment_table\",\n \"list/assignment_table\",\n \"list/caseproperties_table\",\n \"list/document_table\",\n \"list/timelimit_table\",\n \"list/eventhistory_table\",\n \"list/note_table\",\n \"list/record_table\",\n \"list/case_table\",\n \"list/casesearch_table\",\n \"list/datastore_table\",\n \"list/datastoreview_table\",\n \"list/instrumentresult_table\",\n \"list/event_table\",\n \"list/user_table\",\n \"list/organization_table\",\n ],\n },\n AVATAR: {\n hint: \"avatar\",\n description: {\n NL: \"Geef het attribuut weer als de avatar van de gebruiker.\",\n EN: \"Render the attribute as the user's avatar.\",\n },\n link: \"\",\n component: [\n \"caseview_table\",\n \"codemap\",\n \"list/appointment_table\",\n \"list/assignment_table\",\n \"list/caseproperties_table\",\n \"list/document_table\",\n \"list/timelimit_table\",\n \"list/eventhistory_table\",\n \"list/note_table\",\n \"list/record_table\",\n \"list/case_table\",\n \"list/casesearch_table\",\n \"list/datastore_table\",\n \"list/datastoreview_table\",\n \"list/instrumentresult_table\",\n \"list/event_table\",\n \"list/user_table\",\n \"list/organization_table\",\n ],\n },\n};\n"],"mappings":"AACA,OAAO,MAAMA,uBAAuB,GAAG;EACrCC,SAAS,EAAE;IACTC,IAAI,EAAE,WAAW;IACjBC,WAAW,EAAE;MACXC,EAAE,EAAE,iGAAiG;MACrGC,EAAE,EAAE;IACN,CAAC;IACDC,IAAI,EAAE,EAAE;IACRC,SAAS,EAAE,CAAC,WAAW;EACzB,CAAC;EACDC,2BAA2B,EAAE;IAC3BN,IAAI,EAAE,wCAAwC;IAC9CC,WAAW,EAAE;MACXC,EAAE,EAAE,2MAA2M;MAC/MC,EAAE,EAAE;IACN,CAAC;IACDC,IAAI,EAAE,EAAE;IACRC,SAAS,EAAE,CAAC,mBAAmB,EAAE,kBAAkB;EACrD,CAAC;EACDE,0BAA0B,EAAE;IAC1BP,IAAI,EAAE,mIAAmI;IACzIC,WAAW,EAAE;MACXC,EAAE,EAAE,sGAAsG;MAC1GC,EAAE,EAAE;IACN,CAAC;IACDC,IAAI,EAAE,EAAE;IACRC,SAAS,EAAE,CAAC,WAAW;EACzB,CAAC;EACDG,yBAAyB,EAAE;IACzBR,IAAI,EAAE,2BAA2B;IACjCC,WAAW,EAAE;MACXC,EAAE,EAAE,mEAAmE;MACvEC,EAAE,EAAE;IACN,CAAC;IACDC,IAAI,EAAE,EAAE;IACRC,SAAS,EAAE,CAAC,MAAM;EACpB,CAAC;EACDI,eAAe,EAAE;IACfT,IAAI,EAAE,iBAAiB;IACvBC,WAAW,EAAE;MACXC,EAAE,EAAE,wEAAwE;MAC5EC,EAAE,EAAE;IACN,CAAC;IACDC,IAAI,EAAE,EAAE;IACRC,SAAS,EAAE,C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IAAI,EAAE,kBAAkB;IACxBC,WAAW,EAAE;MACXC,EAAE,EAAE,gEAAgE;MACpEC,EAAE,EAAE;IACN,CAAC;IACDC,IAAI,EAAE,EAAE;IACRC,SAAS,EAAE,CACT,gBAAgB,EAChB,SAAS,EACT,wBAAwB,EACxB,uBAAuB,EACvB,2BAA2B,EAC3B,qBAAqB,EACrB,sBAAsB,EACtB,yBAAyB,EACzB,iBAAiB,EACjB,mBAAmB,EACnB,iBAAiB,EACjB,uBAAuB,EACvB,sBAAsB,EACtB,0BAA0B,EAC1B,6BAA6B,EAC7B,kBAAkB,EAClB,iBAAiB,EACjB,yBAAyB;EAE7B,CAAC;EACDkB,MAAM,EAAE;IACNvB,IAAI,EAAE,QAAQ;IACdC,WAAW,EAAE;MACXC,EAAE,EAAE,yDAAyD;MAC7DC,EAAE,EAAE;IACN,CAAC;IACDC,IAAI,EAAE,EAAE;IACRC,SAAS,EAAE,CACT,gBAAgB,EAChB,SAAS,EACT,wBAAwB,EACxB,uBAAuB,EACvB,2BAA2B,EAC3B,qBAAqB,EACrB,sBAAsB,EACtB,yBAAyB,EACzB,iBAAiB,EACjB,mBAAmB,EACnB,iBAAiB,EACjB,uBAAuB,EACvB,sBAAsB,EACtB,0BAA0B,EAC1B,6BAA6B,EAC7B,kBAAkB,EAClB,iBAAiB,EACjB,yBAAyB;EAE7B;AACF,CAAC"}
|
|
@@ -119,5 +119,11 @@ export const HIDE_IN_USER_INTERFACE = getHint("HIDE_IN_USER_INTERFACE");
|
|
|
119
119
|
/**
|
|
120
120
|
*/
|
|
121
121
|
export const getLayoutHintConfiguration = () => LayoutHintConfiguration;
|
|
122
|
+
|
|
123
|
+
/**
|
|
124
|
+
* Layout-hint: Marks an attribute as an avatar for the title attribute.
|
|
125
|
+
*/
|
|
126
|
+
export const AVATAR_FOR_TITLE = getHint("AVATAR_FOR_TITLE");
|
|
127
|
+
export const AVATAR = getHint("AVATAR");
|
|
122
128
|
export default getHint;
|
|
123
129
|
//# sourceMappingURL=LayoutHints.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LayoutHints.js","names":["LayoutHintConfiguration","getHint","hint","MANDATORY","DISABLED","DEPENDENT_ATTRIBUTE_CONTROL","DEPENDENT_ATTRIBUTE","CONFIRM_PASSWORD","SORT_OPTIONS","TITLE","DELETE_ACTION","UPDATE_ACTION","CREATE_ACTION","INITIAL_TOTAL_FILESIZE","MAX_TOTAL_FILESIZE","SHOW_ONE_RESULT_AS_DETAIL","HIDE_WHEN_EMPTY","INITIAL_FILTER","CASEVIEW_LINK","RENDER_SECTION_LABEL","HIDE_IN_USER_INTERFACE","getLayoutHintConfiguration"],"sources":["../../src/constants/LayoutHints.js"],"sourcesContent":["// @flow\nimport { LayoutHintConfiguration } from \"./LayoutHintConfig\";\n\n/**\n * Retrieve layout hint by id from the layout hint configuration\n */\nconst getHint = (hint: string): string => {\n if (LayoutHintConfiguration[hint]) {\n return LayoutHintConfiguration[hint].hint;\n }\n\n return \"\";\n};\n\n/**\n * Layout-hint: Indicates a mandatory attribute. Should be used together with the dependency hint.\n */\nexport const MANDATORY: string = getHint(\"MANDATORY\");\n\n/**\n * Layout-hint: Indicates a disabled attribute.\n * @constant\n */\nexport const DISABLED: string = getHint(\"DISABLED\");\n\n/*\n * --------------------------------\n * SELECT DEPENDENT ATTRIBUTES\n * --------------------------------\n */\n/**\n * Layout-hint: Marks the choice attribute where other attributes depend on. The unique control id is a unique id that can be used in the hint for the show|hide action on the dependent attribute.\n */\nexport const DEPENDENT_ATTRIBUTE_CONTROL = \"dependent-control\";\n/**\n */\nexport const DEPENDENT_ATTRIBUTE = \"dependent-attribute:\";\n\n/*\n * --------------------------------\n * ATTRIBUTES\n * --------------------------------\n */\n/**\n * Layout-hint: Password attribute must be confirmed using a second password attribute.\n */\nexport const CONFIRM_PASSWORD: string = getHint(\"CONFIRM_PASSWORD\");\n/**\n * Layout-hint: Sort options alphabetically\n */\nexport const SORT_OPTIONS: string = getHint(\"SORT_OPTIONS\");\n/**\n * Layout-hint: Marks an attribute as a title attribute\n */\nexport const TITLE: string = getHint(\"TITLE\");\n\n/*\n * --------------------------------\n * FORM\n * --------------------------------\n */\n/**\n * Layout-hint: Mark task as delete task\n */\nexport const DELETE_ACTION: string = getHint(\"DELETE_ACTION\");\n/**\n * Layout-hint: Mark task as update task\n */\nexport const UPDATE_ACTION: string = getHint(\"UPDATE_ACTION\");\n/**\n * Layout-hint: Mark task as create task\n */\nexport const CREATE_ACTION: string = getHint(\"CREATE_ACTION\");\n\n/*\n * --------------------------------\n * UPLOAD TOTAL FILE SIZE\n * --------------------------------\n */\n/**\n * Layout-hint: Used in conjunction with an upload attribute, this hint is set on a read only attribute containing the file size currently used.\n */\nexport const INITIAL_TOTAL_FILESIZE: string = getHint(\"INITIAL_TOTAL_FILESIZE\");\n/**\n * Layout-hint: Used in conjunction with an upload attribute, this hint is set on a read only attribute containing the maximum allowed total file size.\n */\nexport const MAX_TOTAL_FILESIZE: string = getHint(\"MAX_TOTAL_FILESIZE\");\n\n/*\n * --------------------------------\n * LISTS\n * --------------------------------\n */\n/**\n * Layout-hint: A list with only one detail must be shown as a detail\n */\nexport const SHOW_ONE_RESULT_AS_DETAIL: string = getHint(\n \"SHOW_ONE_RESULT_AS_DETAIL\",\n);\n/**\n * Layout-hint: A list without list-items and list-tasks should not be shown.\n */\nexport const HIDE_WHEN_EMPTY: string = getHint(\"HIDE_WHEN_EMPTY\");\n/**\n * Layout-hint: Sets a default value on a filter\n */\nexport const INITIAL_FILTER: string = \"initial-filter:\";\n/**\n * Layout-hint: Mark a case id reference attribute as the reference to the case view. Replaces the self link of a list item\n */\nexport const CASEVIEW_LINK: string = getHint(\"CASEVIEW_LINK\");\n\n/**\n * Layout-hint: Set on configuration of instruments to show content in a popover on a label\n */\nexport const RENDER_SECTION_LABEL = \"render-section-label\";\n\n/**\n * Layout-hint: Hide a link to a component\n */\nexport const HIDE_IN_USER_INTERFACE: string = getHint(\"HIDE_IN_USER_INTERFACE\");\n\n/**\n */\nexport const getLayoutHintConfiguration = (): Object => LayoutHintConfiguration;\n\nexport default getHint;\n"],"mappings":"AACA,SAASA,uBAAuB,QAAQ,oBAAoB;;AAE5D;AACA;AACA;AACA,MAAMC,OAAO,GAAIC,IAAY,IAAa;EACxC,IAAIF,uBAAuB,CAACE,IAAI,CAAC,EAAE;IACjC,OAAOF,uBAAuB,CAACE,IAAI,CAAC,CAACA,IAAI;EAC3C;EAEA,OAAO,EAAE;AACX,CAAC;;AAED;AACA;AACA;AACA,OAAO,MAAMC,SAAiB,GAAGF,OAAO,CAAC,WAAW,CAAC;;AAErD;AACA;AACA;AACA;AACA,OAAO,MAAMG,QAAgB,GAAGH,OAAO,CAAC,UAAU,CAAC;;AAEnD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMI,2BAA2B,GAAG,mBAAmB;AAC9D;AACA;AACA,OAAO,MAAMC,mBAAmB,GAAG,sBAAsB;;AAEzD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMC,gBAAwB,GAAGN,OAAO,CAAC,kBAAkB,CAAC;AACnE;AACA;AACA;AACA,OAAO,MAAMO,YAAoB,GAAGP,OAAO,CAAC,cAAc,CAAC;AAC3D;AACA;AACA;AACA,OAAO,MAAMQ,KAAa,GAAGR,OAAO,CAAC,OAAO,CAAC;;AAE7C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMS,aAAqB,GAAGT,OAAO,CAAC,eAAe,CAAC;AAC7D;AACA;AACA;AACA,OAAO,MAAMU,aAAqB,GAAGV,OAAO,CAAC,eAAe,CAAC;AAC7D;AACA;AACA;AACA,OAAO,MAAMW,aAAqB,GAAGX,OAAO,CAAC,eAAe,CAAC;;AAE7D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMY,sBAA8B,GAAGZ,OAAO,CAAC,wBAAwB,CAAC;AAC/E;AACA;AACA;AACA,OAAO,MAAMa,kBAA0B,GAAGb,OAAO,CAAC,oBAAoB,CAAC;;AAEvE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMc,yBAAiC,GAAGd,OAAO,CACtD,2BACF,CAAC;AACD;AACA;AACA;AACA,OAAO,MAAMe,eAAuB,GAAGf,OAAO,CAAC,iBAAiB,CAAC;AACjE;AACA;AACA;AACA,OAAO,MAAMgB,cAAsB,GAAG,iBAAiB;AACvD;AACA;AACA;AACA,OAAO,MAAMC,aAAqB,GAAGjB,OAAO,CAAC,eAAe,CAAC;;AAE7D;AACA;AACA;AACA,OAAO,MAAMkB,oBAAoB,GAAG,sBAAsB;;AAE1D;AACA;AACA;AACA,OAAO,MAAMC,sBAA8B,GAAGnB,OAAO,CAAC,wBAAwB,CAAC;;AAE/E;AACA;AACA,OAAO,MAAMoB,0BAA0B,GAAGA,CAAA,KAAcrB,uBAAuB
|
|
1
|
+
{"version":3,"file":"LayoutHints.js","names":["LayoutHintConfiguration","getHint","hint","MANDATORY","DISABLED","DEPENDENT_ATTRIBUTE_CONTROL","DEPENDENT_ATTRIBUTE","CONFIRM_PASSWORD","SORT_OPTIONS","TITLE","DELETE_ACTION","UPDATE_ACTION","CREATE_ACTION","INITIAL_TOTAL_FILESIZE","MAX_TOTAL_FILESIZE","SHOW_ONE_RESULT_AS_DETAIL","HIDE_WHEN_EMPTY","INITIAL_FILTER","CASEVIEW_LINK","RENDER_SECTION_LABEL","HIDE_IN_USER_INTERFACE","getLayoutHintConfiguration","AVATAR_FOR_TITLE","AVATAR"],"sources":["../../src/constants/LayoutHints.js"],"sourcesContent":["// @flow\nimport { LayoutHintConfiguration } from \"./LayoutHintConfig\";\n\n/**\n * Retrieve layout hint by id from the layout hint configuration\n */\nconst getHint = (hint: string): string => {\n if (LayoutHintConfiguration[hint]) {\n return LayoutHintConfiguration[hint].hint;\n }\n\n return \"\";\n};\n\n/**\n * Layout-hint: Indicates a mandatory attribute. Should be used together with the dependency hint.\n */\nexport const MANDATORY: string = getHint(\"MANDATORY\");\n\n/**\n * Layout-hint: Indicates a disabled attribute.\n * @constant\n */\nexport const DISABLED: string = getHint(\"DISABLED\");\n\n/*\n * --------------------------------\n * SELECT DEPENDENT ATTRIBUTES\n * --------------------------------\n */\n/**\n * Layout-hint: Marks the choice attribute where other attributes depend on. The unique control id is a unique id that can be used in the hint for the show|hide action on the dependent attribute.\n */\nexport const DEPENDENT_ATTRIBUTE_CONTROL = \"dependent-control\";\n/**\n */\nexport const DEPENDENT_ATTRIBUTE = \"dependent-attribute:\";\n\n/*\n * --------------------------------\n * ATTRIBUTES\n * --------------------------------\n */\n/**\n * Layout-hint: Password attribute must be confirmed using a second password attribute.\n */\nexport const CONFIRM_PASSWORD: string = getHint(\"CONFIRM_PASSWORD\");\n/**\n * Layout-hint: Sort options alphabetically\n */\nexport const SORT_OPTIONS: string = getHint(\"SORT_OPTIONS\");\n/**\n * Layout-hint: Marks an attribute as a title attribute\n */\nexport const TITLE: string = getHint(\"TITLE\");\n\n/*\n * --------------------------------\n * FORM\n * --------------------------------\n */\n/**\n * Layout-hint: Mark task as delete task\n */\nexport const DELETE_ACTION: string = getHint(\"DELETE_ACTION\");\n/**\n * Layout-hint: Mark task as update task\n */\nexport const UPDATE_ACTION: string = getHint(\"UPDATE_ACTION\");\n/**\n * Layout-hint: Mark task as create task\n */\nexport const CREATE_ACTION: string = getHint(\"CREATE_ACTION\");\n\n/*\n * --------------------------------\n * UPLOAD TOTAL FILE SIZE\n * --------------------------------\n */\n/**\n * Layout-hint: Used in conjunction with an upload attribute, this hint is set on a read only attribute containing the file size currently used.\n */\nexport const INITIAL_TOTAL_FILESIZE: string = getHint(\"INITIAL_TOTAL_FILESIZE\");\n/**\n * Layout-hint: Used in conjunction with an upload attribute, this hint is set on a read only attribute containing the maximum allowed total file size.\n */\nexport const MAX_TOTAL_FILESIZE: string = getHint(\"MAX_TOTAL_FILESIZE\");\n\n/*\n * --------------------------------\n * LISTS\n * --------------------------------\n */\n/**\n * Layout-hint: A list with only one detail must be shown as a detail\n */\nexport const SHOW_ONE_RESULT_AS_DETAIL: string = getHint(\n \"SHOW_ONE_RESULT_AS_DETAIL\",\n);\n/**\n * Layout-hint: A list without list-items and list-tasks should not be shown.\n */\nexport const HIDE_WHEN_EMPTY: string = getHint(\"HIDE_WHEN_EMPTY\");\n/**\n * Layout-hint: Sets a default value on a filter\n */\nexport const INITIAL_FILTER: string = \"initial-filter:\";\n/**\n * Layout-hint: Mark a case id reference attribute as the reference to the case view. Replaces the self link of a list item\n */\nexport const CASEVIEW_LINK: string = getHint(\"CASEVIEW_LINK\");\n\n/**\n * Layout-hint: Set on configuration of instruments to show content in a popover on a label\n */\nexport const RENDER_SECTION_LABEL = \"render-section-label\";\n\n/**\n * Layout-hint: Hide a link to a component\n */\nexport const HIDE_IN_USER_INTERFACE: string = getHint(\"HIDE_IN_USER_INTERFACE\");\n\n/**\n */\nexport const getLayoutHintConfiguration = (): Object => LayoutHintConfiguration;\n\n/**\n * Layout-hint: Marks an attribute as an avatar for the title attribute.\n */\nexport const AVATAR_FOR_TITLE: string = getHint(\"AVATAR_FOR_TITLE\");\n\nexport const AVATAR: string = getHint(\"AVATAR\");\n\nexport default getHint;\n"],"mappings":"AACA,SAASA,uBAAuB,QAAQ,oBAAoB;;AAE5D;AACA;AACA;AACA,MAAMC,OAAO,GAAIC,IAAY,IAAa;EACxC,IAAIF,uBAAuB,CAACE,IAAI,CAAC,EAAE;IACjC,OAAOF,uBAAuB,CAACE,IAAI,CAAC,CAACA,IAAI;EAC3C;EAEA,OAAO,EAAE;AACX,CAAC;;AAED;AACA;AACA;AACA,OAAO,MAAMC,SAAiB,GAAGF,OAAO,CAAC,WAAW,CAAC;;AAErD;AACA;AACA;AACA;AACA,OAAO,MAAMG,QAAgB,GAAGH,OAAO,CAAC,UAAU,CAAC;;AAEnD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMI,2BAA2B,GAAG,mBAAmB;AAC9D;AACA;AACA,OAAO,MA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;AACA,OAAO,MAAMsB,gBAAwB,GAAGrB,OAAO,CAAC,kBAAkB,CAAC;AAEnE,OAAO,MAAMsB,MAAc,GAAGtB,OAAO,CAAC,QAAQ,CAAC;AAE/C,eAAeA,OAAO"}
|
|
@@ -4,11 +4,12 @@ import _includesInstanceProperty from "@babel/runtime-corejs3/core-js-stable/ins
|
|
|
4
4
|
import _filterInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/filter";
|
|
5
5
|
import _Object$keys from "@babel/runtime-corejs3/core-js-stable/object/keys";
|
|
6
6
|
import _mapInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/map";
|
|
7
|
+
import _findInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/find";
|
|
7
8
|
import { has } from "../../utils/helpers/objects";
|
|
8
9
|
import ActionCollection from "../actions/ActionCollection";
|
|
9
10
|
import AttributeCollection from "../attributes/AttributeCollection";
|
|
10
11
|
import ResourceModel from "../base/ResourceModel";
|
|
11
|
-
import { TITLE } from "../../constants/LayoutHints";
|
|
12
|
+
import { AVATAR, AVATAR_FOR_TITLE, TITLE } from "../../constants/LayoutHints";
|
|
12
13
|
/**
|
|
13
14
|
* Base class for details<br/>
|
|
14
15
|
* For instance the details of case 1<br/>
|
|
@@ -101,7 +102,12 @@ export default class DetailModel extends ResourceModel {
|
|
|
101
102
|
*/
|
|
102
103
|
get attributes() {
|
|
103
104
|
var _context3;
|
|
104
|
-
return _filterInstanceProperty(_context3 = this.attributeCollection.all).call(_context3, attribute =>
|
|
105
|
+
return _filterInstanceProperty(_context3 = this.attributeCollection.all).call(_context3, attribute => {
|
|
106
|
+
const hasTitle = attribute.layouthint.hasExact(TITLE);
|
|
107
|
+
const hasAvatar = attribute.layouthint.hasExact(AVATAR);
|
|
108
|
+
const hasAvatarForTitle = attribute.layouthint.hasExact(AVATAR_FOR_TITLE);
|
|
109
|
+
return !attribute.isHidden && (!hasTitle || hasTitle && hasAvatar) && (!hasAvatarForTitle || hasAvatarForTitle && !hasAvatar);
|
|
110
|
+
});
|
|
105
111
|
}
|
|
106
112
|
|
|
107
113
|
/**
|
|
@@ -160,11 +166,24 @@ export default class DetailModel extends ResourceModel {
|
|
|
160
166
|
return this.contributions.resourcetype === "CaseView";
|
|
161
167
|
}
|
|
162
168
|
|
|
169
|
+
/**
|
|
170
|
+
* Getting the attribute that has as layout hint 'avatar-for-title'
|
|
171
|
+
*/
|
|
172
|
+
get avatarForTitleAttribute() {
|
|
173
|
+
var _context5;
|
|
174
|
+
const avatarAttributes = _filterInstanceProperty(_context5 = this._attributeCollection.all).call(_context5, attribute => attribute.layouthint.hasExact(AVATAR));
|
|
175
|
+
const avatarForTitleAttribute = _findInstanceProperty(avatarAttributes).call(avatarAttributes, attribute => attribute.layouthint.hasExact(AVATAR_FOR_TITLE));
|
|
176
|
+
return avatarForTitleAttribute || null;
|
|
177
|
+
}
|
|
178
|
+
|
|
163
179
|
/**
|
|
164
180
|
* Getting the attribute that has as layout hint 'title'
|
|
165
181
|
*/
|
|
166
182
|
get titleAttribute() {
|
|
167
|
-
|
|
183
|
+
var _context6;
|
|
184
|
+
const nonAvatarAttributes = _filterInstanceProperty(_context6 = this._attributeCollection.all).call(_context6, attribute => !attribute.layouthint.hasExact(AVATAR));
|
|
185
|
+
const titleAttribute = _findInstanceProperty(nonAvatarAttributes).call(nonAvatarAttributes, attribute => attribute.layouthint.has(TITLE));
|
|
186
|
+
return titleAttribute || null;
|
|
168
187
|
}
|
|
169
188
|
|
|
170
189
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DetailModel.js","names":["has","ActionCollection","AttributeCollection","ResourceModel","TITLE","DetailModel","constructor","modularuiResponse","_defineProperty","createAttributeCollection","createMetadataCollection","createActionCollection","type","modelName","isApplicableModel","data","_context","resourceType","contributions","resourcetype","_endsWithInstanceProperty","call","_includesInstanceProperty","getInitialChildModelLinks","_attributeCollection","setChildModels","models","id","getData","key","label","getContribution","_context2","attributeContributions","attributes","_filterInstanceProperty","contribution","_Object$keys","attributeCollection","collection","_context3","all","attribute","layouthint","isHidden","getAttributeByKey","_context4","metadataContributions","metadata","_mapInstanceProperty","metadataKey","metadataCollection","_metadataCollection","_actionCollection","actions","actionCollection","isCase","titleAttribute","getAttributeByLayoutHint","update","model","clonedModel","clone","equals","toString"],"sources":["../../../src/models/detail/DetailModel.js"],"sourcesContent":["// @flow\nimport { has } from \"../../utils/helpers/objects\";\n\nimport ActionCollection from \"../actions/ActionCollection\";\nimport AttributeCollection from \"../attributes/AttributeCollection\";\nimport ResourceModel from \"../base/ResourceModel\";\n\nimport { TITLE } from \"../../constants/LayoutHints\";\n\nimport type { ModularUIResponse } from \"../../modularui\";\nimport type { ModularUIModel, AttributeType } from \"../types\";\nimport type LinkModel from \"../links/LinkModel\";\n\n/**\n * Base class for details<br/>\n * For instance the details of case 1<br/>\n * For instance the details of record 12<br/>\n */\nexport default class DetailModel extends ResourceModel {\n _attributeCollection: AttributeCollection;\n _metadataCollection: AttributeCollection;\n _actionCollection: ActionCollection;\n\n /**\n */\n constructor(modularuiResponse: ModularUIResponse) {\n super(modularuiResponse);\n\n this.createAttributeCollection();\n this.createMetadataCollection();\n this.createActionCollection();\n }\n\n /**\n */\n get type(): string {\n return \"Detail\";\n }\n\n /**\n */\n static get modelName(): string {\n return \"DetailModel\";\n }\n\n /**\n */\n static isApplicableModel(data: ModularUIResponse): boolean {\n const resourceType = data.contributions?.resourcetype;\n return (\n resourceType &&\n (resourceType.endsWith(\"DetailPanel\") ||\n [\"Detail\", \"CasePropertiesPanel\", \"CasePropertiesPanelDetail\"].includes(\n resourceType,\n ))\n );\n }\n\n /**\n */\n getInitialChildModelLinks(): Array<LinkModel> {\n return this._attributeCollection.getInitialChildModelLinks();\n }\n\n /**\n */\n setChildModels(models: Array<ModularUIModel>) {\n this._attributeCollection.setChildModels(models);\n }\n\n /**\n * Getting the unique identifier of the details\n */\n get id(): string {\n return this.getData(\"_id\", this.key);\n }\n\n /**\n */\n get label(): string {\n return this.getContribution(\"label\", \"\");\n }\n\n /**\n * Attribute collection\n */\n createAttributeCollection() {\n const attributeContributions = this.contributions.attributes\n ? this.contributions.attributes.filter((contribution) => {\n const [key] = Object.keys(contribution);\n return has(this.data, key);\n })\n : [];\n\n this.attributeCollection = new AttributeCollection(\n this.data,\n attributeContributions,\n true,\n );\n }\n\n /**\n */\n get attributeCollection(): AttributeCollection {\n return this._attributeCollection;\n }\n\n /**\n */\n set attributeCollection(collection: AttributeCollection) {\n this._attributeCollection = collection;\n }\n\n /**\n * Retrieve list of visible attributes\n */\n get attributes(): Array<AttributeType> {\n return this.attributeCollection.all.filter(\n (attribute) => !attribute.layouthint.has(TITLE) && !attribute.isHidden,\n );\n }\n\n /**\n * Retrieve an attribute by it's key\n */\n getAttributeByKey(key: string): AttributeType | null {\n return this._attributeCollection.getAttributeByKey(key);\n }\n\n /**\n * Metadata collection\n */\n createMetadataCollection() {\n const metadataContributions = this.contributions.metadata\n ? Object.keys(this.contributions.metadata).map((metadataKey) => ({\n [metadataKey]: this.contributions.metadata[metadataKey],\n }))\n : [];\n\n this.metadataCollection = new AttributeCollection(\n this.data,\n metadataContributions,\n true,\n );\n }\n\n /**\n */\n get metadataCollection(): AttributeCollection {\n return this._metadataCollection;\n }\n\n /**\n */\n set metadataCollection(collection: AttributeCollection) {\n this._metadataCollection = collection;\n }\n\n /**\n * Action collection\n */\n createActionCollection() {\n this._actionCollection = new ActionCollection(\n this.data.actions,\n this.contributions.actions,\n );\n }\n\n /**\n */\n get actionCollection(): ActionCollection {\n return this._actionCollection;\n }\n\n /**\n */\n set actionCollection(actionCollection: ActionCollection) {\n this._actionCollection = actionCollection;\n }\n\n /**\n * Determines if this is a case\n */\n get isCase(): boolean {\n return this.contributions.resourcetype === \"CaseView\";\n }\n\n /**\n * Getting the attribute that has as layout hint 'title'\n */\n get titleAttribute(): ?AttributeType {\n return this._attributeCollection.getAttributeByLayoutHint(TITLE);\n }\n\n /**\n * Update current detail with a new detail model and return a cloned version of the model\n */\n update(model: ModularUIModel): DetailModel {\n if (model instanceof DetailModel) {\n const clonedModel = this.clone();\n\n clonedModel.attributeCollection = model._attributeCollection;\n clonedModel.metadataCollection = model._metadataCollection;\n clonedModel.actionCollection = model._actionCollection;\n\n return clonedModel;\n }\n\n return this;\n }\n\n /**\n */\n equals(model: DetailModel): boolean {\n return this.id.toString() === model.id.toString();\n }\n}\n"],"mappings":";;;;;;AACA,SAASA,GAAG,QAAQ,6BAA6B;AAEjD,OAAOC,gBAAgB,MAAM,6BAA6B;AAC1D,OAAOC,mBAAmB,MAAM,mCAAmC;AACnE,OAAOC,aAAa,MAAM,uBAAuB;AAEjD,SAASC,KAAK,QAAQ,6BAA6B;AAMnD;AACA;AACA;AACA;AACA;AACA,eAAe,MAAMC,WAAW,SAASF,aAAa,CAAC;EAKrD;AACF;EACEG,WAAWA,CAACC,iBAAoC,EAAE;IAChD,KAAK,CAACA,iBAAiB,CAAC;IAACC,eAAA;IAAAA,eAAA;IAAAA,eAAA;IAEzB,IAAI,CAACC,yBAAyB,CAAC,CAAC;IAChC,IAAI,CAACC,wBAAwB,CAAC,CAAC;IAC/B,IAAI,CAACC,sBAAsB,CAAC,CAAC;EAC/B;;EAEA;AACF;EACE,IAAIC,IAAIA,CAAA,EAAW;IACjB,OAAO,QAAQ;EACjB;;EAEA;AACF;EACE,WAAWC,SAASA,CAAA,EAAW;IAC7B,OAAO,aAAa;EACtB;;EAEA;AACF;EACE,OAAOC,iBAAiBA,CAACC,IAAuB,EAAW;IAAA,IAAAC,QAAA;IACzD,MAAMC,YAAY,GAAGF,IAAI,CAACG,aAAa,EAAEC,YAAY;IACrD,OACEF,YAAY,KACXG,yBAAA,CAAAH,YAAY,EAAAI,IAAA,CAAZJ,YAAY,EAAU,aAAa,CAAC,IACnCK,yBAAA,CAAAN,QAAA,IAAC,QAAQ,EAAE,qBAAqB,EAAE,2BAA2B,CAAC,EAAAK,IAAA,CAAAL,QAAA,EAC5DC,YACF,CAAC,CAAC;EAER;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ACF,iBAAiB;EAC/B;;EAEA;AACF;EACE,IAAIE,gBAAgBA,CAACA,gBAAkC,EAAE;IACvD,IAAI,CAACF,iBAAiB,GAAGE,gBAAgB;EAC3C;;EAEA;AACF;AACA;EACE,IAAIC,MAAMA,CAAA,EAAY;IACpB,OAAO,IAAI,CAACtC,aAAa,CAACC,YAAY,KAAK,UAAU;EACvD;;EAEA;AACF;AACA;EACE,IAAIsC,cAAcA,CAAA,EAAmB;IACnC,OAAO,IAAI,CAACjC,oBAAoB,CAACkC,wBAAwB,CAACtD,KAAK,CAAC;EAClE;;EAEA;AACF;AACA;EACEuD,MAAMA,CAACC,KAAqB,EAAe;IACzC,IAAIA,KAAK,YAAYvD,WAAW,EAAE;MAChC,MAAMwD,WAAW,GAAG,IAAI,CAACC,KAAK,CAAC,CAAC;MAEhCD,WAAW,CAACvB,mBAAmB,GAAGsB,KAAK,CAACpC,oBAAoB;MAC5DqC,WAAW,CAACV,kBAAkB,GAAGS,KAAK,CAACR,mBAAmB;MAC1DS,WAAW,CAACN,gBAAgB,GAAGK,KAAK,CAACP,iBAAiB;MAEtD,OAAOQ,WAAW;IACpB;IAEA,OAAO,IAAI;EACb;;EAEA;AACF;EACEE,MAAMA,CAACH,KAAkB,EAAW;IAClC,OAAO,IAAI,CAACjC,EAAE,CAACqC,QAAQ,CAAC,CAAC,KAAKJ,KAAK,CAACjC,EAAE,CAACqC,QAAQ,CAAC,CAAC;EACnD;AACF"}
|
|
1
|
+
{"version":3,"file":"DetailModel.js","names":["has","ActionCollection","AttributeCollection","ResourceModel","AVATAR","AVATAR_FOR_TITLE","TITLE","DetailModel","constructor","modularuiResponse","_defineProperty","createAttributeCollection","createMetadataCollection","createActionCollection","type","modelName","isApplicableModel","data","_context","resourceType","contributions","resourcetype","_endsWithInstanceProperty","call","_includesInstanceProperty","getInitialChildModelLinks","_attributeCollection","setChildModels","models","id","getData","key","label","getContribution","_context2","attributeContributions","attributes","_filterInstanceProperty","contribution","_Object$keys","attributeCollection","collection","_context3","all","attribute","hasTitle","layouthint","hasExact","hasAvatar","hasAvatarForTitle","isHidden","getAttributeByKey","_context4","metadataContributions","metadata","_mapInstanceProperty","metadataKey","metadataCollection","_metadataCollection","_actionCollection","actions","actionCollection","isCase","avatarForTitleAttribute","_context5","avatarAttributes","_findInstanceProperty","titleAttribute","_context6","nonAvatarAttributes","update","model","clonedModel","clone","equals","toString"],"sources":["../../../src/models/detail/DetailModel.js"],"sourcesContent":["// @flow\nimport { has } from \"../../utils/helpers/objects\";\n\nimport ActionCollection from \"../actions/ActionCollection\";\nimport AttributeCollection from \"../attributes/AttributeCollection\";\nimport ResourceModel from \"../base/ResourceModel\";\n\nimport { AVATAR, AVATAR_FOR_TITLE, TITLE } from \"../../constants/LayoutHints\";\n\nimport type { ModularUIResponse } from \"../../modularui\";\nimport type { ModularUIModel, AttributeType } from \"../types\";\nimport type LinkModel from \"../links/LinkModel\";\n\n/**\n * Base class for details<br/>\n * For instance the details of case 1<br/>\n * For instance the details of record 12<br/>\n */\nexport default class DetailModel extends ResourceModel {\n _attributeCollection: AttributeCollection;\n _metadataCollection: AttributeCollection;\n _actionCollection: ActionCollection;\n\n /**\n */\n constructor(modularuiResponse: ModularUIResponse) {\n super(modularuiResponse);\n\n this.createAttributeCollection();\n this.createMetadataCollection();\n this.createActionCollection();\n }\n\n /**\n */\n get type(): string {\n return \"Detail\";\n }\n\n /**\n */\n static get modelName(): string {\n return \"DetailModel\";\n }\n\n /**\n */\n static isApplicableModel(data: ModularUIResponse): boolean {\n const resourceType = data.contributions?.resourcetype;\n return (\n resourceType &&\n (resourceType.endsWith(\"DetailPanel\") ||\n [\"Detail\", \"CasePropertiesPanel\", \"CasePropertiesPanelDetail\"].includes(\n resourceType,\n ))\n );\n }\n\n /**\n */\n getInitialChildModelLinks(): Array<LinkModel> {\n return this._attributeCollection.getInitialChildModelLinks();\n }\n\n /**\n */\n setChildModels(models: Array<ModularUIModel>) {\n this._attributeCollection.setChildModels(models);\n }\n\n /**\n * Getting the unique identifier of the details\n */\n get id(): string {\n return this.getData(\"_id\", this.key);\n }\n\n /**\n */\n get label(): string {\n return this.getContribution(\"label\", \"\");\n }\n\n /**\n * Attribute collection\n */\n createAttributeCollection() {\n const attributeContributions = this.contributions.attributes\n ? this.contributions.attributes.filter((contribution) => {\n const [key] = Object.keys(contribution);\n return has(this.data, key);\n })\n : [];\n\n this.attributeCollection = new AttributeCollection(\n this.data,\n attributeContributions,\n true,\n );\n }\n\n /**\n */\n get attributeCollection(): AttributeCollection {\n return this._attributeCollection;\n }\n\n /**\n */\n set attributeCollection(collection: AttributeCollection) {\n this._attributeCollection = collection;\n }\n\n /**\n * Retrieve list of visible attributes\n */\n get attributes(): Array<AttributeType> {\n return this.attributeCollection.all.filter((attribute) => {\n const hasTitle = attribute.layouthint.hasExact(TITLE);\n const hasAvatar = attribute.layouthint.hasExact(AVATAR);\n const hasAvatarForTitle = attribute.layouthint.hasExact(AVATAR_FOR_TITLE);\n return (\n !attribute.isHidden &&\n (!hasTitle || (hasTitle && hasAvatar)) &&\n (!hasAvatarForTitle || (hasAvatarForTitle && !hasAvatar))\n );\n });\n }\n\n /**\n * Retrieve an attribute by it's key\n */\n getAttributeByKey(key: string): AttributeType | null {\n return this._attributeCollection.getAttributeByKey(key);\n }\n\n /**\n * Metadata collection\n */\n createMetadataCollection() {\n const metadataContributions = this.contributions.metadata\n ? Object.keys(this.contributions.metadata).map((metadataKey) => ({\n [metadataKey]: this.contributions.metadata[metadataKey],\n }))\n : [];\n\n this.metadataCollection = new AttributeCollection(\n this.data,\n metadataContributions,\n true,\n );\n }\n\n /**\n */\n get metadataCollection(): AttributeCollection {\n return this._metadataCollection;\n }\n\n /**\n */\n set metadataCollection(collection: AttributeCollection) {\n this._metadataCollection = collection;\n }\n\n /**\n * Action collection\n */\n createActionCollection() {\n this._actionCollection = new ActionCollection(\n this.data.actions,\n this.contributions.actions,\n );\n }\n\n /**\n */\n get actionCollection(): ActionCollection {\n return this._actionCollection;\n }\n\n /**\n */\n set actionCollection(actionCollection: ActionCollection) {\n this._actionCollection = actionCollection;\n }\n\n /**\n * Determines if this is a case\n */\n get isCase(): boolean {\n return this.contributions.resourcetype === \"CaseView\";\n }\n\n /**\n * Getting the attribute that has as layout hint 'avatar-for-title'\n */\n get avatarForTitleAttribute(): ?AttributeType {\n const avatarAttributes = this._attributeCollection.all.filter((attribute) =>\n attribute.layouthint.hasExact(AVATAR),\n );\n\n const avatarForTitleAttribute = avatarAttributes.find((attribute) =>\n attribute.layouthint.hasExact(AVATAR_FOR_TITLE),\n );\n\n return avatarForTitleAttribute || null;\n }\n\n /**\n * Getting the attribute that has as layout hint 'title'\n */\n get titleAttribute(): ?AttributeType {\n const nonAvatarAttributes = this._attributeCollection.all.filter(\n (attribute) => !attribute.layouthint.hasExact(AVATAR),\n );\n\n const titleAttribute = nonAvatarAttributes.find((attribute) =>\n attribute.layouthint.has(TITLE),\n );\n\n return titleAttribute || null;\n }\n\n /**\n * Update current detail with a new detail model and return a cloned version of the model\n */\n update(model: ModularUIModel): DetailModel {\n if (model instanceof DetailModel) {\n const clonedModel = this.clone();\n\n clonedModel.attributeCollection = model._attributeCollection;\n clonedModel.metadataCollection = model._metadataCollection;\n clonedModel.actionCollection = model._actionCollection;\n\n return clonedModel;\n }\n\n return this;\n }\n\n /**\n */\n equals(model: DetailModel): boolean {\n return this.id.toString() === model.id.toString();\n }\n}\n"],"mappings":";;;;;;;AACA,SAASA,GAAG,QAAQ,6BAA6B;AAEjD,OAAOC,gBAAgB,MAAM,6BAA6B;AAC1D,OAAOC,mBAAmB,MAAM,mCAAmC;AACnE,OAAOC,aAAa,MAAM,uBAAuB;AAEjD,SAASC,MAAM,EAAEC,gBAAgB,EAAEC,KAAK,QAAQ,6BAA6B;AAM7E;AACA;AACA;AACA;AACA;AACA,eAAe,MAAMC,WAAW,SAASJ,aAAa,CAAC;EAKrD;AACF;EACEK,WAAWA,CAACC,iBAAoC,EAAE;IAChD,KAAK,CAACA,iBAAiB,CA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AiB;MAEtD,OAAOa,WAAW;IACpB;IAEA,OAAO,IAAI;EACb;;EAEA;AACF;EACEE,MAAMA,CAACH,KAAkB,EAAW;IAClC,OAAO,IAAI,CAAC1C,EAAE,CAAC8C,QAAQ,CAAC,CAAC,KAAKJ,KAAK,CAAC1C,EAAE,CAAC8C,QAAQ,CAAC,CAAC;EACnD;AACF"}
|
|
@@ -152,6 +152,24 @@ const LayoutHintConfiguration = exports.LayoutHintConfiguration = {
|
|
|
152
152
|
},
|
|
153
153
|
link: "",
|
|
154
154
|
component: ["tab"]
|
|
155
|
+
},
|
|
156
|
+
AVATAR_FOR_TITLE: {
|
|
157
|
+
hint: "avatar-for-title",
|
|
158
|
+
description: {
|
|
159
|
+
NL: "Markeert een attribuut als een avatar voor het titelattribuut.",
|
|
160
|
+
EN: "Marks an attribute as an avatar for the title attribute."
|
|
161
|
+
},
|
|
162
|
+
link: "",
|
|
163
|
+
component: ["caseview_table", "codemap", "list/appointment_table", "list/assignment_table", "list/caseproperties_table", "list/document_table", "list/timelimit_table", "list/eventhistory_table", "list/note_table", "list/record_table", "list/case_table", "list/casesearch_table", "list/datastore_table", "list/datastoreview_table", "list/instrumentresult_table", "list/event_table", "list/user_table", "list/organization_table"]
|
|
164
|
+
},
|
|
165
|
+
AVATAR: {
|
|
166
|
+
hint: "avatar",
|
|
167
|
+
description: {
|
|
168
|
+
NL: "Geef het attribuut weer als de avatar van de gebruiker.",
|
|
169
|
+
EN: "Render the attribute as the user's avatar."
|
|
170
|
+
},
|
|
171
|
+
link: "",
|
|
172
|
+
component: ["caseview_table", "codemap", "list/appointment_table", "list/assignment_table", "list/caseproperties_table", "list/document_table", "list/timelimit_table", "list/eventhistory_table", "list/note_table", "list/record_table", "list/case_table", "list/casesearch_table", "list/datastore_table", "list/datastoreview_table", "list/instrumentresult_table", "list/event_table", "list/user_table", "list/organization_table"]
|
|
155
173
|
}
|
|
156
174
|
};
|
|
157
175
|
//# sourceMappingURL=LayoutHintConfig.js.map
|
|
@@ -167,4 +167,60 @@ export const LayoutHintConfiguration = {
|
|
|
167
167
|
link: "",
|
|
168
168
|
component: ["tab"],
|
|
169
169
|
},
|
|
170
|
+
AVATAR_FOR_TITLE: {
|
|
171
|
+
hint: "avatar-for-title",
|
|
172
|
+
description: {
|
|
173
|
+
NL: "Markeert een attribuut als een avatar voor het titelattribuut.",
|
|
174
|
+
EN: "Marks an attribute as an avatar for the title attribute.",
|
|
175
|
+
},
|
|
176
|
+
link: "",
|
|
177
|
+
component: [
|
|
178
|
+
"caseview_table",
|
|
179
|
+
"codemap",
|
|
180
|
+
"list/appointment_table",
|
|
181
|
+
"list/assignment_table",
|
|
182
|
+
"list/caseproperties_table",
|
|
183
|
+
"list/document_table",
|
|
184
|
+
"list/timelimit_table",
|
|
185
|
+
"list/eventhistory_table",
|
|
186
|
+
"list/note_table",
|
|
187
|
+
"list/record_table",
|
|
188
|
+
"list/case_table",
|
|
189
|
+
"list/casesearch_table",
|
|
190
|
+
"list/datastore_table",
|
|
191
|
+
"list/datastoreview_table",
|
|
192
|
+
"list/instrumentresult_table",
|
|
193
|
+
"list/event_table",
|
|
194
|
+
"list/user_table",
|
|
195
|
+
"list/organization_table",
|
|
196
|
+
],
|
|
197
|
+
},
|
|
198
|
+
AVATAR: {
|
|
199
|
+
hint: "avatar",
|
|
200
|
+
description: {
|
|
201
|
+
NL: "Geef het attribuut weer als de avatar van de gebruiker.",
|
|
202
|
+
EN: "Render the attribute as the user's avatar.",
|
|
203
|
+
},
|
|
204
|
+
link: "",
|
|
205
|
+
component: [
|
|
206
|
+
"caseview_table",
|
|
207
|
+
"codemap",
|
|
208
|
+
"list/appointment_table",
|
|
209
|
+
"list/assignment_table",
|
|
210
|
+
"list/caseproperties_table",
|
|
211
|
+
"list/document_table",
|
|
212
|
+
"list/timelimit_table",
|
|
213
|
+
"list/eventhistory_table",
|
|
214
|
+
"list/note_table",
|
|
215
|
+
"list/record_table",
|
|
216
|
+
"list/case_table",
|
|
217
|
+
"list/casesearch_table",
|
|
218
|
+
"list/datastore_table",
|
|
219
|
+
"list/datastoreview_table",
|
|
220
|
+
"list/instrumentresult_table",
|
|
221
|
+
"list/event_table",
|
|
222
|
+
"list/user_table",
|
|
223
|
+
"list/organization_table",
|
|
224
|
+
],
|
|
225
|
+
},
|
|
170
226
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LayoutHintConfig.js","names":["LayoutHintConfiguration","exports","MANDATORY","hint","description","NL","EN","link","component","DEPENDENT_ATTRIBUTE_CONTROL","DEPENDENT_ATTRIBUTE_ACTION","SHOW_ONE_RESULT_AS_DETAIL","HIDE_WHEN_EMPTY","INITIAL_FILTER","CONFIRM_PASSWORD","TITLE","INITIAL_TOTAL_FILESIZE","MAX_TOTAL_FILESIZE","CREATE_ACTION","UPDATE_ACTION","DELETE_ACTION","SORT_OPTIONS","CASEVIEW_LINK","DISABLED","HIDE_IN_USER_INTERFACE"],"sources":["../../src/constants/LayoutHintConfig.js"],"sourcesContent":["// @flow\nexport const LayoutHintConfiguration = {\n MANDATORY: {\n hint: \"mandatory\",\n description: {\n NL: \"Geeft aan of een attribuut verplicht is. Dient samen met de dependency hint gebruikt te worden.\",\n EN: \"Indicates a mandatory attribute.\\nShould be used together with the dependency hint.\",\n },\n link: \"\",\n component: [\"attribute\"],\n },\n DEPENDENT_ATTRIBUTE_CONTROL: {\n hint: \"dependent-control:${unique-control-id}\",\n description: {\n NL: \"Geeft aan dat dit het attribuut is waar attributen van afhankelijk zijn. Het unique-control-id is een uniek id dat kan worden gebruikt in the hint voor de show|hide actie op het afhankelijke attribuut.\",\n EN: \"Marks the choice attribute where other attributes depend on. The unique control id is a unique id that can be used in the hint for the show|hide action on the dependent attribute.\",\n },\n link: \"\",\n component: [\"attribute/boolean\", \"attribute/choice\"],\n },\n DEPENDENT_ATTRIBUTE_ACTION: {\n hint: \"dependent-attribute:(show|hide) when dependent-control:${unique-control-id} (equals|includes|notEquals|notIncludes) [${codemaps}]\",\n description: {\n NL: \"Toon of verberg een attribute dat afhankelijk is van de geselecteerde opties van een keuze attribute\",\n EN: \"To show or hide an attribute dependent on options of the choice control codemap that are selected or not selected.\",\n },\n link: \"\",\n component: [\"attribute\"],\n },\n SHOW_ONE_RESULT_AS_DETAIL: {\n hint: \"show-one-result-as-detail\",\n description: {\n NL: \"Een lijst met maar één item mag direct als detail getoond worden.\",\n EN: \"A list with only one detail must be shown as a detail.\",\n },\n link: \"\",\n component: [\"list\"],\n },\n HIDE_WHEN_EMPTY: {\n hint: \"hide-when-empty\",\n description: {\n NL: \"Een lijst zonder lijst-items en lijst-taken dient niet getoond worden.\",\n EN: \"A list without list-items and list-tasks should not be shown.\",\n },\n link: \"\",\n component: [\"list\"],\n },\n INITIAL_FILTER: {\n hint: \"initial-filter:${filter-name}=${initial-value}\",\n description: {\n NL: \"Laad de lijst met een standaardwaarde voor een filter, er is geen controle op het bestaan van het filter. Als het filter niet is geconfigureerd, treedt er een fout op. Houd er rekening mee dat filters hoofdlettergevoelig zijn.\",\n EN: \"Load the list with a default value for a filter, there is no check for the existence of the filter. If the filter is not configured, an error occurs. Keep in mind that filters are case sensitive.\",\n },\n link: \"\",\n component: [\"list\"],\n },\n CONFIRM_PASSWORD: {\n hint: \"confirm-password\",\n description: {\n NL: \"Wachtwoord attribuut moet bevestigd worden dmv een tweede wachtwoord attribuut.\",\n EN: \"Password attribute must be confirmed using a second password attribute.\",\n },\n link: \"\",\n component: [\"attribute/password\"],\n },\n TITLE: {\n hint: \"title\",\n description: {\n NL: \"Markeert een attribuut als een titel attribuut\",\n EN: \"Marks an attribute as a title attribute\",\n },\n link: \"\",\n component: [\n \"caseview_table\",\n \"codemap\",\n \"list/appointment_table\",\n \"list/assignment_table\",\n \"list/caseproperties_table\",\n \"list/document_table\",\n \"list/timelimit_table\",\n \"list/eventhistory_table\",\n \"list/note_table\",\n \"list/record_table\",\n \"list/case_table\",\n \"list/casesearch_table\",\n \"list/datastore_table\",\n \"list/datastoreview_table\",\n \"list/instrumentresult_table\",\n \"list/event_table\",\n \"list/user_table\",\n \"list/organization_table\",\n ],\n },\n INITIAL_TOTAL_FILESIZE: {\n hint: \"initial-total-file-size\",\n description: {\n NL: \"Wordt gebruikt in samenwerking met een upload attribuut, deze hint moet worden gezet op een readonly attribuut dat de reeds gebruikte file grootte bevat.\",\n EN: \"Used in conjunction with an upload attribute, this hint is set on a read only attribute containing the file size currently used.\",\n },\n link: \"\",\n component: [\"attribute/number\"],\n },\n MAX_TOTAL_FILESIZE: {\n hint: \"max-total-file-size\",\n description: {\n NL: \"Wordt gebruikt in samenwerking met een upload attribuut, deze hint moet worden gezet op een readonly attribuut dat de maximaal toegestane file grootte bevat.\",\n EN: \"Used in conjunction with an upload attribute, this hint is set on a read only attribute containing the maximum allowed total file size.\",\n },\n link: \"\",\n component: [\"attribute/number\"],\n },\n CREATE_ACTION: {\n hint: \"create\",\n description: {\n NL: \"Markeer taak als creëer taak.\",\n EN: \"Mark task as create task\",\n },\n component: [\"form\"],\n },\n UPDATE_ACTION: {\n hint: \"update\",\n description: {\n NL: \"Markeer taak als bewerk taak.\",\n EN: \"Mark task as update task\",\n },\n component: [\"form\"],\n },\n DELETE_ACTION: {\n hint: \"delete\",\n description: {\n NL: \"Markeer taak als verwijder taak.\",\n EN: \"Mark task as delete task\",\n },\n component: [\"form\"],\n },\n SORT_OPTIONS: {\n hint: \"sort-options\",\n description: {\n NL: \"Sorteer opties alfabetisch\",\n EN: \"Sort options alphabetically\",\n },\n component: [\"attribute/choice\"],\n },\n CASEVIEW_LINK: {\n hint: \"case-view-link\",\n description: {\n NL: \"Markeer een case id reference attribute als de referentie naar de case view. Vervangt de self link van een lijst item\",\n EN: \"Mark a case id reference attribute as the reference to the case view. Replaces the self link of a list item\",\n },\n component: [\"attribute/reference\", \"list/datastore_table\"],\n },\n DISABLED: {\n hint: \"disabled\",\n description: {\n NL: \"Geeft aan of een attribuut uitgeschakeld is.\",\n EN: \"Indicates a disabled attribute.\",\n },\n link: \"\",\n component: [\"attribute\"],\n },\n HIDE_IN_USER_INTERFACE: {\n hint: \"hide-in-user-interface\",\n description: {\n NL: \"Verberg een tab in de user interface.\",\n EN: \"Hide a tab in the user interface.\",\n },\n link: \"\",\n component: [\"tab\"],\n },\n};\n"],"mappings":";;;;;;AACO,MAAMA,uBAAuB,GAAAC,OAAA,CAAAD,uBAAA,GAAG;EACrCE,SAAS,EAAE;IACTC,IAAI,EAAE,WAAW;IACjBC,WAAW,EAAE;MACXC,EAAE,EAAE,iGAAiG;MACrGC,EAAE,EAAE;IACN,CAAC;IACDC,IAAI,EAAE,EAAE;IACRC,SAAS,EAAE,CAAC,WAAW;EACzB,CAAC;EACDC,2BAA2B,EAAE;IAC3BN,IAAI,EAAE,wCAAwC;IAC9CC,WAAW,EAAE;MACXC,EAAE,EAAE,2MAA2M;MAC/MC,EAAE,EAAE;IACN,CAAC;IACDC,IAAI,EAAE,EAAE;IACRC,SAAS,EAAE,CAAC,mBAAmB,EAAE,kBAAkB;EACrD,CAAC;EACDE,0BAA0B,EAAE;IAC1BP,IAAI,EAAE,mIAAmI;IACzIC,WAAW,EAAE;MACXC,EAAE,EAAE,sGAAsG;MAC1GC,EAAE,EAAE;IACN,CAAC;IACDC,IAAI,EAAE,EAAE;IACRC,SAAS,EAAE,CAAC,WAAW;EACzB,CAAC;EACDG,yBAAyB,EAAE;IACzBR,IAAI,EAAE,2BAA2B;IACjCC,WAAW,EAAE;MACXC,EAAE,EAAE,mEAAmE;MACvEC,EAAE,EAAE;IACN,CAAC;IACDC,IAAI,EAAE,EAAE;IACRC,SAAS,EAAE,CAAC,MAAM;EACpB,CAAC;EACDI,eAAe,EAAE;IACfT,IAAI,EAAE,iBAAiB;IACvBC,WAAW,EAAE;MACXC,EAAE,EAAE,wEAAwE;MAC5EC,EAAE,EAAE;IACN,CAAC;IACDC,IAAI,EAAE,EAAE;IACRC,SAAS,EAAE,CAAC,MAAM;EACpB,CAAC;EACDK,cAAc,EAAE;IACdV,IAAI,EAAE,g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AAE,EAAE,+BAA+B;MACnCC,EAAE,EAAE;IACN,CAAC;IACDE,SAAS,EAAE,CAAC,MAAM;EACpB,CAAC;EACDW,aAAa,EAAE;IACbhB,IAAI,EAAE,QAAQ;IACdC,WAAW,EAAE;MACXC,EAAE,EAAE,+BAA+B;MACnCC,EAAE,EAAE;IACN,CAAC;IACDE,SAAS,EAAE,CAAC,MAAM;EACpB,CAAC;EACDY,aAAa,EAAE;IACbjB,IAAI,EAAE,QAAQ;IACdC,WAAW,EAAE;MACXC,EAAE,EAAE,kCAAkC;MACtCC,EAAE,EAAE;IACN,CAAC;IACDE,SAAS,EAAE,CAAC,MAAM;EACpB,CAAC;EACDa,YAAY,EAAE;IACZlB,IAAI,EAAE,cAAc;IACpBC,WAAW,EAAE;MACXC,EAAE,EAAE,4BAA4B;MAChCC,EAAE,EAAE;IACN,CAAC;IACDE,SAAS,EAAE,CAAC,kBAAkB;EAChC,CAAC;EACDc,aAAa,EAAE;IACbnB,IAAI,EAAE,gBAAgB;IACtBC,WAAW,EAAE;MACXC,EAAE,EAAE,uHAAuH;MAC3HC,EAAE,EAAE;IACN,CAAC;IACDE,SAAS,EAAE,CAAC,qBAAqB,EAAE,sBAAsB;EAC3D,CAAC;EACDe,QAAQ,EAAE;IACRpB,IAAI,EAAE,UAAU;IAChBC,WAAW,EAAE;MACXC,EAAE,EAAE,8CAA8C;MAClDC,EAAE,EAAE;IACN,CAAC;IACDC,IAAI,EAAE,EAAE;IACRC,SAAS,EAAE,CAAC,WAAW;EACzB,CAAC;EACDgB,sBAAsB,EAAE;IACtBrB,IAAI,EAAE,wBAAwB;IAC9BC,WAAW,EAAE;MACXC,EAAE,EAAE,uCAAuC;MAC3CC,EAAE,EAAE;IACN,CAAC;IACDC,IAAI,EAAE,EAAE;IACRC,SAAS,EAAE,CAAC,KAAK;EACnB;AACF,CAAC"}
|
|
1
|
+
{"version":3,"file":"LayoutHintConfig.js","names":["LayoutHintConfiguration","exports","MANDATORY","hint","description","NL","EN","link","component","DEPENDENT_ATTRIBUTE_CONTROL","DEPENDENT_ATTRIBUTE_ACTION","SHOW_ONE_RESULT_AS_DETAIL","HIDE_WHEN_EMPTY","INITIAL_FILTER","CONFIRM_PASSWORD","TITLE","INITIAL_TOTAL_FILESIZE","MAX_TOTAL_FILESIZE","CREATE_ACTION","UPDATE_ACTION","DELETE_ACTION","SORT_OPTIONS","CASEVIEW_LINK","DISABLED","HIDE_IN_USER_INTERFACE","AVATAR_FOR_TITLE","AVATAR"],"sources":["../../src/constants/LayoutHintConfig.js"],"sourcesContent":["// @flow\nexport const LayoutHintConfiguration = {\n MANDATORY: {\n hint: \"mandatory\",\n description: {\n NL: \"Geeft aan of een attribuut verplicht is. Dient samen met de dependency hint gebruikt te worden.\",\n EN: \"Indicates a mandatory attribute.\\nShould be used together with the dependency hint.\",\n },\n link: \"\",\n component: [\"attribute\"],\n },\n DEPENDENT_ATTRIBUTE_CONTROL: {\n hint: \"dependent-control:${unique-control-id}\",\n description: {\n NL: \"Geeft aan dat dit het attribuut is waar attributen van afhankelijk zijn. Het unique-control-id is een uniek id dat kan worden gebruikt in the hint voor de show|hide actie op het afhankelijke attribuut.\",\n EN: \"Marks the choice attribute where other attributes depend on. The unique control id is a unique id that can be used in the hint for the show|hide action on the dependent attribute.\",\n },\n link: \"\",\n component: [\"attribute/boolean\", \"attribute/choice\"],\n },\n DEPENDENT_ATTRIBUTE_ACTION: {\n hint: \"dependent-attribute:(show|hide) when dependent-control:${unique-control-id} (equals|includes|notEquals|notIncludes) [${codemaps}]\",\n description: {\n NL: \"Toon of verberg een attribute dat afhankelijk is van de geselecteerde opties van een keuze attribute\",\n EN: \"To show or hide an attribute dependent on options of the choice control codemap that are selected or not selected.\",\n },\n link: \"\",\n component: [\"attribute\"],\n },\n SHOW_ONE_RESULT_AS_DETAIL: {\n hint: \"show-one-result-as-detail\",\n description: {\n NL: \"Een lijst met maar één item mag direct als detail getoond worden.\",\n EN: \"A list with only one detail must be shown as a detail.\",\n },\n link: \"\",\n component: [\"list\"],\n },\n HIDE_WHEN_EMPTY: {\n hint: \"hide-when-empty\",\n description: {\n NL: \"Een lijst zonder lijst-items en lijst-taken dient niet getoond worden.\",\n EN: \"A list without list-items and list-tasks should not be shown.\",\n },\n link: \"\",\n component: [\"list\"],\n },\n INITIAL_FILTER: {\n hint: \"initial-filter:${filter-name}=${initial-value}\",\n description: {\n NL: \"Laad de lijst met een standaardwaarde voor een filter, er is geen controle op het bestaan van het filter. Als het filter niet is geconfigureerd, treedt er een fout op. Houd er rekening mee dat filters hoofdlettergevoelig zijn.\",\n EN: \"Load the list with a default value for a filter, there is no check for the existence of the filter. If the filter is not configured, an error occurs. Keep in mind that filters are case sensitive.\",\n },\n link: \"\",\n component: [\"list\"],\n },\n CONFIRM_PASSWORD: {\n hint: \"confirm-password\",\n description: {\n NL: \"Wachtwoord attribuut moet bevestigd worden dmv een tweede wachtwoord attribuut.\",\n EN: \"Password attribute must be confirmed using a second password attribute.\",\n },\n link: \"\",\n component: [\"attribute/password\"],\n },\n TITLE: {\n hint: \"title\",\n description: {\n NL: \"Markeert een attribuut als een titel attribuut\",\n EN: \"Marks an attribute as a title attribute\",\n },\n link: \"\",\n component: [\n \"caseview_table\",\n \"codemap\",\n \"list/appointment_table\",\n \"list/assignment_table\",\n \"list/caseproperties_table\",\n \"list/document_table\",\n \"list/timelimit_table\",\n \"list/eventhistory_table\",\n \"list/note_table\",\n \"list/record_table\",\n \"list/case_table\",\n \"list/casesearch_table\",\n \"list/datastore_table\",\n \"list/datastoreview_table\",\n \"list/instrumentresult_table\",\n \"list/event_table\",\n \"list/user_table\",\n \"list/organization_table\",\n ],\n },\n INITIAL_TOTAL_FILESIZE: {\n hint: \"initial-total-file-size\",\n description: {\n NL: \"Wordt gebruikt in samenwerking met een upload attribuut, deze hint moet worden gezet op een readonly attribuut dat de reeds gebruikte file grootte bevat.\",\n EN: \"Used in conjunction with an upload attribute, this hint is set on a read only attribute containing the file size currently used.\",\n },\n link: \"\",\n component: [\"attribute/number\"],\n },\n MAX_TOTAL_FILESIZE: {\n hint: \"max-total-file-size\",\n description: {\n NL: \"Wordt gebruikt in samenwerking met een upload attribuut, deze hint moet worden gezet op een readonly attribuut dat de maximaal toegestane file grootte bevat.\",\n EN: \"Used in conjunction with an upload attribute, this hint is set on a read only attribute containing the maximum allowed total file size.\",\n },\n link: \"\",\n component: [\"attribute/number\"],\n },\n CREATE_ACTION: {\n hint: \"create\",\n description: {\n NL: \"Markeer taak als creëer taak.\",\n EN: \"Mark task as create task\",\n },\n component: [\"form\"],\n },\n UPDATE_ACTION: {\n hint: \"update\",\n description: {\n NL: \"Markeer taak als bewerk taak.\",\n EN: \"Mark task as update task\",\n },\n component: [\"form\"],\n },\n DELETE_ACTION: {\n hint: \"delete\",\n description: {\n NL: \"Markeer taak als verwijder taak.\",\n EN: \"Mark task as delete task\",\n },\n component: [\"form\"],\n },\n SORT_OPTIONS: {\n hint: \"sort-options\",\n description: {\n NL: \"Sorteer opties alfabetisch\",\n EN: \"Sort options alphabetically\",\n },\n component: [\"attribute/choice\"],\n },\n CASEVIEW_LINK: {\n hint: \"case-view-link\",\n description: {\n NL: \"Markeer een case id reference attribute als de referentie naar de case view. Vervangt de self link van een lijst item\",\n EN: \"Mark a case id reference attribute as the reference to the case view. Replaces the self link of a list item\",\n },\n component: [\"attribute/reference\", \"list/datastore_table\"],\n },\n DISABLED: {\n hint: \"disabled\",\n description: {\n NL: \"Geeft aan of een attribuut uitgeschakeld is.\",\n EN: \"Indicates a disabled attribute.\",\n },\n link: \"\",\n component: [\"attribute\"],\n },\n HIDE_IN_USER_INTERFACE: {\n hint: \"hide-in-user-interface\",\n description: {\n NL: \"Verberg een tab in de user interface.\",\n EN: \"Hide a tab in the user interface.\",\n },\n link: \"\",\n component: [\"tab\"],\n },\n AVATAR_FOR_TITLE: {\n hint: \"avatar-for-title\",\n description: {\n NL: \"Markeert een attribuut als een avatar voor het titelattribuut.\",\n EN: \"Marks an attribute as an avatar for the title attribute.\",\n },\n link: \"\",\n component: [\n \"caseview_table\",\n \"codemap\",\n \"list/appointment_table\",\n \"list/assignment_table\",\n \"list/caseproperties_table\",\n \"list/document_table\",\n \"list/timelimit_table\",\n \"list/eventhistory_table\",\n \"list/note_table\",\n \"list/record_table\",\n \"list/case_table\",\n \"list/casesearch_table\",\n \"list/datastore_table\",\n \"list/datastoreview_table\",\n \"list/instrumentresult_table\",\n \"list/event_table\",\n \"list/user_table\",\n \"list/organization_table\",\n ],\n },\n AVATAR: {\n hint: \"avatar\",\n description: {\n NL: \"Geef het attribuut weer als de avatar van de gebruiker.\",\n EN: \"Render the attribute as the user's avatar.\",\n },\n link: \"\",\n component: [\n \"caseview_table\",\n \"codemap\",\n \"list/appointment_table\",\n \"list/assignment_table\",\n \"list/caseproperties_table\",\n \"list/document_table\",\n \"list/timelimit_table\",\n \"list/eventhistory_table\",\n \"list/note_table\",\n \"list/record_table\",\n \"list/case_table\",\n \"list/casesearch_table\",\n \"list/datastore_table\",\n \"list/datastoreview_table\",\n \"list/instrumentresult_table\",\n \"list/event_table\",\n \"list/user_table\",\n \"list/organization_table\",\n ],\n },\n};\n"],"mappings":";;;;;;AACO,MAAMA,uBAAuB,GAAAC,OAAA,CAAAD,uBAAA,GAAG;EACrCE,SAAS,EAAE;IACTC,IAAI,EAAE,WAAW;IACjBC,WAAW,EAAE;MACXC,EAAE,EAAE,iGAAiG;MACrGC,EAAE,EAAE;IACN,CAAC;IACDC,IAAI,EAAE,EAAE;IACRC,SAAS,EAAE,CAAC,WAAW;EACzB,CAAC;EACDC,2BAA2B,EAAE;IAC3BN,IAAI,EAAE,wCAAwC;IAC9CC,WAAW,EAAE;MACXC,EAAE,EAAE,2MAA2M;MAC/MC,EAAE,EAAE;IACN,CAAC;IACDC,IAAI,EAAE,EAAE;IACRC,SAAS,EAAE,CAAC,mBAAmB,EAAE,kBAAkB;EACrD,CAAC;EACDE,0BAA0B,EAAE;IAC1BP,IAAI,EAAE,mIAAmI;IACzIC,WAAW,E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,sBAAsB,EACtB,0BAA0B,EAC1B,6BAA6B,EAC7B,kBAAkB,EAClB,iBAAiB,EACjB,yBAAyB;EAE7B;AACF,CAAC"}
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.getLayoutHintConfiguration = exports.default = exports.UPDATE_ACTION = exports.TITLE = exports.SORT_OPTIONS = exports.SHOW_ONE_RESULT_AS_DETAIL = exports.RENDER_SECTION_LABEL = exports.MAX_TOTAL_FILESIZE = exports.MANDATORY = exports.INITIAL_TOTAL_FILESIZE = exports.INITIAL_FILTER = exports.HIDE_WHEN_EMPTY = exports.HIDE_IN_USER_INTERFACE = exports.DISABLED = exports.DEPENDENT_ATTRIBUTE_CONTROL = exports.DEPENDENT_ATTRIBUTE = exports.DELETE_ACTION = exports.CREATE_ACTION = exports.CONFIRM_PASSWORD = exports.CASEVIEW_LINK = void 0;
|
|
6
|
+
exports.getLayoutHintConfiguration = exports.default = exports.UPDATE_ACTION = exports.TITLE = exports.SORT_OPTIONS = exports.SHOW_ONE_RESULT_AS_DETAIL = exports.RENDER_SECTION_LABEL = exports.MAX_TOTAL_FILESIZE = exports.MANDATORY = exports.INITIAL_TOTAL_FILESIZE = exports.INITIAL_FILTER = exports.HIDE_WHEN_EMPTY = exports.HIDE_IN_USER_INTERFACE = exports.DISABLED = exports.DEPENDENT_ATTRIBUTE_CONTROL = exports.DEPENDENT_ATTRIBUTE = exports.DELETE_ACTION = exports.CREATE_ACTION = exports.CONFIRM_PASSWORD = exports.CASEVIEW_LINK = exports.AVATAR_FOR_TITLE = exports.AVATAR = void 0;
|
|
7
7
|
var _LayoutHintConfig = require("./LayoutHintConfig");
|
|
8
8
|
/**
|
|
9
9
|
* Retrieve layout hint by id from the layout hint configuration
|
|
@@ -124,6 +124,12 @@ const HIDE_IN_USER_INTERFACE = exports.HIDE_IN_USER_INTERFACE = getHint("HIDE_IN
|
|
|
124
124
|
/**
|
|
125
125
|
*/
|
|
126
126
|
const getLayoutHintConfiguration = () => _LayoutHintConfig.LayoutHintConfiguration;
|
|
127
|
+
|
|
128
|
+
/**
|
|
129
|
+
* Layout-hint: Marks an attribute as an avatar for the title attribute.
|
|
130
|
+
*/
|
|
127
131
|
exports.getLayoutHintConfiguration = getLayoutHintConfiguration;
|
|
132
|
+
const AVATAR_FOR_TITLE = exports.AVATAR_FOR_TITLE = getHint("AVATAR_FOR_TITLE");
|
|
133
|
+
const AVATAR = exports.AVATAR = getHint("AVATAR");
|
|
128
134
|
var _default = exports.default = getHint;
|
|
129
135
|
//# sourceMappingURL=LayoutHints.js.map
|
|
@@ -124,4 +124,11 @@ export const HIDE_IN_USER_INTERFACE: string = getHint("HIDE_IN_USER_INTERFACE");
|
|
|
124
124
|
*/
|
|
125
125
|
export const getLayoutHintConfiguration = (): Object => LayoutHintConfiguration;
|
|
126
126
|
|
|
127
|
+
/**
|
|
128
|
+
* Layout-hint: Marks an attribute as an avatar for the title attribute.
|
|
129
|
+
*/
|
|
130
|
+
export const AVATAR_FOR_TITLE: string = getHint("AVATAR_FOR_TITLE");
|
|
131
|
+
|
|
132
|
+
export const AVATAR: string = getHint("AVATAR");
|
|
133
|
+
|
|
127
134
|
export default getHint;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LayoutHints.js","names":["_LayoutHintConfig","require","getHint","hint","LayoutHintConfiguration","MANDATORY","exports","DISABLED","DEPENDENT_ATTRIBUTE_CONTROL","DEPENDENT_ATTRIBUTE","CONFIRM_PASSWORD","SORT_OPTIONS","TITLE","DELETE_ACTION","UPDATE_ACTION","CREATE_ACTION","INITIAL_TOTAL_FILESIZE","MAX_TOTAL_FILESIZE","SHOW_ONE_RESULT_AS_DETAIL","HIDE_WHEN_EMPTY","INITIAL_FILTER","CASEVIEW_LINK","RENDER_SECTION_LABEL","HIDE_IN_USER_INTERFACE","getLayoutHintConfiguration","_default","default"],"sources":["../../src/constants/LayoutHints.js"],"sourcesContent":["// @flow\nimport { LayoutHintConfiguration } from \"./LayoutHintConfig\";\n\n/**\n * Retrieve layout hint by id from the layout hint configuration\n */\nconst getHint = (hint: string): string => {\n if (LayoutHintConfiguration[hint]) {\n return LayoutHintConfiguration[hint].hint;\n }\n\n return \"\";\n};\n\n/**\n * Layout-hint: Indicates a mandatory attribute. Should be used together with the dependency hint.\n */\nexport const MANDATORY: string = getHint(\"MANDATORY\");\n\n/**\n * Layout-hint: Indicates a disabled attribute.\n * @constant\n */\nexport const DISABLED: string = getHint(\"DISABLED\");\n\n/*\n * --------------------------------\n * SELECT DEPENDENT ATTRIBUTES\n * --------------------------------\n */\n/**\n * Layout-hint: Marks the choice attribute where other attributes depend on. The unique control id is a unique id that can be used in the hint for the show|hide action on the dependent attribute.\n */\nexport const DEPENDENT_ATTRIBUTE_CONTROL = \"dependent-control\";\n/**\n */\nexport const DEPENDENT_ATTRIBUTE = \"dependent-attribute:\";\n\n/*\n * --------------------------------\n * ATTRIBUTES\n * --------------------------------\n */\n/**\n * Layout-hint: Password attribute must be confirmed using a second password attribute.\n */\nexport const CONFIRM_PASSWORD: string = getHint(\"CONFIRM_PASSWORD\");\n/**\n * Layout-hint: Sort options alphabetically\n */\nexport const SORT_OPTIONS: string = getHint(\"SORT_OPTIONS\");\n/**\n * Layout-hint: Marks an attribute as a title attribute\n */\nexport const TITLE: string = getHint(\"TITLE\");\n\n/*\n * --------------------------------\n * FORM\n * --------------------------------\n */\n/**\n * Layout-hint: Mark task as delete task\n */\nexport const DELETE_ACTION: string = getHint(\"DELETE_ACTION\");\n/**\n * Layout-hint: Mark task as update task\n */\nexport const UPDATE_ACTION: string = getHint(\"UPDATE_ACTION\");\n/**\n * Layout-hint: Mark task as create task\n */\nexport const CREATE_ACTION: string = getHint(\"CREATE_ACTION\");\n\n/*\n * --------------------------------\n * UPLOAD TOTAL FILE SIZE\n * --------------------------------\n */\n/**\n * Layout-hint: Used in conjunction with an upload attribute, this hint is set on a read only attribute containing the file size currently used.\n */\nexport const INITIAL_TOTAL_FILESIZE: string = getHint(\"INITIAL_TOTAL_FILESIZE\");\n/**\n * Layout-hint: Used in conjunction with an upload attribute, this hint is set on a read only attribute containing the maximum allowed total file size.\n */\nexport const MAX_TOTAL_FILESIZE: string = getHint(\"MAX_TOTAL_FILESIZE\");\n\n/*\n * --------------------------------\n * LISTS\n * --------------------------------\n */\n/**\n * Layout-hint: A list with only one detail must be shown as a detail\n */\nexport const SHOW_ONE_RESULT_AS_DETAIL: string = getHint(\n \"SHOW_ONE_RESULT_AS_DETAIL\",\n);\n/**\n * Layout-hint: A list without list-items and list-tasks should not be shown.\n */\nexport const HIDE_WHEN_EMPTY: string = getHint(\"HIDE_WHEN_EMPTY\");\n/**\n * Layout-hint: Sets a default value on a filter\n */\nexport const INITIAL_FILTER: string = \"initial-filter:\";\n/**\n * Layout-hint: Mark a case id reference attribute as the reference to the case view. Replaces the self link of a list item\n */\nexport const CASEVIEW_LINK: string = getHint(\"CASEVIEW_LINK\");\n\n/**\n * Layout-hint: Set on configuration of instruments to show content in a popover on a label\n */\nexport const RENDER_SECTION_LABEL = \"render-section-label\";\n\n/**\n * Layout-hint: Hide a link to a component\n */\nexport const HIDE_IN_USER_INTERFACE: string = getHint(\"HIDE_IN_USER_INTERFACE\");\n\n/**\n */\nexport const getLayoutHintConfiguration = (): Object => LayoutHintConfiguration;\n\nexport default getHint;\n"],"mappings":";;;;;;AACA,IAAAA,iBAAA,GAAAC,OAAA;AAEA;AACA;AACA;AACA,MAAMC,OAAO,GAAIC,IAAY,IAAa;EACxC,IAAIC,yCAAuB,CAACD,IAAI,CAAC,EAAE;IACjC,OAAOC,yCAAuB,CAACD,IAAI,CAAC,CAACA,IAAI;EAC3C;EAEA,OAAO,EAAE;AACX,CAAC;;AAED;AACA;AACA;AACO,MAAME,SAAiB,GAAAC,OAAA,CAAAD,SAAA,GAAGH,OAAO,CAAC,WAAW,CAAC;;AAErD;AACA;AACA;AACA;AACO,MAAMK,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AAMiB,eAAuB,GAAAb,OAAA,CAAAa,eAAA,GAAGjB,OAAO,CAAC,iBAAiB,CAAC;AACjE;AACA;AACA;AACO,MAAMkB,cAAsB,GAAAd,OAAA,CAAAc,cAAA,GAAG,iBAAiB;AACvD;AACA;AACA;AACO,MAAMC,aAAqB,GAAAf,OAAA,CAAAe,aAAA,GAAGnB,OAAO,CAAC,eAAe,CAAC;;AAE7D;AACA;AACA;AACO,MAAMoB,oBAAoB,GAAAhB,OAAA,CAAAgB,oBAAA,GAAG,sBAAsB;;AAE1D;AACA;AACA;AACO,MAAMC,sBAA8B,GAAAjB,OAAA,CAAAiB,sBAAA,GAAGrB,OAAO,CAAC,wBAAwB,CAAC;;AAE/E;AACA;AACO,MAAMsB,0BAA0B,GAAGA,CAAA,KAAcpB,yCAAuB;
|
|
1
|
+
{"version":3,"file":"LayoutHints.js","names":["_LayoutHintConfig","require","getHint","hint","LayoutHintConfiguration","MANDATORY","exports","DISABLED","DEPENDENT_ATTRIBUTE_CONTROL","DEPENDENT_ATTRIBUTE","CONFIRM_PASSWORD","SORT_OPTIONS","TITLE","DELETE_ACTION","UPDATE_ACTION","CREATE_ACTION","INITIAL_TOTAL_FILESIZE","MAX_TOTAL_FILESIZE","SHOW_ONE_RESULT_AS_DETAIL","HIDE_WHEN_EMPTY","INITIAL_FILTER","CASEVIEW_LINK","RENDER_SECTION_LABEL","HIDE_IN_USER_INTERFACE","getLayoutHintConfiguration","AVATAR_FOR_TITLE","AVATAR","_default","default"],"sources":["../../src/constants/LayoutHints.js"],"sourcesContent":["// @flow\nimport { LayoutHintConfiguration } from \"./LayoutHintConfig\";\n\n/**\n * Retrieve layout hint by id from the layout hint configuration\n */\nconst getHint = (hint: string): string => {\n if (LayoutHintConfiguration[hint]) {\n return LayoutHintConfiguration[hint].hint;\n }\n\n return \"\";\n};\n\n/**\n * Layout-hint: Indicates a mandatory attribute. Should be used together with the dependency hint.\n */\nexport const MANDATORY: string = getHint(\"MANDATORY\");\n\n/**\n * Layout-hint: Indicates a disabled attribute.\n * @constant\n */\nexport const DISABLED: string = getHint(\"DISABLED\");\n\n/*\n * --------------------------------\n * SELECT DEPENDENT ATTRIBUTES\n * --------------------------------\n */\n/**\n * Layout-hint: Marks the choice attribute where other attributes depend on. The unique control id is a unique id that can be used in the hint for the show|hide action on the dependent attribute.\n */\nexport const DEPENDENT_ATTRIBUTE_CONTROL = \"dependent-control\";\n/**\n */\nexport const DEPENDENT_ATTRIBUTE = \"dependent-attribute:\";\n\n/*\n * --------------------------------\n * ATTRIBUTES\n * --------------------------------\n */\n/**\n * Layout-hint: Password attribute must be confirmed using a second password attribute.\n */\nexport const CONFIRM_PASSWORD: string = getHint(\"CONFIRM_PASSWORD\");\n/**\n * Layout-hint: Sort options alphabetically\n */\nexport const SORT_OPTIONS: string = getHint(\"SORT_OPTIONS\");\n/**\n * Layout-hint: Marks an attribute as a title attribute\n */\nexport const TITLE: string = getHint(\"TITLE\");\n\n/*\n * --------------------------------\n * FORM\n * --------------------------------\n */\n/**\n * Layout-hint: Mark task as delete task\n */\nexport const DELETE_ACTION: string = getHint(\"DELETE_ACTION\");\n/**\n * Layout-hint: Mark task as update task\n */\nexport const UPDATE_ACTION: string = getHint(\"UPDATE_ACTION\");\n/**\n * Layout-hint: Mark task as create task\n */\nexport const CREATE_ACTION: string = getHint(\"CREATE_ACTION\");\n\n/*\n * --------------------------------\n * UPLOAD TOTAL FILE SIZE\n * --------------------------------\n */\n/**\n * Layout-hint: Used in conjunction with an upload attribute, this hint is set on a read only attribute containing the file size currently used.\n */\nexport const INITIAL_TOTAL_FILESIZE: string = getHint(\"INITIAL_TOTAL_FILESIZE\");\n/**\n * Layout-hint: Used in conjunction with an upload attribute, this hint is set on a read only attribute containing the maximum allowed total file size.\n */\nexport const MAX_TOTAL_FILESIZE: string = getHint(\"MAX_TOTAL_FILESIZE\");\n\n/*\n * --------------------------------\n * LISTS\n * --------------------------------\n */\n/**\n * Layout-hint: A list with only one detail must be shown as a detail\n */\nexport const SHOW_ONE_RESULT_AS_DETAIL: string = getHint(\n \"SHOW_ONE_RESULT_AS_DETAIL\",\n);\n/**\n * Layout-hint: A list without list-items and list-tasks should not be shown.\n */\nexport const HIDE_WHEN_EMPTY: string = getHint(\"HIDE_WHEN_EMPTY\");\n/**\n * Layout-hint: Sets a default value on a filter\n */\nexport const INITIAL_FILTER: string = \"initial-filter:\";\n/**\n * Layout-hint: Mark a case id reference attribute as the reference to the case view. Replaces the self link of a list item\n */\nexport const CASEVIEW_LINK: string = getHint(\"CASEVIEW_LINK\");\n\n/**\n * Layout-hint: Set on configuration of instruments to show content in a popover on a label\n */\nexport const RENDER_SECTION_LABEL = \"render-section-label\";\n\n/**\n * Layout-hint: Hide a link to a component\n */\nexport const HIDE_IN_USER_INTERFACE: string = getHint(\"HIDE_IN_USER_INTERFACE\");\n\n/**\n */\nexport const getLayoutHintConfiguration = (): Object => LayoutHintConfiguration;\n\n/**\n * Layout-hint: Marks an attribute as an avatar for the title attribute.\n */\nexport const AVATAR_FOR_TITLE: string = getHint(\"AVATAR_FOR_TITLE\");\n\nexport const AVATAR: string = getHint(\"AVATAR\");\n\nexport default getHint;\n"],"mappings":";;;;;;AACA,IAAAA,iBAAA,GAAAC,OAAA;AAEA;AACA;AACA;AACA,MAAMC,OAAO,GAAIC,IAAY,IAAa;EACxC,IAAIC,yCAAuB,CAACD,IAAI,CAAC,EAAE;IACjC,OAAOC,yCAAuB,CAACD,IAAI,CAAC,CAACA,IAAI;EAC3C;EAEA,OAAO,EAAE;AACX,CAAC;;AAED;AACA;AACA;AACO,MAAME,SAAiB,GAAAC,OAAA,CAAAD,SAAA,GAAGH,OAAO,CAAC,WAAW,CAAC;;AAErD;AACA;AACA;AACA;AACO,MAAMK,QAAgB,GAAAD,OAAA,CAAAC,QAAA,GAAGL,OAAO,CAAC,UAAU,CAAC;;AAEnD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,MAAMM,2BAA2B,GAAAF,OAAA,CAAAE,2BAAA,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vD;AACA;AACA;AACO,MAAMC,aAAqB,GAAAf,OAAA,CAAAe,aAAA,GAAGnB,OAAO,CAAC,eAAe,CAAC;;AAE7D;AACA;AACA;AACO,MAAMoB,oBAAoB,GAAAhB,OAAA,CAAAgB,oBAAA,GAAG,sBAAsB;;AAE1D;AACA;AACA;AACO,MAAMC,sBAA8B,GAAAjB,OAAA,CAAAiB,sBAAA,GAAGrB,OAAO,CAAC,wBAAwB,CAAC;;AAE/E;AACA;AACO,MAAMsB,0BAA0B,GAAGA,CAAA,KAAcpB,yCAAuB;;AAE/E;AACA;AACA;AAFAE,OAAA,CAAAkB,0BAAA,GAAAA,0BAAA;AAGO,MAAMC,gBAAwB,GAAAnB,OAAA,CAAAmB,gBAAA,GAAGvB,OAAO,CAAC,kBAAkB,CAAC;AAE5D,MAAMwB,MAAc,GAAApB,OAAA,CAAAoB,MAAA,GAAGxB,OAAO,CAAC,QAAQ,CAAC;AAAC,IAAAyB,QAAA,GAAArB,OAAA,CAAAsB,OAAA,GAEjC1B,OAAO"}
|
|
@@ -10,6 +10,7 @@ var _includes = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-s
|
|
|
10
10
|
var _filter = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/filter"));
|
|
11
11
|
var _keys = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/object/keys"));
|
|
12
12
|
var _map = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/map"));
|
|
13
|
+
var _find = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/find"));
|
|
13
14
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/defineProperty"));
|
|
14
15
|
var _objects = require("../../utils/helpers/objects");
|
|
15
16
|
var _ActionCollection = _interopRequireDefault(require("../actions/ActionCollection"));
|
|
@@ -108,7 +109,12 @@ class DetailModel extends _ResourceModel.default {
|
|
|
108
109
|
*/
|
|
109
110
|
get attributes() {
|
|
110
111
|
var _context3;
|
|
111
|
-
return (0, _filter.default)(_context3 = this.attributeCollection.all).call(_context3, attribute =>
|
|
112
|
+
return (0, _filter.default)(_context3 = this.attributeCollection.all).call(_context3, attribute => {
|
|
113
|
+
const hasTitle = attribute.layouthint.hasExact(_LayoutHints.TITLE);
|
|
114
|
+
const hasAvatar = attribute.layouthint.hasExact(_LayoutHints.AVATAR);
|
|
115
|
+
const hasAvatarForTitle = attribute.layouthint.hasExact(_LayoutHints.AVATAR_FOR_TITLE);
|
|
116
|
+
return !attribute.isHidden && (!hasTitle || hasTitle && hasAvatar) && (!hasAvatarForTitle || hasAvatarForTitle && !hasAvatar);
|
|
117
|
+
});
|
|
112
118
|
}
|
|
113
119
|
|
|
114
120
|
/**
|
|
@@ -167,11 +173,24 @@ class DetailModel extends _ResourceModel.default {
|
|
|
167
173
|
return this.contributions.resourcetype === "CaseView";
|
|
168
174
|
}
|
|
169
175
|
|
|
176
|
+
/**
|
|
177
|
+
* Getting the attribute that has as layout hint 'avatar-for-title'
|
|
178
|
+
*/
|
|
179
|
+
get avatarForTitleAttribute() {
|
|
180
|
+
var _context5;
|
|
181
|
+
const avatarAttributes = (0, _filter.default)(_context5 = this._attributeCollection.all).call(_context5, attribute => attribute.layouthint.hasExact(_LayoutHints.AVATAR));
|
|
182
|
+
const avatarForTitleAttribute = (0, _find.default)(avatarAttributes).call(avatarAttributes, attribute => attribute.layouthint.hasExact(_LayoutHints.AVATAR_FOR_TITLE));
|
|
183
|
+
return avatarForTitleAttribute || null;
|
|
184
|
+
}
|
|
185
|
+
|
|
170
186
|
/**
|
|
171
187
|
* Getting the attribute that has as layout hint 'title'
|
|
172
188
|
*/
|
|
173
189
|
get titleAttribute() {
|
|
174
|
-
|
|
190
|
+
var _context6;
|
|
191
|
+
const nonAvatarAttributes = (0, _filter.default)(_context6 = this._attributeCollection.all).call(_context6, attribute => !attribute.layouthint.hasExact(_LayoutHints.AVATAR));
|
|
192
|
+
const titleAttribute = (0, _find.default)(nonAvatarAttributes).call(nonAvatarAttributes, attribute => attribute.layouthint.has(_LayoutHints.TITLE));
|
|
193
|
+
return titleAttribute || null;
|
|
175
194
|
}
|
|
176
195
|
|
|
177
196
|
/**
|
|
@@ -5,7 +5,7 @@ import ActionCollection from "../actions/ActionCollection";
|
|
|
5
5
|
import AttributeCollection from "../attributes/AttributeCollection";
|
|
6
6
|
import ResourceModel from "../base/ResourceModel";
|
|
7
7
|
|
|
8
|
-
import { TITLE } from "../../constants/LayoutHints";
|
|
8
|
+
import { AVATAR, AVATAR_FOR_TITLE, TITLE } from "../../constants/LayoutHints";
|
|
9
9
|
|
|
10
10
|
import type { ModularUIResponse } from "../../modularui";
|
|
11
11
|
import type { ModularUIModel, AttributeType } from "../types";
|
|
@@ -115,9 +115,16 @@ export default class DetailModel extends ResourceModel {
|
|
|
115
115
|
* Retrieve list of visible attributes
|
|
116
116
|
*/
|
|
117
117
|
get attributes(): Array<AttributeType> {
|
|
118
|
-
return this.attributeCollection.all.filter(
|
|
119
|
-
|
|
120
|
-
|
|
118
|
+
return this.attributeCollection.all.filter((attribute) => {
|
|
119
|
+
const hasTitle = attribute.layouthint.hasExact(TITLE);
|
|
120
|
+
const hasAvatar = attribute.layouthint.hasExact(AVATAR);
|
|
121
|
+
const hasAvatarForTitle = attribute.layouthint.hasExact(AVATAR_FOR_TITLE);
|
|
122
|
+
return (
|
|
123
|
+
!attribute.isHidden &&
|
|
124
|
+
(!hasTitle || (hasTitle && hasAvatar)) &&
|
|
125
|
+
(!hasAvatarForTitle || (hasAvatarForTitle && !hasAvatar))
|
|
126
|
+
);
|
|
127
|
+
});
|
|
121
128
|
}
|
|
122
129
|
|
|
123
130
|
/**
|
|
@@ -185,11 +192,34 @@ export default class DetailModel extends ResourceModel {
|
|
|
185
192
|
return this.contributions.resourcetype === "CaseView";
|
|
186
193
|
}
|
|
187
194
|
|
|
195
|
+
/**
|
|
196
|
+
* Getting the attribute that has as layout hint 'avatar-for-title'
|
|
197
|
+
*/
|
|
198
|
+
get avatarForTitleAttribute(): ?AttributeType {
|
|
199
|
+
const avatarAttributes = this._attributeCollection.all.filter((attribute) =>
|
|
200
|
+
attribute.layouthint.hasExact(AVATAR),
|
|
201
|
+
);
|
|
202
|
+
|
|
203
|
+
const avatarForTitleAttribute = avatarAttributes.find((attribute) =>
|
|
204
|
+
attribute.layouthint.hasExact(AVATAR_FOR_TITLE),
|
|
205
|
+
);
|
|
206
|
+
|
|
207
|
+
return avatarForTitleAttribute || null;
|
|
208
|
+
}
|
|
209
|
+
|
|
188
210
|
/**
|
|
189
211
|
* Getting the attribute that has as layout hint 'title'
|
|
190
212
|
*/
|
|
191
213
|
get titleAttribute(): ?AttributeType {
|
|
192
|
-
|
|
214
|
+
const nonAvatarAttributes = this._attributeCollection.all.filter(
|
|
215
|
+
(attribute) => !attribute.layouthint.hasExact(AVATAR),
|
|
216
|
+
);
|
|
217
|
+
|
|
218
|
+
const titleAttribute = nonAvatarAttributes.find((attribute) =>
|
|
219
|
+
attribute.layouthint.has(TITLE),
|
|
220
|
+
);
|
|
221
|
+
|
|
222
|
+
return titleAttribute || null;
|
|
193
223
|
}
|
|
194
224
|
|
|
195
225
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DetailModel.js","names":["_objects","require","_ActionCollection","_interopRequireDefault","_AttributeCollection","_ResourceModel","_LayoutHints","DetailModel","ResourceModel","constructor","modularuiResponse","_defineProperty2","default","createAttributeCollection","createMetadataCollection","createActionCollection","type","modelName","isApplicableModel","data","_context","resourceType","contributions","resourcetype","_endsWith","call","_includes","getInitialChildModelLinks","_attributeCollection","setChildModels","models","id","getData","key","label","getContribution","_context2","attributeContributions","attributes","_filter","contribution","_keys","has","attributeCollection","AttributeCollection","collection","_context3","all","attribute","layouthint","TITLE","isHidden","getAttributeByKey","_context4","metadataContributions","metadata","_map","metadataKey","metadataCollection","_metadataCollection","_actionCollection","ActionCollection","actions","actionCollection","isCase","titleAttribute","getAttributeByLayoutHint","update","model","clonedModel","clone","equals","toString","exports"],"sources":["../../../src/models/detail/DetailModel.js"],"sourcesContent":["// @flow\nimport { has } from \"../../utils/helpers/objects\";\n\nimport ActionCollection from \"../actions/ActionCollection\";\nimport AttributeCollection from \"../attributes/AttributeCollection\";\nimport ResourceModel from \"../base/ResourceModel\";\n\nimport { TITLE } from \"../../constants/LayoutHints\";\n\nimport type { ModularUIResponse } from \"../../modularui\";\nimport type { ModularUIModel, AttributeType } from \"../types\";\nimport type LinkModel from \"../links/LinkModel\";\n\n/**\n * Base class for details<br/>\n * For instance the details of case 1<br/>\n * For instance the details of record 12<br/>\n */\nexport default class DetailModel extends ResourceModel {\n _attributeCollection: AttributeCollection;\n _metadataCollection: AttributeCollection;\n _actionCollection: ActionCollection;\n\n /**\n */\n constructor(modularuiResponse: ModularUIResponse) {\n super(modularuiResponse);\n\n this.createAttributeCollection();\n this.createMetadataCollection();\n this.createActionCollection();\n }\n\n /**\n */\n get type(): string {\n return \"Detail\";\n }\n\n /**\n */\n static get modelName(): string {\n return \"DetailModel\";\n }\n\n /**\n */\n static isApplicableModel(data: ModularUIResponse): boolean {\n const resourceType = data.contributions?.resourcetype;\n return (\n resourceType &&\n (resourceType.endsWith(\"DetailPanel\") ||\n [\"Detail\", \"CasePropertiesPanel\", \"CasePropertiesPanelDetail\"].includes(\n resourceType,\n ))\n );\n }\n\n /**\n */\n getInitialChildModelLinks(): Array<LinkModel> {\n return this._attributeCollection.getInitialChildModelLinks();\n }\n\n /**\n */\n setChildModels(models: Array<ModularUIModel>) {\n this._attributeCollection.setChildModels(models);\n }\n\n /**\n * Getting the unique identifier of the details\n */\n get id(): string {\n return this.getData(\"_id\", this.key);\n }\n\n /**\n */\n get label(): string {\n return this.getContribution(\"label\", \"\");\n }\n\n /**\n * Attribute collection\n */\n createAttributeCollection() {\n const attributeContributions = this.contributions.attributes\n ? this.contributions.attributes.filter((contribution) => {\n const [key] = Object.keys(contribution);\n return has(this.data, key);\n })\n : [];\n\n this.attributeCollection = new AttributeCollection(\n this.data,\n attributeContributions,\n true,\n );\n }\n\n /**\n */\n get attributeCollection(): AttributeCollection {\n return this._attributeCollection;\n }\n\n /**\n */\n set attributeCollection(collection: AttributeCollection) {\n this._attributeCollection = collection;\n }\n\n /**\n * Retrieve list of visible attributes\n */\n get attributes(): Array<AttributeType> {\n return this.attributeCollection.all.filter(\n (attribute) => !attribute.layouthint.has(TITLE) && !attribute.isHidden,\n );\n }\n\n /**\n * Retrieve an attribute by it's key\n */\n getAttributeByKey(key: string): AttributeType | null {\n return this._attributeCollection.getAttributeByKey(key);\n }\n\n /**\n * Metadata collection\n */\n createMetadataCollection() {\n const metadataContributions = this.contributions.metadata\n ? Object.keys(this.contributions.metadata).map((metadataKey) => ({\n [metadataKey]: this.contributions.metadata[metadataKey],\n }))\n : [];\n\n this.metadataCollection = new AttributeCollection(\n this.data,\n metadataContributions,\n true,\n );\n }\n\n /**\n */\n get metadataCollection(): AttributeCollection {\n return this._metadataCollection;\n }\n\n /**\n */\n set metadataCollection(collection: AttributeCollection) {\n this._metadataCollection = collection;\n }\n\n /**\n * Action collection\n */\n createActionCollection() {\n this._actionCollection = new ActionCollection(\n this.data.actions,\n this.contributions.actions,\n );\n }\n\n /**\n */\n get actionCollection(): ActionCollection {\n return this._actionCollection;\n }\n\n /**\n */\n set actionCollection(actionCollection: ActionCollection) {\n this._actionCollection = actionCollection;\n }\n\n /**\n * Determines if this is a case\n */\n get isCase(): boolean {\n return this.contributions.resourcetype === \"CaseView\";\n }\n\n /**\n * Getting the attribute that has as layout hint 'title'\n */\n get titleAttribute(): ?AttributeType {\n return this._attributeCollection.getAttributeByLayoutHint(TITLE);\n }\n\n /**\n * Update current detail with a new detail model and return a cloned version of the model\n */\n update(model: ModularUIModel): DetailModel {\n if (model instanceof DetailModel) {\n const clonedModel = this.clone();\n\n clonedModel.attributeCollection = model._attributeCollection;\n clonedModel.metadataCollection = model._metadataCollection;\n clonedModel.actionCollection = model._actionCollection;\n\n return clonedModel;\n }\n\n return this;\n }\n\n /**\n */\n equals(model: DetailModel): boolean {\n return this.id.toString() === model.id.toString();\n }\n}\n"],"mappings":";;;;;;;;;;;;;AACA,IAAAA,QAAA,GAAAC,OAAA;AAEA,IAAAC,iBAAA,GAAAC,sBAAA,CAAAF,OAAA;AACA,IAAAG,oBAAA,GAAAD,sBAAA,CAAAF,OAAA;AACA,IAAAI,cAAA,GAAAF,sBAAA,CAAAF,OAAA;AAEA,IAAAK,YAAA,GAAAL,OAAA;AAMA;AACA;AACA;AACA;AACA;AACe,MAAMM,WAAW,SAASC,sBAAa,CAAC;EAKrD;AACF;EACEC,WAAWA,CAACC,iBAAoC,EAAE;IAChD,KAAK,CAACA,iBAAiB,CAAC;IAAC,IAAAC,gBAAA,CAAAC,OAAA;IAAA,IAAAD,gBAAA,CAAAC,OAAA;IAAA,IAAAD,gBAAA,CAAAC,OAAA;IAEzB,IAAI,CAACC,yBAAyB,CAAC,CAAC;IAChC,IAAI,CAACC,wBAAwB,CAAC,CAAC;IAC/B,IAAI,CAACC,sBAAsB,CAAC,CAAC;EAC/B;;EAEA;AACF;EACE,IAAIC,IAAIA,CAAA,EAAW;IACjB,OAAO,QAAQ;EACjB;;EAEA;AACF;EACE,WAAWC,SAASA,CAAA,EAAW;IAC7B,OAAO,aAAa;EACtB;;EAEA;AACF;EACE,OAAOC,iBAAiBA,CAACC,IAAuB,EAAW;IAAA,IAAAC,QAAA;IACzD,MAAMC,YAAY,GAAGF,IAAI,CAACG,aAAa,EAAEC,YAAY;IACrD,OACEF,YAAY,KACX,IAAAG,SAAA,CAAAZ,OAAA,EAAAS,YAAY,EAAAI,IAAA,CAAZJ,YAAY,EAAU,aAAa,CAAC,IACnC,IAAAK,SAAA,CAAAd,OAAA,EAAAQ,QAAA,IAAC,QAAQ,EAAE,qBAAqB,EAAE,2BAA2B,CAAC,EAAAK,IAAA,CAAAL,QAAA,EAC5DC,YACF,CAAC,CAAC;EAER;;EAEA;AACF;EACEM,yBAAyBA,CAAA,EAAqB;IAC5C,OAA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IAAIC,gBAAgBA,CAAA,EAAqB;IACvC,OAAO,IAAI,CAACH,iBAAiB;EAC/B;;EAEA;AACF;EACE,IAAIG,gBAAgBA,CAACA,gBAAkC,EAAE;IACvD,IAAI,CAACH,iBAAiB,GAAGG,gBAAgB;EAC3C;;EAEA;AACF;AACA;EACE,IAAIC,MAAMA,CAAA,EAAY;IACpB,OAAO,IAAI,CAAC1C,aAAa,CAACC,YAAY,KAAK,UAAU;EACvD;;EAEA;AACF;AACA;EACE,IAAI0C,cAAcA,CAAA,EAAmB;IACnC,OAAO,IAAI,CAACrC,oBAAoB,CAACsC,wBAAwB,CAAChB,kBAAK,CAAC;EAClE;;EAEA;AACF;AACA;EACEiB,MAAMA,CAACC,KAAqB,EAAe;IACzC,IAAIA,KAAK,YAAY7D,WAAW,EAAE;MAChC,MAAM8D,WAAW,GAAG,IAAI,CAACC,KAAK,CAAC,CAAC;MAEhCD,WAAW,CAAC1B,mBAAmB,GAAGyB,KAAK,CAACxC,oBAAoB;MAC5DyC,WAAW,CAACX,kBAAkB,GAAGU,KAAK,CAACT,mBAAmB;MAC1DU,WAAW,CAACN,gBAAgB,GAAGK,KAAK,CAACR,iBAAiB;MAEtD,OAAOS,WAAW;IACpB;IAEA,OAAO,IAAI;EACb;;EAEA;AACF;EACEE,MAAMA,CAACH,KAAkB,EAAW;IAClC,OAAO,IAAI,CAACrC,EAAE,CAACyC,QAAQ,CAAC,CAAC,KAAKJ,KAAK,CAACrC,EAAE,CAACyC,QAAQ,CAAC,CAAC;EACnD;AACF;AAACC,OAAA,CAAA7D,OAAA,GAAAL,WAAA"}
|
|
1
|
+
{"version":3,"file":"DetailModel.js","names":["_objects","require","_ActionCollection","_interopRequireDefault","_AttributeCollection","_ResourceModel","_LayoutHints","DetailModel","ResourceModel","constructor","modularuiResponse","_defineProperty2","default","createAttributeCollection","createMetadataCollection","createActionCollection","type","modelName","isApplicableModel","data","_context","resourceType","contributions","resourcetype","_endsWith","call","_includes","getInitialChildModelLinks","_attributeCollection","setChildModels","models","id","getData","key","label","getContribution","_context2","attributeContributions","attributes","_filter","contribution","_keys","has","attributeCollection","AttributeCollection","collection","_context3","all","attribute","hasTitle","layouthint","hasExact","TITLE","hasAvatar","AVATAR","hasAvatarForTitle","AVATAR_FOR_TITLE","isHidden","getAttributeByKey","_context4","metadataContributions","metadata","_map","metadataKey","metadataCollection","_metadataCollection","_actionCollection","ActionCollection","actions","actionCollection","isCase","avatarForTitleAttribute","_context5","avatarAttributes","_find","titleAttribute","_context6","nonAvatarAttributes","update","model","clonedModel","clone","equals","toString","exports"],"sources":["../../../src/models/detail/DetailModel.js"],"sourcesContent":["// @flow\nimport { has } from \"../../utils/helpers/objects\";\n\nimport ActionCollection from \"../actions/ActionCollection\";\nimport AttributeCollection from \"../attributes/AttributeCollection\";\nimport ResourceModel from \"../base/ResourceModel\";\n\nimport { AVATAR, AVATAR_FOR_TITLE, TITLE } from \"../../constants/LayoutHints\";\n\nimport type { ModularUIResponse } from \"../../modularui\";\nimport type { ModularUIModel, AttributeType } from \"../types\";\nimport type LinkModel from \"../links/LinkModel\";\n\n/**\n * Base class for details<br/>\n * For instance the details of case 1<br/>\n * For instance the details of record 12<br/>\n */\nexport default class DetailModel extends ResourceModel {\n _attributeCollection: AttributeCollection;\n _metadataCollection: AttributeCollection;\n _actionCollection: ActionCollection;\n\n /**\n */\n constructor(modularuiResponse: ModularUIResponse) {\n super(modularuiResponse);\n\n this.createAttributeCollection();\n this.createMetadataCollection();\n this.createActionCollection();\n }\n\n /**\n */\n get type(): string {\n return \"Detail\";\n }\n\n /**\n */\n static get modelName(): string {\n return \"DetailModel\";\n }\n\n /**\n */\n static isApplicableModel(data: ModularUIResponse): boolean {\n const resourceType = data.contributions?.resourcetype;\n return (\n resourceType &&\n (resourceType.endsWith(\"DetailPanel\") ||\n [\"Detail\", \"CasePropertiesPanel\", \"CasePropertiesPanelDetail\"].includes(\n resourceType,\n ))\n );\n }\n\n /**\n */\n getInitialChildModelLinks(): Array<LinkModel> {\n return this._attributeCollection.getInitialChildModelLinks();\n }\n\n /**\n */\n setChildModels(models: Array<ModularUIModel>) {\n this._attributeCollection.setChildModels(models);\n }\n\n /**\n * Getting the unique identifier of the details\n */\n get id(): string {\n return this.getData(\"_id\", this.key);\n }\n\n /**\n */\n get label(): string {\n return this.getContribution(\"label\", \"\");\n }\n\n /**\n * Attribute collection\n */\n createAttributeCollection() {\n const attributeContributions = this.contributions.attributes\n ? this.contributions.attributes.filter((contribution) => {\n const [key] = Object.keys(contribution);\n return has(this.data, key);\n })\n : [];\n\n this.attributeCollection = new AttributeCollection(\n this.data,\n attributeContributions,\n true,\n );\n }\n\n /**\n */\n get attributeCollection(): AttributeCollection {\n return this._attributeCollection;\n }\n\n /**\n */\n set attributeCollection(collection: AttributeCollection) {\n this._attributeCollection = collection;\n }\n\n /**\n * Retrieve list of visible attributes\n */\n get attributes(): Array<AttributeType> {\n return this.attributeCollection.all.filter((attribute) => {\n const hasTitle = attribute.layouthint.hasExact(TITLE);\n const hasAvatar = attribute.layouthint.hasExact(AVATAR);\n const hasAvatarForTitle = attribute.layouthint.hasExact(AVATAR_FOR_TITLE);\n return (\n !attribute.isHidden &&\n (!hasTitle || (hasTitle && hasAvatar)) &&\n (!hasAvatarForTitle || (hasAvatarForTitle && !hasAvatar))\n );\n });\n }\n\n /**\n * Retrieve an attribute by it's key\n */\n getAttributeByKey(key: string): AttributeType | null {\n return this._attributeCollection.getAttributeByKey(key);\n }\n\n /**\n * Metadata collection\n */\n createMetadataCollection() {\n const metadataContributions = this.contributions.metadata\n ? Object.keys(this.contributions.metadata).map((metadataKey) => ({\n [metadataKey]: this.contributions.metadata[metadataKey],\n }))\n : [];\n\n this.metadataCollection = new AttributeCollection(\n this.data,\n metadataContributions,\n true,\n );\n }\n\n /**\n */\n get metadataCollection(): AttributeCollection {\n return this._metadataCollection;\n }\n\n /**\n */\n set metadataCollection(collection: AttributeCollection) {\n this._metadataCollection = collection;\n }\n\n /**\n * Action collection\n */\n createActionCollection() {\n this._actionCollection = new ActionCollection(\n this.data.actions,\n this.contributions.actions,\n );\n }\n\n /**\n */\n get actionCollection(): ActionCollection {\n return this._actionCollection;\n }\n\n /**\n */\n set actionCollection(actionCollection: ActionCollection) {\n this._actionCollection = actionCollection;\n }\n\n /**\n * Determines if this is a case\n */\n get isCase(): boolean {\n return this.contributions.resourcetype === \"CaseView\";\n }\n\n /**\n * Getting the attribute that has as layout hint 'avatar-for-title'\n */\n get avatarForTitleAttribute(): ?AttributeType {\n const avatarAttributes = this._attributeCollection.all.filter((attribute) =>\n attribute.layouthint.hasExact(AVATAR),\n );\n\n const avatarForTitleAttribute = avatarAttributes.find((attribute) =>\n attribute.layouthint.hasExact(AVATAR_FOR_TITLE),\n );\n\n return avatarForTitleAttribute || null;\n }\n\n /**\n * Getting the attribute that has as layout hint 'title'\n */\n get titleAttribute(): ?AttributeType {\n const nonAvatarAttributes = this._attributeCollection.all.filter(\n (attribute) => !attribute.layouthint.hasExact(AVATAR),\n );\n\n const titleAttribute = nonAvatarAttributes.find((attribute) =>\n attribute.layouthint.has(TITLE),\n );\n\n return titleAttribute || null;\n }\n\n /**\n * Update current detail with a new detail model and return a cloned version of the model\n */\n update(model: ModularUIModel): DetailModel {\n if (model instanceof DetailModel) {\n const clonedModel = this.clone();\n\n clonedModel.attributeCollection = model._attributeCollection;\n clonedModel.metadataCollection = model._metadataCollection;\n clonedModel.actionCollection = model._actionCollection;\n\n return clonedModel;\n }\n\n return this;\n }\n\n /**\n */\n equals(model: DetailModel): boolean {\n return this.id.toString() === model.id.toString();\n }\n}\n"],"mappings":";;;;;;;;;;;;;;AACA,IAAAA,QAAA,GAAAC,OAAA;AAEA,IAAAC,iBAAA,GAAAC,sBAAA,CAAAF,OAAA;AACA,IAAAG,oBAAA,GAAAD,sBAAA,CAAAF,OAAA;AACA,IAAAI,cAAA,GAAAF,sBAAA,CAAAF,OAAA;AAEA,IAAAK,YAAA,GAAAL,OAAA;AAMA;AACA;AACA;AACA;AACA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AG,CAACU,kBAAK,CAChC,CAAC;IAED,OAAOuB,cAAc,IAAI,IAAI;EAC/B;;EAEA;AACF;AACA;EACEG,MAAMA,CAACC,KAAqB,EAAe;IACzC,IAAIA,KAAK,YAAYxE,WAAW,EAAE;MAChC,MAAMyE,WAAW,GAAG,IAAI,CAACC,KAAK,CAAC,CAAC;MAEhCD,WAAW,CAACrC,mBAAmB,GAAGoC,KAAK,CAACnD,oBAAoB;MAC5DoD,WAAW,CAAChB,kBAAkB,GAAGe,KAAK,CAACd,mBAAmB;MAC1De,WAAW,CAACX,gBAAgB,GAAGU,KAAK,CAACb,iBAAiB;MAEtD,OAAOc,WAAW;IACpB;IAEA,OAAO,IAAI;EACb;;EAEA;AACF;EACEE,MAAMA,CAACH,KAAkB,EAAW;IAClC,OAAO,IAAI,CAAChD,EAAE,CAACoD,QAAQ,CAAC,CAAC,KAAKJ,KAAK,CAAChD,EAAE,CAACoD,QAAQ,CAAC,CAAC;EACnD;AACF;AAACC,OAAA,CAAAxE,OAAA,GAAAL,WAAA"}
|
package/package.json
CHANGED
|
@@ -167,4 +167,60 @@ export const LayoutHintConfiguration = {
|
|
|
167
167
|
link: "",
|
|
168
168
|
component: ["tab"],
|
|
169
169
|
},
|
|
170
|
+
AVATAR_FOR_TITLE: {
|
|
171
|
+
hint: "avatar-for-title",
|
|
172
|
+
description: {
|
|
173
|
+
NL: "Markeert een attribuut als een avatar voor het titelattribuut.",
|
|
174
|
+
EN: "Marks an attribute as an avatar for the title attribute.",
|
|
175
|
+
},
|
|
176
|
+
link: "",
|
|
177
|
+
component: [
|
|
178
|
+
"caseview_table",
|
|
179
|
+
"codemap",
|
|
180
|
+
"list/appointment_table",
|
|
181
|
+
"list/assignment_table",
|
|
182
|
+
"list/caseproperties_table",
|
|
183
|
+
"list/document_table",
|
|
184
|
+
"list/timelimit_table",
|
|
185
|
+
"list/eventhistory_table",
|
|
186
|
+
"list/note_table",
|
|
187
|
+
"list/record_table",
|
|
188
|
+
"list/case_table",
|
|
189
|
+
"list/casesearch_table",
|
|
190
|
+
"list/datastore_table",
|
|
191
|
+
"list/datastoreview_table",
|
|
192
|
+
"list/instrumentresult_table",
|
|
193
|
+
"list/event_table",
|
|
194
|
+
"list/user_table",
|
|
195
|
+
"list/organization_table",
|
|
196
|
+
],
|
|
197
|
+
},
|
|
198
|
+
AVATAR: {
|
|
199
|
+
hint: "avatar",
|
|
200
|
+
description: {
|
|
201
|
+
NL: "Geef het attribuut weer als de avatar van de gebruiker.",
|
|
202
|
+
EN: "Render the attribute as the user's avatar.",
|
|
203
|
+
},
|
|
204
|
+
link: "",
|
|
205
|
+
component: [
|
|
206
|
+
"caseview_table",
|
|
207
|
+
"codemap",
|
|
208
|
+
"list/appointment_table",
|
|
209
|
+
"list/assignment_table",
|
|
210
|
+
"list/caseproperties_table",
|
|
211
|
+
"list/document_table",
|
|
212
|
+
"list/timelimit_table",
|
|
213
|
+
"list/eventhistory_table",
|
|
214
|
+
"list/note_table",
|
|
215
|
+
"list/record_table",
|
|
216
|
+
"list/case_table",
|
|
217
|
+
"list/casesearch_table",
|
|
218
|
+
"list/datastore_table",
|
|
219
|
+
"list/datastoreview_table",
|
|
220
|
+
"list/instrumentresult_table",
|
|
221
|
+
"list/event_table",
|
|
222
|
+
"list/user_table",
|
|
223
|
+
"list/organization_table",
|
|
224
|
+
],
|
|
225
|
+
},
|
|
170
226
|
};
|
|
@@ -124,4 +124,11 @@ export const HIDE_IN_USER_INTERFACE: string = getHint("HIDE_IN_USER_INTERFACE");
|
|
|
124
124
|
*/
|
|
125
125
|
export const getLayoutHintConfiguration = (): Object => LayoutHintConfiguration;
|
|
126
126
|
|
|
127
|
+
/**
|
|
128
|
+
* Layout-hint: Marks an attribute as an avatar for the title attribute.
|
|
129
|
+
*/
|
|
130
|
+
export const AVATAR_FOR_TITLE: string = getHint("AVATAR_FOR_TITLE");
|
|
131
|
+
|
|
132
|
+
export const AVATAR: string = getHint("AVATAR");
|
|
133
|
+
|
|
127
134
|
export default getHint;
|
|
@@ -5,7 +5,7 @@ import ActionCollection from "../actions/ActionCollection";
|
|
|
5
5
|
import AttributeCollection from "../attributes/AttributeCollection";
|
|
6
6
|
import ResourceModel from "../base/ResourceModel";
|
|
7
7
|
|
|
8
|
-
import { TITLE } from "../../constants/LayoutHints";
|
|
8
|
+
import { AVATAR, AVATAR_FOR_TITLE, TITLE } from "../../constants/LayoutHints";
|
|
9
9
|
|
|
10
10
|
import type { ModularUIResponse } from "../../modularui";
|
|
11
11
|
import type { ModularUIModel, AttributeType } from "../types";
|
|
@@ -115,9 +115,16 @@ export default class DetailModel extends ResourceModel {
|
|
|
115
115
|
* Retrieve list of visible attributes
|
|
116
116
|
*/
|
|
117
117
|
get attributes(): Array<AttributeType> {
|
|
118
|
-
return this.attributeCollection.all.filter(
|
|
119
|
-
|
|
120
|
-
|
|
118
|
+
return this.attributeCollection.all.filter((attribute) => {
|
|
119
|
+
const hasTitle = attribute.layouthint.hasExact(TITLE);
|
|
120
|
+
const hasAvatar = attribute.layouthint.hasExact(AVATAR);
|
|
121
|
+
const hasAvatarForTitle = attribute.layouthint.hasExact(AVATAR_FOR_TITLE);
|
|
122
|
+
return (
|
|
123
|
+
!attribute.isHidden &&
|
|
124
|
+
(!hasTitle || (hasTitle && hasAvatar)) &&
|
|
125
|
+
(!hasAvatarForTitle || (hasAvatarForTitle && !hasAvatar))
|
|
126
|
+
);
|
|
127
|
+
});
|
|
121
128
|
}
|
|
122
129
|
|
|
123
130
|
/**
|
|
@@ -185,11 +192,34 @@ export default class DetailModel extends ResourceModel {
|
|
|
185
192
|
return this.contributions.resourcetype === "CaseView";
|
|
186
193
|
}
|
|
187
194
|
|
|
195
|
+
/**
|
|
196
|
+
* Getting the attribute that has as layout hint 'avatar-for-title'
|
|
197
|
+
*/
|
|
198
|
+
get avatarForTitleAttribute(): ?AttributeType {
|
|
199
|
+
const avatarAttributes = this._attributeCollection.all.filter((attribute) =>
|
|
200
|
+
attribute.layouthint.hasExact(AVATAR),
|
|
201
|
+
);
|
|
202
|
+
|
|
203
|
+
const avatarForTitleAttribute = avatarAttributes.find((attribute) =>
|
|
204
|
+
attribute.layouthint.hasExact(AVATAR_FOR_TITLE),
|
|
205
|
+
);
|
|
206
|
+
|
|
207
|
+
return avatarForTitleAttribute || null;
|
|
208
|
+
}
|
|
209
|
+
|
|
188
210
|
/**
|
|
189
211
|
* Getting the attribute that has as layout hint 'title'
|
|
190
212
|
*/
|
|
191
213
|
get titleAttribute(): ?AttributeType {
|
|
192
|
-
|
|
214
|
+
const nonAvatarAttributes = this._attributeCollection.all.filter(
|
|
215
|
+
(attribute) => !attribute.layouthint.hasExact(AVATAR),
|
|
216
|
+
);
|
|
217
|
+
|
|
218
|
+
const titleAttribute = nonAvatarAttributes.find((attribute) =>
|
|
219
|
+
attribute.layouthint.has(TITLE),
|
|
220
|
+
);
|
|
221
|
+
|
|
222
|
+
return titleAttribute || null;
|
|
193
223
|
}
|
|
194
224
|
|
|
195
225
|
/**
|