@beinformed/ui 1.16.1 → 1.17.2
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 +24 -0
- package/esm/hooks/useForm.js +11 -1
- package/esm/hooks/useForm.js.map +1 -1
- package/esm/models/application/ApplicationModel.js +13 -2
- package/esm/models/application/ApplicationModel.js.map +1 -1
- package/esm/models/href/Href.js +11 -1
- package/esm/models/href/Href.js.map +1 -1
- package/esm/models/index.js +1 -0
- package/esm/models/index.js.map +1 -1
- package/esm/redux/actions/FormAttributeSet.js +10 -1
- package/esm/redux/actions/FormAttributeSet.js.map +1 -1
- package/esm/utils/helpers/checkResource.js +4 -8
- package/esm/utils/helpers/checkResource.js.map +1 -1
- package/lib/hooks/useForm.js +15 -2
- package/lib/hooks/useForm.js.flow +10 -0
- package/lib/hooks/useForm.js.map +1 -1
- package/lib/models/application/ApplicationModel.js +13 -2
- package/lib/models/application/ApplicationModel.js.flow +7 -0
- package/lib/models/application/ApplicationModel.js.map +1 -1
- package/lib/models/href/Href.js +11 -1
- package/lib/models/href/Href.js.flow +12 -1
- package/lib/models/href/Href.js.map +1 -1
- package/lib/models/index.js +8 -0
- package/lib/models/index.js.flow +1 -0
- package/lib/models/index.js.map +1 -1
- package/lib/redux/actions/FormAttributeSet.js +14 -2
- package/lib/redux/actions/FormAttributeSet.js.flow +10 -1
- package/lib/redux/actions/FormAttributeSet.js.map +1 -1
- package/lib/utils/helpers/__tests__/checkResource.spec.js.flow +11 -7
- package/lib/utils/helpers/checkResource.js +4 -7
- package/lib/utils/helpers/checkResource.js.flow +7 -5
- package/lib/utils/helpers/checkResource.js.map +1 -1
- package/package.json +6 -6
- package/src/hooks/useForm.js +10 -0
- package/src/models/application/ApplicationModel.js +7 -0
- package/src/models/href/Href.js +12 -1
- package/src/models/index.js +1 -0
- package/src/redux/actions/FormAttributeSet.js +10 -1
- package/src/utils/helpers/__tests__/checkResource.spec.js +11 -7
- package/src/utils/helpers/checkResource.js +7 -5
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,30 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
|
|
4
4
|
|
|
5
|
+
### [1.17.2](https://git.beinformed.com/public/nl.beinformed.bi.layout.lib.ui/compare/v1.17.1...v1.17.2) (2022-04-07)
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
### Bug Fixes
|
|
9
|
+
|
|
10
|
+
* **validate:** Added useAttributeValidate to validate the attribute onBlur ([#17](https://git.beinformed.com/public/nl.beinformed.bi.layout.lib.ui/issues/17)) ([426b592](https://git.beinformed.com/public/nl.beinformed.bi.layout.lib.ui/commit/426b592015cf07d2c35d1708a54b7d68b6ab9cec))
|
|
11
|
+
|
|
12
|
+
### [1.17.1](https://git.beinformed.com/public/nl.beinformed.bi.layout.lib.ui/compare/v1.17.0...v1.17.1) (2022-03-30)
|
|
13
|
+
|
|
14
|
+
### Bug Fixes
|
|
15
|
+
|
|
16
|
+
- **models:** export ChoiceAttributeOptionCollection through models index file ([c2d4d64](https://git.beinformed.com/public/nl.beinformed.bi.layout.lib.ui/commit/c2d4d64d46ecf9e26e60364b8e170d4e395c8220))
|
|
17
|
+
|
|
18
|
+
## [1.17.0](https://git.beinformed.com/public/nl.beinformed.bi.layout.lib.ui/compare/v1.16.1...v1.17.0) (2022-03-29)
|
|
19
|
+
|
|
20
|
+
### Features
|
|
21
|
+
|
|
22
|
+
- **application:** add isLoggedIn method to application ([61a340d](https://git.beinformed.com/public/nl.beinformed.bi.layout.lib.ui/commit/61a340d12703c2db0c351c3ab23c4bfed12c4f12))
|
|
23
|
+
|
|
24
|
+
### Bug Fixes
|
|
25
|
+
|
|
26
|
+
- **check-resource:** handle Href as input argument for resourceExists and resourceRedirectsToSecureLogin ([c49e671](https://git.beinformed.com/public/nl.beinformed.bi.layout.lib.ui/commit/c49e6715addb2703222ecf4a8b120fc9cb814f35))
|
|
27
|
+
- **href:** absolute href no longer prefixes querystring, use absolutehrefPrefixedQuerystring if needed ([2ff2abd](https://git.beinformed.com/public/nl.beinformed.bi.layout.lib.ui/commit/2ff2abd8ce6f6f9545dd82c573891f344ed49c09))
|
|
28
|
+
|
|
5
29
|
### [1.16.1](https://git.beinformed.com/public/nl.beinformed.bi.layout.lib.ui/compare/v1.16.0...v1.16.1) (2022-03-22)
|
|
6
30
|
|
|
7
31
|
## [1.16.0](https://git.beinformed.com/public/nl.beinformed.bi.layout.lib.ui/compare/v1.15.1...v1.16.0) (2022-03-22)
|
package/esm/hooks/useForm.js
CHANGED
|
@@ -3,7 +3,7 @@ import Href from "../models/href/Href";
|
|
|
3
3
|
import { getSetting, HTTP_METHODS } from "../constants";
|
|
4
4
|
import { loadModularUI, removeModelByKey } from "../redux/_modularui";
|
|
5
5
|
import { useModularUI } from "./useModularUI";
|
|
6
|
-
import { addRepeatableAttributeSet, cancelForm, cancelRepeatableAttributeSet, previousObject, removeRepeatableAttributeSet, showFormNotification, updateFormAttribute } from "../redux/actions";
|
|
6
|
+
import { addRepeatableAttributeSet, cancelForm, cancelRepeatableAttributeSet, previousObject, removeRepeatableAttributeSet, showFormNotification, updateFormAttribute, validateFormAttribute } from "../redux/actions";
|
|
7
7
|
import FormModel from "../models/form/FormModel";
|
|
8
8
|
|
|
9
9
|
/**
|
|
@@ -76,6 +76,16 @@ export var useAttributeUpdate = function useAttributeUpdate(form, object) {
|
|
|
76
76
|
return dispatch(updateFormAttribute(form, object, attribute, value, options));
|
|
77
77
|
};
|
|
78
78
|
};
|
|
79
|
+
/**
|
|
80
|
+
* Validate attributes of a form
|
|
81
|
+
*/
|
|
82
|
+
|
|
83
|
+
export var useAttributeValidate = function useAttributeValidate(form) {
|
|
84
|
+
var dispatch = useDispatch();
|
|
85
|
+
return function () {
|
|
86
|
+
return dispatch(validateFormAttribute(form));
|
|
87
|
+
};
|
|
88
|
+
};
|
|
79
89
|
/**
|
|
80
90
|
* Attributeset actions
|
|
81
91
|
*/
|
package/esm/hooks/useForm.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/hooks/useForm.js"],"names":["useDispatch","Href","getSetting","HTTP_METHODS","loadModularUI","removeModelByKey","useModularUI","addRepeatableAttributeSet","cancelForm","cancelRepeatableAttributeSet","previousObject","removeRepeatableAttributeSet","showFormNotification","updateFormAttribute","FormModel","useForm","href","formHref","addParameter","form","method","POST","targetModel","removeOnUnmount","model","useFormNavigation","dispatch","previous","cancel","submit","connectKey","selfhref","data","formdata","updateModel","remove","showFormNotificationAction","useAttributeUpdate","object","attribute","value","options","useAttributeSet","save"],"mappings":"AACA,SAASA,WAAT,QAA4B,aAA5B;AAEA,OAAOC,IAAP,MAAiB,qBAAjB;AAEA,SAASC,UAAT,EAAqBC,YAArB,QAAyC,cAAzC;AAEA,SAASC,aAAT,EAAwBC,gBAAxB,QAAgD,qBAAhD;AACA,SAASC,YAAT,QAA6B,gBAA7B;AAEA,SACEC,yBADF,EAEEC,UAFF,EAGEC,4BAHF,EAIEC,cAJF,EAKEC,4BALF,EAMEC,oBANF,EAOEC,mBAPF,
|
|
1
|
+
{"version":3,"sources":["../../src/hooks/useForm.js"],"names":["useDispatch","Href","getSetting","HTTP_METHODS","loadModularUI","removeModelByKey","useModularUI","addRepeatableAttributeSet","cancelForm","cancelRepeatableAttributeSet","previousObject","removeRepeatableAttributeSet","showFormNotification","updateFormAttribute","validateFormAttribute","FormModel","useForm","href","formHref","addParameter","form","method","POST","targetModel","removeOnUnmount","model","useFormNavigation","dispatch","previous","cancel","submit","connectKey","selfhref","data","formdata","updateModel","remove","showFormNotificationAction","useAttributeUpdate","object","attribute","value","options","useAttributeValidate","useAttributeSet","save"],"mappings":"AACA,SAASA,WAAT,QAA4B,aAA5B;AAEA,OAAOC,IAAP,MAAiB,qBAAjB;AAEA,SAASC,UAAT,EAAqBC,YAArB,QAAyC,cAAzC;AAEA,SAASC,aAAT,EAAwBC,g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Q,CAACb,qBAAqB,CAACM,IAAD,CAAtB,CAAd;AAAA,GAAP;AACD,CAJM;AAMP;AACA;AACA;;AACA,OAAO,IAAMwB,eAAe,GAAG,SAAlBA,eAAkB,CAACxB,IAAD,EAAuC;AACpE,MAAMO,QAAQ,GAAG3B,WAAW,EAA5B;AAEA,SAAO;AACL6C,IAAAA,IAAI,EAAE;AAAA,aAAMlB,QAAQ,CAACpB,yBAAyB,CAACa,IAAD,CAA1B,CAAd;AAAA,KADD;AAELS,IAAAA,MAAM,EAAE,gBAACU,MAAD;AAAA,aACNZ,QAAQ,CAAClB,4BAA4B,CAACW,IAAD,EAAOmB,MAAP,CAA7B,CADF;AAAA,KAFH;AAILH,IAAAA,MAAM,EAAE,gBAACG,MAAD;AAAA,aACNZ,QAAQ,CAAChB,4BAA4B,CAACS,IAAD,EAAOmB,MAAP,CAA7B,CADF;AAAA;AAJH,GAAP;AAOD,CAVM","sourcesContent":["// @flow\nimport { useDispatch } from \"react-redux\";\n\nimport Href from \"../models/href/Href\";\n\nimport { getSetting, HTTP_METHODS } from \"../constants\";\n\nimport { loadModularUI, removeModelByKey } from \"../redux/_modularui\";\nimport { useModularUI } from \"./useModularUI\";\n\nimport {\n addRepeatableAttributeSet,\n cancelForm,\n cancelRepeatableAttributeSet,\n previousObject,\n removeRepeatableAttributeSet,\n showFormNotification,\n updateFormAttribute,\n validateFormAttribute,\n} from \"../redux/actions\";\n\nimport FormModel from \"../models/form/FormModel\";\n\nimport type { FormObjectModel, AttributeType } from \"../models\";\nimport type { UpdateFormOptions } from \"../redux/types\";\nimport type {\n RemoveModelByKeyAction,\n UpdateModelAction,\n} from \"../redux/_modularui\";\n\ntype FormNavigationHook = {\n previous: (form: FormModel) => UpdateModelAction,\n cancel: (form: FormModel) => void,\n submit: (form: FormModel) => void,\n showFormNotification: (form: FormModel) => void,\n remove: (form: FormModel) => RemoveModelByKeyAction,\n};\n\ntype AttributeSetHook = {\n save: () => UpdateModelAction,\n cancel: (object: FormObjectModel) => UpdateModelAction,\n remove: (object: FormObjectModel) => UpdateModelAction,\n};\n\ntype AttributeUpdateHook = (\n attribute: AttributeType,\n value: string,\n options: UpdateFormOptions\n) => void;\n\n/**\n * Load a form by href\n */\nexport const useForm = (href: string | Href): ?FormModel => {\n const formHref = new Href(href);\n\n if (!getSetting(\"ALWAYS_COMMIT_FORM\")) {\n formHref.addParameter(\"commit\", \"false\");\n }\n\n const form = useModularUI(\"form\", formHref, {\n method: HTTP_METHODS.POST,\n targetModel: FormModel,\n removeOnUnmount: true,\n });\n\n if (form?.model) {\n return form.model;\n }\n};\n\n/**\n * Form navigation methods\n */\nexport const useFormNavigation = (): FormNavigationHook => {\n const dispatch = useDispatch();\n\n const previous = (form: FormModel) => dispatch(previousObject(form));\n\n const cancel = (form: FormModel) => dispatch(cancelForm(form));\n\n const submit = (form: FormModel) =>\n dispatch(\n loadModularUI(form.connectKey, form.selfhref, {\n method: HTTP_METHODS.POST,\n data: form.formdata,\n updateModel: form,\n targetModel: FormModel,\n })\n );\n\n const remove = (form: FormModel) =>\n dispatch(removeModelByKey(form.connectKey));\n\n const showFormNotificationAction = (form: FormModel) =>\n dispatch(showFormNotification(form));\n\n return {\n previous,\n cancel,\n submit,\n remove,\n showFormNotification: showFormNotificationAction,\n };\n};\n\n/**\n * Update attributes of a form\n */\nexport const useAttributeUpdate = (\n form: FormModel,\n object: FormObjectModel\n): AttributeUpdateHook => {\n const dispatch = useDispatch();\n\n return (\n attribute: AttributeType,\n value: string,\n options: UpdateFormOptions\n ) => dispatch(updateFormAttribute(form, object, attribute, value, options));\n};\n\n/**\n * Validate attributes of a form\n */\nexport const useAttributeValidate = (form: FormModel): AttributeUpdateHook => {\n const dispatch = useDispatch();\n\n return () => dispatch(validateFormAttribute(form));\n};\n\n/**\n * Attributeset actions\n */\nexport const useAttributeSet = (form: FormModel): AttributeSetHook => {\n const dispatch = useDispatch();\n\n return {\n save: () => dispatch(addRepeatableAttributeSet(form)),\n cancel: (object: FormObjectModel) =>\n dispatch(cancelRepeatableAttributeSet(form, object)),\n remove: (object: FormObjectModel) =>\n dispatch(removeRepeatableAttributeSet(form, object)),\n };\n};\n"],"file":"useForm.js"}
|
|
@@ -125,13 +125,24 @@ var ApplicationModel = /*#__PURE__*/function (_ResourceModel) {
|
|
|
125
125
|
return this._userServices ? this._userServices : null;
|
|
126
126
|
}
|
|
127
127
|
/**
|
|
128
|
-
*
|
|
129
|
-
* only available when the user services are available
|
|
128
|
+
* Indicates if the user is logged in
|
|
130
129
|
*/
|
|
131
130
|
,
|
|
132
131
|
set: function set(model) {
|
|
133
132
|
this._userServices = model instanceof UserServicesModel ? model : null;
|
|
134
133
|
}
|
|
134
|
+
}, {
|
|
135
|
+
key: "isLoggedIn",
|
|
136
|
+
get: function get() {
|
|
137
|
+
var _this$userServices$is, _this$userServices;
|
|
138
|
+
|
|
139
|
+
return (_this$userServices$is = (_this$userServices = this.userServices) === null || _this$userServices === void 0 ? void 0 : _this$userServices.isLoggedIn) !== null && _this$userServices$is !== void 0 ? _this$userServices$is : false;
|
|
140
|
+
}
|
|
141
|
+
/**
|
|
142
|
+
* Retrieve link to the user information,
|
|
143
|
+
* only available when the user services are available
|
|
144
|
+
*/
|
|
145
|
+
|
|
135
146
|
}, {
|
|
136
147
|
key: "userHref",
|
|
137
148
|
get: function get() {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/models/application/ApplicationModel.js"],"names":["ResourceModel","LinkModel","UserServicesModel","NotAllowedUriException","ApplicationModel","userService","links","getLinkByKey","href","path","models","userServiceModel","model","type","userServices","getContribution","getLinksByGroup","create","_userServices","userLink","data","contributions","resourcetype"],"mappings":";;;;;;;;;;;;;;;AACA,OAAOA,aAAP,MAA0B,uBAA1B;AACA,OAAOC,SAAP,MAAsB,oBAAtB;AACA,OAAOC,iBAAP,MAA8B,2BAA9B;AAEA,SAASC,sBAAT,QAAuC,kBAAvC;;AAOA;AACA;AACA;IACqBC,gB;;;;;;;;;;;;;;;;;;;;;;;;;;AAGnB;AACF;AACA;AACE,mBAAmB;AACjB,aAAO,aAAP;AACD;AAED;AACF;;;;;AAQE;AACF;AACE,yCAA8C;AAC5C,UAAMC,WAAW,GAAG,KAAKC,KAAL,CAAWC,YAAX,CAAwB,cAAxB,CAApB;;AACA,UAAIF,WAAW,IAAIA,WAAW,CAACG,IAAZ,CAAiBC,IAAjB,KAA0B,QAA7C,EAAuD;AACrD,cAAM,IAAIN,sBAAJ,CACJ,kIADI,CAAN;AAGD;;AAED,aAAOE,WAAW,GAAG,CAACA,WAAD,CAAH,GAAmB,EAArC;AACD;AAED;AACF;;;;WACE,wBAAeK,MAAf,EAA8C;AAC5C,UAAMC,gBAAgB,GAAG,sBAAAD,MAAM,MAAN,CAAAA,MAAM,EAC7B,UAACE,KAAD;AAAA,eAAWA,KAAK,CAACC,IAAN,KAAe,cAA1B;AAAA,OAD6B,CAA/B;;AAIA,UAAIF,gBAAJ,EAAsB;AACpB,aAAKG,YAAL,GAAoBH,gBAApB;AACD;AACF;AAED;AACF;AACA;;;;SACE,eAAoB;AAClB,aAAO,KAAKI,eAAL,CAAqB,OAArB,EAA8B,EAA9B,CAAP;AACD;AAED;AACF;AACA;;;;SACE,eAA2B;AACzB,aAAO,KAAKT,KAAL,CAAWU,eAAX,CAA2B,KAA3B,CAAP;AACD;AAED;AACF;AACA;;;;SACE,eAA8B;AAC5B,aAAOf,SAAS,CAACgB,MAAV,CAAiB,cAAjB,EAAiC,eAAjC,EAAkD,eAAlD,CAAP;AACD;AAED;AACF;AACA;;;;;AAKE;AACF;AACA;AACE,mBAAuC;AACrC,aAAO,KAAKC,aAAL,GAAqB,KAAKA,aAA1B,GAA0C,IAAjD;AACD;AAED;AACF;AACA
|
|
1
|
+
{"version":3,"sources":["../../../src/models/application/ApplicationModel.js"],"names":["ResourceModel","LinkModel","UserServicesModel","NotAllowedUriException","ApplicationModel","userService","links","getLinkByKey","href","path","models","userServiceModel","model","type","userServices","getContribution","getLinksByGroup","create","_userServices","isLoggedIn","userLink","data","contributions","resourcetype"],"mappings":";;;;;;;;;;;;;;;AACA,OAAOA,aAAP,MAA0B,uBAA1B;AACA,OAAOC,SAAP,MAAsB,oBAAtB;AACA,OAAOC,iBAAP,MAA8B,2BAA9B;AAEA,SAASC,sBAAT,QAAuC,kBAAvC;;AAOA;AACA;AACA;IACqBC,gB;;;;;;;;;;;;;;;;;;;;;;;;;;AAGnB;AACF;AACA;AACE,mBAAmB;AACjB,aAAO,aAAP;AACD;AAED;AACF;;;;;AAQE;AACF;AACE,yCAA8C;AAC5C,UAAMC,WAAW,GAAG,KAAKC,KAAL,CAAWC,YAAX,CAAwB,cAAxB,CAApB;;AACA,UAAIF,WAAW,IAAIA,WAAW,CAACG,IAAZ,CAAiBC,IAAjB,KAA0B,QAA7C,EAAuD;AACrD,cAAM,IAAIN,sBAAJ,CACJ,kIADI,CAAN;AAGD;;AAED,aAAOE,WAAW,GAAG,CAACA,WAAD,CAAH,GAAmB,EAArC;AACD;AAED;AACF;;;;WACE,wBAAeK,MAAf,EAA8C;AAC5C,UAAMC,gBAAgB,GAAG,sBAAAD,MAAM,MAAN,CAAAA,MAAM,EAC7B,UAACE,KAAD;AAAA,eAAWA,KAAK,CAACC,IAAN,KAAe,cAA1B;AAAA,OAD6B,CAA/B;;AAIA,UAAIF,gBAAJ,EAAsB;AACpB,aAAKG,YAAL,GAAoBH,gBAApB;AACD;AACF;AAED;AACF;AACA;;;;SACE,eAAoB;AAClB,aAAO,KAAKI,eAAL,CAAqB,OAArB,EAA8B,EAA9B,CAAP;AACD;AAED;AACF;AACA;;;;SACE,eAA2B;AACzB,aAAO,KAAKT,KAAL,CAAWU,eAAX,CAA2B,KAA3B,CAAP;AACD;AAED;AACF;AACA;;;;SACE,eAA8B;AAC5B,aAAOf,SAAS,CAACgB,MAAV,CAAiB,cAAjB,EAAiC,eAAjC,EAAkD,eAAlD,CAAP;AACD;AAED;AACF;AACA;;;;;AAKE;AACF;AACA;AACE,mBAAuC;AACrC,aAAO,KAAKC,aAAL,GAAqB,KAAKA,aAA1B,GAA0C,IAAjD;AACD;AAED;AACF;AACA;;SAbE,aAAiBN,KAAjB,EAAyC;AACvC,WAAKM,aAAL,GAAqBN,KAAK,YAAYV,iBAAjB,GAAqCU,KAArC,GAA6C,IAAlE;AACD;;;SAYD,eAA0B;AAAA;;AACxB,4DAAO,KAAKE,YAAZ,uDAAO,mBAAmBK,UAA1B,yEAAwC,KAAxC;AACD;AAED;AACF;AACA;AACA;;;;SACE,eAA4B;AAC1B,UAAI,KAAKL,YAAL,IAAqB,IAArB,IAA6B,KAAKA,YAAL,CAAkBM,QAAlB,IAA8B,IAA/D,EAAqE;AACnE,eAAO,KAAKN,YAAL,CAAkBM,QAAlB,CAA2BZ,IAAlC;AACD;;AAED,aAAO,IAAP;AACD;;;WApFD,2BAAyBa,IAAzB,EAA2D;AACzD,aACEA,IAAI,CAACC,aAAL,CAAmBC,YAAnB,IACAF,IAAI,CAACC,aAAL,CAAmBC,YAAnB,KAAoC,aAFtC;AAID;;;;EAjB2CvB,a;;SAAzBI,gB","sourcesContent":["// @flow\nimport ResourceModel from \"../base/ResourceModel\";\nimport LinkModel from \"../links/LinkModel\";\nimport UserServicesModel from \"../user/UserServicesModel\";\n\nimport { NotAllowedUriException } from \"../../exceptions\";\n\nimport type { ModularUIModel } from \"../types\";\nimport type { ModularUIResponse } from \"../../modularui\";\nimport type LinkCollection from \"../links/LinkCollection\";\nimport type Href from \"../href/Href\";\n\n/**\n * The Application model\n */\nexport default class ApplicationModel extends ResourceModel {\n _userServices: ?UserServicesModel;\n\n /**\n * Retrieve type of model\n */\n get type(): string {\n return \"Application\";\n }\n\n /**\n */\n static isApplicableModel(data: ModularUIResponse): boolean {\n return (\n data.contributions.resourcetype &&\n data.contributions.resourcetype === \"Application\"\n );\n }\n\n /**\n */\n getInitialChildModelLinks(): Array<LinkModel> {\n const userService = this.links.getLinkByKey(\"UserServices\");\n if (userService && userService.href.path === \"/login\") {\n throw new NotAllowedUriException(\n \"The user service (Login panel) should not have the uri '/login', use a different URI because this uri matches the login service.\"\n );\n }\n\n return userService ? [userService] : [];\n }\n\n /**\n */\n setChildModels(models: Array<ModularUIModel>) {\n const userServiceModel = models.find(\n (model) => model.type === \"UserServices\"\n );\n\n if (userServiceModel) {\n this.userServices = userServiceModel;\n }\n }\n\n /**\n * Getting the label of the application\n */\n get label(): string {\n return this.getContribution(\"label\", \"\");\n }\n\n /**\n * Getting the tab links\n */\n get tabs(): LinkCollection {\n return this.links.getLinksByGroup(\"tab\");\n }\n\n /**\n * Get modelcatalog link\n */\n get modelcatalog(): LinkModel {\n return LinkModel.create(\"modelcatalog\", \"/modelcatalog\", \"Model catalog\");\n }\n\n /**\n * Set the userservices for this application\n */\n set userServices(model: ?ModularUIModel) {\n this._userServices = model instanceof UserServicesModel ? model : null;\n }\n\n /**\n * returns the userservices configured for this application\n */\n get userServices(): ?UserServicesModel {\n return this._userServices ? this._userServices : null;\n }\n\n /**\n * Indicates if the user is logged in\n */\n get isLoggedIn(): boolean {\n return this.userServices?.isLoggedIn ?? false;\n }\n\n /**\n * Retrieve link to the user information,\n * only available when the user services are available\n */\n get userHref(): Href | null {\n if (this.userServices != null && this.userServices.userLink != null) {\n return this.userServices.userLink.href;\n }\n\n return null;\n }\n}\n"],"file":"ApplicationModel.js"}
|
package/esm/models/href/Href.js
CHANGED
|
@@ -390,11 +390,21 @@ var Href = /*#__PURE__*/function () {
|
|
|
390
390
|
return this.querystring.length > 0 ? [this.path, this.querystring].join("?") : this.path;
|
|
391
391
|
}
|
|
392
392
|
/**
|
|
393
|
-
* Getting the URL including the base path
|
|
393
|
+
* Getting the URL including the base path, querystring is prefixed
|
|
394
394
|
*/
|
|
395
395
|
|
|
396
396
|
}, {
|
|
397
397
|
key: "absolutehref",
|
|
398
|
+
get: function get() {
|
|
399
|
+
var querystring = this.getQuerystring(false);
|
|
400
|
+
return querystring.length > 0 ? [this.absolutepath, querystring].join("?") : this.absolutepath;
|
|
401
|
+
}
|
|
402
|
+
/**
|
|
403
|
+
* Getting the URL including the base path, the querystring is prefixed
|
|
404
|
+
*/
|
|
405
|
+
|
|
406
|
+
}, {
|
|
407
|
+
key: "absolutehrefPrefixedQuerystring",
|
|
398
408
|
get: function get() {
|
|
399
409
|
var querystring = this.getQuerystring(true);
|
|
400
410
|
return querystring.length > 0 ? [this.absolutepath, querystring].join("?") : this.absolutepath;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/models/href/Href.js"],"names":["BASE","CONTENT_PATH","HTTP_METHODS","Parameter","IllegalArgumentException","Href","href","resourcetype","path","parameters","hash","state","method","GET","setFromHref","setFromString","setFromLocationOrObject","pathname","_path","search","addParametersFromString","Array","isArray","_parameters","param","addParameter","_name","_value","_prefix","getHashFromString","_hash","_state","getPathFromString","checkAbsoluteUrl","split","forEach","paramFromString","fromString","setParameter","name","value","prefix","removeParameter","push","getParameter","undefined","_method","withPrefix","toQuerystring","join","isModUIParameter","getQuerystring","_resourcetype","isExternal","querystring","length","absolutepath","thisPath","otherPath","equals","thisParams","toString","every","checkAbsolute","RegExp","test","decodedHref","decodeURI","hrefNoHash","substr","indexOf"],"mappings":";;;;;;;;;AACA,SAASA,IAAT,EAAeC,YAAf,EAA6BC,YAA7B,QAAiD,2BAAjD;AAEA,OAAOC,SAAP,MAAsB,wBAAtB;AACA,SAASC,wBAAT,QAAyC,kBAAzC;;AAgBA;AACA;AACA;IACMC,I;AAQJ;AACF;AACA;AACE,gBAAYC,IAAZ,EAA8BC,YAA9B,EAAqD;AAAA;;AAAA;;AAAA;;AAAA;;AAAA;;AAAA;;AAAA;;AACnD,SAAKC,IAAL,GAAY,EAAZ;AACA,SAAKC,UAAL,GAAkB,EAAlB;AACA,SAAKC,IAAL,GAAY,EAAZ;AACA,SAAKC,KAAL,GAAa,IAAb;AACA,SAAKC,MAAL,GAAcV,YAAY,CAACW,GAA3B;AACA,SAAKN,YAAL,GAAoBA,YAAY,IAAI,EAApC;;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sB,CAAtB,CAA3B,GAAsDkC,UAA7D;AACD;AAED;AACF;AACA;;;;WACE,6BAAoD;AAAA,UAA3B9D,IAA2B,uEAAZ,EAAY;AAClD,aAAO,0BAAAA,IAAI,MAAJ,CAAAA,IAAI,EAAU,GAAV,CAAJ,GAAqBA,IAAI,CAAC+D,MAAL,CAAY/D,IAAI,CAACgE,OAAL,CAAa,GAAb,IAAoB,CAAhC,CAArB,GAA0D,EAAjE;AACD;;;;;;AA+SH,eAAejE,IAAf","sourcesContent":["// @flow\nimport { BASE, CONTENT_PATH, HTTP_METHODS } from \"../../constants/Constants\";\n\nimport Parameter from \"../parameter/Parameter\";\nimport { IllegalArgumentException } from \"../../exceptions\";\n\nimport type { LocationShape } from \"react-router\";\n\ntype HrefObject = {\n _path: string,\n _hash: string,\n _parameters: Array<Parameter>,\n _resourcetype: string,\n _method: $Keys<typeof HTTP_METHODS>,\n _state: ?{ [key: string]: any },\n pathname: ?string,\n};\n\nexport type HrefInput = Href | HrefObject | LocationShape | string;\n\n/**\n * Defines a Href with the parameters\n */\nclass Href {\n _path: string;\n _hash: string;\n _parameters: Array<Parameter>;\n _resourcetype: string;\n _method: $Keys<typeof HTTP_METHODS>;\n _state: ?{ +[key: string]: any };\n\n /**\n * Create a Href\n */\n constructor(href?: HrefInput, resourcetype?: string) {\n this.path = \"\";\n this.parameters = [];\n this.hash = \"\";\n this.state = null;\n this.method = HTTP_METHODS.GET;\n this.resourcetype = resourcetype || \"\";\n\n if (href instanceof Href) {\n this.setFromHref(href);\n } else if (typeof href === \"string\") {\n this.setFromString(href);\n } else if (typeof href === \"object\") {\n this.setFromLocationOrObject(href);\n }\n }\n\n /**\n * Set parameters from Href model input\n */\n setFromHref(href: Href) {\n this.path = href.path;\n this.parameters = href.parameters;\n this.hash = href.hash;\n this.state = href.state;\n }\n\n /**\n */\n setFromLocationOrObject(href: LocationShape | HrefObject) {\n if (typeof href[\"pathname\"] === \"string\") {\n this.path = href.pathname;\n } else if (typeof href._path === \"string\") {\n this.path = href._path;\n }\n\n if (href.search) {\n this.addParametersFromString(href.search);\n } else if (Array.isArray(href._parameters)) {\n // $FlowExpectedError[incompatible-call]\n href._parameters.map((param: Parameter) =>\n this.addParameter(param._name, param._value, param._prefix)\n );\n }\n\n if (href.hash) {\n this.hash = Href.getHashFromString(href.hash);\n } else if (typeof href._hash === \"string\") {\n this.hash = href._hash;\n }\n\n if (href.state) {\n this.state = href.state || null;\n } else if (typeof href._state === \"object\") {\n this.state = href._state;\n }\n }\n\n /**\n * Set parameters from string input\n */\n setFromString(href: string) {\n this.path = Href.getPathFromString(href);\n this.addParametersFromString(href);\n this.hash = Href.getHashFromString(href);\n }\n\n /**\n */\n get isChangePassword(): boolean {\n return this._path.includes(\"/change-password\");\n }\n\n /**\n * check if the path is referencing a camel route\n */\n static isCamelRoute(path: string): boolean {\n return (\n path.startsWith(\"/restServices\") && !path.startsWith(\"/restServices/ui\")\n );\n }\n\n /**\n */\n static checkAbsoluteUrl(href: string): boolean {\n const checkAbsolute = new RegExp(\"^(?:[a-z]+:)?//\", \"i\");\n return checkAbsolute.test(href);\n }\n\n // Check if url is relative (not checking for absolute urls with same domain)\n /**\n */\n get isExternal(): boolean {\n return Href.checkAbsoluteUrl(this.path);\n }\n\n /**\n * Retrieve the relative path part of a href string, e.g. https://www.beinformed.com/BeInformed/tab/view?q=url => /tab/view\n */\n static getPathFromString(href: string): string {\n const decodedHref = decodeURI(href);\n\n const hrefNoHash = decodedHref.includes(\"#\")\n ? decodedHref.substr(0, decodedHref.indexOf(\"#\"))\n : decodedHref;\n\n return hrefNoHash.includes(\"?\") ? hrefNoHash.split(\"?\")[0] : hrefNoHash;\n }\n\n /**\n * Retrieve hash of href string\n */\n static getHashFromString(href: string = \"\"): string {\n return href.includes(\"#\") ? href.substr(href.indexOf(\"#\") + 1) : \"\";\n }\n\n /**\n * Add a parameter for each parameter found in the querystring of an URL string, e.g. https://www.beinformed.com?q=url => q=url\n */\n addParametersFromString(href: string): Href {\n if (href.includes(\"?\")) {\n href\n .split(\"?\")[1]\n .split(\"&\")\n .forEach((param) => {\n const paramFromString = Parameter.fromString(param);\n if (paramFromString) {\n this.setParameter(\n paramFromString.name,\n paramFromString.value,\n paramFromString.prefix\n );\n }\n });\n }\n\n return this;\n }\n\n /**\n * Add a querystring parameter to the parameter collection of this Href, skips parameters that have a value of null\n */\n addParameter(name: string, value: ?string, prefix: ?string): Href {\n if (value !== null) {\n this.removeParameter(name, prefix);\n this._parameters.push(new Parameter(prefix, name, value));\n }\n\n return this;\n }\n\n /**\n * Adds or overwrites a parameter when it exists and value is not null.\n * Removes the parameter when the value is null\n */\n setParameter(name: string, value: ?string, prefix: ?string): Href {\n if (value === null) {\n this.removeParameter(name, prefix);\n } else {\n this.addParameter(name, value, prefix);\n }\n\n return this;\n }\n\n /**\n * Retrieve a parameter by it's name and (optionally) prefix\n */\n getParameter(name: string, prefix: ?string): ?Parameter {\n return this._parameters.find(\n (param) => param.prefix === prefix && param.name === name\n );\n }\n\n /**\n */\n hasParameter(name: string, prefix: ?string): boolean {\n return this.getParameter(name, prefix) !== undefined;\n }\n\n /**\n * Get request method\n */\n get method(): $Keys<typeof HTTP_METHODS> {\n return this._method;\n }\n\n /**\n * Set request method\n */\n set method(method: $Keys<typeof HTTP_METHODS>) {\n this._method = method || HTTP_METHODS.GET;\n }\n\n /**\n * Retrieve all paremters\n */\n get parameters(): Array<Parameter> {\n return this._parameters;\n }\n\n /**\n * Replace parameters of Href\n */\n set parameters(parameters: Array<Parameter>) {\n this._parameters = parameters;\n }\n\n /**\n * Remove a parameter from the parameter collection\n */\n removeParameter(name: string, prefix: ?string): Href {\n this._parameters = this._parameters.filter(\n (param) => param.prefix !== prefix || param.name !== name\n );\n\n return this;\n }\n\n /**\n * Get the parameters as a querystring, e.g. param1=value1¶m2=value2, optionally with prefix\n */\n getQuerystring(withPrefix: boolean = false): string {\n return this.parameters\n .filter((param) => param.value != null)\n .map((param) => param.toQuerystring(withPrefix))\n .join(\"&\");\n }\n\n /**\n * Retrieve a querystring that only contains parameter that can be send to the modular ui, parameters are filtered by prefix\n */\n getQuerystringForModularUI(prefix: string = \"\"): string {\n return this.parameters\n .filter(\n (param) =>\n param.isModUIParameter &&\n (!prefix || !param.prefix || param.prefix === prefix) &&\n param.value != null\n )\n .map((param) => param.toQuerystring(false))\n .join(\"&\");\n }\n\n /**\n * Retrieve all parameters from the parameter collection in a querystring style name1=value1&name2=value2, without the prefix\n */\n get querystring(): string {\n return this.getQuerystring(false);\n }\n\n /**\n * Set the path of the Href, the part before the querystring question mark\n */\n set path(path: string) {\n this._path = path;\n }\n\n /**\n * Retrieve the path\n */\n get path(): string {\n return this._path || \"\";\n }\n\n /**\n * Set hash\n */\n set hash(hash: string) {\n this._hash = hash;\n }\n\n /**\n * Retrieve hash\n */\n get hash(): string {\n return this._hash;\n }\n\n /**\n */\n set state(state: ?{ +[key: string]: any }) {\n this._state = state;\n }\n\n /**\n */\n get state(): ?{ +[key: string]: any } {\n return this._state;\n }\n\n /**\n */\n setState(state: { [key: string]: any }): Href {\n this.state = state;\n\n return this;\n }\n\n /**\n * Set resourctype\n */\n set resourcetype(resourcetype: string) {\n this._resourcetype = resourcetype;\n }\n\n /**\n * Retrieve resourceType\n */\n get resourcetype(): string {\n return this._resourcetype;\n }\n\n /**\n * Retrieve the path combined with the BASE of the application, e.g. /BeInformed\n */\n get absolutepath(): string {\n if (this.isExternal) {\n return this.path;\n }\n\n return BASE + this.path;\n }\n\n /**\n * Retrieves the combination of the path and the querystring\n */\n get href(): string {\n return this.querystring.length > 0\n ? [this.path, this.querystring].join(\"?\")\n : this.path;\n }\n\n /**\n * Getting the URL including the base path\n */\n get absolutehref(): string {\n const querystring = this.getQuerystring(true);\n\n return querystring.length > 0\n ? [this.absolutepath, querystring].join(\"?\")\n : this.absolutepath;\n }\n\n /**\n * Checks if the URL starts within the given href\n */\n startsWith(href: Href | string): boolean {\n const thisPath = `${this.path}/`;\n const otherPath = href instanceof Href ? `${href.path}/` : href;\n\n return thisPath.startsWith(otherPath);\n }\n\n /**\n * Checks if the given Href equals this Href\n */\n equals(href: Href | string): boolean {\n if (href instanceof Href) {\n return this.path === href.path;\n }\n\n return this.path === href;\n }\n\n /**\n */\n equalsWithParameters(href: Href): boolean {\n if (!this.equals(href)) {\n return false;\n }\n\n if (href instanceof Href) {\n if (this.parameters.length !== href.parameters.length) {\n return false;\n }\n\n if (this.parameters.length === 0 && href.parameters.length === 0) {\n return true;\n }\n\n const thisParams = this.parameters.map((param) => param.toString());\n\n return href.parameters.every((param) =>\n thisParams.includes(param.toString())\n );\n }\n\n throw new IllegalArgumentException(`${href} is not an instance of Href`);\n }\n\n /**\n * Indicates if the link is a content link\n */\n get isContent(): boolean {\n return this.absolutepath.startsWith(CONTENT_PATH);\n }\n\n /**\n * Returns a complete url from the Href\n */\n toString(): string {\n return this.href;\n }\n\n /**\n */\n toLocation(): LocationShape {\n return {\n pathname: this.path,\n search: this.querystring.length > 0 ? `?${this.querystring}` : \"\",\n hash: this.hash.length > 0 ? `#${this.hash}` : \"\",\n state: this.state,\n };\n }\n}\n\nexport default Href;\n"],"file":"Href.js"}
|
|
1
|
+
{"version":3,"sources":["../../../src/models/href/Href.js"],"names":["BASE","CONTENT_PATH","HTTP_METHODS","Parameter","IllegalArgumentException","Href","href","resourcetype","path","parameters","hash","state","method","GET","setFromHref","setFromString","setFromLocationOrObject","pathname","_path","search","addParametersFromString","Array","isArray","_parameters","param","addParameter","_name","_value","_prefix","getHashFromString","_hash","_state","getPathFromString","checkAbsoluteUrl","split","forEach","paramFromString","fromString","setParameter","name","value","prefix","removeParameter","push","getParameter","undefined","_method","withPrefix","toQuerystring","join","isModUIParameter","getQuerystring","_resourcetype","isExternal","querystring","length","absolutepath","thisPath","otherPath","equals","thisParams","toString","every","checkAbsolute","RegExp","test","decodedHref","decodeURI","hrefNoHash","substr","indexOf"],"mappings":";;;;;;;;;AACA,SAASA,IAAT,EAAeC,YAAf,EAA6BC,YAA7B,QAAiD,2B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AI,EAAY,eAAZ,CAAJ,IAAoC,CAAC,4BAAAA,IAAI,MAAJ,CAAAA,IAAI,EAAY,kBAAZ,CAD3C;AAGD;AAED;AACF;;;;WACE,0BAAwBF,IAAxB,EAA+C;AAC7C,UAAMyD,aAAa,GAAG,IAAIC,MAAJ,CAAW,iBAAX,EAA8B,GAA9B,CAAtB;AACA,aAAOD,aAAa,CAACE,IAAd,CAAmB3D,IAAnB,CAAP;AACD;;;WAYD,2BAAyBA,IAAzB,EAA+C;AAC7C,UAAM4D,WAAW,GAAGC,SAAS,CAAC7D,IAAD,CAA7B;AAEA,UAAM8D,UAAU,GAAG,0BAAAF,WAAW,MAAX,CAAAA,WAAW,EAAU,GAAV,CAAX,GACfA,WAAW,CAACG,MAAZ,CAAmB,CAAnB,EAAsBH,WAAW,CAACI,OAAZ,CAAoB,GAApB,CAAtB,CADe,GAEfJ,WAFJ;AAIA,aAAO,0BAAAE,UAAU,MAAV,CAAAA,UAAU,EAAU,GAAV,CAAV,GAA2BA,UAAU,CAAClC,KAAX,CAAiB,GAAjB,EAAsB,CAAtB,CAA3B,GAAsDkC,UAA7D;AACD;AAED;AACF;AACA;;;;WACE,6BAAoD;AAAA,UAA3B9D,IAA2B,uEAAZ,EAAY;AAClD,aAAO,0BAAAA,IAAI,MAAJ,CAAAA,IAAI,EAAU,GAAV,CAAJ,GAAqBA,IAAI,CAAC+D,MAAL,CAAY/D,IAAI,CAACgE,OAAL,CAAa,GAAb,IAAoB,CAAhC,CAArB,GAA0D,EAAjE;AACD;;;;;;AA0TH,eAAejE,IAAf","sourcesContent":["// @flow\nimport { BASE, CONTENT_PATH, HTTP_METHODS } from \"../../constants/Constants\";\n\nimport Parameter from \"../parameter/Parameter\";\nimport { IllegalArgumentException } from \"../../exceptions\";\n\nimport type { LocationShape } from \"react-router\";\n\ntype HrefObject = {\n _path: string,\n _hash: string,\n _parameters: Array<Parameter>,\n _resourcetype: string,\n _method: $Keys<typeof HTTP_METHODS>,\n _state: ?{ [key: string]: any },\n pathname: ?string,\n};\n\nexport type HrefInput = Href | HrefObject | LocationShape | string;\n\n/**\n * Defines a Href with the parameters\n */\nclass Href {\n _path: string;\n _hash: string;\n _parameters: Array<Parameter>;\n _resourcetype: string;\n _method: $Keys<typeof HTTP_METHODS>;\n _state: ?{ +[key: string]: any };\n\n /**\n * Create a Href\n */\n constructor(href?: HrefInput, resourcetype?: string) {\n this.path = \"\";\n this.parameters = [];\n this.hash = \"\";\n this.state = null;\n this.method = HTTP_METHODS.GET;\n this.resourcetype = resourcetype || \"\";\n\n if (href instanceof Href) {\n this.setFromHref(href);\n } else if (typeof href === \"string\") {\n this.setFromString(href);\n } else if (typeof href === \"object\") {\n this.setFromLocationOrObject(href);\n }\n }\n\n /**\n * Set parameters from Href model input\n */\n setFromHref(href: Href) {\n this.path = href.path;\n this.parameters = href.parameters;\n this.hash = href.hash;\n this.state = href.state;\n }\n\n /**\n */\n setFromLocationOrObject(href: LocationShape | HrefObject) {\n if (typeof href[\"pathname\"] === \"string\") {\n this.path = href.pathname;\n } else if (typeof href._path === \"string\") {\n this.path = href._path;\n }\n\n if (href.search) {\n this.addParametersFromString(href.search);\n } else if (Array.isArray(href._parameters)) {\n // $FlowExpectedError[incompatible-call]\n href._parameters.map((param: Parameter) =>\n this.addParameter(param._name, param._value, param._prefix)\n );\n }\n\n if (href.hash) {\n this.hash = Href.getHashFromString(href.hash);\n } else if (typeof href._hash === \"string\") {\n this.hash = href._hash;\n }\n\n if (href.state) {\n this.state = href.state || null;\n } else if (typeof href._state === \"object\") {\n this.state = href._state;\n }\n }\n\n /**\n * Set parameters from string input\n */\n setFromString(href: string) {\n this.path = Href.getPathFromString(href);\n this.addParametersFromString(href);\n this.hash = Href.getHashFromString(href);\n }\n\n /**\n */\n get isChangePassword(): boolean {\n return this._path.includes(\"/change-password\");\n }\n\n /**\n * check if the path is referencing a camel route\n */\n static isCamelRoute(path: string): boolean {\n return (\n path.startsWith(\"/restServices\") && !path.startsWith(\"/restServices/ui\")\n );\n }\n\n /**\n */\n static checkAbsoluteUrl(href: string): boolean {\n const checkAbsolute = new RegExp(\"^(?:[a-z]+:)?//\", \"i\");\n return checkAbsolute.test(href);\n }\n\n // Check if url is relative (not checking for absolute urls with same domain)\n /**\n */\n get isExternal(): boolean {\n return Href.checkAbsoluteUrl(this.path);\n }\n\n /**\n * Retrieve the relative path part of a href string, e.g. https://www.beinformed.com/BeInformed/tab/view?q=url => /tab/view\n */\n static getPathFromString(href: string): string {\n const decodedHref = decodeURI(href);\n\n const hrefNoHash = decodedHref.includes(\"#\")\n ? decodedHref.substr(0, decodedHref.indexOf(\"#\"))\n : decodedHref;\n\n return hrefNoHash.includes(\"?\") ? hrefNoHash.split(\"?\")[0] : hrefNoHash;\n }\n\n /**\n * Retrieve hash of href string\n */\n static getHashFromString(href: string = \"\"): string {\n return href.includes(\"#\") ? href.substr(href.indexOf(\"#\") + 1) : \"\";\n }\n\n /**\n * Add a parameter for each parameter found in the querystring of an URL string, e.g. https://www.beinformed.com?q=url => q=url\n */\n addParametersFromString(href: string): Href {\n if (href.includes(\"?\")) {\n href\n .split(\"?\")[1]\n .split(\"&\")\n .forEach((param) => {\n const paramFromString = Parameter.fromString(param);\n if (paramFromString) {\n this.setParameter(\n paramFromString.name,\n paramFromString.value,\n paramFromString.prefix\n );\n }\n });\n }\n\n return this;\n }\n\n /**\n * Add a querystring parameter to the parameter collection of this Href, skips parameters that have a value of null\n */\n addParameter(name: string, value: ?string, prefix: ?string): Href {\n if (value !== null) {\n this.removeParameter(name, prefix);\n this._parameters.push(new Parameter(prefix, name, value));\n }\n\n return this;\n }\n\n /**\n * Adds or overwrites a parameter when it exists and value is not null.\n * Removes the parameter when the value is null\n */\n setParameter(name: string, value: ?string, prefix: ?string): Href {\n if (value === null) {\n this.removeParameter(name, prefix);\n } else {\n this.addParameter(name, value, prefix);\n }\n\n return this;\n }\n\n /**\n * Retrieve a parameter by it's name and (optionally) prefix\n */\n getParameter(name: string, prefix: ?string): ?Parameter {\n return this._parameters.find(\n (param) => param.prefix === prefix && param.name === name\n );\n }\n\n /**\n */\n hasParameter(name: string, prefix: ?string): boolean {\n return this.getParameter(name, prefix) !== undefined;\n }\n\n /**\n * Get request method\n */\n get method(): $Keys<typeof HTTP_METHODS> {\n return this._method;\n }\n\n /**\n * Set request method\n */\n set method(method: $Keys<typeof HTTP_METHODS>) {\n this._method = method || HTTP_METHODS.GET;\n }\n\n /**\n * Retrieve all paremters\n */\n get parameters(): Array<Parameter> {\n return this._parameters;\n }\n\n /**\n * Replace parameters of Href\n */\n set parameters(parameters: Array<Parameter>) {\n this._parameters = parameters;\n }\n\n /**\n * Remove a parameter from the parameter collection\n */\n removeParameter(name: string, prefix: ?string): Href {\n this._parameters = this._parameters.filter(\n (param) => param.prefix !== prefix || param.name !== name\n );\n\n return this;\n }\n\n /**\n * Get the parameters as a querystring, e.g. param1=value1¶m2=value2, optionally with prefix\n */\n getQuerystring(withPrefix: boolean = false): string {\n return this.parameters\n .filter((param) => param.value != null)\n .map((param) => param.toQuerystring(withPrefix))\n .join(\"&\");\n }\n\n /**\n * Retrieve a querystring that only contains parameter that can be send to the modular ui, parameters are filtered by prefix\n */\n getQuerystringForModularUI(prefix: string = \"\"): string {\n return this.parameters\n .filter(\n (param) =>\n param.isModUIParameter &&\n (!prefix || !param.prefix || param.prefix === prefix) &&\n param.value != null\n )\n .map((param) => param.toQuerystring(false))\n .join(\"&\");\n }\n\n /**\n * Retrieve all parameters from the parameter collection in a querystring style name1=value1&name2=value2, without the prefix\n */\n get querystring(): string {\n return this.getQuerystring(false);\n }\n\n /**\n * Set the path of the Href, the part before the querystring question mark\n */\n set path(path: string) {\n this._path = path;\n }\n\n /**\n * Retrieve the path\n */\n get path(): string {\n return this._path || \"\";\n }\n\n /**\n * Set hash\n */\n set hash(hash: string) {\n this._hash = hash;\n }\n\n /**\n * Retrieve hash\n */\n get hash(): string {\n return this._hash;\n }\n\n /**\n */\n set state(state: ?{ +[key: string]: any }) {\n this._state = state;\n }\n\n /**\n */\n get state(): ?{ +[key: string]: any } {\n return this._state;\n }\n\n /**\n */\n setState(state: { [key: string]: any }): Href {\n this.state = state;\n\n return this;\n }\n\n /**\n * Set resourctype\n */\n set resourcetype(resourcetype: string) {\n this._resourcetype = resourcetype;\n }\n\n /**\n * Retrieve resourceType\n */\n get resourcetype(): string {\n return this._resourcetype;\n }\n\n /**\n * Retrieve the path combined with the BASE of the application, e.g. /BeInformed\n */\n get absolutepath(): string {\n if (this.isExternal) {\n return this.path;\n }\n\n return BASE + this.path;\n }\n\n /**\n * Retrieves the combination of the path and the querystring\n */\n get href(): string {\n return this.querystring.length > 0\n ? [this.path, this.querystring].join(\"?\")\n : this.path;\n }\n\n /**\n * Getting the URL including the base path, querystring is prefixed\n */\n get absolutehref(): string {\n const querystring = this.getQuerystring(false);\n\n return querystring.length > 0\n ? [this.absolutepath, querystring].join(\"?\")\n : this.absolutepath;\n }\n\n /**\n * Getting the URL including the base path, the querystring is prefixed\n */\n get absolutehrefPrefixedQuerystring(): string {\n const querystring = this.getQuerystring(true);\n\n return querystring.length > 0\n ? [this.absolutepath, querystring].join(\"?\")\n : this.absolutepath;\n }\n\n /**\n * Checks if the URL starts within the given href\n */\n startsWith(href: Href | string): boolean {\n const thisPath = `${this.path}/`;\n const otherPath = href instanceof Href ? `${href.path}/` : href;\n\n return thisPath.startsWith(otherPath);\n }\n\n /**\n * Checks if the given Href equals this Href\n */\n equals(href: Href | string): boolean {\n if (href instanceof Href) {\n return this.path === href.path;\n }\n\n return this.path === href;\n }\n\n /**\n */\n equalsWithParameters(href: Href): boolean {\n if (!this.equals(href)) {\n return false;\n }\n\n if (href instanceof Href) {\n if (this.parameters.length !== href.parameters.length) {\n return false;\n }\n\n if (this.parameters.length === 0 && href.parameters.length === 0) {\n return true;\n }\n\n const thisParams = this.parameters.map((param) => param.toString());\n\n return href.parameters.every((param) =>\n thisParams.includes(param.toString())\n );\n }\n\n throw new IllegalArgumentException(`${href} is not an instance of Href`);\n }\n\n /**\n * Indicates if the link is a content link\n */\n get isContent(): boolean {\n return this.absolutepath.startsWith(CONTENT_PATH);\n }\n\n /**\n * Returns a complete url from the Href\n */\n toString(): string {\n return this.href;\n }\n\n /**\n */\n toLocation(): LocationShape {\n return {\n pathname: this.path,\n search: this.querystring.length > 0 ? `?${this.querystring}` : \"\",\n hash: this.hash.length > 0 ? `#${this.hash}` : \"\",\n state: this.state,\n };\n }\n}\n\nexport default Href;\n"],"file":"Href.js"}
|
package/esm/models/index.js
CHANGED
|
@@ -9,6 +9,7 @@ export { default as AttributeModel } from "./attributes/AttributeModel";
|
|
|
9
9
|
import { default as BooleanAttributeModel } from "./attributes/BooleanAttributeModel";
|
|
10
10
|
import { default as CaptchaAttributeModel } from "./attributes/CaptchaAttributeModel";
|
|
11
11
|
import { default as ChoiceAttributeModel } from "./attributes/ChoiceAttributeModel";
|
|
12
|
+
export { default as ChoiceAttributeOptionCollection } from "./attributes/ChoiceAttributeOptionCollection";
|
|
12
13
|
export { default as ChoiceAttributeOptionModel } from "./attributes/ChoiceAttributeOptionModel";
|
|
13
14
|
import { default as CompositeAttributeModel } from "./attributes/CompositeAttributeModel";
|
|
14
15
|
export { default as CompositeAttributeChildCollection } from "./attributes/CompositeAttributeChildCollection";
|
package/esm/models/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/models/index.js"],"names":["default","resolveModel","BaseCollection","ActionCollection","ActionModel","ApplicationModel","AttributeCollection","AttributeSetModel","AttributeModel","BooleanAttributeModel","CaptchaAttributeModel","ChoiceAttributeModel","ChoiceAttributeOptionModel","CompositeAttributeModel","CompositeAttributeChildCollection","DatetimeAttributeModel","HelptextAttributeModel","LabelAttributeModel","MemoAttributeModel","MoneyAttributeModel","NumberAttributeModel","PasswordAttributeModel","StringAttributeModel","UploadAttributeModel","XMLAttributeModel","AttributeContent","LayoutHintRuleCollection","addLayoutHintRule","updateLayoutHintRules","BaseLayoutHintRule","DependentAttribute","RemainingTotalUploadSize","CaseViewModel","BusinessScenarioModel","ConceptDetailModel","ConceptIndexModel","ConceptLinkModel","ConceptRelationCollection","ConceptRelationModel","ConceptTypeDetailModel","SourceReferenceCollection","SourceReferenceModel","ConstraintCollection","ConstraintModel","ContentIndexModel","ContentLinkModel","ContentModel","ContentTOCModel","ContentTypeModel","SectionModel","SubSectionModel","ContentConfiguration","ContentConfigurationElements","ContentConfigurationEndResults","ContentConfigurationQuestions","ContentConfigurationResults","DetailModel","ErrorCollection","ErrorModel","ErrorResponse","AssignmentFilterModel","FilterModel","RangeFilterModel","ConceptIndexFilterModel","FilterCollection","FormModel","FormObjectModel","GroupingModel","GroupModel","Href","ListHref","LinkCollection","LinkModel","ListDetailModel","ListHeaderModel","ListItemCollection","ListItemModel","ListModel","LookupOptionsModel","LookupOptionCollection","ModelCatalogModel","ProcessStatusSettingsModel","PagesizeModel","PagingModel","Parameter","GroupingPanelModel","CaseSearchModel","SortingModel","SortOptionModel","TabModel","TaskGroupCollection","TaskGroupModel","UserModel","UserProfileModel","UserServicesModel"],"mappings":"AACA,SAASA,OAAO,IAAIC,YAApB,QAAwC,gBAAxC;AAEA,SAASD,OAAO,IAAIE,cAApB,QAA0C,uBAA1C;AAEA,SAASF,OAAO,IAAIG,gBAApB,QAA4C,4BAA5C;AACA,SAASH,OAAO,IAAII,WAApB,QAAuC,uBAAvC;AAEA,SAASJ,OAAO,IAAIK,gBAApB,QAA4C,gCAA5C;AAEA,SAASL,OAAO,IAAIM,mBAApB,QAA+C,kCAA/C;AACA,SAASN,OAAO,IAAIO,iBAApB,QAA6C,gCAA7C;AAEA,SAASP,OAAO,IAAIQ,cAApB,QAA0C,6BAA1C;AACA,SAASR,OAAO,IAAIS,qBAApB,QAAiD,oCAAjD;AACA,SAAST,OAAO,IAAIU,qBAApB,QAAiD,oCAAjD;AACA,SAASV,OAAO,IAAIW,oBAApB,QAAgD,mCAAhD;AACA,SAASX,OAAO,IAAIY,0BAApB,QAAsD,yCAAtD;AACA,S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AO,IAAI0F,mBAApB,QAA+C,iCAA/C;AACA,SAAS1F,OAAO,IAAI2F,cAApB,QAA0C,4BAA1C;AAEA,SAAS3F,OAAO,IAAI4F,SAApB,QAAqC,kBAArC;AACA,SAAS5F,OAAO,IAAI6F,gBAApB,QAA4C,yBAA5C;AACA,SAAS7F,OAAO,IAAI8F,iBAApB,QAA6C,0BAA7C;AAEA,SACEzF,gBADF,EAEEiF,eAFF,EAGEtD,aAHF,EAIEyC,eAJF,EAKEjB,WALF,EAMES,SANF,EAOEoB,kBAPF,EAQER,SARF,EASEY,QATF,EAUEE,cAVF,EAWEC,SAXF,EAYEC,gBAZF,EAaEC,iBAbF,EAcEd,iBAdF,EAeE7C,iBAfF,EAgBED,kBAhBF,EAiBED,qBAjBF,EAkBEM,sBAlBF,EAmBEK,iBAnBF,EAoBEG,eApBF,EAqBED,YArBF,EAsBEE,gBAtBF,EAuBEvC,qBAvBF,EAwBEC,qBAxBF,EAyBEC,oBAzBF,EA0BEI,sBA1BF,EA2BEC,sBA3BF,EA4BEC,mBA5BF,EA6BEC,kBA7BF,EA8BEC,mBA9BF,EA+BEC,oBA/BF,EAgCEC,sBAhCF,EAiCER,uBAjCF,EAkCES,oBAlCF,EAmCEC,oBAnCF,EAoCEC,iBApCF,EAqCEoC,qBArCF,EAsCEC,WAtCF,EAuCEC,gBAvCF,EAwCEC,uBAxCF","sourcesContent":["// @flow\nexport { default as resolveModel } from \"./resolveModel\";\n\nexport { default as BaseCollection } from \"./base/BaseCollection\";\n\nexport { default as ActionCollection } from \"./actions/ActionCollection\";\nexport { default as ActionModel } from \"./actions/ActionModel\";\n\nimport { default as ApplicationModel } from \"./application/ApplicationModel\";\n\nexport { default as AttributeCollection } from \"./attributes/AttributeCollection\";\nexport { default as AttributeSetModel } from \"./attributes/AttributeSetModel\";\n\nexport { default as AttributeModel } from \"./attributes/AttributeModel\";\nimport { default as BooleanAttributeModel } from \"./attributes/BooleanAttributeModel\";\nimport { default as CaptchaAttributeModel } from \"./attributes/CaptchaAttributeModel\";\nimport { default as ChoiceAttributeModel } from \"./attributes/ChoiceAttributeModel\";\nexport { default as ChoiceAttributeOptionModel } from \"./attributes/ChoiceAttributeOptionModel\";\nimport { default as CompositeAttributeModel } from \"./attributes/CompositeAttributeModel\";\nexport { default as CompositeAttributeChildCollection } from \"./attributes/CompositeAttributeChildCollection\";\nimport { default as DatetimeAttributeModel } from \"./attributes/DatetimeAttributeModel\";\nimport { default as HelptextAttributeModel } from \"./attributes/HelptextAttributeModel\";\nimport { default as LabelAttributeModel } from \"./attributes/LabelAttributeModel\";\nimport { default as MemoAttributeModel } from \"./attributes/MemoAttributeModel\";\nimport { default as MoneyAttributeModel } from \"./attributes/MoneyAttributeModel\";\nimport { default as NumberAttributeModel } from \"./attributes/NumberAttributeModel\";\nimport { default as PasswordAttributeModel } from \"./attributes/PasswordAttributeModel\";\nimport { default as StringAttributeModel } from \"./attributes/StringAttributeModel\";\nimport { default as UploadAttributeModel } from \"./attributes/UploadAttributeModel\";\nimport { default as XMLAttributeModel } from \"./attributes/XMLAttributeModel\";\n\nexport { default as AttributeContent } from \"./attributes/AttributeContent\";\n\nexport {\n default as LayoutHintRuleCollection,\n addLayoutHintRule,\n updateLayoutHintRules,\n} from \"./attributes/layouthint-rules/LayoutHintRuleCollection\";\nexport { default as BaseLayoutHintRule } from \"./attributes/layouthint-rules/BaseLayoutHintRule\";\nexport { default as DependentAttribute } from \"./attributes/layouthint-rules/DependentAttribute\";\nexport { default as RemainingTotalUploadSize } from \"./attributes/layouthint-rules/RemainingTotalUploadSize\";\n\nimport { default as CaseViewModel } from \"./caseview/CaseViewModel\";\n\nimport { default as BusinessScenarioModel } from \"./concepts/BusinessScenarioModel\";\nimport { default as ConceptDetailModel } from \"./concepts/ConceptDetailModel\";\nimport { default as ConceptIndexModel } from \"./concepts/ConceptIndexModel\";\nexport { default as ConceptLinkModel } from \"./concepts/ConceptLinkModel\";\nexport { default as ConceptRelationCollection } from \"./concepts/ConceptRelationCollection\";\nexport { default as ConceptRelationModel } from \"./concepts/ConceptRelationModel\";\nimport { default as ConceptTypeDetailModel } from \"./concepts/ConceptTypeDetailModel\";\nexport { default as SourceReferenceCollection } from \"./concepts/SourceReferenceCollection\";\nexport { default as SourceReferenceModel } from \"./concepts/SourceReferenceModel\";\n\nexport { default as ConstraintCollection } from \"./attributes/input-constraints/ConstraintCollection\";\nexport { default as ConstraintModel } from \"./attributes/input-constraints/ConstraintModel\";\n\nimport { default as ContentIndexModel } from \"./content/ContentIndexModel\";\nexport { default as ContentLinkModel } from \"./content/ContentLinkModel\";\nimport { default as ContentModel } from \"./content/ContentModel\";\nimport { default as ContentTOCModel } from \"./content/ContentTOCModel\";\nimport { default as ContentTypeModel } from \"./content/ContentTypeModel\";\nexport { default as SectionModel } from \"./content/SectionModel\";\nexport { default as SubSectionModel } from \"./content/SubSectionModel\";\n\nexport { default as ContentConfiguration } from \"./contentconfiguration/ContentConfiguration\";\nexport { default as ContentConfigurationElements } from \"./contentconfiguration/ContentConfigurationElements\";\nexport { default as ContentConfigurationEndResults } from \"./contentconfiguration/ContentConfigurationEndResults\";\nexport { default as ContentConfigurationQuestions } from \"./contentconfiguration/ContentConfigurationQuestions\";\nexport { default as ContentConfigurationResults } from \"./contentconfiguration/ContentConfigurationResults\";\n\nimport { default as DetailModel } from \"./detail/DetailModel\";\n\nexport { default as ErrorCollection } from \"./error/ErrorCollection\";\nexport { default as ErrorModel } from \"./error/ErrorModel\";\nexport { default as ErrorResponse } from \"./error/ErrorResponse\";\n\nimport { default as AssignmentFilterModel } from \"./filters/AssignmentFilterModel\";\nimport { default as FilterModel } from \"./filters/FilterModel\";\nimport { default as RangeFilterModel } from \"./filters/RangeFilterModel\";\nimport { default as ConceptIndexFilterModel } from \"./filters/ConceptIndexFilterModel\";\nexport { default as FilterCollection } from \"./filters/FilterCollection\";\n\nimport { default as FormModel } from \"./form/FormModel\";\nexport { default as FormObjectModel } from \"./form/FormObjectModel\";\n\nexport { default as GroupingModel, GroupModel } from \"./grouping/GroupingModel\";\n\nexport { default as Href } from \"./href/Href\";\nexport { default as ListHref } from \"./href/ListHref\";\n\nexport { default as LinkCollection } from \"./links/LinkCollection\";\nexport { default as LinkModel } from \"./links/LinkModel\";\n\nimport { default as ListDetailModel } from \"./list/ListDetailModel\";\nexport { default as ListHeaderModel } from \"./list/ListHeaderModel\";\nexport { default as ListItemCollection } from \"./list/ListItemCollection\";\nexport { default as ListItemModel } from \"./list/ListItemModel\";\nimport { default as ListModel } from \"./list/ListModel\";\n\nexport { default as LookupOptionsModel } from \"./lookup/LookupOptionsModel\";\nexport { default as LookupOptionCollection } from \"./lookup/LookupOptionCollection\";\n\nimport { default as ModelCatalogModel } from \"./modelcatalog/ModelCatalogModel\";\n\nexport { default as ProcessStatusSettingsModel } from \"./process/ProcessStatusSettingsModel\";\n\nexport { default as PagesizeModel } from \"./paging/PagesizeModel\";\nexport { default as PagingModel } from \"./paging/PagingModel\";\n\nexport { default as Parameter } from \"./parameter/Parameter\";\n\nimport { default as GroupingPanelModel } from \"./panels/GroupingPanelModel\";\n\nimport { default as CaseSearchModel } from \"./search/CaseSearchModel\";\n\nexport { default as SortingModel } from \"./sorting/SortingModel\";\nexport { default as SortOptionModel } from \"./sorting/SortOptionModel\";\n\nimport { default as TabModel } from \"./tab/TabModel\";\n\nexport { default as TaskGroupCollection } from \"./taskgroup/TaskGroupCollection\";\nimport { default as TaskGroupModel } from \"./taskgroup/TaskGroupModel\";\n\nimport { default as UserModel } from \"./user/UserModel\";\nimport { default as UserProfileModel } from \"./user/UserProfileModel\";\nimport { default as UserServicesModel } from \"./user/UserServicesModel\";\n\nexport {\n ApplicationModel,\n CaseSearchModel,\n CaseViewModel,\n ListDetailModel,\n DetailModel,\n FormModel,\n GroupingPanelModel,\n ListModel,\n TabModel,\n TaskGroupModel,\n UserModel,\n UserProfileModel,\n UserServicesModel,\n ModelCatalogModel,\n ConceptIndexModel,\n ConceptDetailModel,\n BusinessScenarioModel,\n ConceptTypeDetailModel,\n ContentIndexModel,\n ContentTOCModel,\n ContentModel,\n ContentTypeModel,\n BooleanAttributeModel,\n CaptchaAttributeModel,\n ChoiceAttributeModel,\n DatetimeAttributeModel,\n HelptextAttributeModel,\n LabelAttributeModel,\n MemoAttributeModel,\n MoneyAttributeModel,\n NumberAttributeModel,\n PasswordAttributeModel,\n CompositeAttributeModel,\n StringAttributeModel,\n UploadAttributeModel,\n XMLAttributeModel,\n AssignmentFilterModel,\n FilterModel,\n RangeFilterModel,\n ConceptIndexFilterModel,\n};\n\nexport type * from \"./types\";\n"],"file":"index.js"}
|
|
1
|
+
{"version":3,"sources":["../../src/models/index.js"],"names":["default","resolveModel","BaseCollection","ActionCollection","ActionModel","ApplicationModel","AttributeCollection","AttributeSetModel","AttributeModel","BooleanAttributeModel","CaptchaAttributeModel","ChoiceAttributeModel","ChoiceAttributeOptionCollection","ChoiceAttributeOptionModel","CompositeAttributeModel","CompositeAttributeChildCollection","DatetimeAttributeModel","HelptextAttributeModel","LabelAttributeModel","MemoAttributeModel","MoneyAttributeModel","NumberAttributeModel","PasswordAttributeModel","StringAttributeModel","UploadAttributeModel","XMLAttributeModel","AttributeContent","LayoutHintRuleCollection","addLayoutHintRule","updateLayoutHintRules","BaseLayoutHintRule","DependentAttribute","RemainingTotalUploadSize","CaseViewModel","BusinessScenarioModel","ConceptDetailModel","ConceptIndexModel","ConceptLinkModel","ConceptRelationCollection","ConceptRelationModel","ConceptTypeDetailModel","SourceReferenceCollection","SourceReferenceModel","ConstraintCollection","ConstraintModel","ContentIndexModel","ContentLinkModel","ContentModel","ContentTOCModel","ContentTypeModel","SectionModel","SubSectionModel","ContentConfiguration","ContentConfigurationElements","ContentConfigurationEndResults","ContentConfigurationQuestions","ContentConfigurationResults","DetailModel","ErrorCollection","ErrorModel","ErrorResponse","AssignmentFilterModel","FilterModel","RangeFilterModel","ConceptIndexFilterModel","FilterCollection","FormModel","FormObjectModel","GroupingModel","GroupModel","Href","ListHref","LinkCollection","LinkModel","ListDetailModel","ListHeaderModel","ListItemCollection","ListItemModel","ListModel","LookupOptionsModel","LookupOptionCollection","ModelCatalogModel","ProcessStatusSettingsModel","PagesizeModel","PagingModel","Parameter","GroupingPanelModel","CaseSearchModel","SortingModel","SortOptionModel","TabModel","TaskGroupCollection","TaskGroupModel","UserModel","UserProfileModel","UserServicesModel"],"mappings":"AACA,SAASA,OAAO,IAAIC,YAApB,QAAwC,gBAAxC;AAEA,SAASD,OAAO,IAAIE,cAApB,QAA0C,uBAA1C;AAEA,SAASF,OAAO,IAAIG,gBAApB,QAA4C,4BAA5C;AACA,SAASH,OAAO,IAAII,WAApB,QAAuC,uBAAvC;AAEA,SAASJ,OAAO,IAAIK,gBAApB,QAA4C,gCAA5C;AAEA,SAASL,OAAO,IAAIM,mBAApB,QAA+C,kCAA/C;AACA,SAASN,OAAO,IAAIO,iBAApB,QAA6C,gCAA7C;AAEA,SAASP,OAAO,IAAIQ,cAApB,QAA0C,6BAA1C;AACA,SAASR,OAAO,IAAIS,qBAApB,QAAiD,oCAAjD;AACA,SAAST,OAAO,IAAIU,qBAApB,QAAiD,oCAAjD;AACA,SAASV,OAAO,IAAIW,oBAApB,QAAgD,mCAAhD;AACA,SAASX,OAAO,IAAIY,+BAApB,QAA2D,8CAA3D;AACA,SAASZ,OAAO,IAAIa,0BAApB,QAAsD,yCAAtD;AACA,SAASb,OAAO,IAAIc,uBAApB,QAAmD,sCAAnD;AACA,SAASd,OAAO,IAAIe,iCAApB,QAA6D,gDAA7D;AACA,SAASf,OAAO,IAAIgB,sBAApB,QAAkD,qCAAlD;AACA,SAAShB,OAAO,IAAIiB,sBAApB,QAAkD,qCAAlD;AACA,SAASjB,OAAO,IAAIkB,mBAApB,QAA+C,kCAA/C;AACA,SAASlB,OAAO,IAAImB,kBAApB,QAA8C,iCAA9C;AACA,SAASnB,OAAO,IAAIoB,mBAApB,QAA+C,kCAA/C;AACA,SAASpB,OAAO,IAAIqB,oBAApB,QAAgD,mCAAhD;AACA,SAAS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EC,gBAZF,EAaEC,iBAbF,EAcEd,iBAdF,EAeE7C,iBAfF,EAgBED,kBAhBF,EAiBED,qBAjBF,EAkBEM,sBAlBF,EAmBEK,iBAnBF,EAoBEG,eApBF,EAqBED,YArBF,EAsBEE,gBAtBF,EAuBExC,qBAvBF,EAwBEC,qBAxBF,EAyBEC,oBAzBF,EA0BEK,sBA1BF,EA2BEC,sBA3BF,EA4BEC,mBA5BF,EA6BEC,kBA7BF,EA8BEC,mBA9BF,EA+BEC,oBA/BF,EAgCEC,sBAhCF,EAiCER,uBAjCF,EAkCES,oBAlCF,EAmCEC,oBAnCF,EAoCEC,iBApCF,EAqCEoC,qBArCF,EAsCEC,WAtCF,EAuCEC,gBAvCF,EAwCEC,uBAxCF","sourcesContent":["// @flow\nexport { default as resolveModel } from \"./resolveModel\";\n\nexport { default as BaseCollection } from \"./base/BaseCollection\";\n\nexport { default as ActionCollection } from \"./actions/ActionCollection\";\nexport { default as ActionModel } from \"./actions/ActionModel\";\n\nimport { default as ApplicationModel } from \"./application/ApplicationModel\";\n\nexport { default as AttributeCollection } from \"./attributes/AttributeCollection\";\nexport { default as AttributeSetModel } from \"./attributes/AttributeSetModel\";\n\nexport { default as AttributeModel } from \"./attributes/AttributeModel\";\nimport { default as BooleanAttributeModel } from \"./attributes/BooleanAttributeModel\";\nimport { default as CaptchaAttributeModel } from \"./attributes/CaptchaAttributeModel\";\nimport { default as ChoiceAttributeModel } from \"./attributes/ChoiceAttributeModel\";\nexport { default as ChoiceAttributeOptionCollection } from \"./attributes/ChoiceAttributeOptionCollection\";\nexport { default as ChoiceAttributeOptionModel } from \"./attributes/ChoiceAttributeOptionModel\";\nimport { default as CompositeAttributeModel } from \"./attributes/CompositeAttributeModel\";\nexport { default as CompositeAttributeChildCollection } from \"./attributes/CompositeAttributeChildCollection\";\nimport { default as DatetimeAttributeModel } from \"./attributes/DatetimeAttributeModel\";\nimport { default as HelptextAttributeModel } from \"./attributes/HelptextAttributeModel\";\nimport { default as LabelAttributeModel } from \"./attributes/LabelAttributeModel\";\nimport { default as MemoAttributeModel } from \"./attributes/MemoAttributeModel\";\nimport { default as MoneyAttributeModel } from \"./attributes/MoneyAttributeModel\";\nimport { default as NumberAttributeModel } from \"./attributes/NumberAttributeModel\";\nimport { default as PasswordAttributeModel } from \"./attributes/PasswordAttributeModel\";\nimport { default as StringAttributeModel } from \"./attributes/StringAttributeModel\";\nimport { default as UploadAttributeModel } from \"./attributes/UploadAttributeModel\";\nimport { default as XMLAttributeModel } from \"./attributes/XMLAttributeModel\";\n\nexport { default as AttributeContent } from \"./attributes/AttributeContent\";\n\nexport {\n default as LayoutHintRuleCollection,\n addLayoutHintRule,\n updateLayoutHintRules,\n} from \"./attributes/layouthint-rules/LayoutHintRuleCollection\";\nexport { default as BaseLayoutHintRule } from \"./attributes/layouthint-rules/BaseLayoutHintRule\";\nexport { default as DependentAttribute } from \"./attributes/layouthint-rules/DependentAttribute\";\nexport { default as RemainingTotalUploadSize } from \"./attributes/layouthint-rules/RemainingTotalUploadSize\";\n\nimport { default as CaseViewModel } from \"./caseview/CaseViewModel\";\n\nimport { default as BusinessScenarioModel } from \"./concepts/BusinessScenarioModel\";\nimport { default as ConceptDetailModel } from \"./concepts/ConceptDetailModel\";\nimport { default as ConceptIndexModel } from \"./concepts/ConceptIndexModel\";\nexport { default as ConceptLinkModel } from \"./concepts/ConceptLinkModel\";\nexport { default as ConceptRelationCollection } from \"./concepts/ConceptRelationCollection\";\nexport { default as ConceptRelationModel } from \"./concepts/ConceptRelationModel\";\nimport { default as ConceptTypeDetailModel } from \"./concepts/ConceptTypeDetailModel\";\nexport { default as SourceReferenceCollection } from \"./concepts/SourceReferenceCollection\";\nexport { default as SourceReferenceModel } from \"./concepts/SourceReferenceModel\";\n\nexport { default as ConstraintCollection } from \"./attributes/input-constraints/ConstraintCollection\";\nexport { default as ConstraintModel } from \"./attributes/input-constraints/ConstraintModel\";\n\nimport { default as ContentIndexModel } from \"./content/ContentIndexModel\";\nexport { default as ContentLinkModel } from \"./content/ContentLinkModel\";\nimport { default as ContentModel } from \"./content/ContentModel\";\nimport { default as ContentTOCModel } from \"./content/ContentTOCModel\";\nimport { default as ContentTypeModel } from \"./content/ContentTypeModel\";\nexport { default as SectionModel } from \"./content/SectionModel\";\nexport { default as SubSectionModel } from \"./content/SubSectionModel\";\n\nexport { default as ContentConfiguration } from \"./contentconfiguration/ContentConfiguration\";\nexport { default as ContentConfigurationElements } from \"./contentconfiguration/ContentConfigurationElements\";\nexport { default as ContentConfigurationEndResults } from \"./contentconfiguration/ContentConfigurationEndResults\";\nexport { default as ContentConfigurationQuestions } from \"./contentconfiguration/ContentConfigurationQuestions\";\nexport { default as ContentConfigurationResults } from \"./contentconfiguration/ContentConfigurationResults\";\n\nimport { default as DetailModel } from \"./detail/DetailModel\";\n\nexport { default as ErrorCollection } from \"./error/ErrorCollection\";\nexport { default as ErrorModel } from \"./error/ErrorModel\";\nexport { default as ErrorResponse } from \"./error/ErrorResponse\";\n\nimport { default as AssignmentFilterModel } from \"./filters/AssignmentFilterModel\";\nimport { default as FilterModel } from \"./filters/FilterModel\";\nimport { default as RangeFilterModel } from \"./filters/RangeFilterModel\";\nimport { default as ConceptIndexFilterModel } from \"./filters/ConceptIndexFilterModel\";\nexport { default as FilterCollection } from \"./filters/FilterCollection\";\n\nimport { default as FormModel } from \"./form/FormModel\";\nexport { default as FormObjectModel } from \"./form/FormObjectModel\";\n\nexport { default as GroupingModel, GroupModel } from \"./grouping/GroupingModel\";\n\nexport { default as Href } from \"./href/Href\";\nexport { default as ListHref } from \"./href/ListHref\";\n\nexport { default as LinkCollection } from \"./links/LinkCollection\";\nexport { default as LinkModel } from \"./links/LinkModel\";\n\nimport { default as ListDetailModel } from \"./list/ListDetailModel\";\nexport { default as ListHeaderModel } from \"./list/ListHeaderModel\";\nexport { default as ListItemCollection } from \"./list/ListItemCollection\";\nexport { default as ListItemModel } from \"./list/ListItemModel\";\nimport { default as ListModel } from \"./list/ListModel\";\n\nexport { default as LookupOptionsModel } from \"./lookup/LookupOptionsModel\";\nexport { default as LookupOptionCollection } from \"./lookup/LookupOptionCollection\";\n\nimport { default as ModelCatalogModel } from \"./modelcatalog/ModelCatalogModel\";\n\nexport { default as ProcessStatusSettingsModel } from \"./process/ProcessStatusSettingsModel\";\n\nexport { default as PagesizeModel } from \"./paging/PagesizeModel\";\nexport { default as PagingModel } from \"./paging/PagingModel\";\n\nexport { default as Parameter } from \"./parameter/Parameter\";\n\nimport { default as GroupingPanelModel } from \"./panels/GroupingPanelModel\";\n\nimport { default as CaseSearchModel } from \"./search/CaseSearchModel\";\n\nexport { default as SortingModel } from \"./sorting/SortingModel\";\nexport { default as SortOptionModel } from \"./sorting/SortOptionModel\";\n\nimport { default as TabModel } from \"./tab/TabModel\";\n\nexport { default as TaskGroupCollection } from \"./taskgroup/TaskGroupCollection\";\nimport { default as TaskGroupModel } from \"./taskgroup/TaskGroupModel\";\n\nimport { default as UserModel } from \"./user/UserModel\";\nimport { default as UserProfileModel } from \"./user/UserProfileModel\";\nimport { default as UserServicesModel } from \"./user/UserServicesModel\";\n\nexport {\n ApplicationModel,\n CaseSearchModel,\n CaseViewModel,\n ListDetailModel,\n DetailModel,\n FormModel,\n GroupingPanelModel,\n ListModel,\n TabModel,\n TaskGroupModel,\n UserModel,\n UserProfileModel,\n UserServicesModel,\n ModelCatalogModel,\n ConceptIndexModel,\n ConceptDetailModel,\n BusinessScenarioModel,\n ConceptTypeDetailModel,\n ContentIndexModel,\n ContentTOCModel,\n ContentModel,\n ContentTypeModel,\n BooleanAttributeModel,\n CaptchaAttributeModel,\n ChoiceAttributeModel,\n DatetimeAttributeModel,\n HelptextAttributeModel,\n LabelAttributeModel,\n MemoAttributeModel,\n MoneyAttributeModel,\n NumberAttributeModel,\n PasswordAttributeModel,\n CompositeAttributeModel,\n StringAttributeModel,\n UploadAttributeModel,\n XMLAttributeModel,\n AssignmentFilterModel,\n FilterModel,\n RangeFilterModel,\n ConceptIndexFilterModel,\n};\n\nexport type * from \"./types\";\n"],"file":"index.js"}
|
|
@@ -17,7 +17,7 @@ export var updateFormAttribute = function updateFormAttribute(form, formObject,
|
|
|
17
17
|
return function (dispatch) {
|
|
18
18
|
var newForm = form.clone();
|
|
19
19
|
|
|
20
|
-
if (
|
|
20
|
+
if (options.validate === undefined) {
|
|
21
21
|
options.validate = true;
|
|
22
22
|
}
|
|
23
23
|
|
|
@@ -50,4 +50,13 @@ export var updateFormAttribute = function updateFormAttribute(form, formObject,
|
|
|
50
50
|
return dispatch(updateModel(newForm));
|
|
51
51
|
};
|
|
52
52
|
};
|
|
53
|
+
/**
|
|
54
|
+
* Validate an attribute on a form
|
|
55
|
+
*/
|
|
56
|
+
|
|
57
|
+
export var validateFormAttribute = function validateFormAttribute(form) {
|
|
58
|
+
return function (dispatch) {
|
|
59
|
+
return dispatch(validateFormObject(form));
|
|
60
|
+
};
|
|
61
|
+
};
|
|
53
62
|
//# sourceMappingURL=FormAttributeSet.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/redux/actions/FormAttributeSet.js"],"names":["updateModel","getSetting","validateFormObject","autosaveFormObject","autosubmitFormObject","updateFormAttribute","form","formObject","attribute","inputvalue","options","autosubmit","autosave","forceUpdate","validate","dispatch","newForm","clone","currentFormObject","equals","updateAttribute","completedFormObjects","forEach","completeObject","isValid","autosubmitAction","isChanged","hasDynamicValidations"],"mappings":"AACA,SAASA,WAAT,QAA4B,uBAA5B;AAEA,SAASC,UAAT,QAA2B,0BAA3B;AAEA,SAASC,kBAAT,QAAmC,mBAAnC;AACA,SAASC,kBAAT,QAAmC,gBAAnC;AACA,SAASC,oBAAT,QAAqC,kBAArC;;AAOA;AACA;AACA;AACA,OAAO,IAAMC,mBAAmB,GAC9B,SADWA,mBACX,CACEC,IADF,EAEEC,UAFF,EAGEC,SAHF,EAIEC,UAJF;AAAA,MAKEC,OALF,uEAK+B;AAC3BC,IAAAA,UAAU,EAAE,KADe;AAE3BC,IAAAA,QAAQ,EAAE,KAFiB;AAG3BC,IAAAA,WAAW,EAAE,KAHc;AAI3BC,IAAAA,QAAQ,EAAE;AAJiB,GAL/B;AAAA,SAYA,UAACC,QAAD,EAAwB;AACtB,QAAMC,OAAO,GAAGV,IAAI,CAACW,KAAL,EAAhB;;AAEA,
|
|
1
|
+
{"version":3,"sources":["../../../src/redux/actions/FormAttributeSet.js"],"names":["updateModel","getSetting","validateFormObject","autosaveFormObject","autosubmitFormObject","updateFormAttribute","form","formObject","attribute","inputvalue","options","autosubmit","autosave","forceUpdate","validate","dispatch","newForm","clone","undefined","currentFormObject","equals","updateAttribute","completedFormObjects","forEach","completeObject","isValid","autosubmitAction","isChanged","hasDynamicValidations","validateFormAttribute"],"mappings":"AACA,SAASA,WAAT,QAA4B,uBAA5B;AAEA,SAASC,UAAT,QAA2B,0BAA3B;AAEA,SAASC,kBAAT,QAAmC,mBAAnC;AACA,SAASC,kBAAT,QAAmC,gBAAnC;AACA,SAASC,oBAAT,QAAqC,kBAArC;;AAOA;AACA;AACA;AACA,OAAO,IAAMC,mBAAmB,GAC9B,SADWA,mBACX,CACEC,IADF,EAEEC,UAFF,EAGEC,SAHF,EAIEC,UAJF;AAAA,MAKEC,OALF,uEAK+B;AAC3BC,IAAAA,UAAU,EAAE,KADe;AAE3BC,IAAAA,QAAQ,EAAE,KAFiB;AAG3BC,IAAAA,WAAW,EAAE,KAHc;AAI3BC,IAAAA,QAAQ,EAAE;AAJiB,GAL/B;AAAA,SAYA,UAACC,QAAD,EAAwB;AACtB,QAAMC,OAAO,GAAGV,IAAI,CAACW,KAAL,EAAhB;;AAEA,QAAIP,OAAO,CAACI,QAAR,KAAqBI,SAAzB,EAAoC;AAClCR,MAAAA,OAAO,CAACI,QAAR,GAAmB,IAAnB;AACD;;AAED,QACEE,OAAO,CAACG,iBAAR,IACAH,OAAO,CAACG,iBAAR,CAA0BC,MAA1B,CAAiCb,UAAjC,CAFF,EAGE;AACAS,MAAAA,OAAO,CAACG,iBAA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port { getSetting } from \"../../constants/Settings\";\n\nimport { validateFormObject } from \"./FormValidations\";\nimport { autosaveFormObject } from \"./FormAutosave\";\nimport { autosubmitFormObject } from \"./FormAutosubmit\";\n\nimport type { Dispatch, ThunkAction, UpdateFormOptions } from \"../types\";\nimport type { AttributeType } from \"../../models/types\";\nimport type FormModel from \"../../models/form/FormModel\";\nimport type FormObjectModel from \"../../models/form/FormObjectModel\";\n\n/**\n * Update an attribute on a form\n */\nexport const updateFormAttribute =\n (\n form: FormModel,\n formObject: FormObjectModel,\n attribute: AttributeType,\n inputvalue: string,\n options: UpdateFormOptions = {\n autosubmit: false,\n autosave: false,\n forceUpdate: false,\n validate: true,\n }\n ): ThunkAction =>\n (dispatch: Dispatch) => {\n const newForm = form.clone();\n\n if (options.validate === undefined) {\n options.validate = true;\n }\n\n if (\n newForm.currentFormObject &&\n newForm.currentFormObject.equals(formObject)\n ) {\n newForm.currentFormObject.updateAttribute(attribute, inputvalue);\n } else {\n newForm.completedFormObjects.forEach((completeObject) => {\n if (completeObject.equals(formObject)) {\n completeObject.updateAttribute(attribute, inputvalue);\n }\n });\n }\n\n if (options.autosubmit && newForm.isValid) {\n const autosubmitAction = autosubmitFormObject(\n newForm,\n attribute,\n options.forceUpdate\n );\n if (autosubmitAction) {\n return dispatch(autosubmitAction);\n }\n }\n\n if (options.autosave && newForm.isValid && newForm.isChanged()) {\n dispatch(autosaveFormObject(newForm));\n }\n\n if (\n newForm.currentFormObject &&\n options.validate &&\n newForm.currentFormObject.hasDynamicValidations &&\n getSetting(\"USE_INSTANT_SERVER_VALIDATION\")\n ) {\n dispatch(validateFormObject(newForm));\n }\n\n return dispatch(updateModel(newForm));\n };\n\n/**\n * Validate an attribute on a form\n */\nexport const validateFormAttribute =\n (form: FormModel): ThunkAction =>\n (dispatch: Dispatch) => {\n return dispatch(validateFormObject(form));\n };\n"],"file":"FormAttributeSet.js"}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import _concatInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/concat";
|
|
2
1
|
import _endsWithInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/ends-with";
|
|
3
|
-
import
|
|
2
|
+
import Href from "../../models/href/Href";
|
|
4
3
|
/**
|
|
5
4
|
* Checks if a given url to a modular ui resource exists using a HEAD request to the resource (synchronous)
|
|
6
5
|
* When the resource returns a 404, the resource does not exists and the method returns false
|
|
@@ -10,9 +9,7 @@ import { BASE } from "../../constants/Constants";
|
|
|
10
9
|
*/
|
|
11
10
|
|
|
12
11
|
export var resourceExists = function resourceExists(url) {
|
|
13
|
-
var
|
|
14
|
-
|
|
15
|
-
var fullUrl = _concatInstanceProperty(_context = "".concat(BASE, "/")).call(_context, url).replace(/\/\//g, "/");
|
|
12
|
+
var fullUrl = new Href(url).absolutehref; // const fullUrl = `${BASE}/${url}`.replace(/\/\//g, "/");
|
|
16
13
|
|
|
17
14
|
var xhr = new XMLHttpRequest();
|
|
18
15
|
xhr.open("HEAD", fullUrl, false);
|
|
@@ -28,10 +25,9 @@ export var resourceExists = function resourceExists(url) {
|
|
|
28
25
|
*/
|
|
29
26
|
|
|
30
27
|
export var resourceRedirectsToSecureLogin = function resourceRedirectsToSecureLogin(url) {
|
|
31
|
-
var
|
|
32
|
-
|
|
33
|
-
var fullUrl = _concatInstanceProperty(_context2 = "".concat(BASE, "/")).call(_context2, url).replace(/\/\//g, "/");
|
|
28
|
+
var _xhr$responseURL;
|
|
34
29
|
|
|
30
|
+
var fullUrl = new Href(url).absolutehref;
|
|
35
31
|
var xhr = new XMLHttpRequest();
|
|
36
32
|
xhr.open("HEAD", fullUrl, false);
|
|
37
33
|
xhr.setRequestHeader("Accept", "application/json");
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/utils/helpers/checkResource.js"],"names":["
|
|
1
|
+
{"version":3,"sources":["../../../src/utils/helpers/checkResource.js"],"names":["Href","resourceExists","url","fullUrl","absolutehref","xhr","XMLHttpRequest","open","setRequestH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// @flow\nimport Href from \"../../models/href/Href\";\n\n/**\n * Checks if a given url to a modular ui resource exists using a HEAD request to the resource (synchronous)\n * When the resource returns a 404, the resource does not exists and the method returns false\n *\n * @param url\n * @returns {boolean}\n */\nexport const resourceExists = (url: string | Href): boolean => {\n const fullUrl = new Href(url).absolutehref;\n\n // const fullUrl = `${BASE}/${url}`.replace(/\\/\\//g, \"/\");\n\n const xhr = new XMLHttpRequest();\n xhr.open(\"HEAD\", fullUrl, false);\n xhr.setRequestHeader(\"Accept\", \"application/json\");\n xhr.setRequestHeader(\"Content-Type\", \"application/json\");\n xhr.send();\n\n return xhr.status !== 404;\n};\n\n/**\n * Indicates if a request to the given url resuls in a redirect to /secureRedirect\n * @param url\n * @returns {boolean}\n */\nexport const resourceRedirectsToSecureLogin = (url: string | Href): boolean => {\n const fullUrl = new Href(url).absolutehref;\n\n const xhr = new XMLHttpRequest();\n xhr.open(\"HEAD\", fullUrl, false);\n xhr.setRequestHeader(\"Accept\", \"application/json\");\n xhr.setRequestHeader(\"Content-Type\", \"application/json\");\n xhr.send();\n\n const responseURL = xhr.responseURL ?? \"\";\n\n return xhr.status === 400 && responseURL.endsWith(\"/secureLogin\");\n};\n"],"file":"checkResource.js"}
|
package/lib/hooks/useForm.js
CHANGED
|
@@ -5,7 +5,7 @@ var _interopRequireDefault = require("@babel/runtime-corejs3/helpers/interopRequ
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", {
|
|
6
6
|
value: true
|
|
7
7
|
});
|
|
8
|
-
exports.useFormNavigation = exports.useForm = exports.useAttributeUpdate = exports.useAttributeSet = void 0;
|
|
8
|
+
exports.useFormNavigation = exports.useForm = exports.useAttributeValidate = exports.useAttributeUpdate = exports.useAttributeSet = void 0;
|
|
9
9
|
|
|
10
10
|
var _reactRedux = require("react-redux");
|
|
11
11
|
|
|
@@ -98,12 +98,25 @@ var useAttributeUpdate = function useAttributeUpdate(form, object) {
|
|
|
98
98
|
};
|
|
99
99
|
};
|
|
100
100
|
/**
|
|
101
|
-
*
|
|
101
|
+
* Validate attributes of a form
|
|
102
102
|
*/
|
|
103
103
|
|
|
104
104
|
|
|
105
105
|
exports.useAttributeUpdate = useAttributeUpdate;
|
|
106
106
|
|
|
107
|
+
var useAttributeValidate = function useAttributeValidate(form) {
|
|
108
|
+
var dispatch = (0, _reactRedux.useDispatch)();
|
|
109
|
+
return function () {
|
|
110
|
+
return dispatch((0, _actions.validateFormAttribute)(form));
|
|
111
|
+
};
|
|
112
|
+
};
|
|
113
|
+
/**
|
|
114
|
+
* Attributeset actions
|
|
115
|
+
*/
|
|
116
|
+
|
|
117
|
+
|
|
118
|
+
exports.useAttributeValidate = useAttributeValidate;
|
|
119
|
+
|
|
107
120
|
var useAttributeSet = function useAttributeSet(form) {
|
|
108
121
|
var dispatch = (0, _reactRedux.useDispatch)();
|
|
109
122
|
return {
|
|
@@ -16,6 +16,7 @@ import {
|
|
|
16
16
|
removeRepeatableAttributeSet,
|
|
17
17
|
showFormNotification,
|
|
18
18
|
updateFormAttribute,
|
|
19
|
+
validateFormAttribute,
|
|
19
20
|
} from "../redux/actions";
|
|
20
21
|
|
|
21
22
|
import FormModel from "../models/form/FormModel";
|
|
@@ -119,6 +120,15 @@ export const useAttributeUpdate = (
|
|
|
119
120
|
) => dispatch(updateFormAttribute(form, object, attribute, value, options));
|
|
120
121
|
};
|
|
121
122
|
|
|
123
|
+
/**
|
|
124
|
+
* Validate attributes of a form
|
|
125
|
+
*/
|
|
126
|
+
export const useAttributeValidate = (form: FormModel): AttributeUpdateHook => {
|
|
127
|
+
const dispatch = useDispatch();
|
|
128
|
+
|
|
129
|
+
return () => dispatch(validateFormAttribute(form));
|
|
130
|
+
};
|
|
131
|
+
|
|
122
132
|
/**
|
|
123
133
|
* Attributeset actions
|
|
124
134
|
*/
|
package/lib/hooks/useForm.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/hooks/useForm.js"],"names":["useForm","href","formHref","Href","addParameter","form","method","HTTP_METHODS","POST","targetModel","FormModel","removeOnUnmount","model","useFormNavigation","dispatch","previous","cancel","submit","connectKey","selfhref","data","formdata","updateModel","remove","showFormNotificationAction","showFormNotification","useAttributeUpdate","object","attribute","value","options","useAttributeSet","save"],"mappings":";;;;;;;;;AACA;;AAEA;;AAEA;;AAEA;;AACA;;AAEA;;
|
|
1
|
+
{"version":3,"sources":["../../src/hooks/useForm.js"],"names":["useForm","href","formHref","Href","addParameter","form","method","HTTP_METHODS","POST","targetModel","FormModel","removeOnUnmount","model","useFormNavigation","dispatch","previous","cancel","submit","connectKey","selfhref","data","formdata","updateModel","remove","showFormNotificationAction","showFormNotification","useAttributeUpdate","object","attribute","value","options","useAttributeValidate","useAttributeSet","save"],"mappings":";;;;;;;;;AACA;;AAEA;;AAEA;;AAEA;;AACA;;AAEA;;AAWA;;AA6BA;AACA;AACA;AACO,IAAMA,OAAO,GAAG,SAAVA,OAAU,CAACC,IAAD,EAAqC;AAC1D,MAAMC,QAAQ,GAAG,IAAIC,aAAJ,CAASF,IAAT,CAAjB;;AAEA,MAAI,CAAC,2BAAW,oBAAX,CAAL,EAAuC;AACrCC,IAAAA,QAAQ,CAACE,YAAT,CAAsB,QAAtB,EAAgC,OAAhC;AACD;;AAED,MAAMC,IAAI,GAAG,gCAAa,MAAb,EAAqBH,QAArB,EAA+B;AAC1CI,IAAAA,MAAM,EAAEC,wBAAaC,IADqB;AAE1CC,IAAAA,WAAW,EAAEC,kBAF6B;AAG1CC,IAAAA,eAAe,EAAE;AAHyB,GAA/B,CAAb;;AAMA,MAAIN,IAAJ,aAAIA,IAAJ,eAAIA,IAAI,CAAEO,KAAV,EAAiB;AACf,WAAOP,IAAI,CAACO,KAAZ;AACD;AACF,CAhBM;AAkBP;AACA;AACA;;;;;AACO,IAAMC,iBAAiB,GAAG,SAApBA,iBAAoB,GAA0B;AACzD,MAAMC,QAAQ,GAAG,8BAAjB;;AAEA,MAAMC,QAAQ,GAAG,SAAXA,QAAW,CAACV,IAA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EAA6CC,KAA7C,EAAoDC,OAApD,CAAD,CAJN;AAAA,GAAP;AAKD,CAXM;AAaP;AACA;AACA;;;;;AACO,IAAMC,oBAAoB,GAAG,SAAvBA,oBAAuB,CAAC1B,IAAD,EAA0C;AAC5E,MAAMS,QAAQ,GAAG,8BAAjB;AAEA,SAAO;AAAA,WAAMA,QAAQ,CAAC,oCAAsBT,IAAtB,CAAD,CAAd;AAAA,GAAP;AACD,CAJM;AAMP;AACA;AACA;;;;;AACO,IAAM2B,eAAe,GAAG,SAAlBA,eAAkB,CAAC3B,IAAD,EAAuC;AACpE,MAAMS,QAAQ,GAAG,8BAAjB;AAEA,SAAO;AACLmB,IAAAA,IAAI,EAAE;AAAA,aAAMnB,QAAQ,CAAC,wCAA0BT,IAA1B,CAAD,CAAd;AAAA,KADD;AAELW,IAAAA,MAAM,EAAE,gBAACW,MAAD;AAAA,aACNb,QAAQ,CAAC,2CAA6BT,IAA7B,EAAmCsB,MAAnC,CAAD,CADF;AAAA,KAFH;AAILJ,IAAAA,MAAM,EAAE,gBAACI,MAAD;AAAA,aACNb,QAAQ,CAAC,2CAA6BT,IAA7B,EAAmCsB,MAAnC,CAAD,CADF;AAAA;AAJH,GAAP;AAOD,CAVM","sourcesContent":["// @flow\nimport { useDispatch } from \"react-redux\";\n\nimport Href from \"../models/href/Href\";\n\nimport { getSetting, HTTP_METHODS } from \"../constants\";\n\nimport { loadModularUI, removeModelByKey } from \"../redux/_modularui\";\nimport { useModularUI } from \"./useModularUI\";\n\nimport {\n addRepeatableAttributeSet,\n cancelForm,\n cancelRepeatableAttributeSet,\n previousObject,\n removeRepeatableAttributeSet,\n showFormNotification,\n updateFormAttribute,\n validateFormAttribute,\n} from \"../redux/actions\";\n\nimport FormModel from \"../models/form/FormModel\";\n\nimport type { FormObjectModel, AttributeType } from \"../models\";\nimport type { UpdateFormOptions } from \"../redux/types\";\nimport type {\n RemoveModelByKeyAction,\n UpdateModelAction,\n} from \"../redux/_modularui\";\n\ntype FormNavigationHook = {\n previous: (form: FormModel) => UpdateModelAction,\n cancel: (form: FormModel) => void,\n submit: (form: FormModel) => void,\n showFormNotification: (form: FormModel) => void,\n remove: (form: FormModel) => RemoveModelByKeyAction,\n};\n\ntype AttributeSetHook = {\n save: () => UpdateModelAction,\n cancel: (object: FormObjectModel) => UpdateModelAction,\n remove: (object: FormObjectModel) => UpdateModelAction,\n};\n\ntype AttributeUpdateHook = (\n attribute: AttributeType,\n value: string,\n options: UpdateFormOptions\n) => void;\n\n/**\n * Load a form by href\n */\nexport const useForm = (href: string | Href): ?FormModel => {\n const formHref = new Href(href);\n\n if (!getSetting(\"ALWAYS_COMMIT_FORM\")) {\n formHref.addParameter(\"commit\", \"false\");\n }\n\n const form = useModularUI(\"form\", formHref, {\n method: HTTP_METHODS.POST,\n targetModel: FormModel,\n removeOnUnmount: true,\n });\n\n if (form?.model) {\n return form.model;\n }\n};\n\n/**\n * Form navigation methods\n */\nexport const useFormNavigation = (): FormNavigationHook => {\n const dispatch = useDispatch();\n\n const previous = (form: FormModel) => dispatch(previousObject(form));\n\n const cancel = (form: FormModel) => dispatch(cancelForm(form));\n\n const submit = (form: FormModel) =>\n dispatch(\n loadModularUI(form.connectKey, form.selfhref, {\n method: HTTP_METHODS.POST,\n data: form.formdata,\n updateModel: form,\n targetModel: FormModel,\n })\n );\n\n const remove = (form: FormModel) =>\n dispatch(removeModelByKey(form.connectKey));\n\n const showFormNotificationAction = (form: FormModel) =>\n dispatch(showFormNotification(form));\n\n return {\n previous,\n cancel,\n submit,\n remove,\n showFormNotification: showFormNotificationAction,\n };\n};\n\n/**\n * Update attributes of a form\n */\nexport const useAttributeUpdate = (\n form: FormModel,\n object: FormObjectModel\n): AttributeUpdateHook => {\n const dispatch = useDispatch();\n\n return (\n attribute: AttributeType,\n value: string,\n options: UpdateFormOptions\n ) => dispatch(updateFormAttribute(form, object, attribute, value, options));\n};\n\n/**\n * Validate attributes of a form\n */\nexport const useAttributeValidate = (form: FormModel): AttributeUpdateHook => {\n const dispatch = useDispatch();\n\n return () => dispatch(validateFormAttribute(form));\n};\n\n/**\n * Attributeset actions\n */\nexport const useAttributeSet = (form: FormModel): AttributeSetHook => {\n const dispatch = useDispatch();\n\n return {\n save: () => dispatch(addRepeatableAttributeSet(form)),\n cancel: (object: FormObjectModel) =>\n dispatch(cancelRepeatableAttributeSet(form, object)),\n remove: (object: FormObjectModel) =>\n dispatch(removeRepeatableAttributeSet(form, object)),\n };\n};\n"],"file":"useForm.js"}
|
|
@@ -144,13 +144,24 @@ var ApplicationModel = /*#__PURE__*/function (_ResourceModel) {
|
|
|
144
144
|
return this._userServices ? this._userServices : null;
|
|
145
145
|
}
|
|
146
146
|
/**
|
|
147
|
-
*
|
|
148
|
-
* only available when the user services are available
|
|
147
|
+
* Indicates if the user is logged in
|
|
149
148
|
*/
|
|
150
149
|
,
|
|
151
150
|
set: function set(model) {
|
|
152
151
|
this._userServices = model instanceof _UserServicesModel.default ? model : null;
|
|
153
152
|
}
|
|
153
|
+
}, {
|
|
154
|
+
key: "isLoggedIn",
|
|
155
|
+
get: function get() {
|
|
156
|
+
var _this$userServices$is, _this$userServices;
|
|
157
|
+
|
|
158
|
+
return (_this$userServices$is = (_this$userServices = this.userServices) === null || _this$userServices === void 0 ? void 0 : _this$userServices.isLoggedIn) !== null && _this$userServices$is !== void 0 ? _this$userServices$is : false;
|
|
159
|
+
}
|
|
160
|
+
/**
|
|
161
|
+
* Retrieve link to the user information,
|
|
162
|
+
* only available when the user services are available
|
|
163
|
+
*/
|
|
164
|
+
|
|
154
165
|
}, {
|
|
155
166
|
key: "userHref",
|
|
156
167
|
get: function get() {
|