@beinformed/ui 1.65.29 → 1.67.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (39) hide show
  1. package/CHANGELOG.md +27 -0
  2. package/esm/hooks/useErrorHandler.js +26 -0
  3. package/esm/hooks/useErrorHandler.js.flow +31 -0
  4. package/esm/hooks/useErrorHandler.js.map +1 -0
  5. package/esm/hooks/useI18n.js +16 -2
  6. package/esm/hooks/useI18n.js.flow +21 -2
  7. package/esm/hooks/useI18n.js.map +1 -1
  8. package/esm/hooks/useModelSelectors.js +13 -2
  9. package/esm/hooks/useModelSelectors.js.flow +15 -1
  10. package/esm/hooks/useModelSelectors.js.map +1 -1
  11. package/esm/models/concepts/BusinessScenarioModel.js +1 -0
  12. package/esm/models/concepts/BusinessScenarioModel.js.flow +1 -0
  13. package/esm/models/concepts/BusinessScenarioModel.js.map +1 -1
  14. package/esm/redux/_i18n/types.js.flow +14 -0
  15. package/esm/redux/_i18n/types.js.map +1 -1
  16. package/esm/redux/_modularui/ModularUISelectors.js +8 -2
  17. package/esm/redux/_modularui/ModularUISelectors.js.flow +12 -7
  18. package/esm/redux/_modularui/ModularUISelectors.js.map +1 -1
  19. package/esm/redux/_modularui/types.js.flow +63 -0
  20. package/esm/redux/_modularui/types.js.map +1 -1
  21. package/esm/redux/_router/types.js.flow +45 -0
  22. package/esm/redux/_router/types.js.map +1 -1
  23. package/esm/redux/types.js.flow +144 -12
  24. package/esm/redux/types.js.map +1 -1
  25. package/lib/hooks/useErrorHandler.js +33 -0
  26. package/lib/hooks/useErrorHandler.js.map +1 -0
  27. package/lib/hooks/useI18n.js +16 -1
  28. package/lib/hooks/useI18n.js.map +1 -1
  29. package/lib/hooks/useModelSelectors.js +14 -1
  30. package/lib/hooks/useModelSelectors.js.map +1 -1
  31. package/lib/models/concepts/BusinessScenarioModel.js +1 -0
  32. package/lib/models/concepts/BusinessScenarioModel.js.map +1 -1
  33. package/lib/redux/_i18n/types.js.map +1 -1
  34. package/lib/redux/_modularui/ModularUISelectors.js +8 -2
  35. package/lib/redux/_modularui/ModularUISelectors.js.map +1 -1
  36. package/lib/redux/_modularui/types.js.map +1 -1
  37. package/lib/redux/_router/types.js.map +1 -1
  38. package/lib/redux/types.js.map +1 -1
  39. package/package.json +5 -5
@@ -1 +1 @@
1
- {"version":3,"file":"useI18n.js","names":["_reactRedux","require","_reselect","_memoize","_interopRequireDefault","_i18n","getMessage","createSelector","getLocales","getLocale","locales","localeCode","memoize","id","defaultMessage","placeholders","args","_stringify","default","useMessage","useSelector","exports","useTranslate","useLocale","getLocaleCodes","state","i18n","_map","call","locale","code","useLocaleCodes"],"sources":["../../src/hooks/useI18n.js"],"sourcesContent":["// @flow\nimport { useSelector } from \"react-redux\";\nimport { createSelector } from \"reselect\";\nimport memoize from \"lodash/memoize\";\n\nimport { getLocales, getLocale } from \"../redux/selectors/i18n\";\n\nconst getMessage = createSelector(\n [getLocales, getLocale],\n (locales, localeCode) =>\n memoize(\n (id: string, defaultMessage?: string, placeholders?: Object) =>\n locales\n .getLocale(localeCode)\n .getMessage(id, defaultMessage, placeholders),\n (...args) => JSON.stringify(args),\n ),\n);\n\n/**\n */\nconst useMessage = (\n id: string,\n defaultMessage?: string,\n placeholders?: Object | null,\n): any => useSelector(getMessage)(id, defaultMessage, placeholders);\n\n/**\n */\nconst useTranslate = (): ((...any) => any) => useSelector(getMessage);\n\n/**\n */\nconst useLocale = (): string => useSelector(getLocale);\n\nconst getLocaleCodes = createSelector(\n (state) => state.i18n.locales,\n (locales) => locales.map((locale) => locale.code),\n);\n\n/**\n * Retrieve all available locale codes\n */\nconst useLocaleCodes = (): Array<string> => useSelector(getLocaleCodes);\n\nexport { useTranslate, useMessage, useLocale, useLocaleCodes };\n"],"mappings":";;;;;;;;;AACA,IAAAA,WAAA,GAAAC,OAAA;AACA,IAAAC,SAAA,GAAAD,OAAA;AACA,IAAAE,QAAA,GAAAC,sBAAA,CAAAH,OAAA;AAEA,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18n.js","names":["_react","require","_reactRedux","_reselect","_memoize","_interopRequireDefault","_i18n","_I18nActions","getMessage","createSelector","getLocales","getLocale","locales","localeCode","memoize","id","defaultMessage","placeholders","args","_stringify","default","useMessage","useSelector","exports","useTranslate","useLocale","getLocaleCodes","state","i18n","_map","call","locale","code","useLocaleCodes","useUpdateLocale","dispatch","useDispatch","useCallback","updateLocale"],"sources":["../../src/hooks/useI18n.js"],"sourcesContent":["// @flow\nimport { useCallback } from \"react\";\nimport { useDispatch, useSelector } from \"react-redux\";\nimport { createSelector } from \"reselect\";\n\nimport memoize from \"lodash/memoize\";\n\nimport { getLocales, getLocale } from \"../redux/selectors/i18n\";\nimport { updateLocale } from \"../redux/_i18n/I18nActions\";\n\nconst getMessage = createSelector(\n [getLocales, getLocale],\n (locales, localeCode) =>\n memoize(\n (id: string, defaultMessage?: string, placeholders?: Object) =>\n locales\n .getLocale(localeCode)\n .getMessage(id, defaultMessage, placeholders),\n (...args) => JSON.stringify(args),\n ),\n);\n\n/**\n */\nconst useMessage = (\n id: string,\n defaultMessage?: string,\n placeholders?: Object | null,\n): any => useSelector(getMessage)(id, defaultMessage, placeholders);\n\n/**\n */\nconst useTranslate = (): ((...any) => any) => useSelector(getMessage);\n\n/**\n */\nconst useLocale = (): string => useSelector(getLocale);\n\nconst getLocaleCodes = createSelector(\n (state) => state.i18n.locales,\n (locales) => locales.map((locale) => locale.code),\n);\n\n/**\n * Retrieve all available locale codes\n */\nconst useLocaleCodes = (): Array<string> => useSelector(getLocaleCodes);\n\n/**\n * A hook that returns a memoized function to update the application locale.\n *\n * @returns {(locale: string) => void} A memoized function to update the locale.\n */\nconst useUpdateLocale = (): ((locale: string) => void) => {\n const dispatch = useDispatch();\n\n return useCallback(\n (locale: string) => {\n dispatch(updateLocale(locale));\n },\n [dispatch],\n );\n};\n\nexport { useTranslate, useMessage, useLocale, useLocaleCodes, useUpdateLocale };\n"],"mappings":";;;;;;;;;AACA,IAAAA,MAAA,GAAAC,OAAA;AACA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A;AACA,MAAMC,cAAc,GAAGA,CAAA,KAAqB,IAAAX,uBAAW,EAACI,cAAc,CAAC;;AAEvE;AACA;AACA;AACA;AACA;AAJAH,OAAA,CAAAU,cAAA,GAAAA,cAAA;AAKA,MAAMC,eAAe,GAAGA,CAAA,KAAkC;EACxD,MAAMC,QAAQ,GAAG,IAAAC,uBAAW,EAAC,CAAC;EAE9B,OAAO,IAAAC,kBAAW,EACfN,MAAc,IAAK;IAClBI,QAAQ,CAAC,IAAAG,yBAAY,EAACP,MAAM,CAAC,CAAC;EAChC,CAAC,EACD,CAACI,QAAQ,CACX,CAAC;AACH,CAAC;AAACZ,OAAA,CAAAW,eAAA,GAAAA,eAAA","ignoreList":[]}
@@ -4,10 +4,11 @@ var _interopRequireDefault = require("@babel/runtime-corejs3/helpers/interopRequ
4
4
  Object.defineProperty(exports, "__esModule", {
5
5
  value: true
6
6
  });
7
- exports.useModelByHref = exports.useKeyByHref = exports.useFirstModelByInstance = exports.useAllModelsByInstance = exports.useAllKeysByHref = exports.useAllFinishedModels = exports.useActiveModels = exports.useActiveModelByInstance = void 0;
7
+ exports.useModelByHref = exports.useKeyByHref = exports.useFirstModelByInstance = exports.useCurrentApplication = exports.useAllModelsByInstance = exports.useAllKeysByHref = exports.useAllFinishedModels = exports.useActiveModels = exports.useActiveModelByInstance = void 0;
8
8
  var _reactRedux = require("react-redux");
9
9
  var _ModularUISelectors = require("../redux/_modularui/ModularUISelectors");
10
10
  var _Href = _interopRequireDefault(require("../models/href/Href"));
11
+ var _ApplicationModel = _interopRequireDefault(require("../models/application/ApplicationModel"));
11
12
  /**
12
13
  * Returns all models in the store that are instances of the provided class
13
14
  * and match the current application locale.
@@ -83,5 +84,17 @@ exports.useActiveModels = useActiveModels;
83
84
  const useAllFinishedModels = () => {
84
85
  return (0, _reactRedux.useSelector)(_ModularUISelectors.getAllFinishedModels);
85
86
  };
87
+
88
+ /**
89
+ * Returns the current active application, without retrying to request it.
90
+ */
86
91
  exports.useAllFinishedModels = useAllFinishedModels;
92
+ const useCurrentApplication = () => {
93
+ const application = (0, _reactRedux.useSelector)(_ModularUISelectors.getApplication);
94
+ if (application instanceof _ApplicationModel.default) {
95
+ return application;
96
+ }
97
+ return null;
98
+ };
99
+ exports.useCurrentApplication = useCurrentApplication;
87
100
  //# sourceMappingURL=useModelSelectors.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"useModelSelectors.js","names":["_reactRedux","require","_ModularUISelectors","_Href","_interopRequireDefault","useAllModelsByInstance","instance","useSelector","state","getAllModelsByInstance","exports","useFirstModelByInstance","getFirstModelByInstance","useActiveModelByInstance","getActiveModelByInstance","useModelByHref","href","modelByHref","useKeyByHref","keyByHref","useAllKeysByHref","allKeysByHref","useActiveModels","getActiveModels","useAllFinishedModels","getAllFinishedModels"],"sources":["../../src/hooks/useModelSelectors.js"],"sourcesContent":["// @flow\nimport { useSelector } from \"react-redux\";\n\nimport {\n getAllModelsByInstance,\n getFirstModelByInstance,\n getActiveModelByInstance,\n modelByHref,\n keyByHref,\n allKeysByHref,\n getActiveModels,\n getAllFinishedModels,\n} from \"../redux/_modularui/ModularUISelectors\";\nimport type { ModularUIModel } from \"../models/types\";\nimport type { ReduxState } from \"../redux/types\";\nimport Href from \"../models/href/Href\";\n\n/**\n * Returns all models in the store that are instances of the provided class\n * and match the current application locale.\n */\nexport const useAllModelsByInstance = <T>(\n instance: Class<T>,\n): Array<ModularUIModel> => {\n return useSelector((state: ReduxState) =>\n getAllModelsByInstance(state, instance),\n );\n};\n\n/**\n * Returns the first model found in the store that is an instance of the\n * provided class and matches the current locale.\n */\nexport const useFirstModelByInstance = <T>(instance: Class<T>): T | null => {\n return useSelector((state: ReduxState) =>\n getFirstModelByInstance(state, instance),\n );\n};\n\n/**\n * Returns the model instance that is currently \"active\" based on the URL path.\n * It checks if the current router location starts with the model's selfhref path.\n */\nexport const useActiveModelByInstance = <T>(instance: Class<T>): T | null => {\n return useSelector((state: ReduxState) =>\n getActiveModelByInstance(state, instance),\n );\n};\n\n/**\n * Retrieves a specific model from the store based on its unique Href.\n * @param {Href | string} href - The Href object or string path of the model.\n * @returns {ModularUIModel | null} The model matching the href or null.\n */\nexport const useModelByHref = (href: Href | string): null | ModularUIModel => {\n return useSelector((state: ReduxState) => modelByHref(state, href));\n};\n\n/**\n * Returns the unique store key (identifier) for a model associated with a specific Href.\n * @param {Href | string} href - The Href object or string path.\n * @returns {string | null | void} The internal key of the model.\n */\nexport const useKeyByHref = (href: Href | string): ?string => {\n return useSelector((state: ReduxState) => keyByHref(state, href));\n};\n\n/**\n * Returns all internal keys found in the store for a specific Href.\n * Useful if multiple versions/entries exist for the same path.\n * @param {Href | string} href - The Href object or string path.\n * @returns {Array<string>} An array of keys.\n */\nexport const useAllKeysByHref = (href: Href | string): Array<string> => {\n return useSelector((state: ReduxState) => allKeysByHref(state, href));\n};\n\n/**\n * Returns a list of simplified model info (key, href, label, type) for all\n * models currently active in the navigation context (breadcrumbs).\n * @returns {Array<{key: string, href: Href, label: string, type: string}>}\n */\nexport const useActiveModels = (): Array<{\n key: string,\n href: Href,\n label: string,\n type: string,\n}> => {\n return useSelector(getActiveModels);\n};\n\n/**\n * Returns all models in the store that have a status of MODULARUI_STATUS.FINISHED.\n * @returns {Array<ModularUIModel>} An array of fully loaded models.\n */\nexport const useAllFinishedModels = (): Array<ModularUIModel> => {\n return useSelector(getAllFinishedModels);\n};\n"],"mappings":";;;;;;;AACA,IAAAA,WAAA,GAAAC,OAAA;AAEA,IAAAC,mBAAA,GAAAD,OAAA;AAYA,IAAAE,KAAA,GAAAC,sBAAA,CAAAH,OAAA;AAEA;AACA;AACA;AACA;AACO,MAAMI,sBAAsB,GACjCC,QAAkB,IACQ;EAC1B,OAAO,IAAAC,uBAAW,EAAEC,KAAiB,IACnC,IAAAC,0CAAsB,EAACD,KAAK,EAAEF,QAAQ,CACxC,CAAC;AACH,CAAC;;AAED;AACA;AACA;AACA;AAHAI,OAAA,CAAAL,sBAAA,GAAAA,sBAAA;AAIO,M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AY,eAAA,GAAAA,eAAA;AAIO,MAAME,oBAAoB,GAAGA,CAAA,KAA6B;EAC/D,OAAO,IAAAjB,uBAAW,EAACkB,wCAAoB,CAAC;AAC1C,CAAC;AAACf,OAAA,CAAAc,oBAAA,GAAAA,oBAAA","ignoreList":[]}
1
+ {"version":3,"file":"useModelSelectors.js","names":["_reactRedux","require","_ModularUISelectors","_Href","_interopRequireDefault","_ApplicationModel","useAllModelsByInstance","instance","useSelector","state","getAllModelsByInstance","exports","useFirstModelByInstance","getFirstModelByInstance","useActiveModelByInstance","getActiveModelByInstance","useModelByHref","href","modelByHref","useKeyByHref","keyByHref","useAllKeysByHref","allKeysByHref","useActiveModels","getActiveModels","useAllFinishedModels","getAllFinishedModels","useCurrentApplication","application","getApplication","ApplicationModel"],"sources":["../../src/hooks/useModelSelectors.js"],"sourcesContent":["// @flow\nimport { useSelector } from \"react-redux\";\n\nimport {\n getAllModelsByInstance,\n getFirstModelByInstance,\n getActiveModelByInstance,\n modelByHref,\n keyByHref,\n allKeysByHref,\n getActiveModels,\n getAllFinishedModels,\n getApplication,\n} from \"../redux/_modularui/ModularUISelectors\";\nimport Href from \"../models/href/Href\";\nimport ApplicationModel from \"../models/application/ApplicationModel\";\n\nimport type { ModularUIModel } from \"../models/types\";\nimport type { ReduxState } from \"../redux/types\";\n\n/**\n * Returns all models in the store that are instances of the provided class\n * and match the current application locale.\n */\nexport const useAllModelsByInstance = <T>(\n instance: Class<T>,\n): Array<ModularUIModel> => {\n return useSelector((state: ReduxState) =>\n getAllModelsByInstance(state, instance),\n );\n};\n\n/**\n * Returns the first model found in the store that is an instance of the\n * provided class and matches the current locale.\n */\nexport const useFirstModelByInstance = <T>(instance: Class<T>): T | null => {\n return useSelector((state: ReduxState) =>\n getFirstModelByInstance(state, instance),\n );\n};\n\n/**\n * Returns the model instance that is currently \"active\" based on the URL path.\n * It checks if the current router location starts with the model's selfhref path.\n */\nexport const useActiveModelByInstance = <T>(instance: Class<T>): T | null => {\n return useSelector((state: ReduxState) =>\n getActiveModelByInstance(state, instance),\n );\n};\n\n/**\n * Retrieves a specific model from the store based on its unique Href.\n * @param {Href | string} href - The Href object or string path of the model.\n * @returns {ModularUIModel | null} The model matching the href or null.\n */\nexport const useModelByHref = (href: Href | string): null | ModularUIModel => {\n return useSelector((state: ReduxState) => modelByHref(state, href));\n};\n\n/**\n * Returns the unique store key (identifier) for a model associated with a specific Href.\n * @param {Href | string} href - The Href object or string path.\n * @returns {string | null | void} The internal key of the model.\n */\nexport const useKeyByHref = (href: Href | string): ?string => {\n return useSelector((state: ReduxState) => keyByHref(state, href));\n};\n\n/**\n * Returns all internal keys found in the store for a specific Href.\n * Useful if multiple versions/entries exist for the same path.\n * @param {Href | string} href - The Href object or string path.\n * @returns {Array<string>} An array of keys.\n */\nexport const useAllKeysByHref = (href: Href | string): Array<string> => {\n return useSelector((state: ReduxState) => allKeysByHref(state, href));\n};\n\n/**\n * Returns a list of simplified model info (key, href, label, type) for all\n * models currently active in the navigation context (breadcrumbs).\n * @returns {Array<{key: string, href: Href, label: string, type: string}>}\n */\nexport const useActiveModels = (): Array<{\n key: string,\n href: Href,\n label: string,\n type: string,\n}> => {\n return useSelector(getActiveModels);\n};\n\n/**\n * Returns all models in the store that have a status of MODULARUI_STATUS.FINISHED.\n * @returns {Array<ModularUIModel>} An array of fully loaded models.\n */\nexport const useAllFinishedModels = (): Array<ModularUIModel> => {\n return useSelector(getAllFinishedModels);\n};\n\n/**\n * Returns the current active application, without retrying to request it.\n */\nexport const useCurrentApplication = (): ApplicationModel | null => {\n const application = useSelector(getApplication);\n if (application instanceof ApplicationModel) {\n return application;\n }\n return null;\n};\n"],"mappings":";;;;;;;AACA,IAAAA,WAAA,GAAAC,OAAA;AAEA,IAAAC,mBAAA,GAAAD,OAAA;AAWA,IAAAE,KAAA,GAAAC,sBAAA,CAAAH,OAAA;AACA,IAAAI,iBAAA,GAAAD,sBAAA,CAAAH,OAAA;AAKA;AACA;AACA;AACA;AACO,MAAMK,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vE,CAAC;;AAED;AACA;AACA;AACA;AACA;AAJAN,OAAA,CAAAU,gBAAA,GAAAA,gBAAA;AAKO,MAAME,eAAe,GAAGA,CAAA,KAKzB;EACJ,OAAO,IAAAf,uBAAW,EAACgB,mCAAe,CAAC;AACrC,CAAC;;AAED;AACA;AACA;AACA;AAHAb,OAAA,CAAAY,eAAA,GAAAA,eAAA;AAIO,MAAME,oBAAoB,GAAGA,CAAA,KAA6B;EAC/D,OAAO,IAAAjB,uBAAW,EAACkB,wCAAoB,CAAC;AAC1C,CAAC;;AAED;AACA;AACA;AAFAf,OAAA,CAAAc,oBAAA,GAAAA,oBAAA;AAGO,MAAME,qBAAqB,GAAGA,CAAA,KAA+B;EAClE,MAAMC,WAAW,GAAG,IAAApB,uBAAW,EAACqB,kCAAc,CAAC;EAC/C,IAAID,WAAW,YAAYE,yBAAgB,EAAE;IAC3C,OAAOF,WAAW;EACpB;EACA,OAAO,IAAI;AACb,CAAC;AAACjB,OAAA,CAAAgB,qBAAA,GAAAA,qBAAA","ignoreList":[]}
@@ -14,6 +14,7 @@ var _ConceptDetailModel = _interopRequireDefault(require("./ConceptDetailModel")
14
14
  var _ConceptTypeDetailModel = _interopRequireDefault(require("./ConceptTypeDetailModel"));
15
15
  var _Settings = require("../../constants/Settings");
16
16
  /**
17
+ * @deprecated use the ConceptDetailModel with concept type BusinessScenarios#BusinessScenario
17
18
  */
18
19
  class BusinessScenarioModel extends _ConceptDetailModel.default {
19
20
  constructor(...args) {
@@ -1 +1 @@
1
- {"version":3,"file":"BusinessScenarioModel.js","names":["_ConceptDetailModel","_interopRequireDefault","require","_ConceptTypeDetailModel","_Settings","BusinessScenarioModel","ConceptDetailModel","constructor","args","_defineProperty2","default","type","modelName","isApplicableModel","data","isOfConceptType","_links","concepttype","href","conceptTypeHref","settingNames","Array","isArray","TypeError","pathToKmt","conceptTypeSettings","STEP","getSetting","PERSONA","SYSTEM","SCENARIO","decodedConceptTypeHref","decodeURIComponent","some","settingName","conceptTypeSetting","_endsWith","call","getInitialChildModelLinks","_context","_context2","childModelLinks","scenarioStepLinks","_map","_filter","relationsCollection","all","relation","direction","concept","concepttypeHref","path","asLinkModel","length","push","setChildModels","models","errors","conceptTypeModel","_find","model","ConceptTypeDetailModel","conceptType","scenarioSteps","i","selfhref","_scenarioSteps","actors","forEach","scenarioStep","_context3","relationsToActor","newRelationToActor","actor","key","_default","exports"],"sources":["../../../src/models/concepts/BusinessScenarioModel.js"],"sourcesContent":["// @flow\nimport ConceptDetailModel from \"./ConceptDetailModel\";\nimport ConceptTypeDetailModel from \"./ConceptTypeDetailModel\";\nimport { getSetting } from \"../../constants/Settings\";\n\nimport type { ModularUIResponse } from \"../../modularui\";\nimport type { ModularUIModel } from \"../types\";\nimport type LinkModel from \"../links/LinkModel\";\nimport type ConceptLinkModel from \"./ConceptLinkModel\";\nimport type ErrorResponse from \"../error/ErrorResponse\";\n\n/**\n */\nclass BusinessScenarioModel extends ConceptDetailModel {\n _scenarioSteps: Array<ConceptDetailModel>;\n\n /**\n */\n get type(): string {\n return \"BusinessScenario\";\n }\n\n /**\n */\n static get modelName(): string {\n return \"BusinessScenario\";\n }\n\n /**\n */\n static isApplicableModel(data: ModularUIResponse): boolean {\n return BusinessScenarioModel.isOfConceptType(\n data?.data?._links?.concepttype?.href,\n [\"SCENARIO\"],\n );\n }\n\n /**\n */\n static isOfConceptType(\n conceptTypeHref: ?string,\n settingNames: Array<\"STEP\" | \"PERSONA\" | \"SCENARIO\" | \"SYSTEM\">,\n ): boolean {\n if (!conceptTypeHref) {\n return false;\n }\n\n // Check if settingNames is an array\n if (!Array.isArray(settingNames)) {\n throw new TypeError(\"settingNames must be an array\");\n }\n\n const pathToKmt = \"/Library/KMTs/Business scenarios.bixml\";\n\n const conceptTypeSettings = {\n STEP: getSetting(\"BUSINESS_SCENARIO_STEP_CONCEPT_TYPE\", [\n `${pathToKmt}/ScenarioStep`,\n ]),\n PERSONA: getSetting(\"BUSINESS_SCENARIO_PERSONA_CONCEPT_TYPE\", [\n `${pathToKmt}/Persona`,\n ]),\n SYSTEM: getSetting(\"BUSINESS_SCENARIO_SYSTEM_CONCEPT_TYPE\", [\n `${pathToKmt}/System`,\n ]),\n SCENARIO: getSetting(\"BUSINESS_SCENARIO_CONCEPT_TYPE\", [\n `${pathToKmt}/BusinessScenario`,\n ]),\n };\n\n const decodedConceptTypeHref = decodeURIComponent(conceptTypeHref);\n\n return settingNames.some(\n (settingName) =>\n Array.isArray(conceptTypeSettings[settingName]) &&\n conceptTypeSettings[settingName].some((conceptTypeSetting) =>\n decodedConceptTypeHref.endsWith(conceptTypeSetting),\n ),\n );\n }\n\n /**\n */\n getInitialChildModelLinks(): Array<LinkModel> {\n const childModelLinks = super.getInitialChildModelLinks();\n\n const scenarioStepLinks = this.relationsCollection.all\n .filter(\n (relation) =>\n relation.direction === \"outgoing\" &&\n BusinessScenarioModel.isOfConceptType(\n relation.concept.concepttypeHref?.path,\n [\"STEP\"],\n ),\n )\n .map((relation) => relation.concept.asLinkModel());\n\n if (scenarioStepLinks.length > 0) {\n childModelLinks.push(...scenarioStepLinks);\n }\n\n return childModelLinks;\n }\n\n /**\n */\n setChildModels(models: Array<ModularUIModel>, errors: Array<ErrorResponse>) {\n // $FlowExpectedError[incompatible-type]\n const conceptTypeModel: ?ConceptTypeDetailModel = models.find(\n (model) => model instanceof ConceptTypeDetailModel,\n );\n\n if (conceptTypeModel) {\n this.conceptType = conceptTypeModel;\n }\n\n this.relationsCollection.setChildModels(models, errors);\n\n const scenarioSteps = [];\n for (let i = 0; i < models.length; i++) {\n const model = models[i];\n\n if (\n model instanceof ConceptDetailModel &&\n BusinessScenarioModel.isOfConceptType(\n model.conceptType?.selfhref.path,\n [\"STEP\"],\n )\n ) {\n scenarioSteps.push(model);\n }\n }\n\n this.scenarioSteps = scenarioSteps;\n }\n\n /**\n */\n set scenarioSteps(models: Array<ConceptDetailModel>) {\n this._scenarioSteps = models;\n }\n\n /**\n */\n get scenarioSteps(): Array<ConceptDetailModel> {\n return this._scenarioSteps;\n }\n\n /**\n */\n get actors(): Array<ConceptLinkModel> {\n const actors = [];\n\n this.scenarioSteps.forEach((scenarioStep) => {\n const relationsToActor = scenarioStep.relationsCollection.find(\n (relation) =>\n relation.direction === \"outgoing\" &&\n BusinessScenarioModel.isOfConceptType(\n relation.concept.concepttypeHref?.path,\n [\"PERSONA\", \"SYSTEM\"],\n ),\n );\n\n const newRelationToActor =\n relationsToActor &&\n !actors.some((actor) => actor.key === relationsToActor.concept.key);\n\n if (relationsToActor && newRelationToActor) {\n actors.push(relationsToActor.concept);\n }\n });\n\n return actors;\n }\n}\n\nexport default BusinessScenarioModel;\n"],"mappings":";;;;;;;;;;;;AACA,IAAAA,mBAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,uBAAA,GAAAF,sBAAA,CAAAC,OAAA;AACA,IAAAE,SAAA,GAAAF,OAAA;AAQA;AACA;AACA,MAAMG,qBAAqB,SAASC,2BAAkB,CAAC;EAAAC,YAAA,GAAAC,IAAA;IAAA,SAAAA,IAAA;IAAA,IAAAC,gBAAA,CAAAC,OAAA;EAAA;EAGrD;AACF;EACE,IAAIC,IAAIA,CAAA,EAAW;IACjB,OAAO,kBAAkB;EAC3B;;EAEA;AACF;EACE,WAAWC,SAASA,CAAA,EAAW;IAC7B,OAAO,kBAAkB;EAC3B;;EAEA;AACF;EACE,OAAOC,iBAAiBA,CAACC,IAAuB,EAAW;IACzD,OAAOT,qBAAqB,CAACU,eAAe,CAC1CD,IAAI,EAAEA,IAAI,EAAEE,MAAM,EAAEC,WAAW,EAAEC,IAAI,EACrC,CAAC,UAAU,CACb,CAAC;EACH;;EAEA;AACF;EACE,OAAOH,eAAeA,CACpBI,eAAwB,EACxBC,YAA+D,EACtD;IACT,IAAI,CAACD,eAAe,EAAE;MACpB,OAAO,KAAK;IACd;;IAEA;IACA,IAAI,CAACE,KAAK,CAACC,OAAO,CAACF,YAAY,CAAC,EAAE;MAChC,MAAM,IAAIG,SAAS,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AAI,CAACG,cAAc;EAC5B;;EAEA;AACF;EACE,IAAIC,MAAMA,CAAA,EAA4B;IACpC,MAAMA,MAAM,GAAG,EAAE;IAEjB,IAAI,CAACJ,aAAa,CAACK,OAAO,CAAEC,YAAY,IAAK;MAAA,IAAAC,SAAA;MAC3C,MAAMC,gBAAgB,GAAG,IAAAZ,KAAA,CAAAjD,OAAA,EAAA4D,SAAA,GAAAD,YAAY,CAACxB,mBAAmB,EAAAR,IAAA,CAAAiC,SAAA,EACtDvB,QAAQ,IACPA,QAAQ,CAACC,SAAS,KAAK,UAAU,IACjC3C,qBAAqB,CAACU,eAAe,CACnCgC,QAAQ,CAACE,OAAO,CAACC,eAAe,EAAEC,IAAI,EACtC,CAAC,SAAS,EAAE,QAAQ,CACtB,CACJ,CAAC;MAED,MAAMqB,kBAAkB,GACtBD,gBAAgB,IAChB,CAACJ,MAAM,CAAClC,IAAI,CAAEwC,KAAK,IAAKA,KAAK,CAACC,GAAG,KAAKH,gBAAgB,CAACtB,OAAO,CAACyB,GAAG,CAAC;MAErE,IAAIH,gBAAgB,IAAIC,kBAAkB,EAAE;QAC1CL,MAAM,CAACb,IAAI,CAACiB,gBAAgB,CAACtB,OAAO,CAAC;MACvC;IACF,CAAC,CAAC;IAEF,OAAOkB,MAAM;EACf;AACF;AAAC,IAAAQ,QAAA,GAAAC,OAAA,CAAAlE,OAAA,GAEcL,qBAAqB","ignoreList":[]}
1
+ {"version":3,"file":"BusinessScenarioModel.js","names":["_ConceptDetailModel","_interopRequireDefault","require","_ConceptTypeDetailModel","_Settings","BusinessScenarioModel","ConceptDetailModel","constructor","args","_defineProperty2","default","type","modelName","isApplicableModel","data","isOfConceptType","_links","concepttype","href","conceptTypeHref","settingNames","Array","isArray","TypeError","pathToKmt","conceptTypeSettings","STEP","getSetting","PERSONA","SYSTEM","SCENARIO","decodedConceptTypeHref","decodeURIComponent","some","settingName","conceptTypeSetting","_endsWith","call","getInitialChildModelLinks","_context","_context2","childModelLinks","scenarioStepLinks","_map","_filter","relationsCollection","all","relation","direction","concept","concepttypeHref","path","asLinkModel","length","push","setChildModels","models","errors","conceptTypeModel","_find","model","ConceptTypeDetailModel","conceptType","scenarioSteps","i","selfhref","_scenarioSteps","actors","forEach","scenarioStep","_context3","relationsToActor","newRelationToActor","actor","key","_default","exports"],"sources":["../../../src/models/concepts/BusinessScenarioModel.js"],"sourcesContent":["// @flow\nimport ConceptDetailModel from \"./ConceptDetailModel\";\nimport ConceptTypeDetailModel from \"./ConceptTypeDetailModel\";\nimport { getSetting } from \"../../constants/Settings\";\n\nimport type { ModularUIResponse } from \"../../modularui\";\nimport type { ModularUIModel } from \"../types\";\nimport type LinkModel from \"../links/LinkModel\";\nimport type ConceptLinkModel from \"./ConceptLinkModel\";\nimport type ErrorResponse from \"../error/ErrorResponse\";\n\n/**\n * @deprecated use the ConceptDetailModel with concept type BusinessScenarios#BusinessScenario\n */\nclass BusinessScenarioModel extends ConceptDetailModel {\n _scenarioSteps: Array<ConceptDetailModel>;\n\n /**\n */\n get type(): string {\n return \"BusinessScenario\";\n }\n\n /**\n */\n static get modelName(): string {\n return \"BusinessScenario\";\n }\n\n /**\n */\n static isApplicableModel(data: ModularUIResponse): boolean {\n return BusinessScenarioModel.isOfConceptType(\n data?.data?._links?.concepttype?.href,\n [\"SCENARIO\"],\n );\n }\n\n /**\n */\n static isOfConceptType(\n conceptTypeHref: ?string,\n settingNames: Array<\"STEP\" | \"PERSONA\" | \"SCENARIO\" | \"SYSTEM\">,\n ): boolean {\n if (!conceptTypeHref) {\n return false;\n }\n\n // Check if settingNames is an array\n if (!Array.isArray(settingNames)) {\n throw new TypeError(\"settingNames must be an array\");\n }\n\n const pathToKmt = \"/Library/KMTs/Business scenarios.bixml\";\n\n const conceptTypeSettings = {\n STEP: getSetting(\"BUSINESS_SCENARIO_STEP_CONCEPT_TYPE\", [\n `${pathToKmt}/ScenarioStep`,\n ]),\n PERSONA: getSetting(\"BUSINESS_SCENARIO_PERSONA_CONCEPT_TYPE\", [\n `${pathToKmt}/Persona`,\n ]),\n SYSTEM: getSetting(\"BUSINESS_SCENARIO_SYSTEM_CONCEPT_TYPE\", [\n `${pathToKmt}/System`,\n ]),\n SCENARIO: getSetting(\"BUSINESS_SCENARIO_CONCEPT_TYPE\", [\n `${pathToKmt}/BusinessScenario`,\n ]),\n };\n\n const decodedConceptTypeHref = decodeURIComponent(conceptTypeHref);\n\n return settingNames.some(\n (settingName) =>\n Array.isArray(conceptTypeSettings[settingName]) &&\n conceptTypeSettings[settingName].some((conceptTypeSetting) =>\n decodedConceptTypeHref.endsWith(conceptTypeSetting),\n ),\n );\n }\n\n /**\n */\n getInitialChildModelLinks(): Array<LinkModel> {\n const childModelLinks = super.getInitialChildModelLinks();\n\n const scenarioStepLinks = this.relationsCollection.all\n .filter(\n (relation) =>\n relation.direction === \"outgoing\" &&\n BusinessScenarioModel.isOfConceptType(\n relation.concept.concepttypeHref?.path,\n [\"STEP\"],\n ),\n )\n .map((relation) => relation.concept.asLinkModel());\n\n if (scenarioStepLinks.length > 0) {\n childModelLinks.push(...scenarioStepLinks);\n }\n\n return childModelLinks;\n }\n\n /**\n */\n setChildModels(models: Array<ModularUIModel>, errors: Array<ErrorResponse>) {\n // $FlowExpectedError[incompatible-type]\n const conceptTypeModel: ?ConceptTypeDetailModel = models.find(\n (model) => model instanceof ConceptTypeDetailModel,\n );\n\n if (conceptTypeModel) {\n this.conceptType = conceptTypeModel;\n }\n\n this.relationsCollection.setChildModels(models, errors);\n\n const scenarioSteps = [];\n for (let i = 0; i < models.length; i++) {\n const model = models[i];\n\n if (\n model instanceof ConceptDetailModel &&\n BusinessScenarioModel.isOfConceptType(\n model.conceptType?.selfhref.path,\n [\"STEP\"],\n )\n ) {\n scenarioSteps.push(model);\n }\n }\n\n this.scenarioSteps = scenarioSteps;\n }\n\n /**\n */\n set scenarioSteps(models: Array<ConceptDetailModel>) {\n this._scenarioSteps = models;\n }\n\n /**\n */\n get scenarioSteps(): Array<ConceptDetailModel> {\n return this._scenarioSteps;\n }\n\n /**\n */\n get actors(): Array<ConceptLinkModel> {\n const actors = [];\n\n this.scenarioSteps.forEach((scenarioStep) => {\n const relationsToActor = scenarioStep.relationsCollection.find(\n (relation) =>\n relation.direction === \"outgoing\" &&\n BusinessScenarioModel.isOfConceptType(\n relation.concept.concepttypeHref?.path,\n [\"PERSONA\", \"SYSTEM\"],\n ),\n );\n\n const newRelationToActor =\n relationsToActor &&\n !actors.some((actor) => actor.key === relationsToActor.concept.key);\n\n if (relationsToActor && newRelationToActor) {\n actors.push(relationsToActor.concept);\n }\n });\n\n return actors;\n }\n}\n\nexport default BusinessScenarioModel;\n"],"mappings":";;;;;;;;;;;;AACA,IAAAA,mBAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,uBAAA,GAAAF,sBAAA,CAAAC,OAAA;AACA,IAAAE,SAAA,GAAAF,OAAA;AAQA;AACA;AACA;AACA,MAAMG,qBAAqB,SAASC,2BAAkB,CAAC;EAAAC,YAAA,GAAAC,IAAA;IAAA,SAAAA,IAAA;IAAA,IAAAC,gBAAA,CAAAC,OAAA;EAAA;EAGrD;AACF;EACE,IAAIC,IAAIA,CAAA,EAAW;IACjB,OAAO,kBAAkB;EAC3B;;EAEA;AACF;EACE,WAAWC,SAASA,CAAA,EAAW;IAC7B,OAAO,kBAAkB;EAC3B;;EAEA;AACF;EACE,OAAOC,iBAAiBA,CAACC,IAAuB,EAAW;IACzD,OAAOT,qBAAqB,CAACU,eAAe,CAC1CD,IAAI,EAAEA,IAAI,EAAEE,MAAM,EAAEC,WAAW,EAAEC,IAAI,EACrC,CAAC,UAAU,CACb,CAAC;EACH;;EAEA;AACF;EACE,OAAOH,eAAeA,CACpBI,eAAwB,EACxBC,YAA+D,EACtD;IACT,IAAI,CAACD,eAAe,EAAE;MACpB,OAAO,KAAK;IACd;;IAEA;IACA,IAAI,CAACE,KAAK,CAACC,OAAO,CAACF,YAAY,CAAC,EAAE;MAChC,MAAM,IAAIG,SAAS,C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AI,CAACG,cAAc;EAC5B;;EAEA;AACF;EACE,IAAIC,MAAMA,CAAA,EAA4B;IACpC,MAAMA,MAAM,GAAG,EAAE;IAEjB,IAAI,CAACJ,aAAa,CAACK,OAAO,CAAEC,YAAY,IAAK;MAAA,IAAAC,SAAA;MAC3C,MAAMC,gBAAgB,GAAG,IAAAZ,KAAA,CAAAjD,OAAA,EAAA4D,SAAA,GAAAD,YAAY,CAACxB,mBAAmB,EAAAR,IAAA,CAAAiC,SAAA,EACtDvB,QAAQ,IACPA,QAAQ,CAACC,SAAS,KAAK,UAAU,IACjC3C,qBAAqB,CAACU,eAAe,CACnCgC,QAAQ,CAACE,OAAO,CAACC,eAAe,EAAEC,IAAI,EACtC,CAAC,SAAS,EAAE,QAAQ,CACtB,CACJ,CAAC;MAED,MAAMqB,kBAAkB,GACtBD,gBAAgB,IAChB,CAACJ,MAAM,CAAClC,IAAI,CAAEwC,KAAK,IAAKA,KAAK,CAACC,GAAG,KAAKH,gBAAgB,CAACtB,OAAO,CAACyB,GAAG,CAAC;MAErE,IAAIH,gBAAgB,IAAIC,kBAAkB,EAAE;QAC1CL,MAAM,CAACb,IAAI,CAACiB,gBAAgB,CAACtB,OAAO,CAAC;MACvC;IACF,CAAC,CAAC;IAEF,OAAOkB,MAAM;EACf;AACF;AAAC,IAAAQ,QAAA,GAAAC,OAAA,CAAAlE,OAAA,GAEcL,qBAAqB","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"file":"types.js","names":[],"sources":["../../../src/redux/_i18n/types.js"],"sourcesContent":["// @flow\nimport type Locales from \"../../i18n/Locales\";\n\nexport type I18nState = {\n +locales: Locales,\n +locale: string,\n};\n\nexport type UpdateLocaleAction = {\n type: \"UPDATE_LOCALE\",\n payload: string,\n};\n\nexport type SetLocalesAction = {\n type: \"SET_LOCALES\",\n payload: {\n locales: Locales,\n locale: string,\n },\n};\n"],"mappings":"","ignoreList":[]}
1
+ {"version":3,"file":"types.js","names":[],"sources":["../../../src/redux/_i18n/types.js"],"sourcesContent":["// @flow\nimport type Locales from \"../../i18n/Locales\";\n\nexport type I18nState = {\n +locales: Locales,\n +locale: string,\n};\n\n/**\n * @deprecated This manual action type will be removed in a future major release.\n * Recommended fixes:\n * - Type component props as a simple callback: e.g. `onDismiss: () => void`.\n * - Use the appropriate hook (useUpdateLocale) to encapsulate this logic.\n * - Reference the action object type for middleware, use ReturnType<typeof actionCreator>.\n */\nexport type UpdateLocaleAction = {\n type: \"UPDATE_LOCALE\",\n payload: string,\n};\n\n/**\n * @deprecated This manual action type will be removed in a future major release.\n * Recommended fixes:\n * - Type component props as a simple callback: e.g. `onDismiss: () => void`.\n * - Use the appropriate hook to encapsulate this logic.\n * - Reference the action object type for middleware, use ReturnType<typeof actionCreator>.\n */\nexport type SetLocalesAction = {\n type: \"SET_LOCALES\",\n payload: {\n locales: Locales,\n locale: string,\n },\n};\n"],"mappings":"","ignoreList":[]}
@@ -254,10 +254,16 @@ const getModelsByType = (state, type) => {
254
254
  /**
255
255
  */
256
256
  exports.getModelsByType = getModelsByType;
257
- const getAllFinishedModels = exports.getAllFinishedModels = (0, _reselect.createSelector)(state => state.modularui, modularui => {
257
+ const getAllFinishedModels = exports.getAllFinishedModels = (0, _reselect.createSelector)([state => state.modularui, state => state.i18n.locale], (modularui, locale) => {
258
258
  if (modularui) {
259
259
  var _context0, _context1;
260
- return (0, _map.default)(_context0 = (0, _filter.default)(_context1 = (0, _keys.default)(modularui)).call(_context1, key => modularui[key] && modularui[key].status === _constants.MODULARUI_STATUS.FINISHED)).call(_context0, key => modularui[key].model);
260
+ return (0, _map.default)(_context0 = (0, _filter.default)(_context1 = (0, _keys.default)(modularui)).call(_context1, key => {
261
+ if (modularui[key]) {
262
+ const item = modularui[key];
263
+ return item.status === _constants.MODULARUI_STATUS.FINISHED && item.model?.locale === locale;
264
+ }
265
+ return false;
266
+ })).call(_context0, key => modularui[key].model);
261
267
  }
262
268
  return [];
263
269
  });
@@ -1 +1 @@
1
- {"version":3,"file":"ModularUISelectors.js","names":["_reselect","require","_objects","_Href","_interopRequireDefault","_ContentModel","_ContentTOCModel","_ApplicationModel","_TabModel","_CaseViewModel","_FormModel","_constants","getAllModelsByInstance","state","instance","locale","i18n","modularui","_context","_context2","_map","default","_filter","_keys","call","key","model","exports","getFirstModelByInstance","_context3","foundKey","_find","entry","isInstance","localeMatches","getActiveModelByInstance","location","getLocation","_context4","_startsWith","selfhref","path","getApplication","ApplicationModel","getTab","TabModel","getCaseView","CaseViewModel","getForm","FormModel","modelByHref","href","_context5","findHref","Href","modelConfigKey","equals","keyByHref","_context6","allKeysByHref","_context7","router","pathname","getModels","models","forEach","modelKey","modelEntry","has","label","type","modelInfo","selfContentLink","ContentModel","ContentTOCModel","push","getActiveModels","createSelectorCreator","defaultMemoize","value","other","_stringify","contextModels","locationParts","split","reduce","accumulator","current","comparePath","decodeURIComponent","replace","foundEntry","encodedHref","toString","getPreference","preferenceName","preferences","getModelsByType","_context8","_context9","getAllFinishedModels","createSelector","_context0","_context1","status","MODULARUI_STATUS","FINISHED"],"sources":["../../../src/redux/_modularui/ModularUISelectors.js"],"sourcesContent":["// @flow\nimport {\n createSelector,\n createSelectorCreator,\n defaultMemoize,\n} from \"reselect\";\nimport { has } from \"../../utils/helpers/objects\";\n\nimport Href from \"../../models/href/Href\";\nimport ContentModel from \"../../models/content/ContentModel\";\nimport ContentTOCModel from \"../../models/content/ContentTOCModel\";\nimport ApplicationModel from \"../../models/application/ApplicationModel\";\nimport TabModel from \"../../models/tab/TabModel\";\nimport CaseViewModel from \"../../models/caseview/CaseViewModel\";\nimport FormModel from \"../../models/form/FormModel\";\n\nimport type { ReduxState, PreferenceValue } from \"../types\";\nimport type { ModularUIModel } from \"../../models/types\";\nimport { MODULARUI_STATUS } from \"../../constants\";\n\n/**\n */\nexport const getAllModelsByInstance = <T>(\n state: ReduxState,\n instance: Class<T>,\n): Array<ModularUIModel> => {\n const locale = state?.i18n?.locale || \"en\";\n const modularui = state?.modularui;\n\n if (modularui) {\n return Object.keys(modularui)\n .filter((key) => {\n const { model } = modularui[key];\n return model instanceof instance && model.locale === locale;\n })\n .map((key) => modularui[key].model);\n }\n\n return [];\n};\n\n/**\n */\nexport const getFirstModelByInstance = <T = ModularUIModel>(\n state: ReduxState,\n instance: Class<T>,\n): T | null => {\n const locale = state?.i18n?.locale || \"en\";\n const modularui = state?.modularui;\n\n if (!modularui) return null;\n\n const foundKey = Object.keys(modularui).find((key) => {\n const entry = modularui[key];\n if (!entry || !entry.model) return false;\n\n const isInstance = entry.model instanceof instance;\n const localeMatches = entry.model.locale === locale;\n\n return isInstance && localeMatches;\n });\n\n // $FlowIssue\n return foundKey ? modularui[foundKey].model : null;\n};\n\n/**\n */\nexport const getActiveModelByInstance = <T>(\n state: ReduxState,\n instance: Class<T>,\n): T | null => {\n const location = getLocation(state);\n\n const locale = state?.i18n?.locale || \"en\";\n const modularui = state?.modularui;\n\n if (modularui) {\n const key = Object.keys(modularui).find((key) => {\n const { model } = modularui[key];\n return (\n model instanceof instance &&\n model.locale === locale &&\n location.startsWith(model.selfhref.path)\n );\n });\n\n if (key) {\n const { model } = modularui[key];\n if (model instanceof instance) {\n return model;\n }\n }\n }\n\n return null;\n};\n\n/**\n * Get the application model, which is the model with selfhref '/'\n */\nexport const getApplication = (state: ReduxState): null | ApplicationModel =>\n getFirstModelByInstance(state, ApplicationModel);\n\n/**\n */\nexport const getTab = (state: ReduxState): null | TabModel =>\n getFirstModelByInstance(state, TabModel);\n\n/**\n */\nexport const getCaseView = (state: ReduxState): null | CaseViewModel =>\n getFirstModelByInstance(state, CaseViewModel);\n\n/**\n */\nexport const getForm = (state: ReduxState): null | FormModel =>\n getFirstModelByInstance(state, FormModel);\n\n/**\n * Get the model by it's href\n */\nexport const modelByHref = (\n state: ReduxState,\n href: Href | string,\n): null | ModularUIModel => {\n if (state && state.modularui) {\n const findHref = href instanceof Href ? href : new Href(href);\n\n const modelConfigKey = Object.keys(state.modularui).find((key) => {\n const model = state.modularui[key];\n\n return (\n model.model &&\n model.model.selfhref &&\n model.model.selfhref.equals(findHref)\n );\n });\n\n if (modelConfigKey) {\n return state.modularui[modelConfigKey].model;\n }\n }\n\n return null;\n};\n\n/**\n * Return the key of a model by the selfhref the model is saved in the reducer\n */\nexport const keyByHref = (state: ReduxState, href: Href | string): ?string => {\n if (state && state.modularui) {\n const findHref = href instanceof Href ? href : new Href(href);\n\n return Object.keys(state.modularui).find((key) => {\n const { model } = state.modularui[key];\n return model && model.selfhref && model.selfhref.equals(findHref);\n });\n }\n\n return null;\n};\n\n/**\n * Returns all model keys found in the store, restrict on href\n */\nexport const allKeysByHref = (\n state: ReduxState,\n href: Href | string,\n): Array<string> => {\n if (state && state.modularui) {\n const findHref = href instanceof Href ? href : new Href(href);\n\n return Object.keys(state.modularui).filter((key) => {\n const { model } = state.modularui[key];\n return model && model.selfhref && model.selfhref.equals(findHref);\n });\n }\n\n return [];\n};\n\n/**\n */\nconst getLocation = (state: ReduxState): string =>\n state?.router?.location.pathname;\n\n/**\n */\nconst getModels = (state: ReduxState) => {\n const models = [];\n\n Object.keys(state.modularui).forEach((modelKey: string) => {\n const modelEntry = state.modularui[modelKey];\n\n if (has(modelEntry, \"model\")) {\n const { key, selfhref, label, type } = modelEntry.model;\n\n const modelInfo = {\n key,\n selfhref,\n label,\n type,\n selfContentLink: null,\n };\n\n if (\n modelEntry.model instanceof ContentModel ||\n modelEntry.model instanceof ContentTOCModel\n ) {\n models.push({\n ...modelInfo,\n selfContentLink: modelEntry.model.selfContentLink,\n });\n } else {\n models.push(modelInfo);\n }\n }\n });\n\n return models;\n};\n\nexport const getActiveModels: (state: ReduxState) => Array<{\n key: string,\n href: Href,\n label: string,\n type: string,\n}> = createSelectorCreator(\n defaultMemoize,\n (value, other) => JSON.stringify(value) === JSON.stringify(other),\n)([getLocation, getModels], (location, models) => {\n const contextModels = [];\n\n if (location) {\n const locationParts = location.split(\"/\");\n\n locationParts.reduce((accumulator, current) => {\n const path = `${accumulator}/${current}`;\n\n // Remove modelcatalog part to match breadcrumb parts\n const comparePath = decodeURIComponent(path).replace(\n \"/modelcatalog/\",\n \"/\",\n );\n\n const foundEntry = models.find(\n (model) => model.selfhref && model.selfhref.equals(comparePath),\n );\n\n if (foundEntry) {\n const { key, label, type, selfhref, selfContentLink } = foundEntry;\n\n const href =\n path.startsWith(\"/modelcatalog/\") && selfContentLink\n ? new Href(`/modelcatalog${selfContentLink.encodedHref.toString()}`)\n : selfhref;\n\n contextModels.push({ key, href, label, type });\n }\n\n return path;\n });\n }\n\n return contextModels;\n});\n\n/**\n */\nexport const getPreference = (\n state: ReduxState,\n preferenceName: string,\n): null | PreferenceValue => {\n if (state && state.preferences) {\n return state.preferences[preferenceName];\n }\n\n return null;\n};\n\n/**\n * @deprecated - Use getFirstModelByInstance or the appropriate getter for the model type: getApplication, getTab, etc\n */\nexport const getModelsByType = (\n state: ReduxState,\n type: string,\n): Array<ModularUIModel> => {\n if (state && state.modularui) {\n return Object.keys(state.modularui)\n .filter(\n (key) =>\n state.modularui[key] &&\n state.modularui[key].model &&\n state.modularui[key].model.type === type,\n )\n .map((key) => state.modularui[key].model);\n }\n\n return [];\n};\n\n/**\n */\nexport const getAllFinishedModels: (\n state: ReduxState,\n) => Array<ModularUIModel> = createSelector(\n (state: ReduxState) => state.modularui,\n (modularui): Array<ModularUIModel> => {\n if (modularui) {\n return Object.keys(modularui)\n .filter(\n (key) =>\n modularui[key] &&\n modularui[key].status === MODULARUI_STATUS.FINISHED,\n )\n .map((key) => modularui[key].model);\n }\n return [];\n },\n);\n"],"mappings":";;;;;;;;;;;;;AACA,IAAAA,SAAA,GAAAC,OAAA;AAKA,IAAAC,QAAA,GAAAD,OAAA;AAEA,IAAAE,KAAA,GAAAC,sBAAA,CAAAH,OAAA;AACA,IAAAI,aAAA,GAAAD,sBAAA,CAAAH,OAAA;AACA,IAAAK,gBAAA,GAAAF,sBAAA,CAAAH,OAAA;AACA,IAAAM,iBAAA,GAAAH,sBAAA,CAAAH,OAAA;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,CAACQ,GAAG,CAAC,CAACC,KAAK,CAAC4C,IAAI,KAAKA,IACxC,CAAC,EAAA9C,IAAA,CAAA0E,SAAA,EACKzE,GAAG,IAAKZ,KAAK,CAACI,SAAS,CAACQ,GAAG,CAAC,CAACC,KAAK,CAAC;EAC7C;EAEA,OAAO,EAAE;AACX,CAAC;;AAED;AACA;AADAC,OAAA,CAAAsE,eAAA,GAAAA,eAAA;AAEO,MAAMG,oBAEa,GAAAzE,OAAA,CAAAyE,oBAAA,GAAG,IAAAC,wBAAc,EACxCxF,KAAiB,IAAKA,KAAK,CAACI,SAAS,EACrCA,SAAS,IAA4B;EACpC,IAAIA,SAAS,EAAE;IAAA,IAAAqF,SAAA,EAAAC,SAAA;IACb,OAAO,IAAAnF,IAAA,CAAAC,OAAA,EAAAiF,SAAA,OAAAhF,OAAA,CAAAD,OAAA,EAAAkF,SAAA,OAAAhF,KAAA,CAAAF,OAAA,EAAYJ,SAAS,CAAC,EAAAO,IAAA,CAAA+E,SAAA,EAExB9E,GAAG,IACFR,SAAS,CAACQ,GAAG,CAAC,IACdR,SAAS,CAACQ,GAAG,CAAC,CAAC+E,MAAM,KAAKC,2BAAgB,CAACC,QAC/C,CAAC,EAAAlF,IAAA,CAAA8E,SAAA,EACK7E,GAAG,IAAKR,SAAS,CAACQ,GAAG,CAAC,CAACC,KAAK,CAAC;EACvC;EACA,OAAO,EAAE;AACX,CACF,CAAC","ignoreList":[]}
1
+ {"version":3,"file":"ModularUISelectors.js","names":["_reselect","require","_objects","_Href","_interopRequireDefault","_ContentModel","_ContentTOCModel","_ApplicationModel","_TabModel","_CaseViewModel","_FormModel","_constants","getAllModelsByInstance","state","instance","locale","i18n","modularui","_context","_context2","_map","default","_filter","_keys","call","key","model","exports","getFirstModelByInstance","_context3","foundKey","_find","entry","isInstance","localeMatches","getActiveModelByInstance","location","getLocation","_context4","_startsWith","selfhref","path","getApplication","ApplicationModel","getTab","TabModel","getCaseView","CaseViewModel","getForm","FormModel","modelByHref","href","_context5","findHref","Href","modelConfigKey","equals","keyByHref","_context6","allKeysByHref","_context7","router","pathname","getModels","models","forEach","modelKey","modelEntry","has","label","type","modelInfo","selfContentLink","ContentModel","ContentTOCModel","push","getActiveModels","createSelectorCreator","defaultMemoize","value","other","_stringify","contextModels","locationParts","split","reduce","accumulator","current","comparePath","decodeURIComponent","replace","foundEntry","encodedHref","toString","getPreference","preferenceName","preferences","getModelsByType","_context8","_context9","getAllFinishedModels","createSelector","_context0","_context1","item","status","MODULARUI_STATUS","FINISHED"],"sources":["../../../src/redux/_modularui/ModularUISelectors.js"],"sourcesContent":["// @flow\nimport {\n createSelector,\n createSelectorCreator,\n defaultMemoize,\n} from \"reselect\";\nimport { has } from \"../../utils/helpers/objects\";\n\nimport Href from \"../../models/href/Href\";\nimport ContentModel from \"../../models/content/ContentModel\";\nimport ContentTOCModel from \"../../models/content/ContentTOCModel\";\nimport ApplicationModel from \"../../models/application/ApplicationModel\";\nimport TabModel from \"../../models/tab/TabModel\";\nimport CaseViewModel from \"../../models/caseview/CaseViewModel\";\nimport FormModel from \"../../models/form/FormModel\";\n\nimport type { ReduxState, PreferenceValue } from \"../types\";\nimport type { ModularUIModel } from \"../../models/types\";\nimport { MODULARUI_STATUS } from \"../../constants\";\n\n/**\n */\nexport const getAllModelsByInstance = <T>(\n state: ReduxState,\n instance: Class<T>,\n): Array<ModularUIModel> => {\n const locale = state?.i18n?.locale || \"en\";\n const modularui = state?.modularui;\n\n if (modularui) {\n return Object.keys(modularui)\n .filter((key) => {\n const { model } = modularui[key];\n return model instanceof instance && model.locale === locale;\n })\n .map((key) => modularui[key].model);\n }\n\n return [];\n};\n\n/**\n */\nexport const getFirstModelByInstance = <T = ModularUIModel>(\n state: ReduxState,\n instance: Class<T>,\n): T | null => {\n const locale = state?.i18n?.locale || \"en\";\n const modularui = state?.modularui;\n\n if (!modularui) return null;\n\n const foundKey = Object.keys(modularui).find((key) => {\n const entry = modularui[key];\n if (!entry || !entry.model) return false;\n\n const isInstance = entry.model instanceof instance;\n const localeMatches = entry.model.locale === locale;\n\n return isInstance && localeMatches;\n });\n\n // $FlowIssue\n return foundKey ? modularui[foundKey].model : null;\n};\n\n/**\n */\nexport const getActiveModelByInstance = <T>(\n state: ReduxState,\n instance: Class<T>,\n): T | null => {\n const location = getLocation(state);\n\n const locale = state?.i18n?.locale || \"en\";\n const modularui = state?.modularui;\n\n if (modularui) {\n const key = Object.keys(modularui).find((key) => {\n const { model } = modularui[key];\n return (\n model instanceof instance &&\n model.locale === locale &&\n location.startsWith(model.selfhref.path)\n );\n });\n\n if (key) {\n const { model } = modularui[key];\n if (model instanceof instance) {\n return model;\n }\n }\n }\n\n return null;\n};\n\n/**\n * Get the application model, which is the model with selfhref '/'\n */\nexport const getApplication = (state: ReduxState): null | ApplicationModel =>\n getFirstModelByInstance(state, ApplicationModel);\n\n/**\n */\nexport const getTab = (state: ReduxState): null | TabModel =>\n getFirstModelByInstance(state, TabModel);\n\n/**\n */\nexport const getCaseView = (state: ReduxState): null | CaseViewModel =>\n getFirstModelByInstance(state, CaseViewModel);\n\n/**\n */\nexport const getForm = (state: ReduxState): null | FormModel =>\n getFirstModelByInstance(state, FormModel);\n\n/**\n * Get the model by it's href\n */\nexport const modelByHref = (\n state: ReduxState,\n href: Href | string,\n): null | ModularUIModel => {\n if (state && state.modularui) {\n const findHref = href instanceof Href ? href : new Href(href);\n\n const modelConfigKey = Object.keys(state.modularui).find((key) => {\n const model = state.modularui[key];\n\n return (\n model.model &&\n model.model.selfhref &&\n model.model.selfhref.equals(findHref)\n );\n });\n\n if (modelConfigKey) {\n return state.modularui[modelConfigKey].model;\n }\n }\n\n return null;\n};\n\n/**\n * Return the key of a model by the selfhref the model is saved in the reducer\n */\nexport const keyByHref = (state: ReduxState, href: Href | string): ?string => {\n if (state && state.modularui) {\n const findHref = href instanceof Href ? href : new Href(href);\n\n return Object.keys(state.modularui).find((key) => {\n const { model } = state.modularui[key];\n return model && model.selfhref && model.selfhref.equals(findHref);\n });\n }\n\n return null;\n};\n\n/**\n * Returns all model keys found in the store, restrict on href\n */\nexport const allKeysByHref = (\n state: ReduxState,\n href: Href | string,\n): Array<string> => {\n if (state && state.modularui) {\n const findHref = href instanceof Href ? href : new Href(href);\n\n return Object.keys(state.modularui).filter((key) => {\n const { model } = state.modularui[key];\n return model && model.selfhref && model.selfhref.equals(findHref);\n });\n }\n\n return [];\n};\n\n/**\n */\nconst getLocation = (state: ReduxState): string =>\n state?.router?.location.pathname;\n\n/**\n */\nconst getModels = (state: ReduxState) => {\n const models = [];\n\n Object.keys(state.modularui).forEach((modelKey: string) => {\n const modelEntry = state.modularui[modelKey];\n\n if (has(modelEntry, \"model\")) {\n const { key, selfhref, label, type } = modelEntry.model;\n\n const modelInfo = {\n key,\n selfhref,\n label,\n type,\n selfContentLink: null,\n };\n\n if (\n modelEntry.model instanceof ContentModel ||\n modelEntry.model instanceof ContentTOCModel\n ) {\n models.push({\n ...modelInfo,\n selfContentLink: modelEntry.model.selfContentLink,\n });\n } else {\n models.push(modelInfo);\n }\n }\n });\n\n return models;\n};\n\nexport const getActiveModels: (state: ReduxState) => Array<{\n key: string,\n href: Href,\n label: string,\n type: string,\n}> = createSelectorCreator(\n defaultMemoize,\n (value, other) => JSON.stringify(value) === JSON.stringify(other),\n)([getLocation, getModels], (location, models) => {\n const contextModels = [];\n\n if (location) {\n const locationParts = location.split(\"/\");\n\n locationParts.reduce((accumulator, current) => {\n const path = `${accumulator}/${current}`;\n\n // Remove modelcatalog part to match breadcrumb parts\n const comparePath = decodeURIComponent(path).replace(\n \"/modelcatalog/\",\n \"/\",\n );\n\n const foundEntry = models.find(\n (model) => model.selfhref && model.selfhref.equals(comparePath),\n );\n\n if (foundEntry) {\n const { key, label, type, selfhref, selfContentLink } = foundEntry;\n\n const href =\n path.startsWith(\"/modelcatalog/\") && selfContentLink\n ? new Href(`/modelcatalog${selfContentLink.encodedHref.toString()}`)\n : selfhref;\n\n contextModels.push({ key, href, label, type });\n }\n\n return path;\n });\n }\n\n return contextModels;\n});\n\n/**\n */\nexport const getPreference = (\n state: ReduxState,\n preferenceName: string,\n): null | PreferenceValue => {\n if (state && state.preferences) {\n return state.preferences[preferenceName];\n }\n\n return null;\n};\n\n/**\n * @deprecated - Use getFirstModelByInstance or the appropriate getter for the model type: getApplication, getTab, etc\n */\nexport const getModelsByType = (\n state: ReduxState,\n type: string,\n): Array<ModularUIModel> => {\n if (state && state.modularui) {\n return Object.keys(state.modularui)\n .filter(\n (key) =>\n state.modularui[key] &&\n state.modularui[key].model &&\n state.modularui[key].model.type === type,\n )\n .map((key) => state.modularui[key].model);\n }\n\n return [];\n};\n\n/**\n */\nexport const getAllFinishedModels: (\n state: ReduxState,\n) => Array<ModularUIModel> = createSelector(\n [(state) => state.modularui, (state) => state.i18n.locale],\n (modularui, locale): Array<ModularUIModel> => {\n if (modularui) {\n return Object.keys(modularui)\n .filter((key) => {\n if (modularui[key]) {\n const item = modularui[key];\n return (\n item.status === MODULARUI_STATUS.FINISHED &&\n item.model?.locale === locale\n );\n }\n return false;\n })\n .map((key) => modularui[key].model);\n }\n return [];\n },\n);\n"],"mappings":";;;;;;;;;;;;;AACA,IAAAA,SAAA,GAAAC,OAAA;AAKA,IAAAC,QAAA,GAAAD,OAAA;AAEA,IAAAE,KAAA,GAAAC,sBAAA,CAAAH,OAAA;AACA,IAAAI,aAAA,GAAAD,sBAAA,CAAAH,OAAA;AACA,IAAAK,gBAAA,GAAAF,sBAAA,CAAAH,OAAA;AACA,IAAAM,iBAAA,GAAAH,sBAAA,CAAAH,OAAA;AACA,IAAAO,SAAA,GAAAJ,sBAAA,CAAAH,OAAA;AACA,IAAAQ,cAAA,GAAAL,sBAAA,CAAAH,OAAA;AACA,IAAAS,UAAA,GAAAN,sBAAA,CAAAH,OAAA;AAIA,IAAAU,UAAA,GAAAV,OAAA;AAEA;AACA;AACO,MAAMW,sBAAsB,GAAGA,CACpCC,KAAiB,EACjBC,QAAkB,KACQ;EAC1B,MAAMC,MAAM,GA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MG,oBAEa,GAAAzE,OAAA,CAAAyE,oBAAA,GAAG,IAAAC,wBAAc,EACzC,CAAExF,KAAK,IAAKA,KAAK,CAACI,SAAS,EAAGJ,KAAK,IAAKA,KAAK,CAACG,IAAI,CAACD,MAAM,CAAC,EAC1D,CAACE,SAAS,EAAEF,MAAM,KAA4B;EAC5C,IAAIE,SAAS,EAAE;IAAA,IAAAqF,SAAA,EAAAC,SAAA;IACb,OAAO,IAAAnF,IAAA,CAAAC,OAAA,EAAAiF,SAAA,OAAAhF,OAAA,CAAAD,OAAA,EAAAkF,SAAA,OAAAhF,KAAA,CAAAF,OAAA,EAAYJ,SAAS,CAAC,EAAAO,IAAA,CAAA+E,SAAA,EAClB9E,GAAG,IAAK;MACf,IAAIR,SAAS,CAACQ,GAAG,CAAC,EAAE;QAClB,MAAM+E,IAAI,GAAGvF,SAAS,CAACQ,GAAG,CAAC;QAC3B,OACE+E,IAAI,CAACC,MAAM,KAAKC,2BAAgB,CAACC,QAAQ,IACzCH,IAAI,CAAC9E,KAAK,EAAEX,MAAM,KAAKA,MAAM;MAEjC;MACA,OAAO,KAAK;IACd,CAAC,CAAC,EAAAS,IAAA,CAAA8E,SAAA,EACI7E,GAAG,IAAKR,SAAS,CAACQ,GAAG,CAAC,CAACC,KAAK,CAAC;EACvC;EACA,OAAO,EAAE;AACX,CACF,CAAC","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"file":"types.js","names":[],"sources":["../../../src/redux/_modularui/types.js"],"sourcesContent":["// @flow\nimport type { ModularUIModel } from \"../../models/types\";\nimport type Href from \"../../models/href/Href\";\nimport type { FetchException } from \"../../exceptions\";\nimport type { NoAction } from \"../types\";\nimport typeof {\n HTTP_METHODS,\n MODULARUI_STATUS,\n} from \"../../constants/Constants\";\nimport type { ComponentType } from \"react\";\nimport type { TargetModel } from \"../../modularui/types\";\nimport type { RequestModularUIOptions } from \"../../utils/fetch/types\";\n\nexport type ModularUIOptions = {\n propName?: string,\n removeOnUnmount?: boolean,\n ...RequestModularUIOptions,\n};\n\nexport type ModelEntry = {\n +status: string,\n +model: ModularUIModel,\n +lastModification: number,\n +requestOptions?: any,\n};\n\nexport type ModularUIState = {\n [string]: ModelEntry,\n ...\n};\n\nexport type SetModelAction = {\n type: \"MODULARUI/SET\",\n payload: {\n key: string,\n model: ?ModularUIModel,\n },\n};\n\nexport type InitModelAction = {\n type: \"MODULARUI/INIT\",\n payload: Array<{\n key: string,\n model: ModularUIModel,\n }>,\n};\n\nexport type UpdateModelAction = {\n type: \"MODULARUI/UPDATE\",\n payload: ModularUIModel,\n};\n\nexport type UpdateFormAction = {\n type: \"MODULARUI/UPDATE_FORM\",\n payload: ModularUIModel,\n};\n\nexport type SuccessAction = (\n model: ModularUIModel,\n) => UpdateModelAction | SetModelAction;\n\nexport type ErrorAction = (\n error: FetchException,\n) => UpdateStatusAction | RemoveModelByKeyAction | NoAction;\n\nexport type ModularUIAction = {\n type: \"MODULARUI/FETCH\",\n payload: {\n key: string,\n origin?: string,\n contextPath?: string,\n href: Href,\n method?: $Keys<HTTP_METHODS>,\n params?: string,\n data?: any,\n timeout?: number,\n headers?: {\n [headerName: string]: string,\n Accept?: string,\n \"Accept-Language\"?: string,\n \"Content-Type\"?: string,\n \"x-filename\"?: string,\n \"x-filesize\"?: string,\n },\n events?: { [eventName: string]: () => void },\n onProgress?: ProgressEventHandler,\n locale: string,\n childmodels?: boolean,\n targetModel?: TargetModel,\n forceTargetModel?: boolean,\n cache?: boolean,\n isReload?: boolean,\n withCredentials?: boolean,\n successAction: (\n model: ModularUIModel,\n ) => UpdateModelAction | SetModelAction,\n errorAction?: ErrorAction,\n },\n};\n\nexport type RemoveModelByKeyAction = {\n type: \"MODULARUI/REMOVE_KEY\",\n payload: string,\n};\n\nexport type ResetModularUIAction = {\n type: \"MODULARUI/RESET\",\n};\n\nexport type UpdateStatusAction = {\n type: \"MODULARUI/STATUS\",\n payload: {\n key: string,\n status: $Keys<MODULARUI_STATUS>,\n requestOptions: any,\n },\n};\n\nexport type ModularUIConnector = (\n Component: ComponentType<any>,\n) => ComponentType<any>;\n"],"mappings":"","ignoreList":[]}
1
+ {"version":3,"file":"types.js","names":[],"sources":["../../../src/redux/_modularui/types.js"],"sourcesContent":["// @flow\nimport type { ModularUIModel } from \"../../models/types\";\nimport type Href from \"../../models/href/Href\";\nimport type { FetchException } from \"../../exceptions\";\nimport type { NoAction } from \"../types\";\nimport typeof {\n HTTP_METHODS,\n MODULARUI_STATUS,\n} from \"../../constants/Constants\";\nimport type { ComponentType } from \"react\";\nimport type { TargetModel } from \"../../modularui/types\";\nimport type { RequestModularUIOptions } from \"../../utils/fetch/types\";\n\nexport type ModularUIOptions = {\n propName?: string,\n removeOnUnmount?: boolean,\n ...RequestModularUIOptions,\n};\n\nexport type ModelEntry = {\n +status: string,\n +model: ModularUIModel,\n +lastModification: number,\n +requestOptions?: any,\n};\n\nexport type ModularUIState = {\n [string]: ModelEntry,\n ...\n};\n\n/**\n * @deprecated This manual action type will be removed in a future major release.\n * Recommended fixes:\n * - Type component props as a simple callback: e.g. `onDismiss: () => void`.\n * - Use the appropriate hook to encapsulate this logic.\n * - Reference the action object type for middleware, use ReturnType<typeof actionCreator>.\n */\nexport type SetModelAction = {\n type: \"MODULARUI/SET\",\n payload: {\n key: string,\n model: ?ModularUIModel,\n },\n};\n\n/**\n * @deprecated This manual action type will be removed in a future major release.\n * Recommended fixes:\n * - Type component props as a simple callback: e.g. `onDismiss: () => void`.\n * - Use the appropriate hook to encapsulate this logic.\n * - Reference the action object type for middleware, use ReturnType<typeof actionCreator>.\n */\nexport type InitModelAction = {\n type: \"MODULARUI/INIT\",\n payload: Array<{\n key: string,\n model: ModularUIModel,\n }>,\n};\n\n/**\n * @deprecated This manual action type will be removed in a future major release.\n * Recommended fixes:\n * - Type component props as a simple callback: e.g. `onDismiss: () => void`.\n * - Use the appropriate hook to encapsulate this logic.\n * - Reference the action object type for middleware, use ReturnType<typeof actionCreator>.\n */\nexport type UpdateModelAction = {\n type: \"MODULARUI/UPDATE\",\n payload: ModularUIModel,\n};\n\n/**\n * @deprecated This manual action type will be removed in a future major release.\n * Recommended fixes:\n * - Type component props as a simple callback: e.g. `onDismiss: () => void`.\n * - Use the appropriate hook to encapsulate this logic.\n * - Reference the action object type for middleware, use ReturnType<typeof actionCreator>.\n */\nexport type UpdateFormAction = {\n type: \"MODULARUI/UPDATE_FORM\",\n payload: ModularUIModel,\n};\n\n/**\n * @deprecated This manual action type will be removed in a future major release.\n * Recommended fixes:\n * - Type component props as a simple callback: e.g. `onDismiss: () => void`.\n * - Use the appropriate hook to encapsulate this logic.\n * - Reference the action object type for middleware, use ReturnType<typeof actionCreator>.\n */\nexport type SuccessAction = (\n model: ModularUIModel,\n) => UpdateModelAction | SetModelAction;\n\nexport type ErrorAction = (\n error: FetchException,\n) => UpdateStatusAction | RemoveModelByKeyAction | NoAction;\n\n/**\n * @deprecated This manual action type will be removed in a future major release.\n * Recommended fixes:\n * - Type component props as a simple callback: e.g. `onDismiss: () => void`.\n * - Use the appropriate hook to encapsulate this logic.\n * - Reference the action object type for middleware, use ReturnType<typeof actionCreator>.\n */\nexport type ModularUIAction = {\n type: \"MODULARUI/FETCH\",\n payload: {\n key: string,\n origin?: string,\n contextPath?: string,\n href: Href,\n method?: $Keys<HTTP_METHODS>,\n params?: string,\n data?: any,\n timeout?: number,\n headers?: {\n [headerName: string]: string,\n Accept?: string,\n \"Accept-Language\"?: string,\n \"Content-Type\"?: string,\n \"x-filename\"?: string,\n \"x-filesize\"?: string,\n },\n events?: { [eventName: string]: () => void },\n onProgress?: ProgressEventHandler,\n locale: string,\n childmodels?: boolean,\n targetModel?: TargetModel,\n forceTargetModel?: boolean,\n cache?: boolean,\n isReload?: boolean,\n withCredentials?: boolean,\n successAction: (\n model: ModularUIModel,\n ) => UpdateModelAction | SetModelAction,\n errorAction?: ErrorAction,\n },\n};\n\n/**\n * @deprecated This manual action type will be removed in a future major release.\n * Recommended fixes:\n * - Type component props as a simple callback: e.g. `onDismiss: () => void`.\n * - Use the appropriate hook to encapsulate this logic.\n * - Reference the action object type for middleware, use ReturnType<typeof actionCreator>.\n */\nexport type RemoveModelByKeyAction = {\n type: \"MODULARUI/REMOVE_KEY\",\n payload: string,\n};\n\n/**\n * @deprecated This manual action type will be removed in a future major release.\n * Recommended fixes:\n * - Type component props as a simple callback: e.g. `onDismiss: () => void`.\n * - Use the appropriate hook to encapsulate this logic.\n * - Reference the action object type for middleware, use ReturnType<typeof actionCreator>.\n */\nexport type ResetModularUIAction = {\n type: \"MODULARUI/RESET\",\n};\n\n/**\n * @deprecated This manual action type will be removed in a future major release.\n * Recommended fixes:\n * - Type component props as a simple callback: e.g. `onDismiss: () => void`.\n * - Use the appropriate hook to encapsulate this logic.\n * - Reference the action object type for middleware, use ReturnType<typeof actionCreator>.\n */\nexport type UpdateStatusAction = {\n type: \"MODULARUI/STATUS\",\n payload: {\n key: string,\n status: $Keys<MODULARUI_STATUS>,\n requestOptions: any,\n },\n};\n\nexport type ModularUIConnector = (\n Component: ComponentType<any>,\n) => ComponentType<any>;\n"],"mappings":"","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"file":"types.js","names":[],"sources":["../../../src/redux/_router/types.js"],"sourcesContent":["// @flow\nimport type { HistoryAction, Location, LocationShape } from \"react-router\";\n\nexport type RouterState = {\n +location: Location,\n +action: HistoryAction,\n};\n\nexport type LocationChangeAction = {\n type: \"ROUTER/LOCATION_CHANGE\",\n payload: {\n location: Location,\n action: HistoryAction,\n },\n};\n\nexport type PushAction = {\n type: \"ROUTER/PUSH\",\n payload: {\n location: string | LocationShape,\n state?: { ... },\n },\n};\nexport type ReplaceAction = {\n type: \"ROUTER/REPLACE\",\n payload: {\n location: string | LocationShape,\n state?: { ... },\n },\n};\nexport type GoAction = {\n type: \"ROUTER/GO\",\n payload: {\n delta: number,\n },\n};\nexport type GoBackAction = {\n type: \"ROUTER/GOBACK\",\n};\n\nexport type GoForwardAction = {\n type: \"ROUTER/GOFORWARD\",\n};\n"],"mappings":"","ignoreList":[]}
1
+ {"version":3,"file":"types.js","names":[],"sources":["../../../src/redux/_router/types.js"],"sourcesContent":["// @flow\nimport type { HistoryAction, Location, LocationShape } from \"react-router\";\n\nexport type RouterState = {\n +location: Location,\n +action: HistoryAction,\n};\n\n/**\n * @deprecated This manual action type will be removed in a future major release.\n * Recommended fixes:\n * - Type component props as a simple callback: e.g. `onDismiss: () => void`.\n * - Use the appropriate hook to encapsulate this logic.\n * - Reference the action object type for middleware, use ReturnType<typeof actionCreator>.\n */\nexport type LocationChangeAction = {\n type: \"ROUTER/LOCATION_CHANGE\",\n payload: {\n location: Location,\n action: HistoryAction,\n },\n};\n\n/**\n * @deprecated This manual action type will be removed in a future major release.\n * Recommended fixes:\n * - Type component props as a simple callback: e.g. `onDismiss: () => void`.\n * - Use the appropriate hook to encapsulate this logic.\n * - Reference the action object type for middleware, use ReturnType<typeof actionCreator>.\n */\nexport type PushAction = {\n type: \"ROUTER/PUSH\",\n payload: {\n location: string | LocationShape,\n state?: { ... },\n },\n};\n\n/**\n * @deprecated This manual action type will be removed in a future major release.\n * Recommended fixes:\n * - Type component props as a simple callback: e.g. `onDismiss: () => void`.\n * - Use the appropriate hook to encapsulate this logic.\n * - Reference the action object type for middleware, use ReturnType<typeof actionCreator>.\n */\nexport type ReplaceAction = {\n type: \"ROUTER/REPLACE\",\n payload: {\n location: string | LocationShape,\n state?: { ... },\n },\n};\n\n/**\n * @deprecated This manual action type will be removed in a future major release.\n * Recommended fixes:\n * - Type component props as a simple callback: e.g. `onDismiss: () => void`.\n * - Use the appropriate hook to encapsulate this logic.\n * - Reference the action object type for middleware, use ReturnType<typeof actionCreator>.\n */\nexport type GoAction = {\n type: \"ROUTER/GO\",\n payload: {\n delta: number,\n },\n};\n\n/**\n * @deprecated This manual action type will be removed in a future major release.\n * Recommended fixes:\n * - Type component props as a simple callback: e.g. `onDismiss: () => void`.\n * - Use the appropriate hook to encapsulate this logic.\n * - Reference the action object type for middleware, use ReturnType<typeof actionCreator>.\n */\nexport type GoBackAction = {\n type: \"ROUTER/GOBACK\",\n};\n\n/**\n * @deprecated This manual action type will be removed in a future major release.\n * Recommended fixes:\n * - Type component props as a simple callback: e.g. `onDismiss: () => void`.\n * - Use the appropriate hook to encapsulate this logic.\n * - Reference the action object type for middleware, use ReturnType<typeof actionCreator>.\n */\nexport type GoForwardAction = {\n type: \"ROUTER/GOFORWARD\",\n};\n"],"mappings":"","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"file":"types.js","names":[],"sources":["../../src/redux/types.js"],"sourcesContent":["// @flow\nimport type { Store } from \"redux\";\n\nimport type ErrorResponse from \"../models/error/ErrorResponse\";\n\nimport type FormModel from \"../models/form/FormModel\";\nimport typeof {\n NOTIFICATION_TYPES,\n AUTOSAVE_STATUS,\n} from \"../constants/Constants\";\n\nimport type { MessageObject } from \"../i18n/types\";\nimport type {\n I18nState,\n UpdateLocaleAction,\n SetLocalesAction,\n} from \"./_i18n/types\";\nimport type {\n ModularUIState,\n ModularUIAction,\n UpdateStatusAction,\n SetModelAction,\n UpdateModelAction,\n UpdateFormAction,\n RemoveModelByKeyAction,\n ResetModularUIAction,\n InitModelAction,\n} from \"./_modularui/types\";\nimport type {\n RouterState,\n LocationChangeAction,\n PushAction,\n ReplaceAction,\n GoAction,\n GoBackAction,\n GoForwardAction,\n} from \"./_router/types\";\n\nexport type PreferenceValue =\n | null\n | string\n | boolean\n | { [key: string]: any }\n | Array<PreferenceValue>;\n\nexport type UpdateFormOptions = {\n autosubmit: boolean,\n autosave: boolean,\n autoupdate: boolean,\n forceUpdate?: boolean,\n /** Default true: Activate/deactivate the form object validate by an update */\n validate?: boolean,\n};\n\nexport type NoAction = {\n type: \"NO_ACTION\",\n};\n\nexport type SaveErrorAction = {\n type: \"SAVE_ERROR\",\n payload: ErrorResponse,\n};\n\nexport type ShowModalAction = {\n type: \"SHOW_MODAL\",\n payload: string,\n};\n\nexport type CloseModalAction = {\n type: \"CLOSE_MODAL\",\n payload: string,\n};\n\nexport type DismissNotificationAction = {\n type: \"DISMISS_NOTIFICATION\",\n};\nexport type ShowNotificationAction = {\n type: \"SHOW_NOTIFICATION\",\n payload: {\n type: $Keys<NOTIFICATION_TYPES>,\n message: MessageObject,\n error: ?ErrorResponse,\n },\n};\n\nexport type SetPreferenceAction = {\n type: \"SET_PREFERENCE\",\n payload: { [name: string]: PreferenceValue },\n};\nexport type SetPreferencesAction = {\n type: \"SET_PREFERENCES\",\n payload: { [name: string]: PreferenceValue },\n};\n\nexport type StartProgressAction = {\n type: \"START_PROGRESS\",\n};\nexport type FinishProgressAction = {\n type: \"FINISH_PROGRESS\",\n};\nexport type ResetProgressAction = {\n type: \"RESET_PROGRESS\",\n};\nexport type UpdateProgressAction = {\n type: \"UPDATE_PROGRESS\",\n payload: { percentComplete: number },\n};\n\nexport type SendAuthenticationErrorAction = {\n type: \"AUTHENTICATION_ERROR\",\n payload: string,\n};\n\nexport type ResetAuthErrorsAction = {\n type: \"AUTHENTICATION_RESET_ERRORS\",\n};\n\nexport type LoginSuccessAction = {\n type: \"AUTHENTICATION_SUCCESS\",\n};\n\nexport type ChangePasswordAction = {\n type: \"CHANGE_PASSWORD\",\n};\n\nexport type LogoutSuccessAction = {\n type: \"AUTHENTICATION_LOGOUT\",\n};\n\nexport type UpdateAutosaveAction = {\n type: \"UPDATE_AUTOSAVE_STATUS\",\n payload: {\n status: $Keys<AUTOSAVE_STATUS>,\n model: FormModel,\n },\n};\n\nexport type UpdateEntryDateAction = {\n type: \"UPDATE_ENTRYDATE\",\n payload: ISO_DATE,\n};\n\nexport type ReduxAction =\n | UpdateStatusAction\n | SetModelAction\n | InitModelAction\n | UpdateModelAction\n | UpdateFormAction\n | RemoveModelByKeyAction\n | ResetModularUIAction\n | SaveErrorAction\n | UpdateLocaleAction\n | SetLocalesAction\n | ShowModalAction\n | CloseModalAction\n | DismissNotificationAction\n | ShowNotificationAction\n | SetPreferenceAction\n | SetPreferencesAction\n | StartProgressAction\n | FinishProgressAction\n | ResetProgressAction\n | UpdateProgressAction\n | ResetAuthErrorsAction\n | SendAuthenticationErrorAction\n | LoginSuccessAction\n | ChangePasswordAction\n | LogoutSuccessAction\n | UpdateAutosaveAction\n | UpdateEntryDateAction\n | LocationChangeAction\n | PushAction\n | ReplaceAction\n | GoAction\n | GoBackAction\n | GoForwardAction\n | ModularUIAction\n | NoAction;\n\n// Redux state\nexport type AuthState = {\n +mustChangePassword: boolean,\n +error: ?string,\n};\n\nexport type ErrorState = null | ErrorResponse;\n\nexport type ModalState = {\n +key: string,\n +visible: boolean,\n +size?: string,\n};\n\nexport type ModalsState = {\n +modals: Array<ModalState>,\n};\n\nexport type NotificationState = {\n +render: boolean,\n +messageType: string | null,\n +message: MessageObject | null,\n +error: ?ErrorResponse | null,\n};\n\nexport type PreferencesState = {\n +[name: string]: PreferenceValue,\n};\n\nexport type ProgressIndicatorState = {\n +count: number,\n +timestamp: number,\n +percentComplete: number,\n};\n\nexport type ModelCatalogState = {\n entryDate: ISO_DATE | null,\n};\n\nexport type ReduxState = {\n +router: RouterState,\n +modularui: ModularUIState,\n +i18n: I18nState,\n +auth: AuthState,\n +modelcatalog: ModelCatalogState,\n +error: ErrorState,\n +modals: ModalsState,\n +notification: NotificationState,\n +progressindicator: ProgressIndicatorState,\n +preferences: PreferencesState,\n ...\n};\n\nexport type GetState = () => ReduxState;\n\n/**\n * A function that accepts a listener callback and returns an unsubscribe function.\n */\nexport type Subscribe = (listener: () => void) => () => void;\n\nexport type ThunkExtra = {\n subscribe: Subscribe,\n ...\n};\n\n// 1. Define ThunkAction first.\n// We use 'any' for Dispatch here temporarily to break the circularity\n// or use the specialized function type.\nexport type ThunkAction<R = any> = (\n dispatch: Dispatch,\n getState: GetState,\n extra: ThunkExtra,\n) => R;\n\nexport type PromiseAction = Promise<ReduxAction | ThunkAction<any>>;\n\n// 2. Define Dispatch as a naked function type.\n// This is much more reliable in modern Flow than DispatchAPI<...>.\nexport type Dispatch = (\n action: ReduxAction | ThunkAction<any> | PromiseAction,\n) => any;\n\n// 3. Update ReduxStore to use the ReduxAction for the base reducer\n// but our custom Dispatch for the store instance.\nexport type ReduxStore = Store<ReduxState, ReduxAction, Dispatch>;\n\n// 4. Clean up PossibleAction if you still use it elsewhere\nexport type PossibleAction = ReduxAction | ThunkAction<any> | PromiseAction;\n\nexport type CustomReducers = { [reducerKey: string]: any };\n"],"mappings":"","ignoreList":[]}
1
+ {"version":3,"file":"types.js","names":[],"sources":["../../src/redux/types.js"],"sourcesContent":["// @flow\nimport type { Store } from \"redux\";\n\nimport type ErrorResponse from \"../models/error/ErrorResponse\";\n\nimport type FormModel from \"../models/form/FormModel\";\nimport typeof {\n NOTIFICATION_TYPES,\n AUTOSAVE_STATUS,\n} from \"../constants/Constants\";\n\nimport type { MessageObject } from \"../i18n/types\";\nimport type {\n I18nState,\n UpdateLocaleAction,\n SetLocalesAction,\n} from \"./_i18n/types\";\nimport type {\n ModularUIState,\n ModularUIAction,\n UpdateStatusAction,\n SetModelAction,\n UpdateModelAction,\n UpdateFormAction,\n RemoveModelByKeyAction,\n ResetModularUIAction,\n InitModelAction,\n} from \"./_modularui/types\";\nimport type {\n RouterState,\n LocationChangeAction,\n PushAction,\n ReplaceAction,\n GoAction,\n GoBackAction,\n GoForwardAction,\n} from \"./_router/types\";\n\nexport type PreferenceValue =\n | null\n | string\n | boolean\n | { [key: string]: any }\n | Array<PreferenceValue>;\n\nexport type UpdateFormOptions = {\n autosubmit: boolean,\n autosave: boolean,\n autoupdate: boolean,\n forceUpdate?: boolean,\n /** Default true: Activate/deactivate the form object validate by an update */\n validate?: boolean,\n};\n\n/**\n * @deprecated This manual action type will be removed in a future major release.\n */\nexport type NoAction = {\n type: \"NO_ACTION\",\n};\n\n/**\n * @deprecated This manual action type will be removed in a future major release.\n * Recommended fixes:\n * - Type component props as a simple callback: e.g. `onDismiss: () => void`.\n * - Use the appropriate hook (useErrorHandler) to encapsulate this logic.\n * - Reference the action object type for middleware, use ReturnType<typeof actionCreator>.\n */\nexport type SaveErrorAction = {\n type: \"SAVE_ERROR\",\n payload: ErrorResponse,\n};\n\n/**\n * @deprecated This manual action type will be removed in a future major release.\n * Recommended fixes:\n * - Type component props as a simple callback: e.g. `onDismiss: () => void`.\n * - Use the appropriate hook (useModal) to encapsulate this logic.\n * - Reference the action object type for middleware, use ReturnType<typeof actionCreator>.\n */\nexport type ShowModalAction = {\n type: \"SHOW_MODAL\",\n payload: string,\n};\n\n/**\n * @deprecated This manual action type will be removed in a future major release.\n * Recommended fixes:\n * - Type component props as a simple callback: e.g. `onDismiss: () => void`.\n * - Use the appropriate hook (useModal) to encapsulate this logic.\n * - Reference the action object type for middleware, use ReturnType<typeof actionCreator>.\n */\nexport type CloseModalAction = {\n type: \"CLOSE_MODAL\",\n payload: string,\n};\n\n/**\n * @deprecated This manual action type will be removed in a future major release.\n * Recommended fixes:\n * - Type component props as a simple callback: e.g. onDismiss: () => void`.\n * - Use the appropriate hook (useNotification) to encapsulate this logic.\n * - Reference the action object type for middleware, use ReturnType<typeof actionCreator>.\n */\nexport type DismissNotificationAction = {\n type: \"DISMISS_NOTIFICATION\",\n};\n/**\n * @deprecated This manual action type will be removed in a future major release.\n * Recommended fixes:\n * - Type component props as a simple callback: e.g. `onDismiss: () => void`.\n * - Use the appropriate hook (useNotification) to encapsulate this logic.\n * - Reference the action object type for middleware, use ReturnType<typeof actionCreator>.\n */\nexport type ShowNotificationAction = {\n type: \"SHOW_NOTIFICATION\",\n payload: {\n type: $Keys<NOTIFICATION_TYPES>,\n message: MessageObject,\n error: ?ErrorResponse,\n },\n};\n\n/**\n * @deprecated This manual action type will be removed in a future major release.\n * Recommended fixes:\n * - Type component props as a simple callback: e.g. `onDismiss: () => void`.\n * - Use the appropriate hook (usePreference) to encapsulate this logic.\n * - Reference the action object type for middleware, use ReturnType<typeof actionCreator>.\n */\nexport type SetPreferenceAction = {\n type: \"SET_PREFERENCE\",\n payload: { [name: string]: PreferenceValue },\n};\n/**\n * @deprecated This manual action type will be removed in a future major release.\n * Recommended fixes:\n * - Type component props as a simple callback: e.g. `onDismiss: () => void`.\n * - Use the appropriate hook (usePreference) to encapsulate this logic.\n * - Reference the action object type for middleware, use ReturnType<typeof actionCreator>.\n */\nexport type SetPreferencesAction = {\n type: \"SET_PREFERENCES\",\n payload: { [name: string]: PreferenceValue },\n};\n\n/**\n * @deprecated This manual action type will be removed in a future major release.\n * Recommended fixes:\n * - Type component props as a simple callback: e.g. `onDismiss: () => void`.\n * - Use the appropriate hook (useProgressIndicator) to encapsulate this logic.\n * - Reference the action object type for middleware, use ReturnType<typeof actionCreator>.\n */\nexport type StartProgressAction = {\n type: \"START_PROGRESS\",\n};\n/**\n * @deprecated This manual action type will be removed in a future major release.\n * Recommended fixes:\n * - Type component props as a simple callback: e.g. `onDismiss: () => void`.\n * - Use the appropriate hook (useProgressIndicator) to encapsulate this logic.\n * - Reference the action object type for middleware, use ReturnType<typeof actionCreator>.\n */\nexport type FinishProgressAction = {\n type: \"FINISH_PROGRESS\",\n};\n/**\n * @deprecated This manual action type will be removed in a future major release.\n * Recommended fixes:\n * - Type component props as a simple callback: e.g. `onDismiss: () => void`.\n * - Use the appropriate hook (useProgressIndicator) to encapsulate this logic.\n * - Reference the action object type for middleware, use ReturnType<typeof actionCreator>.\n */\nexport type ResetProgressAction = {\n type: \"RESET_PROGRESS\",\n};\n/**\n * @deprecated This manual action type will be removed in a future major release.\n * Recommended fixes:\n * - Type component props as a simple callback: e.g. `onDismiss: () => void`.\n * - Use the appropriate hook (useProgressIndicator) to encapsulate this logic.\n * - Reference the action object type for middleware, use ReturnType<typeof actionCreator>.\n */\nexport type UpdateProgressAction = {\n type: \"UPDATE_PROGRESS\",\n payload: { percentComplete: number },\n};\n\n/**\n * @deprecated This manual action type will be removed in a future major release.\n * Recommended fixes:\n * - Type component props as a simple callback: e.g. `onDismiss: () => void`.\n * - Use the appropriate hook (useAuthentication) to encapsulate this logic.\n * - Reference the action object type for middleware, use ReturnType<typeof actionCreator>.\n */\nexport type SendAuthenticationErrorAction = {\n type: \"AUTHENTICATION_ERROR\",\n payload: string,\n};\n\n/**\n * @deprecated This manual action type will be removed in a future major release.\n * Recommended fixes:\n * - Type component props as a simple callback: e.g. `onDismiss: () => void`.\n * - Use the appropriate hook (useAuthentication) to encapsulate this logic.\n * - Reference the action object type for middleware, use ReturnType<typeof actionCreator>.\n */\nexport type ResetAuthErrorsAction = {\n type: \"AUTHENTICATION_RESET_ERRORS\",\n};\n\n/**\n * @deprecated This manual action type will be removed in a future major release.\n * Recommended fixes:\n * - Type component props as a simple callback: e.g. `onDismiss: () => void`.\n * - Use the appropriate hook (useAuthentication) to encapsulate this logic.\n * - Reference the action object type for middleware, use ReturnType<typeof actionCreator>.\n */\nexport type LoginSuccessAction = {\n type: \"AUTHENTICATION_SUCCESS\",\n};\n\n/**\n * @deprecated This manual action type will be removed in a future major release.\n * Recommended fixes:\n * - Type component props as a simple callback: e.g. `onDismiss: () => void`.\n * - Use the appropriate hook (useAuthentication) to encapsulate this logic.\n * - Reference the action object type for middleware, use ReturnType<typeof actionCreator>.\n */\nexport type ChangePasswordAction = {\n type: \"CHANGE_PASSWORD\",\n};\n\n/**\n * @deprecated This manual action type will be removed in a future major release.\n * Recommended fixes:\n * - Type component props as a simple callback: e.g. `onDismiss: () => void`.\n * - Use the appropriate hook (useAuthentication) to encapsulate this logic.\n * - Reference the action object type for middleware, use ReturnType<typeof actionCreator>.\n */\nexport type LogoutSuccessAction = {\n type: \"AUTHENTICATION_LOGOUT\",\n};\n\n/**\n * @deprecated This manual action type will be removed in a future major release.\n * Recommended fixes:\n * - Type component props as a simple callback: e.g. `onDismiss: () => void`.\n * - Use the appropriate hook (useFormNavigation) to encapsulate this logic.\n * - Reference the action object type for middleware, use ReturnType<typeof actionCreator>.\n */\nexport type UpdateAutosaveAction = {\n type: \"UPDATE_AUTOSAVE_STATUS\",\n payload: {\n status: $Keys<AUTOSAVE_STATUS>,\n model: FormModel,\n },\n};\n\n/**\n * @deprecated This manual action type will be removed in a future major release.\n * Recommended fixes:\n * - Type component props as a simple callback: e.g. `onDismiss: () => void`.\n * - Use the appropriate hook to encapsulate this logic.\n * - Reference the action object type for middleware, use ReturnType<typeof actionCreator>.\n */\nexport type UpdateEntryDateAction = {\n type: \"UPDATE_ENTRYDATE\",\n payload: ISO_DATE,\n};\n\n/**\n * @deprecated This union type is a legacy pattern and is not maintained for new actions.\n */\nexport type ReduxAction =\n | UpdateStatusAction\n | SetModelAction\n | InitModelAction\n | UpdateModelAction\n | UpdateFormAction\n | RemoveModelByKeyAction\n | ResetModularUIAction\n | SaveErrorAction\n | UpdateLocaleAction\n | SetLocalesAction\n | ShowModalAction\n | CloseModalAction\n | DismissNotificationAction\n | ShowNotificationAction\n | SetPreferenceAction\n | SetPreferencesAction\n | StartProgressAction\n | FinishProgressAction\n | ResetProgressAction\n | UpdateProgressAction\n | ResetAuthErrorsAction\n | SendAuthenticationErrorAction\n | LoginSuccessAction\n | ChangePasswordAction\n | LogoutSuccessAction\n | UpdateAutosaveAction\n | UpdateEntryDateAction\n | LocationChangeAction\n | PushAction\n | ReplaceAction\n | GoAction\n | GoBackAction\n | GoForwardAction\n | ModularUIAction\n | NoAction;\n\nexport type AuthState = {\n +mustChangePassword: boolean,\n +error: ?string,\n};\n\nexport type ErrorState = null | ErrorResponse;\n\nexport type ModalState = {\n +key: string,\n +visible: boolean,\n +size?: string,\n};\n\nexport type ModalsState = {\n +modals: Array<ModalState>,\n};\n\nexport type NotificationState = {\n +render: boolean,\n +messageType: string | null,\n +message: MessageObject | null,\n +error: ?ErrorResponse | null,\n};\n\nexport type PreferencesState = {\n +[name: string]: PreferenceValue,\n};\n\nexport type ProgressIndicatorState = {\n +count: number,\n +timestamp: number,\n +percentComplete: number,\n};\n\nexport type ModelCatalogState = {\n entryDate: ISO_DATE | null,\n};\n\nexport type ReduxState = {\n +router: RouterState,\n +modularui: ModularUIState,\n +i18n: I18nState,\n +auth: AuthState,\n +modelcatalog: ModelCatalogState,\n +error: ErrorState,\n +modals: ModalsState,\n +notification: NotificationState,\n +progressindicator: ProgressIndicatorState,\n +preferences: PreferencesState,\n ...\n};\n\nexport type GetState = () => ReduxState;\n\nexport type Subscribe = (listener: () => void) => () => void;\n\nexport type ThunkExtra = {\n subscribe: Subscribe,\n ...\n};\n\nexport type ThunkAction<R = any> = (\n dispatch: Dispatch,\n getState: GetState,\n extra: ThunkExtra,\n) => R;\n\n/**\n * @deprecated This manual action type will be removed in a future major release.\n * Recommended fixes:\n * - Type component props as a simple callback: e.g. `onDismiss: () => void`.\n * - Use the appropriate hook to encapsulate this logic.\n */\nexport type PromiseAction = Promise<ReduxAction | ThunkAction<any>>;\n\nexport type Dispatch = (\n action: ReduxAction | ThunkAction<any> | PromiseAction,\n) => any;\n\nexport type ReduxStore = Store<ReduxState, ReduxAction, Dispatch>;\n\n/**\n * @deprecated This manual action type will be removed in a future major release.\n * Recommended fixes:\n * - Type component props as a simple callback: e.g. `onDismiss: () => void`.\n * - Use the appropriate hook to encapsulate this logic.\n */\nexport type PossibleAction = ReduxAction | ThunkAction<any> | PromiseAction;\n\nexport type CustomReducers = { [reducerKey: string]: any };\n"],"mappings":"","ignoreList":[]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@beinformed/ui",
3
- "version": "1.65.29",
3
+ "version": "1.67.0",
4
4
  "description": "Toolbox for be informed javascript layouts",
5
5
  "license": "SEE LICENSE IN LICENSE.md",
6
6
  "bugs": "https://support.beinformed.com",
@@ -98,8 +98,8 @@
98
98
  "@babel/preset-env": "^7.29.0",
99
99
  "@babel/preset-flow": "^7.27.1",
100
100
  "@babel/preset-react": "^7.28.5",
101
- "@commitlint/cli": "^20.4.0",
102
- "@commitlint/config-conventional": "^20.4.0",
101
+ "@commitlint/cli": "^20.4.1",
102
+ "@commitlint/config-conventional": "^20.4.1",
103
103
  "@testing-library/dom": "^10.4.1",
104
104
  "@testing-library/react": "^16.3.2",
105
105
  "auditjs": "^4.2.0",
@@ -113,8 +113,8 @@
113
113
  "eslint-config-prettier": "^10.1.8",
114
114
  "eslint-plugin-babel": "^5.3.1",
115
115
  "eslint-plugin-ft-flow": "^3.0.11",
116
- "eslint-plugin-jest": "^29.12.1",
117
- "eslint-plugin-jsdoc": "^62.5.0",
116
+ "eslint-plugin-jest": "^29.14.0",
117
+ "eslint-plugin-jsdoc": "^62.5.4",
118
118
  "eslint-plugin-react": "^7.37.5",
119
119
  "eslint-plugin-react-hooks": "^5.2.0",
120
120
  "eslint-plugin-you-dont-need-lodash-underscore": "^6.14.0",