@beinformed/ui 1.21.5 → 1.22.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +11 -0
- package/esm/models/attributes/AttributeModel.js +1 -1
- package/esm/models/attributes/AttributeModel.js.map +1 -1
- package/esm/models/error/ErrorResponse.js +8 -1
- package/esm/models/error/ErrorResponse.js.map +1 -1
- package/esm/models/form/FormModel.js +1 -1
- package/esm/models/form/FormModel.js.map +1 -1
- package/esm/models/form/FormObjectModel.js +1 -1
- package/esm/models/form/FormObjectModel.js.map +1 -1
- package/lib/models/attributes/AttributeModel.js +1 -1
- package/lib/models/attributes/AttributeModel.js.flow +2 -1
- package/lib/models/attributes/AttributeModel.js.map +1 -1
- package/lib/models/error/ErrorResponse.js +8 -1
- package/lib/models/error/ErrorResponse.js.flow +7 -1
- package/lib/models/error/ErrorResponse.js.map +1 -1
- package/lib/models/form/FormModel.js +1 -1
- package/lib/models/form/FormModel.js.flow +2 -1
- package/lib/models/form/FormModel.js.map +1 -1
- package/lib/models/form/FormObjectModel.js +1 -1
- package/lib/models/form/FormObjectModel.js.flow +2 -1
- package/lib/models/form/FormObjectModel.js.map +1 -1
- package/package.json +1 -1
- package/src/models/attributes/AttributeModel.js +2 -1
- package/src/models/error/ErrorResponse.js +7 -1
- package/src/models/form/FormModel.js +2 -1
- package/src/models/form/FormObjectModel.js +2 -1
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,17 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
|
|
4
4
|
|
|
5
|
+
## [1.22.0](https://git.beinformed.com/public/nl.beinformed.bi.layout.lib.ui/compare/v1.21.7...v1.22.0) (2022-09-05)
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
### Features
|
|
9
|
+
|
|
10
|
+
* **error:** added get isInvalidCredentials in to ErrorResponse ([b6e2ef6](https://git.beinformed.com/public/nl.beinformed.bi.layout.lib.ui/commit/b6e2ef6e2838f7fe65bbedefedf8c6a1ea927fc2))
|
|
11
|
+
|
|
12
|
+
### [1.21.7](https://git.beinformed.com/public/nl.beinformed.bi.layout.lib.ui/compare/v1.21.6...v1.21.7) (2022-09-01)
|
|
13
|
+
|
|
14
|
+
### [1.21.6](https://git.beinformed.com/public/nl.beinformed.bi.layout.lib.ui/compare/v1.21.5...v1.21.6) (2022-08-29)
|
|
15
|
+
|
|
5
16
|
### [1.21.5](https://git.beinformed.com/public/nl.beinformed.bi.layout.lib.ui/compare/v1.21.4...v1.21.5) (2022-08-26)
|
|
6
17
|
|
|
7
18
|
### [1.21.4](https://git.beinformed.com/public/nl.beinformed.bi.layout.lib.ui/compare/v1.21.3...v1.21.4) (2022-08-25)
|
|
@@ -85,7 +85,7 @@ export default class AttributeModel extends BaseModel {
|
|
|
85
85
|
this._errorCollection = new ErrorCollection("attribute");
|
|
86
86
|
|
|
87
87
|
if (attribute && attribute.message) {
|
|
88
|
-
this._errorCollection.addServerError(attribute.message.id, attribute.message.message, attribute.message.parameters);
|
|
88
|
+
this._errorCollection.addServerError(attribute.message.id, attribute.message.message, attribute.message.parameters, attribute.message.layouthint);
|
|
89
89
|
}
|
|
90
90
|
|
|
91
91
|
this._referenceDate = this.getData("referenceDate", DateUtil.now());
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AttributeModel.js","names":["DateUtil","isPlainObject","BaseModel","ConstraintCollection","ErrorCollection","LinkCollection","StringLengthConstraint","MandatoryConstraint","ConceptDetailModel","DISABLED","MANDATORY","ATTRIBUTE_WIDTH","TIMEVERSION_FILTER_NAME","getSetting","hasAllContentInData","IllegalArgumentException","UnsupportedOperationException","AttributeContent","AttributeModel","constructor","attribute","attributeContributions","hasContentFromData","content","label","_label","contributions","_initvalue","data","value","_inputvalue","getInitialInputValue","_value","_disabled","layouthint","has","_errorCollection","message","addServerError","id","parameters","_referenceDate","getData","now","_isResult","_mandatory","mandatory","_links","isApplicableModel","getInitialChildModelLinks","hasContentConfiguration","conceptLink","setChildModels","models","conceptHref","href","concept","model","selfhref","equalsWithParameters","key","parentKey","_parentKey","name","type","_hasContentConfiguration","indicateContentConfiguration","contentConfiguration","hasQuestionConfig","questions","hasConfig","hasEndResultConfig","isConfiguredEndResultAttribute","hasIntermediateResultConfig","isConfiguredIntermediateResultAttribute","getContentConfiguredLabel","configuredLabelProperties","labelConfig","length","types","configuredLabels","getLabelElementByIds","configuredLabel","firstConfiguredLabel","configuredLabelProperty","some","_id","defaultAlignment","alignment","alignmentHints","getByLayoutHint","substring","links","downloadLink","getLinksByGroup","first","getLinkByKey","addParameter","referenceDate","isCacheable","_concept","date","initvalue","getInputValue","inputvalue","toString","validateValue","validate","hasValue","getValue","getFormData","inError","formdata","getEmptyFormData","updateLastModification","formatValue","readonlyvalue","configuredMandatory","_validatedValue","readonly","_readonly","static","isResult","disabled","format","getContribution","formatLabel","minLength","maxLength","operator","assistantMessage","isValid","constraintCollection","constraints","add","_serverConstraints","addConstraints","setUseClientsideValidation","enabled","_useClientsideValidation","useClientsideValidation","isOptionalAndEmpty","_isValid","undefined","errorCollection","collection","invalidConstraints","isChangedSince","resetErrors","error","properties","removeServerError","hasServerErrors","serverErrors","hasErrors","hasItems","addMissingError","removeMissingError","addServerConstraint","defaultMessage","addConstraint","formatParameters","params","forEach","paramKey","paramValue","hasDynamicValidationData","updateValidations","errors","_lastModification","Date","timestamp","reset","mergeAttribute","oldAttribute","update","changedAttribute","isEditable","_isEditable","isVisible","_isHidden","isHidden","show","hide","equals","otherAttribute","readonlyWidth","MEDIUM","layoutHintRules","_layoutHintRules","rules","processLayoutHintRules","attributes","process"],"sources":["../../../src/models/attributes/AttributeModel.js"],"sourcesContent":["// @flow\nimport { DateUtil } from \"../../utils/datetime/DateTimeUtil\";\nimport { isPlainObject } from \"../../utils/helpers/objects\";\n\nimport BaseModel from \"../base/BaseModel\";\nimport ConstraintCollection from \"./input-constraints/ConstraintCollection\";\nimport ErrorCollection from \"../error/ErrorCollection\";\nimport LinkCollection from \"../links/LinkCollection\";\n\nimport StringLengthConstraint from \"./input-constraints/StringLengthConstraint\";\nimport MandatoryConstraint from \"./input-constraints/MandatoryConstraint\";\n\nimport ConceptDetailModel from \"../concepts/ConceptDetailModel\";\n\nimport { DISABLED, MANDATORY } from \"../../constants/LayoutHints\";\nimport {\n ATTRIBUTE_WIDTH,\n TIMEVERSION_FILTER_NAME,\n} from \"../../constants/Constants\";\n\nimport { getSetting, hasAllContentInData } from \"../../constants/Settings\";\n\nimport {\n IllegalArgumentException,\n UnsupportedOperationException,\n} from \"../../exceptions\";\n\nimport type { MessageParameters } from \"../../i18n/types\";\nimport type {\n AttributeType,\n FormErrorAnchor,\n IModelWithChildModels,\n ModularUIModel,\n} from \"../types\";\nimport type LinkModel from \"../links/LinkModel\";\nimport type ContentConfiguration from \"../contentconfiguration/ContentConfiguration\";\nimport type ContentConfigurationElements from \"../contentconfiguration/ContentConfigurationElements\";\nimport type LayoutHintRuleCollection from \"./layouthint-rules/LayoutHintRuleCollection\";\nimport type AttributeCollection from \"./AttributeCollection\";\nimport AttributeContent from \"./AttributeContent\";\n\n/**\n * Attribute model, base model for all kind of attributes\n */\nexport default class AttributeModel\n extends BaseModel\n implements IModelWithChildModels\n{\n _label: string;\n _lastModification: number = 0;\n\n _initvalue: any;\n _inputvalue: string;\n _value: any;\n\n _errorCollection: ErrorCollection;\n _serverConstraints: ConstraintCollection = new ConstraintCollection();\n _useClientsideValidation: boolean = getSetting(\"USE_CLIENTSIDE_VALIDATION\");\n _isValid: boolean = true;\n _validatedValue: string | null;\n _isEditable: boolean = false;\n _concept: ConceptDetailModel | null = null;\n _referenceDate: ISO_DATE;\n _isResult: boolean;\n _isHidden: boolean = false;\n _readonly: boolean;\n _disabled: boolean = false;\n _mandatory: boolean;\n _links: LinkCollection;\n _parentKey: ?string;\n _hasContentConfiguration: boolean;\n _layoutHintRules: LayoutHintRuleCollection;\n\n /**\n */\n constructor(attribute: Object, attributeContributions: Object) {\n super(attribute, attributeContributions);\n\n if (this.hasContentFromData && this.content.label) {\n this._label = this.content.label;\n } else {\n this._label = this.contributions.label;\n }\n\n this._initvalue = this.data.value;\n this._inputvalue = this.getInitialInputValue(this.data.value);\n this._value = this.data.value;\n this._disabled = this.layouthint.has(DISABLED);\n\n this._errorCollection = new ErrorCollection(\"attribute\");\n if (attribute && attribute.message) {\n this._errorCollection.addServerError(\n attribute.message.id,\n attribute.message.message,\n attribute.message.parameters\n );\n }\n\n this._referenceDate = this.getData(\"referenceDate\", DateUtil.now());\n\n this._isResult = this.getData(\"isResult\", false);\n\n this._mandatory =\n this.layouthint.has(MANDATORY) || this.contributions.mandatory;\n\n this._links = new LinkCollection(\n this.data._links,\n this.contributions._links\n );\n }\n\n /**\n */\n static isApplicableModel(contributions: Object): boolean {\n if (!isPlainObject(contributions)) {\n throw new IllegalArgumentException(\n \"Given argument for isApplicableModel is not a contributions object\"\n );\n }\n\n return false;\n }\n\n /**\n * Retrieve initial input value\n */\n getInitialInputValue(value: any): any {\n return value;\n }\n\n /**\n */\n getInitialChildModelLinks(): Array<LinkModel> {\n if (\n !this.hasContentFromData &&\n this.hasContentConfiguration &&\n this.conceptLink\n ) {\n return [this.conceptLink];\n }\n return [];\n }\n\n /**\n */\n setChildModels(models: Array<ModularUIModel>) {\n const conceptHref = this.conceptLink?.href;\n if (conceptHref) {\n this.concept = models.find((model) =>\n model.selfhref.equalsWithParameters(conceptHref)\n );\n }\n }\n\n /**\n * Getting the attribute key\n */\n get key(): string {\n return this.data.key;\n }\n\n /**\n */\n get parentKey(): string {\n return this._parentKey || \"\";\n }\n\n /**\n */\n set parentKey(parentKey: string) {\n this._parentKey = parentKey;\n }\n\n /**\n * Getting the attribute name\n */\n get name(): string {\n return this.key;\n }\n\n /**\n * Getting the type of the attribute\n */\n get type(): string {\n return this.contributions.type;\n }\n\n /**\n * Getting the label of the attribute\n */\n get label(): string {\n return this._label || \"\";\n }\n\n /**\n * Set the label of this attribute\n */\n set label(label: string) {\n this._label = label;\n }\n\n /**\n */\n set hasContentConfiguration(hasContentConfiguration: boolean) {\n this._hasContentConfiguration = hasContentConfiguration;\n }\n\n /**\n */\n get hasContentConfiguration(): boolean {\n return this._hasContentConfiguration || false;\n }\n\n /**\n */\n indicateContentConfiguration(contentConfiguration: ContentConfiguration) {\n if (contentConfiguration) {\n const hasQuestionConfig = contentConfiguration.questions?.hasConfig();\n\n const hasEndResultConfig =\n contentConfiguration.isConfiguredEndResultAttribute(this.key);\n const hasIntermediateResultConfig =\n contentConfiguration.isConfiguredIntermediateResultAttribute(this.key);\n\n this.hasContentConfiguration =\n hasQuestionConfig || hasEndResultConfig || hasIntermediateResultConfig;\n }\n }\n\n /**\n * Retrieve the first permitted label to render when a concept and contentConfiguration is available\n * Be aware that permission could be in place for labels from a concept.\n */\n getContentConfiguredLabel(\n contentConfiguration: ?ContentConfigurationElements\n ): string {\n if (this.hasContentFromData) {\n return this.content.label ?? this.label;\n }\n\n const configuredLabelProperties =\n contentConfiguration && contentConfiguration.labelConfig.length > 0\n ? contentConfiguration.labelConfig[0].types\n : [];\n\n if (this.concept && configuredLabelProperties.length > 0) {\n const configuredLabels = this.concept\n .getLabelElementByIds(configuredLabelProperties)\n .filter(\n (configuredLabel) =>\n configuredLabel.value && configuredLabel.value !== \"\"\n );\n\n if (configuredLabels.length > 0) {\n const [firstConfiguredLabel] = configuredLabelProperties\n .filter((configuredLabelProperty) =>\n configuredLabels.some(\n (configuredLabel) =>\n configuredLabel._id === configuredLabelProperty\n )\n )\n .map((configuredLabelProperty) =>\n configuredLabels.find(\n (configuredLabel) =>\n configuredLabel._id === configuredLabelProperty\n )\n );\n\n if (firstConfiguredLabel) {\n return firstConfiguredLabel.value;\n }\n }\n }\n\n return this.label;\n }\n\n /**\n */\n get defaultAlignment(): \"left\" | \"center\" | \"right\" {\n return \"left\";\n }\n\n /**\n * Handles layout hint align-left, align-center and align-right\n */\n get alignment(): \"left\" | \"center\" | \"right\" {\n const alignmentHints = this.layouthint.getByLayoutHint(\"align-\");\n\n // return alignment based on layouthint or the default alignment for the attribute\n const alignment = alignmentHints\n ? alignmentHints.substring(\"align-\".length)\n : this.defaultAlignment;\n\n if (\n alignment === \"left\" ||\n alignment === \"center\" ||\n alignment === \"right\"\n ) {\n return alignment;\n }\n\n return this.defaultAlignment;\n }\n\n /**\n * Retrieve links of attribute\n */\n get links(): LinkCollection {\n if (!this._links) {\n this._links = new LinkCollection(\n this.data._links,\n this.contributions._links\n );\n }\n\n return this._links;\n }\n\n /**\n * Retrieve link of attribute when available\n */\n get downloadLink(): ?LinkModel {\n const downloadLink = this.links.getLinksByGroup(\"download\").first;\n\n if (downloadLink && downloadLink.key === this.key) {\n return downloadLink;\n }\n\n return null;\n }\n\n /**\n * Retrieve concept link of attribute when available\n */\n get conceptLink(): ?LinkModel {\n const conceptLink = this.links.getLinkByKey(\"concept\");\n\n if (conceptLink !== null) {\n conceptLink.href = conceptLink.href.addParameter(\n TIMEVERSION_FILTER_NAME,\n this.referenceDate\n );\n\n conceptLink.isCacheable = true;\n }\n\n return conceptLink;\n }\n\n /**\n * Get concept information\n */\n get concept(): ConceptDetailModel | null {\n return this._concept ?? null;\n }\n\n /**\n * Set the concept\n */\n set concept(concept: ?ModularUIModel) {\n this._concept = concept instanceof ConceptDetailModel ? concept : null;\n }\n\n /**\n * Retrieve reference date of attribute which can be used as entryDate for content\n * to get information in correct time version\n */\n get referenceDate(): ISO_DATE {\n return this._referenceDate;\n }\n\n /**\n * Set reference date for concepts and content\n */\n set referenceDate(date: ISO_DATE) {\n this._referenceDate = date;\n }\n\n /**\n * Initial value received from the modular ui service\n */\n get initvalue(): any {\n return this._initvalue;\n }\n\n /**\n * Retrieve input value\n */\n getInputValue(): string {\n const inputvalue = this._inputvalue;\n\n return inputvalue ? inputvalue.toString() : \"\";\n }\n\n /**\n * Returns the value as entered by the user. This can differ from the internal iso value that is stored\n */\n get inputvalue(): string {\n return this.getInputValue();\n }\n\n /**\n * Value that is used when retrieving an error collection of this attribute\n * Mostly this is the input value, but sometimes a different value is needed,\n * for example iban and postcode need to validate length without spaces\n */\n get validateValue(): string {\n return this.inputvalue;\n }\n\n /**\n * Sets the input value to the value entered by the user\n */\n set inputvalue(value: string) {\n this._inputvalue = value;\n this.value = value;\n\n this.validate(value);\n }\n\n /**\n */\n hasValue(): boolean {\n return this._value != null && this._value !== \"\";\n }\n\n /**\n * Getting the value of the attribute\n */\n getValue(): any {\n return this.hasValue() ? this._value : null;\n }\n\n /**\n * Getting data ready to be send to the modular ui\n * Returns null when the attribute should not be send to the server\n */\n getFormData(): { [string]: any } | null {\n if (this.inError()) {\n return null;\n }\n\n return {\n [this.name]: this.value,\n };\n }\n\n /**\n */\n get formdata(): { [string]: any } | null {\n return this.getFormData();\n }\n\n /**\n */\n getEmptyFormData(): { [string]: null } {\n return { [this.name]: null };\n }\n\n /**\n * Getting the value of the attribute\n */\n get value(): any {\n return this.getValue();\n }\n\n /**\n * Setting a value in the element\n */\n set value(value: ?string) {\n this.updateLastModification();\n\n this._value = value;\n }\n\n /**\n */\n formatValue(value: string): string {\n return value;\n }\n\n /**\n * Getting the readonly value, iso value converted for human reading\n */\n get readonlyvalue(): string {\n return this.value ? this.value.toString() : \"\";\n }\n\n /**\n * Getting mandatory status of attribute\n */\n get mandatory(): boolean {\n return this._mandatory || false;\n }\n\n /**\n */\n get configuredMandatory(): ?boolean {\n return this.layouthint.has(MANDATORY) || this.contributions.mandatory;\n }\n\n /**\n * Set mandatory status of attribute\n */\n set mandatory(mandatory: boolean) {\n if (mandatory !== this._mandatory) {\n this._validatedValue = null;\n }\n this._mandatory = mandatory;\n }\n\n /**\n */\n get readonly(): boolean {\n return (\n this._readonly ||\n this.contributions.readonly === true ||\n this.data.static === true ||\n this.isResult === true\n );\n }\n\n /**\n */\n set readonly(readonly: boolean) {\n this._readonly = readonly;\n }\n\n /**\n */\n get disabled(): boolean {\n return this._disabled;\n }\n\n /**\n */\n set disabled(disabled: boolean) {\n this._disabled = disabled;\n }\n\n /**\n */\n get isResult(): boolean {\n return this._isResult;\n }\n\n /**\n */\n set isResult(isResult: boolean) {\n this._isResult = isResult;\n }\n\n /**\n * Getting the display and input format of a attribute\n */\n get format(): string | null {\n return this.getContribution(\"format\");\n }\n\n /**\n */\n get formatLabel(): string {\n return this.format || \"\";\n }\n\n /**\n * Get minimum string length\n */\n get minLength(): number | null {\n return this.getContribution(\"minLength\");\n }\n\n /**\n * Get maximum string length\n */\n get maxLength(): number | null {\n return this.getContribution(\"maxLength\");\n }\n\n /**\n */\n get operator(): string {\n return \"\";\n }\n\n /**\n * Get assistant message\n */\n get assistantMessage(): string | null {\n return this.getContribution(\"assistant\");\n }\n\n /**\n * Get valid status\n */\n get isValid(): boolean {\n return this.validate(this.validateValue);\n }\n\n /**\n * Retrieve applicable constraint for this attribute\n */\n get constraintCollection(): ConstraintCollection {\n const constraints = new ConstraintCollection();\n\n constraints.add(this._serverConstraints);\n\n // Mandatory constraint\n if (this.mandatory) {\n constraints.add(new MandatoryConstraint());\n }\n\n if (this.minLength || this.maxLength) {\n constraints.add(\n new StringLengthConstraint(this.minLength, this.maxLength)\n );\n }\n\n constraints.add(this.addConstraints());\n\n return constraints;\n }\n\n /**\n * Template method for class extending this model to add extra constraints\n * @abstract\n */\n addConstraints(): ConstraintCollection {\n return new ConstraintCollection();\n }\n\n /**\n * Used to programmatically overwrite the setting USE_CLIENTSIDE_VALIDATION\n */\n setUseClientsideValidation(enabled: boolean) {\n this._useClientsideValidation = enabled;\n }\n\n /**\n * Indicates if client side validation is enabled\n * @returns {boolean}\n */\n useClientsideValidation(): boolean {\n return this._useClientsideValidation ?? true;\n }\n\n /**\n * Validate input on client side constraint\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 !== value) {\n this._isValid = this.constraintCollection.validate(value);\n }\n this._validatedValue = value;\n\n return this._isValid;\n }\n\n /**\n * Indicates if attribute is optional and empty\n */\n isOptionalAndEmpty(value: string): boolean {\n if (value === undefined) {\n throw new IllegalArgumentException(\n \"isOptionalAndEmpty method needs value argument\"\n );\n }\n\n return !this.mandatory && value === \"\";\n }\n\n /**\n * Retrieve error messages of this attribute\n */\n get errorCollection(): ErrorCollection {\n const collection = new ErrorCollection(\"attribute\", this._errorCollection);\n\n collection.addConstraints(\n this.constraintCollection.invalidConstraints(this.validateValue)\n );\n\n return collection;\n }\n\n /**\n * Check if attribute is in error\n */\n inError(): boolean {\n return !this._isValid && this.isChangedSince(0);\n }\n\n /**\n * Reset static error messages on attribute\n */\n resetErrors() {\n this._errorCollection = new ErrorCollection(\"attribute\");\n }\n\n /**\n * Registers an error that was received from a server response\n */\n addServerError(error: FormErrorAnchor) {\n this._errorCollection.addServerError(\n error.id,\n error.message,\n error.properties,\n error.layouthint\n );\n }\n\n /**\n */\n removeServerError(id: string) {\n this._errorCollection.removeServerError(id);\n }\n\n /**\n */\n hasServerErrors(): boolean {\n return this.errorCollection.serverErrors.length > 0;\n }\n\n /**\n */\n hasErrors(): boolean {\n return this.errorCollection.hasItems;\n }\n\n /**\n * Registers a missing error that was received from the server\n */\n addMissingError() {\n this._errorCollection.addServerError(\"Constraint.Missing\");\n }\n\n /**\n */\n removeMissingError() {\n this.removeServerError(\"Constraint.Missing\");\n }\n\n /**\n */\n addServerConstraint(\n id: string,\n defaultMessage?: string,\n parameters?: MessageParameters\n ) {\n this._serverConstraints.addConstraint(\n id,\n null,\n defaultMessage,\n parameters,\n this.useClientsideValidation()\n );\n }\n\n /**\n */\n formatParameters(parameters: Object): { [string]: string | number } {\n if (parameters == null) {\n return {};\n }\n\n const params = {};\n\n Object.keys(parameters).forEach((paramKey: string) => {\n const paramValue = parameters[paramKey];\n if (paramKey.endsWith(\"-number\") || paramKey.endsWith(\"-date\")) {\n params[paramKey] = this.formatValue(paramValue);\n } else {\n params[paramKey] = paramValue;\n }\n });\n\n return params;\n }\n\n /**\n */\n get hasDynamicValidationData(): boolean {\n return true;\n }\n\n /**\n */\n updateValidations(errors: Array<Object>) {\n if (\n errors.some((error) => error.id === \"Constraint.Mandatory\") ||\n this.layouthint.has(MANDATORY)\n ) {\n this.mandatory = true;\n } else if (!this.hasValue()) {\n this.mandatory = false;\n }\n\n this._serverConstraints = new ConstraintCollection();\n this.resetErrors();\n\n errors\n .filter(\n (error) => error.id !== \"Constraint.Mandatory\" || !this.hasValue()\n )\n .forEach((error) => {\n if (this.hasValue()) {\n this._errorCollection.addServerError(\n error.id,\n error.message,\n this.formatParameters(error.properties),\n error.layouthint\n );\n } else {\n this.addServerConstraint(\n error.id,\n error.message,\n this.formatParameters(error.properties)\n );\n }\n });\n }\n\n /**\n * Set last modification to current timestamp\n */\n updateLastModification() {\n this._lastModification = Date.now();\n }\n\n /**\n * Inidicates if attribute is changed since a given timestamp (Date.now)\n */\n isChangedSince(timestamp: number): boolean {\n return this._lastModification > timestamp;\n }\n\n /**\n * Abstract reset method which should be implemented on each attribute that has this attribute as a base class.\n *\n * @abstract\n */\n reset() {\n throw new UnsupportedOperationException(\n `Reset method not implemented for ${this.type}`\n );\n }\n\n /**\n * Merge old attribute with the attribute from the server.\n * Readonly attributes always need to show the value from the server\n */\n mergeAttribute(oldAttribute: AttributeType) {\n this.concept = oldAttribute.concept;\n\n if (\n !oldAttribute.readonly &&\n oldAttribute.isValid &&\n oldAttribute.inputvalue !== null\n ) {\n this.update(oldAttribute.inputvalue);\n }\n }\n\n /**\n * Abstract update method which should be implemented on each attribute that has this attribute as a base class.\n * @abstract\n */\n // eslint-disable-next-line no-unused-vars\n update(value: string, changedAttribute?: AttributeType): AttributeType {\n throw new UnsupportedOperationException(\n `Update method not implemented for ${this.type}`\n );\n }\n\n /**\n * Indicate if attribute is editable\n */\n set isEditable(isEditable: boolean) {\n this._isEditable = isEditable;\n }\n\n /**\n * Retrieve if attribute is editable\n */\n get isEditable(): boolean {\n return this._isEditable;\n }\n\n /**\n * Indicates if the attribute is visible\n */\n get isVisible(): boolean {\n return !this._isHidden;\n }\n\n /**\n */\n get isHidden(): boolean {\n return this._isHidden;\n }\n\n /**\n */\n set isHidden(isHidden: boolean) {\n this._isHidden = isHidden;\n }\n\n /**\n * Explicitly toggle visibility of this attribute\n */\n show() {\n this.isHidden = false;\n }\n\n /**\n */\n hide() {\n this.isHidden = true;\n }\n\n /**\n */\n equals(otherAttribute: AttributeType): boolean {\n return (\n this.key === otherAttribute.key &&\n this.parentKey === otherAttribute.parentKey\n );\n }\n\n /**\n * Readonly attribute width indicates the proposed width of this attribute\n */\n get readonlyWidth(): $Keys<typeof ATTRIBUTE_WIDTH> {\n return ATTRIBUTE_WIDTH.MEDIUM;\n }\n\n /**\n */\n get layoutHintRules(): LayoutHintRuleCollection {\n return this._layoutHintRules;\n }\n\n /**\n */\n set layoutHintRules(rules: LayoutHintRuleCollection) {\n this._layoutHintRules = rules;\n }\n\n /**\n */\n processLayoutHintRules(attributes: AttributeCollection) {\n if (this._layoutHintRules) {\n this.layoutHintRules.process(this, attributes);\n }\n }\n\n /**\n * Indicates if content comes from the data service\n */\n get hasContentFromData(): boolean {\n return hasAllContentInData();\n }\n\n /**\n */\n get content(): AttributeContent {\n return new AttributeContent(this.data.content);\n }\n}\n"],"mappings":";;;;;;AACA,SAASA,QAAT,QAAyB,mCAAzB;AACA,SAASC,aAAT,QAA8B,6BAA9B;AAEA,OAAOC,SAAP,MAAsB,mBAAtB;AACA,OAAOC,oBAAP,MAAiC,0CAAjC;AACA,OAAOC,eAAP,MAA4B,0BAA5B;AACA,OAAOC,cAAP,MAA2B,yBAA3B;AAEA,OAAOC,sBAAP,MAAmC,4CAAnC;AACA,OAAOC,mBAAP,MAAgC,yCAAhC;AAEA,OAAOC,kBAAP,MAA+B,gCAA/B;AAEA,SAASC,QAAT,EAAmBC,SAAnB,QAAoC,6BAApC;AACA,SACEC,eADF,EAEEC,uBAFF,QAGO,2BAHP;A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,UAAU,GAAY;IACxB,OAAO,KAAKC,WAAZ;EACD;EAED;AACF;AACA;;;EACe,IAATC,SAAS,GAAY;IACvB,OAAO,CAAC,KAAKC,SAAb;EACD;EAED;AACF;;;EACc,IAARC,QAAQ,GAAY;IACtB,OAAO,KAAKD,SAAZ;EACD;EAED;AACF;;;EACc,IAARC,QAAQ,CAACA,QAAD,EAAoB;IAC9B,KAAKD,SAAL,GAAiBC,QAAjB;EACD;EAED;AACF;AACA;;;EACEC,IAAI,GAAG;IACL,KAAKD,QAAL,GAAgB,KAAhB;EACD;EAED;AACF;;;EACEE,IAAI,GAAG;IACL,KAAKF,QAAL,GAAgB,IAAhB;EACD;EAED;AACF;;;EACEG,MAAM,CAACC,cAAD,EAAyC;IAC7C,OACE,KAAK7H,GAAL,KAAa6H,cAAc,CAAC7H,GAA5B,IACA,KAAKC,SAAL,KAAmB4H,cAAc,CAAC5H,SAFpC;EAID;EAED;AACF;AACA;;;EACmB,IAAb6H,aAAa,GAAkC;IACjD,OAAO/K,eAAe,CAACgL,MAAvB;EACD;EAED;AACF;;;EACqB,IAAfC,eAAe,GAA6B;IAC9C,OAAO,KAAKC,gBAAZ;EACD;EAED;AACF;;;EACqB,IAAfD,eAAe,CAACE,KAAD,EAAkC;IACnD,KAAKD,gBAAL,GAAwBC,KAAxB;EACD;EAED;AACF;;;EACEC,sBAAsB,CAACC,UAAD,EAAkC;IACtD,IAAI,KAAKH,gBAAT,EAA2B;MACzB,KAAKD,eAAL,CAAqBK,OAArB,CAA6B,IAA7B,EAAmCD,UAAnC;IACD;EACF;EAED;AACF;AACA;;;EACwB,IAAlB1K,kBAAkB,GAAY;IAChC,OAAOR,mBAAmB,EAA1B;EACD;EAED;AACF;;;EACa,IAAPS,OAAO,GAAqB;IAC9B,OAAO,IAAIN,gBAAJ,CAAqB,KAAKW,IAAL,CAAUL,OAA/B,CAAP;EACD;;AA/5BH"}
|
|
1
|
+
{"version":3,"file":"AttributeModel.js","names":["DateUtil","isPlainObject","BaseModel","ConstraintCollection","ErrorCollection","LinkCollection","StringLengthConstraint","MandatoryConstraint","ConceptDetailModel","DISABLED","MANDATORY","ATTRIBUTE_WIDTH","TIMEVERSION_FILTER_NAME","getSetting","hasAllContentInData","IllegalArgumentException","UnsupportedOperationException","AttributeContent","AttributeModel","constructor","attribute","attributeContributions","hasContentFromData","content","label","_label","contributions","_initvalue","data","value","_inputvalue","getInitialInputValue","_value","_disabled","layouthint","has","_errorCollection","message","addServerError","id","parameters","_referenceDate","getData","now","_isResult","_mandatory","mandatory","_links","isApplicableModel","getInitialChildModelLinks","hasContentConfiguration","conceptLink","setChildModels","models","conceptHref","href","concept","model","selfhref","equalsWithParameters","key","parentKey","_parentKey","name","type","_hasContentConfiguration","indicateContentConfiguration","contentConfiguration","hasQuestionConfig","questions","hasConfig","hasEndResultConfig","isConfiguredEndResultAttribute","hasIntermediateResultConfig","isConfiguredIntermediateResultAttribute","getContentConfiguredLabel","configuredLabelProperties","labelConfig","length","types","configuredLabels","getLabelElementByIds","configuredLabel","firstConfiguredLabel","configuredLabelProperty","some","_id","defaultAlignment","alignment","alignmentHints","getByLayoutHint","substring","links","downloadLink","getLinksByGroup","first","getLinkByKey","addParameter","referenceDate","isCacheable","_concept","date","initvalue","getInputValue","inputvalue","toString","validateValue","validate","hasValue","getValue","getFormData","inError","formdata","getEmptyFormData","updateLastModification","formatValue","readonlyvalue","configuredMandatory","_validatedValue","readonly","_readonly","static","isResult","disabled","format","getContribution","formatLabel","minLength","maxLength","operator","assistantMessage","isValid","constraintCollection","constraints","add","_serverConstraints","addConstraints","setUseClientsideValidation","enabled","_useClientsideValidation","useClientsideValidation","isOptionalAndEmpty","_isValid","undefined","errorCollection","collection","invalidConstraints","isChangedSince","resetErrors","error","properties","removeServerError","hasServerErrors","serverErrors","hasErrors","hasItems","addMissingError","removeMissingError","addServerConstraint","defaultMessage","addConstraint","formatParameters","params","forEach","paramKey","paramValue","hasDynamicValidationData","updateValidations","errors","_lastModification","Date","timestamp","reset","mergeAttribute","oldAttribute","update","changedAttribute","isEditable","_isEditable","isVisible","_isHidden","isHidden","show","hide","equals","otherAttribute","readonlyWidth","MEDIUM","layoutHintRules","_layoutHintRules","rules","processLayoutHintRules","attributes","process"],"sources":["../../../src/models/attributes/AttributeModel.js"],"sourcesContent":["// @flow\nimport { DateUtil } from \"../../utils/datetime/DateTimeUtil\";\nimport { isPlainObject } from \"../../utils/helpers/objects\";\n\nimport BaseModel from \"../base/BaseModel\";\nimport ConstraintCollection from \"./input-constraints/ConstraintCollection\";\nimport ErrorCollection from \"../error/ErrorCollection\";\nimport LinkCollection from \"../links/LinkCollection\";\n\nimport StringLengthConstraint from \"./input-constraints/StringLengthConstraint\";\nimport MandatoryConstraint from \"./input-constraints/MandatoryConstraint\";\n\nimport ConceptDetailModel from \"../concepts/ConceptDetailModel\";\n\nimport { DISABLED, MANDATORY } from \"../../constants/LayoutHints\";\nimport {\n ATTRIBUTE_WIDTH,\n TIMEVERSION_FILTER_NAME,\n} from \"../../constants/Constants\";\n\nimport { getSetting, hasAllContentInData } from \"../../constants/Settings\";\n\nimport {\n IllegalArgumentException,\n UnsupportedOperationException,\n} from \"../../exceptions\";\n\nimport type { MessageParameters } from \"../../i18n/types\";\nimport type {\n AttributeType,\n FormErrorAnchor,\n IModelWithChildModels,\n ModularUIModel,\n} from \"../types\";\nimport type LinkModel from \"../links/LinkModel\";\nimport type ContentConfiguration from \"../contentconfiguration/ContentConfiguration\";\nimport type ContentConfigurationElements from \"../contentconfiguration/ContentConfigurationElements\";\nimport type LayoutHintRuleCollection from \"./layouthint-rules/LayoutHintRuleCollection\";\nimport type AttributeCollection from \"./AttributeCollection\";\nimport AttributeContent from \"./AttributeContent\";\n\n/**\n * Attribute model, base model for all kind of attributes\n */\nexport default class AttributeModel\n extends BaseModel\n implements IModelWithChildModels\n{\n _label: string;\n _lastModification: number = 0;\n\n _initvalue: any;\n _inputvalue: string;\n _value: any;\n\n _errorCollection: ErrorCollection;\n _serverConstraints: ConstraintCollection = new ConstraintCollection();\n _useClientsideValidation: boolean = getSetting(\"USE_CLIENTSIDE_VALIDATION\");\n _isValid: boolean = true;\n _validatedValue: string | null;\n _isEditable: boolean = false;\n _concept: ConceptDetailModel | null = null;\n _referenceDate: ISO_DATE;\n _isResult: boolean;\n _isHidden: boolean = false;\n _readonly: boolean;\n _disabled: boolean = false;\n _mandatory: boolean;\n _links: LinkCollection;\n _parentKey: ?string;\n _hasContentConfiguration: boolean;\n _layoutHintRules: LayoutHintRuleCollection;\n\n /**\n */\n constructor(attribute: Object, attributeContributions: Object) {\n super(attribute, attributeContributions);\n\n if (this.hasContentFromData && this.content.label) {\n this._label = this.content.label;\n } else {\n this._label = this.contributions.label;\n }\n\n this._initvalue = this.data.value;\n this._inputvalue = this.getInitialInputValue(this.data.value);\n this._value = this.data.value;\n this._disabled = this.layouthint.has(DISABLED);\n\n this._errorCollection = new ErrorCollection(\"attribute\");\n if (attribute && attribute.message) {\n this._errorCollection.addServerError(\n attribute.message.id,\n attribute.message.message,\n attribute.message.parameters,\n attribute.message.layouthint\n );\n }\n\n this._referenceDate = this.getData(\"referenceDate\", DateUtil.now());\n\n this._isResult = this.getData(\"isResult\", false);\n\n this._mandatory =\n this.layouthint.has(MANDATORY) || this.contributions.mandatory;\n\n this._links = new LinkCollection(\n this.data._links,\n this.contributions._links\n );\n }\n\n /**\n */\n static isApplicableModel(contributions: Object): boolean {\n if (!isPlainObject(contributions)) {\n throw new IllegalArgumentException(\n \"Given argument for isApplicableModel is not a contributions object\"\n );\n }\n\n return false;\n }\n\n /**\n * Retrieve initial input value\n */\n getInitialInputValue(value: any): any {\n return value;\n }\n\n /**\n */\n getInitialChildModelLinks(): Array<LinkModel> {\n if (\n !this.hasContentFromData &&\n this.hasContentConfiguration &&\n this.conceptLink\n ) {\n return [this.conceptLink];\n }\n return [];\n }\n\n /**\n */\n setChildModels(models: Array<ModularUIModel>) {\n const conceptHref = this.conceptLink?.href;\n if (conceptHref) {\n this.concept = models.find((model) =>\n model.selfhref.equalsWithParameters(conceptHref)\n );\n }\n }\n\n /**\n * Getting the attribute key\n */\n get key(): string {\n return this.data.key;\n }\n\n /**\n */\n get parentKey(): string {\n return this._parentKey || \"\";\n }\n\n /**\n */\n set parentKey(parentKey: string) {\n this._parentKey = parentKey;\n }\n\n /**\n * Getting the attribute name\n */\n get name(): string {\n return this.key;\n }\n\n /**\n * Getting the type of the attribute\n */\n get type(): string {\n return this.contributions.type;\n }\n\n /**\n * Getting the label of the attribute\n */\n get label(): string {\n return this._label || \"\";\n }\n\n /**\n * Set the label of this attribute\n */\n set label(label: string) {\n this._label = label;\n }\n\n /**\n */\n set hasContentConfiguration(hasContentConfiguration: boolean) {\n this._hasContentConfiguration = hasContentConfiguration;\n }\n\n /**\n */\n get hasContentConfiguration(): boolean {\n return this._hasContentConfiguration || false;\n }\n\n /**\n */\n indicateContentConfiguration(contentConfiguration: ContentConfiguration) {\n if (contentConfiguration) {\n const hasQuestionConfig = contentConfiguration.questions?.hasConfig();\n\n const hasEndResultConfig =\n contentConfiguration.isConfiguredEndResultAttribute(this.key);\n const hasIntermediateResultConfig =\n contentConfiguration.isConfiguredIntermediateResultAttribute(this.key);\n\n this.hasContentConfiguration =\n hasQuestionConfig || hasEndResultConfig || hasIntermediateResultConfig;\n }\n }\n\n /**\n * Retrieve the first permitted label to render when a concept and contentConfiguration is available\n * Be aware that permission could be in place for labels from a concept.\n */\n getContentConfiguredLabel(\n contentConfiguration: ?ContentConfigurationElements\n ): string {\n if (this.hasContentFromData) {\n return this.content.label ?? this.label;\n }\n\n const configuredLabelProperties =\n contentConfiguration && contentConfiguration.labelConfig.length > 0\n ? contentConfiguration.labelConfig[0].types\n : [];\n\n if (this.concept && configuredLabelProperties.length > 0) {\n const configuredLabels = this.concept\n .getLabelElementByIds(configuredLabelProperties)\n .filter(\n (configuredLabel) =>\n configuredLabel.value && configuredLabel.value !== \"\"\n );\n\n if (configuredLabels.length > 0) {\n const [firstConfiguredLabel] = configuredLabelProperties\n .filter((configuredLabelProperty) =>\n configuredLabels.some(\n (configuredLabel) =>\n configuredLabel._id === configuredLabelProperty\n )\n )\n .map((configuredLabelProperty) =>\n configuredLabels.find(\n (configuredLabel) =>\n configuredLabel._id === configuredLabelProperty\n )\n );\n\n if (firstConfiguredLabel) {\n return firstConfiguredLabel.value;\n }\n }\n }\n\n return this.label;\n }\n\n /**\n */\n get defaultAlignment(): \"left\" | \"center\" | \"right\" {\n return \"left\";\n }\n\n /**\n * Handles layout hint align-left, align-center and align-right\n */\n get alignment(): \"left\" | \"center\" | \"right\" {\n const alignmentHints = this.layouthint.getByLayoutHint(\"align-\");\n\n // return alignment based on layouthint or the default alignment for the attribute\n const alignment = alignmentHints\n ? alignmentHints.substring(\"align-\".length)\n : this.defaultAlignment;\n\n if (\n alignment === \"left\" ||\n alignment === \"center\" ||\n alignment === \"right\"\n ) {\n return alignment;\n }\n\n return this.defaultAlignment;\n }\n\n /**\n * Retrieve links of attribute\n */\n get links(): LinkCollection {\n if (!this._links) {\n this._links = new LinkCollection(\n this.data._links,\n this.contributions._links\n );\n }\n\n return this._links;\n }\n\n /**\n * Retrieve link of attribute when available\n */\n get downloadLink(): ?LinkModel {\n const downloadLink = this.links.getLinksByGroup(\"download\").first;\n\n if (downloadLink && downloadLink.key === this.key) {\n return downloadLink;\n }\n\n return null;\n }\n\n /**\n * Retrieve concept link of attribute when available\n */\n get conceptLink(): ?LinkModel {\n const conceptLink = this.links.getLinkByKey(\"concept\");\n\n if (conceptLink !== null) {\n conceptLink.href = conceptLink.href.addParameter(\n TIMEVERSION_FILTER_NAME,\n this.referenceDate\n );\n\n conceptLink.isCacheable = true;\n }\n\n return conceptLink;\n }\n\n /**\n * Get concept information\n */\n get concept(): ConceptDetailModel | null {\n return this._concept ?? null;\n }\n\n /**\n * Set the concept\n */\n set concept(concept: ?ModularUIModel) {\n this._concept = concept instanceof ConceptDetailModel ? concept : null;\n }\n\n /**\n * Retrieve reference date of attribute which can be used as entryDate for content\n * to get information in correct time version\n */\n get referenceDate(): ISO_DATE {\n return this._referenceDate;\n }\n\n /**\n * Set reference date for concepts and content\n */\n set referenceDate(date: ISO_DATE) {\n this._referenceDate = date;\n }\n\n /**\n * Initial value received from the modular ui service\n */\n get initvalue(): any {\n return this._initvalue;\n }\n\n /**\n * Retrieve input value\n */\n getInputValue(): string {\n const inputvalue = this._inputvalue;\n\n return inputvalue ? inputvalue.toString() : \"\";\n }\n\n /**\n * Returns the value as entered by the user. This can differ from the internal iso value that is stored\n */\n get inputvalue(): string {\n return this.getInputValue();\n }\n\n /**\n * Value that is used when retrieving an error collection of this attribute\n * Mostly this is the input value, but sometimes a different value is needed,\n * for example iban and postcode need to validate length without spaces\n */\n get validateValue(): string {\n return this.inputvalue;\n }\n\n /**\n * Sets the input value to the value entered by the user\n */\n set inputvalue(value: string) {\n this._inputvalue = value;\n this.value = value;\n\n this.validate(value);\n }\n\n /**\n */\n hasValue(): boolean {\n return this._value != null && this._value !== \"\";\n }\n\n /**\n * Getting the value of the attribute\n */\n getValue(): any {\n return this.hasValue() ? this._value : null;\n }\n\n /**\n * Getting data ready to be send to the modular ui\n * Returns null when the attribute should not be send to the server\n */\n getFormData(): { [string]: any } | null {\n if (this.inError()) {\n return null;\n }\n\n return {\n [this.name]: this.value,\n };\n }\n\n /**\n */\n get formdata(): { [string]: any } | null {\n return this.getFormData();\n }\n\n /**\n */\n getEmptyFormData(): { [string]: null } {\n return { [this.name]: null };\n }\n\n /**\n * Getting the value of the attribute\n */\n get value(): any {\n return this.getValue();\n }\n\n /**\n * Setting a value in the element\n */\n set value(value: ?string) {\n this.updateLastModification();\n\n this._value = value;\n }\n\n /**\n */\n formatValue(value: string): string {\n return value;\n }\n\n /**\n * Getting the readonly value, iso value converted for human reading\n */\n get readonlyvalue(): string {\n return this.value ? this.value.toString() : \"\";\n }\n\n /**\n * Getting mandatory status of attribute\n */\n get mandatory(): boolean {\n return this._mandatory || false;\n }\n\n /**\n */\n get configuredMandatory(): ?boolean {\n return this.layouthint.has(MANDATORY) || this.contributions.mandatory;\n }\n\n /**\n * Set mandatory status of attribute\n */\n set mandatory(mandatory: boolean) {\n if (mandatory !== this._mandatory) {\n this._validatedValue = null;\n }\n this._mandatory = mandatory;\n }\n\n /**\n */\n get readonly(): boolean {\n return (\n this._readonly ||\n this.contributions.readonly === true ||\n this.data.static === true ||\n this.isResult === true\n );\n }\n\n /**\n */\n set readonly(readonly: boolean) {\n this._readonly = readonly;\n }\n\n /**\n */\n get disabled(): boolean {\n return this._disabled;\n }\n\n /**\n */\n set disabled(disabled: boolean) {\n this._disabled = disabled;\n }\n\n /**\n */\n get isResult(): boolean {\n return this._isResult;\n }\n\n /**\n */\n set isResult(isResult: boolean) {\n this._isResult = isResult;\n }\n\n /**\n * Getting the display and input format of a attribute\n */\n get format(): string | null {\n return this.getContribution(\"format\");\n }\n\n /**\n */\n get formatLabel(): string {\n return this.format || \"\";\n }\n\n /**\n * Get minimum string length\n */\n get minLength(): number | null {\n return this.getContribution(\"minLength\");\n }\n\n /**\n * Get maximum string length\n */\n get maxLength(): number | null {\n return this.getContribution(\"maxLength\");\n }\n\n /**\n */\n get operator(): string {\n return \"\";\n }\n\n /**\n * Get assistant message\n */\n get assistantMessage(): string | null {\n return this.getContribution(\"assistant\");\n }\n\n /**\n * Get valid status\n */\n get isValid(): boolean {\n return this.validate(this.validateValue);\n }\n\n /**\n * Retrieve applicable constraint for this attribute\n */\n get constraintCollection(): ConstraintCollection {\n const constraints = new ConstraintCollection();\n\n constraints.add(this._serverConstraints);\n\n // Mandatory constraint\n if (this.mandatory) {\n constraints.add(new MandatoryConstraint());\n }\n\n if (this.minLength || this.maxLength) {\n constraints.add(\n new StringLengthConstraint(this.minLength, this.maxLength)\n );\n }\n\n constraints.add(this.addConstraints());\n\n return constraints;\n }\n\n /**\n * Template method for class extending this model to add extra constraints\n * @abstract\n */\n addConstraints(): ConstraintCollection {\n return new ConstraintCollection();\n }\n\n /**\n * Used to programmatically overwrite the setting USE_CLIENTSIDE_VALIDATION\n */\n setUseClientsideValidation(enabled: boolean) {\n this._useClientsideValidation = enabled;\n }\n\n /**\n * Indicates if client side validation is enabled\n * @returns {boolean}\n */\n useClientsideValidation(): boolean {\n return this._useClientsideValidation ?? true;\n }\n\n /**\n * Validate input on client side constraint\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 !== value) {\n this._isValid = this.constraintCollection.validate(value);\n }\n this._validatedValue = value;\n\n return this._isValid;\n }\n\n /**\n * Indicates if attribute is optional and empty\n */\n isOptionalAndEmpty(value: string): boolean {\n if (value === undefined) {\n throw new IllegalArgumentException(\n \"isOptionalAndEmpty method needs value argument\"\n );\n }\n\n return !this.mandatory && value === \"\";\n }\n\n /**\n * Retrieve error messages of this attribute\n */\n get errorCollection(): ErrorCollection {\n const collection = new ErrorCollection(\"attribute\", this._errorCollection);\n\n collection.addConstraints(\n this.constraintCollection.invalidConstraints(this.validateValue)\n );\n\n return collection;\n }\n\n /**\n * Check if attribute is in error\n */\n inError(): boolean {\n return !this._isValid && this.isChangedSince(0);\n }\n\n /**\n * Reset static error messages on attribute\n */\n resetErrors() {\n this._errorCollection = new ErrorCollection(\"attribute\");\n }\n\n /**\n * Registers an error that was received from a server response\n */\n addServerError(error: FormErrorAnchor) {\n this._errorCollection.addServerError(\n error.id,\n error.message,\n error.properties,\n error.layouthint\n );\n }\n\n /**\n */\n removeServerError(id: string) {\n this._errorCollection.removeServerError(id);\n }\n\n /**\n */\n hasServerErrors(): boolean {\n return this.errorCollection.serverErrors.length > 0;\n }\n\n /**\n */\n hasErrors(): boolean {\n return this.errorCollection.hasItems;\n }\n\n /**\n * Registers a missing error that was received from the server\n */\n addMissingError() {\n this._errorCollection.addServerError(\"Constraint.Missing\");\n }\n\n /**\n */\n removeMissingError() {\n this.removeServerError(\"Constraint.Missing\");\n }\n\n /**\n */\n addServerConstraint(\n id: string,\n defaultMessage?: string,\n parameters?: MessageParameters\n ) {\n this._serverConstraints.addConstraint(\n id,\n null,\n defaultMessage,\n parameters,\n this.useClientsideValidation()\n );\n }\n\n /**\n */\n formatParameters(parameters: Object): { [string]: string | number } {\n if (parameters == null) {\n return {};\n }\n\n const params = {};\n\n Object.keys(parameters).forEach((paramKey: string) => {\n const paramValue = parameters[paramKey];\n if (paramKey.endsWith(\"-number\") || paramKey.endsWith(\"-date\")) {\n params[paramKey] = this.formatValue(paramValue);\n } else {\n params[paramKey] = paramValue;\n }\n });\n\n return params;\n }\n\n /**\n */\n get hasDynamicValidationData(): boolean {\n return true;\n }\n\n /**\n */\n updateValidations(errors: Array<Object>) {\n if (\n errors.some((error) => error.id === \"Constraint.Mandatory\") ||\n this.layouthint.has(MANDATORY)\n ) {\n this.mandatory = true;\n } else if (!this.hasValue()) {\n this.mandatory = false;\n }\n\n this._serverConstraints = new ConstraintCollection();\n this.resetErrors();\n\n errors\n .filter(\n (error) => error.id !== \"Constraint.Mandatory\" || !this.hasValue()\n )\n .forEach((error) => {\n if (this.hasValue()) {\n this._errorCollection.addServerError(\n error.id,\n error.message,\n this.formatParameters(error.properties),\n error.layouthint\n );\n } else {\n this.addServerConstraint(\n error.id,\n error.message,\n this.formatParameters(error.properties)\n );\n }\n });\n }\n\n /**\n * Set last modification to current timestamp\n */\n updateLastModification() {\n this._lastModification = Date.now();\n }\n\n /**\n * Inidicates if attribute is changed since a given timestamp (Date.now)\n */\n isChangedSince(timestamp: number): boolean {\n return this._lastModification > timestamp;\n }\n\n /**\n * Abstract reset method which should be implemented on each attribute that has this attribute as a base class.\n *\n * @abstract\n */\n reset() {\n throw new UnsupportedOperationException(\n `Reset method not implemented for ${this.type}`\n );\n }\n\n /**\n * Merge old attribute with the attribute from the server.\n * Readonly attributes always need to show the value from the server\n */\n mergeAttribute(oldAttribute: AttributeType) {\n this.concept = oldAttribute.concept;\n\n if (\n !oldAttribute.readonly &&\n oldAttribute.isValid &&\n oldAttribute.inputvalue !== null\n ) {\n this.update(oldAttribute.inputvalue);\n }\n }\n\n /**\n * Abstract update method which should be implemented on each attribute that has this attribute as a base class.\n * @abstract\n */\n // eslint-disable-next-line no-unused-vars\n update(value: string, changedAttribute?: AttributeType): AttributeType {\n throw new UnsupportedOperationException(\n `Update method not implemented for ${this.type}`\n );\n }\n\n /**\n * Indicate if attribute is editable\n */\n set isEditable(isEditable: boolean) {\n this._isEditable = isEditable;\n }\n\n /**\n * Retrieve if attribute is editable\n */\n get isEditable(): boolean {\n return this._isEditable;\n }\n\n /**\n * Indicates if the attribute is visible\n */\n get isVisible(): boolean {\n return !this._isHidden;\n }\n\n /**\n */\n get isHidden(): boolean {\n return this._isHidden;\n }\n\n /**\n */\n set isHidden(isHidden: boolean) {\n this._isHidden = isHidden;\n }\n\n /**\n * Explicitly toggle visibility of this attribute\n */\n show() {\n this.isHidden = false;\n }\n\n /**\n */\n hide() {\n this.isHidden = true;\n }\n\n /**\n */\n equals(otherAttribute: AttributeType): boolean {\n return (\n this.key === otherAttribute.key &&\n this.parentKey === otherAttribute.parentKey\n );\n }\n\n /**\n * Readonly attribute width indicates the proposed width of this attribute\n */\n get readonlyWidth(): $Keys<typeof ATTRIBUTE_WIDTH> {\n return ATTRIBUTE_WIDTH.MEDIUM;\n }\n\n /**\n */\n get layoutHintRules(): LayoutHintRuleCollection {\n return this._layoutHintRules;\n }\n\n /**\n */\n set layoutHintRules(rules: LayoutHintRuleCollection) {\n this._layoutHintRules = rules;\n }\n\n /**\n */\n processLayoutHintRules(attributes: AttributeCollection) {\n if (this._layoutHintRules) {\n this.layoutHintRules.process(this, attributes);\n }\n }\n\n /**\n * Indicates if content comes from the data service\n */\n get hasContentFromData(): boolean {\n return hasAllContentInData();\n }\n\n /**\n */\n get content(): AttributeContent {\n return new AttributeContent(this.data.content);\n }\n}\n"],"mappings":";;;;;;AACA,SAASA,QAAT,QAAyB,mCAAzB;AACA,SAASC,aAAT,QAA8B,6BAA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ACC,UAAD,EAAkC;IACtD,IAAI,KAAKH,gBAAT,EAA2B;MACzB,KAAKD,eAAL,CAAqBK,OAArB,CAA6B,IAA7B,EAAmCD,UAAnC;IACD;EACF;EAED;AACF;AACA;;;EACwB,IAAlB1K,kBAAkB,GAAY;IAChC,OAAOR,mBAAmB,EAA1B;EACD;EAED;AACF;;;EACa,IAAPS,OAAO,GAAqB;IAC9B,OAAO,IAAIN,gBAAJ,CAAqB,KAAKW,IAAL,CAAUL,OAA/B,CAAP;EACD;;AAh6BH"}
|
|
@@ -78,7 +78,7 @@ export default class ErrorResponse {
|
|
|
78
78
|
|
|
79
79
|
|
|
80
80
|
get responseMessage() {
|
|
81
|
-
return this.response.message ||
|
|
81
|
+
return this.response.message || null;
|
|
82
82
|
}
|
|
83
83
|
/**
|
|
84
84
|
* Return response error title
|
|
@@ -283,6 +283,13 @@ export default class ErrorResponse {
|
|
|
283
283
|
*/
|
|
284
284
|
|
|
285
285
|
|
|
286
|
+
get isInvalidCredentials() {
|
|
287
|
+
return this.id === "Error.Authentication.InvalidCredentials";
|
|
288
|
+
}
|
|
289
|
+
/**
|
|
290
|
+
*/
|
|
291
|
+
|
|
292
|
+
|
|
286
293
|
get isInvalidUsername() {
|
|
287
294
|
return this.id === "Error.Authentication.InvalidUsername";
|
|
288
295
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ErrorResponse.js","names":["Href","LayoutHintCollection","ErrorResponse","constructor","data","connectKey","_error","_connectKey","key","error","status","NO_RESPONSE_CODE","DECIMAL_RADIX","parseInt","id","isResourceNotFound","name","message","responseMessage","response","title","titleMessage","undefined","titleId","titleProperties","properties","redirect","redirectText","text","redirectTextID","redirectTextProperties","redirectMessage","redirectHref","href","layouthint","parameters","RESOURCE_NOT_FOUND_RESPONSE_CODE","isResourceNotFoundAfterReload","isReload","isUnauthorized","UNAUTHORIZED_RESPONSE_CODE","hasUnauthorizedStatus","hasUnauthorizedErrorId","hasLoginAction","action","isChangePassword","isConcurrentUser","isConcurrentError","isBlocked","isInvalidUsername","isTimeoutError","isRemoteServiceException","changePasswordHref","isBasicAuthentication","loginFailed","shouldThrowOnServer"],"sources":["../../../src/models/error/ErrorResponse.js"],"sourcesContent":["// @flow\nimport Href from \"../href/Href\";\n\nimport type { MessageParameters } from \"../../i18n/types\";\nimport LayoutHintCollection from \"../layouthint/LayoutHintCollection\";\n\n/**\n */\nexport type TitleObject = {\n +id: string,\n +properties?: Object,\n +message?: string,\n};\n/**\n */\nexport type RedirectTextObject = {\n +id: string,\n +properties?: Object,\n +message?: string,\n};\n\n/**\n */\nexport type RedirectObject = {\n +href: Href,\n +text?: RedirectTextObject,\n};\n\n/**\n * Error response model\n */\nexport default class ErrorResponse {\n _error: Object;\n _connectKey: ?string;\n\n /**\n * Construct ErrorResponse\n */\n constructor(data: Object, connectKey?: string) {\n this._error = data;\n this._connectKey = connectKey;\n }\n\n /**\n */\n set connectKey(key: string) {\n this._connectKey = key;\n }\n\n /**\n */\n get connectKey(): ?string {\n return this._connectKey;\n }\n\n /**\n * Return error information\n */\n get error(): Object {\n return this._error ?? {};\n }\n\n /**\n * Get request status code\n */\n get status(): number {\n const NO_RESPONSE_CODE = 0;\n const DECIMAL_RADIX = 10;\n return this.error.status\n ? parseInt(this.error.status, DECIMAL_RADIX)\n : NO_RESPONSE_CODE;\n }\n\n /**\n * Return error type information\n */\n get id(): string {\n if (this.isResourceNotFound && this.error.id !== \"Error.NotAuthorized\") {\n return \"Error.ResourceNotFound\";\n }\n\n return this.error.id || this.error.name || \"Error.GeneralError\";\n }\n\n /**\n */\n get message(): string {\n return this.error.message || this.id;\n }\n\n /**\n * Return response error message\n */\n get responseMessage(): string {\n return this.response.message || this.id;\n }\n\n /**\n * Return response error title\n */\n get title(): TitleObject {\n return this.response.title || null;\n }\n\n /**\n * Return response error title message\n */\n get titleMessage(): string {\n return this.response.title?.message || undefined;\n }\n\n /**\n * Return response error title Id\n */\n get titleId(): string {\n return this.response.title?.id || undefined;\n }\n\n /**\n * Return response error title properties\n */\n get titleProperties(): Object {\n return this.response.title?.properties || null;\n }\n\n /**\n * Return response error redirect\n */\n get redirect(): RedirectObject {\n return this.response.redirect || null;\n }\n /**\n * Return response error redirect text\n */\n get redirectText(): RedirectTextObject {\n return this.response?.redirect?.text || null;\n }\n\n /**\n * Return response error redirect text id\n */\n get redirectTextID(): string {\n return this.response.redirect?.text?.id || undefined;\n }\n\n /**\n * Return response error redirect text properties\n */\n get redirectTextProperties(): Object {\n return this.response.redirect?.text?.properties || null;\n }\n\n /**\n * Return response error redirect text message\n */\n get redirectMessage(): string {\n return this.response.redirect?.text?.message || undefined;\n }\n\n /**\n * Return response error redirect href\n */\n get redirectHref(): Href {\n if (this.response.redirect?.href) {\n return new Href(this.response.redirect?.href);\n }\n return new Href();\n }\n\n /**\n * Return error response layouthint\n */\n get layouthint(): LayoutHintCollection {\n return new LayoutHintCollection(this.response?.layouthint);\n }\n\n /**\n */\n get response(): Object {\n return this.error?.response?.error || {};\n }\n\n /**\n */\n get properties(): Object {\n const { properties } = this.error;\n if (properties != null && typeof properties == \"object\") {\n return properties;\n }\n\n return {};\n }\n\n /**\n * Return error parameters\n */\n get parameters(): ?MessageParameters {\n return this.error.parameters || null;\n }\n\n /**\n */\n get isResourceNotFound(): boolean {\n const RESOURCE_NOT_FOUND_RESPONSE_CODE = 404;\n\n return this.status === RESOURCE_NOT_FOUND_RESPONSE_CODE;\n }\n\n /**\n */\n get isResourceNotFoundAfterReload(): boolean {\n return this.isResourceNotFound && this.error.isReload;\n }\n\n /**\n * Check if the error message is an authorization error\n */\n get isUnauthorized(): boolean {\n const UNAUTHORIZED_RESPONSE_CODE = 401;\n\n const hasUnauthorizedStatus = this.status === UNAUTHORIZED_RESPONSE_CODE;\n const hasUnauthorizedErrorId =\n this.id === \"Error.NotAuthorized\" ||\n this.id === \"Error.Authentication.Required\" ||\n this.id === \"Error.Authentication.InvalidUsername\" ||\n this.id === \"Error.Authentication.InvalidCredentials\";\n\n const hasLoginAction = this.error.action\n ? this.error.action.name === \"login\"\n : false;\n\n return hasUnauthorizedStatus || hasUnauthorizedErrorId || hasLoginAction;\n }\n\n /**\n */\n get isChangePassword(): boolean {\n return this.id === \"Error.ChangePasswordRequired\";\n }\n\n /**\n */\n get isConcurrentUser(): boolean {\n return this.id === \"Error.Authentication.ConcurrentUser\";\n }\n\n /**\n */\n get isConcurrentError(): boolean {\n return (\n this.id === \"Error.Case.ConcurrentModification\" ||\n this.id === \"Error.DataStore.ConcurrentModification\" ||\n this.id === \"Error.DataStore.RecordAlreadyExists\" ||\n this.id === \"Error.DataStore.RowCannotBeLocked\"\n );\n }\n\n /**\n */\n get isBlocked(): boolean {\n return this.id === \"Error.Authentication.BlockedUser\";\n }\n\n /**\n */\n get isInvalidUsername(): boolean {\n return this.id === \"Error.Authentication.InvalidUsername\";\n }\n\n /**\n */\n get isTimeoutError(): boolean {\n return this.id === \"Error.CodemapLookup.InvalidToken\";\n }\n\n /**\n * A RemoteServiceException occurs when an exception occurs connecting to an external system,\n * for example when using the service list panels\n */\n get isRemoteServiceException(): boolean {\n return this.id === \"Error.RemoteServiceException\";\n }\n\n /**\n * Get response url\n */\n get changePasswordHref(): ?Href {\n return this.properties.redirect ? new Href(this.properties.redirect) : null;\n }\n\n /**\n * When no action information is present in the unauthorized response, for now we assume it is Basic Authentication\n */\n get isBasicAuthentication(): boolean {\n const UNAUTHORIZED_RESPONSE_CODE = 401;\n return (\n this.isUnauthorized &&\n this.status === UNAUTHORIZED_RESPONSE_CODE &&\n this.response.error === \"No responseText\"\n );\n }\n\n /**\n * Retrieve a failed login attempt\n */\n get loginFailed(): boolean {\n return (\n this.id === \"Error.Authentication.Required\" ||\n this.id === \"Error.Authentication.InvalidCredentials\"\n );\n }\n\n /**\n */\n get shouldThrowOnServer(): boolean {\n return !this.isChangePassword && !this.isBlocked && !this.isConcurrentUser;\n }\n}\n"],"mappings":";AACA,OAAOA,IAAP,MAAiB,cAAjB;AAGA,OAAOC,oBAA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,KAAd,KAAwB,iBAH1B;EAKD;EAED;AACF;AACA;;;EACiB,IAAX6C,WAAW,GAAY;IACzB,OACE,KAAKxC,EAAL,KAAY,+BAAZ,IACA,KAAKA,EAAL,KAAY,yCAFd;EAID;EAED;AACF;;;EACyB,IAAnByC,mBAAmB,GAAY;IACjC,OAAO,CAAC,KAAKV,gBAAN,IAA0B,CAAC,KAAKG,SAAhC,IAA6C,CAAC,KAAKF,gBAA1D;EACD;;AA7RgC"}
|
|
1
|
+
{"version":3,"file":"ErrorResponse.js","names":["Href","LayoutHintCollection","ErrorResponse","constructor","data","connectKey","_error","_connectKey","key","error","status","NO_RESPONSE_CODE","DECIMAL_RADIX","parseInt","id","isResourceNotFound","name","message","responseMessage","response","title","titleMessage","undefined","titleId","titleProperties","properties","redirect","redirectText","text","redirectTextID","redirectTextProperties","redirectMessage","redirectHref","href","layouthint","parameters","RESOURCE_NOT_FOUND_RESPONSE_CODE","isResourceNotFoundAfterReload","isReload","isUnauthorized","UNAUTHORIZED_RESPONSE_CODE","hasUnauthorizedStatus","hasUnauthorizedErrorId","hasLoginAction","action","isChangePassword","isConcurrentUser","isConcurrentError","isBlocked","isInvalidCredentials","isInvalidUsername","isTimeoutError","isRemoteServiceException","changePasswordHref","isBasicAuthentication","loginFailed","shouldThrowOnServer"],"sources":["../../../src/models/error/ErrorResponse.js"],"sourcesContent":["// @flow\nimport Href from \"../href/Href\";\n\nimport type { MessageParameters } from \"../../i18n/types\";\nimport LayoutHintCollection from \"../layouthint/LayoutHintCollection\";\n\n/**\n */\nexport type TitleObject = {\n +id: string,\n +properties?: Object,\n +message?: string,\n};\n/**\n */\nexport type RedirectTextObject = {\n +id: string,\n +properties?: Object,\n +message?: string,\n};\n\n/**\n */\nexport type RedirectObject = {\n +href: Href,\n +text?: RedirectTextObject,\n};\n\n/**\n * Error response model\n */\nexport default class ErrorResponse {\n _error: Object;\n _connectKey: ?string;\n\n /**\n * Construct ErrorResponse\n */\n constructor(data: Object, connectKey?: string) {\n this._error = data;\n this._connectKey = connectKey;\n }\n\n /**\n */\n set connectKey(key: string) {\n this._connectKey = key;\n }\n\n /**\n */\n get connectKey(): ?string {\n return this._connectKey;\n }\n\n /**\n * Return error information\n */\n get error(): Object {\n return this._error ?? {};\n }\n\n /**\n * Get request status code\n */\n get status(): number {\n const NO_RESPONSE_CODE = 0;\n const DECIMAL_RADIX = 10;\n return this.error.status\n ? parseInt(this.error.status, DECIMAL_RADIX)\n : NO_RESPONSE_CODE;\n }\n\n /**\n * Return error type information\n */\n get id(): string {\n if (this.isResourceNotFound && this.error.id !== \"Error.NotAuthorized\") {\n return \"Error.ResourceNotFound\";\n }\n\n return this.error.id || this.error.name || \"Error.GeneralError\";\n }\n\n /**\n */\n get message(): string {\n return this.error.message || this.id;\n }\n\n /**\n * Return response error message\n */\n get responseMessage(): string {\n return this.response.message || null;\n }\n\n /**\n * Return response error title\n */\n get title(): TitleObject {\n return this.response.title || null;\n }\n\n /**\n * Return response error title message\n */\n get titleMessage(): string {\n return this.response.title?.message || undefined;\n }\n\n /**\n * Return response error title Id\n */\n get titleId(): string {\n return this.response.title?.id || undefined;\n }\n\n /**\n * Return response error title properties\n */\n get titleProperties(): Object {\n return this.response.title?.properties || null;\n }\n\n /**\n * Return response error redirect\n */\n get redirect(): RedirectObject {\n return this.response.redirect || null;\n }\n /**\n * Return response error redirect text\n */\n get redirectText(): RedirectTextObject {\n return this.response?.redirect?.text || null;\n }\n\n /**\n * Return response error redirect text id\n */\n get redirectTextID(): string {\n return this.response.redirect?.text?.id || undefined;\n }\n\n /**\n * Return response error redirect text properties\n */\n get redirectTextProperties(): Object {\n return this.response.redirect?.text?.properties || null;\n }\n\n /**\n * Return response error redirect text message\n */\n get redirectMessage(): string {\n return this.response.redirect?.text?.message || undefined;\n }\n\n /**\n * Return response error redirect href\n */\n get redirectHref(): Href {\n if (this.response.redirect?.href) {\n return new Href(this.response.redirect?.href);\n }\n return new Href();\n }\n\n /**\n * Return error response layouthint\n */\n get layouthint(): LayoutHintCollection {\n return new LayoutHintCollection(this.response?.layouthint);\n }\n\n /**\n */\n get response(): Object {\n return this.error?.response?.error || {};\n }\n\n /**\n */\n get properties(): Object {\n const { properties } = this.error;\n if (properties != null && typeof properties == \"object\") {\n return properties;\n }\n\n return {};\n }\n\n /**\n * Return error parameters\n */\n get parameters(): ?MessageParameters {\n return this.error.parameters || null;\n }\n\n /**\n */\n get isResourceNotFound(): boolean {\n const RESOURCE_NOT_FOUND_RESPONSE_CODE = 404;\n\n return this.status === RESOURCE_NOT_FOUND_RESPONSE_CODE;\n }\n\n /**\n */\n get isResourceNotFoundAfterReload(): boolean {\n return this.isResourceNotFound && this.error.isReload;\n }\n\n /**\n * Check if the error message is an authorization error\n */\n get isUnauthorized(): boolean {\n const UNAUTHORIZED_RESPONSE_CODE = 401;\n\n const hasUnauthorizedStatus = this.status === UNAUTHORIZED_RESPONSE_CODE;\n const hasUnauthorizedErrorId =\n this.id === \"Error.NotAuthorized\" ||\n this.id === \"Error.Authentication.Required\" ||\n this.id === \"Error.Authentication.InvalidUsername\" ||\n this.id === \"Error.Authentication.InvalidCredentials\";\n\n const hasLoginAction = this.error.action\n ? this.error.action.name === \"login\"\n : false;\n\n return hasUnauthorizedStatus || hasUnauthorizedErrorId || hasLoginAction;\n }\n\n /**\n */\n get isChangePassword(): boolean {\n return this.id === \"Error.ChangePasswordRequired\";\n }\n\n /**\n */\n get isConcurrentUser(): boolean {\n return this.id === \"Error.Authentication.ConcurrentUser\";\n }\n\n /**\n */\n get isConcurrentError(): boolean {\n return (\n this.id === \"Error.Case.ConcurrentModification\" ||\n this.id === \"Error.DataStore.ConcurrentModification\" ||\n this.id === \"Error.DataStore.RecordAlreadyExists\" ||\n this.id === \"Error.DataStore.RowCannotBeLocked\"\n );\n }\n\n /**\n */\n get isBlocked(): boolean {\n return this.id === \"Error.Authentication.BlockedUser\";\n }\n\n /**\n */\n get isInvalidCredentials(): boolean {\n return this.id === \"Error.Authentication.InvalidCredentials\";\n }\n\n /**\n */\n get isInvalidUsername(): boolean {\n return this.id === \"Error.Authentication.InvalidUsername\";\n }\n\n /**\n */\n get isTimeoutError(): boolean {\n return this.id === \"Error.CodemapLookup.InvalidToken\";\n }\n\n /**\n * A RemoteServiceException occurs when an exception occurs connecting to an external system,\n * for example when using the service list panels\n */\n get isRemoteServiceException(): boolean {\n return this.id === \"Error.RemoteServiceException\";\n }\n\n /**\n * Get response url\n */\n get changePasswordHref(): ?Href {\n return this.properties.redirect ? new Href(this.properties.redirect) : null;\n }\n\n /**\n * When no action information is present in the unauthorized response, for now we assume it is Basic Authentication\n */\n get isBasicAuthentication(): boolean {\n const UNAUTHORIZED_RESPONSE_CODE = 401;\n return (\n this.isUnauthorized &&\n this.status === UNAUTHORIZED_RESPONSE_CODE &&\n this.response.error === \"No responseText\"\n );\n }\n\n /**\n * Retrieve a failed login attempt\n */\n get loginFailed(): boolean {\n return (\n this.id === \"Error.Authentication.Required\" ||\n this.id === \"Error.Authentication.InvalidCredentials\"\n );\n }\n\n /**\n */\n get shouldThrowOnServer(): boolean {\n return !this.isChangePassword && !this.isBlocked && !this.isConcurrentUser;\n }\n}\n"],"mappings":";AACA,OAAOA,IAAP,MAAiB,cAAjB;AAGA,OAAOC,oBAAP,MAAiC,oCAAjC;AAEA;AACA;;AAqBA;AACA;AACA;AACA,eAAe,MAAMC,aAAN,CAAoB;EAIjC;AACF;AACA;EACEC,WAAW,CAACC,IAAD,EAAeC,UAAf,EAAoC;IAAA;;IAAA;;IAC7C,KAAKC,MAAL,GAAcF,IAAd;IACA,KAAKG,WAAL,GAAmBF,UAAnB;EACD;EAED;AACF;;;EACgB,IAAVA,UAAU,CAACG,GAAD,EAAc;IAC1B,KAAKD,WAAL,GAAmBC,GAAnB;EACD;EAED;AACF;;;EACgB,IAAVH,UAAU,GAAY;IACxB,OAAO,KAAKE,WAAZ;EACD;EAED;AACF;AACA;;;EACW,IAALE,KAAK,GAAW;IAAA;;IAClB,uBAAO,KAAKH,MAAZ,uD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(errors) {
|
|
1017
1017
|
_filterInstanceProperty(errors).call(errors, error => !error.anchor).forEach(error => {
|
|
1018
|
-
this.errorCollection.addServerError(error.id, error.message, error.properties);
|
|
1018
|
+
this.errorCollection.addServerError(error.id, error.message, error.properties, error.layouthint);
|
|
1019
1019
|
});
|
|
1020
1020
|
}
|
|
1021
1021
|
/**
|