@beinformed/ui 1.27.1 → 1.27.3
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 +14 -0
- package/esm/constants/Constants.js +5 -0
- package/esm/constants/Constants.js.map +1 -1
- package/esm/constants/Settings.js +6 -4
- package/esm/constants/Settings.js.map +1 -1
- package/esm/models/application/ApplicationModel.js +6 -3
- package/esm/models/application/ApplicationModel.js.map +1 -1
- package/esm/models/attributes/AttributeDataHelper.js +2 -2
- package/esm/models/attributes/AttributeDataHelper.js.map +1 -1
- package/esm/models/attributes/_createAttribute.js +2 -2
- package/esm/models/attributes/_createAttribute.js.map +1 -1
- package/esm/models/base/BaseCollection.js +3 -9
- package/esm/models/base/BaseCollection.js.map +1 -1
- package/esm/models/base/BaseModel.js +2 -8
- package/esm/models/base/BaseModel.js.map +1 -1
- package/esm/modularui/Authenticate.js +25 -13
- package/esm/modularui/Authenticate.js.map +1 -1
- package/esm/react/ErrorBoundaryFallback.js +3 -0
- package/esm/react/ErrorBoundaryFallback.js.map +1 -1
- package/esm/react-server/serverUtil.js +1 -0
- package/esm/react-server/serverUtil.js.map +1 -1
- package/esm/redux/actions/FormValidations.js +1 -1
- package/esm/redux/actions/FormValidations.js.map +1 -1
- package/lib/constants/Constants.js +7 -1
- package/lib/constants/Constants.js.flow +5 -0
- package/lib/constants/Constants.js.map +1 -1
- package/lib/constants/Settings.js +5 -3
- package/lib/constants/Settings.js.flow +7 -3
- package/lib/constants/Settings.js.map +1 -1
- package/lib/models/application/ApplicationModel.js +6 -3
- package/lib/models/application/ApplicationModel.js.flow +10 -5
- package/lib/models/application/ApplicationModel.js.map +1 -1
- package/lib/models/attributes/AttributeDataHelper.js +2 -2
- package/lib/models/attributes/AttributeDataHelper.js.flow +2 -2
- package/lib/models/attributes/AttributeDataHelper.js.map +1 -1
- package/lib/models/attributes/__tests__/ChoiceAttributeModel.spec.js.flow +3 -0
- package/lib/models/attributes/__tests__/CompositeAttributeModel.spec.js.flow +3 -0
- package/lib/models/attributes/_createAttribute.js +2 -2
- package/lib/models/attributes/_createAttribute.js.flow +2 -2
- package/lib/models/attributes/_createAttribute.js.map +1 -1
- package/lib/models/base/BaseCollection.js +3 -9
- package/lib/models/base/BaseCollection.js.flow +4 -10
- package/lib/models/base/BaseCollection.js.map +1 -1
- package/lib/models/base/BaseModel.js +2 -8
- package/lib/models/base/BaseModel.js.flow +3 -9
- package/lib/models/base/BaseModel.js.map +1 -1
- package/lib/models/base/__tests__/BaseModel.spec.js.flow +3 -7
- package/lib/modularui/Authenticate.js +24 -12
- package/lib/modularui/Authenticate.js.flow +30 -13
- package/lib/modularui/Authenticate.js.map +1 -1
- package/lib/react/ErrorBoundaryFallback.js +3 -0
- package/lib/react/ErrorBoundaryFallback.js.flow +2 -0
- package/lib/react/ErrorBoundaryFallback.js.map +1 -1
- package/lib/react-server/serverUtil.js +1 -0
- package/lib/react-server/serverUtil.js.flow +2 -0
- package/lib/react-server/serverUtil.js.map +1 -1
- package/lib/redux/actions/FormValidations.js +1 -1
- package/lib/redux/actions/FormValidations.js.flow +1 -1
- package/lib/redux/actions/FormValidations.js.map +1 -1
- package/package.json +11 -10
- package/src/constants/Constants.js +5 -0
- package/src/constants/Settings.js +7 -3
- package/src/models/application/ApplicationModel.js +10 -5
- package/src/models/attributes/AttributeDataHelper.js +2 -2
- package/src/models/attributes/__tests__/ChoiceAttributeModel.spec.js +3 -0
- package/src/models/attributes/__tests__/CompositeAttributeModel.spec.js +3 -0
- package/src/models/attributes/_createAttribute.js +2 -2
- package/src/models/base/BaseCollection.js +4 -10
- package/src/models/base/BaseModel.js +3 -9
- package/src/models/base/__tests__/BaseModel.spec.js +3 -7
- package/src/modularui/Authenticate.js +30 -13
- package/src/react/ErrorBoundaryFallback.js +2 -0
- package/src/react-server/serverUtil.js +2 -0
- package/src/redux/actions/FormValidations.js +1 -1
- package/types/constants/Constants.d.ts +5 -0
- package/types/models/base/BaseCollection.d.ts +2 -2
- package/types/models/base/BaseModel.d.ts +1 -1
- package/types/modularui/Authenticate.d.ts +8 -1
|
@@ -130,6 +130,9 @@ describe("choiceAttributeModel", () => {
|
|
|
130
130
|
expect(attribute.format).toBeNull();
|
|
131
131
|
|
|
132
132
|
expect(attribute.options).toHaveLength(4);
|
|
133
|
+
|
|
134
|
+
const clonedAttribute = attribute.clone();
|
|
135
|
+
expect(clonedAttribute).toStrictEqual(attribute);
|
|
133
136
|
});
|
|
134
137
|
|
|
135
138
|
it("handles sort-options hint", () => {
|
|
@@ -202,6 +202,9 @@ describe("compositeAttributeModel", () => {
|
|
|
202
202
|
PrintingHouse: "Printers united",
|
|
203
203
|
Title: "Matilda",
|
|
204
204
|
});
|
|
205
|
+
|
|
206
|
+
const clonedAttribute = attribute.clone();
|
|
207
|
+
expect(clonedAttribute).toStrictEqual(attribute);
|
|
205
208
|
});
|
|
206
209
|
|
|
207
210
|
it("creates a composite attribute for a choice attribute with a table codemap on a list, multiple choice", () => {
|
|
@@ -8,7 +8,7 @@ exports.default = void 0;
|
|
|
8
8
|
var _map = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/map"));
|
|
9
9
|
var _keys = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/object/keys"));
|
|
10
10
|
var _find = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/find"));
|
|
11
|
-
var
|
|
11
|
+
var _full = require("klona/full");
|
|
12
12
|
var _objects = require("../../utils/helpers/objects");
|
|
13
13
|
var _LayoutHintRuleCollection = _interopRequireDefault(require("./layouthint-rules/LayoutHintRuleCollection"));
|
|
14
14
|
var _CaptchaAttributeModel = _interopRequireDefault(require("./CaptchaAttributeModel"));
|
|
@@ -67,7 +67,7 @@ const updateContributions = (key, data, contributions) => {
|
|
|
67
67
|
* @private
|
|
68
68
|
*/
|
|
69
69
|
const updateData = (key, data, contributions) => {
|
|
70
|
-
const newData = (0,
|
|
70
|
+
const newData = (0, _full.klona)(data);
|
|
71
71
|
if (contributions.dynamicschemaId) {
|
|
72
72
|
newData.dynamicschemaId = contributions.dynamicschemaId;
|
|
73
73
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// @flow
|
|
2
|
-
import
|
|
2
|
+
import { klona } from "klona/full";
|
|
3
3
|
|
|
4
4
|
import { has, isPlainObject } from "../../utils/helpers/objects";
|
|
5
5
|
|
|
@@ -105,7 +105,7 @@ const updateData = (
|
|
|
105
105
|
data: Object,
|
|
106
106
|
contributions: Object
|
|
107
107
|
): Object => {
|
|
108
|
-
const newData =
|
|
108
|
+
const newData = klona(data);
|
|
109
109
|
|
|
110
110
|
if (contributions.dynamicschemaId) {
|
|
111
111
|
newData.dynamicschemaId = contributions.dynamicschemaId;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"_createAttribute.js","names":["getChildrenKeys","children","child","childKey","isComposite","type","key","dynamicschemaId","undefined","getAttributeModel","contributions","ATTRIBUTE_MODELS","ChoiceAttributeModel","BooleanAttributeModel","HelptextAttributeModel","LabelAttributeModel","XMLAttributeModel","MemoAttributeModel","StringAttributeModel","DatetimeAttributeModel","MoneyAttributeModel","NumberAttributeModel","PasswordAttributeModel","UploadAttributeModel","CompositeAttributeModel","CaptchaAttributeModel","model","isApplicableModel","updateContributions","data","has","isPlainObject","Array","isArray","updateData","newData","
|
|
1
|
+
{"version":3,"file":"_createAttribute.js","names":["getChildrenKeys","children","child","childKey","isComposite","type","key","dynamicschemaId","undefined","getAttributeModel","contributions","ATTRIBUTE_MODELS","ChoiceAttributeModel","BooleanAttributeModel","HelptextAttributeModel","LabelAttributeModel","XMLAttributeModel","MemoAttributeModel","StringAttributeModel","DatetimeAttributeModel","MoneyAttributeModel","NumberAttributeModel","PasswordAttributeModel","UploadAttributeModel","CompositeAttributeModel","CaptchaAttributeModel","model","isApplicableModel","updateContributions","data","has","isPlainObject","Array","isArray","updateData","newData","klona","createAttribute","updatedContributions","updatedData","Model","Error","childrenKeys","dataHelper","AttributeDataHelper","getData","attribute","LayoutHintRuleCollection","setLayoutHintRules"],"sources":["../../../src/models/attributes/_createAttribute.js"],"sourcesContent":["// @flow\nimport { klona } from \"klona/full\";\n\nimport { has, isPlainObject } from \"../../utils/helpers/objects\";\n\nimport LayoutHintRuleCollection from \"./layouthint-rules/LayoutHintRuleCollection\";\n\nimport CaptchaAttributeModel from \"./CaptchaAttributeModel\";\nimport ChoiceAttributeModel from \"./ChoiceAttributeModel\";\nimport DatetimeAttributeModel from \"./DatetimeAttributeModel\";\nimport HelptextAttributeModel from \"./HelptextAttributeModel\";\nimport LabelAttributeModel from \"./LabelAttributeModel\";\nimport MemoAttributeModel from \"./MemoAttributeModel\";\nimport MoneyAttributeModel from \"./MoneyAttributeModel\";\nimport NumberAttributeModel from \"./NumberAttributeModel\";\nimport PasswordAttributeModel from \"./PasswordAttributeModel\";\nimport CompositeAttributeModel from \"./CompositeAttributeModel\";\nimport StringAttributeModel from \"./StringAttributeModel\";\nimport UploadAttributeModel from \"./UploadAttributeModel\";\nimport XMLAttributeModel from \"./XMLAttributeModel\";\nimport BooleanAttributeModel from \"./BooleanAttributeModel\";\n\nimport AttributeDataHelper from \"./AttributeDataHelper\";\n\nimport type { AttributeType } from \"../types\";\n\n/**\n * @private\n */\nconst getChildrenKeys = (children: Array<Object>): Array<Object> => {\n if (children) {\n return children.map((child) => {\n const [childKey] = Object.keys(child);\n const isComposite =\n child[childKey].type === \"range\" ||\n child[childKey].type === \"composite\";\n\n return {\n key: childKey,\n dynamicschemaId: child[childKey]?.dynamicschemaId || undefined,\n children: isComposite ? getChildrenKeys(child[childKey]?.children) : [],\n };\n });\n }\n\n return [];\n};\n\n/**\n * @private\n */\nconst getAttributeModel = (contributions: Object): ?Class<AttributeType> => {\n const ATTRIBUTE_MODELS = [\n ChoiceAttributeModel,\n BooleanAttributeModel,\n\n HelptextAttributeModel,\n LabelAttributeModel,\n\n XMLAttributeModel,\n MemoAttributeModel,\n StringAttributeModel,\n\n DatetimeAttributeModel,\n\n MoneyAttributeModel,\n NumberAttributeModel,\n PasswordAttributeModel,\n\n UploadAttributeModel,\n CompositeAttributeModel,\n CaptchaAttributeModel,\n ];\n\n return ATTRIBUTE_MODELS.find((model) =>\n model.isApplicableModel(contributions)\n );\n};\n\n/**\n * @private\n */\nconst updateContributions = (\n key: string,\n data: Object,\n contributions: Object\n): Object => {\n const isComposite =\n contributions.type === \"array\" &&\n has(contributions, \"children\") &&\n isPlainObject(data) &&\n Array.isArray(data[key]);\n\n return {\n ...contributions,\n type: isComposite ? \"composite\" : contributions.type,\n };\n};\n\n/**\n * @private\n */\nconst updateData = (\n key: string,\n data: Object,\n contributions: Object\n): Object => {\n const newData = klona(data);\n\n if (contributions.dynamicschemaId) {\n newData.dynamicschemaId = contributions.dynamicschemaId;\n }\n\n return newData;\n};\n\n/**\n * Create an attribute based on data and contributions\n */\nconst createAttribute = (\n key: string,\n data: Object | Array<Object>,\n contributions: Object\n): AttributeType => {\n const updatedContributions = updateContributions(key, data, contributions);\n const updatedData = updateData(key, data, contributions);\n\n const Model = getAttributeModel(updatedContributions);\n\n if (!Model) {\n throw new Error(\"Could not find model\");\n }\n\n const childrenKeys = getChildrenKeys(updatedContributions.children ?? []);\n const dataHelper = new AttributeDataHelper(\n updatedData,\n key,\n childrenKeys\n ).getData();\n\n const attribute = new Model(dataHelper, updatedContributions);\n\n return LayoutHintRuleCollection.setLayoutHintRules(attribute);\n};\n\nexport default createAttribute;\n"],"mappings":";;;;;;;;;;AACA;AAEA;AAEA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AAIA;AACA;AACA;AACA,MAAMA,eAAe,GAAIC,QAAuB,IAAoB;EAClE,IAAIA,QAAQ,EAAE;IACZ,OAAO,kBAAAA,QAAQ,OAARA,QAAQ,EAAMC,KAAK,IAAK;MAC7B,MAAM,CAACC,QAAQ,CAAC,GAAG,mBAAYD,KAAK,CAAC;MACrC,MAAME,WAAW,G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,CAAC;;AAED;AACA;AACA;AACA,MAAM6B,UAAU,GAAG,CACjB5B,GAAW,EACXuB,IAAY,EACZnB,aAAqB,KACV;EACX,MAAMyB,OAAO,GAAG,IAAAC,WAAK,EAACP,IAAI,CAAC;EAE3B,IAAInB,aAAa,CAACH,eAAe,EAAE;IACjC4B,OAAO,CAAC5B,eAAe,GAAGG,aAAa,CAACH,eAAe;EACzD;EAEA,OAAO4B,OAAO;AAChB,CAAC;;AAED;AACA;AACA;AACA,MAAME,eAAe,GAAG,CACtB/B,GAAW,EACXuB,IAA4B,EAC5BnB,aAAqB,KACH;EAClB,MAAM4B,oBAAoB,GAAGV,mBAAmB,CAACtB,GAAG,EAAEuB,IAAI,EAAEnB,aAAa,CAAC;EAC1E,MAAM6B,WAAW,GAAGL,UAAU,CAAC5B,GAAG,EAAEuB,IAAI,EAAEnB,aAAa,CAAC;EAExD,MAAM8B,KAAK,GAAG/B,iBAAiB,CAAC6B,oBAAoB,CAAC;EAErD,IAAI,CAACE,KAAK,EAAE;IACV,MAAM,IAAIC,KAAK,CAAC,sBAAsB,CAAC;EACzC;EAEA,MAAMC,YAAY,GAAG1C,eAAe,CAACsC,oBAAoB,CAACrC,QAAQ,IAAI,EAAE,CAAC;EACzE,MAAM0C,UAAU,GAAG,IAAIC,4BAAmB,CACxCL,WAAW,EACXjC,GAAG,EACHoC,YAAY,CACb,CAACG,OAAO,EAAE;EAEX,MAAMC,SAAS,GAAG,IAAIN,KAAK,CAACG,UAAU,EAAEL,oBAAoB,CAAC;EAE7D,OAAOS,iCAAwB,CAACC,kBAAkB,CAACF,SAAS,CAAC;AAC/D,CAAC;AAAC,eAEaT,eAAe;AAAA"}
|
|
@@ -11,8 +11,7 @@ var _filter = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-sta
|
|
|
11
11
|
var _map = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/map"));
|
|
12
12
|
var _sort = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/sort"));
|
|
13
13
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/defineProperty"));
|
|
14
|
-
var
|
|
15
|
-
var _cloneDeep = _interopRequireDefault(require("lodash/cloneDeep"));
|
|
14
|
+
var _full = require("klona/full");
|
|
16
15
|
/**
|
|
17
16
|
* Base class for collections of models
|
|
18
17
|
*/
|
|
@@ -177,15 +176,10 @@ class BaseCollection {
|
|
|
177
176
|
}
|
|
178
177
|
|
|
179
178
|
/**
|
|
180
|
-
* Returns a clone of the model
|
|
179
|
+
* Returns a clone of the model
|
|
181
180
|
*/
|
|
182
181
|
clone() {
|
|
183
|
-
|
|
184
|
-
// deepcopy can be expensive, use with care!
|
|
185
|
-
if (deepcopy) {
|
|
186
|
-
return (0, _cloneDeep.default)(this);
|
|
187
|
-
}
|
|
188
|
-
return (0, _clone.default)(this);
|
|
182
|
+
return (0, _full.klona)(this);
|
|
189
183
|
}
|
|
190
184
|
}
|
|
191
185
|
var _default = BaseCollection;
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
// @flow
|
|
2
|
-
import
|
|
3
|
-
import cloneDeep from "lodash/cloneDeep";
|
|
2
|
+
import { klona } from "klona/full";
|
|
4
3
|
|
|
5
4
|
/**
|
|
6
5
|
* Base class for collections of models
|
|
@@ -182,15 +181,10 @@ class BaseCollection<T> {
|
|
|
182
181
|
}
|
|
183
182
|
|
|
184
183
|
/**
|
|
185
|
-
* Returns a clone of the model
|
|
184
|
+
* Returns a clone of the model
|
|
186
185
|
*/
|
|
187
|
-
clone(
|
|
188
|
-
|
|
189
|
-
if (deepcopy) {
|
|
190
|
-
return cloneDeep(this);
|
|
191
|
-
}
|
|
192
|
-
|
|
193
|
-
return clone(this);
|
|
186
|
+
clone(): this {
|
|
187
|
+
return klona(this);
|
|
194
188
|
}
|
|
195
189
|
}
|
|
196
190
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BaseCollection.js","names":["BaseCollection","constructor","initCollection","collection","_collection","add","items","all","Array","isArray","removeByIndex","itemIndex","hasItems","length","isEmpty","size","first","last","get","index","find","callbackfn","thisArg","filter","some","every","map","forEach","sort","compareFn","sorted","clone","
|
|
1
|
+
{"version":3,"file":"BaseCollection.js","names":["BaseCollection","constructor","initCollection","collection","_collection","add","items","all","Array","isArray","removeByIndex","itemIndex","hasItems","length","isEmpty","size","first","last","get","index","find","callbackfn","thisArg","filter","some","every","map","forEach","sort","compareFn","sorted","clone","klona"],"sources":["../../../src/models/base/BaseCollection.js"],"sourcesContent":["// @flow\nimport { klona } from \"klona/full\";\n\n/**\n * Base class for collections of models\n */\nclass BaseCollection<T> {\n _collection: Array<T>;\n\n /**\n * Construct base collection\n */\n constructor(initCollection: Array<T> = []) {\n this.collection = initCollection;\n }\n\n /**\n * Retrieve current collection\n */\n get collection(): Array<T> {\n return this._collection;\n }\n\n /**\n * Replace current collection with a new collection\n */\n set collection(collection: Array<T>) {\n this._collection = collection;\n }\n\n /**\n * Add an other collection, array of items or single item to this collection;\n */\n add(items: BaseCollection<T> | Array<T> | T): BaseCollection<T> {\n if (items instanceof BaseCollection) {\n this.collection = [...this.collection, ...items.all];\n } else if (Array.isArray(items)) {\n // $FlowExpectedError[incompatible-type]\n this.collection = [...this.collection, ...items];\n } else {\n this.collection = [...this.collection, items];\n }\n\n return this;\n }\n\n /**\n * Remove an item from the collection by it's index.\n */\n removeByIndex(itemIndex: number) {\n if (itemIndex > -1) {\n this.collection = [\n ...this.collection.slice(0, itemIndex),\n ...this.collection.slice(itemIndex + 1),\n ];\n }\n }\n\n /**\n * Indicates if the collection has items\n */\n get hasItems(): boolean {\n return this.length > 0;\n }\n\n /**\n * Indicates if collection is empty\n */\n get isEmpty(): boolean {\n return !this.hasItems;\n }\n\n /**\n * Retrieve all items in collection\n */\n get all(): Array<T> {\n return this.collection;\n }\n\n /**\n * Get the size of this collection\n */\n get size(): number {\n return this.length;\n }\n\n /**\n * Get the size of this collection\n */\n get length(): number {\n return this.collection.length;\n }\n\n /**\n * Return first link in collection\n */\n get first(): T | null {\n return this.collection[0] ?? null;\n }\n\n /**\n */\n get last(): T | null {\n return this.collection[this.collection.length - 1] ?? null;\n }\n\n /**\n */\n get(index: number): T | null {\n return this.collection[index] ?? null;\n }\n\n /**\n * Find item\n */\n find(\n callbackfn: (value: T, index: number, array: Array<T>) => any,\n thisArg?: any\n ): T | null {\n return this.collection.find(callbackfn, thisArg) ?? null;\n }\n\n /**\n * Filter items\n */\n filter(\n callbackfn: (value: T, index: number, array: Array<T>) => any,\n thisArg?: any\n ): Array<T> {\n return this.collection.filter(callbackfn, thisArg);\n }\n\n /**\n * Check if at least one item occurs\n */\n some(\n callbackfn: (value: T, index: number, array: Array<T>) => any,\n thisArg?: any\n ): boolean {\n return this.collection.some(callbackfn, thisArg);\n }\n\n /**\n */\n every(\n callbackfn: (value: T, index: number, array: Array<T>) => any,\n thisArg?: any\n ): boolean {\n return this.collection.every(callbackfn, thisArg);\n }\n\n /**\n */\n map<U>(\n callbackfn: (value: T, index: number, array: Array<T>) => U,\n thisArg?: T\n ): Array<U> {\n return this.collection.map<U, ?T>(callbackfn, thisArg);\n }\n\n /**\n */\n forEach(\n callbackfn: (value: T, index: number, array: Array<T>) => any,\n thisArg?: any\n ) {\n this.collection.forEach(callbackfn, thisArg);\n }\n\n /**\n */\n sort(compareFn?: (a: T, b: T) => number): Array<T> {\n return this.collection.sort(compareFn);\n }\n\n /**\n * Retrieve an alphabetically sorted array of items\n */\n get sorted(): Array<T> {\n return this.collection.sort();\n }\n\n /**\n * Returns a clone of the model\n */\n clone(): this {\n return klona(this);\n }\n}\n\nexport default BaseCollection;\n"],"mappings":";;;;;;;;;;;;;AACA;AAEA;AACA;AACA;AACA,MAAMA,cAAc,CAAI;EAGtB;AACF;AACA;EACEC,WAAW,GAAgC;IAAA,IAA/BC,cAAwB,uEAAG,EAAE;IAAA;IACvC,IAAI,CAACC,UAAU,GAAGD,cAAc;EAClC;;EAEA;AACF;AACA;EACE,IAAIC,U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wB,OAAO,CAACN,UAAU,EAAEC,OAAO,CAAC;EAC9C;;EAEA;AACF;EACEM,IAAI,CAACC,SAAkC,EAAY;IAAA;IACjD,OAAO,mCAAI,CAAC1B,UAAU,kBAAM0B,SAAS,CAAC;EACxC;;EAEA;AACF;AACA;EACE,IAAIC,MAAM,GAAa;IAAA;IACrB,OAAO,mCAAI,CAAC3B,UAAU,iBAAO;EAC/B;;EAEA;AACF;AACA;EACE4B,KAAK,GAAS;IACZ,OAAO,IAAAC,WAAK,EAAC,IAAI,CAAC;EACpB;AACF;AAAC,eAEchC,cAAc;AAAA"}
|
|
@@ -7,8 +7,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
7
7
|
exports.default = void 0;
|
|
8
8
|
var _keys = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/object/keys"));
|
|
9
9
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/defineProperty"));
|
|
10
|
-
var
|
|
11
|
-
var _cloneDeep = _interopRequireDefault(require("lodash/cloneDeep"));
|
|
10
|
+
var _full = require("klona/full");
|
|
12
11
|
var _LayoutHintCollection = _interopRequireDefault(require("../layouthint/LayoutHintCollection"));
|
|
13
12
|
/**
|
|
14
13
|
* Base model, this is the foundation of a model,
|
|
@@ -117,12 +116,7 @@ class BaseModel {
|
|
|
117
116
|
* Returns a clone of the model
|
|
118
117
|
*/
|
|
119
118
|
clone() {
|
|
120
|
-
|
|
121
|
-
// deepcopy can be expensive, use with care!
|
|
122
|
-
if (deepcopy) {
|
|
123
|
-
return (0, _cloneDeep.default)(this);
|
|
124
|
-
}
|
|
125
|
-
return (0, _clone.default)(this);
|
|
119
|
+
return (0, _full.klona)(this);
|
|
126
120
|
}
|
|
127
121
|
}
|
|
128
122
|
var _default = BaseModel;
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
// @flow
|
|
2
|
-
import
|
|
3
|
-
import cloneDeep from "lodash/cloneDeep";
|
|
2
|
+
import { klona } from "klona/full";
|
|
4
3
|
|
|
5
4
|
import LayoutHintCollection from "../layouthint/LayoutHintCollection";
|
|
6
5
|
|
|
@@ -118,13 +117,8 @@ class BaseModel {
|
|
|
118
117
|
/**
|
|
119
118
|
* Returns a clone of the model
|
|
120
119
|
*/
|
|
121
|
-
clone(
|
|
122
|
-
|
|
123
|
-
if (deepcopy) {
|
|
124
|
-
return cloneDeep(this);
|
|
125
|
-
}
|
|
126
|
-
|
|
127
|
-
return clone(this);
|
|
120
|
+
clone(): any {
|
|
121
|
+
return klona(this);
|
|
128
122
|
}
|
|
129
123
|
}
|
|
130
124
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BaseModel.js","names":["BaseModel","constructor","data","contributions","_data","_contributions","_layouthint","LayoutHintCollection","getContribution","getData","propName","defaultValue","layouthint","hasData","length","connectKey","key","_connectKey","dehydrate","rehydrate","clone","
|
|
1
|
+
{"version":3,"file":"BaseModel.js","names":["BaseModel","constructor","data","contributions","_data","_contributions","_layouthint","LayoutHintCollection","getContribution","getData","propName","defaultValue","layouthint","hasData","length","connectKey","key","_connectKey","dehydrate","rehydrate","clone","klona"],"sources":["../../../src/models/base/BaseModel.js"],"sourcesContent":["// @flow\nimport { klona } from \"klona/full\";\n\nimport LayoutHintCollection from \"../layouthint/LayoutHintCollection\";\n\nexport type BaseDehydrateData = {\n +data: Object,\n +contributions: Object,\n connectKey: string,\n ...\n};\n\n/**\n * Base model, this is the foundation of a model,\n * it contains data that is needed for all models like, data, contributions and layout hint\n *\n * Extend this for non modular ui resources, for modular ui resource start with the resourceModel\n */\nclass BaseModel {\n _data: Object;\n _contributions: Object;\n _layouthint: LayoutHintCollection;\n _connectKey: string;\n\n /**\n * constructor\n */\n constructor(data: Object, contributions: Object) {\n this._data = data;\n this._contributions = contributions;\n this._layouthint = new LayoutHintCollection(\n this.getContribution(\"layouthint\", [])\n );\n }\n\n /**\n * Retrieve data\n */\n get data(): Object {\n return this._data || {};\n }\n\n /**\n * Retrieve property from the data object of the model, mostly used internal\n */\n getData(propName: string, defaultValue: any = null): any {\n return this.data[propName] ?? defaultValue;\n }\n\n /**\n * Retrieve contributions\n */\n get contributions(): Object {\n return this._contributions || {};\n }\n\n /**\n * Retrieve property from the contributions of the model, mostly used internal\n */\n getContribution(propName: string, defaultValue: any = null): any {\n return this.contributions[propName] ?? defaultValue;\n }\n\n /**\n * Getting the layouthint\n */\n get layouthint(): LayoutHintCollection {\n return this._layouthint;\n }\n\n /**\n * Set the layouthint\n */\n set layouthint(layouthint: Array<string>) {\n this._layouthint = new LayoutHintCollection(layouthint);\n }\n\n /**\n * Indicates if the model has data\n */\n get hasData(): boolean {\n return Object.keys(this.data).length > 0;\n }\n\n /**\n * Set the unique key for this model\n */\n set connectKey(key: string) {\n this._connectKey = key;\n }\n\n /**\n * Get the unique key of this model\n */\n get connectKey(): string {\n return this._connectKey;\n }\n\n /**\n * Dehydrate internal data, returns the information that is needed to recreate the model\n */\n dehydrate(): BaseDehydrateData {\n return {\n data: this._data,\n contributions: this._contributions,\n connectKey: this._connectKey,\n };\n }\n\n /**\n * Recreate the model with the given data\n */\n rehydrate(data: BaseDehydrateData) {\n this._connectKey = data.connectKey;\n }\n\n /**\n * Returns a clone of the model\n */\n clone(): any {\n return klona(this);\n }\n}\n\nexport default BaseModel;\n"],"mappings":";;;;;;;;;AACA;AAEA;AASA;AACA;AACA;AACA;AACA;AACA;AACA,MAAMA,SAAS,CAAC;EAMd;AACF;AACA;EACEC,WAAW,CAACC,IAAY,EAAEC,aAAqB,EAAE;IAAA;IAAA;IAAA;IAAA;IAC/C,IAAI,CAACC,KAAK,GAAGF,IAAI;IACjB,IAAI,CAACG,cAAc,GAAGF,aAAa;IACnC,IAAI,CAACG,WAAW,GAAG,IAAIC,6BAAoB,CACzC,IAAI,CAACC,eAAe,CAAC,YAAY,EAAE,EAAE,CAAC,CACvC;EACH;;EAEA;AACF;AACA;EACE,IAAIN,IAAI,GAAW;IACjB,OAAO,IAAI,CAACE,KAAK,IAAI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OAAO,IAAAC,WAAK,EAAC,IAAI,CAAC;EACpB;AACF;AAAC,eAEcrB,SAAS;AAAA"}
|
|
@@ -11,7 +11,8 @@ describe("baseModel", () => {
|
|
|
11
11
|
expect(model.contributions).toStrictEqual({});
|
|
12
12
|
expect(model.hasData).toBeFalsy();
|
|
13
13
|
|
|
14
|
-
|
|
14
|
+
const clonedModel = model.clone();
|
|
15
|
+
expect(clonedModel).toStrictEqual(model);
|
|
15
16
|
});
|
|
16
17
|
|
|
17
18
|
it("should handle data without contributions", () => {
|
|
@@ -72,12 +73,7 @@ describe("baseModel", () => {
|
|
|
72
73
|
},
|
|
73
74
|
});
|
|
74
75
|
|
|
75
|
-
const
|
|
76
|
-
expect(model).not.toBe(shallowClone);
|
|
77
|
-
expect(model.data.prop).toBe(shallowClone.data.prop);
|
|
78
|
-
expect(model.data.prop.child).toBe(shallowClone.data.prop.child);
|
|
79
|
-
|
|
80
|
-
const deepClone = model.clone(true);
|
|
76
|
+
const deepClone = model.clone();
|
|
81
77
|
expect(model).not.toBe(deepClone);
|
|
82
78
|
expect(model.data.prop === deepClone.data.prop).toBeFalsy();
|
|
83
79
|
expect(model.data.prop.child).toBe(deepClone.data.prop.child);
|
|
@@ -27,13 +27,13 @@ class Authenticate {
|
|
|
27
27
|
*/
|
|
28
28
|
get authenticationType() {
|
|
29
29
|
const type = (0, _constants.loginType)();
|
|
30
|
-
if (!type || type ===
|
|
31
|
-
return
|
|
30
|
+
if (!type || type === _constants.INTERNAL_LOGIN_TYPE.JAAS) {
|
|
31
|
+
return _constants.INTERNAL_LOGIN_TYPE.JAAS;
|
|
32
32
|
}
|
|
33
33
|
if ((0, _includes.default)(type).call(type, "FormClient")) {
|
|
34
|
-
return
|
|
34
|
+
return _constants.INTERNAL_LOGIN_TYPE.PAC4J_FORM;
|
|
35
35
|
} else if ((0, _includes.default)(type).call(type, "BasicClient")) {
|
|
36
|
-
return
|
|
36
|
+
return _constants.INTERNAL_LOGIN_TYPE.PAC4J_BASIC;
|
|
37
37
|
}
|
|
38
38
|
throw new Error(`Unsupported login type found: ${type}`);
|
|
39
39
|
}
|
|
@@ -41,7 +41,7 @@ class Authenticate {
|
|
|
41
41
|
/**
|
|
42
42
|
*/
|
|
43
43
|
get isBasicAuthentication() {
|
|
44
|
-
return this._isBasic || this.authenticationType ===
|
|
44
|
+
return this._isBasic || this.authenticationType === _constants.INTERNAL_LOGIN_TYPE.PAC4J_BASIC;
|
|
45
45
|
}
|
|
46
46
|
|
|
47
47
|
/**
|
|
@@ -84,9 +84,9 @@ class Authenticate {
|
|
|
84
84
|
*/
|
|
85
85
|
login(username, password) {
|
|
86
86
|
switch (this.authenticationType) {
|
|
87
|
-
case
|
|
87
|
+
case _constants.INTERNAL_LOGIN_TYPE.PAC4J_FORM:
|
|
88
88
|
return this.doFormLogin(username, password);
|
|
89
|
-
case
|
|
89
|
+
case _constants.INTERNAL_LOGIN_TYPE.PAC4J_BASIC:
|
|
90
90
|
return this.doBasicAuthentication(username, password);
|
|
91
91
|
default:
|
|
92
92
|
return this.doJaasAuthentication(username, password);
|
|
@@ -97,8 +97,8 @@ class Authenticate {
|
|
|
97
97
|
*/
|
|
98
98
|
getFormLoginUrl() {
|
|
99
99
|
switch (this.authenticationType) {
|
|
100
|
-
case
|
|
101
|
-
case
|
|
100
|
+
case _constants.INTERNAL_LOGIN_TYPE.PAC4J_BASIC:
|
|
101
|
+
case _constants.INTERNAL_LOGIN_TYPE.PAC4J_FORM:
|
|
102
102
|
return `${(0, _constants.getBasePath)()}${(0, _constants.loginPath)()}`;
|
|
103
103
|
default:
|
|
104
104
|
return `${(0, _constants.getBasePath)()}/j_security_check`;
|
|
@@ -111,8 +111,8 @@ class Authenticate {
|
|
|
111
111
|
const encodedUsername = encodeURIComponent(username);
|
|
112
112
|
const encodedPassword = encodeURIComponent(password);
|
|
113
113
|
switch (this.authenticationType) {
|
|
114
|
-
case
|
|
115
|
-
case
|
|
114
|
+
case _constants.INTERNAL_LOGIN_TYPE.PAC4J_BASIC:
|
|
115
|
+
case _constants.INTERNAL_LOGIN_TYPE.PAC4J_FORM:
|
|
116
116
|
return `${(0, _constants.loginUsernameField)()}=${encodedUsername}&${(0, _constants.loginPasswordField)()}=${encodedPassword}`;
|
|
117
117
|
default:
|
|
118
118
|
return `j_username=${encodedUsername}&j_password=${encodedPassword}`;
|
|
@@ -151,11 +151,23 @@ class Authenticate {
|
|
|
151
151
|
});
|
|
152
152
|
}
|
|
153
153
|
|
|
154
|
+
/**
|
|
155
|
+
*/
|
|
156
|
+
getLogoutUrl() {
|
|
157
|
+
switch (this.authenticationType) {
|
|
158
|
+
case _constants.INTERNAL_LOGIN_TYPE.PAC4J_BASIC:
|
|
159
|
+
case _constants.INTERNAL_LOGIN_TYPE.PAC4J_FORM:
|
|
160
|
+
return `${(0, _constants.getBasePath)()}${(0, _constants.logoutPath)()}`;
|
|
161
|
+
default:
|
|
162
|
+
return `${(0, _constants.getBasePath)()}/Logoff`;
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
|
|
154
166
|
/**
|
|
155
167
|
*/
|
|
156
168
|
logout() {
|
|
157
169
|
return (0, _universalFetch.default)({
|
|
158
|
-
url:
|
|
170
|
+
url: this.getLogoutUrl()
|
|
159
171
|
}).then(response => {
|
|
160
172
|
// clear cache because of cached contributions
|
|
161
173
|
_Cache.default.clear();
|
|
@@ -6,6 +6,7 @@ import Cache from "../utils/browser/Cache";
|
|
|
6
6
|
|
|
7
7
|
import { UnauthorizedException } from "../exceptions";
|
|
8
8
|
import {
|
|
9
|
+
INTERNAL_LOGIN_TYPE,
|
|
9
10
|
loginType,
|
|
10
11
|
loginPath,
|
|
11
12
|
loginPasswordField,
|
|
@@ -27,16 +28,17 @@ class Authenticate {
|
|
|
27
28
|
|
|
28
29
|
/**
|
|
29
30
|
*/
|
|
30
|
-
get authenticationType():
|
|
31
|
+
get authenticationType(): $Keys<typeof INTERNAL_LOGIN_TYPE> {
|
|
31
32
|
const type = loginType();
|
|
32
33
|
|
|
33
|
-
if (!type || type ===
|
|
34
|
-
return
|
|
34
|
+
if (!type || type === INTERNAL_LOGIN_TYPE.JAAS) {
|
|
35
|
+
return INTERNAL_LOGIN_TYPE.JAAS;
|
|
35
36
|
}
|
|
37
|
+
|
|
36
38
|
if (type.includes("FormClient")) {
|
|
37
|
-
return
|
|
39
|
+
return INTERNAL_LOGIN_TYPE.PAC4J_FORM;
|
|
38
40
|
} else if (type.includes("BasicClient")) {
|
|
39
|
-
return
|
|
41
|
+
return INTERNAL_LOGIN_TYPE.PAC4J_BASIC;
|
|
40
42
|
}
|
|
41
43
|
|
|
42
44
|
throw new Error(`Unsupported login type found: ${type}`);
|
|
@@ -45,7 +47,10 @@ class Authenticate {
|
|
|
45
47
|
/**
|
|
46
48
|
*/
|
|
47
49
|
get isBasicAuthentication(): boolean {
|
|
48
|
-
return
|
|
50
|
+
return (
|
|
51
|
+
this._isBasic ||
|
|
52
|
+
this.authenticationType === INTERNAL_LOGIN_TYPE.PAC4J_BASIC
|
|
53
|
+
);
|
|
49
54
|
}
|
|
50
55
|
|
|
51
56
|
/**
|
|
@@ -90,9 +95,9 @@ class Authenticate {
|
|
|
90
95
|
*/
|
|
91
96
|
login(username: string, password: string): Promise<any> {
|
|
92
97
|
switch (this.authenticationType) {
|
|
93
|
-
case
|
|
98
|
+
case INTERNAL_LOGIN_TYPE.PAC4J_FORM:
|
|
94
99
|
return this.doFormLogin(username, password);
|
|
95
|
-
case
|
|
100
|
+
case INTERNAL_LOGIN_TYPE.PAC4J_BASIC:
|
|
96
101
|
return this.doBasicAuthentication(username, password);
|
|
97
102
|
default:
|
|
98
103
|
return this.doJaasAuthentication(username, password);
|
|
@@ -103,8 +108,8 @@ class Authenticate {
|
|
|
103
108
|
*/
|
|
104
109
|
getFormLoginUrl(): string {
|
|
105
110
|
switch (this.authenticationType) {
|
|
106
|
-
case
|
|
107
|
-
case
|
|
111
|
+
case INTERNAL_LOGIN_TYPE.PAC4J_BASIC:
|
|
112
|
+
case INTERNAL_LOGIN_TYPE.PAC4J_FORM:
|
|
108
113
|
return `${getBasePath()}${loginPath()}`;
|
|
109
114
|
default:
|
|
110
115
|
return `${getBasePath()}/j_security_check`;
|
|
@@ -118,8 +123,8 @@ class Authenticate {
|
|
|
118
123
|
const encodedPassword = encodeURIComponent(password);
|
|
119
124
|
|
|
120
125
|
switch (this.authenticationType) {
|
|
121
|
-
case
|
|
122
|
-
case
|
|
126
|
+
case INTERNAL_LOGIN_TYPE.PAC4J_BASIC:
|
|
127
|
+
case INTERNAL_LOGIN_TYPE.PAC4J_FORM:
|
|
123
128
|
return `${loginUsernameField()}=${encodedUsername}&${loginPasswordField()}=${encodedPassword}`;
|
|
124
129
|
default:
|
|
125
130
|
return `j_username=${encodedUsername}&j_password=${encodedPassword}`;
|
|
@@ -158,11 +163,23 @@ class Authenticate {
|
|
|
158
163
|
});
|
|
159
164
|
}
|
|
160
165
|
|
|
166
|
+
/**
|
|
167
|
+
*/
|
|
168
|
+
getLogoutUrl(): string {
|
|
169
|
+
switch (this.authenticationType) {
|
|
170
|
+
case INTERNAL_LOGIN_TYPE.PAC4J_BASIC:
|
|
171
|
+
case INTERNAL_LOGIN_TYPE.PAC4J_FORM:
|
|
172
|
+
return `${getBasePath()}${logoutPath()}`;
|
|
173
|
+
default:
|
|
174
|
+
return `${getBasePath()}/Logoff`;
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
|
|
161
178
|
/**
|
|
162
179
|
*/
|
|
163
180
|
logout(): Promise<any> {
|
|
164
181
|
return universalFetch({
|
|
165
|
-
url:
|
|
182
|
+
url: this.getLogoutUrl(),
|
|
166
183
|
}).then((response) => {
|
|
167
184
|
// clear cache because of cached contributions
|
|
168
185
|
Cache.clear();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Authenticate.js","names":["Authenticate","constructor","_isBasic","authenticationType","type","loginType","Error","isBasicAuthentication","requestLogin","universalFetch","url","getBasePath","method","HTTP_METHODS","GET","headers","Accept","initLogin","resolve","catch","error","UnauthorizedException","login","username","password","doFormLogin","doBasicAuthentication","doJaasAuthentication","getFormLoginUrl","loginPath","getFormLoginData","encodedUsername","encodeURIComponent","encodedPassword","loginUsernameField","loginPasswordField","POST","data","Cache","addItem","btoa","then","
|
|
1
|
+
{"version":3,"file":"Authenticate.js","names":["Authenticate","constructor","_isBasic","authenticationType","type","loginType","INTERNAL_LOGIN_TYPE","JAAS","PAC4J_FORM","PAC4J_BASIC","Error","isBasicAuthentication","requestLogin","universalFetch","url","getBasePath","method","HTTP_METHODS","GET","headers","Accept","initLogin","resolve","catch","error","UnauthorizedException","login","username","password","doFormLogin","doBasicAuthentication","doJaasAuthentication","getFormLoginUrl","loginPath","getFormLoginData","encodedUsername","encodeURIComponent","encodedPassword","loginUsernameField","loginPasswordField","POST","data","Cache","addItem","btoa","then","getLogoutUrl","logoutPath","logout","response","clear"],"sources":["../../src/modularui/Authenticate.js"],"sourcesContent":["// @flow\nimport { HTTP_METHODS } from \"../constants/Constants\";\n\nimport universalFetch from \"../utils/fetch/universalFetch\";\nimport Cache from \"../utils/browser/Cache\";\n\nimport { UnauthorizedException } from \"../exceptions\";\nimport {\n INTERNAL_LOGIN_TYPE,\n loginType,\n loginPath,\n loginPasswordField,\n loginUsernameField,\n logoutPath,\n getBasePath,\n} from \"../constants\";\n\n/**\n */\nclass Authenticate {\n _isBasic: boolean;\n\n /**\n */\n constructor() {\n this._isBasic = false;\n }\n\n /**\n */\n get authenticationType(): $Keys<typeof INTERNAL_LOGIN_TYPE> {\n const type = loginType();\n\n if (!type || type === INTERNAL_LOGIN_TYPE.JAAS) {\n return INTERNAL_LOGIN_TYPE.JAAS;\n }\n\n if (type.includes(\"FormClient\")) {\n return INTERNAL_LOGIN_TYPE.PAC4J_FORM;\n } else if (type.includes(\"BasicClient\")) {\n return INTERNAL_LOGIN_TYPE.PAC4J_BASIC;\n }\n\n throw new Error(`Unsupported login type found: ${type}`);\n }\n\n /**\n */\n get isBasicAuthentication(): boolean {\n return (\n this._isBasic ||\n this.authenticationType === INTERNAL_LOGIN_TYPE.PAC4J_BASIC\n );\n }\n\n /**\n */\n set isBasicAuthentication(isBasicAuthentication: boolean) {\n this._isBasic = isBasicAuthentication;\n }\n\n /**\n */\n requestLogin(): Promise<any> {\n return universalFetch({\n url: `${getBasePath()}/login`,\n method: HTTP_METHODS.GET,\n headers: {\n Accept: \"application/json\",\n \"Content-Type\": \"application/x-www-form-urlencoded\",\n },\n });\n }\n\n /**\n */\n initLogin(initLogin: boolean): Promise<any> {\n if (this.isBasicAuthentication || !initLogin) {\n return Promise.resolve(true);\n }\n\n return this.requestLogin().catch((error) => {\n // when an unauthorizedexception is received on a request to the login service,\n // this indicates a basic authorization scenario\n // in case of form based authentication other exceptions are thrown\n if (error instanceof UnauthorizedException) {\n this.isBasicAuthentication = true;\n }\n\n return Promise.resolve({});\n });\n }\n\n /**\n */\n login(username: string, password: string): Promise<any> {\n switch (this.authenticationType) {\n case INTERNAL_LOGIN_TYPE.PAC4J_FORM:\n return this.doFormLogin(username, password);\n case INTERNAL_LOGIN_TYPE.PAC4J_BASIC:\n return this.doBasicAuthentication(username, password);\n default:\n return this.doJaasAuthentication(username, password);\n }\n }\n\n /**\n */\n getFormLoginUrl(): string {\n switch (this.authenticationType) {\n case INTERNAL_LOGIN_TYPE.PAC4J_BASIC:\n case INTERNAL_LOGIN_TYPE.PAC4J_FORM:\n return `${getBasePath()}${loginPath()}`;\n default:\n return `${getBasePath()}/j_security_check`;\n }\n }\n\n /**\n */\n getFormLoginData(username: string, password: string): string {\n const encodedUsername = encodeURIComponent(username);\n const encodedPassword = encodeURIComponent(password);\n\n switch (this.authenticationType) {\n case INTERNAL_LOGIN_TYPE.PAC4J_BASIC:\n case INTERNAL_LOGIN_TYPE.PAC4J_FORM:\n return `${loginUsernameField()}=${encodedUsername}&${loginPasswordField()}=${encodedPassword}`;\n default:\n return `j_username=${encodedUsername}&j_password=${encodedPassword}`;\n }\n }\n\n /**\n */\n doFormLogin(username: string, password: string): Promise<any> {\n return universalFetch({\n url: this.getFormLoginUrl(),\n method: HTTP_METHODS.POST,\n headers: {\n Accept: \"application/json\",\n \"Content-Type\": \"application/x-www-form-urlencoded\",\n },\n data: this.getFormLoginData(username, password),\n });\n }\n\n /**\n */\n doBasicAuthentication(username: string, password: string): Promise<any> {\n Cache.addItem(\"basic\", btoa(`${username}:${password}`));\n return this.requestLogin();\n }\n\n /**\n */\n doJaasAuthentication(username: string, password: string): Promise<any> {\n return this.initLogin(true).then(() => {\n if (this.isBasicAuthentication) {\n return this.doBasicAuthentication(username, password);\n }\n return this.doFormLogin(username, password);\n });\n }\n\n /**\n */\n getLogoutUrl(): string {\n switch (this.authenticationType) {\n case INTERNAL_LOGIN_TYPE.PAC4J_BASIC:\n case INTERNAL_LOGIN_TYPE.PAC4J_FORM:\n return `${getBasePath()}${logoutPath()}`;\n default:\n return `${getBasePath()}/Logoff`;\n }\n }\n\n /**\n */\n logout(): Promise<any> {\n return universalFetch({\n url: this.getLogoutUrl(),\n }).then((response) => {\n // clear cache because of cached contributions\n Cache.clear();\n return response;\n });\n }\n}\n\nexport default Authenticate;\n"],"mappings":";;;;;;;;;;AACA;AAEA;AACA;AAEA;AACA;AAUA;AACA;AACA,MAAMA,YAAY,CAAC;EAGjB;AACF;EACEC,WAAW,GAAG;IAAA;IACZ,IAAI,CAACC,QAAQ,GAAG,KAAK;EACvB;;EAEA;AACF;EACE,IAAIC,kBAAkB,GAAsC;IAC1D,MAAMC,IAAI,GAAG,IAAAC,oBAAS,GAAE;IAExB,IAAI,CAACD,IAAI,IAAIA,IAAI,KAAKE,8BAAmB,CAACC,IAAI,EAAE;MAC9C,OAAOD,8BAAmB,CAACC,IAAI;IACjC;IAEA,IAAI,uBAAAH,IAAI,OAAJA,IAAI,EAAU,YAAY,CAAC,EAAE;MAC/B,OAAOE,8BAAmB,CAACE,UAAU;IACvC,CAAC,MAAM,IAAI,uBAAAJ,IAAI,OAAJA,IAAI,EAAU,aAAa,CAA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E,qBAAqB,CAACH,QAAgB,EAAEC,QAAgB,EAAgB;IACtEc,cAAK,CAACC,OAAO,CAAC,OAAO,EAAEC,IAAI,CAAE,GAAEjB,QAAS,IAAGC,QAAS,EAAC,CAAC,CAAC;IACvD,OAAO,IAAI,CAAChB,YAAY,EAAE;EAC5B;;EAEA;AACF;EACEmB,oBAAoB,CAACJ,QAAgB,EAAEC,QAAgB,EAAgB;IACrE,OAAO,IAAI,CAACP,SAAS,CAAC,IAAI,CAAC,CAACwB,IAAI,CAAC,MAAM;MACrC,IAAI,IAAI,CAAClC,qBAAqB,EAAE;QAC9B,OAAO,IAAI,CAACmB,qBAAqB,CAACH,QAAQ,EAAEC,QAAQ,CAAC;MACvD;MACA,OAAO,IAAI,CAACC,WAAW,CAACF,QAAQ,EAAEC,QAAQ,CAAC;IAC7C,CAAC,CAAC;EACJ;;EAEA;AACF;EACEkB,YAAY,GAAW;IACrB,QAAQ,IAAI,CAAC3C,kBAAkB;MAC7B,KAAKG,8BAAmB,CAACG,WAAW;MACpC,KAAKH,8BAAmB,CAACE,UAAU;QACjC,OAAQ,GAAE,IAAAO,sBAAW,GAAG,GAAE,IAAAgC,qBAAU,GAAG,EAAC;MAC1C;QACE,OAAQ,GAAE,IAAAhC,sBAAW,GAAG,SAAQ;IAAC;EAEvC;;EAEA;AACF;EACEiC,MAAM,GAAiB;IACrB,OAAO,IAAAnC,uBAAc,EAAC;MACpBC,GAAG,EAAE,IAAI,CAACgC,YAAY;IACxB,CAAC,CAAC,CAACD,IAAI,CAAEI,QAAQ,IAAK;MACpB;MACAP,cAAK,CAACQ,KAAK,EAAE;MACb,OAAOD,QAAQ;IACjB,CAAC,CAAC;EACJ;AACF;AAAC,eAEcjD,YAAY;AAAA"}
|
|
@@ -8,9 +8,12 @@ exports.default = void 0;
|
|
|
8
8
|
var _styledComponents = _interopRequireDefault(require("styled-components"));
|
|
9
9
|
var _spacers = require("../react-theme/utils/spacers");
|
|
10
10
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
11
|
+
// $FlowFixMe
|
|
11
12
|
const StyledBoundary = /*#__PURE__*/_styledComponents.default.div.withConfig({
|
|
12
13
|
componentId: "sc-xsbtpo-0"
|
|
13
14
|
})(["padding:", ";margin-bottom:", ";background-color:#e9ecef;border-radius:0.3em;"], (0, _spacers.spacers)(2, 1), (0, _spacers.spacer)(2));
|
|
15
|
+
|
|
16
|
+
// $FlowFixMe
|
|
14
17
|
const StyledStack = /*#__PURE__*/_styledComponents.default.pre.withConfig({
|
|
15
18
|
componentId: "sc-xsbtpo-1"
|
|
16
19
|
})(["display:block;font-size:87.5%;color:#212529;font-style:italic;"]);
|
|
@@ -12,6 +12,7 @@ export type Props = {
|
|
|
12
12
|
+error: Error,
|
|
13
13
|
};
|
|
14
14
|
|
|
15
|
+
// $FlowFixMe
|
|
15
16
|
const StyledBoundary: StyledComponent<{}, Theme, *> = styled.div`
|
|
16
17
|
padding: ${spacers(2, 1)};
|
|
17
18
|
margin-bottom: ${spacer(2)};
|
|
@@ -19,6 +20,7 @@ const StyledBoundary: StyledComponent<{}, Theme, *> = styled.div`
|
|
|
19
20
|
border-radius: 0.3em;
|
|
20
21
|
`;
|
|
21
22
|
|
|
23
|
+
// $FlowFixMe
|
|
22
24
|
const StyledStack = styled.pre`
|
|
23
25
|
display: block;
|
|
24
26
|
font-size: 87.5%;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ErrorBoundaryFallback.js","names":["StyledBoundary","styled","div","spacers","spacer","StyledStack","pre","ErrorBoundaryFallback","className","componentStack","error","toString","displayName"],"sources":["../../src/react/ErrorBoundaryFallback.js"],"sourcesContent":["// @flow\nimport styled from \"styled-components\";\nimport { spacers, spacer } from \"../react-theme/utils/spacers\";\n\nimport type { StyledComponent } from \"styled-components\";\nimport type { Theme } from \"../react-theme/types\";\nimport type { Node } from \"react\";\n\nexport type Props = {\n +className?: string,\n +componentStack: string,\n +error: Error,\n};\n\nconst StyledBoundary: StyledComponent<{}, Theme, *> = styled.div`\n padding: ${spacers(2, 1)};\n margin-bottom: ${spacer(2)};\n background-color: #e9ecef;\n border-radius: 0.3em;\n`;\n\nconst StyledStack = styled.pre`\n display: block;\n font-size: 87.5%;\n color: #212529;\n font-style: italic;\n`;\n\n/**\n */\nconst ErrorBoundaryFallback = ({\n className,\n componentStack,\n error,\n}: Props): Node => (\n <StyledBoundary className={className}>\n <h2>{error.toString()}</h2>\n <StyledStack className=\"debug\">{componentStack}</StyledStack>\n </StyledBoundary>\n);\n\nErrorBoundaryFallback.displayName = \"BI.ErrorBoundaryFallback\";\n\nexport default ErrorBoundaryFallback;\n"],"mappings":";;;;;;;AACA;AACA;AAA+D;AAY/D,MAAMA,cAA6C,gBAAGC,yBAAM,CAACC,GAAG;EAAA;AAAA,sFACnD,IAAAC,gBAAO,EAAC,CAAC,EAAE,CAAC,CAAC,EACP,IAAAC,eAAM,EAAC,CAAC,CAAC,CAG3B;
|
|
1
|
+
{"version":3,"file":"ErrorBoundaryFallback.js","names":["StyledBoundary","styled","div","spacers","spacer","StyledStack","pre","ErrorBoundaryFallback","className","componentStack","error","toString","displayName"],"sources":["../../src/react/ErrorBoundaryFallback.js"],"sourcesContent":["// @flow\nimport styled from \"styled-components\";\nimport { spacers, spacer } from \"../react-theme/utils/spacers\";\n\nimport type { StyledComponent } from \"styled-components\";\nimport type { Theme } from \"../react-theme/types\";\nimport type { Node } from \"react\";\n\nexport type Props = {\n +className?: string,\n +componentStack: string,\n +error: Error,\n};\n\n// $FlowFixMe\nconst StyledBoundary: StyledComponent<{}, Theme, *> = styled.div`\n padding: ${spacers(2, 1)};\n margin-bottom: ${spacer(2)};\n background-color: #e9ecef;\n border-radius: 0.3em;\n`;\n\n// $FlowFixMe\nconst StyledStack = styled.pre`\n display: block;\n font-size: 87.5%;\n color: #212529;\n font-style: italic;\n`;\n\n/**\n */\nconst ErrorBoundaryFallback = ({\n className,\n componentStack,\n error,\n}: Props): Node => (\n <StyledBoundary className={className}>\n <h2>{error.toString()}</h2>\n <StyledStack className=\"debug\">{componentStack}</StyledStack>\n </StyledBoundary>\n);\n\nErrorBoundaryFallback.displayName = \"BI.ErrorBoundaryFallback\";\n\nexport default ErrorBoundaryFallback;\n"],"mappings":";;;;;;;AACA;AACA;AAA+D;AAY/D;AACA,MAAMA,cAA6C,gBAAGC,yBAAM,CAACC,GAAG;EAAA;AAAA,sFACnD,IAAAC,gBAAO,EAAC,CAAC,EAAE,CAAC,CAAC,EACP,IAAAC,eAAM,EAAC,CAAC,CAAC,CAG3B;;AAED;AACA,MAAMC,WAAW,gBAAGJ,yBAAM,CAACK,GAAG;EAAA;AAAA,sEAK7B;;AAED;AACA;AACA,MAAMC,qBAAqB,GAAG;EAAA,IAAC;IAC7BC,SAAS;IACTC,cAAc;IACdC;EACK,CAAC;EAAA,oBACN,sBAAC,cAAc;IAAC,SAAS,EAAEF,SAAU;IAAA,wBACnC;MAAA,UAAKE,KAAK,CAACC,QAAQ;IAAE,EAAM,eAC3B,qBAAC,WAAW;MAAC,SAAS,EAAC,OAAO;MAAA,UAAEF;IAAc,EAAe;EAAA,EAC9C;AAAA,CAClB;AAEDF,qBAAqB,CAACK,WAAW,GAAG,0BAA0B;AAAC,eAEhDL,qBAAqB;AAAA"}
|
|
@@ -141,6 +141,7 @@ const setApplication = store => {
|
|
|
141
141
|
const application = new _ModularUIRequest.default("/", {
|
|
142
142
|
locale: locale
|
|
143
143
|
}).fetchSync();
|
|
144
|
+
application.connectKey = `application(/)(${locale})`;
|
|
144
145
|
store.dispatch((0, _redux.initModels)([{
|
|
145
146
|
key: `application(/)(${locale})`,
|
|
146
147
|
model: application
|