@beinformed/ui 1.19.0 → 1.19.4
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 +16 -0
- package/esm/constants/Settings.js +6 -0
- package/esm/constants/Settings.js.map +1 -1
- package/esm/models/application/ApplicationModel.js +9 -0
- package/esm/models/application/ApplicationModel.js.map +1 -1
- package/esm/models/attributes/PasswordAttributeModel.js +4 -5
- package/esm/models/attributes/PasswordAttributeModel.js.map +1 -1
- package/esm/models/types.js.map +1 -1
- package/esm/redux/actions/Application.js +2 -1
- package/esm/redux/actions/Application.js.map +1 -1
- package/esm/redux/actions/Authorization.js +5 -2
- package/esm/redux/actions/Authorization.js.map +1 -1
- package/esm/redux/actions/SignOut.js +1 -1
- package/esm/redux/actions/SignOut.js.map +1 -1
- package/lib/constants/Settings.js +6 -0
- package/lib/constants/Settings.js.flow +9 -0
- package/lib/constants/Settings.js.map +1 -1
- package/lib/hooks/__tests__/useAuthentication.spec.js.flow +8 -0
- package/lib/models/application/ApplicationModel.js +9 -0
- package/lib/models/application/ApplicationModel.js.flow +7 -1
- package/lib/models/application/ApplicationModel.js.map +1 -1
- package/lib/models/attributes/PasswordAttributeModel.js +4 -5
- package/lib/models/attributes/PasswordAttributeModel.js.flow +8 -6
- package/lib/models/attributes/PasswordAttributeModel.js.map +1 -1
- package/lib/models/types.js.flow +7 -0
- package/lib/models/types.js.map +1 -1
- package/lib/redux/actions/Application.js +1 -0
- package/lib/redux/actions/Application.js.flow +3 -1
- package/lib/redux/actions/Application.js.map +1 -1
- package/lib/redux/actions/Authorization.js +6 -2
- package/lib/redux/actions/Authorization.js.flow +4 -2
- package/lib/redux/actions/Authorization.js.map +1 -1
- package/lib/redux/actions/SignOut.js.flow +1 -1
- package/lib/redux/actions/SignOut.js.map +1 -1
- package/lib/redux/actions/__tests__/Application.spec.js.flow +8 -0
- package/lib/redux/actions/__tests__/Authorization.spec.js.flow +4 -0
- package/package.json +15 -27
- package/src/constants/Settings.js +9 -0
- package/src/hooks/__tests__/useAuthentication.spec.js +8 -0
- package/src/models/application/ApplicationModel.js +7 -1
- package/src/models/attributes/PasswordAttributeModel.js +8 -6
- package/src/models/types.js +7 -0
- package/src/redux/actions/Application.js +3 -1
- package/src/redux/actions/Authorization.js +4 -2
- package/src/redux/actions/SignOut.js +1 -1
- package/src/redux/actions/__tests__/Application.spec.js +8 -0
- package/src/redux/actions/__tests__/Authorization.spec.js +4 -0
- package/builder/package.json +0 -8
- package/exceptions/package.json +0 -8
- package/hooks/package.json +0 -8
- package/i18n/package.json +0 -8
- package/models/package.json +0 -8
- package/modularui/package.json +0 -8
- package/react/package.json +0 -8
- package/react-client/package.json +0 -8
- package/react-server/package.json +0 -8
- package/react-theme/package.json +0 -8
- package/redux/package.json +0 -8
- package/utils/package.json +0 -8
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PasswordAttributeModel.js","names":["PasswordAttributeModel","value","updateLastModification","inputvalue","getContribution","constraints","upperAndLowerCaseMandatory","maxSequenceOfIdenticalCharacters","maxSequenceOfUsernameCharacters","minNumberOfNumericCharacters","minNumberOfSpecialCharacters","regexConstraint","isConfirmPassword","getConfirmPasswordConstraints","getStandardPasswordConstraints","ConstraintCollection","add","PasswordConfirmConstraint","confirmValue","otherLabel","PasswordLowerAndUpperCaseConstraint","PasswordThreeConsecutiveCharactersNotAllowedConstraint","PasswordMinNumericCharactersConstraint","PasswordMinSpecialCharactersConstraint","regexConstraints","length","forEach","RegexConstraint","layouthint","has","CONFIRM_PASSWORD","addConstraints","_isConfirmPassword","_confirmValue","validate","_otherLabel","useClientsideValidation","isOptionalAndEmpty","_isValid","_validatedValue","constraintCollection","inError","name","contributions","type","Array","isArray","StringAttributeModel"],"sources":["../../../src/models/attributes/PasswordAttributeModel.js"],"sourcesContent":["// @flow\nimport StringAttributeModel from \"./StringAttributeModel\";\nimport ConstraintCollection from \"./input-constraints/ConstraintCollection\";\n\nimport PasswordLowerAndUpperCaseConstraint from \"./input-constraints/PasswordLowerAndUpperCaseConstraint\";\nimport PasswordThreeConsecutiveCharactersNotAllowedConstraint from \"./input-constraints/PasswordThreeConsecutiveCharactersNotAllowedConstraint\";\nimport PasswordMinNumericCharactersConstraint from \"./input-constraints/PasswordMinNumericCharactersConstraint\";\nimport PasswordMinSpecialCharactersConstraint from \"./input-constraints/PasswordMinSpecialCharactersConstraint\";\nimport RegexConstraint from \"./input-constraints/RegexConstraint\";\nimport PasswordConfirmConstraint from \"./input-constraints/PasswordConfirmConstraint\";\n\nimport { CONFIRM_PASSWORD } from \"../../constants/LayoutHints\";\n\nimport type { RegexObject } from \"./input-constraints/RegexConstraint\";\n\n/**\n * Password attribute\n */\nexport default class PasswordAttributeModel extends StringAttributeModel {\n _confirmValue: string;\n _isConfirmPassword: boolean;\n _otherLabel: string;\n\n /**\n */\n static isApplicableModel(contributions: Object): boolean {\n const layouthint = contributions?.layouthint;\n return (\n contributions.type === \"password\" ||\n (Array.isArray(layouthint) && layouthint.includes(\"password\"))\n );\n }\n\n /**\n */\n get type(): string {\n return \"password\";\n }\n\n /**\n * Update the attribute by name and value\n */\n update(value: string): PasswordAttributeModel {\n this.updateLastModification();\n this.inputvalue = value;\n\n return this;\n }\n\n /**\n */\n get constraints(): Object {\n return this.getContribution(\"constraints\", {});\n }\n\n /**\n */\n get upperAndLowerCaseMandatory(): ?boolean {\n return this.constraints.upperAndLowerCaseMandatory;\n }\n\n /**\n */\n get maxSequenceOfIdenticalCharacters(): ?number {\n return this.constraints.maxSequenceOfIdenticalCharacters;\n }\n\n /**\n */\n get maxSequenceOfUsernameCharacters(): ?number {\n return this.constraints.maxSequenceOfUsernameCharacters;\n }\n\n /**\n */\n get minNumberOfNumericCharacters(): ?number {\n return this.constraints.minNumberOfNumericCharacters;\n }\n\n /**\n */\n get minNumberOfSpecialCharacters(): ?number {\n return this.constraints.minNumberOfSpecialCharacters;\n }\n\n /**\n */\n get regexConstraints(): ?Array<RegexObject> {\n return this.constraints.regexConstraint;\n }\n\n /**\n * Add password constraints\n */\n addConstraints(): ConstraintCollection {\n if (this.isConfirmPassword) {\n return this.getConfirmPasswordConstraints();\n }\n return this.getStandardPasswordConstraints();\n }\n\n /**\n * Constraints for a confirmation password\n */\n getConfirmPasswordConstraints(): ConstraintCollection {\n const constraints = new ConstraintCollection();\n constraints.add(\n new PasswordConfirmConstraint(this.confirmValue, this.otherLabel)\n );\n return constraints;\n }\n\n /**\n * Constrains for a standard password\n */\n getStandardPasswordConstraints(): ConstraintCollection {\n const constraints = new ConstraintCollection();\n\n if (this.upperAndLowerCaseMandatory) {\n constraints.add(new PasswordLowerAndUpperCaseConstraint());\n }\n\n if (this.maxSequenceOfIdenticalCharacters) {\n constraints.add(\n new PasswordThreeConsecutiveCharactersNotAllowedConstraint(\n this.maxSequenceOfIdenticalCharacters\n )\n );\n }\n\n if (this.minNumberOfNumericCharacters) {\n constraints.add(\n new PasswordMinNumericCharactersConstraint(\n this.minNumberOfNumericCharacters\n )\n );\n }\n\n if (this.minNumberOfSpecialCharacters) {\n constraints.add(\n new PasswordMinSpecialCharactersConstraint(\n this.minNumberOfSpecialCharacters\n )\n );\n }\n\n if (this.regexConstraints && this.regexConstraints.length > 0) {\n this.regexConstraints.forEach((regexConstraint) => {\n constraints.add(new RegexConstraint(regexConstraint));\n });\n }\n\n if (this.layouthint.has(CONFIRM_PASSWORD) && this.confirmValue !== \"\") {\n constraints.add(\n new PasswordConfirmConstraint(this.confirmValue, this.otherLabel)\n );\n }\n\n return constraints;\n }\n\n /**\n * Retrieve applicable constraint for this attribute\n */\n get constraintCollection(): ConstraintCollection {\n if (this.isConfirmPassword) {\n const constraints = new ConstraintCollection();\n constraints.add(this.addConstraints());\n return constraints;\n }\n\n return super.constraintCollection;\n }\n\n /**\n */\n get isConfirmPassword(): boolean {\n return this._isConfirmPassword || false;\n }\n\n /**\n */\n set isConfirmPassword(isConfirmPassword: boolean) {\n this._isConfirmPassword = isConfirmPassword;\n }\n\n /**\n */\n get confirmValue(): string {\n return this._confirmValue || \"\";\n }\n\n /**\n */\n set confirmValue(confirmValue: string) {\n this._confirmValue = confirmValue;\n\n this.validate(this.inputvalue);\n }\n\n /**\n */\n get otherLabel(): string {\n return this._otherLabel;\n }\n\n /**\n */\n set otherLabel(otherLabel: string) {\n this._otherLabel = otherLabel;\n }\n\n /**\n * Validate input\n */\n validate(value: string): boolean {\n // when client side validation is disabled, this attribute is always valid\n if (!this.useClientsideValidation()) {\n return true;\n }\n\n if (this.isOptionalAndEmpty(value)) {\n this._isValid = true;\n } else if (this._validatedValue !== `${this.confirmValue}-${value}`) {\n this._isValid = this.constraintCollection.validate(value);\n }\n this._validatedValue = `${this.confirmValue}-${value}`;\n\n return this._isValid;\n }\n\n /**\n */\n getFormData(): { [string]: any } | null {\n if (this.isConfirmPassword || this.inError()) {\n return null;\n }\n\n return {\n [this.name]: this.value,\n };\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA;;AACA;;AAEA;;AACA;;AACA;;AACA;;AACA;;AACA;;AAEA;;;;;;AAIA;AACA;AACA;IACqBA,sB;;;;;;;;;;;;;;;;;;;;;;;;;;IAenB;AACF;IACE,eAAmB;MACjB,OAAO,UAAP;IACD;IAED;AACF;AACA;;;;WACE,gBAAOC,KAAP,EAA8C;MAC5C,KAAKC,sBAAL;MACA,KAAKC,UAAL,GAAkBF,KAAlB;MAEA,OAAO,IAAP;IACD;IAED;AACF;;;;SACE,eAA0B;MACxB,OAAO,KAAKG,eAAL,CAAqB,aAArB,EAAoC,EAApC,CAAP;IACD;IAED;AACF;;;;SACE,eAA2C;MACzC,OAAO,KAAKC,WAAL,CAAiBC,0BAAxB;IACD;IAED;AACF;;;;SACE,eAAgD;MAC9C,OAAO,KAAKD,WAAL,CAAiBE,gCAAxB;IACD;IAED;AACF;;;;SACE,eAA+C;MAC7C,OAAO,KAAKF,WAAL,CAAiBG,+BAAxB;IACD;IAED;AACF;;;;SACE,eAA4C;MA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BAAiDjB,KAAjD,CAAJ,EAA8D;QACnE,KAAKqC,QAAL,GAAgB,KAAKE,oBAAL,CAA0BN,QAA1B,CAAmCjC,KAAnC,CAAhB;MACD;;MACD,KAAKsC,eAAL,8CAA0B,KAAKrB,YAA/B,wBAA+CjB,KAA/C;MAEA,OAAO,KAAKqC,QAAZ;IACD;IAED;AACF;;;;WACE,uBAAwC;MACtC,IAAI,KAAK1B,iBAAL,IAA0B,KAAK6B,OAAL,EAA9B,EAA8C;QAC5C,OAAO,IAAP;MACD;;MAED,yCACG,KAAKC,IADR,EACe,KAAKzC,KADpB;IAGD;;;;IA1ND;AACF;IACE,2BAAyB0C,aAAzB,EAAyD;MACvD,IAAMf,UAAU,GAAGe,aAAH,aAAGA,aAAH,uBAAGA,aAAa,CAAEf,UAAlC;MACA,OACEe,aAAa,CAACC,IAAd,KAAuB,UAAvB,IACCC,KAAK,CAACC,OAAN,CAAclB,UAAd,KAA6B,uBAAAA,UAAU,MAAV,CAAAA,UAAU,EAAU,UAAV,CAF1C;IAID;;;EAbiDmB,8B"}
|
|
1
|
+
{"version":3,"file":"PasswordAttributeModel.js","names":["PasswordAttributeModel","value","updateLastModification","inputvalue","getContribution","constraints","upperAndLowerCaseMandatory","maxSequenceOfIdenticalCharacters","maxSequenceOfUsernameCharacters","minNumberOfNumericCharacters","minNumberOfSpecialCharacters","regexConstraint","isConfirmPassword","getConfirmPasswordConstraints","getStandardPasswordConstraints","ConstraintCollection","add","PasswordConfirmConstraint","confirmValue","otherLabel","PasswordLowerAndUpperCaseConstraint","PasswordThreeConsecutiveCharactersNotAllowedConstraint","PasswordMinNumericCharactersConstraint","PasswordMinSpecialCharactersConstraint","regexConstraints","length","forEach","RegexConstraint","layouthint","has","CONFIRM_PASSWORD","_isConfirmPassword","_confirmValue","validate","_otherLabel","useClientsideValidation","isOptionalAndEmpty","_isValid","_validatedValue","constraintCollection","inError","name","contributions","type","Array","isArray","StringAttributeModel"],"sources":["../../../src/models/attributes/PasswordAttributeModel.js"],"sourcesContent":["// @flow\nimport StringAttributeModel from \"./StringAttributeModel\";\nimport ConstraintCollection from \"./input-constraints/ConstraintCollection\";\n\nimport PasswordLowerAndUpperCaseConstraint from \"./input-constraints/PasswordLowerAndUpperCaseConstraint\";\nimport PasswordThreeConsecutiveCharactersNotAllowedConstraint from \"./input-constraints/PasswordThreeConsecutiveCharactersNotAllowedConstraint\";\nimport PasswordMinNumericCharactersConstraint from \"./input-constraints/PasswordMinNumericCharactersConstraint\";\nimport PasswordMinSpecialCharactersConstraint from \"./input-constraints/PasswordMinSpecialCharactersConstraint\";\nimport RegexConstraint from \"./input-constraints/RegexConstraint\";\nimport PasswordConfirmConstraint from \"./input-constraints/PasswordConfirmConstraint\";\n\nimport { CONFIRM_PASSWORD } from \"../../constants/LayoutHints\";\n\nimport type { RegexObject } from \"./input-constraints/RegexConstraint\";\n\n/**\n * Password attribute\n */\nexport default class PasswordAttributeModel extends StringAttributeModel {\n _confirmValue: string;\n _isConfirmPassword: boolean;\n _otherLabel: string;\n\n /**\n */\n static isApplicableModel(contributions: Object): boolean {\n const layouthint = contributions?.layouthint;\n return (\n contributions.type === \"password\" ||\n (Array.isArray(layouthint) && layouthint.includes(\"password\"))\n );\n }\n\n /**\n */\n get type(): string {\n return \"password\";\n }\n\n /**\n * Update the attribute by name and value\n */\n update(value: string): PasswordAttributeModel {\n this.updateLastModification();\n this.inputvalue = value;\n\n return this;\n }\n\n /**\n */\n get constraints(): Object {\n return this.getContribution(\"constraints\", {});\n }\n\n /**\n */\n get upperAndLowerCaseMandatory(): ?boolean {\n return this.constraints.upperAndLowerCaseMandatory;\n }\n\n /**\n */\n get maxSequenceOfIdenticalCharacters(): ?number {\n return this.constraints.maxSequenceOfIdenticalCharacters;\n }\n\n /**\n */\n get maxSequenceOfUsernameCharacters(): ?number {\n return this.constraints.maxSequenceOfUsernameCharacters;\n }\n\n /**\n */\n get minNumberOfNumericCharacters(): ?number {\n return this.constraints.minNumberOfNumericCharacters;\n }\n\n /**\n */\n get minNumberOfSpecialCharacters(): ?number {\n return this.constraints.minNumberOfSpecialCharacters;\n }\n\n /**\n */\n get regexConstraints(): ?Array<RegexObject> {\n return this.constraints.regexConstraint;\n }\n\n /**\n * Add password constraints\n */\n addConstraints(): ConstraintCollection {\n if (this.isConfirmPassword) {\n return this.getConfirmPasswordConstraints();\n }\n return this.getStandardPasswordConstraints();\n }\n\n /**\n * Constraints for a confirmation password\n */\n getConfirmPasswordConstraints(): ConstraintCollection {\n const constraints = new ConstraintCollection();\n constraints.add(\n new PasswordConfirmConstraint(this.confirmValue, this.otherLabel)\n );\n return constraints;\n }\n\n /**\n * Constrains for a standard password\n */\n getStandardPasswordConstraints(): ConstraintCollection {\n const constraints = new ConstraintCollection();\n\n if (this.upperAndLowerCaseMandatory) {\n constraints.add(new PasswordLowerAndUpperCaseConstraint());\n }\n\n if (this.maxSequenceOfIdenticalCharacters) {\n constraints.add(\n new PasswordThreeConsecutiveCharactersNotAllowedConstraint(\n this.maxSequenceOfIdenticalCharacters\n )\n );\n }\n\n if (this.minNumberOfNumericCharacters) {\n constraints.add(\n new PasswordMinNumericCharactersConstraint(\n this.minNumberOfNumericCharacters\n )\n );\n }\n\n if (this.minNumberOfSpecialCharacters) {\n constraints.add(\n new PasswordMinSpecialCharactersConstraint(\n this.minNumberOfSpecialCharacters\n )\n );\n }\n\n if (this.regexConstraints && this.regexConstraints.length > 0) {\n this.regexConstraints.forEach((regexConstraint) => {\n constraints.add(new RegexConstraint(regexConstraint));\n });\n }\n\n if (\n this.layouthint.has(CONFIRM_PASSWORD) &&\n this.isConfirmPassword == null\n ) {\n constraints.add(\n new PasswordConfirmConstraint(this.confirmValue, this.otherLabel)\n );\n }\n\n return constraints;\n }\n\n /**\n * Retrieve applicable constraint for this attribute\n */\n get constraintCollection(): ConstraintCollection {\n if (this.isConfirmPassword) {\n // confirm password only needs local constraints, no server constraints\n return this.getConfirmPasswordConstraints();\n }\n\n return super.constraintCollection;\n }\n\n /**\n */\n get isConfirmPassword(): boolean | null {\n return this._isConfirmPassword;\n }\n\n /**\n */\n set isConfirmPassword(isConfirmPassword: boolean) {\n this._isConfirmPassword = isConfirmPassword;\n }\n\n /**\n */\n get confirmValue(): string {\n return this._confirmValue || \"\";\n }\n\n /**\n */\n set confirmValue(confirmValue: string) {\n this._confirmValue = confirmValue;\n\n this.validate(this.inputvalue);\n }\n\n /**\n */\n get otherLabel(): string {\n return this._otherLabel;\n }\n\n /**\n */\n set otherLabel(otherLabel: string) {\n this._otherLabel = otherLabel;\n }\n\n /**\n * Validate input\n */\n validate(value: string): boolean {\n // when client side validation is disabled, this attribute is always valid\n if (!this.useClientsideValidation()) {\n return true;\n }\n\n if (this.isOptionalAndEmpty(value)) {\n this._isValid = true;\n } else if (this._validatedValue !== `${this.confirmValue}-${value}`) {\n this._isValid = this.constraintCollection.validate(value);\n }\n this._validatedValue = `${this.confirmValue}-${value}`;\n\n return this._isValid;\n }\n\n /**\n */\n getFormData(): { [string]: any } | null {\n if (this.isConfirmPassword || this.inError()) {\n return null;\n }\n\n return {\n [this.name]: this.value,\n };\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA;;AACA;;AAEA;;AACA;;AACA;;AACA;;AACA;;AACA;;AAEA;;;;;;AAIA;AACA;AACA;IACqBA,sB;;;;;;;;;;;;;;;;;;;;;;;;;;IAenB;AACF;IACE,eAAmB;MACjB,OAAO,UAAP;IACD;IAED;AACF;AACA;;;;WACE,gBAAOC,KAAP,EAA8C;MAC5C,KAAKC,sBAAL;MACA,KAAKC,UAAL,GAAkBF,KAAlB;MAEA,OAAO,IAAP;IACD;IAED;AACF;;;;SACE,eAA0B;MACxB,OAAO,KAAKG,eAAL,CAAqB,aAArB,EAAoC,EAApC,CAAP;IACD;IAED;AACF;;;;SACE,eAA2C;MACzC,OAAO,KAAKC,WAAL,CAAiBC,0BAAxB;IACD;IAED;AACF;;;;SACE,eAAgD;MAC9C,OAAO,KAAKD,WAAL,CAA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KpB,YAAjC,wBAAiDjB,KAAjD,CAAJ,EAA8D;QACnE,KAAKoC,QAAL,GAAgB,KAAKE,oBAAL,CAA0BN,QAA1B,CAAmChC,KAAnC,CAAhB;MACD;;MACD,KAAKqC,eAAL,8CAA0B,KAAKpB,YAA/B,wBAA+CjB,KAA/C;MAEA,OAAO,KAAKoC,QAAZ;IACD;IAED;AACF;;;;WACE,uBAAwC;MACtC,IAAI,KAAKzB,iBAAL,IAA0B,KAAK4B,OAAL,EAA9B,EAA8C;QAC5C,OAAO,IAAP;MACD;;MAED,yCACG,KAAKC,IADR,EACe,KAAKxC,KADpB;IAGD;;;;IA5ND;AACF;IACE,2BAAyByC,aAAzB,EAAyD;MACvD,IAAMd,UAAU,GAAGc,aAAH,aAAGA,aAAH,uBAAGA,aAAa,CAAEd,UAAlC;MACA,OACEc,aAAa,CAACC,IAAd,KAAuB,UAAvB,IACCC,KAAK,CAACC,OAAN,CAAcjB,UAAd,KAA6B,uBAAAA,UAAU,MAAV,CAAAA,UAAU,EAAU,UAAV,CAF1C;IAID;;;EAbiDkB,8B"}
|
package/lib/models/types.js.flow
CHANGED
|
@@ -153,6 +153,13 @@ export interface IModelWithChildModels {
|
|
|
153
153
|
setChildModels(models: Array<ModularUIModel>): void;
|
|
154
154
|
}
|
|
155
155
|
|
|
156
|
+
export type AuthenticationType = {
|
|
157
|
+
name: string,
|
|
158
|
+
authentication: string,
|
|
159
|
+
redirectUri: string,
|
|
160
|
+
isPrimary: boolean,
|
|
161
|
+
};
|
|
162
|
+
|
|
156
163
|
export type FileEntryType = {
|
|
157
164
|
name: string,
|
|
158
165
|
size?: number,
|
package/lib/models/types.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","names":[],"sources":["../../src/models/types.js"],"sourcesContent":["// @flow\nimport type ApplicationModel from \"./application/ApplicationModel\";\nimport type BooleanAttributeModel from \"./attributes/BooleanAttributeModel\";\nimport type CaptchaAttributeModel from \"./attributes/CaptchaAttributeModel\";\nimport type ChoiceAttributeModel from \"./attributes/ChoiceAttributeModel\";\nimport type CompositeAttributeModel from \"./attributes/CompositeAttributeModel\";\nimport type DatetimeAttributeModel from \"./attributes/DatetimeAttributeModel\";\nimport type HelptextAttributeModel from \"./attributes/HelptextAttributeModel\";\nimport type LabelAttributeModel from \"./attributes/LabelAttributeModel\";\nimport type MemoAttributeModel from \"./attributes/MemoAttributeModel\";\nimport type MoneyAttributeModel from \"./attributes/MoneyAttributeModel\";\nimport type NumberAttributeModel from \"./attributes/NumberAttributeModel\";\nimport type PasswordAttributeModel from \"./attributes/PasswordAttributeModel\";\nimport type StringAttributeModel from \"./attributes/StringAttributeModel\";\nimport type UploadAttributeModel from \"./attributes/UploadAttributeModel\";\nimport type XMLAttributeModel from \"./attributes/XMLAttributeModel\";\nimport type CaseViewModel from \"./caseview/CaseViewModel\";\nimport type BusinessScenarioModel from \"./concepts/BusinessScenarioModel\";\nimport type ConceptDetailModel from \"./concepts/ConceptDetailModel\";\nimport type ConceptIndexModel from \"./concepts/ConceptIndexModel\";\nimport type ConceptTypeDetailModel from \"./concepts/ConceptTypeDetailModel\";\nimport type ContentIndexModel from \"./content/ContentIndexModel\";\nimport type ContentModel from \"./content/ContentModel\";\nimport type SectionModel from \"./content/SectionModel\";\nimport type ContentTOCModel from \"./content/ContentTOCModel\";\nimport type ContentTypeModel from \"./content/ContentTypeModel\";\nimport type DetailModel from \"./detail/DetailModel\";\nimport type AssignmentFilterModel from \"./filters/AssignmentFilterModel\";\nimport type FilterModel from \"./filters/FilterModel\";\nimport type RangeFilterModel from \"./filters/RangeFilterModel\";\nimport type ConceptIndexFilterModel from \"./filters/ConceptIndexFilterModel\";\nimport type FormModel from \"./form/FormModel\";\nimport type ListDetailModel from \"./list/ListDetailModel\";\nimport type ListModel from \"./list/ListModel\";\nimport type ModelCatalogModel from \"./modelcatalog/ModelCatalogModel\";\nimport type GroupingPanelModel from \"./panels/GroupingPanelModel\";\nimport type CaseSearchModel from \"./search/CaseSearchModel\";\nimport type TabModel from \"./tab/TabModel\";\nimport type TaskGroupModel from \"./taskgroup/TaskGroupModel\";\nimport type UserModel from \"./user/UserModel\";\nimport type UserServicesModel from \"./user/UserServicesModel\";\nimport type LinkModel from \"./links/LinkModel\";\nimport type LookupOptionsModel from \"./lookup/LookupOptionsModel\";\nimport type BaseFilterModel from \"./filters/BaseFilterModel\";\nimport type AttributeCollection from \"./attributes/AttributeCollection\";\nimport type AttributeModel from \"./attributes/AttributeModel\";\nimport type LayoutHintCollection from \"./layouthint/LayoutHintCollection\";\n\nexport type ModularUIModel =\n | ApplicationModel\n | CaseSearchModel\n | CaseViewModel\n | ListDetailModel\n | DetailModel\n | FormModel\n | GroupingPanelModel\n | ListModel\n | TabModel\n | TaskGroupModel\n | UserModel\n | UserServicesModel\n | ModelCatalogModel\n | ConceptIndexModel\n | ConceptDetailModel\n | BusinessScenarioModel\n | ConceptTypeDetailModel\n | ContentIndexModel\n | ContentTOCModel\n | ContentModel\n | ContentTypeModel\n | LookupOptionsModel;\n\nexport type AttributeType =\n | BooleanAttributeModel\n | CaptchaAttributeModel\n | ChoiceAttributeModel\n | DatetimeAttributeModel\n | HelptextAttributeModel\n | LabelAttributeModel\n | MemoAttributeModel\n | MoneyAttributeModel\n | NumberAttributeModel\n | PasswordAttributeModel\n | CompositeAttributeModel\n | StringAttributeModel\n | UploadAttributeModel\n | XMLAttributeModel;\n\nexport type RangeChildAttributeType =\n | NumberAttributeModel\n | DatetimeAttributeModel;\n\nexport type FilterType =\n | BaseFilterModel\n | FilterModel\n | AssignmentFilterModel\n | RangeFilterModel\n | ConceptIndexFilterModel;\n\nexport type FormErrorAnchor = {\n id: string,\n properties?: {\n [propertyName: string]: string | number,\n },\n anchor?: {\n objectid: string,\n elementid?: string,\n _links?: Object,\n index?: number,\n \"index-identifier\"?: string,\n },\n message: string,\n param?: {\n name: string,\n },\n};\n\nexport type labelsJSON = {|\n _id: string,\n label: string,\n value: string,\n|};\n\nexport type propertyJSON = {|\n _id: string,\n type: string,\n mandatory: string,\n label: string,\n value: string,\n|};\n\nexport type textfragmentJSON = {|\n label: string,\n text: string,\n type: string,\n|};\n\nexport interface IConstraintModel {\n +id: string;\n +defaultMessage: string;\n +parameters: Object;\n +isMandatoryConstraint: boolean;\n validate(value: any): boolean;\n hasValidation(): boolean;\n}\n\nexport interface ILayoutHintRule {\n process(attribute: AttributeModel, attributes: AttributeCollection): void;\n}\n\nexport interface IModelWithChildModels {\n getInitialChildModelLinks(): Array<LinkModel>;\n setChildModels(models: Array<ModularUIModel>): void;\n}\n\nexport type FileEntryType = {\n name: string,\n size?: number,\n progress: number,\n error?: string,\n token?: string,\n};\n\nexport type FilesType = {\n [filename: string]: FileEntryType,\n};\n\nexport type FiletypeConstraintsType = Array<{|\n extensions: Array<string>,\n mimeTypes: Array<string>,\n|}>;\n\nexport type FilesizeConstraintsType = {\n fileSize: ?number,\n maxTotalFileSize: ?number,\n isMaxTotal: boolean,\n};\n\nexport type PropertyData = { type: string, label: string, value: string };\nexport type TextFragmentData = {\n type: string,\n label: string,\n text: string | { id?: string, message: string, properties?: Object },\n};\nexport type SectionData = {\n id: string,\n type: string,\n label?: string,\n number?: string,\n body: string | { id?: string, message: string, properties?: Object },\n _links: { self: { href: string } },\n childSections: Array<SectionData>,\n subSections: Array<SectionData>,\n};\n\nexport type PropertyElement = {\n propertyElement: {\n label: string,\n layouthint: Array<string>,\n properties: Array<PropertyData>,\n },\n};\nexport type TextFragmentElement = {\n textFragmentElement: {\n label: string,\n layouthint: Array<string>,\n textfragments: Array<TextFragmentData>,\n },\n};\nexport type ContentElement = {\n contentElement: {\n label: string,\n layouthint: Array<string>,\n sections: Array<SectionData>,\n },\n};\n\nexport type PropertyElementMapped = {\n propertyElement: {\n label: string,\n layouthint: LayoutHintCollection,\n properties: Array<PropertyData>,\n },\n};\nexport type TextFragmentElementMapped = {\n textFragmentElement: {\n label: string,\n layouthint: LayoutHintCollection,\n textfragments: Array<TextFragmentData>,\n },\n};\nexport type ContentElementMapped = {\n contentElement: {\n label: string,\n layouthint: LayoutHintCollection,\n sections: Array<SectionModel>,\n },\n};\n\nexport type ContentAll = Array<\n PropertyElementMapped | TextFragmentElementMapped | ContentElementMapped\n>;\n\nexport type ContentData = {\n header: {\n label?: string,\n description?: { id?: string, message: string, properties?: Object },\n },\n label?: string,\n elements: Array<PropertyElement | TextFragmentElement | ContentElement>,\n};\n"],"mappings":""}
|
|
1
|
+
{"version":3,"file":"types.js","names":[],"sources":["../../src/models/types.js"],"sourcesContent":["// @flow\nimport type ApplicationModel from \"./application/ApplicationModel\";\nimport type BooleanAttributeModel from \"./attributes/BooleanAttributeModel\";\nimport type CaptchaAttributeModel from \"./attributes/CaptchaAttributeModel\";\nimport type ChoiceAttributeModel from \"./attributes/ChoiceAttributeModel\";\nimport type CompositeAttributeModel from \"./attributes/CompositeAttributeModel\";\nimport type DatetimeAttributeModel from \"./attributes/DatetimeAttributeModel\";\nimport type HelptextAttributeModel from \"./attributes/HelptextAttributeModel\";\nimport type LabelAttributeModel from \"./attributes/LabelAttributeModel\";\nimport type MemoAttributeModel from \"./attributes/MemoAttributeModel\";\nimport type MoneyAttributeModel from \"./attributes/MoneyAttributeModel\";\nimport type NumberAttributeModel from \"./attributes/NumberAttributeModel\";\nimport type PasswordAttributeModel from \"./attributes/PasswordAttributeModel\";\nimport type StringAttributeModel from \"./attributes/StringAttributeModel\";\nimport type UploadAttributeModel from \"./attributes/UploadAttributeModel\";\nimport type XMLAttributeModel from \"./attributes/XMLAttributeModel\";\nimport type CaseViewModel from \"./caseview/CaseViewModel\";\nimport type BusinessScenarioModel from \"./concepts/BusinessScenarioModel\";\nimport type ConceptDetailModel from \"./concepts/ConceptDetailModel\";\nimport type ConceptIndexModel from \"./concepts/ConceptIndexModel\";\nimport type ConceptTypeDetailModel from \"./concepts/ConceptTypeDetailModel\";\nimport type ContentIndexModel from \"./content/ContentIndexModel\";\nimport type ContentModel from \"./content/ContentModel\";\nimport type SectionModel from \"./content/SectionModel\";\nimport type ContentTOCModel from \"./content/ContentTOCModel\";\nimport type ContentTypeModel from \"./content/ContentTypeModel\";\nimport type DetailModel from \"./detail/DetailModel\";\nimport type AssignmentFilterModel from \"./filters/AssignmentFilterModel\";\nimport type FilterModel from \"./filters/FilterModel\";\nimport type RangeFilterModel from \"./filters/RangeFilterModel\";\nimport type ConceptIndexFilterModel from \"./filters/ConceptIndexFilterModel\";\nimport type FormModel from \"./form/FormModel\";\nimport type ListDetailModel from \"./list/ListDetailModel\";\nimport type ListModel from \"./list/ListModel\";\nimport type ModelCatalogModel from \"./modelcatalog/ModelCatalogModel\";\nimport type GroupingPanelModel from \"./panels/GroupingPanelModel\";\nimport type CaseSearchModel from \"./search/CaseSearchModel\";\nimport type TabModel from \"./tab/TabModel\";\nimport type TaskGroupModel from \"./taskgroup/TaskGroupModel\";\nimport type UserModel from \"./user/UserModel\";\nimport type UserServicesModel from \"./user/UserServicesModel\";\nimport type LinkModel from \"./links/LinkModel\";\nimport type LookupOptionsModel from \"./lookup/LookupOptionsModel\";\nimport type BaseFilterModel from \"./filters/BaseFilterModel\";\nimport type AttributeCollection from \"./attributes/AttributeCollection\";\nimport type AttributeModel from \"./attributes/AttributeModel\";\nimport type LayoutHintCollection from \"./layouthint/LayoutHintCollection\";\n\nexport type ModularUIModel =\n | ApplicationModel\n | CaseSearchModel\n | CaseViewModel\n | ListDetailModel\n | DetailModel\n | FormModel\n | GroupingPanelModel\n | ListModel\n | TabModel\n | TaskGroupModel\n | UserModel\n | UserServicesModel\n | ModelCatalogModel\n | ConceptIndexModel\n | ConceptDetailModel\n | BusinessScenarioModel\n | ConceptTypeDetailModel\n | ContentIndexModel\n | ContentTOCModel\n | ContentModel\n | ContentTypeModel\n | LookupOptionsModel;\n\nexport type AttributeType =\n | BooleanAttributeModel\n | CaptchaAttributeModel\n | ChoiceAttributeModel\n | DatetimeAttributeModel\n | HelptextAttributeModel\n | LabelAttributeModel\n | MemoAttributeModel\n | MoneyAttributeModel\n | NumberAttributeModel\n | PasswordAttributeModel\n | CompositeAttributeModel\n | StringAttributeModel\n | UploadAttributeModel\n | XMLAttributeModel;\n\nexport type RangeChildAttributeType =\n | NumberAttributeModel\n | DatetimeAttributeModel;\n\nexport type FilterType =\n | BaseFilterModel\n | FilterModel\n | AssignmentFilterModel\n | RangeFilterModel\n | ConceptIndexFilterModel;\n\nexport type FormErrorAnchor = {\n id: string,\n properties?: {\n [propertyName: string]: string | number,\n },\n anchor?: {\n objectid: string,\n elementid?: string,\n _links?: Object,\n index?: number,\n \"index-identifier\"?: string,\n },\n message: string,\n param?: {\n name: string,\n },\n};\n\nexport type labelsJSON = {|\n _id: string,\n label: string,\n value: string,\n|};\n\nexport type propertyJSON = {|\n _id: string,\n type: string,\n mandatory: string,\n label: string,\n value: string,\n|};\n\nexport type textfragmentJSON = {|\n label: string,\n text: string,\n type: string,\n|};\n\nexport interface IConstraintModel {\n +id: string;\n +defaultMessage: string;\n +parameters: Object;\n +isMandatoryConstraint: boolean;\n validate(value: any): boolean;\n hasValidation(): boolean;\n}\n\nexport interface ILayoutHintRule {\n process(attribute: AttributeModel, attributes: AttributeCollection): void;\n}\n\nexport interface IModelWithChildModels {\n getInitialChildModelLinks(): Array<LinkModel>;\n setChildModels(models: Array<ModularUIModel>): void;\n}\n\nexport type AuthenticationType = {\n name: string,\n authentication: string,\n redirectUri: string,\n isPrimary: boolean,\n};\n\nexport type FileEntryType = {\n name: string,\n size?: number,\n progress: number,\n error?: string,\n token?: string,\n};\n\nexport type FilesType = {\n [filename: string]: FileEntryType,\n};\n\nexport type FiletypeConstraintsType = Array<{|\n extensions: Array<string>,\n mimeTypes: Array<string>,\n|}>;\n\nexport type FilesizeConstraintsType = {\n fileSize: ?number,\n maxTotalFileSize: ?number,\n isMaxTotal: boolean,\n};\n\nexport type PropertyData = { type: string, label: string, value: string };\nexport type TextFragmentData = {\n type: string,\n label: string,\n text: string | { id?: string, message: string, properties?: Object },\n};\nexport type SectionData = {\n id: string,\n type: string,\n label?: string,\n number?: string,\n body: string | { id?: string, message: string, properties?: Object },\n _links: { self: { href: string } },\n childSections: Array<SectionData>,\n subSections: Array<SectionData>,\n};\n\nexport type PropertyElement = {\n propertyElement: {\n label: string,\n layouthint: Array<string>,\n properties: Array<PropertyData>,\n },\n};\nexport type TextFragmentElement = {\n textFragmentElement: {\n label: string,\n layouthint: Array<string>,\n textfragments: Array<TextFragmentData>,\n },\n};\nexport type ContentElement = {\n contentElement: {\n label: string,\n layouthint: Array<string>,\n sections: Array<SectionData>,\n },\n};\n\nexport type PropertyElementMapped = {\n propertyElement: {\n label: string,\n layouthint: LayoutHintCollection,\n properties: Array<PropertyData>,\n },\n};\nexport type TextFragmentElementMapped = {\n textFragmentElement: {\n label: string,\n layouthint: LayoutHintCollection,\n textfragments: Array<TextFragmentData>,\n },\n};\nexport type ContentElementMapped = {\n contentElement: {\n label: string,\n layouthint: LayoutHintCollection,\n sections: Array<SectionModel>,\n },\n};\n\nexport type ContentAll = Array<\n PropertyElementMapped | TextFragmentElementMapped | ContentElementMapped\n>;\n\nexport type ContentData = {\n header: {\n label?: string,\n description?: { id?: string, message: string, properties?: Object },\n },\n label?: string,\n elements: Array<PropertyElement | TextFragmentElement | ContentElement>,\n};\n"],"mappings":""}
|
|
@@ -24,6 +24,7 @@ var reloadApplication = function reloadApplication() {
|
|
|
24
24
|
modelKey = "application(/)(".concat(locale, ")");
|
|
25
25
|
}
|
|
26
26
|
|
|
27
|
+
dispatch((0, _actions.removeModelByKey)(modelKey));
|
|
27
28
|
return dispatch((0, _actions.loadModularUI)(modelKey, new _models.Href("/", "Application"), {
|
|
28
29
|
targetModel: _models.ApplicationModel
|
|
29
30
|
}));
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// @flow
|
|
2
|
-
import { loadModularUI } from "../_modularui/actions";
|
|
2
|
+
import { loadModularUI, removeModelByKey } from "../_modularui/actions";
|
|
3
3
|
import { keyByHref } from "../_modularui/selectors";
|
|
4
4
|
import { ApplicationModel, Href } from "../../models";
|
|
5
5
|
|
|
@@ -16,6 +16,8 @@ export const reloadApplication =
|
|
|
16
16
|
modelKey = `application(/)(${locale})`;
|
|
17
17
|
}
|
|
18
18
|
|
|
19
|
+
dispatch(removeModelByKey(modelKey));
|
|
20
|
+
|
|
19
21
|
return dispatch(
|
|
20
22
|
loadModularUI(modelKey, new Href("/", "Application"), {
|
|
21
23
|
targetModel: ApplicationModel,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Application.js","names":["reloadApplication","dispatch","getState","modelKey","keyByHref","locale","i18n","loadModularUI","Href","targetModel","ApplicationModel"],"sources":["../../../src/redux/actions/Application.js"],"sourcesContent":["// @flow\nimport { loadModularUI } from \"../_modularui/actions\";\nimport { keyByHref } from \"../_modularui/selectors\";\nimport { ApplicationModel, Href } from \"../../models\";\n\nimport type { Dispatch, GetState, ThunkAction } from \"../types\";\n\n/**\n */\nexport const reloadApplication =\n (): ThunkAction => (dispatch: Dispatch, getState: GetState) => {\n let modelKey = keyByHref(getState(), \"/\");\n\n if (!modelKey) {\n const locale = getState().i18n?.locale;\n modelKey = `application(/)(${locale})`;\n }\n\n return dispatch(\n loadModularUI(modelKey, new Href(\"/\", \"Application\"), {\n targetModel: ApplicationModel,\n })\n );\n };\n"],"mappings":";;;;;;;AACA;;AACA;;AACA;;AAIA;AACA;AACO,IAAMA,iBAAiB,GAC5B,SADWA,iBACX;EAAA,OAAmB,UAACC,QAAD,EAAqBC,QAArB,EAA4C;IAC7D,IAAIC,QAAQ,GAAG,IAAAC,oBAAA,EAAUF,QAAQ,EAAlB,EAAsB,GAAtB,CAAf;;IAEA,IAAI,CAACC,QAAL,EAAe;MAAA;;MACb,IAAME,MAAM,qBAAGH,QAAQ,GAAGI,IAAd,mDAAG,eAAiBD,MAAhC;MACAF,QAAQ,4BAAqBE,MAArB,MAAR;IACD;;
|
|
1
|
+
{"version":3,"file":"Application.js","names":["reloadApplication","dispatch","getState","modelKey","keyByHref","locale","i18n","removeModelByKey","loadModularUI","Href","targetModel","ApplicationModel"],"sources":["../../../src/redux/actions/Application.js"],"sourcesContent":["// @flow\nimport { loadModularUI, removeModelByKey } from \"../_modularui/actions\";\nimport { keyByHref } from \"../_modularui/selectors\";\nimport { ApplicationModel, Href } from \"../../models\";\n\nimport type { Dispatch, GetState, ThunkAction } from \"../types\";\n\n/**\n */\nexport const reloadApplication =\n (): ThunkAction => (dispatch: Dispatch, getState: GetState) => {\n let modelKey = keyByHref(getState(), \"/\");\n\n if (!modelKey) {\n const locale = getState().i18n?.locale;\n modelKey = `application(/)(${locale})`;\n }\n\n dispatch(removeModelByKey(modelKey));\n\n return dispatch(\n loadModularUI(modelKey, new Href(\"/\", \"Application\"), {\n targetModel: ApplicationModel,\n })\n );\n };\n"],"mappings":";;;;;;;AACA;;AACA;;AACA;;AAIA;AACA;AACO,IAAMA,iBAAiB,GAC5B,SADWA,iBACX;EAAA,OAAmB,UAACC,QAAD,EAAqBC,QAArB,EAA4C;IAC7D,IAAIC,QAAQ,GAAG,IAAAC,oBAAA,EAAUF,QAAQ,EAAlB,EAAsB,GAAtB,CAAf;;IAEA,IAAI,CAACC,QAAL,EAAe;MAAA;;MACb,IAAME,MAAM,qBAAGH,QAAQ,GAAGI,IAAd,mDAAG,eAAiBD,MAAhC;MACAF,QAAQ,4BAAqBE,MAArB,MAAR;IACD;;IAEDJ,QAAQ,CAAC,IAAAM,yBAAA,EAAiBJ,QAAjB,CAAD,CAAR;IAEA,OAAOF,QAAQ,CACb,IAAAO,sBAAA,EAAcL,QAAd,EAAwB,IAAIM,YAAJ,CAAS,GAAT,EAAc,aAAd,CAAxB,EAAsD;MACpDC,WAAW,EAAEC;IADuC,CAAtD,CADa,CAAf;EAKD,CAfD;AAAA,CADK"}
|
|
@@ -21,6 +21,8 @@ var _Cache = _interopRequireDefault(require("../../utils/browser/Cache"));
|
|
|
21
21
|
|
|
22
22
|
var _actions2 = require("../_modularui/actions");
|
|
23
23
|
|
|
24
|
+
var _selectors = require("../_modularui/selectors");
|
|
25
|
+
|
|
24
26
|
var _Application = require("./Application");
|
|
25
27
|
|
|
26
28
|
var _constants = require("../../constants");
|
|
@@ -38,10 +40,12 @@ var handleUnauthorized = function handleUnauthorized(errorResponse) {
|
|
|
38
40
|
if ((0, _constants.getSetting)("PAGE_RELOAD_ON_UNAUTHORIZED_ERROR", false) && (_errorResponse$respon = errorResponse.response) !== null && _errorResponse$respon !== void 0 && _errorResponse$respon.error) {
|
|
39
41
|
window.location.reload();
|
|
40
42
|
return;
|
|
41
|
-
} // reload application when flag auth is set
|
|
43
|
+
} // reload application when flag auth is set or isLogged
|
|
44
|
+
|
|
42
45
|
|
|
46
|
+
var application = (0, _selectors.getApplication)(getState());
|
|
43
47
|
|
|
44
|
-
if (_Cache.default.getItem("auth")) {
|
|
48
|
+
if (_Cache.default.getItem("auth") || application !== null && application !== void 0 && application.isLoggedIn) {
|
|
45
49
|
dispatch((0, _Application.reloadApplication)());
|
|
46
50
|
} // set logged auth
|
|
47
51
|
|
|
@@ -10,6 +10,7 @@ import { showNotification } from "./Notification";
|
|
|
10
10
|
import Cache from "../../utils/browser/Cache";
|
|
11
11
|
|
|
12
12
|
import { removeModelByKey } from "../_modularui/actions";
|
|
13
|
+
import { getApplication } from "../_modularui/selectors";
|
|
13
14
|
import { reloadApplication } from "./Application";
|
|
14
15
|
|
|
15
16
|
import { getSetting } from "../../constants";
|
|
@@ -33,8 +34,9 @@ export const handleUnauthorized =
|
|
|
33
34
|
return;
|
|
34
35
|
}
|
|
35
36
|
|
|
36
|
-
// reload application when flag auth is set
|
|
37
|
-
|
|
37
|
+
// reload application when flag auth is set or isLogged
|
|
38
|
+
const application = getApplication(getState());
|
|
39
|
+
if (Cache.getItem("auth") || application?.isLoggedIn) {
|
|
38
40
|
dispatch(reloadApplication());
|
|
39
41
|
}
|
|
40
42
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Authorization.js","names":["handleUnauthorized","errorResponse","dispatch","getState","connectKey","removeModelByKey","getSetting","response","error","window","location","reload","Cache","getItem","reloadApplication","logoutSuccess","removeItem","isInvalidUsername","WARNING_TIMEOUT","showNotification","NOTIFICATION_TYPES","WARNING","id","defaultMessage","message","router","pathname","LOGIN_PATH","locationFrom","state","from","replace","modal","type"],"sources":["../../../src/redux/actions/Authorization.js"],"sourcesContent":["// @flow\nimport { LOGIN_PATH, NOTIFICATION_TYPES } from \"../../constants/Constants\";\n\nimport ErrorResponse from \"../../models/error/ErrorResponse\";\n\nimport { replace } from \"../_router/actions\";\nimport { logoutSuccess } from \"./SignOut\";\nimport { showNotification } from \"./Notification\";\n\nimport Cache from \"../../utils/browser/Cache\";\n\nimport { removeModelByKey } from \"../_modularui/actions\";\nimport { reloadApplication } from \"./Application\";\n\nimport { getSetting } from \"../../constants\";\n\nimport type { ThunkAction } from \"../types\";\n\n/**\n */\nexport const handleUnauthorized =\n (errorResponse: ErrorResponse): ThunkAction =>\n (dispatch, getState) => {\n if (errorResponse.connectKey) {\n dispatch(removeModelByKey(errorResponse.connectKey));\n }\n\n if (\n getSetting(\"PAGE_RELOAD_ON_UNAUTHORIZED_ERROR\", false) &&\n errorResponse.response?.error\n ) {\n window.location.reload();\n return;\n }\n\n // reload application when flag auth is set\n if (Cache.getItem(\"auth\")) {\n dispatch(reloadApplication());\n }\n\n // set logged auth\n dispatch(logoutSuccess());\n\n Cache.removeItem(\"auth\");\n\n if (errorResponse.isInvalidUsername) {\n const WARNING_TIMEOUT = 4000;\n dispatch(\n showNotification(\n NOTIFICATION_TYPES.WARNING,\n {\n id: errorResponse.id,\n defaultMessage: errorResponse.message,\n },\n null,\n WARNING_TIMEOUT\n )\n );\n }\n\n // add current location as from location before redirect\n const location = getState().router.location;\n if (location?.pathname !== LOGIN_PATH) {\n const locationFrom = location?.state?.from;\n return dispatch(\n replace(LOGIN_PATH, {\n from: locationFrom ? locationFrom : getState().router.location,\n // cannot open login in a modal, because of previous locations that might be secure\n modal: false,\n })\n );\n }\n\n return { type: \"NO_ACTION\" };\n };\n"],"mappings":";;;;;;;;;AACA;;AAEA;;AAEA;;AACA;;AACA;;AAEA;;AAEA;;AACA;;AAEA;;AAIA;AACA;AACO,IAAMA,kBAAkB,GAC7B,SADWA,kBACX,CAACC,aAAD;EAAA,OACA,UAACC,QAAD,EAAWC,QAAX,EAAwB;IAAA;;IACtB,IAAIF,aAAa,CAACG,UAAlB,EAA8B;MAC5BF,QAAQ,CAAC,IAAAG,0BAAA,EAAiBJ,aAAa,CAACG,UAA/B,CAAD,CAAR;IACD;;IAED,IACE,IAAAE,qBAAA,EAAW,mCAAX,EAAgD,KAAhD,8BACAL,aAAa,CAACM,QADd,kDACA,sBAAwBC,KAF1B,EAGE;MACAC,MAAM,CAACC,QAAP,CAAgBC,MAAhB;MACA;IACD,CAXqB,CAatB;;;IACA,
|
|
1
|
+
{"version":3,"file":"Authorization.js","names":["handleUnauthorized","errorResponse","dispatch","getState","connectKey","removeModelByKey","getSetting","response","error","window","location","reload","application","getApplication","Cache","getItem","isLoggedIn","reloadApplication","logoutSuccess","removeItem","isInvalidUsername","WARNING_TIMEOUT","showNotification","NOTIFICATION_TYPES","WARNING","id","defaultMessage","message","router","pathname","LOGIN_PATH","locationFrom","state","from","replace","modal","type"],"sources":["../../../src/redux/actions/Authorization.js"],"sourcesContent":["// @flow\nimport { LOGIN_PATH, NOTIFICATION_TYPES } from \"../../constants/Constants\";\n\nimport ErrorResponse from \"../../models/error/ErrorResponse\";\n\nimport { replace } from \"../_router/actions\";\nimport { logoutSuccess } from \"./SignOut\";\nimport { showNotification } from \"./Notification\";\n\nimport Cache from \"../../utils/browser/Cache\";\n\nimport { removeModelByKey } from \"../_modularui/actions\";\nimport { getApplication } from \"../_modularui/selectors\";\nimport { reloadApplication } from \"./Application\";\n\nimport { getSetting } from \"../../constants\";\n\nimport type { ThunkAction } from \"../types\";\n\n/**\n */\nexport const handleUnauthorized =\n (errorResponse: ErrorResponse): ThunkAction =>\n (dispatch, getState) => {\n if (errorResponse.connectKey) {\n dispatch(removeModelByKey(errorResponse.connectKey));\n }\n\n if (\n getSetting(\"PAGE_RELOAD_ON_UNAUTHORIZED_ERROR\", false) &&\n errorResponse.response?.error\n ) {\n window.location.reload();\n return;\n }\n\n // reload application when flag auth is set or isLogged\n const application = getApplication(getState());\n if (Cache.getItem(\"auth\") || application?.isLoggedIn) {\n dispatch(reloadApplication());\n }\n\n // set logged auth\n dispatch(logoutSuccess());\n\n Cache.removeItem(\"auth\");\n\n if (errorResponse.isInvalidUsername) {\n const WARNING_TIMEOUT = 4000;\n dispatch(\n showNotification(\n NOTIFICATION_TYPES.WARNING,\n {\n id: errorResponse.id,\n defaultMessage: errorResponse.message,\n },\n null,\n WARNING_TIMEOUT\n )\n );\n }\n\n // add current location as from location before redirect\n const location = getState().router.location;\n if (location?.pathname !== LOGIN_PATH) {\n const locationFrom = location?.state?.from;\n return dispatch(\n replace(LOGIN_PATH, {\n from: locationFrom ? locationFrom : getState().router.location,\n // cannot open login in a modal, because of previous locations that might be secure\n modal: false,\n })\n );\n }\n\n return { type: \"NO_ACTION\" };\n };\n"],"mappings":";;;;;;;;;AACA;;AAEA;;AAEA;;AACA;;AACA;;AAEA;;AAEA;;AACA;;AACA;;AAEA;;AAIA;AACA;AACO,IAAMA,kBAAkB,GAC7B,SADWA,kBACX,CAACC,aAAD;EAAA,OACA,UAACC,QAAD,EAAWC,QAAX,EAAwB;IAAA;;IACtB,IAAIF,aAAa,CAACG,UAAlB,EAA8B;MAC5BF,QAAQ,CAAC,IAAAG,0BAAA,EAAiBJ,aAAa,CAACG,UAA/B,CAAD,CAAR;IACD;;IAED,IACE,IAAAE,qBAAA,EAAW,mCAAX,EAAgD,KAAhD,8BACAL,aAAa,CAACM,QADd,kDACA,sBAAwBC,KAF1B,EAGE;MACAC,MAAM,CAACC,QAAP,CAAgBC,MAAhB;MACA;IACD,CAXqB,CAatB;;;IACA,IAAMC,WAAW,GAAG,IAAAC,yBAAA,EAAeV,QAAQ,EAAvB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
|
4
4
|
import { resetModularUI } from "../_modularui/actions";
|
|
5
|
+
import { reloadApplication } from "./Application";
|
|
5
6
|
|
|
6
7
|
import type { Dispatch, LogoutSuccessAction, ThunkAction } from "../types";
|
|
7
|
-
import { reloadApplication } from "./Application";
|
|
8
8
|
|
|
9
9
|
/**
|
|
10
10
|
* Send logout success action
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SignOut.js","names":["logoutSuccess","type","logout","dispatch","startProgress","Authenticate","then","resetModularUI","reloadApplication","finishProgress"],"sources":["../../../src/redux/actions/SignOut.js"],"sourcesContent":["// @flow\nimport Authenticate from \"../../modularui/Authenticate\";\nimport { startProgress, finishProgress } from \"./ProgressIndicator\";\nimport { resetModularUI } from \"../_modularui/actions\";\
|
|
1
|
+
{"version":3,"file":"SignOut.js","names":["logoutSuccess","type","logout","dispatch","startProgress","Authenticate","then","resetModularUI","reloadApplication","finishProgress"],"sources":["../../../src/redux/actions/SignOut.js"],"sourcesContent":["// @flow\nimport Authenticate from \"../../modularui/Authenticate\";\nimport { startProgress, finishProgress } from \"./ProgressIndicator\";\nimport { resetModularUI } from \"../_modularui/actions\";\nimport { reloadApplication } from \"./Application\";\n\nimport type { Dispatch, LogoutSuccessAction, ThunkAction } from \"../types\";\n\n/**\n * Send logout success action\n */\nexport const logoutSuccess = (): LogoutSuccessAction => ({\n type: \"AUTHENTICATION_LOGOUT\",\n});\n\n/**\n */\nexport const logout = (): ThunkAction => (dispatch: Dispatch) => {\n dispatch(startProgress());\n\n return new Authenticate()\n .logout()\n .then(() => dispatch(resetModularUI()))\n .then(() => dispatch(reloadApplication()))\n .then(() => {\n dispatch(logoutSuccess());\n return dispatch(finishProgress());\n });\n};\n"],"mappings":";;;;;;;;;AACA;;AACA;;AACA;;AACA;;AAIA;AACA;AACA;AACO,IAAMA,aAAa,GAAG,SAAhBA,aAAgB;EAAA,OAA4B;IACvDC,IAAI,EAAE;EADiD,CAA5B;AAAA,CAAtB;AAIP;AACA;;;;;AACO,IAAMC,MAAM,GAAG,SAATA,MAAS;EAAA,OAAmB,UAACC,QAAD,EAAwB;IAC/DA,QAAQ,CAAC,IAAAC,gCAAA,GAAD,CAAR;IAEA,OAAO,IAAIC,qBAAJ,GACJH,MADI,GAEJI,IAFI,CAEC;MAAA,OAAMH,QAAQ,CAAC,IAAAI,uBAAA,GAAD,CAAd;IAAA,CAFD,EAGJD,IAHI,CAGC;MAAA,OAAMH,QAAQ,CAAC,IAAAK,8BAAA,GAAD,CAAd;IAAA,CAHD,EAIJF,IAJI,CAIC,YAAM;MACVH,QAAQ,CAACH,aAAa,EAAd,CAAR;MACA,OAAOG,QAAQ,CAAC,IAAAM,iCAAA,GAAD,CAAf;IACD,CAPI,CAAP;EAQD,CAXqB;AAAA,CAAf"}
|
|
@@ -16,6 +16,10 @@ describe("application actions", () => {
|
|
|
16
16
|
await store.dispatch(reloadApplication());
|
|
17
17
|
|
|
18
18
|
expect(store.getActions()).toStrictEqual([
|
|
19
|
+
{
|
|
20
|
+
type: "MODULARUI/REMOVE_KEY",
|
|
21
|
+
payload: "application(/)(en)",
|
|
22
|
+
},
|
|
19
23
|
{
|
|
20
24
|
type: "MODULARUI/STATUS",
|
|
21
25
|
payload: { key: "application(/)(en)", status: "LOADING" },
|
|
@@ -39,6 +43,10 @@ describe("application actions", () => {
|
|
|
39
43
|
store.dispatch(reloadApplication());
|
|
40
44
|
|
|
41
45
|
expect(store.getActions()).toStrictEqual([
|
|
46
|
+
{
|
|
47
|
+
type: "MODULARUI/REMOVE_KEY",
|
|
48
|
+
payload: "/",
|
|
49
|
+
},
|
|
42
50
|
{
|
|
43
51
|
type: "MODULARUI/STATUS",
|
|
44
52
|
payload: { key: "/", status: "LOADING" },
|
|
@@ -35,6 +35,10 @@ describe("authorization actions", () => {
|
|
|
35
35
|
store.dispatch(handleUnauthorized(errorResponse));
|
|
36
36
|
|
|
37
37
|
expect(store.getActions()).toStrictEqual([
|
|
38
|
+
{
|
|
39
|
+
type: "MODULARUI/REMOVE_KEY",
|
|
40
|
+
payload: "/",
|
|
41
|
+
},
|
|
38
42
|
{
|
|
39
43
|
type: "MODULARUI/REMOVE_KEY",
|
|
40
44
|
payload: "/",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@beinformed/ui",
|
|
3
|
-
"version": "1.19.
|
|
3
|
+
"version": "1.19.4",
|
|
4
4
|
"description": "Toolbox for be informed javascript layouts",
|
|
5
5
|
"license": "SEE LICENSE IN LICENSE.md",
|
|
6
6
|
"bugs": "http://support.beinformed.com",
|
|
@@ -51,19 +51,7 @@
|
|
|
51
51
|
"dist",
|
|
52
52
|
"esm",
|
|
53
53
|
"lib",
|
|
54
|
-
"codemods"
|
|
55
|
-
"builder",
|
|
56
|
-
"exceptions",
|
|
57
|
-
"hooks",
|
|
58
|
-
"i18n",
|
|
59
|
-
"models",
|
|
60
|
-
"modularui",
|
|
61
|
-
"react",
|
|
62
|
-
"react-client",
|
|
63
|
-
"react-server",
|
|
64
|
-
"react-theme",
|
|
65
|
-
"redux",
|
|
66
|
-
"utils"
|
|
54
|
+
"codemods"
|
|
67
55
|
],
|
|
68
56
|
"peerDependencies": {
|
|
69
57
|
"history": "^4.0.0",
|
|
@@ -72,10 +60,10 @@
|
|
|
72
60
|
"react-dom": "^16.14.0 || ^17.0.0 || ^18.0.0",
|
|
73
61
|
"react-helmet-async": "^1.0.0",
|
|
74
62
|
"react-redux": "^7.0.0 || ^8.0.0",
|
|
75
|
-
"react-router": "^5.
|
|
63
|
+
"react-router": "^5.0.0",
|
|
76
64
|
"redux": "^4.0.0",
|
|
77
|
-
"redux-thunk": "^2.
|
|
78
|
-
"styled-components": "^5.
|
|
65
|
+
"redux-thunk": "^2.0.0",
|
|
66
|
+
"styled-components": "^5.0.0"
|
|
79
67
|
},
|
|
80
68
|
"dependencies": {
|
|
81
69
|
"@babel/runtime-corejs3": "^7.18.3",
|
|
@@ -135,20 +123,20 @@
|
|
|
135
123
|
"jest-sonar-reporter": "^2.0.0",
|
|
136
124
|
"jscodeshift": "^0.13.1",
|
|
137
125
|
"lint-staged": "^13.0.1",
|
|
138
|
-
"polished": "^4.
|
|
139
|
-
"prettier": "^2.7.
|
|
140
|
-
"react": "^18.
|
|
141
|
-
"react-dom": "^18.
|
|
142
|
-
"react-helmet-async": "^1.
|
|
143
|
-
"react-redux": "^8.0.
|
|
144
|
-
"react-router": "^5.
|
|
126
|
+
"polished": "^4.0.0",
|
|
127
|
+
"prettier": "^2.7.1",
|
|
128
|
+
"react": "^18.0.0",
|
|
129
|
+
"react-dom": "^18.0.0",
|
|
130
|
+
"react-helmet-async": "^1.0.0",
|
|
131
|
+
"react-redux": "^8.0.0",
|
|
132
|
+
"react-router": "^5.0.0",
|
|
145
133
|
"react-test-renderer": "^18.1.0",
|
|
146
|
-
"redux": "^4.
|
|
134
|
+
"redux": "^4.0.0",
|
|
147
135
|
"redux-mock-store": "^1.5.4",
|
|
148
|
-
"redux-thunk": "^2.
|
|
136
|
+
"redux-thunk": "^2.0.0",
|
|
149
137
|
"rimraf": "^3.0.2",
|
|
150
138
|
"standard-version": "^9.5.0",
|
|
151
|
-
"styled-components": "^5.
|
|
139
|
+
"styled-components": "^5.0.0",
|
|
152
140
|
"xhr-mock": "^2.5.1"
|
|
153
141
|
},
|
|
154
142
|
"scarfSettings": {
|
|
@@ -42,6 +42,15 @@ const defaultSettings = {
|
|
|
42
42
|
// Indicates which locales are enabled
|
|
43
43
|
ENABLED_LOCALES: ["en", "nl"],
|
|
44
44
|
|
|
45
|
+
// Renders the global log in page
|
|
46
|
+
RENDER_GLOBAL_LOGIN_PAGE: false,
|
|
47
|
+
|
|
48
|
+
// Renders the global log out page
|
|
49
|
+
RENDER_GLOBAL_LOGOUT_PAGE: false,
|
|
50
|
+
|
|
51
|
+
// Renders the login variants as option on the global logout page
|
|
52
|
+
RENDER_MULTI_LOGIN_ON_GLOBAL_LOGOUT_PAGE: false,
|
|
53
|
+
|
|
45
54
|
// Render forms in a modal
|
|
46
55
|
RENDER_FORMS_IN_MODAL: true,
|
|
47
56
|
|
|
@@ -61,6 +61,10 @@ describe("authentication hooks", () => {
|
|
|
61
61
|
|
|
62
62
|
expect(store.getActions()).toStrictEqual([
|
|
63
63
|
{ type: "START_PROGRESS" },
|
|
64
|
+
{
|
|
65
|
+
type: "MODULARUI/REMOVE_KEY",
|
|
66
|
+
payload: "application(/)(en)",
|
|
67
|
+
},
|
|
64
68
|
{
|
|
65
69
|
type: "MODULARUI/STATUS",
|
|
66
70
|
payload: { key: "application(/)(en)", status: "LOADING" },
|
|
@@ -108,6 +112,10 @@ describe("authentication hooks", () => {
|
|
|
108
112
|
expect(store.getActions()).toStrictEqual([
|
|
109
113
|
{ type: "START_PROGRESS" },
|
|
110
114
|
{ type: "MODULARUI/RESET" },
|
|
115
|
+
{
|
|
116
|
+
type: "MODULARUI/REMOVE_KEY",
|
|
117
|
+
payload: "application(/)(en)",
|
|
118
|
+
},
|
|
111
119
|
{
|
|
112
120
|
type: "MODULARUI/STATUS",
|
|
113
121
|
payload: { key: "application(/)(en)", status: "LOADING" },
|
|
@@ -5,7 +5,7 @@ import UserServicesModel from "../user/UserServicesModel";
|
|
|
5
5
|
|
|
6
6
|
import { NotAllowedUriException } from "../../exceptions";
|
|
7
7
|
|
|
8
|
-
import type { ModularUIModel } from "../types";
|
|
8
|
+
import type { ModularUIModel, AuthenticationType } from "../types";
|
|
9
9
|
import type { ModularUIResponse } from "../../modularui";
|
|
10
10
|
import type LinkCollection from "../links/LinkCollection";
|
|
11
11
|
import type Href from "../href/Href";
|
|
@@ -64,6 +64,12 @@ export default class ApplicationModel extends ResourceModel {
|
|
|
64
64
|
return this.getContribution("label", "");
|
|
65
65
|
}
|
|
66
66
|
|
|
67
|
+
/**
|
|
68
|
+
* Getting the authentication types of the application
|
|
69
|
+
*/
|
|
70
|
+
get authenticationTypes(): Array<AuthenticationType> {
|
|
71
|
+
return this.getContribution("security", []);
|
|
72
|
+
}
|
|
67
73
|
/**
|
|
68
74
|
* Getting the tab links
|
|
69
75
|
*/
|
|
@@ -150,7 +150,10 @@ export default class PasswordAttributeModel extends StringAttributeModel {
|
|
|
150
150
|
});
|
|
151
151
|
}
|
|
152
152
|
|
|
153
|
-
if (
|
|
153
|
+
if (
|
|
154
|
+
this.layouthint.has(CONFIRM_PASSWORD) &&
|
|
155
|
+
this.isConfirmPassword == null
|
|
156
|
+
) {
|
|
154
157
|
constraints.add(
|
|
155
158
|
new PasswordConfirmConstraint(this.confirmValue, this.otherLabel)
|
|
156
159
|
);
|
|
@@ -164,9 +167,8 @@ export default class PasswordAttributeModel extends StringAttributeModel {
|
|
|
164
167
|
*/
|
|
165
168
|
get constraintCollection(): ConstraintCollection {
|
|
166
169
|
if (this.isConfirmPassword) {
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
return constraints;
|
|
170
|
+
// confirm password only needs local constraints, no server constraints
|
|
171
|
+
return this.getConfirmPasswordConstraints();
|
|
170
172
|
}
|
|
171
173
|
|
|
172
174
|
return super.constraintCollection;
|
|
@@ -174,8 +176,8 @@ export default class PasswordAttributeModel extends StringAttributeModel {
|
|
|
174
176
|
|
|
175
177
|
/**
|
|
176
178
|
*/
|
|
177
|
-
get isConfirmPassword(): boolean {
|
|
178
|
-
return this._isConfirmPassword
|
|
179
|
+
get isConfirmPassword(): boolean | null {
|
|
180
|
+
return this._isConfirmPassword;
|
|
179
181
|
}
|
|
180
182
|
|
|
181
183
|
/**
|
package/src/models/types.js
CHANGED
|
@@ -153,6 +153,13 @@ export interface IModelWithChildModels {
|
|
|
153
153
|
setChildModels(models: Array<ModularUIModel>): void;
|
|
154
154
|
}
|
|
155
155
|
|
|
156
|
+
export type AuthenticationType = {
|
|
157
|
+
name: string,
|
|
158
|
+
authentication: string,
|
|
159
|
+
redirectUri: string,
|
|
160
|
+
isPrimary: boolean,
|
|
161
|
+
};
|
|
162
|
+
|
|
156
163
|
export type FileEntryType = {
|
|
157
164
|
name: string,
|
|
158
165
|
size?: number,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// @flow
|
|
2
|
-
import { loadModularUI } from "../_modularui/actions";
|
|
2
|
+
import { loadModularUI, removeModelByKey } from "../_modularui/actions";
|
|
3
3
|
import { keyByHref } from "../_modularui/selectors";
|
|
4
4
|
import { ApplicationModel, Href } from "../../models";
|
|
5
5
|
|
|
@@ -16,6 +16,8 @@ export const reloadApplication =
|
|
|
16
16
|
modelKey = `application(/)(${locale})`;
|
|
17
17
|
}
|
|
18
18
|
|
|
19
|
+
dispatch(removeModelByKey(modelKey));
|
|
20
|
+
|
|
19
21
|
return dispatch(
|
|
20
22
|
loadModularUI(modelKey, new Href("/", "Application"), {
|
|
21
23
|
targetModel: ApplicationModel,
|
|
@@ -10,6 +10,7 @@ import { showNotification } from "./Notification";
|
|
|
10
10
|
import Cache from "../../utils/browser/Cache";
|
|
11
11
|
|
|
12
12
|
import { removeModelByKey } from "../_modularui/actions";
|
|
13
|
+
import { getApplication } from "../_modularui/selectors";
|
|
13
14
|
import { reloadApplication } from "./Application";
|
|
14
15
|
|
|
15
16
|
import { getSetting } from "../../constants";
|
|
@@ -33,8 +34,9 @@ export const handleUnauthorized =
|
|
|
33
34
|
return;
|
|
34
35
|
}
|
|
35
36
|
|
|
36
|
-
// reload application when flag auth is set
|
|
37
|
-
|
|
37
|
+
// reload application when flag auth is set or isLogged
|
|
38
|
+
const application = getApplication(getState());
|
|
39
|
+
if (Cache.getItem("auth") || application?.isLoggedIn) {
|
|
38
40
|
dispatch(reloadApplication());
|
|
39
41
|
}
|
|
40
42
|
|
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
import Authenticate from "../../modularui/Authenticate";
|
|
3
3
|
import { startProgress, finishProgress } from "./ProgressIndicator";
|
|
4
4
|
import { resetModularUI } from "../_modularui/actions";
|
|
5
|
+
import { reloadApplication } from "./Application";
|
|
5
6
|
|
|
6
7
|
import type { Dispatch, LogoutSuccessAction, ThunkAction } from "../types";
|
|
7
|
-
import { reloadApplication } from "./Application";
|
|
8
8
|
|
|
9
9
|
/**
|
|
10
10
|
* Send logout success action
|
|
@@ -16,6 +16,10 @@ describe("application actions", () => {
|
|
|
16
16
|
await store.dispatch(reloadApplication());
|
|
17
17
|
|
|
18
18
|
expect(store.getActions()).toStrictEqual([
|
|
19
|
+
{
|
|
20
|
+
type: "MODULARUI/REMOVE_KEY",
|
|
21
|
+
payload: "application(/)(en)",
|
|
22
|
+
},
|
|
19
23
|
{
|
|
20
24
|
type: "MODULARUI/STATUS",
|
|
21
25
|
payload: { key: "application(/)(en)", status: "LOADING" },
|
|
@@ -39,6 +43,10 @@ describe("application actions", () => {
|
|
|
39
43
|
store.dispatch(reloadApplication());
|
|
40
44
|
|
|
41
45
|
expect(store.getActions()).toStrictEqual([
|
|
46
|
+
{
|
|
47
|
+
type: "MODULARUI/REMOVE_KEY",
|
|
48
|
+
payload: "/",
|
|
49
|
+
},
|
|
42
50
|
{
|
|
43
51
|
type: "MODULARUI/STATUS",
|
|
44
52
|
payload: { key: "/", status: "LOADING" },
|
|
@@ -35,6 +35,10 @@ describe("authorization actions", () => {
|
|
|
35
35
|
store.dispatch(handleUnauthorized(errorResponse));
|
|
36
36
|
|
|
37
37
|
expect(store.getActions()).toStrictEqual([
|
|
38
|
+
{
|
|
39
|
+
type: "MODULARUI/REMOVE_KEY",
|
|
40
|
+
payload: "/",
|
|
41
|
+
},
|
|
38
42
|
{
|
|
39
43
|
type: "MODULARUI/REMOVE_KEY",
|
|
40
44
|
payload: "/",
|
package/builder/package.json
DELETED
package/exceptions/package.json
DELETED
package/hooks/package.json
DELETED
package/i18n/package.json
DELETED
package/models/package.json
DELETED
package/modularui/package.json
DELETED