@beinformed/ui 1.57.4 → 1.58.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 (104) hide show
  1. package/CHANGELOG.md +14 -0
  2. package/esm/hooks/useModelCatalog.js +36 -5
  3. package/esm/hooks/useModelCatalog.js.map +1 -1
  4. package/esm/models/concepts/ConceptDetailModel.js +1 -1
  5. package/esm/models/concepts/ConceptDetailModel.js.map +1 -1
  6. package/esm/models/concepts/ConceptIndexModel.js +1 -1
  7. package/esm/models/concepts/ConceptIndexModel.js.map +1 -1
  8. package/esm/models/content/ContentModel.js +1 -1
  9. package/esm/models/content/ContentModel.js.map +1 -1
  10. package/esm/models/content/ContentTOCModel.js +1 -1
  11. package/esm/models/content/ContentTOCModel.js.map +1 -1
  12. package/esm/models/user/UserServicesModel.js +2 -1
  13. package/esm/models/user/UserServicesModel.js.map +1 -1
  14. package/esm/modularui/Authenticate.js +4 -1
  15. package/esm/modularui/Authenticate.js.map +1 -1
  16. package/esm/redux/actions/EntryDate.js +8 -0
  17. package/esm/redux/actions/EntryDate.js.map +1 -0
  18. package/esm/redux/actions/index.js +1 -0
  19. package/esm/redux/actions/index.js.map +1 -1
  20. package/esm/redux/reducers/ModelCatalogReducer.js +36 -0
  21. package/esm/redux/reducers/ModelCatalogReducer.js.map +1 -0
  22. package/esm/redux/reducers/createReducer.js +2 -0
  23. package/esm/redux/reducers/createReducer.js.map +1 -1
  24. package/esm/redux/reducers/index.js +1 -0
  25. package/esm/redux/reducers/index.js.map +1 -1
  26. package/esm/redux/selectors/index.js +1 -0
  27. package/esm/redux/selectors/index.js.map +1 -1
  28. package/esm/redux/selectors/modelcatalog.js +8 -0
  29. package/esm/redux/selectors/modelcatalog.js.map +1 -0
  30. package/esm/redux/types.js.map +1 -1
  31. package/esm/utils/helpers/createHref.js +10 -7
  32. package/esm/utils/helpers/createHref.js.map +1 -1
  33. package/lib/hooks/__tests__/useModelCatalog.spec.js.flow +7 -6
  34. package/lib/hooks/useModelCatalog.js +38 -6
  35. package/lib/hooks/useModelCatalog.js.flow +39 -5
  36. package/lib/hooks/useModelCatalog.js.map +1 -1
  37. package/lib/models/concepts/ConceptDetailModel.js +1 -1
  38. package/lib/models/concepts/ConceptDetailModel.js.flow +1 -1
  39. package/lib/models/concepts/ConceptDetailModel.js.map +1 -1
  40. package/lib/models/concepts/ConceptIndexModel.js +1 -1
  41. package/lib/models/concepts/ConceptIndexModel.js.flow +1 -1
  42. package/lib/models/concepts/ConceptIndexModel.js.map +1 -1
  43. package/lib/models/content/ContentModel.js +1 -1
  44. package/lib/models/content/ContentModel.js.flow +1 -1
  45. package/lib/models/content/ContentModel.js.map +1 -1
  46. package/lib/models/content/ContentTOCModel.js +1 -1
  47. package/lib/models/content/ContentTOCModel.js.flow +1 -1
  48. package/lib/models/content/ContentTOCModel.js.map +1 -1
  49. package/lib/models/user/UserServicesModel.js +2 -1
  50. package/lib/models/user/UserServicesModel.js.flow +6 -1
  51. package/lib/models/user/UserServicesModel.js.map +1 -1
  52. package/lib/modularui/Authenticate.js +4 -1
  53. package/lib/modularui/Authenticate.js.flow +4 -1
  54. package/lib/modularui/Authenticate.js.map +1 -1
  55. package/lib/redux/actions/EntryDate.js +15 -0
  56. package/lib/redux/actions/EntryDate.js.flow +12 -0
  57. package/lib/redux/actions/EntryDate.js.map +1 -0
  58. package/lib/redux/actions/index.js +11 -0
  59. package/lib/redux/actions/index.js.flow +1 -0
  60. package/lib/redux/actions/index.js.map +1 -1
  61. package/lib/redux/reducers/ModelCatalogReducer.js +43 -0
  62. package/lib/redux/reducers/ModelCatalogReducer.js.flow +46 -0
  63. package/lib/redux/reducers/ModelCatalogReducer.js.map +1 -0
  64. package/lib/redux/reducers/createReducer.js +2 -0
  65. package/lib/redux/reducers/createReducer.js.flow +4 -0
  66. package/lib/redux/reducers/createReducer.js.map +1 -1
  67. package/lib/redux/reducers/index.js +8 -0
  68. package/lib/redux/reducers/index.js.flow +1 -0
  69. package/lib/redux/reducers/index.js.map +1 -1
  70. package/lib/redux/selectors/index.js +11 -0
  71. package/lib/redux/selectors/index.js.flow +1 -0
  72. package/lib/redux/selectors/index.js.map +1 -1
  73. package/lib/redux/selectors/modelcatalog.js +15 -0
  74. package/lib/redux/selectors/modelcatalog.js.flow +11 -0
  75. package/lib/redux/selectors/modelcatalog.js.map +1 -0
  76. package/lib/redux/types.js.flow +11 -0
  77. package/lib/redux/types.js.map +1 -1
  78. package/lib/utils/helpers/__tests__/createHref.spec.js.flow +13 -9
  79. package/lib/utils/helpers/createHref.js +10 -7
  80. package/lib/utils/helpers/createHref.js.flow +17 -9
  81. package/lib/utils/helpers/createHref.js.map +1 -1
  82. package/package.json +8 -8
  83. package/src/hooks/__tests__/useModelCatalog.spec.js +7 -6
  84. package/src/hooks/useModelCatalog.js +39 -5
  85. package/src/models/concepts/ConceptDetailModel.js +1 -1
  86. package/src/models/concepts/ConceptIndexModel.js +1 -1
  87. package/src/models/content/ContentModel.js +1 -1
  88. package/src/models/content/ContentTOCModel.js +1 -1
  89. package/src/models/user/UserServicesModel.js +6 -1
  90. package/src/modularui/Authenticate.js +4 -1
  91. package/src/redux/actions/EntryDate.js +12 -0
  92. package/src/redux/actions/index.js +1 -0
  93. package/src/redux/reducers/ModelCatalogReducer.js +46 -0
  94. package/src/redux/reducers/createReducer.js +4 -0
  95. package/src/redux/reducers/index.js +1 -0
  96. package/src/redux/selectors/index.js +1 -0
  97. package/src/redux/selectors/modelcatalog.js +11 -0
  98. package/src/redux/types.js +11 -0
  99. package/src/utils/helpers/__tests__/createHref.spec.js +13 -9
  100. package/src/utils/helpers/createHref.js +17 -9
  101. package/types/models/concepts/ConceptDetailModel.d.ts +1 -1
  102. package/types/models/concepts/ConceptIndexModel.d.ts +1 -1
  103. package/types/models/content/ContentModel.d.ts +1 -1
  104. package/types/models/content/ContentTOCModel.d.ts +1 -1
@@ -0,0 +1,43 @@
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime-corejs3/helpers/interopRequireDefault");
4
+ Object.defineProperty(exports, "__esModule", {
5
+ value: true
6
+ });
7
+ exports.default = void 0;
8
+ var _urlSearchParams = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/url-search-params"));
9
+ var _utils = require("../../utils");
10
+ var _Cache = _interopRequireDefault(require("../../utils/browser/Cache"));
11
+ const getQueryParam = paramName => {
12
+ if (typeof window !== "undefined") {
13
+ const urlParams = new _urlSearchParams.default(window.location?.search);
14
+ return urlParams.get(paramName);
15
+ }
16
+ return null;
17
+ };
18
+ const initialState = {
19
+ entryDate: getQueryParam("entryDate") || _Cache.default.getItem("ModelCatalogEntryDate") || _utils.DateUtil.now()
20
+ };
21
+
22
+ /**
23
+ * Keep track of the entry date for the modelcatalog
24
+ */
25
+ const ModelCatalogReducer = function () {
26
+ let state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : initialState;
27
+ let action = arguments.length > 1 ? arguments[1] : undefined;
28
+ if (!action) {
29
+ return state;
30
+ }
31
+ switch (action.type) {
32
+ case "UPDATE_ENTRYDATE":
33
+ _Cache.default.addItem("ModelCatalogEntryDate", action.payload);
34
+ return {
35
+ ...state,
36
+ entryDate: action.payload
37
+ };
38
+ default:
39
+ return state;
40
+ }
41
+ };
42
+ var _default = exports.default = ModelCatalogReducer;
43
+ //# sourceMappingURL=ModelCatalogReducer.js.map
@@ -0,0 +1,46 @@
1
+ // @flow
2
+ import { DateUtil } from "../../utils";
3
+ import Cache from "../../utils/browser/Cache";
4
+
5
+ import type { Reducer } from "redux";
6
+ import type { ReduxAction, ModelCatalogState } from "../types";
7
+
8
+ const getQueryParam = (paramName: string): ?string => {
9
+ if (typeof window !== "undefined") {
10
+ const urlParams = new URLSearchParams(window.location?.search);
11
+ return urlParams.get(paramName);
12
+ }
13
+ return null;
14
+ };
15
+
16
+ const initialState: ModelCatalogState = {
17
+ entryDate:
18
+ getQueryParam("entryDate") ||
19
+ Cache.getItem("ModelCatalogEntryDate") ||
20
+ DateUtil.now(),
21
+ };
22
+
23
+ /**
24
+ * Keep track of the entry date for the modelcatalog
25
+ */
26
+ const ModelCatalogReducer: Reducer<ModelCatalogState, ReduxAction> = (
27
+ state = initialState,
28
+ action,
29
+ ) => {
30
+ if (!action) {
31
+ return state;
32
+ }
33
+
34
+ switch (action.type) {
35
+ case "UPDATE_ENTRYDATE":
36
+ Cache.addItem("ModelCatalogEntryDate", action.payload);
37
+ return {
38
+ ...state,
39
+ entryDate: action.payload,
40
+ };
41
+ default:
42
+ return state;
43
+ }
44
+ };
45
+
46
+ export default ModelCatalogReducer;
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ModelCatalogReducer.js","names":["_utils","require","_Cache","_interopRequireDefault","getQueryParam","paramName","window","urlParams","_urlSearchParams","default","location","search","get","initialState","entryDate","Cache","getItem","DateUtil","now","ModelCatalogReducer","state","arguments","length","undefined","action","type","addItem","payload","_default","exports"],"sources":["../../../src/redux/reducers/ModelCatalogReducer.js"],"sourcesContent":["// @flow\nimport { DateUtil } from \"../../utils\";\nimport Cache from \"../../utils/browser/Cache\";\n\nimport type { Reducer } from \"redux\";\nimport type { ReduxAction, ModelCatalogState } from \"../types\";\n\nconst getQueryParam = (paramName: string): ?string => {\n if (typeof window !== \"undefined\") {\n const urlParams = new URLSearchParams(window.location?.search);\n return urlParams.get(paramName);\n }\n return null;\n};\n\nconst initialState: ModelCatalogState = {\n entryDate:\n getQueryParam(\"entryDate\") ||\n Cache.getItem(\"ModelCatalogEntryDate\") ||\n DateUtil.now(),\n};\n\n/**\n * Keep track of the entry date for the modelcatalog\n */\nconst ModelCatalogReducer: Reducer<ModelCatalogState, ReduxAction> = (\n state = initialState,\n action,\n) => {\n if (!action) {\n return state;\n }\n\n switch (action.type) {\n case \"UPDATE_ENTRYDATE\":\n Cache.addItem(\"ModelCatalogEntryDate\", action.payload);\n return {\n ...state,\n entryDate: action.payload,\n };\n default:\n return state;\n }\n};\n\nexport default ModelCatalogReducer;\n"],"mappings":";;;;;;;;AACA,IAAAA,MAAA,GAAAC,OAAA;AACA,IAAAC,MAAA,GAAAC,sBAAA,CAAAF,OAAA;AAKA,MAAMG,aAAa,GAAIC,SAAiB,IAAc;EACpD,IAAI,OAAOC,MAAM,KAAK,WAAW,EAAE;IACjC,MAAMC,SAAS,GAAG,IAAAC,gBAAA,CAAAC,OAAA,CAAoBH,MAAM,CAACI,QAAQ,EAAEC,MAAM,CAAC;IAC9D,OAAOJ,SAAS,CAACK,GAAG,CAACP,SAAS,CAAC;EACjC;EACA,OAAO,IAAI;AACb,CAAC;AAED,MAAMQ,YAA+B,GAAG;EACtCC,SAAS,EACPV,aAAa,CAAC,WAAW,CAAC,IAC1BW,cAAK,CAACC,OAAO,CAAC,uBAAuB,CAAC,IACtCC,eAAQ,CAACC,GAAG,CAAC;AACjB,CAAC;;AAED;AACA;AACA;AACA,MAAMC,mBAA4D,GAAG,SAAAA,CAAA,EAGhE;EAAA,IAFHC,KAAK,GAAAC,SAAA,CAAAC,MAAA,QAAAD,SAAA,QAAAE,SAAA,GAAAF,SAAA,MAAGR,YAAY;EAAA,IACpBW,MAAM,GAAAH,SAAA,CAAAC,MAAA,OAAAD,SAAA,MAAAE,SAAA;EAEN,IAAI,CAACC,MAAM,EAAE;IACX,OAAOJ,KAAK;EACd;EAEA,QAAQI,MAAM,CAACC,IAAI;IACjB,KAAK,kBAAkB;MACrBV,cAAK,CAACW,OAAO,CAAC,uBAAuB,EAAEF,MAAM,CAACG,OAAO,CAAC;MACtD,OAAO;QACL,GAAGP,KAAK;QACRN,SAAS,EAAEU,MAAM,CAACG;MACpB,CAAC;IACH;MACE,OAAOP,KAAK;EAChB;AACF,CAAC;AAAC,IAAAQ,QAAA,GAAAC,OAAA,CAAApB,OAAA,GAEaU,mBAAmB","ignoreList":[]}
@@ -11,6 +11,7 @@ var _I18nReducer = require("../_i18n/I18nReducer");
11
11
  var _ModalsReducer = _interopRequireDefault(require("./ModalsReducer"));
12
12
  var _AuthReducer = _interopRequireDefault(require("./AuthReducer"));
13
13
  var _ErrorReducer = _interopRequireDefault(require("./ErrorReducer"));
14
+ var _ModelCatalogReducer = _interopRequireDefault(require("./ModelCatalogReducer"));
14
15
  var _NotificationReducer = _interopRequireDefault(require("./NotificationReducer"));
15
16
  var _ProgressIndicatorReducer = _interopRequireDefault(require("./ProgressIndicatorReducer"));
16
17
  var _PreferencesReducer = _interopRequireDefault(require("./PreferencesReducer"));
@@ -23,6 +24,7 @@ const createReducer = () => ({
23
24
  auth: _AuthReducer.default,
24
25
  error: _ErrorReducer.default,
25
26
  modals: _ModalsReducer.default,
27
+ modelcatalog: _ModelCatalogReducer.default,
26
28
  notification: _NotificationReducer.default,
27
29
  progressindicator: _ProgressIndicatorReducer.default,
28
30
  preferences: _PreferencesReducer.default
@@ -6,6 +6,7 @@ import { I18nReducer } from "../_i18n/I18nReducer";
6
6
  import ModalsReducer from "./ModalsReducer";
7
7
  import AuthReducer from "./AuthReducer";
8
8
  import ErrorReducer from "./ErrorReducer";
9
+ import ModelCatalogReducer from "./ModelCatalogReducer";
9
10
  import NotificationReducer from "./NotificationReducer";
10
11
  import ProgressIndicatorReducer from "./ProgressIndicatorReducer";
11
12
  import PreferencesReducer from "./PreferencesReducer";
@@ -19,6 +20,7 @@ import type {
19
20
  ModalsState,
20
21
  ErrorState,
21
22
  AuthState,
23
+ ModelCatalogState,
22
24
  } from "../types";
23
25
  import type { RouterState } from "../_router/types";
24
26
  import type { ModularUIState } from "../_modularui/types";
@@ -29,6 +31,7 @@ type Reducers = {
29
31
  error: Reducer<ErrorState, ReduxAction>,
30
32
  i18n: Reducer<I18nState, ReduxAction>,
31
33
  modals: Reducer<ModalsState, ReduxAction>,
34
+ modelcatalog: Reducer<ModelCatalogState, ReduxAction>,
32
35
  modularui: Reducer<ModularUIState, ReduxAction>,
33
36
  notification: Reducer<NotificationState, ReduxAction>,
34
37
  preferences: Reducer<PreferencesState, ReduxAction>,
@@ -45,6 +48,7 @@ export const createReducer = (): Reducers => ({
45
48
  auth: AuthReducer,
46
49
  error: ErrorReducer,
47
50
  modals: ModalsReducer,
51
+ modelcatalog: ModelCatalogReducer,
48
52
  notification: NotificationReducer,
49
53
  progressindicator: ProgressIndicatorReducer,
50
54
  preferences: PreferencesReducer,
@@ -1 +1 @@
1
- {"version":3,"file":"createReducer.js","names":["_RouterReducer","require","_ModularUIReducer","_I18nReducer","_ModalsReducer","_interopRequireDefault","_AuthReducer","_ErrorReducer","_NotificationReducer","_ProgressIndicatorReducer","_PreferencesReducer","createReducer","router","RouterReducer","modularui","ModularUIReducer","i18n","I18nReducer","auth","AuthReducer","error","ErrorReducer","modals","ModalsReducer","notification","NotificationReducer","progressindicator","ProgressIndicatorReducer","preferences","PreferencesReducer","exports"],"sources":["../../../src/redux/reducers/createReducer.js"],"sourcesContent":["// @flow\nimport { RouterReducer } from \"../_router/RouterReducer\";\nimport { ModularUIReducer } from \"../_modularui/ModularUIReducer\";\nimport { I18nReducer } from \"../_i18n/I18nReducer\";\n\nimport ModalsReducer from \"./ModalsReducer\";\nimport AuthReducer from \"./AuthReducer\";\nimport ErrorReducer from \"./ErrorReducer\";\nimport NotificationReducer from \"./NotificationReducer\";\nimport ProgressIndicatorReducer from \"./ProgressIndicatorReducer\";\nimport PreferencesReducer from \"./PreferencesReducer\";\n\nimport type { Reducer } from \"redux\";\nimport type {\n ReduxAction,\n ProgressIndicatorState,\n PreferencesState,\n NotificationState,\n ModalsState,\n ErrorState,\n AuthState,\n} from \"../types\";\nimport type { RouterState } from \"../_router/types\";\nimport type { ModularUIState } from \"../_modularui/types\";\nimport type { I18nState } from \"../_i18n/types\";\n\ntype Reducers = {\n auth: Reducer<AuthState, ReduxAction>,\n error: Reducer<ErrorState, ReduxAction>,\n i18n: Reducer<I18nState, ReduxAction>,\n modals: Reducer<ModalsState, ReduxAction>,\n modularui: Reducer<ModularUIState, ReduxAction>,\n notification: Reducer<NotificationState, ReduxAction>,\n preferences: Reducer<PreferencesState, ReduxAction>,\n progressindicator: Reducer<ProgressIndicatorState, ReduxAction>,\n router: Reducer<RouterState, ReduxAction>,\n};\n\n/**\n */\nexport const createReducer = (): Reducers => ({\n router: RouterReducer,\n modularui: ModularUIReducer,\n i18n: I18nReducer,\n auth: AuthReducer,\n error: ErrorReducer,\n modals: ModalsReducer,\n notification: NotificationReducer,\n progressindicator: ProgressIndicatorReducer,\n preferences: PreferencesReducer,\n});\n"],"mappings":";;;;;;;AACA,IAAAA,cAAA,GAAAC,OAAA;AACA,IAAAC,iBAAA,GAAAD,OAAA;AACA,IAAAE,YAAA,GAAAF,OAAA;AAEA,IAAAG,cAAA,GAAAC,sBAAA,CAAAJ,OAAA;AACA,IAAAK,YAAA,GAAAD,sBAAA,CAAAJ,OAAA;AACA,IAAAM,aAAA,GAAAF,sBAAA,CAAAJ,OAAA;AACA,IAAAO,oBAAA,GAAAH,sBAAA,CAAAJ,OAAA;AACA,IAAAQ,yBAAA,GAAAJ,sBAAA,CAAAJ,OAAA;AACA,IAAAS,mBAAA,GAAAL,sBAAA,CAAAJ,OAAA;AA4BA;AACA;AACO,MAAMU,aAAa,GAAGA,CAAA,MAAiB;EAC5CC,MAAM,EAAEC,4BAAa;EACrBC,SAAS,EAAEC,kCAAgB;EAC3BC,IAAI,EAAEC,wBAAW;EACjBC,IAAI,EAAEC,oBAAW;EACjBC,KAAK,EAAEC,qBAAY;EACnBC,MAAM,EAAEC,sBAAa;EACrBC,YAAY,EAAEC,4BAAmB;EACjCC,iBAAiB,EAAEC,iCAAwB;EAC3CC,WAAW,EAAEC;AACf,CAAC,CAAC;AAACC,OAAA,CAAAnB,aAAA,GAAAA,aAAA","ignoreList":[]}
1
+ {"version":3,"file":"createReducer.js","names":["_RouterReducer","require","_ModularUIReducer","_I18nReducer","_ModalsReducer","_interopRequireDefault","_AuthReducer","_ErrorReducer","_ModelCatalogReducer","_NotificationReducer","_ProgressIndicatorReducer","_PreferencesReducer","createReducer","router","RouterReducer","modularui","ModularUIReducer","i18n","I18nReducer","auth","AuthReducer","error","ErrorReducer","modals","ModalsReducer","modelcatalog","ModelCatalogReducer","notification","NotificationReducer","progressindicator","ProgressIndicatorReducer","preferences","PreferencesReducer","exports"],"sources":["../../../src/redux/reducers/createReducer.js"],"sourcesContent":["// @flow\nimport { RouterReducer } from \"../_router/RouterReducer\";\nimport { ModularUIReducer } from \"../_modularui/ModularUIReducer\";\nimport { I18nReducer } from \"../_i18n/I18nReducer\";\n\nimport ModalsReducer from \"./ModalsReducer\";\nimport AuthReducer from \"./AuthReducer\";\nimport ErrorReducer from \"./ErrorReducer\";\nimport ModelCatalogReducer from \"./ModelCatalogReducer\";\nimport NotificationReducer from \"./NotificationReducer\";\nimport ProgressIndicatorReducer from \"./ProgressIndicatorReducer\";\nimport PreferencesReducer from \"./PreferencesReducer\";\n\nimport type { Reducer } from \"redux\";\nimport type {\n ReduxAction,\n ProgressIndicatorState,\n PreferencesState,\n NotificationState,\n ModalsState,\n ErrorState,\n AuthState,\n ModelCatalogState,\n} from \"../types\";\nimport type { RouterState } from \"../_router/types\";\nimport type { ModularUIState } from \"../_modularui/types\";\nimport type { I18nState } from \"../_i18n/types\";\n\ntype Reducers = {\n auth: Reducer<AuthState, ReduxAction>,\n error: Reducer<ErrorState, ReduxAction>,\n i18n: Reducer<I18nState, ReduxAction>,\n modals: Reducer<ModalsState, ReduxAction>,\n modelcatalog: Reducer<ModelCatalogState, ReduxAction>,\n modularui: Reducer<ModularUIState, ReduxAction>,\n notification: Reducer<NotificationState, ReduxAction>,\n preferences: Reducer<PreferencesState, ReduxAction>,\n progressindicator: Reducer<ProgressIndicatorState, ReduxAction>,\n router: Reducer<RouterState, ReduxAction>,\n};\n\n/**\n */\nexport const createReducer = (): Reducers => ({\n router: RouterReducer,\n modularui: ModularUIReducer,\n i18n: I18nReducer,\n auth: AuthReducer,\n error: ErrorReducer,\n modals: ModalsReducer,\n modelcatalog: ModelCatalogReducer,\n notification: NotificationReducer,\n progressindicator: ProgressIndicatorReducer,\n preferences: PreferencesReducer,\n});\n"],"mappings":";;;;;;;AACA,IAAAA,cAAA,GAAAC,OAAA;AACA,IAAAC,iBAAA,GAAAD,OAAA;AACA,IAAAE,YAAA,GAAAF,OAAA;AAEA,IAAAG,cAAA,GAAAC,sBAAA,CAAAJ,OAAA;AACA,IAAAK,YAAA,GAAAD,sBAAA,CAAAJ,OAAA;AACA,IAAAM,aAAA,GAAAF,sBAAA,CAAAJ,OAAA;AACA,IAAAO,oBAAA,GAAAH,sBAAA,CAAAJ,OAAA;AACA,IAAAQ,oBAAA,GAAAJ,sBAAA,CAAAJ,OAAA;AACA,IAAAS,yBAAA,GAAAL,sBAAA,CAAAJ,OAAA;AACA,IAAAU,mBAAA,GAAAN,sBAAA,CAAAJ,OAAA;AA8BA;AACA;AACO,MAAMW,aAAa,GAAGA,CAAA,MAAiB;EAC5CC,MAAM,EAAEC,4BAAa;EACrBC,SAAS,EAAEC,kCAAgB;EAC3BC,IAAI,EAAEC,wBAAW;EACjBC,IAAI,EAAEC,oBAAW;EACjBC,KAAK,EAAEC,qBAAY;EACnBC,MAAM,EAAEC,sBAAa;EACrBC,YAAY,EAAEC,4BAAmB;EACjCC,YAAY,EAAEC,4BAAmB;EACjCC,iBAAiB,EAAEC,iCAAwB;EAC3CC,WAAW,EAAEC;AACf,CAAC,CAAC;AAACC,OAAA,CAAArB,aAAA,GAAAA,aAAA","ignoreList":[]}
@@ -7,6 +7,7 @@ Object.defineProperty(exports, "__esModule", {
7
7
  });
8
8
  var _exportNames = {
9
9
  AuthReducer: true,
10
+ ModelCatalogReducer: true,
10
11
  ErrorReducer: true,
11
12
  ModalsReducer: true,
12
13
  NotificationReducer: true,
@@ -31,6 +32,12 @@ Object.defineProperty(exports, "ModalsReducer", {
31
32
  return _ModalsReducer.default;
32
33
  }
33
34
  });
35
+ Object.defineProperty(exports, "ModelCatalogReducer", {
36
+ enumerable: true,
37
+ get: function () {
38
+ return _ModelCatalogReducer.default;
39
+ }
40
+ });
34
41
  Object.defineProperty(exports, "NotificationReducer", {
35
42
  enumerable: true,
36
43
  get: function () {
@@ -62,6 +69,7 @@ _Object$keys(_createReducer).forEach(function (key) {
62
69
  });
63
70
  });
64
71
  var _AuthReducer = _interopRequireDefault(require("./AuthReducer"));
72
+ var _ModelCatalogReducer = _interopRequireDefault(require("./ModelCatalogReducer"));
65
73
  var _ErrorReducer = _interopRequireDefault(require("./ErrorReducer"));
66
74
  var _ModalsReducer = _interopRequireDefault(require("./ModalsReducer"));
67
75
  var _NotificationReducer = _interopRequireDefault(require("./NotificationReducer"));
@@ -2,6 +2,7 @@
2
2
  export * from "./createReducer";
3
3
 
4
4
  export { default as AuthReducer } from "./AuthReducer";
5
+ export { default as ModelCatalogReducer } from "./ModelCatalogReducer";
5
6
  export { default as ErrorReducer } from "./ErrorReducer";
6
7
  export { default as ModalsReducer } from "./ModalsReducer";
7
8
  export { default as NotificationReducer } from "./NotificationReducer";
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["_createReducer","require","_Object$keys","forEach","key","Object","prototype","hasOwnProperty","call","_exportNames","exports","defineProperty","enumerable","get","_AuthReducer","_interopRequireDefault","_ErrorReducer","_ModalsReducer","_NotificationReducer","_PreferencesReducer","_ProgressIndicatorReducer"],"sources":["../../../src/redux/reducers/index.js"],"sourcesContent":["// @flow\nexport * from \"./createReducer\";\n\nexport { default as AuthReducer } from \"./AuthReducer\";\nexport { default as ErrorReducer } from \"./ErrorReducer\";\nexport { default as ModalsReducer } from \"./ModalsReducer\";\nexport { default as NotificationReducer } from \"./NotificationReducer\";\nexport { default as PreferencesReducer } from \"./PreferencesReducer\";\nexport { default as ProgressIndicatorReducer } from \"./ProgressIndicatorReducer\";\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,IAAAA,cAAA,GAAAC,OAAA;AAAAC,YAAA,CAAAF,cAAA,EAAAG,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAC,MAAA,CAAAC,SAAA,CAAAC,cAAA,CAAAC,IAAA,CAAAC,YAAA,EAAAL,GAAA;EAAA,IAAAA,GAAA,IAAAM,OAAA,IAAAA,OAAA,CAAAN,GAAA,MAAAJ,cAAA,CAAAI,GAAA;EAAAC,MAAA,CAAAM,cAAA,CAAAD,OAAA,EAAAN,GAAA;IAAAQ,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAb,cAAA,CAAAI,GAAA;IAAA;EAAA;AAAA;AAEA,IAAAU,YAAA,GAAAC,sBAAA,CAAAd,OAAA;AACA,IAAAe,aAAA,GAAAD,sBAAA,CAAAd,OAAA;AACA,IAAAgB,cAAA,GAAAF,sBAAA,CAAAd,OAAA;AACA,IAAAiB,oBAAA,GAAAH,sBAAA,CAAAd,OAAA;AACA,IAAAkB,mBAAA,GAAAJ,sBAAA,CAAAd,OAAA;AACA,IAAAmB,yBAAA,GAAAL,sBAAA,CAAAd,OAAA","ignoreList":[]}
1
+ {"version":3,"file":"index.js","names":["_createReducer","require","_Object$keys","forEach","key","Object","prototype","hasOwnProperty","call","_exportNames","exports","defineProperty","enumerable","get","_AuthReducer","_interopRequireDefault","_ModelCatalogReducer","_ErrorReducer","_ModalsReducer","_NotificationReducer","_PreferencesReducer","_ProgressIndicatorReducer"],"sources":["../../../src/redux/reducers/index.js"],"sourcesContent":["// @flow\nexport * from \"./createReducer\";\n\nexport { default as AuthReducer } from \"./AuthReducer\";\nexport { default as ModelCatalogReducer } from \"./ModelCatalogReducer\";\nexport { default as ErrorReducer } from \"./ErrorReducer\";\nexport { default as ModalsReducer } from \"./ModalsReducer\";\nexport { default as NotificationReducer } from \"./NotificationReducer\";\nexport { default as PreferencesReducer } from \"./PreferencesReducer\";\nexport { default as ProgressIndicatorReducer } from \"./ProgressIndicatorReducer\";\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,IAAAA,cAAA,GAAAC,OAAA;AAAAC,YAAA,CAAAF,cAAA,EAAAG,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAC,MAAA,CAAAC,SAAA,CAAAC,cAAA,CAAAC,IAAA,CAAAC,YAAA,EAAAL,GAAA;EAAA,IAAAA,GAAA,IAAAM,OAAA,IAAAA,OAAA,CAAAN,GAAA,MAAAJ,cAAA,CAAAI,GAAA;EAAAC,MAAA,CAAAM,cAAA,CAAAD,OAAA,EAAAN,GAAA;IAAAQ,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAb,cAAA,CAAAI,GAAA;IAAA;EAAA;AAAA;AAEA,IAAAU,YAAA,GAAAC,sBAAA,CAAAd,OAAA;AACA,IAAAe,oBAAA,GAAAD,sBAAA,CAAAd,OAAA;AACA,IAAAgB,aAAA,GAAAF,sBAAA,CAAAd,OAAA;AACA,IAAAiB,cAAA,GAAAH,sBAAA,CAAAd,OAAA;AACA,IAAAkB,oBAAA,GAAAJ,sBAAA,CAAAd,OAAA;AACA,IAAAmB,mBAAA,GAAAL,sBAAA,CAAAd,OAAA;AACA,IAAAoB,yBAAA,GAAAN,sBAAA,CAAAd,OAAA","ignoreList":[]}
@@ -15,4 +15,15 @@ _Object$keys(_i18n).forEach(function (key) {
15
15
  }
16
16
  });
17
17
  });
18
+ var _modelcatalog = require("./modelcatalog");
19
+ _Object$keys(_modelcatalog).forEach(function (key) {
20
+ if (key === "default" || key === "__esModule") return;
21
+ if (key in exports && exports[key] === _modelcatalog[key]) return;
22
+ Object.defineProperty(exports, key, {
23
+ enumerable: true,
24
+ get: function () {
25
+ return _modelcatalog[key];
26
+ }
27
+ });
28
+ });
18
29
  //# sourceMappingURL=index.js.map
@@ -1,2 +1,3 @@
1
1
  // @flow
2
2
  export * from "./i18n";
3
+ export * from "./modelcatalog";
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["_i18n","require","_Object$keys","forEach","key","exports","Object","defineProperty","enumerable","get"],"sources":["../../../src/redux/selectors/index.js"],"sourcesContent":["// @flow\nexport * from \"./i18n\";\n"],"mappings":";;;;;;AACA,IAAAA,KAAA,GAAAC,OAAA;AAAAC,YAAA,CAAAF,KAAA,EAAAG,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAA,GAAA,IAAAC,OAAA,IAAAA,OAAA,CAAAD,GAAA,MAAAJ,KAAA,CAAAI,GAAA;EAAAE,MAAA,CAAAC,cAAA,CAAAF,OAAA,EAAAD,GAAA;IAAAI,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAT,KAAA,CAAAI,GAAA;IAAA;EAAA;AAAA","ignoreList":[]}
1
+ {"version":3,"file":"index.js","names":["_i18n","require","_Object$keys","forEach","key","exports","Object","defineProperty","enumerable","get","_modelcatalog"],"sources":["../../../src/redux/selectors/index.js"],"sourcesContent":["// @flow\nexport * from \"./i18n\";\nexport * from \"./modelcatalog\";\n"],"mappings":";;;;;;AACA,IAAAA,KAAA,GAAAC,OAAA;AAAAC,YAAA,CAAAF,KAAA,EAAAG,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAA,GAAA,IAAAC,OAAA,IAAAA,OAAA,CAAAD,GAAA,MAAAJ,KAAA,CAAAI,GAAA;EAAAE,MAAA,CAAAC,cAAA,CAAAF,OAAA,EAAAD,GAAA;IAAAI,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAT,KAAA,CAAAI,GAAA;IAAA;EAAA;AAAA;AACA,IAAAM,aAAA,GAAAT,OAAA;AAAAC,YAAA,CAAAQ,aAAA,EAAAP,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAA,GAAA,IAAAC,OAAA,IAAAA,OAAA,CAAAD,GAAA,MAAAM,aAAA,CAAAN,GAAA;EAAAE,MAAA,CAAAC,cAAA,CAAAF,OAAA,EAAAD,GAAA;IAAAI,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAC,aAAA,CAAAN,GAAA;IAAA;EAAA;AAAA","ignoreList":[]}
@@ -0,0 +1,15 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.getEntryDate = void 0;
7
+ var _utils = require("../../utils");
8
+ /**
9
+ * Retrieve entrydate for the model catalog
10
+ */
11
+ const getEntryDate = state => {
12
+ return state.modelcatalog?.entryDate ?? _utils.DateUtil.now();
13
+ };
14
+ exports.getEntryDate = getEntryDate;
15
+ //# sourceMappingURL=modelcatalog.js.map
@@ -0,0 +1,11 @@
1
+ // @flow
2
+ import { DateUtil } from "../../utils";
3
+
4
+ import type { ReduxState } from "../types";
5
+
6
+ /**
7
+ * Retrieve entrydate for the model catalog
8
+ */
9
+ export const getEntryDate = (state: ReduxState): ISO_DATE => {
10
+ return state.modelcatalog?.entryDate ?? DateUtil.now();
11
+ };
@@ -0,0 +1 @@
1
+ {"version":3,"file":"modelcatalog.js","names":["_utils","require","getEntryDate","state","modelcatalog","entryDate","DateUtil","now","exports"],"sources":["../../../src/redux/selectors/modelcatalog.js"],"sourcesContent":["// @flow\nimport { DateUtil } from \"../../utils\";\n\nimport type { ReduxState } from \"../types\";\n\n/**\n * Retrieve entrydate for the model catalog\n */\nexport const getEntryDate = (state: ReduxState): ISO_DATE => {\n return state.modelcatalog?.entryDate ?? DateUtil.now();\n};\n"],"mappings":";;;;;;AACA,IAAAA,MAAA,GAAAC,OAAA;AAIA;AACA;AACA;AACO,MAAMC,YAAY,GAAIC,KAAiB,IAAe;EAC3D,OAAOA,KAAK,CAACC,YAAY,EAAEC,SAAS,IAAIC,eAAQ,CAACC,GAAG,CAAC,CAAC;AACxD,CAAC;AAACC,OAAA,CAAAN,YAAA,GAAAA,YAAA","ignoreList":[]}
@@ -135,6 +135,11 @@ export type UpdateAutosaveAction = {
135
135
  },
136
136
  };
137
137
 
138
+ export type UpdateEntryDateAction = {
139
+ type: "UPDATE_ENTRYDATE",
140
+ payload: ISO_DATE,
141
+ };
142
+
138
143
  export type ReduxAction =
139
144
  | UpdateStatusAction
140
145
  | SetModelAction
@@ -162,6 +167,7 @@ export type ReduxAction =
162
167
  | ChangePasswordAction
163
168
  | LogoutSuccessAction
164
169
  | UpdateAutosaveAction
170
+ | UpdateEntryDateAction
165
171
  | LocationChangeAction
166
172
  | PushAction
167
173
  | ReplaceAction
@@ -206,11 +212,16 @@ export type ProgressIndicatorState = {
206
212
  +percentComplete: number,
207
213
  };
208
214
 
215
+ export type ModelCatalogState = {
216
+ entryDate: ISO_DATE,
217
+ };
218
+
209
219
  export type ReduxState = {
210
220
  +router: RouterState,
211
221
  +modularui: ModularUIState,
212
222
  +i18n: I18nState,
213
223
  +auth: AuthState,
224
+ +modelcatalog: ModelCatalogState,
214
225
  +error: ErrorState,
215
226
  +modals: ModalsState,
216
227
  +notification: NotificationState,
@@ -1 +1 @@
1
- {"version":3,"file":"types.js","names":[],"sources":["../../src/redux/types.js"],"sourcesContent":["// @flow\nimport type { Store, DispatchAPI } 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 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 | 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 ReduxState = {\n +router: RouterState,\n +modularui: ModularUIState,\n +i18n: I18nState,\n +auth: AuthState,\n +error: ErrorState,\n +modals: ModalsState,\n +notification: NotificationState,\n +progressindicator: ProgressIndicatorState,\n +preferences: PreferencesState,\n ...\n};\n\nexport type GetState = () => ReduxState;\nexport type ThunkAction = (dispatch: Dispatch, getState: GetState) => any;\nexport type PromiseAction = Promise<PossibleAction>;\nexport type Dispatch = DispatchAPI<PossibleAction>;\nexport type ReduxStore = Store<ReduxState, ReduxAction, Dispatch>;\n\nexport type PossibleAction = ReduxAction | ThunkAction | 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, DispatchAPI } 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,\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;\nexport type ThunkAction = (dispatch: Dispatch, getState: GetState) => any;\nexport type PromiseAction = Promise<PossibleAction>;\nexport type Dispatch = DispatchAPI<PossibleAction>;\nexport type ReduxStore = Store<ReduxState, ReduxAction, Dispatch>;\n\nexport type PossibleAction = ReduxAction | ThunkAction | PromiseAction;\n\nexport type CustomReducers = { [reducerKey: string]: any };\n"],"mappings":"","ignoreList":[]}
@@ -7,25 +7,29 @@ describe("createHref", () => {
7
7
  const location = {
8
8
  search: "?entryDate=2024-03-08&index=C&notAllowed=true",
9
9
  };
10
+ const expectedSearch = "?index=C&notAllowed=true&entryDate=2010-01-01";
10
11
 
11
12
  expect(createHref("concepts", dynamicPart)).toEqual(
12
13
  new Href("/concepts/" + dynamicPart),
13
14
  );
14
- expect(createHref("concepts", dynamicPart, location)).toEqual(
15
- new Href("/concepts/" + dynamicPart + location.search),
15
+ expect(createHref("concepts", dynamicPart, "2010-01-01", location)).toEqual(
16
+ new Href("/concepts/" + dynamicPart + expectedSearch),
16
17
  );
17
18
  expect(
18
- createHref("concepts", dynamicPart, location, ["entryDate", "index"]),
19
+ createHref("concepts", dynamicPart, "2010-01-01", location, ["index"]),
19
20
  ).toEqual(
20
- new Href("/concepts/" + dynamicPart + "?entryDate=2024-03-08&index=C"),
21
+ new Href("/concepts/" + dynamicPart + "?index=C&entryDate=2010-01-01"),
21
22
  );
22
23
  expect(
23
- createHref("concepts", dynamicPart + location.search, location, [
24
- "entryDate",
25
- "index",
26
- ]),
24
+ createHref(
25
+ "concepts",
26
+ dynamicPart + location.search,
27
+ "2010-01-01",
28
+ location,
29
+ ["index"],
30
+ ),
27
31
  ).toEqual(
28
- new Href("/concepts/" + dynamicPart + "?entryDate=2024-03-08&index=C"),
32
+ new Href("/concepts/" + dynamicPart + "?index=C&entryDate=2010-01-01"),
29
33
  );
30
34
 
31
35
  expect(createHref("concepts", dynamicPart + "#hash")).toEqual(
@@ -75,7 +75,7 @@ const filterParameters = (href, allowedParameters) => {
75
75
  /**
76
76
  */
77
77
  exports.filterParameters = filterParameters;
78
- const createHref = (context, dynamicPart, location, allowedParameters) => {
78
+ const createHref = (context, dynamicPart, entryDate, location, allowedParameters) => {
79
79
  let href = dynamicPart.toString();
80
80
  if (!(0, _startsWith.default)(href).call(href, `/${context}/`)) {
81
81
  href = `/${context}/${href}`;
@@ -86,13 +86,16 @@ const createHref = (context, dynamicPart, location, allowedParameters) => {
86
86
  const search = (0, _startsWith.default)(_context = location.search).call(_context, "?") ? location.search.substring(1) : location.search;
87
87
  href = `${href}?${search}`;
88
88
  }
89
- if (dynamicPart instanceof _Href.default) {
90
- return filterParameters(new _Href.default(href, dynamicPart.resourcetype, {
91
- origin: dynamicPart.origin,
92
- contextPath: dynamicPart.contextPath
93
- }), allowedParameters);
89
+ const finalHref = dynamicPart instanceof _Href.default ? filterParameters(new _Href.default(href, dynamicPart.resourcetype, {
90
+ origin: dynamicPart.origin,
91
+ contextPath: dynamicPart.contextPath
92
+ }), allowedParameters) : filterParameters(href, allowedParameters);
93
+ if (entryDate) {
94
+ finalHref.setParameter("entryDate", entryDate);
95
+ } else {
96
+ finalHref.removeParameter("entryDate");
94
97
  }
95
- return filterParameters(href, allowedParameters);
98
+ return finalHref;
96
99
  };
97
100
  exports.createHref = createHref;
98
101
  //# sourceMappingURL=createHref.js.map
@@ -77,6 +77,7 @@ export const filterParameters = (
77
77
  export const createHref = (
78
78
  context: string,
79
79
  dynamicPart: string | Href,
80
+ entryDate?: ISO_DATE,
80
81
  location?: ?Location,
81
82
  allowedParameters?: Array<string>,
82
83
  ): Href => {
@@ -95,15 +96,22 @@ export const createHref = (
95
96
  href = `${href}?${search}`;
96
97
  }
97
98
 
98
- if (dynamicPart instanceof Href) {
99
- return filterParameters(
100
- new Href(href, dynamicPart.resourcetype, {
101
- origin: dynamicPart.origin,
102
- contextPath: dynamicPart.contextPath,
103
- }),
104
- allowedParameters,
105
- );
99
+ const finalHref =
100
+ dynamicPart instanceof Href
101
+ ? filterParameters(
102
+ new Href(href, dynamicPart.resourcetype, {
103
+ origin: dynamicPart.origin,
104
+ contextPath: dynamicPart.contextPath,
105
+ }),
106
+ allowedParameters,
107
+ )
108
+ : filterParameters(href, allowedParameters);
109
+
110
+ if (entryDate) {
111
+ finalHref.setParameter("entryDate", entryDate);
112
+ } else {
113
+ finalHref.removeParameter("entryDate");
106
114
  }
107
115
 
108
- return filterParameters(href, allowedParameters);
116
+ return finalHref;
109
117
  };
@@ -1 +1 @@
1
- {"version":3,"file":"createHref.js","names":["_Href","_interopRequireDefault","require","parseUrl","href","Href","path","querystring","hash","_includes","default","call","hashSplit","split","qsSplit","exports","filterParameters","allowedParameters","Array","isArray","url","filteredUrl","searchParams","_urlSearchParams","params","_from","_keys","param","delete","toString","resourcetype","origin","contextPath","createHref","context","dynamicPart","location","_startsWith","replace","search","_context","substring"],"sources":["../../../src/utils/helpers/createHref.js"],"sourcesContent":["// @flow\nimport Href from \"../../models/href/Href\";\n\nimport type { Location } from \"react-router\";\n\n/**\n */\nexport const parseUrl = (\n href: string | Href,\n): { path: string, querystring: null | string, hash: null | string } => {\n if (href instanceof Href) {\n return {\n path: href.path,\n querystring: href.querystring,\n hash: href.hash,\n };\n }\n\n let path = href;\n let hash = null;\n let querystring = null;\n if (href.includes(\"#\")) {\n const hashSplit = href.split(\"#\");\n path = hashSplit[0];\n hash = hashSplit[1];\n }\n if (href.includes(\"?\")) {\n const qsSplit = path.split(\"?\");\n path = qsSplit[0];\n querystring = qsSplit[1];\n }\n return {\n path,\n querystring,\n hash,\n };\n};\n\n/**\n */\nexport const filterParameters = (\n href: string | Href,\n allowedParameters?: Array<string>,\n): Href => {\n if (!Array.isArray(allowedParameters)) {\n return new Href(href);\n }\n\n const url = parseUrl(href);\n let filteredUrl = url.path;\n if (url.querystring) {\n const searchParams = new URLSearchParams(url.querystring);\n const params = Array.from(searchParams.keys());\n for (const param of params) {\n if (!allowedParameters.includes(param)) {\n searchParams.delete(param);\n }\n }\n filteredUrl = filteredUrl + \"?\" + searchParams.toString();\n }\n if (url.hash) {\n filteredUrl = filteredUrl + \"#\" + url.hash;\n }\n\n if (href instanceof Href) {\n return new Href(filteredUrl, href.resourcetype, {\n origin: href.origin,\n contextPath: href.contextPath,\n });\n }\n\n return new Href(filteredUrl);\n};\n\n/**\n */\nexport const createHref = (\n context: string,\n dynamicPart: string | Href,\n location?: ?Location,\n allowedParameters?: Array<string>,\n): Href => {\n let href = dynamicPart.toString();\n\n if (!href.startsWith(`/${context}/`)) {\n href = `/${context}/${href}`;\n }\n\n href = href.replace(/\\/\\//g, \"/\");\n\n if (location?.search && !href.includes(\"?\")) {\n const search = location.search.startsWith(\"?\")\n ? location.search.substring(1)\n : location.search;\n href = `${href}?${search}`;\n }\n\n if (dynamicPart instanceof Href) {\n return filterParameters(\n new Href(href, dynamicPart.resourcetype, {\n origin: dynamicPart.origin,\n contextPath: dynamicPart.contextPath,\n }),\n allowedParameters,\n );\n }\n\n return filterParameters(href, allowedParameters);\n};\n"],"mappings":";;;;;;;;;;;;AACA,IAAAA,KAAA,GAAAC,sBAAA,CAAAC,OAAA;AAIA;AACA;AACO,MAAMC,QAAQ,GACnBC,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AAC,EAAE;IACpC9B,IAAI,GAAG,IAAI8B,OAAO,IAAI9B,IAAI,EAAE;EAC9B;EAEAA,IAAI,GAAGA,IAAI,CAACkC,OAAO,CAAC,OAAO,EAAE,GAAG,CAAC;EAEjC,IAAIF,QAAQ,EAAEG,MAAM,IAAI,CAAC,IAAA9B,SAAA,CAAAC,OAAA,EAAAN,IAAI,EAAAO,IAAA,CAAJP,IAAI,EAAU,GAAG,CAAC,EAAE;IAAA,IAAAoC,QAAA;IAC3C,MAAMD,MAAM,GAAG,IAAAF,WAAA,CAAA3B,OAAA,EAAA8B,QAAA,GAAAJ,QAAQ,CAACG,MAAM,EAAA5B,IAAA,CAAA6B,QAAA,EAAY,GAAG,CAAC,GAC1CJ,QAAQ,CAACG,MAAM,CAACE,SAAS,CAAC,CAAC,CAAC,GAC5BL,QAAQ,CAACG,MAAM;IACnBnC,IAAI,GAAG,GAAGA,IAAI,IAAImC,MAAM,EAAE;EAC5B;EAEA,IAAIJ,WAAW,YAAY9B,aAAI,EAAE;IAC/B,OAAOW,gBAAgB,CACrB,IAAIX,aAAI,CAACD,IAAI,EAAE+B,WAAW,CAACL,YAAY,EAAE;MACvCC,MAAM,EAAEI,WAAW,CAACJ,MAAM;MAC1BC,WAAW,EAAEG,WAAW,CAACH;IAC3B,CAAC,CAAC,EACFf,iBACF,CAAC;EACH;EAEA,OAAOD,gBAAgB,CAACZ,IAAI,EAAEa,iBAAiB,CAAC;AAClD,CAAC;AAACF,OAAA,CAAAkB,UAAA,GAAAA,UAAA","ignoreList":[]}
1
+ {"version":3,"file":"createHref.js","names":["_Href","_interopRequireDefault","require","parseUrl","href","Href","path","querystring","hash","_includes","default","call","hashSplit","split","qsSplit","exports","filterParameters","allowedParameters","Array","isArray","url","filteredUrl","searchParams","_urlSearchParams","params","_from","_keys","param","delete","toString","resourcetype","origin","contextPath","createHref","context","dynamicPart","entryDate","location","_startsWith","replace","search","_context","substring","finalHref","setParameter","removeParameter"],"sources":["../../../src/utils/helpers/createHref.js"],"sourcesContent":["// @flow\nimport Href from \"../../models/href/Href\";\n\nimport type { Location } from \"react-router\";\n\n/**\n */\nexport const parseUrl = (\n href: string | Href,\n): { path: string, querystring: null | string, hash: null | string } => {\n if (href instanceof Href) {\n return {\n path: href.path,\n querystring: href.querystring,\n hash: href.hash,\n };\n }\n\n let path = href;\n let hash = null;\n let querystring = null;\n if (href.includes(\"#\")) {\n const hashSplit = href.split(\"#\");\n path = hashSplit[0];\n hash = hashSplit[1];\n }\n if (href.includes(\"?\")) {\n const qsSplit = path.split(\"?\");\n path = qsSplit[0];\n querystring = qsSplit[1];\n }\n return {\n path,\n querystring,\n hash,\n };\n};\n\n/**\n */\nexport const filterParameters = (\n href: string | Href,\n allowedParameters?: Array<string>,\n): Href => {\n if (!Array.isArray(allowedParameters)) {\n return new Href(href);\n }\n\n const url = parseUrl(href);\n let filteredUrl = url.path;\n if (url.querystring) {\n const searchParams = new URLSearchParams(url.querystring);\n const params = Array.from(searchParams.keys());\n for (const param of params) {\n if (!allowedParameters.includes(param)) {\n searchParams.delete(param);\n }\n }\n filteredUrl = filteredUrl + \"?\" + searchParams.toString();\n }\n if (url.hash) {\n filteredUrl = filteredUrl + \"#\" + url.hash;\n }\n\n if (href instanceof Href) {\n return new Href(filteredUrl, href.resourcetype, {\n origin: href.origin,\n contextPath: href.contextPath,\n });\n }\n\n return new Href(filteredUrl);\n};\n\n/**\n */\nexport const createHref = (\n context: string,\n dynamicPart: string | Href,\n entryDate?: ISO_DATE,\n location?: ?Location,\n allowedParameters?: Array<string>,\n): Href => {\n let href = dynamicPart.toString();\n\n if (!href.startsWith(`/${context}/`)) {\n href = `/${context}/${href}`;\n }\n\n href = href.replace(/\\/\\//g, \"/\");\n\n if (location?.search && !href.includes(\"?\")) {\n const search = location.search.startsWith(\"?\")\n ? location.search.substring(1)\n : location.search;\n href = `${href}?${search}`;\n }\n\n const finalHref =\n dynamicPart instanceof Href\n ? filterParameters(\n new Href(href, dynamicPart.resourcetype, {\n origin: dynamicPart.origin,\n contextPath: dynamicPart.contextPath,\n }),\n allowedParameters,\n )\n : filterParameters(href, allowedParameters);\n\n if (entryDate) {\n finalHref.setParameter(\"entryDate\", entryDate);\n } else {\n finalHref.removeParameter(\"entryDate\");\n }\n\n return finalHref;\n};\n"],"mappings":";;;;;;;;;;;;AACA,IAAAA,KAAA,GAAAC,sBAAA,CAAAC,OAAA;AAIA;AACA;AACO,MAAMC,QAAQ,GACnBC,IAAmB,IACmD;EACtE,IAAIA,IAAI,YAAYC,aAAI,EAAE;IACxB,OAAO;MACLC,IAAI,EAAEF,IAAI,CAACE,IAAI;MACfC,WAAW,EAAEH,IAAI,CAACG,WAAW;MAC7BC,IAAI,EAAEJ,IAAI,CAACI;IACb,CAAC;EACH;EAEA,IAAIF,IAAI,GAAGF,IAAI;EACf,IAAII,IAAI,GAAG,IAAI;EACf,IAAID,WAAW,GAAG,IAAI;EACtB,IAAI,IAAAE,SAAA,CAAAC,OAAA,EAAAN,IAAI,EAAAO,IAAA,CAAJP,IAAI,EAAU,GAAG,CAAC,EAAE;IACtB,MAAMQ,SAAS,GAAGR,IAAI,CAACS,KAAK,CAAC,GAAG,CAAC;IACjCP,IAAI,GAAGM,SAAS,CAAC,CAAC,CAAC;IACnBJ,IAAI,GAAGI,SAAS,CAAC,CAAC,CAAC;EACrB;EACA,IAAI,IAAAH,SAAA,CAAAC,OAAA,EAAAN,IAAI,EAAAO,IAAA,CAAJP,IAAI,EAAU,GAAG,CAAC,EAAE;IACtB,MAAMU,OAAO,GAAGR,IAAI,CAACO,KAAK,CAAC,GAAG,CAAC;IAC/BP,IAAI,GAAGQ,OAAO,CAAC,CAAC,CAAC;IACjBP,WAAW,GAAGO,OAAO,CAAC,CAAC,CAAC;EAC1B;EACA,OAAO;IACLR,IAAI;IACJC,WAAW;IACXC;EACF,CAAC;AACH,CAAC;;AAED;AACA;AADAO,OAAA,CAAAZ,QAAA,GAAAA,QAAA;AAEO,MAAMa,gBAAgB,GAAGA,CAC9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W,EAAER,SAAS,CAAC;EAChD,CAAC,MAAM;IACLO,SAAS,CAACE,eAAe,CAAC,WAAW,CAAC;EACxC;EAEA,OAAOF,SAAS;AAClB,CAAC;AAAC5B,OAAA,CAAAkB,UAAA,GAAAA,UAAA","ignoreList":[]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@beinformed/ui",
3
- "version": "1.57.4",
3
+ "version": "1.58.0",
4
4
  "description": "Toolbox for be informed javascript layouts",
5
5
  "license": "SEE LICENSE IN LICENSE.md",
6
6
  "bugs": "http://support.beinformed.com",
@@ -108,10 +108,10 @@
108
108
  "@babel/preset-env": "^7.26.0",
109
109
  "@babel/preset-flow": "^7.25.9",
110
110
  "@babel/preset-react": "^7.25.9",
111
- "@commitlint/cli": "^19.5.0",
112
- "@commitlint/config-conventional": "^19.5.0",
111
+ "@commitlint/cli": "^19.6.0",
112
+ "@commitlint/config-conventional": "^19.6.0",
113
113
  "@testing-library/react": "^16.0.1",
114
- "auditjs": "^4.0.45",
114
+ "auditjs": "^4.0.46",
115
115
  "babel-jest": "^29.7.0",
116
116
  "babel-plugin-styled-components": "^2.1.4",
117
117
  "cherry-pick": "^0.5.0",
@@ -123,8 +123,8 @@
123
123
  "eslint-plugin-babel": "^5.3.1",
124
124
  "eslint-plugin-ft-flow": "^3.0.11",
125
125
  "eslint-plugin-import": "^2.31.0",
126
- "eslint-plugin-jest": "^28.8.3",
127
- "eslint-plugin-jsdoc": "^50.4.3",
126
+ "eslint-plugin-jest": "^28.9.0",
127
+ "eslint-plugin-jsdoc": "^50.5.0",
128
128
  "eslint-plugin-react": "^7.37.2",
129
129
  "eslint-plugin-react-hooks": "^5.0.0",
130
130
  "eslint-plugin-you-dont-need-lodash-underscore": "^6.14.0",
@@ -133,12 +133,12 @@
133
133
  "flow-typed": "^3.9.0",
134
134
  "hermes-eslint": "^0.25.0",
135
135
  "history": "^4.0.0",
136
- "husky": "^9.1.6",
136
+ "husky": "^9.1.7",
137
137
  "jest": "^29.7.0",
138
138
  "jest-environment-jsdom": "^29.7.0",
139
139
  "jest-junit": "^16.0.0",
140
140
  "jest-sonar-reporter": "^2.0.0",
141
- "jscodeshift": "^17.0.0",
141
+ "jscodeshift": "^17.1.1",
142
142
  "lint-staged": "^15.2.10",
143
143
  "polished": "^4.0.0",
144
144
  "prettier": "^3.3.3",
@@ -23,6 +23,7 @@ import {
23
23
  useModelCatalog,
24
24
  useContentType,
25
25
  } from "../useModelCatalog";
26
+ import { DateUtil } from "../../utils";
26
27
 
27
28
  const middlewares = [thunk];
28
29
  const mockStore = configureMockStore(middlewares);
@@ -68,7 +69,7 @@ describe("modelcatalog hooks", () => {
68
69
  {
69
70
  type: "MODULARUI/FETCH",
70
71
  payload: expect.objectContaining({
71
- key: `${key}(${url})(en)`,
72
+ key: `${key}(${url.split("?")[0]})(en)`,
72
73
  href: new Href(url),
73
74
  locale: "en",
74
75
  targetModel: targetModel,
@@ -106,7 +107,7 @@ describe("modelcatalog hooks", () => {
106
107
  assertTargetModel(
107
108
  () => useConceptIndex("/conceptindex"),
108
109
  "conceptindex",
109
- "/conceptindex",
110
+ "/conceptindex?entryDate=" + DateUtil.now(),
110
111
  ConceptIndexModel,
111
112
  );
112
113
  });
@@ -116,7 +117,7 @@ describe("modelcatalog hooks", () => {
116
117
  assertTargetModel(
117
118
  () => useConceptDetail("/conceptdetail"),
118
119
  "conceptdetail",
119
- "/concepts/conceptdetail",
120
+ "/concepts/conceptdetail?entryDate=" + DateUtil.now(),
120
121
  );
121
122
  });
122
123
 
@@ -135,7 +136,7 @@ describe("modelcatalog hooks", () => {
135
136
  assertTargetModel(
136
137
  () => useContentTOC("/contenttoc"),
137
138
  "contenttoc",
138
- "/content/contenttoc",
139
+ "/content/contenttoc?entryDate=" + DateUtil.now(),
139
140
  ContentTOCModel,
140
141
  );
141
142
  });
@@ -145,7 +146,7 @@ describe("modelcatalog hooks", () => {
145
146
  assertTargetModel(
146
147
  () => useContent("/contentdetail"),
147
148
  "content",
148
- "/content/contentdetail",
149
+ "/content/contentdetail?entryDate=" + DateUtil.now(),
149
150
  ContentModel,
150
151
  );
151
152
  });
@@ -155,7 +156,7 @@ describe("modelcatalog hooks", () => {
155
156
  assertTargetModel(
156
157
  () => useContentType("/contenttypes/contenttype"),
157
158
  "contenttypes",
158
- "/contenttypes/contenttype",
159
+ "/contenttypes/contenttype?entryDate=" + DateUtil.now(),
159
160
  ContentTypeModel,
160
161
  );
161
162
  });