@beinformed/ui 1.65.24 → 1.65.26
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 +18 -0
- package/esm/builder/mergeLayoutHintConfigurations.js +7 -5
- package/esm/builder/mergeLayoutHintConfigurations.js.flow +12 -5
- package/esm/builder/mergeLayoutHintConfigurations.js.map +1 -1
- package/esm/constants/Settings.js +4 -1
- package/esm/constants/Settings.js.flow +3 -3
- package/esm/constants/Settings.js.map +1 -1
- package/esm/hooks/useAuthentication.js +7 -3
- package/esm/hooks/useAuthentication.js.flow +6 -3
- package/esm/hooks/useAuthentication.js.map +1 -1
- package/esm/hooks/useModelCatalog.js +1 -1
- package/esm/hooks/useModelCatalog.js.flow +1 -1
- package/esm/hooks/useModelCatalog.js.map +1 -1
- package/esm/i18n/Locale.js +7 -1
- package/esm/i18n/Locale.js.flow +4 -2
- package/esm/i18n/Locale.js.map +1 -1
- package/esm/models/actions/ActionCollection.js +1 -1
- package/esm/models/actions/ActionCollection.js.flow +3 -3
- package/esm/models/actions/ActionCollection.js.map +1 -1
- package/esm/models/application/ApplicationModel.js +6 -1
- package/esm/models/application/ApplicationModel.js.flow +7 -2
- package/esm/models/application/ApplicationModel.js.map +1 -1
- package/esm/models/attributes/ChoiceAttributeModel.js +3 -5
- package/esm/models/attributes/ChoiceAttributeModel.js.flow +3 -5
- package/esm/models/attributes/ChoiceAttributeModel.js.map +1 -1
- package/esm/models/attributes/CompositeAttributeModel.js +1 -1
- package/esm/models/attributes/CompositeAttributeModel.js.flow +1 -1
- package/esm/models/attributes/CompositeAttributeModel.js.map +1 -1
- package/esm/models/attributes/NumberAttributeModel.js +3 -1
- package/esm/models/attributes/NumberAttributeModel.js.flow +2 -1
- package/esm/models/attributes/NumberAttributeModel.js.map +1 -1
- package/esm/models/attributes/StringAttributeModel.js +9 -4
- package/esm/models/attributes/StringAttributeModel.js.flow +7 -4
- package/esm/models/attributes/StringAttributeModel.js.map +1 -1
- package/esm/models/attributes/input-constraints/DatetimeFormatConstraint.js +1 -1
- package/esm/models/attributes/input-constraints/DatetimeFormatConstraint.js.flow +1 -1
- package/esm/models/attributes/input-constraints/DatetimeFormatConstraint.js.map +1 -1
- package/esm/models/base/BaseModel.js +8 -5
- package/esm/models/base/BaseModel.js.flow +8 -5
- package/esm/models/base/BaseModel.js.map +1 -1
- package/esm/models/base/ResourceModel.js +6 -7
- package/esm/models/base/ResourceModel.js.flow +4 -4
- package/esm/models/base/ResourceModel.js.map +1 -1
- package/esm/models/concepts/ConceptDetailModel.js +16 -16
- package/esm/models/concepts/ConceptDetailModel.js.flow +16 -19
- package/esm/models/concepts/ConceptDetailModel.js.map +1 -1
- package/esm/models/concepts/SourceReferenceCollection.js +1 -1
- package/esm/models/concepts/SourceReferenceCollection.js.flow +1 -2
- package/esm/models/concepts/SourceReferenceCollection.js.map +1 -1
- package/esm/models/content/ContentLinkModel.js +6 -6
- package/esm/models/content/ContentLinkModel.js.flow +6 -6
- package/esm/models/content/ContentLinkModel.js.map +1 -1
- package/esm/models/filters/BaseFilterModel.js +3 -5
- package/esm/models/filters/BaseFilterModel.js.flow +4 -5
- package/esm/models/filters/BaseFilterModel.js.map +1 -1
- package/esm/models/filters/StringFilterModel.js +4 -2
- package/esm/models/filters/StringFilterModel.js.flow +3 -2
- package/esm/models/filters/StringFilterModel.js.map +1 -1
- package/esm/models/form/FormModel.js +1 -1
- package/esm/models/form/FormModel.js.flow +1 -2
- package/esm/models/form/FormModel.js.map +1 -1
- package/esm/models/form/FormObjectModel.js +1 -1
- package/esm/models/form/FormObjectModel.js.flow +2 -3
- package/esm/models/form/FormObjectModel.js.map +1 -1
- package/esm/models/href/Href.js +2 -2
- package/esm/models/href/Href.js.flow +2 -2
- package/esm/models/href/Href.js.map +1 -1
- package/esm/models/index.js +2 -2
- package/esm/models/index.js.flow +1 -2
- package/esm/models/index.js.map +1 -1
- package/esm/models/links/normalizeLinkJSON.js +1 -1
- package/esm/models/links/normalizeLinkJSON.js.flow +1 -1
- package/esm/models/links/normalizeLinkJSON.js.map +1 -1
- package/esm/modularui/Authenticate.js +7 -2
- package/esm/modularui/Authenticate.js.flow +4 -2
- package/esm/modularui/Authenticate.js.map +1 -1
- package/esm/modularui/ModularUIRequest.js +2 -5
- package/esm/modularui/ModularUIRequest.js.flow +2 -6
- package/esm/modularui/ModularUIRequest.js.map +1 -1
- package/esm/modularui/UploadRequest.js +3 -1
- package/esm/modularui/UploadRequest.js.flow +3 -1
- package/esm/modularui/UploadRequest.js.map +1 -1
- package/esm/react-client/client.js +22 -10
- package/esm/react-client/client.js.flow +17 -11
- package/esm/react-client/client.js.map +1 -1
- package/esm/react-client/contextPath.js +3 -1
- package/esm/react-client/contextPath.js.flow +2 -1
- package/esm/react-client/contextPath.js.map +1 -1
- package/esm/redux/_i18n/I18nReducer.js +1 -4
- package/esm/redux/_i18n/I18nReducer.js.flow +1 -4
- package/esm/redux/_i18n/I18nReducer.js.map +1 -1
- package/esm/redux/_modularui/ModularUIActions.js +1 -4
- package/esm/redux/_modularui/ModularUIActions.js.flow +1 -5
- package/esm/redux/_modularui/ModularUIActions.js.map +1 -1
- package/esm/redux/_modularui/ModularUIConnector.js +3 -4
- package/esm/redux/_modularui/ModularUIConnector.js.flow +2 -1
- package/esm/redux/_modularui/ModularUIConnector.js.map +1 -1
- package/esm/redux/_modularui/ModularUIReducer.js +6 -3
- package/esm/redux/_modularui/ModularUIReducer.js.flow +2 -2
- package/esm/redux/_modularui/ModularUIReducer.js.map +1 -1
- package/esm/redux/actions/Authorization.js +4 -2
- package/esm/redux/actions/Authorization.js.flow +3 -2
- package/esm/redux/actions/Authorization.js.map +1 -1
- package/esm/redux/actions/Preferences.js +4 -4
- package/esm/redux/actions/Preferences.js.flow +6 -10
- package/esm/redux/actions/Preferences.js.map +1 -1
- package/esm/redux/reducers/ModelCatalogReducer.js +7 -9
- package/esm/redux/reducers/ModelCatalogReducer.js.flow +8 -9
- package/esm/redux/reducers/ModelCatalogReducer.js.map +1 -1
- package/esm/redux/store/configureStore.js +6 -1
- package/esm/redux/store/configureStore.js.flow +4 -1
- package/esm/redux/store/configureStore.js.map +1 -1
- package/esm/redux/types.js.flow +10 -1
- package/esm/redux/types.js.map +1 -1
- package/esm/utils/browser/Cache.js +3 -1
- package/esm/utils/browser/Cache.js.flow +2 -1
- package/esm/utils/browser/Cache.js.map +1 -1
- package/esm/utils/browser/__tests__/Cookies.spec.js.flow +2 -1
- package/esm/utils/datetime/DateTimeUtil.js +6 -5
- package/esm/utils/datetime/DateTimeUtil.js.flow +5 -11
- package/esm/utils/datetime/DateTimeUtil.js.map +1 -1
- package/esm/utils/datetime/__tests__/DateTimeFormat.spec.js.flow +0 -6
- package/esm/utils/fetch/universalFetch.js +7 -8
- package/esm/utils/fetch/universalFetch.js.flow +13 -14
- package/esm/utils/fetch/universalFetch.js.map +1 -1
- package/esm/utils/fetch/xhr.js +2 -5
- package/esm/utils/fetch/xhr.js.flow +2 -6
- package/esm/utils/fetch/xhr.js.map +1 -1
- package/esm/utils/helpers/createHref.js +4 -1
- package/esm/utils/helpers/createHref.js.flow +2 -1
- package/esm/utils/helpers/createHref.js.map +1 -1
- package/esm/utils/helpers/createUUID.js +2 -1
- package/esm/utils/helpers/createUUID.js.flow +1 -1
- package/esm/utils/helpers/createUUID.js.map +1 -1
- package/esm/utils/number/parseNumbers.js +6 -3
- package/esm/utils/number/parseNumbers.js.flow +4 -3
- package/esm/utils/number/parseNumbers.js.map +1 -1
- package/lib/builder/mergeLayoutHintConfigurations.js +7 -5
- package/lib/builder/mergeLayoutHintConfigurations.js.map +1 -1
- package/lib/constants/Settings.js +4 -1
- package/lib/constants/Settings.js.map +1 -1
- package/lib/hooks/useAuthentication.js +7 -3
- package/lib/hooks/useAuthentication.js.map +1 -1
- package/lib/hooks/useModelCatalog.js +1 -1
- package/lib/hooks/useModelCatalog.js.map +1 -1
- package/lib/i18n/Locale.js +7 -1
- package/lib/i18n/Locale.js.map +1 -1
- package/lib/models/actions/ActionCollection.js +1 -1
- package/lib/models/actions/ActionCollection.js.map +1 -1
- package/lib/models/application/ApplicationModel.js +6 -1
- package/lib/models/application/ApplicationModel.js.map +1 -1
- package/lib/models/attributes/ChoiceAttributeModel.js +3 -5
- package/lib/models/attributes/ChoiceAttributeModel.js.map +1 -1
- package/lib/models/attributes/CompositeAttributeModel.js +1 -1
- package/lib/models/attributes/CompositeAttributeModel.js.map +1 -1
- package/lib/models/attributes/NumberAttributeModel.js +3 -1
- package/lib/models/attributes/NumberAttributeModel.js.map +1 -1
- package/lib/models/attributes/StringAttributeModel.js +9 -4
- package/lib/models/attributes/StringAttributeModel.js.map +1 -1
- package/lib/models/attributes/input-constraints/DatetimeFormatConstraint.js +1 -1
- package/lib/models/attributes/input-constraints/DatetimeFormatConstraint.js.map +1 -1
- package/lib/models/base/BaseModel.js +8 -5
- package/lib/models/base/BaseModel.js.map +1 -1
- package/lib/models/base/ResourceModel.js +6 -7
- package/lib/models/base/ResourceModel.js.map +1 -1
- package/lib/models/concepts/ConceptDetailModel.js +16 -16
- package/lib/models/concepts/ConceptDetailModel.js.map +1 -1
- package/lib/models/concepts/SourceReferenceCollection.js +1 -1
- package/lib/models/concepts/SourceReferenceCollection.js.map +1 -1
- package/lib/models/content/ContentLinkModel.js +6 -6
- package/lib/models/content/ContentLinkModel.js.map +1 -1
- package/lib/models/filters/BaseFilterModel.js +3 -5
- package/lib/models/filters/BaseFilterModel.js.map +1 -1
- package/lib/models/filters/StringFilterModel.js +4 -2
- package/lib/models/filters/StringFilterModel.js.map +1 -1
- package/lib/models/form/FormModel.js +1 -1
- package/lib/models/form/FormModel.js.map +1 -1
- package/lib/models/form/FormObjectModel.js +1 -1
- package/lib/models/form/FormObjectModel.js.map +1 -1
- package/lib/models/href/Href.js +2 -2
- package/lib/models/href/Href.js.map +1 -1
- package/lib/models/index.js.map +1 -1
- package/lib/models/links/normalizeLinkJSON.js +1 -1
- package/lib/models/links/normalizeLinkJSON.js.map +1 -1
- package/lib/modularui/Authenticate.js +7 -2
- package/lib/modularui/Authenticate.js.map +1 -1
- package/lib/modularui/ModularUIRequest.js +2 -5
- package/lib/modularui/ModularUIRequest.js.map +1 -1
- package/lib/modularui/UploadRequest.js +3 -1
- package/lib/modularui/UploadRequest.js.map +1 -1
- package/lib/react-client/client.js +22 -10
- package/lib/react-client/client.js.map +1 -1
- package/lib/react-client/contextPath.js +4 -1
- package/lib/react-client/contextPath.js.map +1 -1
- package/lib/redux/_i18n/I18nReducer.js +1 -4
- package/lib/redux/_i18n/I18nReducer.js.map +1 -1
- package/lib/redux/_modularui/ModularUIActions.js +1 -4
- package/lib/redux/_modularui/ModularUIActions.js.map +1 -1
- package/lib/redux/_modularui/ModularUIConnector.js +3 -4
- package/lib/redux/_modularui/ModularUIConnector.js.map +1 -1
- package/lib/redux/_modularui/ModularUIReducer.js +6 -3
- package/lib/redux/_modularui/ModularUIReducer.js.map +1 -1
- package/lib/redux/actions/Authorization.js +4 -2
- package/lib/redux/actions/Authorization.js.map +1 -1
- package/lib/redux/actions/Preferences.js +4 -4
- package/lib/redux/actions/Preferences.js.map +1 -1
- package/lib/redux/reducers/ModelCatalogReducer.js +7 -9
- package/lib/redux/reducers/ModelCatalogReducer.js.map +1 -1
- package/lib/redux/store/configureStore.js +6 -1
- package/lib/redux/store/configureStore.js.map +1 -1
- package/lib/redux/types.js.map +1 -1
- package/lib/utils/browser/Cache.js +3 -1
- package/lib/utils/browser/Cache.js.map +1 -1
- package/lib/utils/datetime/DateTimeUtil.js +6 -5
- package/lib/utils/datetime/DateTimeUtil.js.map +1 -1
- package/lib/utils/fetch/universalFetch.js +7 -8
- package/lib/utils/fetch/universalFetch.js.map +1 -1
- package/lib/utils/fetch/xhr.js +2 -5
- package/lib/utils/fetch/xhr.js.map +1 -1
- package/lib/utils/helpers/createHref.js +4 -1
- package/lib/utils/helpers/createHref.js.map +1 -1
- package/lib/utils/helpers/createUUID.js +3 -1
- package/lib/utils/helpers/createUUID.js.map +1 -1
- package/lib/utils/number/parseNumbers.js +6 -3
- package/lib/utils/number/parseNumbers.js.map +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FormObjectModel.js","names":["has","BaseModel","AttributeCollection","CompositeAttributeModel","ContentConfiguration","ErrorCollection","IllegalArgumentException","LayoutHintCollection","FormObjectModel","constructor","object","objectContributions","modelOptions","_defineProperty","getElements","length","_attributeCollection","getApplicableAttributeContributions","isReadonly","_contentConfiguration","content","_errorCollection","data","attributeCollection","setReferenceDate","getData","indicateContentConfiguration","contentConfiguration","createEmpty","formObjectModel","contributions","equals","withRepeatIndex","_context","key","objectContainsOneOfTheAttributes","_filterInstanceProperty","all","call","attribute","isResult","some","hasAttributeByKey","hasSameRepeatIndex","repeatIndex","getAttributeByAttribute","getAttributeByKey","elements","push","results","_context2","dataResults","_mapInstanceProperty","result","elementid","_context3","dataElementIds","element","getAttributesInData","attributes","isDynamic","attributeKey","_Object$keys","mandatory","attributesContributions","attributeContributions","dataElementId","split","getInitialChildModelLinks","setChildModels","models","errors","objectid","hasEndResultConfiguration","getContribution","hasDynamicValidations","isRepeatable","_repeatIndex","index","maxRepeats","hasFixedNrOfRepeats","isRepeatWithUnknownTotal","isLastRepeat","last","repeatIndexLabel","label","introText","text","message","assistent","buttonLabels","mergeObject","oldObject","forEach","mergeWithAttribute","mergeAttribute","updateAttribute","value","attributeToUpdate","Error","name","update","isChangedSince","timestamp","_context4","_findInstanceProperty","resetErrors","errorCollection","addServerError","error","anchor","id","properties","layouthint","hasServerErrors","hasItems","hasErrors","isValid","visible","every","dynamicValidationsLoaded","_dynamicValidationsLoaded","handleErrorValidations","attributeErrors","updateValidations","handleMissingValidations","missing","anchors","Array","isArray","formdata","getFormData","validationData"],"sources":["../../../src/models/form/FormObjectModel.js"],"sourcesContent":["// @flow\nimport { has } from \"../../utils/helpers/objects\";\n\nimport BaseModel from \"../base/BaseModel\";\nimport AttributeCollection from \"../attributes/AttributeCollection\";\nimport CompositeAttributeModel from \"../attributes/CompositeAttributeModel\";\nimport ContentConfiguration from \"../contentconfiguration/ContentConfiguration\";\nimport ErrorCollection from \"../error/ErrorCollection\";\nimport { IllegalArgumentException } from \"../../exceptions\";\n\nimport type {\n AttributeType,\n ModularUIModel,\n FormErrorAnchor,\n ModelOptions,\n} from \"../types\";\n\nimport LayoutHintCollection from \"../layouthint/LayoutHintCollection\";\n\nimport type LinkModel from \"../links/LinkModel\";\nimport type ErrorResponse from \"../error/ErrorResponse\";\nimport type { MessageParameters } from \"../../i18n\";\n\ntype ErrorObject = {\n anchor: {\n objectid: string,\n elementid?: string,\n },\n id: string,\n message: string,\n properties: MessageParameters,\n layouthint: Array<string>,\n};\n\n/**\n * Form Object\n */\nexport default class FormObjectModel extends BaseModel {\n _attributeCollection: AttributeCollection;\n _contentConfiguration: ContentConfiguration;\n _errorCollection: ErrorCollection;\n _repeatIndex: number;\n _dynamicValidationsLoaded: boolean;\n\n /**\n * Construct FormObjectModel\n */\n constructor(\n object: Object,\n objectContributions: Object,\n modelOptions?: ModelOptions,\n ) {\n super(object, objectContributions, modelOptions);\n\n if (object && this.getElements().length > 0) {\n this._attributeCollection = new AttributeCollection(\n this.getElements(),\n this.getApplicableAttributeContributions(),\n { ...modelOptions, isReadonly: false },\n );\n } else {\n this._attributeCollection = new AttributeCollection();\n }\n\n this._contentConfiguration = new ContentConfiguration(\n objectContributions ? objectContributions.content : {},\n );\n\n this._errorCollection = new ErrorCollection(\"formobject\");\n\n if (has(this.data, \"referenceDate\")) {\n this.attributeCollection.setReferenceDate(this.getData(\"referenceDate\"));\n }\n\n this.attributeCollection.indicateContentConfiguration(\n this.contentConfiguration,\n );\n }\n\n /**\n */\n static createEmpty(formObjectModel: FormObjectModel): FormObjectModel {\n if (!formObjectModel) {\n throw new IllegalArgumentException(\n \"createEmpty method needs a FormObjectModel as input argument to create a new version of the object\",\n );\n }\n return new FormObjectModel(\n formObjectModel.data,\n formObjectModel.contributions,\n formObjectModel.modelOptions,\n );\n }\n\n /**\n */\n equals(object: ?FormObjectModel, withRepeatIndex: boolean = true): boolean {\n if (!object || this.key !== object.key) {\n return false;\n }\n\n const objectContainsOneOfTheAttributes = this.attributeCollection.all\n .filter((attribute) => !attribute.isResult)\n .some(\n (attribute) =>\n object && object.attributeCollection.hasAttributeByKey(attribute.key),\n );\n\n const hasSameRepeatIndex = withRepeatIndex\n ? this.repeatIndex === object.repeatIndex\n : true;\n\n return hasSameRepeatIndex && objectContainsOneOfTheAttributes;\n }\n\n /**\n */\n getAttributeByAttribute(attribute: AttributeType): AttributeType | null {\n return this.attributeCollection.getAttributeByAttribute(attribute);\n }\n\n /**\n */\n getAttributeByKey(key: string): AttributeType | null {\n return this.attributeCollection.getAttributeByKey(key);\n }\n\n /**\n */\n hasAttributeByKey(key: string): boolean {\n return this.attributeCollection.hasAttributeByKey(key);\n }\n\n /**\n * Get elements from both the missing attributes and the result attributes\n */\n getElements(): Array<Object> {\n const elements = [];\n\n if (this.data.elements) {\n elements.push(...this.data.elements);\n }\n\n if (this.data.results) {\n const dataResults = this.data.results.map((result) => ({\n ...result,\n isResult: true,\n }));\n\n elements.push(...dataResults);\n }\n\n if (this.data.elementid) {\n elements.push({\n ...this.data,\n });\n }\n\n return elements;\n }\n\n /**\n * Map available contributions on the available data. Only use contributions that are needed for the data\n */\n getApplicableAttributeContributions(): Array<Object> {\n if (this.data && this.contributions) {\n const dataElementIds = this.getElements().map(\n (element) => element.elementid,\n );\n\n const contributions = this.getAttributesInData(\n dataElementIds,\n this.contributions.attributes,\n );\n\n // set all attribute mandatory for dynamic object\n if (this.isDynamic) {\n return contributions.map((attribute) => {\n const [attributeKey] = Object.keys(attribute);\n return {\n [attributeKey]: {\n ...attribute[attributeKey],\n mandatory: true,\n },\n };\n });\n }\n\n return contributions;\n }\n\n return [];\n }\n\n /**\n * Recursevily check if an attribute id occurs in the tree of attribute contributions.\n * The complete leaf of the tree is returned when an attribute id matches\n */\n getAttributesInData(\n dataElementIds: Array<string>,\n attributesContributions: Object,\n ): Array<Object> {\n return attributesContributions.filter((attributeContributions) => {\n const [attributeKey] = Object.keys(attributeContributions);\n\n return dataElementIds.some(\n (dataElementId) => dataElementId.split(\".\")[0] === attributeKey,\n );\n });\n }\n\n /**\n */\n getInitialChildModelLinks(): Array<LinkModel> {\n return this._attributeCollection.getInitialChildModelLinks();\n }\n\n /**\n */\n setChildModels(models: Array<ModularUIModel>, errors: Array<ErrorResponse>) {\n this._attributeCollection.setChildModels(models, errors);\n }\n\n /**\n * get key\n */\n get key(): string {\n return this.data.objectid;\n }\n\n /**\n * Get content configuration for form objects\n */\n get contentConfiguration(): ContentConfiguration {\n return this._contentConfiguration;\n }\n\n /**\n */\n get hasEndResultConfiguration(): boolean {\n return this.contributions.content?.results != null;\n }\n\n /**\n * Indicates if object is dynamic.\n *\n * A subtle difference exists between objects for wizard style instrument dialogs and other objects.\n * In the 'missing object' response, wizard style objects will include only the first attribute(s) to be answered,\n * while other objects will include the complete set of attributes of that object.\n *\n * This difference is condensed in the term of 'dynamic objects': these objects start (in the 'missing object' response)\n * with a very select set of attributes to be answered, and each successive 'missing elements' response will include next attributes to be answered.\n * When an object is dynamic, the form contributions will mention a \"dynamicObject\": true property.\n */\n get isDynamic(): boolean {\n return this.getContribution(\"dynamicObject\", false);\n }\n\n /**\n */\n get hasDynamicValidations(): boolean {\n return this.getContribution(\"dynamicValidations\", false);\n }\n\n /**\n * Indicates if object is repeatable\n */\n get isRepeatable(): boolean {\n return this.getContribution(\"repeatable\", false);\n }\n\n /**\n */\n get repeatIndex(): number {\n return this._repeatIndex ?? this.data.index ?? 1;\n }\n\n /**\n */\n set repeatIndex(repeatIndex: number) {\n this._repeatIndex = repeatIndex;\n }\n\n /**\n */\n get maxRepeats(): number {\n if (this.isRepeatable) {\n return this.getData(\"numberofrepeats\", -1);\n }\n\n return 1;\n }\n\n /**\n */\n get hasFixedNrOfRepeats(): boolean {\n return this.maxRepeats > -1;\n }\n\n /**\n */\n get isRepeatWithUnknownTotal(): boolean {\n return this.isRepeatable && this.maxRepeats === -1;\n }\n\n /**\n */\n get isLastRepeat(): boolean {\n if (this.isRepeatable) {\n return this.data.last || false;\n }\n\n return true;\n }\n\n /**\n */\n get repeatIndexLabel(): string | null {\n return this.data[\"index-identifier\"] || null;\n }\n\n /**\n * Get label of form object\n */\n get label(): string {\n return this.contributions.label;\n }\n\n /**\n * Get introText of form object\n */\n get introText(): string {\n if (this.data.content?.text) {\n return this.data.content.text.message;\n }\n\n if (this.contributions.text?.message) {\n return this.contributions.text.message;\n }\n\n return this.contributions.introText;\n }\n\n /**\n * Get assistent of form object\n */\n get assistent(): string {\n return this.contributions.assistent;\n }\n\n /**\n * Get button labels\n */\n get buttonLabels(): Object {\n return this.getContribution(\"buttonLabels\", {});\n }\n\n /**\n * get attribute collection\n */\n get attributeCollection(): AttributeCollection {\n return this._attributeCollection;\n }\n\n /**\n */\n set attributeCollection(attributeCollection: AttributeCollection) {\n this._attributeCollection = attributeCollection;\n }\n\n /**\n */\n mergeObject(oldObject: FormObjectModel) {\n this.attributeCollection.forEach((attribute) => {\n const mergeWithAttribute = oldObject.getAttributeByAttribute(attribute);\n if (mergeWithAttribute) {\n attribute.mergeAttribute(mergeWithAttribute);\n }\n });\n\n this.repeatIndex = oldObject.repeatIndex;\n }\n\n /**\n * Update attribute\n */\n updateAttribute(attribute: AttributeType, value: any): AttributeType {\n const attributeToUpdate =\n this.attributeCollection.getAttributeByAttribute(attribute);\n\n if (attributeToUpdate === null) {\n throw new Error(`Attribute with name: ${attribute.name} not found.`);\n }\n\n if (attributeToUpdate instanceof CompositeAttributeModel) {\n attributeToUpdate.update(value, attribute);\n } else {\n attributeToUpdate.update(value);\n }\n\n return attributeToUpdate;\n }\n\n /**\n * Inidicates if Form is changed since a given timestamp (Date.now)\n */\n isChangedSince(timestamp: number): boolean {\n return (\n this.attributeCollection.find((attribute) =>\n attribute.isChangedSince(timestamp),\n ) !== null\n );\n }\n\n /**\n * Reset all errors on Form Object\n */\n resetErrors() {\n this._errorCollection = new ErrorCollection(\"formobject\");\n this.attributeCollection.forEach((attribute) => attribute.resetErrors());\n }\n\n /**\n * Get error messages\n */\n get errorCollection(): ErrorCollection {\n return this._errorCollection;\n }\n\n /**\n * Registers an error that was received from a server response\n */\n addServerError(error: FormErrorAnchor) {\n if (error.anchor?.elementid != null) {\n this.attributeCollection.addServerError(error);\n } else {\n this._errorCollection.addServerError(\n error.id,\n error.message,\n error.properties,\n error.layouthint,\n );\n }\n }\n\n /**\n */\n hasServerErrors(): boolean {\n return (\n this.errorCollection.hasItems ||\n this.attributeCollection.hasServerErrors()\n );\n }\n\n /**\n */\n hasErrors(): boolean {\n return (\n this.errorCollection.hasItems || this.attributeCollection.hasErrors()\n );\n }\n\n /**\n */\n get isValid(): boolean {\n return (\n this.attributeCollection.visible.every(\n (attribute) => attribute.isValid,\n ) && !this.errorCollection.hasItems\n );\n }\n\n /**\n */\n get dynamicValidationsLoaded(): boolean {\n return this._dynamicValidationsLoaded;\n }\n\n /**\n */\n set dynamicValidationsLoaded(dynamicValidationsLoaded: boolean) {\n this._dynamicValidationsLoaded = dynamicValidationsLoaded;\n }\n\n /**\n * Convert error json from a form service to validation messages on the form object and attributes\n */\n handleErrorValidations(errors: Array<ErrorObject>) {\n const attributeErrors = [];\n\n errors\n .filter((error) => error.anchor?.objectid === this.key)\n .forEach((error) => {\n if (has(error.anchor, \"elementid\")) {\n attributeErrors.push(error);\n } else {\n this.errorCollection.addServerError(\n error.id,\n error.message,\n error.properties,\n new LayoutHintCollection(error.layouthint),\n );\n }\n });\n\n this.attributeCollection.updateValidations(attributeErrors);\n }\n\n /**\n * Convert missing json from a form service to mandatory validation constraints and messages\n */\n handleMissingValidations(\n missing: {\n anchors: Array<\n | {\n elements: Array<{ elementid: string }>,\n objectid?: string,\n }\n | { anchor: { elementid: string, objectid?: string } },\n >,\n },\n errors: Array<ErrorObject>,\n ) {\n const attributeErrors = [];\n\n for (const anchor of missing.anchors) {\n if (!anchor.objectid || anchor.objectid === this.key) {\n if (Array.isArray(anchor.elements)) {\n for (const element of anchor.elements) {\n attributeErrors.push({\n anchor: { elementid: element.elementid },\n id: \"Constraint.Mandatory\",\n });\n }\n } else {\n attributeErrors.push({\n anchor,\n id: \"Constraint.Mandatory\",\n });\n }\n }\n }\n\n if (Array.isArray(errors)) {\n errors\n .filter(\n (error) =>\n error.id === \"Constraint.Mandatory\" &&\n error.anchor?.objectid === this.key &&\n has(error.anchor, \"elementid\"),\n )\n .forEach((error) => {\n attributeErrors.push(error);\n });\n }\n this.attributeCollection.updateValidations(attributeErrors);\n }\n\n /**\n */\n updateValidations(data: any): FormObjectModel {\n this.resetErrors();\n\n if (Array.isArray(data.errors)) {\n this.handleErrorValidations(data.errors);\n }\n\n // missing attribute errors\n if (Array.isArray(data.missing?.anchors)) {\n this.handleMissingValidations(data.missing, data.errors);\n }\n\n this.dynamicValidationsLoaded = true;\n\n return this;\n }\n\n /**\n * Generate formdata object for current formobject based on formdata of attributes\n */\n get formdata(): { [string]: any } | null {\n return this.attributeCollection.formdata;\n }\n\n /**\n */\n getFormData(validationData: boolean = false): { [string]: any } | null {\n return this.attributeCollection.getFormData(validationData);\n }\n}\n"],"mappings":";;;;;AACA,SAASA,GAAG,QAAQ,6BAA6B;AAEjD,OAAOC,SAAS,MAAM,mBAAmB;AACzC,OAAOC,mBAAmB,MAAM,mCAAmC;AACnE,OAAOC,uBAAuB,MAAM,uCAAuC;AAC3E,OAAOC,oBAAoB,MAAM,8CAA8C;AAC/E,OAAOC,eAAe,MAAM,0BAA0B;AACtD,SAASC,wBAAwB,QAAQ,kBAAkB;AAS3D,OAAOC,oBAAoB,MAAM,oCAAoC;AAiBrE;AACA;AACA;AACA,eAAe,MAAMC,eAAe,SAASP,SAAS,CAAC;EAOrD;AACF;AACA;EACEQ,WAAWA,CACTC,MAAc,EACdC,mBAA2B,EAC3BC,YAA2B,EAC3B;IACA,KAAK,CAACF,MAAM,EAAEC,mBAAmB,EAAE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C1C;;IAEA;IACA,IAAIyD,KAAK,CAACC,OAAO,CAAC3G,IAAI,CAACwG,OAAO,EAAEC,OAAO,CAAC,EAAE;MACxC,IAAI,CAACF,wBAAwB,CAACvG,IAAI,CAACwG,OAAO,EAAExG,IAAI,CAACiD,MAAM,CAAC;IAC1D;IAEA,IAAI,CAACiD,wBAAwB,GAAG,IAAI;IAEpC,OAAO,IAAI;EACb;;EAEA;AACF;AACA;EACE,IAAIU,QAAQA,CAAA,EAA6B;IACvC,OAAO,IAAI,CAAC3G,mBAAmB,CAAC2G,QAAQ;EAC1C;;EAEA;AACF;EACEC,WAAWA,CAACC,cAAuB,GAAG,KAAK,EAA4B;IACrE,OAAO,IAAI,CAAC7G,mBAAmB,CAAC4G,WAAW,CAACC,cAAc,CAAC;EAC7D;AACF","ignoreList":[]}
|
|
1
|
+
{"version":3,"file":"FormObjectModel.js","names":["has","BaseModel","AttributeCollection","CompositeAttributeModel","ContentConfiguration","ErrorCollection","IllegalArgumentException","LayoutHintCollection","FormObjectModel","constructor","object","objectContributions","modelOptions","_defineProperty","getElements","length","_attributeCollection","getApplicableAttributeContributions","isReadonly","_contentConfiguration","content","_errorCollection","data","attributeCollection","setReferenceDate","getData","indicateContentConfiguration","contentConfiguration","createEmpty","formObjectModel","contributions","equals","withRepeatIndex","_context","key","objectContainsOneOfTheAttributes","_filterInstanceProperty","all","call","attribute","isResult","some","hasAttributeByKey","hasSameRepeatIndex","repeatIndex","getAttributeByAttribute","getAttributeByKey","elements","push","results","_context2","dataResults","_mapInstanceProperty","result","elementid","_context3","dataElementIds","element","getAttributesInData","attributes","isDynamic","attributeKey","_Object$keys","mandatory","attributesContributions","attributeContributions","dataElementId","split","getInitialChildModelLinks","setChildModels","models","errors","objectid","hasEndResultConfiguration","getContribution","hasDynamicValidations","isRepeatable","_repeatIndex","index","maxRepeats","hasFixedNrOfRepeats","isRepeatWithUnknownTotal","isLastRepeat","last","repeatIndexLabel","label","introText","text","message","assistent","buttonLabels","mergeObject","oldObject","forEach","mergeWithAttribute","mergeAttribute","updateAttribute","value","attributeToUpdate","Error","name","update","isChangedSince","timestamp","_context4","_findInstanceProperty","resetErrors","errorCollection","addServerError","error","anchor","id","properties","layouthint","hasServerErrors","hasItems","hasErrors","isValid","visible","every","dynamicValidationsLoaded","_dynamicValidationsLoaded","handleErrorValidations","attributeErrors","updateValidations","handleMissingValidations","missing","anchors","Array","isArray","formdata","getFormData","validationData"],"sources":["../../../src/models/form/FormObjectModel.js"],"sourcesContent":["// @flow\nimport { has } from \"../../utils/helpers/objects\";\n\nimport BaseModel from \"../base/BaseModel\";\nimport AttributeCollection from \"../attributes/AttributeCollection\";\nimport CompositeAttributeModel from \"../attributes/CompositeAttributeModel\";\nimport ContentConfiguration from \"../contentconfiguration/ContentConfiguration\";\nimport ErrorCollection from \"../error/ErrorCollection\";\nimport { IllegalArgumentException } from \"../../exceptions\";\n\nimport type {\n AttributeType,\n ModularUIModel,\n FormErrorAnchor,\n ModelOptions,\n} from \"../types\";\n\nimport LayoutHintCollection from \"../layouthint/LayoutHintCollection\";\n\nimport type LinkModel from \"../links/LinkModel\";\nimport type ErrorResponse from \"../error/ErrorResponse\";\nimport type { MessageParameters } from \"../../i18n\";\n\ntype ErrorObject = {\n anchor: {\n objectid: string,\n elementid?: string,\n },\n id: string,\n message: string,\n properties: MessageParameters,\n layouthint: Array<string>,\n};\n\n/**\n * Form Object\n */\nexport default class FormObjectModel extends BaseModel {\n _attributeCollection: AttributeCollection;\n _contentConfiguration: ContentConfiguration;\n _errorCollection: ErrorCollection;\n _repeatIndex: number;\n _dynamicValidationsLoaded: boolean;\n\n /**\n * Construct FormObjectModel\n */\n constructor(\n object: Object,\n objectContributions: Object,\n modelOptions?: ModelOptions,\n ) {\n super(object, objectContributions, modelOptions);\n\n if (object && this.getElements().length > 0) {\n this._attributeCollection = new AttributeCollection(\n this.getElements(),\n this.getApplicableAttributeContributions(),\n { ...modelOptions, isReadonly: false },\n );\n } else {\n this._attributeCollection = new AttributeCollection();\n }\n\n this._contentConfiguration = new ContentConfiguration(\n objectContributions ? objectContributions.content : {},\n );\n\n this._errorCollection = new ErrorCollection(\"formobject\");\n\n if (has(this.data, \"referenceDate\")) {\n this.attributeCollection.setReferenceDate(this.getData(\"referenceDate\"));\n }\n\n this.attributeCollection.indicateContentConfiguration(\n this.contentConfiguration,\n );\n }\n\n /**\n */\n static createEmpty(formObjectModel: FormObjectModel): FormObjectModel {\n if (!formObjectModel) {\n throw new IllegalArgumentException(\n \"createEmpty method needs a FormObjectModel as input argument to create a new version of the object\",\n );\n }\n return new FormObjectModel(\n formObjectModel.data,\n formObjectModel.contributions,\n formObjectModel.modelOptions,\n );\n }\n\n /**\n */\n equals(object: ?FormObjectModel, withRepeatIndex: boolean = true): boolean {\n if (!object || this.key !== object.key) {\n return false;\n }\n\n const objectContainsOneOfTheAttributes = this.attributeCollection.all\n .filter((attribute) => !attribute.isResult)\n .some((attribute) =>\n object?.attributeCollection.hasAttributeByKey(attribute.key),\n );\n\n const hasSameRepeatIndex = withRepeatIndex\n ? this.repeatIndex === object.repeatIndex\n : true;\n\n return hasSameRepeatIndex && objectContainsOneOfTheAttributes;\n }\n\n /**\n */\n getAttributeByAttribute(attribute: AttributeType): AttributeType | null {\n return this.attributeCollection.getAttributeByAttribute(attribute);\n }\n\n /**\n */\n getAttributeByKey(key: string): AttributeType | null {\n return this.attributeCollection.getAttributeByKey(key);\n }\n\n /**\n */\n hasAttributeByKey(key: string): boolean {\n return this.attributeCollection.hasAttributeByKey(key);\n }\n\n /**\n * Get elements from both the missing attributes and the result attributes\n */\n getElements(): Array<Object> {\n const elements = [];\n\n if (this.data.elements) {\n elements.push(...this.data.elements);\n }\n\n if (this.data.results) {\n const dataResults = this.data.results.map((result) => ({\n ...result,\n isResult: true,\n }));\n\n elements.push(...dataResults);\n }\n\n if (this.data.elementid) {\n elements.push({\n ...this.data,\n });\n }\n\n return elements;\n }\n\n /**\n * Map available contributions on the available data. Only use contributions that are needed for the data\n */\n getApplicableAttributeContributions(): Array<Object> {\n if (this.data && this.contributions) {\n const dataElementIds = this.getElements().map(\n (element) => element.elementid,\n );\n\n const contributions = this.getAttributesInData(\n dataElementIds,\n this.contributions.attributes,\n );\n\n // set all attribute mandatory for dynamic object\n if (this.isDynamic) {\n return contributions.map((attribute) => {\n const [attributeKey] = Object.keys(attribute);\n return {\n [attributeKey]: {\n ...attribute[attributeKey],\n mandatory: true,\n },\n };\n });\n }\n\n return contributions;\n }\n\n return [];\n }\n\n /**\n * Recursevily check if an attribute id occurs in the tree of attribute contributions.\n * The complete leaf of the tree is returned when an attribute id matches\n */\n getAttributesInData(\n dataElementIds: Array<string>,\n attributesContributions: Object,\n ): Array<Object> {\n return attributesContributions.filter((attributeContributions) => {\n const [attributeKey] = Object.keys(attributeContributions);\n\n return dataElementIds.some(\n (dataElementId) => dataElementId.split(\".\")[0] === attributeKey,\n );\n });\n }\n\n /**\n */\n getInitialChildModelLinks(): Array<LinkModel> {\n return this._attributeCollection.getInitialChildModelLinks();\n }\n\n /**\n */\n setChildModels(models: Array<ModularUIModel>, errors: Array<ErrorResponse>) {\n this._attributeCollection.setChildModels(models, errors);\n }\n\n /**\n * get key\n */\n get key(): string {\n return this.data.objectid;\n }\n\n /**\n * Get content configuration for form objects\n */\n get contentConfiguration(): ContentConfiguration {\n return this._contentConfiguration;\n }\n\n /**\n */\n get hasEndResultConfiguration(): boolean {\n return this.contributions.content?.results != null;\n }\n\n /**\n * Indicates if object is dynamic.\n *\n * A subtle difference exists between objects for wizard style instrument dialogs and other objects.\n * In the 'missing object' response, wizard style objects will include only the first attribute(s) to be answered,\n * while other objects will include the complete set of attributes of that object.\n *\n * This difference is condensed in the term of 'dynamic objects': these objects start (in the 'missing object' response)\n * with a very select set of attributes to be answered, and each successive 'missing elements' response will include next attributes to be answered.\n * When an object is dynamic, the form contributions will mention a \"dynamicObject\": true property.\n */\n get isDynamic(): boolean {\n return this.getContribution(\"dynamicObject\", false);\n }\n\n /**\n */\n get hasDynamicValidations(): boolean {\n return this.getContribution(\"dynamicValidations\", false);\n }\n\n /**\n * Indicates if object is repeatable\n */\n get isRepeatable(): boolean {\n return this.getContribution(\"repeatable\", false);\n }\n\n /**\n */\n get repeatIndex(): number {\n return this._repeatIndex ?? this.data.index ?? 1;\n }\n\n /**\n */\n set repeatIndex(repeatIndex: number) {\n this._repeatIndex = repeatIndex;\n }\n\n /**\n */\n get maxRepeats(): number {\n if (this.isRepeatable) {\n return this.getData(\"numberofrepeats\", -1);\n }\n\n return 1;\n }\n\n /**\n */\n get hasFixedNrOfRepeats(): boolean {\n return this.maxRepeats > -1;\n }\n\n /**\n */\n get isRepeatWithUnknownTotal(): boolean {\n return this.isRepeatable && this.maxRepeats === -1;\n }\n\n /**\n */\n get isLastRepeat(): boolean {\n if (this.isRepeatable) {\n return this.data.last || false;\n }\n\n return true;\n }\n\n /**\n */\n get repeatIndexLabel(): string | null {\n return this.data[\"index-identifier\"] || null;\n }\n\n /**\n * Get label of form object\n */\n get label(): string {\n return this.contributions.label;\n }\n\n /**\n * Get introText of form object\n */\n get introText(): string {\n if (this.data.content?.text) {\n return this.data.content.text.message;\n }\n\n if (this.contributions.text?.message) {\n return this.contributions.text.message;\n }\n\n return this.contributions.introText;\n }\n\n /**\n * Get assistent of form object\n */\n get assistent(): string {\n return this.contributions.assistent;\n }\n\n /**\n * Get button labels\n */\n get buttonLabels(): Object {\n return this.getContribution(\"buttonLabels\", {});\n }\n\n /**\n * get attribute collection\n */\n get attributeCollection(): AttributeCollection {\n return this._attributeCollection;\n }\n\n /**\n */\n set attributeCollection(attributeCollection: AttributeCollection) {\n this._attributeCollection = attributeCollection;\n }\n\n /**\n */\n mergeObject(oldObject: FormObjectModel) {\n this.attributeCollection.forEach((attribute) => {\n const mergeWithAttribute = oldObject.getAttributeByAttribute(attribute);\n if (mergeWithAttribute) {\n attribute.mergeAttribute(mergeWithAttribute);\n }\n });\n\n this.repeatIndex = oldObject.repeatIndex;\n }\n\n /**\n * Update attribute\n */\n updateAttribute(attribute: AttributeType, value: any): AttributeType {\n const attributeToUpdate =\n this.attributeCollection.getAttributeByAttribute(attribute);\n\n if (attributeToUpdate === null) {\n throw new Error(`Attribute with name: ${attribute.name} not found.`);\n }\n\n if (attributeToUpdate instanceof CompositeAttributeModel) {\n attributeToUpdate.update(value, attribute);\n } else {\n attributeToUpdate.update(value);\n }\n\n return attributeToUpdate;\n }\n\n /**\n * Inidicates if Form is changed since a given timestamp (Date.now)\n */\n isChangedSince(timestamp: number): boolean {\n return (\n this.attributeCollection.find((attribute) =>\n attribute.isChangedSince(timestamp),\n ) !== null\n );\n }\n\n /**\n * Reset all errors on Form Object\n */\n resetErrors() {\n this._errorCollection = new ErrorCollection(\"formobject\");\n this.attributeCollection.forEach((attribute) => attribute.resetErrors());\n }\n\n /**\n * Get error messages\n */\n get errorCollection(): ErrorCollection {\n return this._errorCollection;\n }\n\n /**\n * Registers an error that was received from a server response\n */\n addServerError(error: FormErrorAnchor) {\n if (error.anchor?.elementid != null) {\n this.attributeCollection.addServerError(error);\n } else {\n this._errorCollection.addServerError(\n error.id,\n error.message,\n error.properties,\n error.layouthint,\n );\n }\n }\n\n /**\n */\n hasServerErrors(): boolean {\n return (\n this.errorCollection.hasItems ||\n this.attributeCollection.hasServerErrors()\n );\n }\n\n /**\n */\n hasErrors(): boolean {\n return (\n this.errorCollection.hasItems || this.attributeCollection.hasErrors()\n );\n }\n\n /**\n */\n get isValid(): boolean {\n return (\n this.attributeCollection.visible.every(\n (attribute) => attribute.isValid,\n ) && !this.errorCollection.hasItems\n );\n }\n\n /**\n */\n get dynamicValidationsLoaded(): boolean {\n return this._dynamicValidationsLoaded;\n }\n\n /**\n */\n set dynamicValidationsLoaded(dynamicValidationsLoaded: boolean) {\n this._dynamicValidationsLoaded = dynamicValidationsLoaded;\n }\n\n /**\n * Convert error json from a form service to validation messages on the form object and attributes\n */\n handleErrorValidations(errors: Array<ErrorObject>) {\n const attributeErrors = [];\n\n errors\n .filter((error) => error.anchor?.objectid === this.key)\n .forEach((error) => {\n if (has(error.anchor, \"elementid\")) {\n attributeErrors.push(error);\n } else {\n this.errorCollection.addServerError(\n error.id,\n error.message,\n error.properties,\n new LayoutHintCollection(error.layouthint),\n );\n }\n });\n\n this.attributeCollection.updateValidations(attributeErrors);\n }\n\n /**\n * Convert missing json from a form service to mandatory validation constraints and messages\n */\n handleMissingValidations(\n missing: {\n anchors: Array<\n | {\n elements: Array<{ elementid: string }>,\n objectid?: string,\n }\n | { anchor: { elementid: string, objectid?: string } },\n >,\n },\n errors: Array<ErrorObject>,\n ) {\n const attributeErrors = [];\n\n for (const anchor of missing.anchors) {\n if (!anchor.objectid || anchor.objectid === this.key) {\n if (Array.isArray(anchor.elements)) {\n for (const element of anchor.elements) {\n attributeErrors.push({\n anchor: { elementid: element.elementid },\n id: \"Constraint.Mandatory\",\n });\n }\n } else {\n attributeErrors.push({\n anchor,\n id: \"Constraint.Mandatory\",\n });\n }\n }\n }\n\n if (Array.isArray(errors)) {\n errors\n .filter(\n (error) =>\n error.id === \"Constraint.Mandatory\" &&\n error.anchor?.objectid === this.key &&\n has(error.anchor, \"elementid\"),\n )\n .forEach((error) => {\n attributeErrors.push(error);\n });\n }\n this.attributeCollection.updateValidations(attributeErrors);\n }\n\n /**\n */\n updateValidations(data: any): FormObjectModel {\n this.resetErrors();\n\n if (Array.isArray(data.errors)) {\n this.handleErrorValidations(data.errors);\n }\n\n // missing attribute errors\n if (Array.isArray(data.missing?.anchors)) {\n this.handleMissingValidations(data.missing, data.errors);\n }\n\n this.dynamicValidationsLoaded = true;\n\n return this;\n }\n\n /**\n * Generate formdata object for current formobject based on formdata of attributes\n */\n get formdata(): { [string]: any } | null {\n return this.attributeCollection.formdata;\n }\n\n /**\n */\n getFormData(validationData: boolean = false): { [string]: any } | null {\n return this.attributeCollection.getFormData(validationData);\n }\n}\n"],"mappings":";;;;;AACA,SAASA,GAAG,QAAQ,6BAA6B;AAEjD,OAAOC,SAAS,MAAM,mBAAmB;A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B,OAAO,CAAEgB,KAAK,IAAK;QAClBc,eAAe,CAAC3E,IAAI,CAAC6D,KAAK,CAAC;MAC7B,CAAC,CAAC;IACN;IACA,IAAI,CAACtF,mBAAmB,CAACqG,iBAAiB,CAACD,eAAe,CAAC;EAC7D;;EAEA;AACF;EACEC,iBAAiBA,CAACtG,IAAS,EAAmB;IAC5C,IAAI,CAACoF,WAAW,CAAC,CAAC;IAElB,IAAIsB,KAAK,CAACC,OAAO,CAAC3G,IAAI,CAACiD,MAAM,CAAC,EAAE;MAC9B,IAAI,CAACmD,sBAAsB,CAACpG,IAAI,CAACiD,MAAM,CAAC;IAC1C;;IAEA;IACA,IAAIyD,KAAK,CAACC,OAAO,CAAC3G,IAAI,CAACwG,OAAO,EAAEC,OAAO,CAAC,EAAE;MACxC,IAAI,CAACF,wBAAwB,CAACvG,IAAI,CAACwG,OAAO,EAAExG,IAAI,CAACiD,MAAM,CAAC;IAC1D;IAEA,IAAI,CAACiD,wBAAwB,GAAG,IAAI;IAEpC,OAAO,IAAI;EACb;;EAEA;AACF;AACA;EACE,IAAIU,QAAQA,CAAA,EAA6B;IACvC,OAAO,IAAI,CAAC3G,mBAAmB,CAAC2G,QAAQ;EAC1C;;EAEA;AACF;EACEC,WAAWA,CAACC,cAAuB,GAAG,KAAK,EAA4B;IACrE,OAAO,IAAI,CAAC7G,mBAAmB,CAAC4G,WAAW,CAACC,cAAc,CAAC;EAC7D;AACF","ignoreList":[]}
|
package/esm/models/href/Href.js
CHANGED
|
@@ -149,7 +149,7 @@ class Href {
|
|
|
149
149
|
* Retrieve hash of href string
|
|
150
150
|
*/
|
|
151
151
|
static getHashFromString(href = "") {
|
|
152
|
-
return _includesInstanceProperty(href).call(href, "#") ? href.
|
|
152
|
+
return _includesInstanceProperty(href).call(href, "#") ? href.substring(href.indexOf("#") + 1) : "";
|
|
153
153
|
}
|
|
154
154
|
|
|
155
155
|
/**
|
|
@@ -237,7 +237,7 @@ class Href {
|
|
|
237
237
|
* Remove a parameter from the parameter collection
|
|
238
238
|
*/
|
|
239
239
|
removeParameter(name, prefix, value) {
|
|
240
|
-
if (value
|
|
240
|
+
if (value) {
|
|
241
241
|
var _context4;
|
|
242
242
|
const valueToRemove = value;
|
|
243
243
|
this._parameters = _mapInstanceProperty(_context4 = this._parameters).call(_context4, param => {
|
|
@@ -182,7 +182,7 @@ class Href {
|
|
|
182
182
|
* Retrieve hash of href string
|
|
183
183
|
*/
|
|
184
184
|
static getHashFromString(href: string = ""): string {
|
|
185
|
-
return href.includes("#") ? href.
|
|
185
|
+
return href.includes("#") ? href.substring(href.indexOf("#") + 1) : "";
|
|
186
186
|
}
|
|
187
187
|
|
|
188
188
|
/**
|
|
@@ -281,7 +281,7 @@ class Href {
|
|
|
281
281
|
* Remove a parameter from the parameter collection
|
|
282
282
|
*/
|
|
283
283
|
removeParameter(name: string, prefix: ?string, value: ?string): Href {
|
|
284
|
-
if (value
|
|
284
|
+
if (value) {
|
|
285
285
|
const valueToRemove = value;
|
|
286
286
|
|
|
287
287
|
this._parameters = this._parameters.map((param) => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Href.js","names":["getBasePathModularUI","HTTP_METHODS","CONTENT_PATH","Parameter","Href","constructor","href","resourcetype","modelOptions","_defineProperty","GET","setFromHref","setFromString","setFromLocationOrObject","origin","contextPath","path","parameters","hash","state","_origin","_contextPath","pathname","_path","search","addParametersFromString","Array","isArray","_parameters","_context","_mapInstanceProperty","call","param","addParameter","_name","_value","_prefix","getHashFromString","_hash","setStateFromLocationOrObject","_state","getPathFromString","isChangePassword","_context2","_includesInstanceProperty","isCamelRoute","_startsWithInstanceProperty","checkAbsoluteUrl","checkAbsolute","RegExp","test","isExternal","hrefNoHash","substring","indexOf","split","substr","forEach","paramFromString","fromString","setParameter","name","value","prefix","removeParameter","push","getParameter","_context3","_findInstanceProperty","hasParameter","undefined","method","_method","_context4","valueToRemove","_context5","newValue","Function","bind","_filterInstanceProperty","val","join","_context6","getQuerystring","withPrefix","_context7","_context8","toQuerystring","getQuerystringForModularUI","_context9","_context0","isModUIParameter","querystring","publicQuerystring","setState","formdata","currentState","_resourcetype","absolutepath","length","absolutehref","absolutehrefPrefixedQuerystring","startsWith","thisPath","otherPath","equals","equalsWithParameters","other","_context1","thisParams","toString","every","isContent","_context10","getReferenceHash","_referenceHash","setReferenceHash","referenceHash","toLocation"],"sources":["../../../src/models/href/Href.js"],"sourcesContent":["// @flow\nimport {\n getBasePathModularUI,\n HTTP_METHODS,\n CONTENT_PATH,\n} from \"../../constants\";\n\nimport Parameter from \"../parameter/Parameter\";\n\nimport type { LocationShape } from \"react-router\";\nimport type { ModelOptions } from \"../types\";\n\ntype HrefObject = {\n _path: string,\n _hash: string,\n _parameters: Array<Parameter>,\n _resourcetype: string,\n _method: $Keys<typeof HTTP_METHODS>,\n _state: ?{ [key: string]: any },\n pathname: ?string,\n};\n\nexport type HrefInput = Href | HrefObject | LocationShape | string;\n\n/**\n * Defines a Href with the parameters\n */\nclass Href {\n _path: string = \"\";\n _hash: string = \"\";\n _parameters: Array<Parameter> = [];\n _resourcetype: string = \"\";\n _method: $Keys<typeof HTTP_METHODS> = HTTP_METHODS.GET;\n _state: any = null;\n _referenceHash: ?number;\n _origin: string = \"\";\n _contextPath: string = getBasePathModularUI();\n\n /**\n * Create a Href\n */\n constructor(\n href?: HrefInput,\n resourcetype?: string,\n modelOptions?: ?ModelOptions,\n ) {\n this.resourcetype = resourcetype ?? \"\";\n\n if (href instanceof Href) {\n this.setFromHref(href);\n } else if (typeof href === \"string\") {\n this.setFromString(href);\n } else if (typeof href === \"object\") {\n this.setFromLocationOrObject(href);\n }\n\n if (typeof modelOptions?.origin === \"string\") {\n this.origin = modelOptions.origin;\n }\n\n if (typeof modelOptions?.contextPath === \"string\") {\n this.contextPath = modelOptions.contextPath;\n }\n }\n\n /**\n * Set parameters from Href model input\n */\n setFromHref(href: Href) {\n this.origin = href.origin;\n this.contextPath = href.contextPath;\n this.path = href.path;\n this.parameters = href.parameters;\n this.hash = href.hash;\n this.state = href.state;\n }\n\n /**\n */\n setFromLocationOrObject(href: LocationShape | HrefObject) {\n // $FlowFixMe\n if (typeof href._origin === \"string\") {\n this.origin = href._origin;\n }\n // $FlowFixMe\n if (typeof href._contextPath === \"string\") {\n this.contextPath = href._contextPath;\n }\n\n if (typeof href[\"pathname\"] === \"string\") {\n this.path = href.pathname;\n } else if (typeof href._path === \"string\") {\n this.path = href._path;\n }\n\n if (href.search) {\n this.addParametersFromString(href.search);\n } else if (Array.isArray(href._parameters)) {\n // $FlowExpectedError[incompatible-call]\n href._parameters.map((param: Parameter) =>\n this.addParameter(param._name, param._value, param._prefix),\n );\n }\n\n if (href.hash) {\n this.hash = Href.getHashFromString(href.hash);\n } else if (typeof href._hash === \"string\") {\n this.hash = href._hash;\n }\n\n if (typeof href.state === \"object\") {\n this.setStateFromLocationOrObject(href.state);\n } else if (typeof href._state === \"object\") {\n this.setStateFromLocationOrObject(href._state);\n }\n }\n\n /**\n */\n setStateFromLocationOrObject(state?: any) {\n if (state != null) {\n this.state = state;\n if (typeof state.contextPath === \"string\") {\n this.contextPath = state.contextPath;\n }\n if (typeof state.origin === \"string\") {\n this.origin = state.origin;\n }\n }\n }\n\n /**\n * Set parameters from string input\n */\n setFromString(href: string) {\n this.path = Href.getPathFromString(href);\n this.addParametersFromString(href);\n this.hash = Href.getHashFromString(href);\n }\n\n /**\n */\n get isChangePassword(): boolean {\n return this._path.includes(\"/change-password\");\n }\n\n /**\n * check if the path is referencing a camel route\n */\n static isCamelRoute(path: string): boolean {\n return (\n path.startsWith(\"/restServices\") && !path.startsWith(\"/restServices/ui\")\n );\n }\n\n /**\n */\n static checkAbsoluteUrl(href: string): boolean {\n const checkAbsolute = new RegExp(\"^(?:[a-z]+:)?//\", \"i\");\n return checkAbsolute.test(href);\n }\n\n // Check if url is relative (not checking for absolute urls with same domain)\n /**\n */\n get isExternal(): boolean {\n return Href.checkAbsoluteUrl(this.path);\n }\n\n /**\n * Retrieve the relative path part of a href string, e.g. https://www.beinformed.com/BeInformed/tab/view?q=url => /tab/view\n */\n static getPathFromString(href: string): string {\n const hrefNoHash = href.includes(\"#\")\n ? href.substring(0, href.indexOf(\"#\"))\n : href;\n\n return hrefNoHash.includes(\"?\") ? hrefNoHash.split(\"?\")[0] : hrefNoHash;\n }\n\n /**\n * Retrieve hash of href string\n */\n static getHashFromString(href: string = \"\"): string {\n return href.includes(\"#\") ? href.substr(href.indexOf(\"#\") + 1) : \"\";\n }\n\n /**\n * Add a parameter for each parameter found in the querystring of an URL string, e.g. https://www.beinformed.com?q=url => q=url\n */\n addParametersFromString(href: string): Href {\n if (href.includes(\"?\")) {\n href\n .split(\"?\")[1]\n .split(\"&\")\n .forEach((param) => {\n const paramFromString = Parameter.fromString(param);\n if (paramFromString) {\n this.setParameter(\n paramFromString.name,\n paramFromString.value,\n paramFromString.prefix,\n );\n }\n });\n }\n\n return this;\n }\n\n /**\n * Add a querystring parameter to the parameter collection of this Href, skips parameters that have a value of null\n */\n addParameter(name: string, value: ?string, prefix: ?string): Href {\n if (value !== null) {\n this.removeParameter(name, prefix);\n this._parameters.push(new Parameter(prefix, name, value));\n }\n\n return this;\n }\n\n /**\n * Adds or overwrites a parameter when it exists and value is not null.\n * Removes the parameter when the value is null\n */\n setParameter(name: string, value: ?string, prefix: ?string): Href {\n if (value === null) {\n this.removeParameter(name, prefix);\n } else {\n this.addParameter(name, value, prefix);\n }\n\n return this;\n }\n\n /**\n * Retrieve a parameter by it's name and (optionally) prefix\n */\n getParameter(name: string, prefix: ?string): ?Parameter {\n return this._parameters.find(\n (param) => param.prefix === prefix && param.name === name,\n );\n }\n\n /**\n */\n hasParameter(name: string, prefix: ?string): boolean {\n return this.getParameter(name, prefix) !== undefined;\n }\n\n /**\n * Get request method\n */\n get method(): $Keys<typeof HTTP_METHODS> {\n return this._method;\n }\n\n /**\n * Set request method\n */\n set method(method: $Keys<typeof HTTP_METHODS>) {\n this._method = method || HTTP_METHODS.GET;\n }\n\n /**\n * Retrieve all paremters\n */\n get parameters(): Array<Parameter> {\n return this._parameters;\n }\n\n /**\n * Replace parameters of Href\n */\n set parameters(parameters: Array<Parameter>) {\n this._parameters = parameters;\n }\n\n /**\n * Remove a parameter from the parameter collection\n */\n removeParameter(name: string, prefix: ?string, value: ?string): Href {\n if (value != undefined) {\n const valueToRemove = value;\n\n this._parameters = this._parameters.map((param) => {\n if (param.prefix === prefix && param.name === name) {\n const newValue = param.value\n ?.split(\",\")\n .filter((val) => val !== valueToRemove)\n .join(\",\");\n return new Parameter(param.prefix, param.name, newValue);\n }\n return param;\n });\n } else {\n this._parameters = this._parameters.filter(\n (param) => param.prefix !== prefix || param.name !== name,\n );\n }\n\n return this;\n }\n\n /**\n * Get the parameters as a querystring, e.g. param1=value1¶m2=value2, optionally with prefix\n */\n getQuerystring(withPrefix: boolean = false): string {\n return this.parameters\n .filter((param) => param.value != null && param.value !== \"\")\n .map((param) => param.toQuerystring(withPrefix))\n .join(\"&\");\n }\n\n /**\n * Retrieve a querystring that only contains parameter that can be send to the modular ui, parameters are filtered by prefix\n */\n getQuerystringForModularUI(prefix: string = \"\"): string {\n return this.parameters\n .filter(\n (param) =>\n param.isModUIParameter &&\n (!prefix || !param.prefix || param.prefix === prefix) &&\n param.value != null &&\n param.value !== \"\",\n )\n .map((param) => param.toQuerystring(false))\n .join(\"&\");\n }\n\n /**\n * Retrieve all parameters from the parameter collection in a querystring style name1=value1&name2=value2, without the prefix\n */\n get querystring(): string {\n return this.getQuerystring(false);\n }\n\n /**\n * Retrieve all parameters from the parameter collection in a querystring style prefix~name1=value1&prefix~name2=value2, with the prefix\n * The prefix is used to identify parameters per component on a grouping panel\n * @returns {string}\n */\n get publicQuerystring(): string {\n return this.getQuerystring(true);\n }\n\n /**\n * Set the path of the Href, the part before the querystring question mark\n */\n set path(path: string) {\n this._path = path;\n }\n\n /**\n * Retrieve the path\n */\n get path(): string {\n return this._path ?? \"\";\n }\n\n /**\n * Retrieve the origin (e.g. http://example.com:18080)<br>\n * Empty when the default must be used\n */\n get origin(): string {\n return this._origin ?? \"\";\n }\n\n /**\n * Set the origin (e.g. http://example.com:18080)\n */\n set origin(origin: string) {\n this._origin = origin;\n }\n\n /**\n * Get the context path\n */\n get contextPath(): string {\n return this._contextPath;\n }\n\n /**\n * Set the context path if different from default\n */\n set contextPath(contextPath: string) {\n this._contextPath = contextPath;\n }\n\n /**\n * Set hash\n */\n set hash(hash: string) {\n this._hash = hash;\n }\n\n /**\n * Retrieve hash\n */\n get hash(): string {\n return this._hash;\n }\n\n /**\n */\n set state(state: any) {\n this._state = state;\n }\n\n /**\n */\n get state(): any {\n return this._state;\n }\n\n /**\n */\n setState(state: any): Href {\n this.state = state;\n\n return this;\n }\n\n /**\n */\n set formdata(formdata: any) {\n const currentState = this.state ?? {};\n\n this.state = {\n ...currentState,\n formdata,\n };\n }\n\n /**\n */\n get formdata(): any {\n return this.state?.formdata;\n }\n\n /**\n * Set resourctype\n */\n set resourcetype(resourcetype: string) {\n this._resourcetype = resourcetype;\n }\n\n /**\n * Retrieve resourceType\n */\n get resourcetype(): string {\n return this._resourcetype;\n }\n\n /**\n * Retrieve the path combined with the base path (context-path) of the application, e.g. /BeInformed\n */\n get absolutepath(): string {\n if (this.isExternal) {\n return this.path;\n }\n\n return this.origin + this.contextPath + this.path;\n }\n\n /**\n * Retrieves the combination of the path and the querystring\n */\n get href(): string {\n return this.querystring.length > 0\n ? [this.path, this.querystring].join(\"?\")\n : this.path;\n }\n\n /**\n * Getting the URL including the base path, querystring is prefixed\n */\n get absolutehref(): string {\n const querystring = this.getQuerystring(false);\n\n return querystring.length > 0\n ? [this.absolutepath, querystring].join(\"?\")\n : this.absolutepath;\n }\n\n /**\n * Getting the URL including the base path, the querystring is prefixed\n */\n get absolutehrefPrefixedQuerystring(): string {\n const querystring = this.getQuerystring(true);\n\n return querystring.length > 0\n ? [this.absolutepath, querystring].join(\"?\")\n : this.absolutepath;\n }\n\n /**\n * Checks if the URL starts within the given href\n */\n startsWith(href: Href | string): boolean {\n const thisPath = `${this.path}/`;\n const otherPath = href instanceof Href ? `${href.path}/` : href;\n\n return thisPath.startsWith(otherPath);\n }\n\n /**\n * Checks if the given Href equals this Href\n */\n equals(href: Href | string | null): boolean {\n if (href instanceof Href) {\n return this.path === href.path;\n }\n\n return this.path === href;\n }\n\n /**\n */\n equalsWithParameters(other: Href | string | null): boolean {\n if (other == null) {\n return false;\n }\n\n const href = other instanceof Href ? other : new Href(other);\n\n if (!this.equals(href)) {\n return false;\n }\n\n if (this.parameters.length !== href.parameters.length) {\n return false;\n }\n\n if (this.parameters.length === 0 && href.parameters.length === 0) {\n return true;\n }\n\n const thisParams = this.parameters.map((param) => param.toString());\n\n return href.parameters.every((param) =>\n thisParams.includes(param.toString()),\n );\n }\n\n /**\n * Indicates if the link is a content link\n */\n get isContent(): boolean {\n return this.absolutepath.startsWith(\n `${getBasePathModularUI()}${CONTENT_PATH}`,\n );\n }\n\n /**\n */\n getReferenceHash(): ?number {\n return this._referenceHash;\n }\n\n /**\n */\n setReferenceHash(referenceHash: number) {\n this._referenceHash = referenceHash;\n }\n\n /**\n * Returns a complete url from the Href\n */\n toString(): string {\n return this.href;\n }\n\n /**\n */\n toLocation(): LocationShape {\n return {\n pathname: this.path,\n search:\n this.publicQuerystring.length > 0 ? `?${this.publicQuerystring}` : \"\",\n hash: this.hash.length > 0 ? `#${this.hash}` : \"\",\n state: {\n origin: this.origin,\n contextPath: this.contextPath,\n ...this.state,\n },\n };\n }\n}\n\nexport default Href;\n"],"mappings":";;;;;;AACA,SACEA,oBAAoB,EACpBC,YAAY,EACZC,YAAY,QACP,iBAAiB;AAExB,OAAOC,SAAS,MAAM,wBAAwB;AAiB9C;AACA;AACA;AACA,MAAMC,IAAI,CAAC;EAWT;AACF;AACA;EACEC,WAAWA,CACTC,IAAgB,EAChBC,YAAqB,EACrBC,YAA4B,EAC5B;IAAAC,eAAA,gBAjBc,EAAE;IAAAA,eAAA,gBACF,EAAE;IAAAA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AAM;QACnBC,WAAW,EAAE,IAAI,CAACA,WAAW;QAC7B,GAAG,IAAI,CAACI;MACV;IACF,CAAC;EACH;AACF;AAEA,eAAef,IAAI","ignoreList":[]}
|
|
1
|
+
{"version":3,"file":"Href.js","names":["getBasePathModularUI","HTTP_METHODS","CONTENT_PATH","Parameter","Href","constructor","href","resourcetype","modelOptions","_defineProperty","GET","setFromHref","setFromString","setFromLocationOrObject","origin","contextPath","path","parameters","hash","state","_origin","_contextPath","pathname","_path","search","addParametersFromString","Array","isArray","_parameters","_context","_mapInstanceProperty","call","param","addParameter","_name","_value","_prefix","getHashFromString","_hash","setStateFromLocationOrObject","_state","getPathFromString","isChangePassword","_context2","_includesInstanceProperty","isCamelRoute","_startsWithInstanceProperty","checkAbsoluteUrl","checkAbsolute","RegExp","test","isExternal","hrefNoHash","substring","indexOf","split","forEach","paramFromString","fromString","setParameter","name","value","prefix","removeParameter","push","getParameter","_context3","_findInstanceProperty","hasParameter","undefined","method","_method","_context4","valueToRemove","_context5","newValue","Function","bind","_filterInstanceProperty","val","join","_context6","getQuerystring","withPrefix","_context7","_context8","toQuerystring","getQuerystringForModularUI","_context9","_context0","isModUIParameter","querystring","publicQuerystring","setState","formdata","currentState","_resourcetype","absolutepath","length","absolutehref","absolutehrefPrefixedQuerystring","startsWith","thisPath","otherPath","equals","equalsWithParameters","other","_context1","thisParams","toString","every","isContent","_context10","getReferenceHash","_referenceHash","setReferenceHash","referenceHash","toLocation"],"sources":["../../../src/models/href/Href.js"],"sourcesContent":["// @flow\nimport {\n getBasePathModularUI,\n HTTP_METHODS,\n CONTENT_PATH,\n} from \"../../constants\";\n\nimport Parameter from \"../parameter/Parameter\";\n\nimport type { LocationShape } from \"react-router\";\nimport type { ModelOptions } from \"../types\";\n\ntype HrefObject = {\n _path: string,\n _hash: string,\n _parameters: Array<Parameter>,\n _resourcetype: string,\n _method: $Keys<typeof HTTP_METHODS>,\n _state: ?{ [key: string]: any },\n pathname: ?string,\n};\n\nexport type HrefInput = Href | HrefObject | LocationShape | string;\n\n/**\n * Defines a Href with the parameters\n */\nclass Href {\n _path: string = \"\";\n _hash: string = \"\";\n _parameters: Array<Parameter> = [];\n _resourcetype: string = \"\";\n _method: $Keys<typeof HTTP_METHODS> = HTTP_METHODS.GET;\n _state: any = null;\n _referenceHash: ?number;\n _origin: string = \"\";\n _contextPath: string = getBasePathModularUI();\n\n /**\n * Create a Href\n */\n constructor(\n href?: HrefInput,\n resourcetype?: string,\n modelOptions?: ?ModelOptions,\n ) {\n this.resourcetype = resourcetype ?? \"\";\n\n if (href instanceof Href) {\n this.setFromHref(href);\n } else if (typeof href === \"string\") {\n this.setFromString(href);\n } else if (typeof href === \"object\") {\n this.setFromLocationOrObject(href);\n }\n\n if (typeof modelOptions?.origin === \"string\") {\n this.origin = modelOptions.origin;\n }\n\n if (typeof modelOptions?.contextPath === \"string\") {\n this.contextPath = modelOptions.contextPath;\n }\n }\n\n /**\n * Set parameters from Href model input\n */\n setFromHref(href: Href) {\n this.origin = href.origin;\n this.contextPath = href.contextPath;\n this.path = href.path;\n this.parameters = href.parameters;\n this.hash = href.hash;\n this.state = href.state;\n }\n\n /**\n */\n setFromLocationOrObject(href: LocationShape | HrefObject) {\n // $FlowFixMe\n if (typeof href._origin === \"string\") {\n this.origin = href._origin;\n }\n // $FlowFixMe\n if (typeof href._contextPath === \"string\") {\n this.contextPath = href._contextPath;\n }\n\n if (typeof href[\"pathname\"] === \"string\") {\n this.path = href.pathname;\n } else if (typeof href._path === \"string\") {\n this.path = href._path;\n }\n\n if (href.search) {\n this.addParametersFromString(href.search);\n } else if (Array.isArray(href._parameters)) {\n // $FlowExpectedError[incompatible-call]\n href._parameters.map((param: Parameter) =>\n this.addParameter(param._name, param._value, param._prefix),\n );\n }\n\n if (href.hash) {\n this.hash = Href.getHashFromString(href.hash);\n } else if (typeof href._hash === \"string\") {\n this.hash = href._hash;\n }\n\n if (typeof href.state === \"object\") {\n this.setStateFromLocationOrObject(href.state);\n } else if (typeof href._state === \"object\") {\n this.setStateFromLocationOrObject(href._state);\n }\n }\n\n /**\n */\n setStateFromLocationOrObject(state?: any) {\n if (state != null) {\n this.state = state;\n if (typeof state.contextPath === \"string\") {\n this.contextPath = state.contextPath;\n }\n if (typeof state.origin === \"string\") {\n this.origin = state.origin;\n }\n }\n }\n\n /**\n * Set parameters from string input\n */\n setFromString(href: string) {\n this.path = Href.getPathFromString(href);\n this.addParametersFromString(href);\n this.hash = Href.getHashFromString(href);\n }\n\n /**\n */\n get isChangePassword(): boolean {\n return this._path.includes(\"/change-password\");\n }\n\n /**\n * check if the path is referencing a camel route\n */\n static isCamelRoute(path: string): boolean {\n return (\n path.startsWith(\"/restServices\") && !path.startsWith(\"/restServices/ui\")\n );\n }\n\n /**\n */\n static checkAbsoluteUrl(href: string): boolean {\n const checkAbsolute = new RegExp(\"^(?:[a-z]+:)?//\", \"i\");\n return checkAbsolute.test(href);\n }\n\n // Check if url is relative (not checking for absolute urls with same domain)\n /**\n */\n get isExternal(): boolean {\n return Href.checkAbsoluteUrl(this.path);\n }\n\n /**\n * Retrieve the relative path part of a href string, e.g. https://www.beinformed.com/BeInformed/tab/view?q=url => /tab/view\n */\n static getPathFromString(href: string): string {\n const hrefNoHash = href.includes(\"#\")\n ? href.substring(0, href.indexOf(\"#\"))\n : href;\n\n return hrefNoHash.includes(\"?\") ? hrefNoHash.split(\"?\")[0] : hrefNoHash;\n }\n\n /**\n * Retrieve hash of href string\n */\n static getHashFromString(href: string = \"\"): string {\n return href.includes(\"#\") ? href.substring(href.indexOf(\"#\") + 1) : \"\";\n }\n\n /**\n * Add a parameter for each parameter found in the querystring of an URL string, e.g. https://www.beinformed.com?q=url => q=url\n */\n addParametersFromString(href: string): Href {\n if (href.includes(\"?\")) {\n href\n .split(\"?\")[1]\n .split(\"&\")\n .forEach((param) => {\n const paramFromString = Parameter.fromString(param);\n if (paramFromString) {\n this.setParameter(\n paramFromString.name,\n paramFromString.value,\n paramFromString.prefix,\n );\n }\n });\n }\n\n return this;\n }\n\n /**\n * Add a querystring parameter to the parameter collection of this Href, skips parameters that have a value of null\n */\n addParameter(name: string, value: ?string, prefix: ?string): Href {\n if (value !== null) {\n this.removeParameter(name, prefix);\n this._parameters.push(new Parameter(prefix, name, value));\n }\n\n return this;\n }\n\n /**\n * Adds or overwrites a parameter when it exists and value is not null.\n * Removes the parameter when the value is null\n */\n setParameter(name: string, value: ?string, prefix: ?string): Href {\n if (value === null) {\n this.removeParameter(name, prefix);\n } else {\n this.addParameter(name, value, prefix);\n }\n\n return this;\n }\n\n /**\n * Retrieve a parameter by it's name and (optionally) prefix\n */\n getParameter(name: string, prefix: ?string): ?Parameter {\n return this._parameters.find(\n (param) => param.prefix === prefix && param.name === name,\n );\n }\n\n /**\n */\n hasParameter(name: string, prefix: ?string): boolean {\n return this.getParameter(name, prefix) !== undefined;\n }\n\n /**\n * Get request method\n */\n get method(): $Keys<typeof HTTP_METHODS> {\n return this._method;\n }\n\n /**\n * Set request method\n */\n set method(method: $Keys<typeof HTTP_METHODS>) {\n this._method = method || HTTP_METHODS.GET;\n }\n\n /**\n * Retrieve all paremters\n */\n get parameters(): Array<Parameter> {\n return this._parameters;\n }\n\n /**\n * Replace parameters of Href\n */\n set parameters(parameters: Array<Parameter>) {\n this._parameters = parameters;\n }\n\n /**\n * Remove a parameter from the parameter collection\n */\n removeParameter(name: string, prefix: ?string, value: ?string): Href {\n if (value) {\n const valueToRemove = value;\n\n this._parameters = this._parameters.map((param) => {\n if (param.prefix === prefix && param.name === name) {\n const newValue = param.value\n ?.split(\",\")\n .filter((val) => val !== valueToRemove)\n .join(\",\");\n return new Parameter(param.prefix, param.name, newValue);\n }\n return param;\n });\n } else {\n this._parameters = this._parameters.filter(\n (param) => param.prefix !== prefix || param.name !== name,\n );\n }\n\n return this;\n }\n\n /**\n * Get the parameters as a querystring, e.g. param1=value1¶m2=value2, optionally with prefix\n */\n getQuerystring(withPrefix: boolean = false): string {\n return this.parameters\n .filter((param) => param.value != null && param.value !== \"\")\n .map((param) => param.toQuerystring(withPrefix))\n .join(\"&\");\n }\n\n /**\n * Retrieve a querystring that only contains parameter that can be send to the modular ui, parameters are filtered by prefix\n */\n getQuerystringForModularUI(prefix: string = \"\"): string {\n return this.parameters\n .filter(\n (param) =>\n param.isModUIParameter &&\n (!prefix || !param.prefix || param.prefix === prefix) &&\n param.value != null &&\n param.value !== \"\",\n )\n .map((param) => param.toQuerystring(false))\n .join(\"&\");\n }\n\n /**\n * Retrieve all parameters from the parameter collection in a querystring style name1=value1&name2=value2, without the prefix\n */\n get querystring(): string {\n return this.getQuerystring(false);\n }\n\n /**\n * Retrieve all parameters from the parameter collection in a querystring style prefix~name1=value1&prefix~name2=value2, with the prefix\n * The prefix is used to identify parameters per component on a grouping panel\n * @returns {string}\n */\n get publicQuerystring(): string {\n return this.getQuerystring(true);\n }\n\n /**\n * Set the path of the Href, the part before the querystring question mark\n */\n set path(path: string) {\n this._path = path;\n }\n\n /**\n * Retrieve the path\n */\n get path(): string {\n return this._path ?? \"\";\n }\n\n /**\n * Retrieve the origin (e.g. http://example.com:18080)<br>\n * Empty when the default must be used\n */\n get origin(): string {\n return this._origin ?? \"\";\n }\n\n /**\n * Set the origin (e.g. http://example.com:18080)\n */\n set origin(origin: string) {\n this._origin = origin;\n }\n\n /**\n * Get the context path\n */\n get contextPath(): string {\n return this._contextPath;\n }\n\n /**\n * Set the context path if different from default\n */\n set contextPath(contextPath: string) {\n this._contextPath = contextPath;\n }\n\n /**\n * Set hash\n */\n set hash(hash: string) {\n this._hash = hash;\n }\n\n /**\n * Retrieve hash\n */\n get hash(): string {\n return this._hash;\n }\n\n /**\n */\n set state(state: any) {\n this._state = state;\n }\n\n /**\n */\n get state(): any {\n return this._state;\n }\n\n /**\n */\n setState(state: any): Href {\n this.state = state;\n\n return this;\n }\n\n /**\n */\n set formdata(formdata: any) {\n const currentState = this.state ?? {};\n\n this.state = {\n ...currentState,\n formdata,\n };\n }\n\n /**\n */\n get formdata(): any {\n return this.state?.formdata;\n }\n\n /**\n * Set resourctype\n */\n set resourcetype(resourcetype: string) {\n this._resourcetype = resourcetype;\n }\n\n /**\n * Retrieve resourceType\n */\n get resourcetype(): string {\n return this._resourcetype;\n }\n\n /**\n * Retrieve the path combined with the base path (context-path) of the application, e.g. /BeInformed\n */\n get absolutepath(): string {\n if (this.isExternal) {\n return this.path;\n }\n\n return this.origin + this.contextPath + this.path;\n }\n\n /**\n * Retrieves the combination of the path and the querystring\n */\n get href(): string {\n return this.querystring.length > 0\n ? [this.path, this.querystring].join(\"?\")\n : this.path;\n }\n\n /**\n * Getting the URL including the base path, querystring is prefixed\n */\n get absolutehref(): string {\n const querystring = this.getQuerystring(false);\n\n return querystring.length > 0\n ? [this.absolutepath, querystring].join(\"?\")\n : this.absolutepath;\n }\n\n /**\n * Getting the URL including the base path, the querystring is prefixed\n */\n get absolutehrefPrefixedQuerystring(): string {\n const querystring = this.getQuerystring(true);\n\n return querystring.length > 0\n ? [this.absolutepath, querystring].join(\"?\")\n : this.absolutepath;\n }\n\n /**\n * Checks if the URL starts within the given href\n */\n startsWith(href: Href | string): boolean {\n const thisPath = `${this.path}/`;\n const otherPath = href instanceof Href ? `${href.path}/` : href;\n\n return thisPath.startsWith(otherPath);\n }\n\n /**\n * Checks if the given Href equals this Href\n */\n equals(href: Href | string | null): boolean {\n if (href instanceof Href) {\n return this.path === href.path;\n }\n\n return this.path === href;\n }\n\n /**\n */\n equalsWithParameters(other: Href | string | null): boolean {\n if (other == null) {\n return false;\n }\n\n const href = other instanceof Href ? other : new Href(other);\n\n if (!this.equals(href)) {\n return false;\n }\n\n if (this.parameters.length !== href.parameters.length) {\n return false;\n }\n\n if (this.parameters.length === 0 && href.parameters.length === 0) {\n return true;\n }\n\n const thisParams = this.parameters.map((param) => param.toString());\n\n return href.parameters.every((param) =>\n thisParams.includes(param.toString()),\n );\n }\n\n /**\n * Indicates if the link is a content link\n */\n get isContent(): boolean {\n return this.absolutepath.startsWith(\n `${getBasePathModularUI()}${CONTENT_PATH}`,\n );\n }\n\n /**\n */\n getReferenceHash(): ?number {\n return this._referenceHash;\n }\n\n /**\n */\n setReferenceHash(referenceHash: number) {\n this._referenceHash = referenceHash;\n }\n\n /**\n * Returns a complete url from the Href\n */\n toString(): string {\n return this.href;\n }\n\n /**\n */\n toLocation(): LocationShape {\n return {\n pathname: this.path,\n search:\n this.publicQuerystring.length > 0 ? `?${this.publicQuerystring}` : \"\",\n hash: this.hash.length > 0 ? `#${this.hash}` : \"\",\n state: {\n origin: this.origin,\n contextPath: this.contextPath,\n ...this.state,\n },\n };\n }\n}\n\nexport default Href;\n"],"mappings":";;;;;;AACA,SACEA,oBAAoB,EACpBC,YAAY,EACZC,YAAY,QACP,iBAAiB;AAExB,OAAOC,SAAS,MAAM,wBAAwB;AAiB9C;AACA;AACA;AACA,MAAMC,IAAI,CAAC;EAWT;AACF;AACA;EACEC,WAAWA,CACTC,IAAgB,EAChBC,YAAqB,EACrBC,YAA4B,EAC5B;IAAAC,eAAA,gBAjBc,EAAE;IAAAA,eAAA,gBACF,EAAE;IAAAA,eAAA,sBACc,EAAE;IAAAA,eAAA,wBACV,EAAE;IAAAA,eAAA,kBACYR,YAAY,CAACS,GAAG;IAAAD,eAAA,iBACxC,IAAI;IAAAA,eAAA;IAAAA,eAAA,kBAEA,EAAE;IAAAA,eAAA,uBACGT,oBAAoB,CAAC,CAAC;IAU3C,IAAI,CAACO,YAAY,GAAGA,YAAY,IAAI,EAAE;IAEtC,IAAID,IAAI,YAAYF,IAAI,EAAE;MACxB,IAAI,CAACO,WAAW,CAACL,IAAI,CAAC;IACxB,CAAC,MAAM,IAAI,OAAOA,IAAI,KAAK,QAAQ,EAAE;MACnC,IAAI,CAACM,aAAa,CAACN,IAAI,CAAC;IAC1B,CAAC,MAAM,IAAI,OAAOA,IAAI,KAAK,QAAQ,EAAE;MACnC,IAAI,CAACO,uBAAuB,CAACP,IAAI,CAAC;IACpC;IAEA,IAAI,OAAOE,YAAY,EAAEM,MAAM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GAAGE,YAAY,EAC1C,CAAC;EACH;;EAEA;AACF;EACE+G,gBAAgBA,CAAA,EAAY;IAC1B,OAAO,IAAI,CAACC,cAAc;EAC5B;;EAEA;AACF;EACEC,gBAAgBA,CAACC,aAAqB,EAAE;IACtC,IAAI,CAACF,cAAc,GAAGE,aAAa;EACrC;;EAEA;AACF;AACA;EACEP,QAAQA,CAAA,EAAW;IACjB,OAAO,IAAI,CAACvG,IAAI;EAClB;;EAEA;AACF;EACE+G,UAAUA,CAAA,EAAkB;IAC1B,OAAO;MACL/F,QAAQ,EAAE,IAAI,CAACN,IAAI;MACnBQ,MAAM,EACJ,IAAI,CAACoE,iBAAiB,CAACM,MAAM,GAAG,CAAC,GAAG,IAAI,IAAI,CAACN,iBAAiB,EAAE,GAAG,EAAE;MACvE1E,IAAI,EAAE,IAAI,CAACA,IAAI,CAACgF,MAAM,GAAG,CAAC,GAAG,IAAI,IAAI,CAAChF,IAAI,EAAE,GAAG,EAAE;MACjDC,KAAK,EAAE;QACLL,MAAM,EAAE,IAAI,CAACA,MAAM;QACnBC,WAAW,EAAE,IAAI,CAACA,WAAW;QAC7B,GAAG,IAAI,CAACI;MACV;IACF,CAAC;EACH;AACF;AAEA,eAAef,IAAI","ignoreList":[]}
|
package/esm/models/index.js
CHANGED
|
@@ -28,7 +28,7 @@ export { default as LayoutHintRuleCollection, addLayoutHintRule, updateLayoutHin
|
|
|
28
28
|
export { default as BaseLayoutHintRule } from "./attributes/layouthint-rules/BaseLayoutHintRule";
|
|
29
29
|
export { default as DependentAttribute } from "./attributes/layouthint-rules/DependentAttribute";
|
|
30
30
|
export { default as RemainingTotalUploadSize } from "./attributes/layouthint-rules/RemainingTotalUploadSize";
|
|
31
|
-
|
|
31
|
+
export { default as LayoutHintCollection } from "./layouthint/LayoutHintCollection";
|
|
32
32
|
import { default as CaseViewModel } from "./caseview/CaseViewModel";
|
|
33
33
|
import { default as BusinessScenarioModel } from "./concepts/BusinessScenarioModel";
|
|
34
34
|
import { default as ConceptDetailModel } from "./concepts/ConceptDetailModel";
|
|
@@ -92,5 +92,5 @@ import { default as TaskGroupModel } from "./taskgroup/TaskGroupModel";
|
|
|
92
92
|
import { default as UserModel } from "./user/UserModel";
|
|
93
93
|
import { default as UserProfileModel } from "./user/UserProfileModel";
|
|
94
94
|
import { default as UserServicesModel } from "./user/UserServicesModel";
|
|
95
|
-
export { ApplicationModel, CaseSearchModel, CaseViewModel, ListDetailModel, DetailModel, FormModel, GroupingPanelModel, ListModel, TabModel, TaskGroupModel, UserModel, UserProfileModel, UserServicesModel, ModelCatalogModel, ConceptIndexModel, ConceptDetailModel, BusinessScenarioModel, ConceptTypeDetailModel, ContentIndexModel, ContentTOCModel, ContentModel, ContentTypeModel, BooleanAttributeModel, CaptchaAttributeModel, ChoiceAttributeModel, DatetimeAttributeModel, HelptextAttributeModel, LabelAttributeModel, MemoAttributeModel, MoneyAttributeModel, NumberAttributeModel, PasswordAttributeModel, CompositeAttributeModel, StringAttributeModel, UploadAttributeModel, XMLAttributeModel, AssignmentFilterModel, FilterModel, RangeFilterModel, ConceptIndexFilterModel
|
|
95
|
+
export { ApplicationModel, CaseSearchModel, CaseViewModel, ListDetailModel, DetailModel, FormModel, GroupingPanelModel, ListModel, TabModel, TaskGroupModel, UserModel, UserProfileModel, UserServicesModel, ModelCatalogModel, ConceptIndexModel, ConceptDetailModel, BusinessScenarioModel, ConceptTypeDetailModel, ContentIndexModel, ContentTOCModel, ContentModel, ContentTypeModel, BooleanAttributeModel, CaptchaAttributeModel, ChoiceAttributeModel, DatetimeAttributeModel, HelptextAttributeModel, LabelAttributeModel, MemoAttributeModel, MoneyAttributeModel, NumberAttributeModel, PasswordAttributeModel, CompositeAttributeModel, StringAttributeModel, UploadAttributeModel, XMLAttributeModel, AssignmentFilterModel, FilterModel, RangeFilterModel, ConceptIndexFilterModel };
|
|
96
96
|
//# sourceMappingURL=index.js.map
|
package/esm/models/index.js.flow
CHANGED
|
@@ -41,7 +41,7 @@ export { default as BaseLayoutHintRule } from "./attributes/layouthint-rules/Bas
|
|
|
41
41
|
export { default as DependentAttribute } from "./attributes/layouthint-rules/DependentAttribute";
|
|
42
42
|
export { default as RemainingTotalUploadSize } from "./attributes/layouthint-rules/RemainingTotalUploadSize";
|
|
43
43
|
|
|
44
|
-
|
|
44
|
+
export { default as LayoutHintCollection } from "./layouthint/LayoutHintCollection";
|
|
45
45
|
|
|
46
46
|
import { default as CaseViewModel } from "./caseview/CaseViewModel";
|
|
47
47
|
|
|
@@ -171,7 +171,6 @@ export {
|
|
|
171
171
|
FilterModel,
|
|
172
172
|
RangeFilterModel,
|
|
173
173
|
ConceptIndexFilterModel,
|
|
174
|
-
LayoutHintCollection,
|
|
175
174
|
};
|
|
176
175
|
|
|
177
176
|
export type * from "./types";
|
package/esm/models/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["default","resolveModel","BaseCollection","ActionCollection","ActionModel","ApplicationModel","AttributeCollection","AttributeSetModel","AttributeModel","BooleanAttributeModel","CaptchaAttributeModel","ChoiceAttributeModel","ChoiceAttributeOptionCollection","ChoiceAttributeOptionModel","CompositeAttributeModel","CompositeAttributeChildCollection","DatetimeAttributeModel","HelptextAttributeModel","LabelAttributeModel","MemoAttributeModel","MoneyAttributeModel","NumberAttributeModel","PasswordAttributeModel","StringAttributeModel","UploadAttributeModel","XMLAttributeModel","AttributeContent","LayoutHintRuleCollection","addLayoutHintRule","updateLayoutHintRules","BaseLayoutHintRule","DependentAttribute","RemainingTotalUploadSize","LayoutHintCollection","CaseViewModel","BusinessScenarioModel","ConceptDetailModel","ConceptIndexModel","ConceptLinkModel","ConceptRelationCollection","ConceptRelationModel","ConceptTypeDetailModel","SourceReferenceCollection","SourceReferenceModel","ConstraintCollection","ConstraintModel","ContentIndexModel","ContentLinkModel","ContentModel","ContentTOCModel","ContentTypeModel","SectionModel","SubSectionModel","ContentConfiguration","ContentConfigurationElements","ContentConfigurationEndResults","ContentConfigurationQuestions","ContentConfigurationResults","DetailModel","ErrorCollection","ErrorModel","ErrorResponse","AssignmentFilterModel","FilterModel","RangeFilterModel","ConceptIndexFilterModel","FilterCollection","FormModel","FormObjectModel","GroupingModel","GroupModel","Href","ListHref","LinkCollection","LinkModel","ListDetailModel","ListHeaderModel","ListItemCollection","ListItemModel","ListModel","LookupOptionsModel","LookupOptionCollection","ModelCatalogModel","ModelCategory","ProcessStatusSettingsModel","PagesizeModel","PagingModel","Parameter","GroupingPanelModel","CaseSearchModel","SortingModel","SortOptionModel","TabModel","TaskGroupCollection","TaskGroupModel","UserModel","UserProfileModel","UserServicesModel"],"sources":["../../src/models/index.js"],"sourcesContent":["// @flow\nexport { default as resolveModel } from \"./resolveModel\";\n\nexport { default as BaseCollection } from \"./base/BaseCollection\";\n\nexport { default as ActionCollection } from \"./actions/ActionCollection\";\nexport { default as ActionModel } from \"./actions/ActionModel\";\n\nimport { default as ApplicationModel } from \"./application/ApplicationModel\";\n\nexport { default as AttributeCollection } from \"./attributes/AttributeCollection\";\nexport { default as AttributeSetModel } from \"./attributes/AttributeSetModel\";\n\nexport { default as AttributeModel } from \"./attributes/AttributeModel\";\nimport { default as BooleanAttributeModel } from \"./attributes/BooleanAttributeModel\";\nimport { default as CaptchaAttributeModel } from \"./attributes/CaptchaAttributeModel\";\nimport { default as ChoiceAttributeModel } from \"./attributes/ChoiceAttributeModel\";\nexport { default as ChoiceAttributeOptionCollection } from \"./attributes/ChoiceAttributeOptionCollection\";\nexport { default as ChoiceAttributeOptionModel } from \"./attributes/ChoiceAttributeOptionModel\";\nimport { default as CompositeAttributeModel } from \"./attributes/CompositeAttributeModel\";\nexport { default as CompositeAttributeChildCollection } from \"./attributes/CompositeAttributeChildCollection\";\nimport { default as DatetimeAttributeModel } from \"./attributes/DatetimeAttributeModel\";\nimport { default as HelptextAttributeModel } from \"./attributes/HelptextAttributeModel\";\nimport { default as LabelAttributeModel } from \"./attributes/LabelAttributeModel\";\nimport { default as MemoAttributeModel } from \"./attributes/MemoAttributeModel\";\nimport { default as MoneyAttributeModel } from \"./attributes/MoneyAttributeModel\";\nimport { default as NumberAttributeModel } from \"./attributes/NumberAttributeModel\";\nimport { default as PasswordAttributeModel } from \"./attributes/PasswordAttributeModel\";\nimport { default as StringAttributeModel } from \"./attributes/StringAttributeModel\";\nimport { default as UploadAttributeModel } from \"./attributes/UploadAttributeModel\";\nimport { default as XMLAttributeModel } from \"./attributes/XMLAttributeModel\";\n\nexport { default as AttributeContent } from \"./attributes/AttributeContent\";\n\nexport {\n default as LayoutHintRuleCollection,\n addLayoutHintRule,\n updateLayoutHintRules,\n} from \"./attributes/layouthint-rules/LayoutHintRuleCollection\";\nexport { default as BaseLayoutHintRule } from \"./attributes/layouthint-rules/BaseLayoutHintRule\";\nexport { default as DependentAttribute } from \"./attributes/layouthint-rules/DependentAttribute\";\nexport { default as RemainingTotalUploadSize } from \"./attributes/layouthint-rules/RemainingTotalUploadSize\";\n\nimport { default as LayoutHintCollection } from \"./layouthint/LayoutHintCollection\";\n\nimport { default as CaseViewModel } from \"./caseview/CaseViewModel\";\n\nimport { default as BusinessScenarioModel } from \"./concepts/BusinessScenarioModel\";\nimport { default as ConceptDetailModel } from \"./concepts/ConceptDetailModel\";\nimport { default as ConceptIndexModel } from \"./concepts/ConceptIndexModel\";\nexport { default as ConceptLinkModel } from \"./concepts/ConceptLinkModel\";\nexport { default as ConceptRelationCollection } from \"./concepts/ConceptRelationCollection\";\nexport { default as ConceptRelationModel } from \"./concepts/ConceptRelationModel\";\nimport { default as ConceptTypeDetailModel } from \"./concepts/ConceptTypeDetailModel\";\nexport { default as SourceReferenceCollection } from \"./concepts/SourceReferenceCollection\";\nexport { default as SourceReferenceModel } from \"./concepts/SourceReferenceModel\";\n\nexport { default as ConstraintCollection } from \"./attributes/input-constraints/ConstraintCollection\";\nexport { default as ConstraintModel } from \"./attributes/input-constraints/ConstraintModel\";\n\nimport { default as ContentIndexModel } from \"./content/ContentIndexModel\";\nexport { default as ContentLinkModel } from \"./content/ContentLinkModel\";\nimport { default as ContentModel } from \"./content/ContentModel\";\nimport { default as ContentTOCModel } from \"./content/ContentTOCModel\";\nimport { default as ContentTypeModel } from \"./content/ContentTypeModel\";\nexport { default as SectionModel } from \"./content/SectionModel\";\nexport { default as SubSectionModel } from \"./content/SubSectionModel\";\n\nexport { default as ContentConfiguration } from \"./contentconfiguration/ContentConfiguration\";\nexport { default as ContentConfigurationElements } from \"./contentconfiguration/ContentConfigurationElements\";\nexport { default as ContentConfigurationEndResults } from \"./contentconfiguration/ContentConfigurationEndResults\";\nexport { default as ContentConfigurationQuestions } from \"./contentconfiguration/ContentConfigurationQuestions\";\nexport { default as ContentConfigurationResults } from \"./contentconfiguration/ContentConfigurationResults\";\n\nimport { default as DetailModel } from \"./detail/DetailModel\";\n\nexport { default as ErrorCollection } from \"./error/ErrorCollection\";\nexport { default as ErrorModel } from \"./error/ErrorModel\";\nexport { default as ErrorResponse } from \"./error/ErrorResponse\";\n\nimport { default as AssignmentFilterModel } from \"./filters/AssignmentFilterModel\";\nimport { default as FilterModel } from \"./filters/FilterModel\";\nimport { default as RangeFilterModel } from \"./filters/RangeFilterModel\";\nimport { default as ConceptIndexFilterModel } from \"./filters/ConceptIndexFilterModel\";\nexport { default as FilterCollection } from \"./filters/FilterCollection\";\n\nimport { default as FormModel } from \"./form/FormModel\";\nexport { default as FormObjectModel } from \"./form/FormObjectModel\";\n\nexport { default as GroupingModel, GroupModel } from \"./grouping/GroupingModel\";\n\nexport { default as Href } from \"./href/Href\";\nexport { default as ListHref } from \"./href/ListHref\";\n\nexport { default as LinkCollection } from \"./links/LinkCollection\";\nexport { default as LinkModel } from \"./links/LinkModel\";\n\nimport { default as ListDetailModel } from \"./list/ListDetailModel\";\nexport { default as ListHeaderModel } from \"./list/ListHeaderModel\";\nexport { default as ListItemCollection } from \"./list/ListItemCollection\";\nexport { default as ListItemModel } from \"./list/ListItemModel\";\nimport { default as ListModel } from \"./list/ListModel\";\n\nexport { default as LookupOptionsModel } from \"./lookup/LookupOptionsModel\";\nexport { default as LookupOptionCollection } from \"./lookup/LookupOptionCollection\";\n\nimport { default as ModelCatalogModel } from \"./modelcatalog/ModelCatalogModel\";\nexport { default as ModelCategory } from \"./modelcatalog/ModelCategoryModel\";\n\nexport { default as ProcessStatusSettingsModel } from \"./process/ProcessStatusSettingsModel\";\n\nexport { default as PagesizeModel } from \"./paging/PagesizeModel\";\nexport { default as PagingModel } from \"./paging/PagingModel\";\n\nexport { default as Parameter } from \"./parameter/Parameter\";\n\nimport { default as GroupingPanelModel } from \"./panels/GroupingPanelModel\";\n\nimport { default as CaseSearchModel } from \"./search/CaseSearchModel\";\n\nexport { default as SortingModel } from \"./sorting/SortingModel\";\nexport { default as SortOptionModel } from \"./sorting/SortOptionModel\";\n\nimport { default as TabModel } from \"./tab/TabModel\";\n\nexport { default as TaskGroupCollection } from \"./taskgroup/TaskGroupCollection\";\nimport { default as TaskGroupModel } from \"./taskgroup/TaskGroupModel\";\n\nimport { default as UserModel } from \"./user/UserModel\";\nimport { default as UserProfileModel } from \"./user/UserProfileModel\";\nimport { default as UserServicesModel } from \"./user/UserServicesModel\";\n\nexport {\n ApplicationModel,\n CaseSearchModel,\n CaseViewModel,\n ListDetailModel,\n DetailModel,\n FormModel,\n GroupingPanelModel,\n ListModel,\n TabModel,\n TaskGroupModel,\n UserModel,\n UserProfileModel,\n UserServicesModel,\n ModelCatalogModel,\n ConceptIndexModel,\n ConceptDetailModel,\n BusinessScenarioModel,\n ConceptTypeDetailModel,\n ContentIndexModel,\n ContentTOCModel,\n ContentModel,\n ContentTypeModel,\n BooleanAttributeModel,\n CaptchaAttributeModel,\n ChoiceAttributeModel,\n DatetimeAttributeModel,\n HelptextAttributeModel,\n LabelAttributeModel,\n MemoAttributeModel,\n MoneyAttributeModel,\n NumberAttributeModel,\n PasswordAttributeModel,\n CompositeAttributeModel,\n StringAttributeModel,\n UploadAttributeModel,\n XMLAttributeModel,\n AssignmentFilterModel,\n FilterModel,\n R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Q,0BAA0B;AAEvE,SACE5F,gBAAgB,EAChBoF,eAAe,EACfvD,aAAa,EACbyC,eAAe,EACfjB,WAAW,EACXS,SAAS,EACTqB,kBAAkB,EAClBT,SAAS,EACTa,QAAQ,EACRE,cAAc,EACdC,SAAS,EACTC,gBAAgB,EAChBC,iBAAiB,EACjBf,iBAAiB,EACjB7C,iBAAiB,EACjBD,kBAAkB,EAClBD,qBAAqB,EACrBM,sBAAsB,EACtBK,iBAAiB,EACjBG,eAAe,EACfD,YAAY,EACZE,gBAAgB,EAChBzC,qBAAqB,EACrBC,qBAAqB,EACrBC,oBAAoB,EACpBK,sBAAsB,EACtBC,sBAAsB,EACtBC,mBAAmB,EACnBC,kBAAkB,EAClBC,mBAAmB,EACnBC,oBAAoB,EACpBC,sBAAsB,EACtBR,uBAAuB,EACvBS,oBAAoB,EACpBC,oBAAoB,EACpBC,iBAAiB,EACjBqC,qBAAqB,EACrBC,WAAW,EACXC,gBAAgB,EAChBC,uBAAuB,EACvBhC,oBAAoB","ignoreList":[]}
|
|
1
|
+
{"version":3,"file":"index.js","names":["default","resolveModel","BaseCollection","ActionCollection","ActionModel","ApplicationModel","AttributeCollection","AttributeSetModel","AttributeModel","BooleanAttributeModel","CaptchaAttributeModel","ChoiceAttributeModel","ChoiceAttributeOptionCollection","ChoiceAttributeOptionModel","CompositeAttributeModel","CompositeAttributeChildCollection","DatetimeAttributeModel","HelptextAttributeModel","LabelAttributeModel","MemoAttributeModel","MoneyAttributeModel","NumberAttributeModel","PasswordAttributeModel","StringAttributeModel","UploadAttributeModel","XMLAttributeModel","AttributeContent","LayoutHintRuleCollection","addLayoutHintRule","updateLayoutHintRules","BaseLayoutHintRule","DependentAttribute","RemainingTotalUploadSize","LayoutHintCollection","CaseViewModel","BusinessScenarioModel","ConceptDetailModel","ConceptIndexModel","ConceptLinkModel","ConceptRelationCollection","ConceptRelationModel","ConceptTypeDetailModel","SourceReferenceCollection","SourceReferenceModel","ConstraintCollection","ConstraintModel","ContentIndexModel","ContentLinkModel","ContentModel","ContentTOCModel","ContentTypeModel","SectionModel","SubSectionModel","ContentConfiguration","ContentConfigurationElements","ContentConfigurationEndResults","ContentConfigurationQuestions","ContentConfigurationResults","DetailModel","ErrorCollection","ErrorModel","ErrorResponse","AssignmentFilterModel","FilterModel","RangeFilterModel","ConceptIndexFilterModel","FilterCollection","FormModel","FormObjectModel","GroupingModel","GroupModel","Href","ListHref","LinkCollection","LinkModel","ListDetailModel","ListHeaderModel","ListItemCollection","ListItemModel","ListModel","LookupOptionsModel","LookupOptionCollection","ModelCatalogModel","ModelCategory","ProcessStatusSettingsModel","PagesizeModel","PagingModel","Parameter","GroupingPanelModel","CaseSearchModel","SortingModel","SortOptionModel","TabModel","TaskGroupCollection","TaskGroupModel","UserModel","UserProfileModel","UserServicesModel"],"sources":["../../src/models/index.js"],"sourcesContent":["// @flow\nexport { default as resolveModel } from \"./resolveModel\";\n\nexport { default as BaseCollection } from \"./base/BaseCollection\";\n\nexport { default as ActionCollection } from \"./actions/ActionCollection\";\nexport { default as ActionModel } from \"./actions/ActionModel\";\n\nimport { default as ApplicationModel } from \"./application/ApplicationModel\";\n\nexport { default as AttributeCollection } from \"./attributes/AttributeCollection\";\nexport { default as AttributeSetModel } from \"./attributes/AttributeSetModel\";\n\nexport { default as AttributeModel } from \"./attributes/AttributeModel\";\nimport { default as BooleanAttributeModel } from \"./attributes/BooleanAttributeModel\";\nimport { default as CaptchaAttributeModel } from \"./attributes/CaptchaAttributeModel\";\nimport { default as ChoiceAttributeModel } from \"./attributes/ChoiceAttributeModel\";\nexport { default as ChoiceAttributeOptionCollection } from \"./attributes/ChoiceAttributeOptionCollection\";\nexport { default as ChoiceAttributeOptionModel } from \"./attributes/ChoiceAttributeOptionModel\";\nimport { default as CompositeAttributeModel } from \"./attributes/CompositeAttributeModel\";\nexport { default as CompositeAttributeChildCollection } from \"./attributes/CompositeAttributeChildCollection\";\nimport { default as DatetimeAttributeModel } from \"./attributes/DatetimeAttributeModel\";\nimport { default as HelptextAttributeModel } from \"./attributes/HelptextAttributeModel\";\nimport { default as LabelAttributeModel } from \"./attributes/LabelAttributeModel\";\nimport { default as MemoAttributeModel } from \"./attributes/MemoAttributeModel\";\nimport { default as MoneyAttributeModel } from \"./attributes/MoneyAttributeModel\";\nimport { default as NumberAttributeModel } from \"./attributes/NumberAttributeModel\";\nimport { default as PasswordAttributeModel } from \"./attributes/PasswordAttributeModel\";\nimport { default as StringAttributeModel } from \"./attributes/StringAttributeModel\";\nimport { default as UploadAttributeModel } from \"./attributes/UploadAttributeModel\";\nimport { default as XMLAttributeModel } from \"./attributes/XMLAttributeModel\";\n\nexport { default as AttributeContent } from \"./attributes/AttributeContent\";\n\nexport {\n default as LayoutHintRuleCollection,\n addLayoutHintRule,\n updateLayoutHintRules,\n} from \"./attributes/layouthint-rules/LayoutHintRuleCollection\";\nexport { default as BaseLayoutHintRule } from \"./attributes/layouthint-rules/BaseLayoutHintRule\";\nexport { default as DependentAttribute } from \"./attributes/layouthint-rules/DependentAttribute\";\nexport { default as RemainingTotalUploadSize } from \"./attributes/layouthint-rules/RemainingTotalUploadSize\";\n\nexport { default as LayoutHintCollection } from \"./layouthint/LayoutHintCollection\";\n\nimport { default as CaseViewModel } from \"./caseview/CaseViewModel\";\n\nimport { default as BusinessScenarioModel } from \"./concepts/BusinessScenarioModel\";\nimport { default as ConceptDetailModel } from \"./concepts/ConceptDetailModel\";\nimport { default as ConceptIndexModel } from \"./concepts/ConceptIndexModel\";\nexport { default as ConceptLinkModel } from \"./concepts/ConceptLinkModel\";\nexport { default as ConceptRelationCollection } from \"./concepts/ConceptRelationCollection\";\nexport { default as ConceptRelationModel } from \"./concepts/ConceptRelationModel\";\nimport { default as ConceptTypeDetailModel } from \"./concepts/ConceptTypeDetailModel\";\nexport { default as SourceReferenceCollection } from \"./concepts/SourceReferenceCollection\";\nexport { default as SourceReferenceModel } from \"./concepts/SourceReferenceModel\";\n\nexport { default as ConstraintCollection } from \"./attributes/input-constraints/ConstraintCollection\";\nexport { default as ConstraintModel } from \"./attributes/input-constraints/ConstraintModel\";\n\nimport { default as ContentIndexModel } from \"./content/ContentIndexModel\";\nexport { default as ContentLinkModel } from \"./content/ContentLinkModel\";\nimport { default as ContentModel } from \"./content/ContentModel\";\nimport { default as ContentTOCModel } from \"./content/ContentTOCModel\";\nimport { default as ContentTypeModel } from \"./content/ContentTypeModel\";\nexport { default as SectionModel } from \"./content/SectionModel\";\nexport { default as SubSectionModel } from \"./content/SubSectionModel\";\n\nexport { default as ContentConfiguration } from \"./contentconfiguration/ContentConfiguration\";\nexport { default as ContentConfigurationElements } from \"./contentconfiguration/ContentConfigurationElements\";\nexport { default as ContentConfigurationEndResults } from \"./contentconfiguration/ContentConfigurationEndResults\";\nexport { default as ContentConfigurationQuestions } from \"./contentconfiguration/ContentConfigurationQuestions\";\nexport { default as ContentConfigurationResults } from \"./contentconfiguration/ContentConfigurationResults\";\n\nimport { default as DetailModel } from \"./detail/DetailModel\";\n\nexport { default as ErrorCollection } from \"./error/ErrorCollection\";\nexport { default as ErrorModel } from \"./error/ErrorModel\";\nexport { default as ErrorResponse } from \"./error/ErrorResponse\";\n\nimport { default as AssignmentFilterModel } from \"./filters/AssignmentFilterModel\";\nimport { default as FilterModel } from \"./filters/FilterModel\";\nimport { default as RangeFilterModel } from \"./filters/RangeFilterModel\";\nimport { default as ConceptIndexFilterModel } from \"./filters/ConceptIndexFilterModel\";\nexport { default as FilterCollection } from \"./filters/FilterCollection\";\n\nimport { default as FormModel } from \"./form/FormModel\";\nexport { default as FormObjectModel } from \"./form/FormObjectModel\";\n\nexport { default as GroupingModel, GroupModel } from \"./grouping/GroupingModel\";\n\nexport { default as Href } from \"./href/Href\";\nexport { default as ListHref } from \"./href/ListHref\";\n\nexport { default as LinkCollection } from \"./links/LinkCollection\";\nexport { default as LinkModel } from \"./links/LinkModel\";\n\nimport { default as ListDetailModel } from \"./list/ListDetailModel\";\nexport { default as ListHeaderModel } from \"./list/ListHeaderModel\";\nexport { default as ListItemCollection } from \"./list/ListItemCollection\";\nexport { default as ListItemModel } from \"./list/ListItemModel\";\nimport { default as ListModel } from \"./list/ListModel\";\n\nexport { default as LookupOptionsModel } from \"./lookup/LookupOptionsModel\";\nexport { default as LookupOptionCollection } from \"./lookup/LookupOptionCollection\";\n\nimport { default as ModelCatalogModel } from \"./modelcatalog/ModelCatalogModel\";\nexport { default as ModelCategory } from \"./modelcatalog/ModelCategoryModel\";\n\nexport { default as ProcessStatusSettingsModel } from \"./process/ProcessStatusSettingsModel\";\n\nexport { default as PagesizeModel } from \"./paging/PagesizeModel\";\nexport { default as PagingModel } from \"./paging/PagingModel\";\n\nexport { default as Parameter } from \"./parameter/Parameter\";\n\nimport { default as GroupingPanelModel } from \"./panels/GroupingPanelModel\";\n\nimport { default as CaseSearchModel } from \"./search/CaseSearchModel\";\n\nexport { default as SortingModel } from \"./sorting/SortingModel\";\nexport { default as SortOptionModel } from \"./sorting/SortOptionModel\";\n\nimport { default as TabModel } from \"./tab/TabModel\";\n\nexport { default as TaskGroupCollection } from \"./taskgroup/TaskGroupCollection\";\nimport { default as TaskGroupModel } from \"./taskgroup/TaskGroupModel\";\n\nimport { default as UserModel } from \"./user/UserModel\";\nimport { default as UserProfileModel } from \"./user/UserProfileModel\";\nimport { default as UserServicesModel } from \"./user/UserServicesModel\";\n\nexport {\n ApplicationModel,\n CaseSearchModel,\n CaseViewModel,\n ListDetailModel,\n DetailModel,\n FormModel,\n GroupingPanelModel,\n ListModel,\n TabModel,\n TaskGroupModel,\n UserModel,\n UserProfileModel,\n UserServicesModel,\n ModelCatalogModel,\n ConceptIndexModel,\n ConceptDetailModel,\n BusinessScenarioModel,\n ConceptTypeDetailModel,\n ContentIndexModel,\n ContentTOCModel,\n ContentModel,\n ContentTypeModel,\n BooleanAttributeModel,\n CaptchaAttributeModel,\n ChoiceAttributeModel,\n DatetimeAttributeModel,\n HelptextAttributeModel,\n LabelAttributeModel,\n MemoAttributeModel,\n MoneyAttributeModel,\n NumberAttributeModel,\n PasswordAttributeModel,\n CompositeAttributeModel,\n StringAttributeModel,\n UploadAttributeModel,\n XMLAttributeModel,\n AssignmentFilterModel,\n FilterModel,\n RangeFilterModel,\n ConceptIndexFilterModel,\n};\n\nexport type * from \"./types\";\n"],"mappings":"AACA,SAASA,OAAO,IAAIC,YAAY,QAAQ,gBAAgB;AAExD,SAASD,OAAO,IAAIE,cAAc,QAAQ,uBAAuB;AAEjE,SAASF,OAAO,IAAIG,gBAAgB,QAAQ,4BAA4B;AACxE,SAASH,OAAO,IAAII,WAAW,QAAQ,uBAAuB;AAE9D,SAASJ,OAAO,IAAIK,gBAAgB,QAAQ,gCAAgC;AAE5E,SAASL,OAAO,IAAIM,mBAAmB,QAAQ,kCAAkC;AACjF,SAASN,OAAO,IAAIO,iBAAiB,QAAQ,gCAAgC;AAE7E,SAASP,OAAO,IAAIQ,cAAc,QAAQ,6BAA6B;AACvE,SAASR,OAAO,IAAIS,qBAAqB,QAAQ,oCAAoC;AACrF,SAAST,OAAO,IAAIU,qBAAqB,QAAQ,oCAAoC;AACrF,SAASV,OAAO,IAAIW,oBAAoB,QAAQ,mCAAmC;AACnF,SAASX,OAAO,IAAIY,+BAA+B,QAAQ,8CAA8C;AACzG,SAASZ,OAAO,IAAIa,0BAA0B,QAAQ,yCAAyC;AAC/F,SAASb,OAAO,IAAIc,uBAAuB,QAAQ,sCAAsC;AACzF,SAASd,OAAO,IAAIe,iCAAiC,QAAQ,gDAAgD;AAC7G,SAASf,OAAO,IAAIgB,sBAAsB,QAAQ,qCAAqC;AACvF,SAAShB,OAAO,IAAIiB,sBAAsB,QAAQ,qCAAqC;AACvF,SAASjB,OAAO,IAAIkB,mBAAmB,QAAQ,kCAAkC;AACjF,SAASlB,OAAO,IAAImB,kBAAkB,QAAQ,iCAAiC;AAC/E,SAASnB,OAAO,IAAIoB,mBAAmB,QAAQ,kCAAkC;AACjF,SAASpB,OAAO,IAAIqB,oBAAoB,QAAQ,mCAAmC;AACnF,S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kBAAkB;AACvD,SAAS/F,OAAO,IAAIgG,gBAAgB,QAAQ,yBAAyB;AACrE,SAAShG,OAAO,IAAIiG,iBAAiB,QAAQ,0BAA0B;AAEvE,SACE5F,gBAAgB,EAChBoF,eAAe,EACfvD,aAAa,EACbyC,eAAe,EACfjB,WAAW,EACXS,SAAS,EACTqB,kBAAkB,EAClBT,SAAS,EACTa,QAAQ,EACRE,cAAc,EACdC,SAAS,EACTC,gBAAgB,EAChBC,iBAAiB,EACjBf,iBAAiB,EACjB7C,iBAAiB,EACjBD,kBAAkB,EAClBD,qBAAqB,EACrBM,sBAAsB,EACtBK,iBAAiB,EACjBG,eAAe,EACfD,YAAY,EACZE,gBAAgB,EAChBzC,qBAAqB,EACrBC,qBAAqB,EACrBC,oBAAoB,EACpBK,sBAAsB,EACtBC,sBAAsB,EACtBC,mBAAmB,EACnBC,kBAAkB,EAClBC,mBAAmB,EACnBC,oBAAoB,EACpBC,sBAAsB,EACtBR,uBAAuB,EACvBS,oBAAoB,EACpBC,oBAAoB,EACpBC,iBAAiB,EACjBqC,qBAAqB,EACrBC,WAAW,EACXC,gBAAgB,EAChBC,uBAAuB","ignoreList":[]}
|
|
@@ -74,7 +74,7 @@ const normalizeLinkJSON = (data, contributions) => {
|
|
|
74
74
|
}
|
|
75
75
|
const flattenedData = data ? flattenDataJSON(data) : [];
|
|
76
76
|
const flattenedContributions = contributions ? flattenContributionsJSON(contributions) : [];
|
|
77
|
-
const filteredContributions = _filterInstanceProperty(flattenedContributions).call(flattenedContributions, contribution => contribution.href && !
|
|
77
|
+
const filteredContributions = _filterInstanceProperty(flattenedContributions).call(flattenedContributions, contribution => contribution.href && !flattenedData.some(linkData => linkData.name === contribution.name));
|
|
78
78
|
return _filterInstanceProperty(_context3 = [..._mapInstanceProperty(flattenedData).call(flattenedData, link => ({
|
|
79
79
|
data: link,
|
|
80
80
|
contributions: _findInstanceProperty(flattenedContributions).call(flattenedContributions, contr => contr.name === link.name) || {
|
|
@@ -88,7 +88,7 @@ const normalizeLinkJSON = (
|
|
|
88
88
|
const filteredContributions = flattenedContributions.filter(
|
|
89
89
|
(contribution) =>
|
|
90
90
|
contribution.href &&
|
|
91
|
-
!flattenedData.
|
|
91
|
+
!flattenedData.some((linkData) => linkData.name === contribution.name),
|
|
92
92
|
);
|
|
93
93
|
|
|
94
94
|
return [
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"normalizeLinkJSON.js","names":["HIDE_IN_USER_INTERFACE","createLink","link","linkKey","newLink","group","layouthint","flattenDataJSON","json","flattenedJSON","_Object$keys","forEach","Array","isArray","_context","push","_mapInstanceProperty","call","_Object$assign","name","flattenContributionsJSON","_context2","label","normalizeLinkJSON","data","contributions","_context3","flattenedData","flattenedContributions","filteredContributions","_filterInstanceProperty","contribution","href","
|
|
1
|
+
{"version":3,"file":"normalizeLinkJSON.js","names":["HIDE_IN_USER_INTERFACE","createLink","link","linkKey","newLink","group","layouthint","flattenDataJSON","json","flattenedJSON","_Object$keys","forEach","Array","isArray","_context","push","_mapInstanceProperty","call","_Object$assign","name","flattenContributionsJSON","_context2","label","normalizeLinkJSON","data","contributions","_context3","flattenedData","flattenedContributions","filteredContributions","_filterInstanceProperty","contribution","href","some","linkData","_findInstanceProperty","contr","_context4","_includesInstanceProperty"],"sources":["../../../src/models/links/normalizeLinkJSON.js"],"sourcesContent":["// @flow\nimport { HIDE_IN_USER_INTERFACE } from \"../../constants\";\n\n/**\n * Flatten JSON structure into a one dimensional array\n * @private\n */\nconst createLink = (link: Object, linkKey: string) => {\n const newLink = { ...link };\n newLink.group = linkKey;\n newLink.layouthint = link.layouthint ? [...link.layouthint] : [];\n return newLink;\n};\n\n/**\n * @private\n */\nconst flattenDataJSON = (json: Object) => {\n const flattenedJSON = [];\n\n Object.keys(json).forEach((linkKey) => {\n if (Array.isArray(json[linkKey])) {\n flattenedJSON.push(\n ...json[linkKey].map((link) => createLink(link, linkKey)),\n );\n } else if (json[linkKey]) {\n flattenedJSON.push(\n Object.assign(json[linkKey], {\n name: linkKey,\n }),\n );\n }\n });\n\n return flattenedJSON;\n};\n\n/**\n */\nconst flattenContributionsJSON = (json: Object) => {\n const flattenedJSON = [];\n\n Object.keys(json).forEach((linkKey) => {\n if (Array.isArray(json[linkKey])) {\n flattenedJSON.push(\n ...json[linkKey].map((link) => createLink(link, linkKey)),\n );\n } else if (json[linkKey]) {\n const newLink = json[linkKey];\n newLink.name = linkKey;\n if (!newLink.label) {\n newLink.label = linkKey;\n }\n if (!newLink.group) {\n newLink.group = linkKey;\n }\n if (!newLink.layouthint) {\n newLink.layouthint = [];\n }\n\n flattenedJSON.push(newLink);\n }\n });\n\n return flattenedJSON;\n};\n\n/**\n * Normalize various link formats from services into a concistent format\n * @private\n */\nconst normalizeLinkJSON = (\n data: Object,\n contributions: Object,\n): Array<{\n data: any,\n contributions: any,\n}> => {\n if (!data && !contributions) {\n return [];\n }\n\n const flattenedData = data ? flattenDataJSON(data) : [];\n const flattenedContributions = contributions\n ? flattenContributionsJSON(contributions)\n : [];\n\n const filteredContributions = flattenedContributions.filter(\n (contribution) =>\n contribution.href &&\n !flattenedData.some((linkData) => linkData.name === contribution.name),\n );\n\n return [\n ...flattenedData.map((link) => ({\n data: link,\n contributions: flattenedContributions.find(\n (contr) => contr.name === link.name,\n ) || {\n name: link.name,\n label: link.name ?? \"\",\n layouthint: link.layouthint ?? [],\n },\n })),\n ...filteredContributions.map((link) => ({\n data: {\n ...link,\n href: link.href || \"\",\n },\n contributions: {\n name: link.name,\n label: link.name ?? \"\",\n layouthint: link.layouthint,\n },\n })),\n ].filter(\n (link) => !link.contributions.layouthint.includes(HIDE_IN_USER_INTERFACE),\n );\n};\n\nexport default normalizeLinkJSON;\n"],"mappings":";;;;;;AACA,SAASA,sBAAsB,QAAQ,iBAAiB;;AAExD;AACA;AACA;AACA;AACA,MAAMC,UAAU,GAAGA,CAACC,IAAY,EAAEC,OAAe,KAAK;EACpD,MAAMC,OAAO,GAAG;IAAE,GAAGF;EAA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AI,EAAEtB,IAAI;IACVuB,aAAa,EAAEU,qBAAA,CAAAP,sBAAsB,EAAAX,IAAA,CAAtBW,sBAAsB,EAClCQ,KAAK,IAAKA,KAAK,CAACjB,IAAI,KAAKjB,IAAI,CAACiB,IACjC,CAAC,IAAI;MACHA,IAAI,EAAEjB,IAAI,CAACiB,IAAI;MACfG,KAAK,EAAEpB,IAAI,CAACiB,IAAI,IAAI,EAAE;MACtBb,UAAU,EAAEJ,IAAI,CAACI,UAAU,IAAI;IACjC;EACF,CAAC,CAAC,CAAC,EACH,GAAGU,oBAAA,CAAAa,qBAAqB,EAAAZ,IAAA,CAArBY,qBAAqB,EAAM3B,IAAI,KAAM;IACtCsB,IAAI,EAAE;MACJ,GAAGtB,IAAI;MACP8B,IAAI,EAAE9B,IAAI,CAAC8B,IAAI,IAAI;IACrB,CAAC;IACDP,aAAa,EAAE;MACbN,IAAI,EAAEjB,IAAI,CAACiB,IAAI;MACfG,KAAK,EAAEpB,IAAI,CAACiB,IAAI,IAAI,EAAE;MACtBb,UAAU,EAAEJ,IAAI,CAACI;IACnB;EACF,CAAC,CAAC,CAAC,CACJ,EAAAW,IAAA,CAAAS,SAAA,EACExB,IAAI;IAAA,IAAAmC,SAAA;IAAA,OAAK,CAACC,yBAAA,CAAAD,SAAA,GAAAnC,IAAI,CAACuB,aAAa,CAACnB,UAAU,EAAAW,IAAA,CAAAoB,SAAA,EAAUrC,sBAAsB,CAAC;EAAA,CAC3E,CAAC;AACH,CAAC;AAED,eAAeuB,iBAAiB","ignoreList":[]}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import _defineProperty from "@babel/runtime-corejs3/helpers/esm/defineProperty";
|
|
2
2
|
import _includesInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/includes";
|
|
3
3
|
import _Promise from "@babel/runtime-corejs3/core-js-stable/promise";
|
|
4
|
+
import _globalThis from "@babel/runtime-corejs3/core-js/global-this";
|
|
4
5
|
import _startsWithInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/starts-with";
|
|
5
6
|
import { HTTP_METHODS } from "../constants/Constants";
|
|
6
7
|
import universalFetch from "../utils/fetch/universalFetch";
|
|
@@ -174,9 +175,13 @@ class Authenticate {
|
|
|
174
175
|
redirectToLogout(postRedirectUrl = "") {
|
|
175
176
|
var _context;
|
|
176
177
|
Cache.clear();
|
|
177
|
-
|
|
178
|
+
|
|
179
|
+
// $FlowIssue
|
|
180
|
+
const origin = _globalThis.location.origin;
|
|
178
181
|
const redirectUrl = ((_context = postRedirectUrl) == null ? void 0 : Function.call.bind(_startsWithInstanceProperty(_context), _context))?.("http") ? postRedirectUrl : `${origin}${getBasePath()}`;
|
|
179
|
-
|
|
182
|
+
|
|
183
|
+
// $FlowIssue
|
|
184
|
+
_globalThis.location.assign(this.getLogoutUrl() + "?url=" + redirectUrl);
|
|
180
185
|
}
|
|
181
186
|
|
|
182
187
|
/**
|
|
@@ -192,12 +192,14 @@ class Authenticate {
|
|
|
192
192
|
redirectToLogout(postRedirectUrl: string = ""): void {
|
|
193
193
|
Cache.clear();
|
|
194
194
|
|
|
195
|
-
|
|
195
|
+
// $FlowIssue
|
|
196
|
+
const origin = globalThis.location.origin;
|
|
196
197
|
const redirectUrl = postRedirectUrl?.startsWith("http")
|
|
197
198
|
? postRedirectUrl
|
|
198
199
|
: `${origin}${getBasePath()}`;
|
|
199
200
|
|
|
200
|
-
|
|
201
|
+
// $FlowIssue
|
|
202
|
+
globalThis.location.assign(this.getLogoutUrl() + "?url=" + redirectUrl);
|
|
201
203
|
}
|
|
202
204
|
|
|
203
205
|
/**
|