@beinformed/ui 1.61.1 → 1.62.1

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.
Files changed (80) hide show
  1. package/CHANGELOG.md +16 -0
  2. package/esm/constants/Settings.js +2 -1
  3. package/esm/constants/Settings.js.flow +2 -0
  4. package/esm/constants/Settings.js.map +1 -1
  5. package/esm/models/attributes/__tests__/AttributeContent.spec.js.flow +1 -1
  6. package/esm/models/concepts/ConceptIndexModel.js +1 -1
  7. package/esm/models/concepts/ConceptIndexModel.js.flow +3 -1
  8. package/esm/models/concepts/ConceptIndexModel.js.map +1 -1
  9. package/esm/models/concepts/ConceptLinkModel.d.ts +15 -0
  10. package/esm/models/concepts/ConceptLinkModel.js +14 -0
  11. package/esm/models/concepts/ConceptLinkModel.js.flow +21 -0
  12. package/esm/models/concepts/ConceptLinkModel.js.map +1 -1
  13. package/esm/models/concepts/SourceReferenceModel.d.ts +9 -0
  14. package/esm/models/concepts/SourceReferenceModel.js +16 -2
  15. package/esm/models/concepts/SourceReferenceModel.js.flow +22 -10
  16. package/esm/models/concepts/SourceReferenceModel.js.map +1 -1
  17. package/esm/models/concepts/__mock__/related_concepts.js.flow +12 -0
  18. package/esm/models/concepts/__tests__/RelatedConcepts.spec.js.flow +60 -0
  19. package/esm/models/concepts/__tests__/SourceReferenceModel.spec.js.flow +99 -0
  20. package/esm/models/content/ContentLinkModel.d.ts +8 -0
  21. package/esm/models/content/ContentLinkModel.js +31 -1
  22. package/esm/models/content/ContentLinkModel.js.flow +35 -1
  23. package/esm/models/content/ContentLinkModel.js.map +1 -1
  24. package/esm/models/content/ContentTOCModel.d.ts +3 -0
  25. package/esm/models/content/ContentTOCModel.js +6 -0
  26. package/esm/models/content/ContentTOCModel.js.flow +6 -0
  27. package/esm/models/content/ContentTOCModel.js.map +1 -1
  28. package/esm/models/content/__tests__/ContentIndexModel.spec.js.flow +3 -0
  29. package/esm/models/content/__tests__/ContentModel.spec.js.flow +5 -5
  30. package/esm/models/content/__tests__/Formalsource.spec.js.flow +4 -0
  31. package/esm/models/types.d.ts +6 -0
  32. package/esm/models/types.js.flow +7 -0
  33. package/esm/models/types.js.map +1 -1
  34. package/esm/utils/helpers/__tests__/createHash.spec.js.flow +5 -5
  35. package/esm/utils/helpers/createHash.d.ts +2 -1
  36. package/esm/utils/helpers/createHash.js +10 -9
  37. package/esm/utils/helpers/createHash.js.flow +10 -10
  38. package/esm/utils/helpers/createHash.js.map +1 -1
  39. package/lib/constants/Settings.js +2 -1
  40. package/lib/constants/Settings.js.map +1 -1
  41. package/lib/models/concepts/ConceptIndexModel.js +1 -1
  42. package/lib/models/concepts/ConceptIndexModel.js.map +1 -1
  43. package/lib/models/concepts/ConceptLinkModel.d.ts +15 -0
  44. package/lib/models/concepts/ConceptLinkModel.js +14 -0
  45. package/lib/models/concepts/ConceptLinkModel.js.map +1 -1
  46. package/lib/models/concepts/SourceReferenceModel.d.ts +9 -0
  47. package/lib/models/concepts/SourceReferenceModel.js +16 -2
  48. package/lib/models/concepts/SourceReferenceModel.js.map +1 -1
  49. package/lib/models/content/ContentLinkModel.d.ts +8 -0
  50. package/lib/models/content/ContentLinkModel.js +31 -1
  51. package/lib/models/content/ContentLinkModel.js.map +1 -1
  52. package/lib/models/content/ContentTOCModel.d.ts +3 -0
  53. package/lib/models/content/ContentTOCModel.js +6 -0
  54. package/lib/models/content/ContentTOCModel.js.map +1 -1
  55. package/lib/models/types.d.ts +6 -0
  56. package/lib/models/types.js.map +1 -1
  57. package/lib/utils/helpers/createHash.d.ts +2 -1
  58. package/lib/utils/helpers/createHash.js +11 -9
  59. package/lib/utils/helpers/createHash.js.map +1 -1
  60. package/package.json +3 -1
  61. package/src/constants/Settings.js +2 -0
  62. package/src/models/attributes/__tests__/AttributeContent.spec.js +1 -1
  63. package/src/models/concepts/ConceptIndexModel.js +3 -1
  64. package/src/models/concepts/ConceptLinkModel.js +21 -0
  65. package/src/models/concepts/SourceReferenceModel.js +22 -10
  66. package/src/models/concepts/__mock__/related_concepts.js +12 -0
  67. package/src/models/concepts/__mock__/related_concepts_contributions.json +41 -0
  68. package/src/models/concepts/__mock__/related_concepts_data.json +2292 -0
  69. package/src/models/concepts/__tests__/RelatedConcepts.spec.js +60 -0
  70. package/src/models/concepts/__tests__/SourceReferenceModel.spec.js +99 -0
  71. package/src/models/content/ContentLinkModel.js +35 -1
  72. package/src/models/content/ContentTOCModel.js +6 -0
  73. package/src/models/content/__tests__/ContentIndexModel.spec.js +3 -0
  74. package/src/models/content/__tests__/ContentModel.spec.js +5 -5
  75. package/src/models/content/__tests__/Formalsource.spec.js +4 -0
  76. package/src/models/content/__tests__/content-index.json +1 -0
  77. package/src/models/content/__tests__/formalsource-complete.json +1 -0
  78. package/src/models/types.js +7 -0
  79. package/src/utils/helpers/__tests__/createHash.spec.js +5 -5
  80. package/src/utils/helpers/createHash.js +10 -10
package/CHANGELOG.md CHANGED
@@ -2,6 +2,22 @@
2
2
 
3
3
  All notable changes to this project will be documented in this file. See [commit-and-tag-version](https://github.com/absolute-version/commit-and-tag-version) for commit guidelines.
4
4
 
5
+ ## [1.62.1](https://git.beinformed.com/public/nl.beinformed.bi.layout.lib.ui/compare/v1.62.0...v1.62.1) (2025-06-04)
6
+
7
+
8
+ ### Bug Fixes
9
+
10
+ * **sources:** add setting to use complete sources in library ([66bc5e9](https://git.beinformed.com/public/nl.beinformed.bi.layout.lib.ui/commit/66bc5e93be2a91a174628455b864d33993f29647))
11
+
12
+ ## [1.62.0](https://git.beinformed.com/public/nl.beinformed.bi.layout.lib.ui/compare/v1.61.1...v1.62.0) (2025-06-03)
13
+
14
+
15
+ ### Features
16
+
17
+ * **abbreviation:** add source abbreviations to content ([88a9351](https://git.beinformed.com/public/nl.beinformed.bi.layout.lib.ui/commit/88a935180dc76da862b34dd0381b03790245c501))
18
+ * **fragment:** add fragments to source references ([4f107a4](https://git.beinformed.com/public/nl.beinformed.bi.layout.lib.ui/commit/4f107a48a97a7b070b55732accc37639feaeba3a))
19
+ * **related-concepts:** handle fragments on source references ([76a4519](https://git.beinformed.com/public/nl.beinformed.bi.layout.lib.ui/commit/76a45197190ff4dacff129e9aa1737589d05e832))
20
+
5
21
  ## [1.61.1](https://git.beinformed.com/public/nl.beinformed.bi.layout.lib.ui/compare/v1.61.0...v1.61.1) (2025-06-02)
6
22
 
7
23
 
@@ -65,7 +65,8 @@ const defaultSettings = {
65
65
  XHR_TIMEOUT_MS: 300000,
66
66
  XHR_ALWAYS_WITH_CREDENTIALS: false,
67
67
  HIDE_WHEN_EMPTY_IGNORE_TASKS: false,
68
- SHOW_AVATARS: true
68
+ SHOW_AVATARS: true,
69
+ COMPLETE_SOURCE: false
69
70
  };
70
71
  let settings = defaultSettings;
71
72
 
@@ -123,6 +123,8 @@ const defaultSettings: { [name: string]: Setting } = {
123
123
  HIDE_WHEN_EMPTY_IGNORE_TASKS: false,
124
124
 
125
125
  SHOW_AVATARS: true,
126
+
127
+ COMPLETE_SOURCE: false,
126
128
  };
127
129
 
128
130
  let settings = defaultSettings;
@@ -1 +1 @@
1
- {"version":3,"file":"Settings.js","names":["isPlainObject","has","getRepositoryResourceUrl","ALL_CONTENT_IN_DATA_SETTING","INCLUDE_TIME_OFFSET","INTERNAL_LOGIN_TYPE","LOGIN_TYPE","LOGIN_PATH_SETTING","LOGIN_USERNAME_SETTING","LOGIN_PASSWORD_SETTING","LOGOUT_PATH_SETTING","UPLOAD_PATH","CAPTCHA_PATH","serverBase","__CONTEXT_PATH__","defaultSettings","CONTEXT_PATH","window","contextPath","CACHE_CONTRIBUTIONS","DEBUG_I18N_MESSAGE_NOT_FOUND","HIDE_NOTIFICATION_TIMEOUT","ALWAYS_COMMIT_FORM","RENDER_QUESTION_LABELS","RENDER_MANDATORY_ATTRIBUTE_INDICATION","RENDER_OPTIONAL_ATTRIBUTE_INDICATION","AVAILABLE_LIST_VIEWS","USE_CLIENTSIDE_VALIDATION","USE_INSTANT_SERVER_VALIDATION","ENABLED_LOCALES","RENDER_GLOBAL_LOGIN_PAGE","RENDER_GLOBAL_LOGOUT_PAGE","RENDER_MULTI_LOGIN_ON_GLOBAL_LOGOUT_PAGE","LOGIN_PATH","ADMINISTRATOR_LOGIN_PATH","LOGOUT_PATH","RENDER_FORMS_IN_MODAL","SHOW_SUBMIT_WAIT_TIMEOUT","SWIM_LANE_DIAGRAM_CONFIGURATION","BUSINESS_SCENARIO_CONCEPT_TYPE","BUSINESS_SCENARIO_STEP_CONCEPT_TYPE","BUSINESS_SCENARIO_PERSONA_CONCEPT_TYPE","BUSINESS_SCENARIO_SYSTEM_CONCEPT_TYPE","CALENDAR_WEEK_STARTS_ON","CALENDAR_FIRST_WEEK_CONTAINS_DATE","UI_PARAMETERS","ALLOW_HIDE_WHEN_EMPTY_ON_TABS","PAGE_RELOAD_ON_UNAUTHORIZED_ERROR","XHR_TIMEOUT_MS","XHR_ALWAYS_WITH_CREDENTIALS","HIDE_WHEN_EMPTY_IGNORE_TASKS","SHOW_AVATARS","settings","setSettings","config","_Object$assign","getSetting","key","defaultValue","undefined","Error","setSetting","value","allSettings","cacheContributions","getBasePath","getBasePathModularUI","getBasePathServer","getUploadPath","arguments","length","origin","getCaptchaPath","hasAllContentInData","isIncludeTimeOffsetInDateTimes","loginType","JAAS","loginPath","clientName","loginUsernameField","loginPasswordField","logoutPath","getSwimLaneDiagramConfiguration","configLocation","_startsWithInstanceProperty","call","setContextPath","BASE"],"sources":["../../src/constants/Settings.js"],"sourcesContent":["// @flow\nimport { isPlainObject, has } from \"../utils/helpers/objects\";\nimport { getRepositoryResourceUrl } from \"../utils/helpers/repositoryResource\";\nimport {\n ALL_CONTENT_IN_DATA_SETTING,\n INCLUDE_TIME_OFFSET,\n INTERNAL_LOGIN_TYPE,\n LOGIN_TYPE,\n LOGIN_PATH_SETTING,\n LOGIN_USERNAME_SETTING,\n LOGIN_PASSWORD_SETTING,\n LOGOUT_PATH_SETTING,\n UPLOAD_PATH,\n CAPTCHA_PATH,\n} from \"./Constants\";\n\ntype Setting = boolean | string | number | Array<string>;\n\nconst serverBase =\n typeof __CONTEXT_PATH__ === \"undefined\" ? null : __CONTEXT_PATH__;\n\nconst defaultSettings: { [name: string]: Setting } = {\n // This uses contextPath set from property from server\n CONTEXT_PATH:\n serverBase ??\n (typeof window !== \"undefined\" && window.contextPath\n ? window.contextPath\n : \"/BeInformed\"),\n\n // Indicates if contributions should be cached\n CACHE_CONTRIBUTIONS: true,\n\n // Debug missing i18n messages in layout\n DEBUG_I18N_MESSAGE_NOT_FOUND: true,\n\n // Time to show the notification bar\n HIDE_NOTIFICATION_TIMEOUT: 5000,\n\n // Always commit form, does not show result pages for instruments\n ALWAYS_COMMIT_FORM: false,\n\n // Render instrument and event question labels on forms (might result in duplicate labels)\n RENDER_QUESTION_LABELS: true,\n\n // Render mandatory indications on attributes\n RENDER_MANDATORY_ATTRIBUTE_INDICATION: true,\n\n // Render optional indications on attributes\n RENDER_OPTIONAL_ATTRIBUTE_INDICATION: false,\n\n // Renders a toggle with supported list views, options are ListView and TableView\n AVAILABLE_LIST_VIEWS: [\"ListView\", \"TableView\"],\n\n // Toggle client side validation\n USE_CLIENTSIDE_VALIDATION: true,\n\n // Indicates if server validation should be used when a form field is changed\n USE_INSTANT_SERVER_VALIDATION: true,\n\n // Indicates which locales are enabled\n ENABLED_LOCALES: [\"en\", \"nl\"],\n\n // Renders the global log in page\n RENDER_GLOBAL_LOGIN_PAGE: false,\n\n // Renders the global log out page\n RENDER_GLOBAL_LOGOUT_PAGE: false,\n\n // Renders the login variants as option on the global logout page\n RENDER_MULTI_LOGIN_ON_GLOBAL_LOGOUT_PAGE: false,\n\n // Path to login page / component\n LOGIN_PATH: \"/signin\",\n\n // Path to administrator login page / component\n ADMINISTRATOR_LOGIN_PATH: \"\",\n\n // Path to logout page / component\n LOGOUT_PATH: \"/signout\",\n\n // Render forms in a modal\n RENDER_FORMS_IN_MODAL: true,\n\n // Wait timeout before rendering submit wait icon\n SHOW_SUBMIT_WAIT_TIMEOUT: 300,\n\n // Swim lane diagram configuration file\n SWIM_LANE_DIAGRAM_CONFIGURATION: \"/Library/Diagrams/Overviews.json\",\n\n // Business scenario concept types\n BUSINESS_SCENARIO_CONCEPT_TYPE: [\n \"/Library/KMTs/Business scenarios.bixml/BusinessScenario\",\n ],\n BUSINESS_SCENARIO_STEP_CONCEPT_TYPE: [\n \"/Library/KMTs/Business scenarios.bixml/ScenarioStep\",\n ],\n BUSINESS_SCENARIO_PERSONA_CONCEPT_TYPE: [\n \"/Library/KMTs/Business scenarios.bixml/Persona\",\n ],\n BUSINESS_SCENARIO_SYSTEM_CONCEPT_TYPE: [\n \"/Library/KMTs/Business scenarios.bixml/System\",\n ],\n\n // indicates on what day the week starts (0 = Sunday)\n CALENDAR_WEEK_STARTS_ON: 1,\n\n // indicates which date indicates the first week of the year\n CALENDAR_FIRST_WEEK_CONTAINS_DATE: 1,\n\n // parameters that are added for the ui state, but should not be send to the modular ui\n UI_PARAMETERS: [],\n\n // disable hide-when-empty hint for layouts running on Be Informed versions older than 21.1\n ALLOW_HIDE_WHEN_EMPTY_ON_TABS: true,\n\n // reload the complete page on signout, usefull when third party authentication is in place\n PAGE_RELOAD_ON_UNAUTHORIZED_ERROR: false,\n\n XHR_TIMEOUT_MS: 300000,\n\n XHR_ALWAYS_WITH_CREDENTIALS: false,\n\n HIDE_WHEN_EMPTY_IGNORE_TASKS: false,\n\n SHOW_AVATARS: true,\n};\n\nlet settings = defaultSettings;\n\n/**\n */\nexport const setSettings = (config: Object) => {\n if (isPlainObject(config)) {\n settings = Object.assign(defaultSettings, config);\n }\n};\n\n/**\n */\nexport const getSetting = (key: string, defaultValue?: any): any => {\n if (!has(settings, key) && defaultValue === undefined) {\n throw new Error(\n `Setting with name ${key} not found and no defaultValue given`,\n );\n }\n\n return settings[key] ?? defaultValue;\n};\n\n/**\n */\nexport const setSetting = (key: string, value: any) => {\n settings[key] = value;\n};\n\n/**\n */\nexport const allSettings = (): { [name: string]: Setting } => settings;\n\n/**\n * Indicates if contributions must be cached\n */\nexport const cacheContributions = (): boolean =>\n getSetting(\"CACHE_CONTRIBUTIONS\", true);\n\n/**\n * The context path is retrieved on the server using the context path property as set in the runtime properties\n * This can be manually override by setting the UI setting 'CONTEXT_PATH'\n */\nexport const getBasePath = (): string =>\n getSetting(\"CONTEXT_PATH\", \"/BeInformed\");\n\n/**\n * The context path to modular ui rest services\n */\nexport const getBasePathModularUI = (): string =>\n getSetting(\"CONTEXT_PATH_SERVER\", getBasePath());\n\n/**\n * Used to link the css and js files in the server templates\n */\nexport const getBasePathServer = (): string =>\n getSetting(\"CONTEXT_PATH_SERVER\", getBasePath());\n\n/**\n * Path to upload service\n */\nexport const getUploadPath = (\n contextPath: string = getBasePathModularUI(),\n origin: string = \"\",\n): string => `${origin}${contextPath}${UPLOAD_PATH}`;\n\n/**\n * Path to captcha service\n */\nexport const getCaptchaPath = (\n contextPath: string = getBasePathModularUI(),\n origin: string = \"\",\n): string => `${origin}${contextPath}${CAPTCHA_PATH}`;\n\n/**\n */\nexport const hasAllContentInData = (): boolean =>\n getSetting(ALL_CONTENT_IN_DATA_SETTING, true);\n\n/**\n */\nexport const isIncludeTimeOffsetInDateTimes = (): boolean =>\n getSetting(INCLUDE_TIME_OFFSET, false);\n\n/**\n * Login type, only available when pac4j is configured\n *\n * Preview does not support pac4j, thus is probably not configured when started, which results in login type JAAS\n */\nexport const loginType = (): string =>\n getSetting(LOGIN_TYPE, INTERNAL_LOGIN_TYPE.JAAS);\n\n/**\n */\nexport const loginPath = (clientName: string = \"FormClient\"): string =>\n getSetting(LOGIN_PATH_SETTING, `/callback?client_name=${clientName}`);\n/**\n */\nexport const loginUsernameField = (): string =>\n getSetting(LOGIN_USERNAME_SETTING, \"j_username\");\n/**\n */\nexport const loginPasswordField = (): string =>\n getSetting(LOGIN_PASSWORD_SETTING, \"j_password\");\n/**\n */\nexport const logoutPath = (): string =>\n getSetting(LOGOUT_PATH_SETTING, \"/logout\");\n\nexport const LOGIN_PATH: string = loginPath();\nexport const LOGOUT_PATH: string = logoutPath();\n\n/**\n * Model overview swim lane configuration\n */\nexport const getSwimLaneDiagramConfiguration: Object = () => {\n let configLocation = getSetting(\n \"SWIM_LANE_DIAGRAM_CONFIGURATION\",\n \"/Library/Diagrams/Overviews.json\",\n );\n if (!configLocation.startsWith(\"/\")) {\n configLocation = `/${configLocation}`;\n }\n return getRepositoryResourceUrl(configLocation);\n};\n\n/**\n * Set the context path for requests to be informed\n */\nexport const setContextPath = (contextPath: string) => {\n setSetting(\"CONTEXT_PATH\", contextPath);\n};\n\n/**\n * Backwards compatible export of BASE constant\n */\nexport const BASE: string = getBasePath();\n"],"mappings":";;AACA,SAASA,aAAa,EAAEC,GAAG,QAAQ,0BAA0B;AAC7D,SAASC,wBAAwB,QAAQ,qCAAqC;AAC9E,SACEC,2BAA2B,EAC3BC,mBAAmB,EACnBC,mBAAmB,EACnBC,UAAU,EACVC,kBAAkB,EAClBC,sBAAsB,EACtBC,sBAAsB,EACtBC,mBAAmB,EACnBC,WAAW,EACXC,YAAY,QACP,aAAa;AAIpB,MAAMC,UAAU,GACd,OAAOC,gBAAgB,KAAK,WAAW,GAAG,IAAI,GAAGA,gBAAgB;AAEnE,MAAMC,eAA4C,GAAG;EACnD;EACAC,YAAY,EACVH,UAAU,KACT,OAAOI,MAAM,KAAK,WAAW,IAAIA,MAAM,CAACC,WAAW,GAChDD,MAAM,CAACC,WAAW,GAClB,aAAa,CAAC;EAEpB;EACAC,mBAAmB,EAAE,IAAI;EAEzB;EACAC,4BAA4B,EAAE,IAAI;EAElC;EACAC,yBAAyB,EAAE,IAAI;EAE/B;EACAC,kBAAkB,EAAE,KAAK;EAEzB;EACAC,sBAAsB,EAAE,IAAI;EAE5B;EACAC,qCAAqC,EAAE,IAAI;EAE3C;EACAC,oCAAoC,EAAE,KAAK;EAE3C;EACAC,oBAAoB,EAAE,CAAC,UAAU,EAAE,WAAW,CAAC;EAE/C;EACAC,yBAAyB,EAAE,IAAI;EAE/B;EACAC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AIC,cAAc,GAAG3B,UAAU,CAC7B,iCAAiC,EACjC,kCACF,CAAC;EACD,IAAI,CAAC4B,2BAAA,CAAAD,cAAc,EAAAE,IAAA,CAAdF,cAAc,EAAY,GAAG,CAAC,EAAE;IACnCA,cAAc,GAAG,IAAIA,cAAc,EAAE;EACvC;EACA,OAAOjF,wBAAwB,CAACiF,cAAc,CAAC;AACjD,CAAC;;AAED;AACA;AACA;AACA,OAAO,MAAMG,cAAc,GAAIpE,WAAmB,IAAK;EACrD2C,UAAU,CAAC,cAAc,EAAE3C,WAAW,CAAC;AACzC,CAAC;;AAED;AACA;AACA;AACA,OAAO,MAAMqE,IAAY,GAAGtB,WAAW,CAAC,CAAC","ignoreList":[]}
1
+ {"version":3,"file":"Settings.js","names":["isPlainObject","has","getRepositoryResourceUrl","ALL_CONTENT_IN_DATA_SETTING","INCLUDE_TIME_OFFSET","INTERNAL_LOGIN_TYPE","LOGIN_TYPE","LOGIN_PATH_SETTING","LOGIN_USERNAME_SETTING","LOGIN_PASSWORD_SETTING","LOGOUT_PATH_SETTING","UPLOAD_PATH","CAPTCHA_PATH","serverBase","__CONTEXT_PATH__","defaultSettings","CONTEXT_PATH","window","contextPath","CACHE_CONTRIBUTIONS","DEBUG_I18N_MESSAGE_NOT_FOUND","HIDE_NOTIFICATION_TIMEOUT","ALWAYS_COMMIT_FORM","RENDER_QUESTION_LABELS","RENDER_MANDATORY_ATTRIBUTE_INDICATION","RENDER_OPTIONAL_ATTRIBUTE_INDICATION","AVAILABLE_LIST_VIEWS","USE_CLIENTSIDE_VALIDATION","USE_INSTANT_SERVER_VALIDATION","ENABLED_LOCALES","RENDER_GLOBAL_LOGIN_PAGE","RENDER_GLOBAL_LOGOUT_PAGE","RENDER_MULTI_LOGIN_ON_GLOBAL_LOGOUT_PAGE","LOGIN_PATH","ADMINISTRATOR_LOGIN_PATH","LOGOUT_PATH","RENDER_FORMS_IN_MODAL","SHOW_SUBMIT_WAIT_TIMEOUT","SWIM_LANE_DIAGRAM_CONFIGURATION","BUSINESS_SCENARIO_CONCEPT_TYPE","BUSINESS_SCENARIO_STEP_CONCEPT_TYPE","BUSINESS_SCENARIO_PERSONA_CONCEPT_TYPE","BUSINESS_SCENARIO_SYSTEM_CONCEPT_TYPE","CALENDAR_WEEK_STARTS_ON","CALENDAR_FIRST_WEEK_CONTAINS_DATE","UI_PARAMETERS","ALLOW_HIDE_WHEN_EMPTY_ON_TABS","PAGE_RELOAD_ON_UNAUTHORIZED_ERROR","XHR_TIMEOUT_MS","XHR_ALWAYS_WITH_CREDENTIALS","HIDE_WHEN_EMPTY_IGNORE_TASKS","SHOW_AVATARS","COMPLETE_SOURCE","settings","setSettings","config","_Object$assign","getSetting","key","defaultValue","undefined","Error","setSetting","value","allSettings","cacheContributions","getBasePath","getBasePathModularUI","getBasePathServer","getUploadPath","arguments","length","origin","getCaptchaPath","hasAllContentInData","isIncludeTimeOffsetInDateTimes","loginType","JAAS","loginPath","clientName","loginUsernameField","loginPasswordField","logoutPath","getSwimLaneDiagramConfiguration","configLocation","_startsWithInstanceProperty","call","setContextPath","BASE"],"sources":["../../src/constants/Settings.js"],"sourcesContent":["// @flow\nimport { isPlainObject, has } from \"../utils/helpers/objects\";\nimport { getRepositoryResourceUrl } from \"../utils/helpers/repositoryResource\";\nimport {\n ALL_CONTENT_IN_DATA_SETTING,\n INCLUDE_TIME_OFFSET,\n INTERNAL_LOGIN_TYPE,\n LOGIN_TYPE,\n LOGIN_PATH_SETTING,\n LOGIN_USERNAME_SETTING,\n LOGIN_PASSWORD_SETTING,\n LOGOUT_PATH_SETTING,\n UPLOAD_PATH,\n CAPTCHA_PATH,\n} from \"./Constants\";\n\ntype Setting = boolean | string | number | Array<string>;\n\nconst serverBase =\n typeof __CONTEXT_PATH__ === \"undefined\" ? null : __CONTEXT_PATH__;\n\nconst defaultSettings: { [name: string]: Setting } = {\n // This uses contextPath set from property from server\n CONTEXT_PATH:\n serverBase ??\n (typeof window !== \"undefined\" && window.contextPath\n ? window.contextPath\n : \"/BeInformed\"),\n\n // Indicates if contributions should be cached\n CACHE_CONTRIBUTIONS: true,\n\n // Debug missing i18n messages in layout\n DEBUG_I18N_MESSAGE_NOT_FOUND: true,\n\n // Time to show the notification bar\n HIDE_NOTIFICATION_TIMEOUT: 5000,\n\n // Always commit form, does not show result pages for instruments\n ALWAYS_COMMIT_FORM: false,\n\n // Render instrument and event question labels on forms (might result in duplicate labels)\n RENDER_QUESTION_LABELS: true,\n\n // Render mandatory indications on attributes\n RENDER_MANDATORY_ATTRIBUTE_INDICATION: true,\n\n // Render optional indications on attributes\n RENDER_OPTIONAL_ATTRIBUTE_INDICATION: false,\n\n // Renders a toggle with supported list views, options are ListView and TableView\n AVAILABLE_LIST_VIEWS: [\"ListView\", \"TableView\"],\n\n // Toggle client side validation\n USE_CLIENTSIDE_VALIDATION: true,\n\n // Indicates if server validation should be used when a form field is changed\n USE_INSTANT_SERVER_VALIDATION: true,\n\n // Indicates which locales are enabled\n ENABLED_LOCALES: [\"en\", \"nl\"],\n\n // Renders the global log in page\n RENDER_GLOBAL_LOGIN_PAGE: false,\n\n // Renders the global log out page\n RENDER_GLOBAL_LOGOUT_PAGE: false,\n\n // Renders the login variants as option on the global logout page\n RENDER_MULTI_LOGIN_ON_GLOBAL_LOGOUT_PAGE: false,\n\n // Path to login page / component\n LOGIN_PATH: \"/signin\",\n\n // Path to administrator login page / component\n ADMINISTRATOR_LOGIN_PATH: \"\",\n\n // Path to logout page / component\n LOGOUT_PATH: \"/signout\",\n\n // Render forms in a modal\n RENDER_FORMS_IN_MODAL: true,\n\n // Wait timeout before rendering submit wait icon\n SHOW_SUBMIT_WAIT_TIMEOUT: 300,\n\n // Swim lane diagram configuration file\n SWIM_LANE_DIAGRAM_CONFIGURATION: \"/Library/Diagrams/Overviews.json\",\n\n // Business scenario concept types\n BUSINESS_SCENARIO_CONCEPT_TYPE: [\n \"/Library/KMTs/Business scenarios.bixml/BusinessScenario\",\n ],\n BUSINESS_SCENARIO_STEP_CONCEPT_TYPE: [\n \"/Library/KMTs/Business scenarios.bixml/ScenarioStep\",\n ],\n BUSINESS_SCENARIO_PERSONA_CONCEPT_TYPE: [\n \"/Library/KMTs/Business scenarios.bixml/Persona\",\n ],\n BUSINESS_SCENARIO_SYSTEM_CONCEPT_TYPE: [\n \"/Library/KMTs/Business scenarios.bixml/System\",\n ],\n\n // indicates on what day the week starts (0 = Sunday)\n CALENDAR_WEEK_STARTS_ON: 1,\n\n // indicates which date indicates the first week of the year\n CALENDAR_FIRST_WEEK_CONTAINS_DATE: 1,\n\n // parameters that are added for the ui state, but should not be send to the modular ui\n UI_PARAMETERS: [],\n\n // disable hide-when-empty hint for layouts running on Be Informed versions older than 21.1\n ALLOW_HIDE_WHEN_EMPTY_ON_TABS: true,\n\n // reload the complete page on signout, usefull when third party authentication is in place\n PAGE_RELOAD_ON_UNAUTHORIZED_ERROR: false,\n\n XHR_TIMEOUT_MS: 300000,\n\n XHR_ALWAYS_WITH_CREDENTIALS: false,\n\n HIDE_WHEN_EMPTY_IGNORE_TASKS: false,\n\n SHOW_AVATARS: true,\n\n COMPLETE_SOURCE: false,\n};\n\nlet settings = defaultSettings;\n\n/**\n */\nexport const setSettings = (config: Object) => {\n if (isPlainObject(config)) {\n settings = Object.assign(defaultSettings, config);\n }\n};\n\n/**\n */\nexport const getSetting = (key: string, defaultValue?: any): any => {\n if (!has(settings, key) && defaultValue === undefined) {\n throw new Error(\n `Setting with name ${key} not found and no defaultValue given`,\n );\n }\n\n return settings[key] ?? defaultValue;\n};\n\n/**\n */\nexport const setSetting = (key: string, value: any) => {\n settings[key] = value;\n};\n\n/**\n */\nexport const allSettings = (): { [name: string]: Setting } => settings;\n\n/**\n * Indicates if contributions must be cached\n */\nexport const cacheContributions = (): boolean =>\n getSetting(\"CACHE_CONTRIBUTIONS\", true);\n\n/**\n * The context path is retrieved on the server using the context path property as set in the runtime properties\n * This can be manually override by setting the UI setting 'CONTEXT_PATH'\n */\nexport const getBasePath = (): string =>\n getSetting(\"CONTEXT_PATH\", \"/BeInformed\");\n\n/**\n * The context path to modular ui rest services\n */\nexport const getBasePathModularUI = (): string =>\n getSetting(\"CONTEXT_PATH_SERVER\", getBasePath());\n\n/**\n * Used to link the css and js files in the server templates\n */\nexport const getBasePathServer = (): string =>\n getSetting(\"CONTEXT_PATH_SERVER\", getBasePath());\n\n/**\n * Path to upload service\n */\nexport const getUploadPath = (\n contextPath: string = getBasePathModularUI(),\n origin: string = \"\",\n): string => `${origin}${contextPath}${UPLOAD_PATH}`;\n\n/**\n * Path to captcha service\n */\nexport const getCaptchaPath = (\n contextPath: string = getBasePathModularUI(),\n origin: string = \"\",\n): string => `${origin}${contextPath}${CAPTCHA_PATH}`;\n\n/**\n */\nexport const hasAllContentInData = (): boolean =>\n getSetting(ALL_CONTENT_IN_DATA_SETTING, true);\n\n/**\n */\nexport const isIncludeTimeOffsetInDateTimes = (): boolean =>\n getSetting(INCLUDE_TIME_OFFSET, false);\n\n/**\n * Login type, only available when pac4j is configured\n *\n * Preview does not support pac4j, thus is probably not configured when started, which results in login type JAAS\n */\nexport const loginType = (): string =>\n getSetting(LOGIN_TYPE, INTERNAL_LOGIN_TYPE.JAAS);\n\n/**\n */\nexport const loginPath = (clientName: string = \"FormClient\"): string =>\n getSetting(LOGIN_PATH_SETTING, `/callback?client_name=${clientName}`);\n/**\n */\nexport const loginUsernameField = (): string =>\n getSetting(LOGIN_USERNAME_SETTING, \"j_username\");\n/**\n */\nexport const loginPasswordField = (): string =>\n getSetting(LOGIN_PASSWORD_SETTING, \"j_password\");\n/**\n */\nexport const logoutPath = (): string =>\n getSetting(LOGOUT_PATH_SETTING, \"/logout\");\n\nexport const LOGIN_PATH: string = loginPath();\nexport const LOGOUT_PATH: string = logoutPath();\n\n/**\n * Model overview swim lane configuration\n */\nexport const getSwimLaneDiagramConfiguration: Object = () => {\n let configLocation = getSetting(\n \"SWIM_LANE_DIAGRAM_CONFIGURATION\",\n \"/Library/Diagrams/Overviews.json\",\n );\n if (!configLocation.startsWith(\"/\")) {\n configLocation = `/${configLocation}`;\n }\n return getRepositoryResourceUrl(configLocation);\n};\n\n/**\n * Set the context path for requests to be informed\n */\nexport const setContextPath = (contextPath: string) => {\n setSetting(\"CONTEXT_PATH\", contextPath);\n};\n\n/**\n * Backwards compatible export of BASE constant\n */\nexport const BASE: string = getBasePath();\n"],"mappings":";;AACA,SAASA,aAAa,EAAEC,GAAG,QAAQ,0BAA0B;AAC7D,SAASC,wBAAwB,QAAQ,qCAAqC;AAC9E,SACEC,2BAA2B,EAC3BC,mBAAmB,EACnBC,mBAAmB,EACnBC,UAAU,EACVC,kBAAkB,EAClBC,sBAAsB,EACtBC,sBAAsB,EACtBC,mBAAmB,EACnBC,WAAW,EACXC,YAAY,QACP,aAAa;AAIpB,MAAMC,UAAU,GACd,OAAOC,gBAAgB,KAAK,WAAW,GAAG,IAAI,GAAGA,gBAAgB;AAEnE,MAAMC,eAA4C,GAAG;EACnD;EACAC,YAAY,EACVH,UAAU,KACT,OAAOI,MAAM,KAAK,WAAW,IAAIA,MAAM,CAACC,WAAW,GAChDD,MAAM,CAACC,WAAW,GAClB,aAAa,CAAC;EAEpB;EACAC,mBAAmB,EAAE,IAAI;EAEzB;EACAC,4BAA4B,EAAE,IAAI;EAElC;EACAC,yBAAyB,EAAE,IAAI;EAE/B;EACAC,kBAAkB,EAAE,KAAK;EAEzB;EACAC,sBAAsB,EAAE,IAAI;EAE5B;EACAC,qCAAqC,EAAE,IAAI;EAE3C;EACAC,oCAAoC,EAAE,KAAK;EAE3C;EACAC,oBAAoB,EAAE,CAAC,UAAU,EAAE,WAAW,CAAC;EAE/C;EACAC,yBAAyB,EAAE,IAAI;EAE/B;EACAC,6BAA6B,EAAE,IAAI;EAEnC;EACAC,eAAe,EAAE,CAAC,IAAI,EAAE,IAAI,CAAC;EAE7B;EACAC,wBAAwB,EAAE,KAAK;EAE/B;EACAC,yBAAyB,EAAE,KAAK;EAEhC;EACAC,wCAAwC,EAAE,KAAK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nCA,cAAc,GAAG,IAAIA,cAAc,EAAE;EACvC;EACA,OAAOlF,wBAAwB,CAACkF,cAAc,CAAC;AACjD,CAAC;;AAED;AACA;AACA;AACA,OAAO,MAAMG,cAAc,GAAIrE,WAAmB,IAAK;EACrD4C,UAAU,CAAC,cAAc,EAAE5C,WAAW,CAAC;AACzC,CAAC;;AAED;AACA;AACA;AACA,OAAO,MAAMsE,IAAY,GAAGtB,WAAW,CAAC,CAAC","ignoreList":[]}
@@ -205,7 +205,7 @@ describe("AttributeContent", () => {
205
205
 
206
206
  expect(firstSection.childSections).toHaveLength(2);
207
207
  expect(firstSection.subSections).toHaveLength(2);
208
- expect(firstSection.referenceHash).toBe(-1954774597);
208
+ expect(firstSection.referenceHash).toBe(4345174491453);
209
209
  });
210
210
 
211
211
  it("can handle referredSections", () => {
@@ -44,7 +44,7 @@ export default class ConceptIndexModel extends ResourceModel {
44
44
  */
45
45
  static isApplicableModel(data) {
46
46
  const resourceType = data.contributions?.resourcetype;
47
- return resourceType === "ConceptSearch" || resourceType === "relatedConcepts";
47
+ return resourceType === "ConceptSearch" || resourceType === "relatedConcepts" || resourceType === "RelatedConcepts";
48
48
  }
49
49
 
50
50
  /**
@@ -67,7 +67,9 @@ export default class ConceptIndexModel extends ResourceModel {
67
67
  static isApplicableModel(data: ModularUIResponse): boolean {
68
68
  const resourceType = data.contributions?.resourcetype;
69
69
  return (
70
- resourceType === "ConceptSearch" || resourceType === "relatedConcepts"
70
+ resourceType === "ConceptSearch" ||
71
+ resourceType === "relatedConcepts" ||
72
+ resourceType === "RelatedConcepts"
71
73
  );
72
74
  }
73
75
 
@@ -1 +1 @@
1
- {"version":3,"file":"ConceptIndexModel.js","names":["ResourceModel","ResourceCollection","FilterCollection","ConceptLinkModel","TIMEVERSION_FILTER_NAME","ConceptIndexModel","constructor","modularuiResponse","_context","_defineProperty","_filterCollection","_filterInstanceProperty","data","filter","contributions","dynamicschema","modelOptions","_concepts","collection","_embedded","_mapInstanceProperty","results","call","concept","entryDate","type","resourcetype","modelName","isApplicableModel","resourceType","getInitialChildModelLinks","items","setChildModels","models","errors","selfhref","href","selflink","filterCollection","hasItems","forEach","params","param","value","setParameter","name","removeParameter","label","getContribution","indexfilter","getFilterByAttributeKey","timeversionFilter","attribute","searchtermfilter","modelCategoryFilter","itemCollection"],"sources":["../../../src/models/concepts/ConceptIndexModel.js"],"sourcesContent":["// @flow\nimport ResourceModel from \"../base/ResourceModel\";\nimport ResourceCollection from \"../base/ResourceCollection\";\nimport FilterCollection from \"../filters/FilterCollection\";\nimport ConceptLinkModel from \"./ConceptLinkModel\";\n\nimport { TIMEVERSION_FILTER_NAME } from \"../../constants/Constants\";\n\nimport type { ModularUIResponse } from \"../../modularui\";\nimport type { FilterType, ModularUIModel } from \"../types\";\nimport type LinkModel from \"../links/LinkModel\";\nimport type Href from \"../href/Href\";\nimport type ErrorResponse from \"../error/ErrorResponse\";\n\n/**\n * Get Index of concepts, to filter model catalog\n */\nexport default class ConceptIndexModel extends ResourceModel {\n _filterCollection: FilterCollection;\n _concepts: ResourceCollection<ConceptLinkModel>;\n\n /**\n */\n constructor(modularuiResponse: ModularUIResponse) {\n super(modularuiResponse);\n\n this._filterCollection = new FilterCollection(\n this.data.filter,\n {\n filter: this.contributions.filter,\n dynamicschema: this.data.dynamicschema,\n },\n this.modelOptions,\n );\n\n this._concepts = new ResourceCollection();\n this._concepts.collection = this.data._embedded\n ? this.data._embedded.results.map(\n (concept) =>\n new ConceptLinkModel(\n concept.concept,\n this.entryDate,\n this.modelOptions,\n ),\n )\n : [];\n }\n\n /**\n */\n get type(): string {\n if (this.resourcetype === \"RelatedConcepts\") {\n return \"RelatedConcepts\";\n }\n\n return \"ConceptIndex\";\n }\n\n /**\n */\n static get modelName(): string {\n return \"ConceptIndexModel\";\n }\n\n /**\n */\n static isApplicableModel(data: ModularUIResponse): boolean {\n const resourceType = data.contributions?.resourcetype;\n return (\n resourceType === \"ConceptSearch\" || resourceType === \"relatedConcepts\"\n );\n }\n\n /**\n */\n getInitialChildModelLinks(): Array<LinkModel> {\n return this.items.getInitialChildModelLinks();\n }\n\n /**\n */\n setChildModels(models: Array<ModularUIModel>, errors: Array<ErrorResponse>) {\n this.items.setChildModels(models, errors);\n }\n\n /**\n * Getting the self link of this list\n */\n get selfhref(): Href {\n const { href } = this.selflink;\n\n if (this.filterCollection.hasItems) {\n this.filterCollection.forEach((filter) => {\n filter.params.forEach((param) => {\n if (param.value) {\n href.setParameter(param.name, param.value);\n } else {\n href.removeParameter(param.name);\n }\n });\n });\n }\n\n return href;\n }\n\n /**\n */\n get label(): string {\n return this.getContribution(\"label\");\n }\n\n /**\n * Retrieve filters of conceptindex model\n */\n get filterCollection(): FilterCollection {\n return this._filterCollection;\n }\n\n /**\n * Get index filter\n */\n get indexfilter(): FilterType | null {\n return this.filterCollection.getFilterByAttributeKey(\"index\");\n }\n\n /**\n * Retrieve modelcatalog.js of content toc\n */\n get entryDate(): string | null {\n const timeversionFilter = this.filterCollection.getFilterByAttributeKey(\n TIMEVERSION_FILTER_NAME,\n );\n if (timeversionFilter && timeversionFilter.attribute) {\n return timeversionFilter.attribute.value;\n }\n\n return null;\n }\n\n /**\n * get searchterm filter\n */\n get searchtermfilter(): FilterType | null {\n return this.filterCollection.getFilterByAttributeKey(\"label\");\n }\n\n /**\n * Get model category filter\n */\n get modelCategoryFilter(): FilterType | null {\n return this.filterCollection.getFilterByAttributeKey(\"modelCategory\");\n }\n\n /**\n * Get concept links found by index filter\n */\n get items(): ResourceCollection<ConceptLinkModel> {\n return this._concepts;\n }\n\n /**\n * Replace the items collection\n */\n set items(itemCollection: ResourceCollection<ConceptLinkModel>) {\n this._concepts = itemCollection;\n }\n}\n"],"mappings":";;;AACA,OAAOA,aAAa,MAAM,uBAAuB;AACjD,OAAOC,kBAAkB,MAAM,4BAA4B;AAC3D,OAAOC,gBAAgB,MAAM,6BAA6B;AAC1D,OAAOC,gBAAgB,MAAM,oBAAoB;AAEjD,SAASC,uBAAuB,QAAQ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AS,EAAE;MACpD,OAAOD,iBAAiB,CAACC,SAAS,CAACT,KAAK;IAC1C;IAEA,OAAO,IAAI;EACb;;EAEA;AACF;AACA;EACE,IAAIU,gBAAgBA,CAAA,EAAsB;IACxC,OAAO,IAAI,CAACf,gBAAgB,CAACY,uBAAuB,CAAC,OAAO,CAAC;EAC/D;;EAEA;AACF;AACA;EACE,IAAII,mBAAmBA,CAAA,EAAsB;IAC3C,OAAO,IAAI,CAAChB,gBAAgB,CAACY,uBAAuB,CAAC,eAAe,CAAC;EACvE;;EAEA;AACF;AACA;EACE,IAAInB,KAAKA,CAAA,EAAyC;IAChD,OAAO,IAAI,CAACd,SAAS;EACvB;;EAEA;AACF;AACA;EACE,IAAIc,KAAKA,CAACwB,cAAoD,EAAE;IAC9D,IAAI,CAACtC,SAAS,GAAGsC,cAAc;EACjC;AACF","ignoreList":[]}
1
+ {"version":3,"file":"ConceptIndexModel.js","names":["ResourceModel","ResourceCollection","FilterCollection","ConceptLinkModel","TIMEVERSION_FILTER_NAME","ConceptIndexModel","constructor","modularuiResponse","_context","_defineProperty","_filterCollection","_filterInstanceProperty","data","filter","contributions","dynamicschema","modelOptions","_concepts","collection","_embedded","_mapInstanceProperty","results","call","concept","entryDate","type","resourcetype","modelName","isApplicableModel","resourceType","getInitialChildModelLinks","items","setChildModels","models","errors","selfhref","href","selflink","filterCollection","hasItems","forEach","params","param","value","setParameter","name","removeParameter","label","getContribution","indexfilter","getFilterByAttributeKey","timeversionFilter","attribute","searchtermfilter","modelCategoryFilter","itemCollection"],"sources":["../../../src/models/concepts/ConceptIndexModel.js"],"sourcesContent":["// @flow\nimport ResourceModel from \"../base/ResourceModel\";\nimport ResourceCollection from \"../base/ResourceCollection\";\nimport FilterCollection from \"../filters/FilterCollection\";\nimport ConceptLinkModel from \"./ConceptLinkModel\";\n\nimport { TIMEVERSION_FILTER_NAME } from \"../../constants/Constants\";\n\nimport type { ModularUIResponse } from \"../../modularui\";\nimport type { FilterType, ModularUIModel } from \"../types\";\nimport type LinkModel from \"../links/LinkModel\";\nimport type Href from \"../href/Href\";\nimport type ErrorResponse from \"../error/ErrorResponse\";\n\n/**\n * Get Index of concepts, to filter model catalog\n */\nexport default class ConceptIndexModel extends ResourceModel {\n _filterCollection: FilterCollection;\n _concepts: ResourceCollection<ConceptLinkModel>;\n\n /**\n */\n constructor(modularuiResponse: ModularUIResponse) {\n super(modularuiResponse);\n\n this._filterCollection = new FilterCollection(\n this.data.filter,\n {\n filter: this.contributions.filter,\n dynamicschema: this.data.dynamicschema,\n },\n this.modelOptions,\n );\n\n this._concepts = new ResourceCollection();\n this._concepts.collection = this.data._embedded\n ? this.data._embedded.results.map(\n (concept) =>\n new ConceptLinkModel(\n concept.concept,\n this.entryDate,\n this.modelOptions,\n ),\n )\n : [];\n }\n\n /**\n */\n get type(): string {\n if (this.resourcetype === \"RelatedConcepts\") {\n return \"RelatedConcepts\";\n }\n\n return \"ConceptIndex\";\n }\n\n /**\n */\n static get modelName(): string {\n return \"ConceptIndexModel\";\n }\n\n /**\n */\n static isApplicableModel(data: ModularUIResponse): boolean {\n const resourceType = data.contributions?.resourcetype;\n return (\n resourceType === \"ConceptSearch\" ||\n resourceType === \"relatedConcepts\" ||\n resourceType === \"RelatedConcepts\"\n );\n }\n\n /**\n */\n getInitialChildModelLinks(): Array<LinkModel> {\n return this.items.getInitialChildModelLinks();\n }\n\n /**\n */\n setChildModels(models: Array<ModularUIModel>, errors: Array<ErrorResponse>) {\n this.items.setChildModels(models, errors);\n }\n\n /**\n * Getting the self link of this list\n */\n get selfhref(): Href {\n const { href } = this.selflink;\n\n if (this.filterCollection.hasItems) {\n this.filterCollection.forEach((filter) => {\n filter.params.forEach((param) => {\n if (param.value) {\n href.setParameter(param.name, param.value);\n } else {\n href.removeParameter(param.name);\n }\n });\n });\n }\n\n return href;\n }\n\n /**\n */\n get label(): string {\n return this.getContribution(\"label\");\n }\n\n /**\n * Retrieve filters of conceptindex model\n */\n get filterCollection(): FilterCollection {\n return this._filterCollection;\n }\n\n /**\n * Get index filter\n */\n get indexfilter(): FilterType | null {\n return this.filterCollection.getFilterByAttributeKey(\"index\");\n }\n\n /**\n * Retrieve modelcatalog.js of content toc\n */\n get entryDate(): string | null {\n const timeversionFilter = this.filterCollection.getFilterByAttributeKey(\n TIMEVERSION_FILTER_NAME,\n );\n if (timeversionFilter && timeversionFilter.attribute) {\n return timeversionFilter.attribute.value;\n }\n\n return null;\n }\n\n /**\n * get searchterm filter\n */\n get searchtermfilter(): FilterType | null {\n return this.filterCollection.getFilterByAttributeKey(\"label\");\n }\n\n /**\n * Get model category filter\n */\n get modelCategoryFilter(): FilterType | null {\n return this.filterCollection.getFilterByAttributeKey(\"modelCategory\");\n }\n\n /**\n * Get concept links found by index filter\n */\n get items(): ResourceCollection<ConceptLinkModel> {\n return this._concepts;\n }\n\n /**\n * Replace the items collection\n */\n set items(itemCollection: ResourceCollection<ConceptLinkModel>) {\n this._concepts = itemCollection;\n }\n}\n"],"mappings":";;;AACA,OAAOA,aAAa,MAAM,uBAAuB;AACjD,OAAOC,kBAAkB,MAAM,4BAA4B;AAC3D,OAAOC,gBAAgB,MAAM,6BAA6B;AAC1D,OAAOC,gBAAgB,MAAM,oBAAoB;AAEjD,SAASC,uBAAuB,QAAQ,2BAA2B;AAQnE;AACA;AACA;AACA,eAAe,MAAMC,iBAAiB,SAASL,aAAa,CAAC;EAI3D;AACF;EACEM,WAAWA,CAACC,iBAAoC,EAAE;IAAA,IAAAC,QAAA;IAChD,KAAK,CAACD,iBAAiB,CAAC;IAACE,eAAA;IAAAA,eAAA;IAEzB,IAAI,CAACC,iBAAiB,GAAG,IAAIR,gBAAgB,CAAAS,uBAAA,CAC3C,IAAI,CAACC,IAAI,GACT;MACEC,MAAM,EAAAF,uBAAA,CAAE,IAAI,CAACG,aAAa,CAAO;MACjCC,aAAa,EAAE,IAAI,CAACH,IAAI,CAACG;IAC3B,CAAC,EACD,IAAI,CAACC,YACP,CAAC;IAED,IAAI,CAACC,SAA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AEA;AACF;AACA;EACE,IAAIc,KAAKA,CAACwB,cAAoD,EAAE;IAC9D,IAAI,CAACtC,SAAS,GAAGsC,cAAc;EACjC;AACF","ignoreList":[]}
@@ -60,6 +60,14 @@ export default class ConceptLinkModel extends BaseModel {
60
60
  * Indicates if the given concept type id or href exists in the hierarchy of concept types for this concept
61
61
  */
62
62
  isOfConceptType(conceptTypeId: string): boolean;
63
+ /**
64
+ *
65
+ */
66
+ get modelCategory(): string;
67
+ /**
68
+ *
69
+ */
70
+ get fragment(): SectionFragment;
63
71
  }
64
72
  import BaseModel from "../base/BaseModel";
65
73
  import LinkCollection from "../links/LinkCollection";
@@ -67,4 +75,11 @@ import ConceptTypeDetailModel from "./ConceptTypeDetailModel";
67
75
  import LinkModel from "../links/LinkModel";
68
76
  import { ModularUIModel } from "../types";
69
77
  import Href from "../href/Href";
78
+ type SectionFragment = {
79
+ sectionId: string;
80
+ text: string;
81
+ startOffset: number;
82
+ endOffset: number;
83
+ };
70
84
  import { ModelOptions } from "../types";
85
+ export {};
@@ -140,5 +140,19 @@ export default class ConceptLinkModel extends BaseModel {
140
140
  isOfConceptType(conceptTypeId) {
141
141
  return this.conceptType?.isOfConceptType(conceptTypeId) ?? false;
142
142
  }
143
+
144
+ /**
145
+ *
146
+ */
147
+ get modelCategory() {
148
+ return this.getData("modelCategory");
149
+ }
150
+
151
+ /**
152
+ *
153
+ */
154
+ get fragment() {
155
+ return this.getData("sectionFragment");
156
+ }
143
157
  }
144
158
  //# sourceMappingURL=ConceptLinkModel.js.map
@@ -12,6 +12,13 @@ import type {
12
12
  } from "../types";
13
13
  import type Href from "../href/Href";
14
14
 
15
+ type SectionFragment = {
16
+ sectionId: string,
17
+ text: string,
18
+ startOffset: number,
19
+ endOffset: number,
20
+ };
21
+
15
22
  /**
16
23
  * Link to a concept
17
24
  */
@@ -184,4 +191,18 @@ export default class ConceptLinkModel
184
191
  isOfConceptType(conceptTypeId: string): boolean {
185
192
  return this.conceptType?.isOfConceptType(conceptTypeId) ?? false;
186
193
  }
194
+
195
+ /**
196
+ *
197
+ */
198
+ get modelCategory(): string {
199
+ return this.getData("modelCategory");
200
+ }
201
+
202
+ /**
203
+ *
204
+ */
205
+ get fragment(): SectionFragment {
206
+ return this.getData("sectionFragment");
207
+ }
187
208
  }
@@ -1 +1 @@
1
- {"version":3,"file":"ConceptLinkModel.js","names":["BaseModel","LinkModel","LinkCollection","ConceptTypeDetailModel","TIMEVERSION_FILTER_NAME","ConceptLinkModel","constructor","data","entryDate","arguments","length","undefined","modelOptions","_defineProperty","_entryDate","getInitialChildModelLinks","conceptTypeLink","isCacheable","setChildModels","models","href","conceptTypeModel","_findInstanceProperty","call","model","selfhref","equalsWithParameters","type","conceptType","_conceptType","key","_id","label","getData","links","_links","Array","isArray","selflink","getLinkByKey","Error","addParameter","concepttypeHref","taxonomyType","asLinkModel","link","create","isOfConceptType","conceptTypeId"],"sources":["../../../src/models/concepts/ConceptLinkModel.js"],"sourcesContent":["// @flow\nimport BaseModel from \"../base/BaseModel\";\nimport LinkModel from \"../links/LinkModel\";\nimport LinkCollection from \"../links/LinkCollection\";\nimport ConceptTypeDetailModel from \"./ConceptTypeDetailModel\";\nimport { TIMEVERSION_FILTER_NAME } from \"../../constants/Constants\";\n\nimport type {\n IModelWithChildModels,\n ModelOptions,\n ModularUIModel,\n} from \"../types\";\nimport type Href from \"../href/Href\";\n\n/**\n * Link to a concept\n */\nexport default class ConceptLinkModel\n extends BaseModel\n implements IModelWithChildModels\n{\n _links: ?LinkCollection;\n _entryDate: ?ISO_DATE;\n _conceptType: ?ConceptTypeDetailModel;\n\n /**\n * Construct ConceptLinkModel\n */\n constructor(\n data: Object,\n entryDate: ?ISO_DATE = null,\n modelOptions?: ModelOptions,\n ) {\n super(data, {}, modelOptions);\n\n this._entryDate = entryDate;\n }\n\n /**\n */\n getInitialChildModelLinks(): Array<LinkModel> {\n if (this.conceptTypeLink) {\n this.conceptTypeLink.isCacheable = true;\n return [this.conceptTypeLink];\n }\n\n return [];\n }\n\n /**\n */\n setChildModels(models: Array<ModularUIModel>) {\n if (this.conceptTypeLink) {\n const href = this.conceptTypeLink.href;\n const conceptTypeModel = models.find((model) =>\n model.selfhref.equalsWithParameters(href),\n );\n\n if (conceptTypeModel?.type === \"ConceptTypeDetail\") {\n this.conceptType = conceptTypeModel;\n }\n }\n }\n\n /**\n * Retrieve concept type\n */\n get conceptType(): ?ConceptTypeDetailModel {\n return this._conceptType;\n }\n\n /**\n * Set concept type\n */\n set conceptType(conceptType: ?ModularUIModel) {\n this._conceptType =\n conceptType instanceof ConceptTypeDetailModel ? conceptType : null;\n }\n\n /**\n * Retrieve key\n */\n get key(): string {\n return this.data._id;\n }\n\n /**\n * Retrieve label\n */\n get label(): string {\n const label = this.getData(\"label\");\n\n if (label) {\n return label;\n }\n\n return this.getData(\"conceptLabel\", \"\");\n }\n\n /**\n * Getting the links of the resource\n */\n get links(): LinkCollection {\n if (!this._links) {\n this._links = new LinkCollection(\n Array.isArray(this.data._links)\n ? this.data._links[0]\n : this.data._links,\n null,\n this.modelOptions,\n );\n }\n\n return this._links;\n }\n\n /**\n * Get self link of model\n */\n get selflink(): LinkModel {\n const selflink = this.links.getLinkByKey(\"self\");\n\n if (selflink === null) {\n throw new Error(\n `Could not find self link for ${\n this.key === null ? \"unknown\" : this.key\n }`,\n );\n }\n\n return selflink;\n }\n\n /**\n * Self href of concept\n */\n get selfhref(): Href {\n if (this._entryDate !== null) {\n return this.selflink.href.addParameter(\n TIMEVERSION_FILTER_NAME,\n this._entryDate,\n );\n }\n\n return this.selflink.href;\n }\n\n /**\n */\n get conceptTypeLink(): LinkModel | null {\n return this.links.getLinkByKey(\"concepttype\");\n }\n\n /**\n * Concept type href of concept\n */\n get concepttypeHref(): Href | null {\n return this.conceptTypeLink?.href ?? null;\n }\n\n /**\n */\n get taxonomyType(): string {\n return \"default\";\n }\n\n /**\n */\n asLinkModel(): LinkModel {\n const link = LinkModel.create(\n this.key,\n this.selfhref.href,\n this.label,\n this.modelOptions,\n );\n link.href = this.selfhref;\n\n return link;\n }\n\n /**\n * Indicates if the given concept type id or href exists in the hierarchy of concept types for this concept\n */\n isOfConceptType(conceptTypeId: string): boolean {\n return this.conceptType?.isOfConceptType(conceptTypeId) ?? false;\n }\n}\n"],"mappings":";;AACA,OAAOA,SAAS,MAAM,mBAAmB;AACzC,OAAOC,SAAS,MAAM,oBAAoB;AAC1C,OAAOC,cAAc,MAAM,yBAAyB;AACpD,OAAOC,sBAAsB,MAAM,0BAA0B;AAC7D,SAASC,uBAAuB,QAAQ,2BAA2B;AASnE;AACA;AACA;AACA,eAAe,MAAMC,gBAAgB,SAC3BL,SAAS,CAEnB;EAKE;AACF;AACA;EACEM,WAAWA,CACTC,IAAY,EAGZ;IAAA,IAFAC,SAAoB,GAAAC,SAAA,CAAAC,MAAA,QAAAD,SAAA,QAAAE,SAAA,GAAAF,SAAA,MAAG,IAAI;IAAA,IAC3BG,YAA2B,GAAAH,SAAA,CAAAC,MAAA,OAAAD,SAAA,MAAAE,SAAA;IAE3B,KAAK,CAACJ,IAAI,EAAE,CAAC,CAAC,EAAEK,YAAY,CAAC;IAACC,eAAA;IAAAA,eAAA;IAAAA,eAAA;IAE9B,IAAI,CAACC,UAAU,GAAGN,SAAS;EAC7B;;EAEA;AACF;EACEO,yBAAyBA,CAAA,EAAqB;IAC5C,IAAI,IAAI,CAACC,eAAe,EAAE;MACxB,IAAI,CAACA,eAAe,CAACC,WAAW,GAAG,IAAI;MACvC,OAAO,CAAC,IAAI,CAACD,eAAe,CAAC;IAC/B;IAEA,OAAO,EAAE;EACX;;EAEA;AACF;EACEE,cAAcA,CAACC,MAA6B,EAAE;IAC5C,IAAI,IAAI,CAACH,eAAe,EAAE;MACxB,MAAMI,IAAI,GAAG,IAAI,CAACJ,eAAe,CAACI,IAAI;MACtC,MAAMC,gBAAgB,GAAGC,qBAAA,CAAAH,MAAM,EAAAI,IAAA,CAANJ,MAAM,EAAOK,KAAK,IACzCA,KAAK,CAACC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hD,IAAID,QAAQ,KAAK,IAAI,EAAE;MACrB,MAAM,IAAIE,KAAK,CACb,gCACE,IAAI,CAACV,GAAG,KAAK,IAAI,GAAG,SAAS,GAAG,IAAI,CAACA,GAAG,EAE5C,CAAC;IACH;IAEA,OAAOQ,QAAQ;EACjB;;EAEA;AACF;AACA;EACE,IAAIb,QAAQA,CAAA,EAAS;IACnB,IAAI,IAAI,CAACX,UAAU,KAAK,IAAI,EAAE;MAC5B,OAAO,IAAI,CAACwB,QAAQ,CAAClB,IAAI,CAACqB,YAAY,CACpCrC,uBAAuB,EACvB,IAAI,CAACU,UACP,CAAC;IACH;IAEA,OAAO,IAAI,CAACwB,QAAQ,CAAClB,IAAI;EAC3B;;EAEA;AACF;EACE,IAAIJ,eAAeA,CAAA,EAAqB;IACtC,OAAO,IAAI,CAACkB,KAAK,CAACK,YAAY,CAAC,aAAa,CAAC;EAC/C;;EAEA;AACF;AACA;EACE,IAAIG,eAAeA,CAAA,EAAgB;IACjC,OAAO,IAAI,CAAC1B,eAAe,EAAEI,IAAI,IAAI,IAAI;EAC3C;;EAEA;AACF;EACE,IAAIuB,YAAYA,CAAA,EAAW;IACzB,OAAO,SAAS;EAClB;;EAEA;AACF;EACEC,WAAWA,CAAA,EAAc;IACvB,MAAMC,IAAI,GAAG5C,SAAS,CAAC6C,MAAM,CAC3B,IAAI,CAAChB,GAAG,EACR,IAAI,CAACL,QAAQ,CAACL,IAAI,EAClB,IAAI,CAACY,KAAK,EACV,IAAI,CAACpB,YACP,CAAC;IACDiC,IAAI,CAACzB,IAAI,GAAG,IAAI,CAACK,QAAQ;IAEzB,OAAOoB,IAAI;EACb;;EAEA;AACF;AACA;EACEE,eAAeA,CAACC,aAAqB,EAAW;IAC9C,OAAO,IAAI,CAACpB,WAAW,EAAEmB,eAAe,CAACC,aAAa,CAAC,IAAI,KAAK;EAClE;AACF","ignoreList":[]}
1
+ {"version":3,"file":"ConceptLinkModel.js","names":["BaseModel","LinkModel","LinkCollection","ConceptTypeDetailModel","TIMEVERSION_FILTER_NAME","ConceptLinkModel","constructor","data","entryDate","arguments","length","undefined","modelOptions","_defineProperty","_entryDate","getInitialChildModelLinks","conceptTypeLink","isCacheable","setChildModels","models","href","conceptTypeModel","_findInstanceProperty","call","model","selfhref","equalsWithParameters","type","conceptType","_conceptType","key","_id","label","getData","links","_links","Array","isArray","selflink","getLinkByKey","Error","addParameter","concepttypeHref","taxonomyType","asLinkModel","link","create","isOfConceptType","conceptTypeId","modelCategory","fragment"],"sources":["../../../src/models/concepts/ConceptLinkModel.js"],"sourcesContent":["// @flow\nimport BaseModel from \"../base/BaseModel\";\nimport LinkModel from \"../links/LinkModel\";\nimport LinkCollection from \"../links/LinkCollection\";\nimport ConceptTypeDetailModel from \"./ConceptTypeDetailModel\";\nimport { TIMEVERSION_FILTER_NAME } from \"../../constants/Constants\";\n\nimport type {\n IModelWithChildModels,\n ModelOptions,\n ModularUIModel,\n} from \"../types\";\nimport type Href from \"../href/Href\";\n\ntype SectionFragment = {\n sectionId: string,\n text: string,\n startOffset: number,\n endOffset: number,\n};\n\n/**\n * Link to a concept\n */\nexport default class ConceptLinkModel\n extends BaseModel\n implements IModelWithChildModels\n{\n _links: ?LinkCollection;\n _entryDate: ?ISO_DATE;\n _conceptType: ?ConceptTypeDetailModel;\n\n /**\n * Construct ConceptLinkModel\n */\n constructor(\n data: Object,\n entryDate: ?ISO_DATE = null,\n modelOptions?: ModelOptions,\n ) {\n super(data, {}, modelOptions);\n\n this._entryDate = entryDate;\n }\n\n /**\n */\n getInitialChildModelLinks(): Array<LinkModel> {\n if (this.conceptTypeLink) {\n this.conceptTypeLink.isCacheable = true;\n return [this.conceptTypeLink];\n }\n\n return [];\n }\n\n /**\n */\n setChildModels(models: Array<ModularUIModel>) {\n if (this.conceptTypeLink) {\n const href = this.conceptTypeLink.href;\n const conceptTypeModel = models.find((model) =>\n model.selfhref.equalsWithParameters(href),\n );\n\n if (conceptTypeModel?.type === \"ConceptTypeDetail\") {\n this.conceptType = conceptTypeModel;\n }\n }\n }\n\n /**\n * Retrieve concept type\n */\n get conceptType(): ?ConceptTypeDetailModel {\n return this._conceptType;\n }\n\n /**\n * Set concept type\n */\n set conceptType(conceptType: ?ModularUIModel) {\n this._conceptType =\n conceptType instanceof ConceptTypeDetailModel ? conceptType : null;\n }\n\n /**\n * Retrieve key\n */\n get key(): string {\n return this.data._id;\n }\n\n /**\n * Retrieve label\n */\n get label(): string {\n const label = this.getData(\"label\");\n\n if (label) {\n return label;\n }\n\n return this.getData(\"conceptLabel\", \"\");\n }\n\n /**\n * Getting the links of the resource\n */\n get links(): LinkCollection {\n if (!this._links) {\n this._links = new LinkCollection(\n Array.isArray(this.data._links)\n ? this.data._links[0]\n : this.data._links,\n null,\n this.modelOptions,\n );\n }\n\n return this._links;\n }\n\n /**\n * Get self link of model\n */\n get selflink(): LinkModel {\n const selflink = this.links.getLinkByKey(\"self\");\n\n if (selflink === null) {\n throw new Error(\n `Could not find self link for ${\n this.key === null ? \"unknown\" : this.key\n }`,\n );\n }\n\n return selflink;\n }\n\n /**\n * Self href of concept\n */\n get selfhref(): Href {\n if (this._entryDate !== null) {\n return this.selflink.href.addParameter(\n TIMEVERSION_FILTER_NAME,\n this._entryDate,\n );\n }\n\n return this.selflink.href;\n }\n\n /**\n */\n get conceptTypeLink(): LinkModel | null {\n return this.links.getLinkByKey(\"concepttype\");\n }\n\n /**\n * Concept type href of concept\n */\n get concepttypeHref(): Href | null {\n return this.conceptTypeLink?.href ?? null;\n }\n\n /**\n */\n get taxonomyType(): string {\n return \"default\";\n }\n\n /**\n */\n asLinkModel(): LinkModel {\n const link = LinkModel.create(\n this.key,\n this.selfhref.href,\n this.label,\n this.modelOptions,\n );\n link.href = this.selfhref;\n\n return link;\n }\n\n /**\n * Indicates if the given concept type id or href exists in the hierarchy of concept types for this concept\n */\n isOfConceptType(conceptTypeId: string): boolean {\n return this.conceptType?.isOfConceptType(conceptTypeId) ?? false;\n }\n\n /**\n *\n */\n get modelCategory(): string {\n return this.getData(\"modelCategory\");\n }\n\n /**\n *\n */\n get fragment(): SectionFragment {\n return this.getData(\"sectionFragment\");\n }\n}\n"],"mappings":";;AACA,OAAOA,SAAS,MAAM,mBAAmB;AACzC,OAAOC,SAAS,MAAM,oBAAoB;AAC1C,OAAOC,cAAc,MAAM,yBAAyB;AACpD,OAAOC,sBAAsB,MAAM,0BAA0B;AAC7D,SAASC,uBAAuB,QAAQ,2BAA2B;AAgBnE;AACA;AACA;AACA,eAAe,MAAMC,gBAAgB,SAC3BL,SAAS,CAEnB;EAKE;AACF;AACA;EACEM,WAAWA,CACTC,IAAY,EAGZ;IAAA,IAFAC,SAAoB,GAAAC,SAAA,CAAAC,MAAA,QAAAD,SAAA,QAAAE,SAAA,GAAAF,SAAA,MAAG,IAAI;IAAA,IAC3BG,YAA2B,GAAAH,SAAA,CAAAC,MAAA,OAAAD,SAAA,MAAAE,SAAA;IAE3B,KAAK,CAACJ,IAAI,EAAE,CAAC,CAAC,EAAEK,YAAY,CAAC;IAACC,eAAA;IAAAA,eAAA;IAAAA,eAAA;IAE9B,IAAI,CAACC,UAAU,GAAGN,SAAS;EAC7B;;EAEA;AACF;EACEO,yBAAyBA,CAAA,EAAqB;IAC5C,IAAI,IAAI,CAACC,eAAe,EAAE;MACxB,IAAI,CAACA,eAAe,CAACC,WAAW,GAAG,IAAI;MACvC,OAAO,CAAC,IAAI,CAACD,eAAe,CAAC;IAC/B;IAEA,OAAO,EAAE;EACX;;EAEA;AACF;EACEE,cAAcA,CAACC,MAA6B,EAAE;IAC5C,IAAI,IAAI,CAACH,eAAe,EAAE;MACxB,MAAMI,IAAI,GAAG,IAAI,CAACJ,eAAe,CAACI,IAAI;MACtC,MAAMC,gBAAgB,GAAGC,qBAAA,CAAAH,MAAM,EAAAI,IAAA,CAANJ,MAAM,EAAOK,KAAK,IACzCA,KAAK,CAACC,QAAQ,CAACC,oBAAoB,CAACN,IAAI,CAC1C,CAAC;MAED,IAAIC,gBAAgB,EAAEM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IAC9B,OAAO,IAAI,CAACjB,OAAO,CAAC,iBAAiB,CAAC;EACxC;AACF","ignoreList":[]}
@@ -23,10 +23,19 @@ declare class SourceReferenceModel {
23
23
  /**
24
24
  */
25
25
  get sourceLabel(): string;
26
+ /**
27
+ *
28
+ */
29
+ get sourceAbbreviation(): string;
26
30
  /**
27
31
  */
28
32
  get referenceHash(): number;
33
+ /**
34
+ *
35
+ */
36
+ get fragment(): SectionFragment | void;
29
37
  }
30
38
  import { ModelOptions } from "../types";
31
39
  import ContentLinkModel from "../content/ContentLinkModel";
32
40
  import Href from "../href/Href";
41
+ import { SectionFragment } from "../types";
@@ -25,7 +25,7 @@ class SourceReferenceModel {
25
25
  /**
26
26
  */
27
27
  get link() {
28
- const section = this._sourceReference._links.self.href.replace(`${this._sourceReference._links.content.href}/`, "");
28
+ const section = this.fragment?.sectionId || this._sourceReference._links.self.href.replace(`${this._sourceReference._links.content.href}/`, "");
29
29
  return new ContentLinkModel({
30
30
  ...this._sourceReference,
31
31
  section
@@ -35,7 +35,7 @@ class SourceReferenceModel {
35
35
  /**
36
36
  */
37
37
  get selfhref() {
38
- return new Href(this._sourceReference._links.self.href, "SourceReference", this._modelOptions);
38
+ return this.link.selfhref;
39
39
  }
40
40
 
41
41
  /**
@@ -56,11 +56,25 @@ class SourceReferenceModel {
56
56
  return this._sourceReference.sourceLabel;
57
57
  }
58
58
 
59
+ /**
60
+ *
61
+ */
62
+ get sourceAbbreviation() {
63
+ return this._sourceReference.sourceAbbreviation;
64
+ }
65
+
59
66
  /**
60
67
  */
61
68
  get referenceHash() {
62
69
  return createHashFromHref(this.selfhref);
63
70
  }
71
+
72
+ /**
73
+ *
74
+ */
75
+ get fragment() {
76
+ return this._sourceReference.sectionFragment;
77
+ }
64
78
  }
65
79
  export default SourceReferenceModel;
66
80
  //# sourceMappingURL=SourceReferenceModel.js.map
@@ -4,7 +4,7 @@ import { createHashFromHref } from "../../utils/helpers/createHash";
4
4
  import ContentLinkModel from "../content/ContentLinkModel";
5
5
  import Href from "../href/Href";
6
6
  import { getBasePathModularUI } from "../../constants";
7
- import type { ModelOptions } from "../types";
7
+ import type { ModelOptions, SectionFragment } from "../types";
8
8
 
9
9
  /**
10
10
  */
@@ -31,10 +31,12 @@ class SourceReferenceModel {
31
31
  /**
32
32
  */
33
33
  get link(): ContentLinkModel {
34
- const section = this._sourceReference._links.self.href.replace(
35
- `${this._sourceReference._links.content.href}/`,
36
- "",
37
- );
34
+ const section =
35
+ this.fragment?.sectionId ||
36
+ this._sourceReference._links.self.href.replace(
37
+ `${this._sourceReference._links.content.href}/`,
38
+ "",
39
+ );
38
40
 
39
41
  return new ContentLinkModel(
40
42
  {
@@ -49,11 +51,7 @@ class SourceReferenceModel {
49
51
  /**
50
52
  */
51
53
  get selfhref(): Href {
52
- return new Href(
53
- this._sourceReference._links.self.href,
54
- "SourceReference",
55
- this._modelOptions,
56
- );
54
+ return this.link.selfhref;
57
55
  }
58
56
 
59
57
  /**
@@ -74,11 +72,25 @@ class SourceReferenceModel {
74
72
  return this._sourceReference.sourceLabel;
75
73
  }
76
74
 
75
+ /**
76
+ *
77
+ */
78
+ get sourceAbbreviation(): string {
79
+ return this._sourceReference.sourceAbbreviation;
80
+ }
81
+
77
82
  /**
78
83
  */
79
84
  get referenceHash(): number {
80
85
  return createHashFromHref(this.selfhref);
81
86
  }
87
+
88
+ /**
89
+ *
90
+ */
91
+ get fragment(): SectionFragment | void {
92
+ return this._sourceReference.sectionFragment;
93
+ }
82
94
  }
83
95
 
84
96
  export default SourceReferenceModel;
@@ -1 +1 @@
1
- {"version":3,"file":"SourceReferenceModel.js","names":["createHashFromHref","ContentLinkModel","Href","getBasePathModularUI","SourceReferenceModel","constructor","sourceReference","entryDate","arguments","length","undefined","modelOptions","_defineProperty","_sourceReference","_entryDate","_modelOptions","origin","contextPath","link","section","_links","self","href","replace","content","selfhref","type","label","sourceLabel","referenceHash"],"sources":["../../../src/models/concepts/SourceReferenceModel.js"],"sourcesContent":["// @flow\nimport { createHashFromHref } from \"../../utils/helpers/createHash\";\n\nimport ContentLinkModel from \"../content/ContentLinkModel\";\nimport Href from \"../href/Href\";\nimport { getBasePathModularUI } from \"../../constants\";\nimport type { ModelOptions } from \"../types\";\n\n/**\n */\nclass SourceReferenceModel {\n _sourceReference: Object;\n _entryDate: ?ISO_DATE;\n _modelOptions: ModelOptions;\n\n /**\n */\n constructor(\n sourceReference: Object,\n entryDate: ?ISO_DATE = null,\n modelOptions?: ModelOptions,\n ) {\n this._sourceReference = sourceReference;\n this._entryDate = entryDate;\n this._modelOptions = modelOptions || {\n origin: \"\",\n contextPath: getBasePathModularUI(),\n };\n }\n\n /**\n */\n get link(): ContentLinkModel {\n const section = this._sourceReference._links.self.href.replace(\n `${this._sourceReference._links.content.href}/`,\n \"\",\n );\n\n return new ContentLinkModel(\n {\n ...this._sourceReference,\n section,\n },\n this._entryDate,\n this._modelOptions,\n );\n }\n\n /**\n */\n get selfhref(): Href {\n return new Href(\n this._sourceReference._links.self.href,\n \"SourceReference\",\n this._modelOptions,\n );\n }\n\n /**\n */\n get type(): string {\n return this._sourceReference.type;\n }\n\n /**\n */\n get label(): string {\n return this._sourceReference.label;\n }\n\n /**\n */\n get sourceLabel(): string {\n return this._sourceReference.sourceLabel;\n }\n\n /**\n */\n get referenceHash(): number {\n return createHashFromHref(this.selfhref);\n }\n}\n\nexport default SourceReferenceModel;\n"],"mappings":";AACA,SAASA,kBAAkB,QAAQ,gCAAgC;AAEnE,OAAOC,gBAAgB,MAAM,6BAA6B;AAC1D,OAAOC,IAAI,MAAM,cAAc;AAC/B,SAASC,oBAAoB,QAAQ,iBAAiB;AAGtD;AACA;AACA,MAAMC,oBAAoB,CAAC;EAKzB;AACF;EACEC,WAAWA,CACTC,eAAuB,EAGvB;IAAA,IAFAC,SAAoB,GAAAC,SAAA,CAAAC,MAAA,QAAAD,SAAA,QAAAE,SAAA,GAAAF,SAAA,MAAG,IAAI;IAAA,IAC3BG,YAA2B,GAAAH,SAAA,CA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AAerB,oBAAoB","ignoreList":[]}
1
+ {"version":3,"file":"SourceReferenceModel.js","names":["createHashFromHref","ContentLinkModel","Href","getBasePathModularUI","SourceReferenceModel","constructor","sourceReference","entryDate","arguments","length","undefined","modelOptions","_defineProperty","_sourceReference","_entryDate","_modelOptions","origin","contextPath","link","section","fragment","sectionId","_links","self","href","replace","content","selfhref","type","label","sourceLabel","sourceAbbreviation","referenceHash","sectionFragment"],"sources":["../../../src/models/concepts/SourceReferenceModel.js"],"sourcesContent":["// @flow\nimport { createHashFromHref } from \"../../utils/helpers/createHash\";\n\nimport ContentLinkModel from \"../content/ContentLinkModel\";\nimport Href from \"../href/Href\";\nimport { getBasePathModularUI } from \"../../constants\";\nimport type { ModelOptions, SectionFragment } from \"../types\";\n\n/**\n */\nclass SourceReferenceModel {\n _sourceReference: Object;\n _entryDate: ?ISO_DATE;\n _modelOptions: ModelOptions;\n\n /**\n */\n constructor(\n sourceReference: Object,\n entryDate: ?ISO_DATE = null,\n modelOptions?: ModelOptions,\n ) {\n this._sourceReference = sourceReference;\n this._entryDate = entryDate;\n this._modelOptions = modelOptions || {\n origin: \"\",\n contextPath: getBasePathModularUI(),\n };\n }\n\n /**\n */\n get link(): ContentLinkModel {\n const section =\n this.fragment?.sectionId ||\n this._sourceReference._links.self.href.replace(\n `${this._sourceReference._links.content.href}/`,\n \"\",\n );\n\n return new ContentLinkModel(\n {\n ...this._sourceReference,\n section,\n },\n this._entryDate,\n this._modelOptions,\n );\n }\n\n /**\n */\n get selfhref(): Href {\n return this.link.selfhref;\n }\n\n /**\n */\n get type(): string {\n return this._sourceReference.type;\n }\n\n /**\n */\n get label(): string {\n return this._sourceReference.label;\n }\n\n /**\n */\n get sourceLabel(): string {\n return this._sourceReference.sourceLabel;\n }\n\n /**\n *\n */\n get sourceAbbreviation(): string {\n return this._sourceReference.sourceAbbreviation;\n }\n\n /**\n */\n get referenceHash(): number {\n return createHashFromHref(this.selfhref);\n }\n\n /**\n *\n */\n get fragment(): SectionFragment | void {\n return this._sourceReference.sectionFragment;\n }\n}\n\nexport default SourceReferenceModel;\n"],"mappings":";AACA,SAASA,kBAAkB,QAAQ,gCAAgC;AAEnE,OAAOC,gBAAgB,MAAM,6BAA6B;AAC1D,OAAOC,IAAI,MAAM,cAAc;AAC/B,SAASC,oBAAoB,QAAQ,iBAAiB;AAGtD;AACA;AACA,MAAMC,oBAAoB,CAAC;EAKzB;AACF;EACEC,WAAWA,CACTC,eAAuB,EAGvB;IAAA,IAFAC,SAAoB,GAAAC,SAAA,CAAAC,MAAA,QAAAD,SAAA,QAAAE,SAAA,GAAAF,SAAA,MAAG,IAAI;IAAA,IAC3BG,YAA2B,GAAAH,SAAA,CAAAC,MAAA,OAAAD,SAAA,MAAAE,SAAA;IAAAE,eAAA;IAAAA,eAAA;IAAAA,eAAA;IAE3B,IAAI,CAACC,gBAAgB,GAAGP,eAAe;IACvC,IAAI,CAACQ,UAAU,GAAGP,SAAS;IAC3B,IAAI,CAACQ,aAAa,GAAGJ,YAAY,IAAI;MACnCK,MAAM,EAAE,EAAE;MACVC,WAAW,EAAEd,oBAAoB,CAAC;IACpC,CAAC;EACH;;EAEA;AACF;EACE,IAAIe,IAAIA,CAAA,EAAqB;IAC3B,MAAMC,OAAO,GACX,IAAI,CAACC,QAAQ,EAAEC,SAAS,IACxB,IAAI,CAACR,gBAAgB,CAACS,MAAM,CAACC,IAAI,CAACC,IAAI,CAACC,OAAO,CAC5C,GAAG,IAAI,CAACZ,gBAAgB,CAACS,MAAM,CAACI,OAAO,CAACF,IAAI,GAAG,EAC/C,EACF,CAAC;IAEH,OAAO,IAAIvB,gBAAgB,CACzB;MACE,GAAG,IAAI,CAACY,gBAAgB;MACxBM;IACF,CAAC,EACD,IAAI,CAACL,UAAU,EACf,IAAI,CAACC,aACP,CAAC;EACH;;EAEA;AACF;EACE,IAAIY,QAAQA,CAAA,EAAS;IACnB,OAAO,IAAI,CAACT,IAAI,CAACS,QAAQ;EAC3B;;EAEA;AACF;EACE,IAAIC,IAAIA,CAAA,EAAW;IACjB,OAAO,IAAI,CAACf,gBAAgB,CAACe,IAAI;EACnC;;EAEA;AACF;EACE,IAAIC,KAAKA,CAAA,EAAW;IAClB,OAAO,IAAI,CAAChB,gBAAgB,CAACgB,KAAK;EACpC;;EAEA;AACF;EACE,IAAIC,WAAWA,CAAA,EAAW;IACxB,OAAO,IAAI,CAACjB,gBAAgB,CAACiB,WAAW;EAC1C;;EAEA;AACF;AACA;EACE,IAAIC,kBAAkBA,CAAA,EAAW;IAC/B,OAAO,IAAI,CAAClB,gBAAgB,CAACkB,kBAAkB;EACjD;;EAEA;AACF;EACE,IAAIC,aAAaA,CAAA,EAAW;IAC1B,OAAOhC,kBAAkB,CAAC,IAAI,CAAC2B,QAAQ,CAAC;EAC1C;;EAEA;AACF;AACA;EACE,IAAIP,QAAQA,CAAA,EAA2B;IACrC,OAAO,IAAI,CAACP,gBAAgB,CAACoB,eAAe;EAC9C;AACF;AAEA,eAAe7B,oBAAoB","ignoreList":[]}
@@ -0,0 +1,12 @@
1
+ import ModularUIResponse from "../../../modularui/ModularUIResponse";
2
+ import data from "./related_concepts_data.json";
3
+ import contributions from "./related_concepts_contributions.json";
4
+ import ConceptIndexModel from "../ConceptIndexModel";
5
+
6
+ const response = ModularUIResponse.create({
7
+ key: "concept",
8
+ data,
9
+ contributions,
10
+ });
11
+
12
+ export const relatedConcepts = new ConceptIndexModel(response);
@@ -0,0 +1,60 @@
1
+ import { relatedConcepts } from "../__mock__/related_concepts";
2
+ import ConceptIndexModel from "../ConceptIndexModel";
3
+
4
+ describe("Related concepts", () => {
5
+ it("Should be able to create a relatedConceptsModel from RelatedConcepts json", () => {
6
+ expect(relatedConcepts).toBeInstanceOf(ConceptIndexModel);
7
+
8
+ expect(relatedConcepts.label).toBe("Related concepts of content");
9
+
10
+ expect(relatedConcepts.label).toBe("Related concepts of content");
11
+ expect(relatedConcepts.selfhref.toString()).toBe(
12
+ "/content/bundle-com.beinformed.source.Highlevelrequirements/ResearchGrant/High%20level%20requirements.formalsource/relatedConcepts?entryDate=2025-06-03",
13
+ );
14
+
15
+ expect(relatedConcepts.entryDate).toBe("2025-06-03");
16
+ expect(relatedConcepts.modelCategoryFilter.label).toBe("Model category");
17
+
18
+ expect(relatedConcepts.items.size).toBe(116);
19
+
20
+ const firstItem = relatedConcepts.items.first;
21
+ expect(firstItem.key).toBe(
22
+ "SystemMustSendAutomatedNotificationsForStatusChanges",
23
+ );
24
+ expect(firstItem.label).toBe(
25
+ "System must send automated notifications for status changes.",
26
+ );
27
+ expect(firstItem.modelCategory).toBe("Requirements");
28
+ expect(firstItem.selfhref.toString()).toBe(
29
+ "/concepts/bundle-com.beinformed.frames.ResearchGrantRequirements/frames.beimodel.json/SystemMustSendAutomatedNotificationsForStatusChanges?entryDate=2025-06-03",
30
+ );
31
+ expect(firstItem.conceptTypeLink.href.toString()).toBe(
32
+ "/concepttypes/bundle-com.beinformed.research.grant.metamodels/High%20level%20requirements.bixml/ArchitecturalSignificantRequirement",
33
+ );
34
+
35
+ expect(firstItem.fragment.sectionId).toBe(
36
+ "AutomatedNotifications_Requirement",
37
+ );
38
+ expect(firstItem.fragment.text).toBeUndefined();
39
+
40
+ const secondItem = relatedConcepts.items.get(1);
41
+
42
+ expect(secondItem.key).toBe(
43
+ "n74UsersHaveMaximumFlexibilityWithinPolicyConstraints",
44
+ );
45
+ expect(secondItem.label).toBe(
46
+ "Users have maximum flexibility within policy constraints",
47
+ );
48
+
49
+ expect(secondItem.modelCategory).toBe("Requirements");
50
+
51
+ expect(secondItem.fragment.sectionId).toBe(
52
+ "MaximumFlexibilityWithinPolicyConstraints",
53
+ );
54
+ expect(secondItem.fragment.text).toBe(
55
+ "<p>Users have maximum flexibility within policy constraints</p>",
56
+ );
57
+ expect(secondItem.fragment.startOffset).toBe(0);
58
+ expect(secondItem.fragment.endOffset).toBe(56);
59
+ });
60
+ });