@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.
- package/CHANGELOG.md +14 -0
- package/esm/hooks/useModelCatalog.js +36 -5
- package/esm/hooks/useModelCatalog.js.map +1 -1
- package/esm/models/concepts/ConceptDetailModel.js +1 -1
- package/esm/models/concepts/ConceptDetailModel.js.map +1 -1
- package/esm/models/concepts/ConceptIndexModel.js +1 -1
- package/esm/models/concepts/ConceptIndexModel.js.map +1 -1
- package/esm/models/content/ContentModel.js +1 -1
- package/esm/models/content/ContentModel.js.map +1 -1
- package/esm/models/content/ContentTOCModel.js +1 -1
- package/esm/models/content/ContentTOCModel.js.map +1 -1
- package/esm/models/user/UserServicesModel.js +2 -1
- package/esm/models/user/UserServicesModel.js.map +1 -1
- package/esm/modularui/Authenticate.js +4 -1
- package/esm/modularui/Authenticate.js.map +1 -1
- package/esm/redux/actions/EntryDate.js +8 -0
- package/esm/redux/actions/EntryDate.js.map +1 -0
- package/esm/redux/actions/index.js +1 -0
- package/esm/redux/actions/index.js.map +1 -1
- package/esm/redux/reducers/ModelCatalogReducer.js +36 -0
- package/esm/redux/reducers/ModelCatalogReducer.js.map +1 -0
- package/esm/redux/reducers/createReducer.js +2 -0
- package/esm/redux/reducers/createReducer.js.map +1 -1
- package/esm/redux/reducers/index.js +1 -0
- package/esm/redux/reducers/index.js.map +1 -1
- package/esm/redux/selectors/index.js +1 -0
- package/esm/redux/selectors/index.js.map +1 -1
- package/esm/redux/selectors/modelcatalog.js +8 -0
- package/esm/redux/selectors/modelcatalog.js.map +1 -0
- package/esm/redux/types.js.map +1 -1
- package/esm/utils/helpers/createHref.js +10 -7
- package/esm/utils/helpers/createHref.js.map +1 -1
- package/lib/hooks/__tests__/useModelCatalog.spec.js.flow +7 -6
- package/lib/hooks/useModelCatalog.js +38 -6
- package/lib/hooks/useModelCatalog.js.flow +39 -5
- package/lib/hooks/useModelCatalog.js.map +1 -1
- package/lib/models/concepts/ConceptDetailModel.js +1 -1
- package/lib/models/concepts/ConceptDetailModel.js.flow +1 -1
- package/lib/models/concepts/ConceptDetailModel.js.map +1 -1
- package/lib/models/concepts/ConceptIndexModel.js +1 -1
- package/lib/models/concepts/ConceptIndexModel.js.flow +1 -1
- package/lib/models/concepts/ConceptIndexModel.js.map +1 -1
- package/lib/models/content/ContentModel.js +1 -1
- package/lib/models/content/ContentModel.js.flow +1 -1
- package/lib/models/content/ContentModel.js.map +1 -1
- package/lib/models/content/ContentTOCModel.js +1 -1
- package/lib/models/content/ContentTOCModel.js.flow +1 -1
- package/lib/models/content/ContentTOCModel.js.map +1 -1
- package/lib/models/user/UserServicesModel.js +2 -1
- package/lib/models/user/UserServicesModel.js.flow +6 -1
- package/lib/models/user/UserServicesModel.js.map +1 -1
- package/lib/modularui/Authenticate.js +4 -1
- package/lib/modularui/Authenticate.js.flow +4 -1
- package/lib/modularui/Authenticate.js.map +1 -1
- package/lib/redux/actions/EntryDate.js +15 -0
- package/lib/redux/actions/EntryDate.js.flow +12 -0
- package/lib/redux/actions/EntryDate.js.map +1 -0
- package/lib/redux/actions/index.js +11 -0
- package/lib/redux/actions/index.js.flow +1 -0
- package/lib/redux/actions/index.js.map +1 -1
- package/lib/redux/reducers/ModelCatalogReducer.js +43 -0
- package/lib/redux/reducers/ModelCatalogReducer.js.flow +46 -0
- package/lib/redux/reducers/ModelCatalogReducer.js.map +1 -0
- package/lib/redux/reducers/createReducer.js +2 -0
- package/lib/redux/reducers/createReducer.js.flow +4 -0
- package/lib/redux/reducers/createReducer.js.map +1 -1
- package/lib/redux/reducers/index.js +8 -0
- package/lib/redux/reducers/index.js.flow +1 -0
- package/lib/redux/reducers/index.js.map +1 -1
- package/lib/redux/selectors/index.js +11 -0
- package/lib/redux/selectors/index.js.flow +1 -0
- package/lib/redux/selectors/index.js.map +1 -1
- package/lib/redux/selectors/modelcatalog.js +15 -0
- package/lib/redux/selectors/modelcatalog.js.flow +11 -0
- package/lib/redux/selectors/modelcatalog.js.map +1 -0
- package/lib/redux/types.js.flow +11 -0
- package/lib/redux/types.js.map +1 -1
- package/lib/utils/helpers/__tests__/createHref.spec.js.flow +13 -9
- package/lib/utils/helpers/createHref.js +10 -7
- package/lib/utils/helpers/createHref.js.flow +17 -9
- package/lib/utils/helpers/createHref.js.map +1 -1
- package/package.json +8 -8
- package/src/hooks/__tests__/useModelCatalog.spec.js +7 -6
- package/src/hooks/useModelCatalog.js +39 -5
- package/src/models/concepts/ConceptDetailModel.js +1 -1
- package/src/models/concepts/ConceptIndexModel.js +1 -1
- package/src/models/content/ContentModel.js +1 -1
- package/src/models/content/ContentTOCModel.js +1 -1
- package/src/models/user/UserServicesModel.js +6 -1
- package/src/modularui/Authenticate.js +4 -1
- package/src/redux/actions/EntryDate.js +12 -0
- package/src/redux/actions/index.js +1 -0
- package/src/redux/reducers/ModelCatalogReducer.js +46 -0
- package/src/redux/reducers/createReducer.js +4 -0
- package/src/redux/reducers/index.js +1 -0
- package/src/redux/selectors/index.js +1 -0
- package/src/redux/selectors/modelcatalog.js +11 -0
- package/src/redux/types.js +11 -0
- package/src/utils/helpers/__tests__/createHref.spec.js +13 -9
- package/src/utils/helpers/createHref.js +17 -9
- package/types/models/concepts/ConceptDetailModel.d.ts +1 -1
- package/types/models/concepts/ConceptIndexModel.d.ts +1 -1
- package/types/models/content/ContentModel.d.ts +1 -1
- package/types/models/content/ContentTOCModel.d.ts +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":[],"sources":["../../../src/redux/actions/index.js"],"sourcesContent":["// @flow\nexport * from \"./Application\";\nexport * from \"./Authorization\";\nexport * from \"./Error\";\nexport * from \"./Form\";\nexport * from \"./FormAttributeSet\";\nexport * from \"./FormAttributeSetRepeatable\";\nexport * from \"./FormAutosave\";\nexport * from \"./FormAutosubmit\";\nexport * from \"./FormValidations\";\nexport * from \"./Modals\";\nexport * from \"./Notification\";\nexport * from \"./Preferences\";\nexport * from \"./ProgressIndicator\";\nexport * from \"./SignIn\";\nexport * from \"./SignOut\";\n"],"mappings":"AACA,cAAc,eAAe;AAC7B,cAAc,iBAAiB;AAC/B,cAAc,SAAS;AACvB,cAAc,QAAQ;AACtB,cAAc,oBAAoB;AAClC,cAAc,8BAA8B;AAC5C,cAAc,gBAAgB;AAC9B,cAAc,kBAAkB;AAChC,cAAc,mBAAmB;AACjC,cAAc,UAAU;AACxB,cAAc,gBAAgB;AAC9B,cAAc,eAAe;AAC7B,cAAc,qBAAqB;AACnC,cAAc,UAAU;AACxB,cAAc,WAAW","ignoreList":[]}
|
|
1
|
+
{"version":3,"file":"index.js","names":[],"sources":["../../../src/redux/actions/index.js"],"sourcesContent":["// @flow\nexport * from \"./Application\";\nexport * from \"./Authorization\";\nexport * from \"./EntryDate\";\nexport * from \"./Error\";\nexport * from \"./Form\";\nexport * from \"./FormAttributeSet\";\nexport * from \"./FormAttributeSetRepeatable\";\nexport * from \"./FormAutosave\";\nexport * from \"./FormAutosubmit\";\nexport * from \"./FormValidations\";\nexport * from \"./Modals\";\nexport * from \"./Notification\";\nexport * from \"./Preferences\";\nexport * from \"./ProgressIndicator\";\nexport * from \"./SignIn\";\nexport * from \"./SignOut\";\n"],"mappings":"AACA,cAAc,eAAe;AAC7B,cAAc,iBAAiB;AAC/B,cAAc,aAAa;AAC3B,cAAc,SAAS;AACvB,cAAc,QAAQ;AACtB,cAAc,oBAAoB;AAClC,cAAc,8BAA8B;AAC5C,cAAc,gBAAgB;AAC9B,cAAc,kBAAkB;AAChC,cAAc,mBAAmB;AACjC,cAAc,UAAU;AACxB,cAAc,gBAAgB;AAC9B,cAAc,eAAe;AAC7B,cAAc,qBAAqB;AACnC,cAAc,UAAU;AACxB,cAAc,WAAW","ignoreList":[]}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import _URLSearchParams from "@babel/runtime-corejs3/core-js-stable/url-search-params";
|
|
2
|
+
import { DateUtil } from "../../utils";
|
|
3
|
+
import Cache from "../../utils/browser/Cache";
|
|
4
|
+
const getQueryParam = paramName => {
|
|
5
|
+
if (typeof window !== "undefined") {
|
|
6
|
+
const urlParams = new _URLSearchParams(window.location?.search);
|
|
7
|
+
return urlParams.get(paramName);
|
|
8
|
+
}
|
|
9
|
+
return null;
|
|
10
|
+
};
|
|
11
|
+
const initialState = {
|
|
12
|
+
entryDate: getQueryParam("entryDate") || Cache.getItem("ModelCatalogEntryDate") || DateUtil.now()
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* Keep track of the entry date for the modelcatalog
|
|
17
|
+
*/
|
|
18
|
+
const ModelCatalogReducer = function () {
|
|
19
|
+
let state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : initialState;
|
|
20
|
+
let action = arguments.length > 1 ? arguments[1] : undefined;
|
|
21
|
+
if (!action) {
|
|
22
|
+
return state;
|
|
23
|
+
}
|
|
24
|
+
switch (action.type) {
|
|
25
|
+
case "UPDATE_ENTRYDATE":
|
|
26
|
+
Cache.addItem("ModelCatalogEntryDate", action.payload);
|
|
27
|
+
return {
|
|
28
|
+
...state,
|
|
29
|
+
entryDate: action.payload
|
|
30
|
+
};
|
|
31
|
+
default:
|
|
32
|
+
return state;
|
|
33
|
+
}
|
|
34
|
+
};
|
|
35
|
+
export default ModelCatalogReducer;
|
|
36
|
+
//# sourceMappingURL=ModelCatalogReducer.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ModelCatalogReducer.js","names":["DateUtil","Cache","getQueryParam","paramName","window","urlParams","_URLSearchParams","location","search","get","initialState","entryDate","getItem","now","ModelCatalogReducer","state","arguments","length","undefined","action","type","addItem","payload"],"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,SAASA,QAAQ,QAAQ,aAAa;AACtC,OAAOC,KAAK,MAAM,2BAA2B;AAK7C,MAAMC,aAAa,GAAIC,SAAiB,IAAc;EACpD,IAAI,OAAOC,MAAM,KAAK,WAAW,EAAE;IACjC,MAAMC,SAAS,GAAG,IAAAC,gBAAA,CAAoBF,MAAM,CAACG,QAAQ,EAAEC,MAAM,CAAC;IAC9D,OAAOH,SAAS,CAACI,GAAG,CAACN,SAAS,CAAC;EACjC;EACA,OAAO,IAAI;AACb,CAAC;AAED,MAAMO,YAA+B,GAAG;EACtCC,SAAS,EACPT,aAAa,CAAC,WAAW,CAAC,IAC1BD,KAAK,CAACW,OAAO,CAAC,uBAAuB,CAAC,IACtCZ,QAAQ,CAACa,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,MAAGN,YAAY;EAAA,IACpBS,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;MACrBnB,KAAK,CAACoB,OAAO,CAAC,uBAAuB,EAAEF,MAAM,CAACG,OAAO,CAAC;MACtD,OAAO;QACL,GAAGP,KAAK;QACRJ,SAAS,EAAEQ,MAAM,CAACG;MACpB,CAAC;IACH;MACE,OAAOP,KAAK;EAChB;AACF,CAAC;AAED,eAAeD,mBAAmB","ignoreList":[]}
|
|
@@ -4,6 +4,7 @@ import { I18nReducer } from "../_i18n/I18nReducer";
|
|
|
4
4
|
import ModalsReducer from "./ModalsReducer";
|
|
5
5
|
import AuthReducer from "./AuthReducer";
|
|
6
6
|
import ErrorReducer from "./ErrorReducer";
|
|
7
|
+
import ModelCatalogReducer from "./ModelCatalogReducer";
|
|
7
8
|
import NotificationReducer from "./NotificationReducer";
|
|
8
9
|
import ProgressIndicatorReducer from "./ProgressIndicatorReducer";
|
|
9
10
|
import PreferencesReducer from "./PreferencesReducer";
|
|
@@ -16,6 +17,7 @@ export const createReducer = () => ({
|
|
|
16
17
|
auth: AuthReducer,
|
|
17
18
|
error: ErrorReducer,
|
|
18
19
|
modals: ModalsReducer,
|
|
20
|
+
modelcatalog: ModelCatalogReducer,
|
|
19
21
|
notification: NotificationReducer,
|
|
20
22
|
progressindicator: ProgressIndicatorReducer,
|
|
21
23
|
preferences: PreferencesReducer
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createReducer.js","names":["RouterReducer","ModularUIReducer","I18nReducer","ModalsReducer","AuthReducer","ErrorReducer","NotificationReducer","ProgressIndicatorReducer","PreferencesReducer","createReducer","router","modularui","i18n","auth","error","modals","notification","progressindicator","preferences"],"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,SAASA,aAAa,QAAQ,0BAA0B;AACxD,SAASC,gBAAgB,QAAQ,gCAAgC;AACjE,SAASC,WAAW,QAAQ,sBAAsB;AAElD,OAAOC,aAAa,MAAM,iBAAiB;AAC3C,OAAOC,WAAW,MAAM,eAAe;AACvC,OAAOC,YAAY,MAAM,gBAAgB;AACzC,OAAOC,mBAAmB,MAAM,uBAAuB;AACvD,OAAOC,wBAAwB,MAAM,4BAA4B;AACjE,OAAOC,kBAAkB,MAAM,sBAAsB;
|
|
1
|
+
{"version":3,"file":"createReducer.js","names":["RouterReducer","ModularUIReducer","I18nReducer","ModalsReducer","AuthReducer","ErrorReducer","ModelCatalogReducer","NotificationReducer","ProgressIndicatorReducer","PreferencesReducer","createReducer","router","modularui","i18n","auth","error","modals","modelcatalog","notification","progressindicator","preferences"],"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,SAASA,aAAa,QAAQ,0BAA0B;AACxD,SAASC,gBAAgB,QAAQ,gCAAgC;AACjE,SAASC,WAAW,QAAQ,sBAAsB;AAElD,OAAOC,aAAa,MAAM,iBAAiB;AAC3C,OAAOC,WAAW,MAAM,eAAe;AACvC,OAAOC,YAAY,MAAM,gBAAgB;AACzC,OAAOC,mBAAmB,MAAM,uBAAuB;AACvD,OAAOC,mBAAmB,MAAM,uBAAuB;AACvD,OAAOC,wBAAwB,MAAM,4BAA4B;AACjE,OAAOC,kBAAkB,MAAM,sBAAsB;AA8BrD;AACA;AACA,OAAO,MAAMC,aAAa,GAAGA,CAAA,MAAiB;EAC5CC,MAAM,EAAEX,aAAa;EACrBY,SAAS,EAAEX,gBAAgB;EAC3BY,IAAI,EAAEX,WAAW;EACjBY,IAAI,EAAEV,WAAW;EACjBW,KAAK,EAAEV,YAAY;EACnBW,MAAM,EAAEb,aAAa;EACrBc,YAAY,EAAEX,mBAAmB;EACjCY,YAAY,EAAEX,mBAAmB;EACjCY,iBAAiB,EAAEX,wBAAwB;EAC3CY,WAAW,EAAEX;AACf,CAAC,CAAC","ignoreList":[]}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
export * from "./createReducer";
|
|
2
2
|
export { default as AuthReducer } from "./AuthReducer";
|
|
3
|
+
export { default as ModelCatalogReducer } from "./ModelCatalogReducer";
|
|
3
4
|
export { default as ErrorReducer } from "./ErrorReducer";
|
|
4
5
|
export { default as ModalsReducer } from "./ModalsReducer";
|
|
5
6
|
export { default as NotificationReducer } from "./NotificationReducer";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["default","AuthReducer","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,cAAc,iBAAiB;AAE/B,SAASA,OAAO,IAAIC,WAAW,QAAQ,eAAe;AACtD,SAASD,OAAO,IAAIE,YAAY,QAAQ,gBAAgB;AACxD,
|
|
1
|
+
{"version":3,"file":"index.js","names":["default","AuthReducer","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,cAAc,iBAAiB;AAE/B,SAASA,OAAO,IAAIC,WAAW,QAAQ,eAAe;AACtD,SAASD,OAAO,IAAIE,mBAAmB,QAAQ,uBAAuB;AACtE,SAASF,OAAO,IAAIG,YAAY,QAAQ,gBAAgB;AACxD,SAASH,OAAO,IAAII,aAAa,QAAQ,iBAAiB;AAC1D,SAASJ,OAAO,IAAIK,mBAAmB,QAAQ,uBAAuB;AACtE,SAASL,OAAO,IAAIM,kBAAkB,QAAQ,sBAAsB;AACpE,SAASN,OAAO,IAAIO,wBAAwB,QAAQ,4BAA4B","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":[],"sources":["../../../src/redux/selectors/index.js"],"sourcesContent":["// @flow\nexport * from \"./i18n\";\n"],"mappings":"AACA,cAAc,QAAQ","ignoreList":[]}
|
|
1
|
+
{"version":3,"file":"index.js","names":[],"sources":["../../../src/redux/selectors/index.js"],"sourcesContent":["// @flow\nexport * from \"./i18n\";\nexport * from \"./modelcatalog\";\n"],"mappings":"AACA,cAAc,QAAQ;AACtB,cAAc,gBAAgB","ignoreList":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"modelcatalog.js","names":["DateUtil","getEntryDate","state","modelcatalog","entryDate","now"],"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,SAASA,QAAQ,QAAQ,aAAa;AAItC;AACA;AACA;AACA,OAAO,MAAMC,YAAY,GAAIC,KAAiB,IAAe;EAC3D,OAAOA,KAAK,CAACC,YAAY,EAAEC,SAAS,IAAIJ,QAAQ,CAACK,GAAG,CAAC,CAAC;AACxD,CAAC","ignoreList":[]}
|
package/esm/redux/types.js.map
CHANGED
|
@@ -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":[]}
|
|
@@ -66,7 +66,7 @@ export const filterParameters = (href, allowedParameters) => {
|
|
|
66
66
|
|
|
67
67
|
/**
|
|
68
68
|
*/
|
|
69
|
-
export const createHref = (context, dynamicPart, location, allowedParameters) => {
|
|
69
|
+
export const createHref = (context, dynamicPart, entryDate, location, allowedParameters) => {
|
|
70
70
|
let href = dynamicPart.toString();
|
|
71
71
|
if (!_startsWithInstanceProperty(href).call(href, `/${context}/`)) {
|
|
72
72
|
href = `/${context}/${href}`;
|
|
@@ -77,12 +77,15 @@ export const createHref = (context, dynamicPart, location, allowedParameters) =>
|
|
|
77
77
|
const search = _startsWithInstanceProperty(_context = location.search).call(_context, "?") ? location.search.substring(1) : location.search;
|
|
78
78
|
href = `${href}?${search}`;
|
|
79
79
|
}
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
80
|
+
const finalHref = dynamicPart instanceof Href ? filterParameters(new Href(href, dynamicPart.resourcetype, {
|
|
81
|
+
origin: dynamicPart.origin,
|
|
82
|
+
contextPath: dynamicPart.contextPath
|
|
83
|
+
}), allowedParameters) : filterParameters(href, allowedParameters);
|
|
84
|
+
if (entryDate) {
|
|
85
|
+
finalHref.setParameter("entryDate", entryDate);
|
|
86
|
+
} else {
|
|
87
|
+
finalHref.removeParameter("entryDate");
|
|
85
88
|
}
|
|
86
|
-
return
|
|
89
|
+
return finalHref;
|
|
87
90
|
};
|
|
88
91
|
//# sourceMappingURL=createHref.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createHref.js","names":["Href","parseUrl","href","path","querystring","hash","_includesInstanceProperty","call","hashSplit","split","qsSplit","filterParameters","allowedParameters","Array","isArray","url","filteredUrl","searchParams","_URLSearchParams","params","_Array$from","_keysInstanceProperty","param","delete","toString","resourcetype","origin","contextPath","createHref","context","dynamicPart","location","_startsWithInstanceProperty","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
|
|
1
|
+
{"version":3,"file":"createHref.js","names":["Href","parseUrl","href","path","querystring","hash","_includesInstanceProperty","call","hashSplit","split","qsSplit","filterParameters","allowedParameters","Array","isArray","url","filteredUrl","searchParams","_URLSearchParams","params","_Array$from","_keysInstanceProperty","param","delete","toString","resourcetype","origin","contextPath","createHref","context","dynamicPart","entryDate","location","_startsWithInstanceProperty","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,OAAOA,IAAI,MAAM,wBAAwB;AAIzC;AACA;AACA,OAAO,MAAMC,QAAQ,GACnBC,IAAmB,IACmD;EACtE,IAAIA,IAAI,YAAYF,IAAI,EAAE;IACxB,OAAO;MACLG,IAAI,EAAED,IAAI,CAACC,IAAI;MACfC,WAAW,EAAEF,IAAI,CAACE,WAAW;MAC7BC,IAAI,EAAEH,IAAI,CAACG;IACb,CAAC;EACH;EAEA,IAAIF,IAAI,GAAGD,IAAI;EACf,IAAIG,IAAI,GAAG,IAAI;EACf,IAAID,WAAW,GAAG,IAAI;EACtB,IAAIE,yBAAA,CAAAJ,IAAI,EAAAK,IAAA,CAAJL,IAAI,EAAU,GAAG,CAAC,EAAE;IACtB,MAAMM,SAAS,GAAGN,IAAI,CAACO,KAAK,CAAC,GAAG,CAAC;IACjCN,IAAI,GAAGK,SAAS,CAAC,CAAC,CAAC;IACnBH,IAAI,GAAGG,SAAS,CAAC,CAAC,CAAC;EACrB;EACA,IAAIF,yBAAA,CAAAJ,IAAI,EAAAK,IAAA,CAAJL,IAAI,EAAU,GAAG,CAAC,EAAE;IACtB,MAAMQ,OAAO,GAAGP,IAAI,CAACM,KAAK,CAAC,GAAG,CAAC;IAC/BN,IAAI,GAAGO,OAAO,CAAC,CAAC,CAAC;IACjBN,WAAW,GAAGM,OAAO,CAAC,CAAC,CAAC;EAC1B;EACA,OAAO;IACLP,IAAI;IACJC,WAAW;IACXC;EACF,CAAC;AACH,CAAC;;AAED;AACA;AACA,OAAO,MAAMM,gBAAgB,GAAGA,CAC9BT,IAAmB,EACnBU,iBAAiC,KACxB;EACT,IAAI,CAACC,KAAK,CAACC,OAAO,CAACF,iBAAiB,CAAC,EAAE;IACrC,OAAO,IAAIZ,IAAI,CAACE,IAAI,CAAC;EACvB;EAEA,MAAM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C,EAAE;IACpC3B,IAAI,GAAG,IAAI2B,OAAO,IAAI3B,IAAI,EAAE;EAC9B;EAEAA,IAAI,GAAGA,IAAI,CAACgC,OAAO,CAAC,OAAO,EAAE,GAAG,CAAC;EAEjC,IAAIF,QAAQ,EAAEG,MAAM,IAAI,CAAC7B,yBAAA,CAAAJ,IAAI,EAAAK,IAAA,CAAJL,IAAI,EAAU,GAAG,CAAC,EAAE;IAAA,IAAAkC,QAAA;IAC3C,MAAMD,MAAM,GAAGF,2BAAA,CAAAG,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;IACnBjC,IAAI,GAAG,GAAGA,IAAI,IAAIiC,MAAM,EAAE;EAC5B;EAEA,MAAMG,SAAS,GACbR,WAAW,YAAY9B,IAAI,GACvBW,gBAAgB,CACd,IAAIX,IAAI,CAACE,IAAI,EAAE4B,WAAW,CAACL,YAAY,EAAE;IACvCC,MAAM,EAAEI,WAAW,CAACJ,MAAM;IAC1BC,WAAW,EAAEG,WAAW,CAACH;EAC3B,CAAC,CAAC,EACFf,iBACF,CAAC,GACDD,gBAAgB,CAACT,IAAI,EAAEU,iBAAiB,CAAC;EAE/C,IAAImB,SAAS,EAAE;IACbO,SAAS,CAACC,YAAY,CAAC,WAAW,EAAER,SAAS,CAAC;EAChD,CAAC,MAAM;IACLO,SAAS,CAACE,eAAe,CAAC,WAAW,CAAC;EACxC;EAEA,OAAOF,SAAS;AAClB,CAAC","ignoreList":[]}
|
|
@@ -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
|
});
|
|
@@ -4,8 +4,9 @@ var _interopRequireDefault = require("@babel/runtime-corejs3/helpers/interopRequ
|
|
|
4
4
|
Object.defineProperty(exports, "__esModule", {
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
7
|
-
exports.useModelCatalog = exports.useContentType = exports.useContentTOC = exports.useContentSearch = exports.useContentIndex = exports.useContent = exports.useConceptSearch = exports.useConceptIndex = exports.useConceptDetail = void 0;
|
|
7
|
+
exports.useModelCatalog = exports.useEntryDate = exports.useContentType = exports.useContentTOC = exports.useContentSearch = exports.useContentIndex = exports.useContent = exports.useConceptSearch = exports.useConceptIndex = exports.useConceptDetail = void 0;
|
|
8
8
|
var _keys = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/object/keys"));
|
|
9
|
+
var _reactRedux = require("react-redux");
|
|
9
10
|
var _useRouter = require("./useRouter");
|
|
10
11
|
var _createHref = require("../utils/helpers/createHref");
|
|
11
12
|
var _ModelCatalogModel = _interopRequireDefault(require("../models/modelcatalog/ModelCatalogModel"));
|
|
@@ -17,6 +18,8 @@ var _ContentTOCModel = _interopRequireDefault(require("../models/content/Content
|
|
|
17
18
|
var _ContentModel = _interopRequireDefault(require("../models/content/ContentModel"));
|
|
18
19
|
var _useModularUIBasic = require("./useModularUIBasic");
|
|
19
20
|
var _models = require("../models");
|
|
21
|
+
var _modelcatalog = require("../redux/selectors/modelcatalog");
|
|
22
|
+
var _EntryDate = require("../redux/actions/EntryDate");
|
|
20
23
|
/**
|
|
21
24
|
*/
|
|
22
25
|
const useModelCatalog = options => (0, _useModularUIBasic.useModularUIBasic)("modelcatalog", "/modelcatalog", {
|
|
@@ -31,7 +34,11 @@ exports.useModelCatalog = useModelCatalog;
|
|
|
31
34
|
const useConceptIndex = function (href) {
|
|
32
35
|
let key = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : "conceptindex";
|
|
33
36
|
let options = arguments.length > 2 ? arguments[2] : undefined;
|
|
34
|
-
const
|
|
37
|
+
const {
|
|
38
|
+
entryDate
|
|
39
|
+
} = useEntryDate();
|
|
40
|
+
const url = (0, _createHref.filterParameters)(href, ["index", "label", "modelcategory", "type"]);
|
|
41
|
+
url.setParameter("entryDate", entryDate);
|
|
35
42
|
return (0, _useModularUIBasic.useModularUIBasic)(key, url, {
|
|
36
43
|
expectedModels: ["ConceptIndex"],
|
|
37
44
|
targetModel: _ConceptIndexModel.default,
|
|
@@ -45,8 +52,11 @@ exports.useConceptIndex = useConceptIndex;
|
|
|
45
52
|
const useConceptDetail = function (concept) {
|
|
46
53
|
let key = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : "conceptdetail";
|
|
47
54
|
let options = arguments.length > 2 ? arguments[2] : undefined;
|
|
55
|
+
const {
|
|
56
|
+
entryDate
|
|
57
|
+
} = useEntryDate();
|
|
48
58
|
const location = (0, _useRouter.useLocation)();
|
|
49
|
-
const href = (0, _createHref.createHref)("concepts", concept, location, [
|
|
59
|
+
const href = (0, _createHref.createHref)("concepts", concept, entryDate, location, []);
|
|
50
60
|
return (0, _useModularUIBasic.useModularUIBasic)(key, href, {
|
|
51
61
|
expectedModels: ["ConceptDetail", "BusinessScenario"],
|
|
52
62
|
...options
|
|
@@ -73,8 +83,11 @@ exports.useContentIndex = useContentIndex;
|
|
|
73
83
|
const useContentTOC = function (content) {
|
|
74
84
|
let key = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : "contenttoc";
|
|
75
85
|
let options = arguments.length > 2 ? arguments[2] : undefined;
|
|
86
|
+
const {
|
|
87
|
+
entryDate
|
|
88
|
+
} = useEntryDate();
|
|
76
89
|
const location = (0, _useRouter.useLocation)();
|
|
77
|
-
const href = (0, _createHref.createHref)("content", content, location, [
|
|
90
|
+
const href = (0, _createHref.createHref)("content", content, entryDate, location, []);
|
|
78
91
|
return (0, _useModularUIBasic.useModularUIBasic)(key, href, {
|
|
79
92
|
expectedModels: ["ContentTOC"],
|
|
80
93
|
targetModel: _ContentTOCModel.default,
|
|
@@ -88,7 +101,10 @@ exports.useContentTOC = useContentTOC;
|
|
|
88
101
|
const useContent = function (contentSection) {
|
|
89
102
|
let key = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : "content";
|
|
90
103
|
let options = arguments.length > 2 ? arguments[2] : undefined;
|
|
91
|
-
const
|
|
104
|
+
const {
|
|
105
|
+
entryDate
|
|
106
|
+
} = useEntryDate();
|
|
107
|
+
const href = (0, _createHref.createHref)("content", contentSection, entryDate, null, []);
|
|
92
108
|
return (0, _useModularUIBasic.useModularUIBasic)(key, href, {
|
|
93
109
|
expectedModels: ["Content"],
|
|
94
110
|
targetModel: _ContentModel.default,
|
|
@@ -102,7 +118,10 @@ exports.useContent = useContent;
|
|
|
102
118
|
const useContentType = function (contentType) {
|
|
103
119
|
let key = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : "contenttypes";
|
|
104
120
|
let options = arguments.length > 2 ? arguments[2] : undefined;
|
|
105
|
-
const
|
|
121
|
+
const {
|
|
122
|
+
entryDate
|
|
123
|
+
} = useEntryDate();
|
|
124
|
+
const href = (0, _createHref.createHref)("contenttypes", contentType, entryDate, null, []);
|
|
106
125
|
return (0, _useModularUIBasic.useModularUIBasic)(key, href, {
|
|
107
126
|
expectedModels: ["ContentType"],
|
|
108
127
|
targetModel: _models.ContentTypeModel,
|
|
@@ -146,5 +165,18 @@ const useContentSearch = function (filters) {
|
|
|
146
165
|
const href = getSearchHref("/content", filters);
|
|
147
166
|
return useContentIndex(href, key, options);
|
|
148
167
|
};
|
|
168
|
+
|
|
169
|
+
/**
|
|
170
|
+
* Retrieve and update the entrydate for the modelcatalog
|
|
171
|
+
*/
|
|
149
172
|
exports.useContentSearch = useContentSearch;
|
|
173
|
+
const useEntryDate = () => {
|
|
174
|
+
const dispatch = (0, _reactRedux.useDispatch)();
|
|
175
|
+
const entryDate = (0, _reactRedux.useSelector)(_modelcatalog.getEntryDate);
|
|
176
|
+
return {
|
|
177
|
+
entryDate,
|
|
178
|
+
setEntryDate: entryDate => dispatch((0, _EntryDate.updateEntryDate)(entryDate))
|
|
179
|
+
};
|
|
180
|
+
};
|
|
181
|
+
exports.useEntryDate = useEntryDate;
|
|
150
182
|
//# sourceMappingURL=useModelCatalog.js.map
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
// @flow
|
|
2
|
+
import { useSelector, useDispatch } from "react-redux";
|
|
2
3
|
import { useLocation } from "./useRouter";
|
|
3
4
|
|
|
4
5
|
import { createHref, filterParameters } from "../utils/helpers/createHref";
|
|
@@ -14,8 +15,12 @@ import ContentModel from "../models/content/ContentModel";
|
|
|
14
15
|
import { useModularUIBasic } from "./useModularUIBasic";
|
|
15
16
|
import { ContentTypeModel } from "../models";
|
|
16
17
|
|
|
18
|
+
import { getEntryDate } from "../redux/selectors/modelcatalog";
|
|
19
|
+
import { updateEntryDate } from "../redux/actions/EntryDate";
|
|
20
|
+
|
|
17
21
|
import type Href from "../models/href/Href";
|
|
18
22
|
import type { UseModularUIBasicOptions } from "./useModularUIBasic";
|
|
23
|
+
import type { UpdateEntryDateAction } from "../redux";
|
|
19
24
|
export type SearchFilter = {
|
|
20
25
|
index?: string,
|
|
21
26
|
label?: string,
|
|
@@ -42,13 +47,15 @@ export const useConceptIndex = (
|
|
|
42
47
|
key?: string = "conceptindex",
|
|
43
48
|
options?: UseModularUIBasicOptions<ConceptIndexModel>,
|
|
44
49
|
): ?ConceptIndexModel => {
|
|
50
|
+
const { entryDate } = useEntryDate();
|
|
45
51
|
const url = filterParameters(href, [
|
|
46
|
-
"entryDate",
|
|
47
52
|
"index",
|
|
48
53
|
"label",
|
|
49
54
|
"modelcategory",
|
|
50
55
|
"type",
|
|
51
56
|
]);
|
|
57
|
+
url.setParameter("entryDate", entryDate);
|
|
58
|
+
|
|
52
59
|
return useModularUIBasic(key, url, {
|
|
53
60
|
expectedModels: ["ConceptIndex"],
|
|
54
61
|
targetModel: ConceptIndexModel,
|
|
@@ -65,9 +72,11 @@ export const useConceptDetail = (
|
|
|
65
72
|
ConceptDetailModel | BusinessScenarioModel,
|
|
66
73
|
>,
|
|
67
74
|
): ?ConceptDetailModel | ?BusinessScenarioModel => {
|
|
75
|
+
const { entryDate } = useEntryDate();
|
|
68
76
|
const location = useLocation();
|
|
69
77
|
|
|
70
|
-
const href = createHref("concepts", concept, location, [
|
|
78
|
+
const href = createHref("concepts", concept, entryDate, location, []);
|
|
79
|
+
|
|
71
80
|
return useModularUIBasic(key, href, {
|
|
72
81
|
expectedModels: ["ConceptDetail", "BusinessScenario"],
|
|
73
82
|
...options,
|
|
@@ -96,8 +105,11 @@ export const useContentTOC = (
|
|
|
96
105
|
key?: string = "contenttoc",
|
|
97
106
|
options?: UseModularUIBasicOptions<ContentTOCModel>,
|
|
98
107
|
): ?ContentTOCModel => {
|
|
108
|
+
const { entryDate } = useEntryDate();
|
|
99
109
|
const location = useLocation();
|
|
100
|
-
|
|
110
|
+
|
|
111
|
+
const href = createHref("content", content, entryDate, location, []);
|
|
112
|
+
|
|
101
113
|
return useModularUIBasic(key, href, {
|
|
102
114
|
expectedModels: ["ContentTOC"],
|
|
103
115
|
targetModel: ContentTOCModel,
|
|
@@ -112,7 +124,10 @@ export const useContent = (
|
|
|
112
124
|
key?: string = "content",
|
|
113
125
|
options?: UseModularUIBasicOptions<ContentModel>,
|
|
114
126
|
): ?ContentModel => {
|
|
115
|
-
const
|
|
127
|
+
const { entryDate } = useEntryDate();
|
|
128
|
+
|
|
129
|
+
const href = createHref("content", contentSection, entryDate, null, []);
|
|
130
|
+
|
|
116
131
|
return useModularUIBasic(key, href, {
|
|
117
132
|
expectedModels: ["Content"],
|
|
118
133
|
targetModel: ContentModel,
|
|
@@ -127,7 +142,10 @@ export const useContentType = (
|
|
|
127
142
|
key?: string = "contenttypes",
|
|
128
143
|
options?: UseModularUIBasicOptions<ContentTypeModel>,
|
|
129
144
|
): ?ContentTypeModel => {
|
|
130
|
-
const
|
|
145
|
+
const { entryDate } = useEntryDate();
|
|
146
|
+
|
|
147
|
+
const href = createHref("contenttypes", contentType, entryDate, null, []);
|
|
148
|
+
|
|
131
149
|
return useModularUIBasic(key, href, {
|
|
132
150
|
expectedModels: ["ContentType"],
|
|
133
151
|
targetModel: ContentTypeModel,
|
|
@@ -177,3 +195,19 @@ export const useContentSearch = (
|
|
|
177
195
|
const href = getSearchHref("/content", filters);
|
|
178
196
|
return useContentIndex(href, key, options);
|
|
179
197
|
};
|
|
198
|
+
|
|
199
|
+
/**
|
|
200
|
+
* Retrieve and update the entrydate for the modelcatalog
|
|
201
|
+
*/
|
|
202
|
+
export const useEntryDate = (): ({
|
|
203
|
+
entryDate: ISO_DATE,
|
|
204
|
+
setEntryDate: (entryDate: ISO_DATE) => UpdateEntryDateAction,
|
|
205
|
+
}) => {
|
|
206
|
+
const dispatch = useDispatch();
|
|
207
|
+
const entryDate = useSelector(getEntryDate);
|
|
208
|
+
|
|
209
|
+
return {
|
|
210
|
+
entryDate,
|
|
211
|
+
setEntryDate: (entryDate: ISO_DATE) => dispatch(updateEntryDate(entryDate)),
|
|
212
|
+
};
|
|
213
|
+
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useModelCatalog.js","names":["_useRouter","require","_createHref","_ModelCatalogModel","_interopRequireDefault","_ConceptIndexModel","_ConceptDetailModel","_BusinessScenarioModel","_ContentIndexModel","_ContentTOCModel","_ContentModel","_useModularUIBasic","_models","useModelCatalog","options","useModularUIBasic","expectedModels","targetModel","ModelCatalogModel","exports","useConceptIndex","href","key","arguments","length","undefined","url","filterParameters","ConceptIndexModel","useConceptDetail","concept","location","useLocation","createHref","useContentIndex","ContentIndexModel","useContentTOC","content","ContentTOCModel","useContent","contentSection","ContentModel","useContentType","contentType","ContentTypeModel","getSearchHref","uri","filters","filterString","_keys","default","filterValue","value","Array","isArray","join","replace","push","useConceptSearch","useContentSearch"],"sources":["../../src/hooks/useModelCatalog.js"],"sourcesContent":["// @flow\nimport { useLocation } from \"./useRouter\";\n\nimport { createHref, filterParameters } from \"../utils/helpers/createHref\";\n\nimport ModelCatalogModel from \"../models/modelcatalog/ModelCatalogModel\";\nimport ConceptIndexModel from \"../models/concepts/ConceptIndexModel\";\nimport ConceptDetailModel from \"../models/concepts/ConceptDetailModel\";\nimport { default as BusinessScenarioModel } from \"../models/concepts/BusinessScenarioModel\";\nimport ContentIndexModel from \"../models/content/ContentIndexModel\";\nimport ContentTOCModel from \"../models/content/ContentTOCModel\";\nimport ContentModel from \"../models/content/ContentModel\";\n\nimport { useModularUIBasic } from \"./useModularUIBasic\";\nimport { ContentTypeModel } from \"../models\";\n\nimport type Href from \"../models/href/Href\";\nimport type { UseModularUIBasicOptions } from \"./useModularUIBasic\";\nexport type SearchFilter = {\n index?: string,\n label?: string,\n type?: string | Array<string>,\n modelCategory?: string | Array<string>,\n entryDate?: string,\n};\n\n/**\n */\nexport const useModelCatalog = (\n options?: UseModularUIBasicOptions<ModelCatalogModel>,\n): ?ModelCatalogModel =>\n useModularUIBasic(\"modelcatalog\", \"/modelcatalog\", {\n expectedModels: [\"ModelCatalog\"],\n targetModel: ModelCatalogModel,\n ...options,\n });\n\n/**\n */\nexport const useConceptIndex = (\n href: string | Href,\n key?: string = \"conceptindex\",\n options?: UseModularUIBasicOptions<ConceptIndexModel>,\n): ?ConceptIndexModel => {\n const url = filterParameters(href, [\n \"entryDate\",\n \"index\",\n \"label\",\n \"modelcategory\",\n \"type\",\n ]);\n return useModularUIBasic(key, url, {\n expectedModels: [\"ConceptIndex\"],\n targetModel: ConceptIndexModel,\n ...options,\n });\n};\n\n/**\n */\nexport const useConceptDetail = (\n concept: string | Href,\n key?: string = \"conceptdetail\",\n options?: UseModularUIBasicOptions<\n ConceptDetailModel | BusinessScenarioModel,\n >,\n): ?ConceptDetailModel | ?BusinessScenarioModel => {\n const location = useLocation();\n\n const href = createHref(\"concepts\", concept, location, [\"entryDate\"]);\n return useModularUIBasic(key, href, {\n expectedModels: [\"ConceptDetail\", \"BusinessScenario\"],\n ...options,\n });\n};\n\n/**\n */\nexport const useContentIndex = (\n href: string | Href,\n key?: string = \"contentindex\",\n options?: UseModularUIBasicOptions<ContentIndexModel>,\n): ?ContentIndexModel => {\n const url = filterParameters(href, [\"index\", \"label\", \"type\"]);\n return useModularUIBasic(key, url, {\n expectedModels: [\"ContentIndex\"],\n targetModel: ContentIndexModel,\n ...options,\n });\n};\n\n/**\n */\nexport const useContentTOC = (\n content: string | Href,\n key?: string = \"contenttoc\",\n options?: UseModularUIBasicOptions<ContentTOCModel>,\n): ?ContentTOCModel => {\n const location = useLocation();\n const href = createHref(\"content\", content, location, [\"entryDate\"]);\n return useModularUIBasic(key, href, {\n expectedModels: [\"ContentTOC\"],\n targetModel: ContentTOCModel,\n ...options,\n });\n};\n\n/**\n */\nexport const useContent = (\n contentSection: string | Href,\n key?: string = \"content\",\n options?: UseModularUIBasicOptions<ContentModel>,\n): ?ContentModel => {\n const href = createHref(\"content\", contentSection, null, [\"entryDate\"]);\n return useModularUIBasic(key, href, {\n expectedModels: [\"Content\"],\n targetModel: ContentModel,\n ...options,\n });\n};\n\n/**\n */\nexport const useContentType = (\n contentType: string | Href,\n key?: string = \"contenttypes\",\n options?: UseModularUIBasicOptions<ContentTypeModel>,\n): ?ContentTypeModel => {\n const href = createHref(\"contenttypes\", contentType, null, [\"entryDate\"]);\n return useModularUIBasic(key, href, {\n expectedModels: [\"ContentType\"],\n targetModel: ContentTypeModel,\n ...options,\n });\n};\n\n/**\n */\nconst getSearchHref = (uri: string, filters: SearchFilter): string => {\n const filterString = [];\n\n for (const key of Object.keys(filters)) {\n const filterValue = filters[key];\n if (filterValue) {\n let value: string = Array.isArray(filterValue)\n ? filterValue.join(\",\")\n : filterValue;\n if (key === \"type\") {\n value = value.replace(\"#\", \"%23\"); // handles un-encoded #\n }\n filterString.push(`${key}=${value}`);\n }\n }\n\n return filterString.length ? `${uri}?${filterString.join(\"&\")}` : uri;\n};\n\n/**\n */\nexport const useConceptSearch = (\n filters: SearchFilter,\n key?: string = \"conceptSearch\",\n options?: UseModularUIBasicOptions<ConceptIndexModel>,\n): ?ConceptIndexModel => {\n const href = getSearchHref(\"/concepts\", filters);\n return useConceptIndex(href, key, options);\n};\n\n/**\n */\nexport const useContentSearch = (\n filters: SearchFilter,\n key?: string = \"contentSearch\",\n options?: UseModularUIBasicOptions<ContentIndexModel>,\n): ?ContentIndexModel => {\n const href = getSearchHref(\"/content\", filters);\n return useContentIndex(href, key, options);\n};\n"],"mappings":";;;;;;;;AACA,IAAAA,UAAA,GAAAC,OAAA;AAEA,IAAAC,WAAA,GAAAD,OAAA;AAEA,IAAAE,kBAAA,GAAAC,sBAAA,CAAAH,OAAA;AACA,IAAAI,kBAAA,GAAAD,sBAAA,CAAAH,OAAA;AACA,IAAAK,mBAAA,GAAAF,sBAAA,CAAAH,OAAA;AACA,IAAAM,sBAAA,GAAAH,sBAAA,CAAAH,OAAA;AACA,IAAAO,kBAAA,GAAAJ,sBAAA,CAAAH,OAAA;AACA,IAAAQ,gBAAA,GAAAL,sBAAA,CAAAH,OAAA;AACA,IAAAS,aAAA,GAAAN,sBAAA,CAAAH,OAAA;AAEA,IAAAU,kBAAA,GAAAV,OAAA;AACA,IAAAW,OAAA,GAAAX,OAAA;AAYA;AACA;AACO,MAAMY,eAAe,GAC1BC,OAAqD,IAErD,IAAAC,oCAAiB,EAAC,cAAc,EAAE,eAAe,EAAE;EACjDC,cAAc,EAAE,CAAC,cAAc,CAAC;EAChCC,WAAW,EAAEC,0BAAiB;EAC9B,GAAGJ;AACL,CAAC,CAAC;;AAEJ;AACA;AADAK,OAAA,CAAAN,eAAA,GAAAA,eAAA;AAEO,MAAM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,GAAG,EAAER,OAAO,CAAC;AAC5C,CAAC;AAACK,OAAA,CAAAwC,gBAAA,GAAAA,gBAAA","ignoreList":[]}
|
|
1
|
+
{"version":3,"file":"useModelCatalog.js","names":["_reactRedux","require","_useRouter","_createHref","_ModelCatalogModel","_interopRequireDefault","_ConceptIndexModel","_ConceptDetailModel","_BusinessScenarioModel","_ContentIndexModel","_ContentTOCModel","_ContentModel","_useModularUIBasic","_models","_modelcatalog","_EntryDate","useModelCatalog","options","useModularUIBasic","expectedModels","targetModel","ModelCatalogModel","exports","useConceptIndex","href","key","arguments","length","undefined","entryDate","useEntryDate","url","filterParameters","setParameter","ConceptIndexModel","useConceptDetail","concept","location","useLocation","createHref","useContentIndex","ContentIndexModel","useContentTOC","content","ContentTOCModel","useContent","contentSection","ContentModel","useContentType","contentType","ContentTypeModel","getSearchHref","uri","filters","filterString","_keys","default","filterValue","value","Array","isArray","join","replace","push","useConceptSearch","useContentSearch","dispatch","useDispatch","useSelector","getEntryDate","setEntryDate","updateEntryDate"],"sources":["../../src/hooks/useModelCatalog.js"],"sourcesContent":["// @flow\nimport { useSelector, useDispatch } from \"react-redux\";\nimport { useLocation } from \"./useRouter\";\n\nimport { createHref, filterParameters } from \"../utils/helpers/createHref\";\n\nimport ModelCatalogModel from \"../models/modelcatalog/ModelCatalogModel\";\nimport ConceptIndexModel from \"../models/concepts/ConceptIndexModel\";\nimport ConceptDetailModel from \"../models/concepts/ConceptDetailModel\";\nimport { default as BusinessScenarioModel } from \"../models/concepts/BusinessScenarioModel\";\nimport ContentIndexModel from \"../models/content/ContentIndexModel\";\nimport ContentTOCModel from \"../models/content/ContentTOCModel\";\nimport ContentModel from \"../models/content/ContentModel\";\n\nimport { useModularUIBasic } from \"./useModularUIBasic\";\nimport { ContentTypeModel } from \"../models\";\n\nimport { getEntryDate } from \"../redux/selectors/modelcatalog\";\nimport { updateEntryDate } from \"../redux/actions/EntryDate\";\n\nimport type Href from \"../models/href/Href\";\nimport type { UseModularUIBasicOptions } from \"./useModularUIBasic\";\nimport type { UpdateEntryDateAction } from \"../redux\";\nexport type SearchFilter = {\n index?: string,\n label?: string,\n type?: string | Array<string>,\n modelCategory?: string | Array<string>,\n entryDate?: string,\n};\n\n/**\n */\nexport const useModelCatalog = (\n options?: UseModularUIBasicOptions<ModelCatalogModel>,\n): ?ModelCatalogModel =>\n useModularUIBasic(\"modelcatalog\", \"/modelcatalog\", {\n expectedModels: [\"ModelCatalog\"],\n targetModel: ModelCatalogModel,\n ...options,\n });\n\n/**\n */\nexport const useConceptIndex = (\n href: string | Href,\n key?: string = \"conceptindex\",\n options?: UseModularUIBasicOptions<ConceptIndexModel>,\n): ?ConceptIndexModel => {\n const { entryDate } = useEntryDate();\n const url = filterParameters(href, [\n \"index\",\n \"label\",\n \"modelcategory\",\n \"type\",\n ]);\n url.setParameter(\"entryDate\", entryDate);\n\n return useModularUIBasic(key, url, {\n expectedModels: [\"ConceptIndex\"],\n targetModel: ConceptIndexModel,\n ...options,\n });\n};\n\n/**\n */\nexport const useConceptDetail = (\n concept: string | Href,\n key?: string = \"conceptdetail\",\n options?: UseModularUIBasicOptions<\n ConceptDetailModel | BusinessScenarioModel,\n >,\n): ?ConceptDetailModel | ?BusinessScenarioModel => {\n const { entryDate } = useEntryDate();\n const location = useLocation();\n\n const href = createHref(\"concepts\", concept, entryDate, location, []);\n\n return useModularUIBasic(key, href, {\n expectedModels: [\"ConceptDetail\", \"BusinessScenario\"],\n ...options,\n });\n};\n\n/**\n */\nexport const useContentIndex = (\n href: string | Href,\n key?: string = \"contentindex\",\n options?: UseModularUIBasicOptions<ContentIndexModel>,\n): ?ContentIndexModel => {\n const url = filterParameters(href, [\"index\", \"label\", \"type\"]);\n return useModularUIBasic(key, url, {\n expectedModels: [\"ContentIndex\"],\n targetModel: ContentIndexModel,\n ...options,\n });\n};\n\n/**\n */\nexport const useContentTOC = (\n content: string | Href,\n key?: string = \"contenttoc\",\n options?: UseModularUIBasicOptions<ContentTOCModel>,\n): ?ContentTOCModel => {\n const { entryDate } = useEntryDate();\n const location = useLocation();\n\n const href = createHref(\"content\", content, entryDate, location, []);\n\n return useModularUIBasic(key, href, {\n expectedModels: [\"ContentTOC\"],\n targetModel: ContentTOCModel,\n ...options,\n });\n};\n\n/**\n */\nexport const useContent = (\n contentSection: string | Href,\n key?: string = \"content\",\n options?: UseModularUIBasicOptions<ContentModel>,\n): ?ContentModel => {\n const { entryDate } = useEntryDate();\n\n const href = createHref(\"content\", contentSection, entryDate, null, []);\n\n return useModularUIBasic(key, href, {\n expectedModels: [\"Content\"],\n targetModel: ContentModel,\n ...options,\n });\n};\n\n/**\n */\nexport const useContentType = (\n contentType: string | Href,\n key?: string = \"contenttypes\",\n options?: UseModularUIBasicOptions<ContentTypeModel>,\n): ?ContentTypeModel => {\n const { entryDate } = useEntryDate();\n\n const href = createHref(\"contenttypes\", contentType, entryDate, null, []);\n\n return useModularUIBasic(key, href, {\n expectedModels: [\"ContentType\"],\n targetModel: ContentTypeModel,\n ...options,\n });\n};\n\n/**\n */\nconst getSearchHref = (uri: string, filters: SearchFilter): string => {\n const filterString = [];\n\n for (const key of Object.keys(filters)) {\n const filterValue = filters[key];\n if (filterValue) {\n let value: string = Array.isArray(filterValue)\n ? filterValue.join(\",\")\n : filterValue;\n if (key === \"type\") {\n value = value.replace(\"#\", \"%23\"); // handles un-encoded #\n }\n filterString.push(`${key}=${value}`);\n }\n }\n\n return filterString.length ? `${uri}?${filterString.join(\"&\")}` : uri;\n};\n\n/**\n */\nexport const useConceptSearch = (\n filters: SearchFilter,\n key?: string = \"conceptSearch\",\n options?: UseModularUIBasicOptions<ConceptIndexModel>,\n): ?ConceptIndexModel => {\n const href = getSearchHref(\"/concepts\", filters);\n return useConceptIndex(href, key, options);\n};\n\n/**\n */\nexport const useContentSearch = (\n filters: SearchFilter,\n key?: string = \"contentSearch\",\n options?: UseModularUIBasicOptions<ContentIndexModel>,\n): ?ContentIndexModel => {\n const href = getSearchHref(\"/content\", filters);\n return useContentIndex(href, key, options);\n};\n\n/**\n * Retrieve and update the entrydate for the modelcatalog\n */\nexport const useEntryDate = (): ({\n entryDate: ISO_DATE,\n setEntryDate: (entryDate: ISO_DATE) => UpdateEntryDateAction,\n}) => {\n const dispatch = useDispatch();\n const entryDate = useSelector(getEntryDate);\n\n return {\n entryDate,\n setEntryDate: (entryDate: ISO_DATE) => dispatch(updateEntryDate(entryDate)),\n };\n};\n"],"mappings":";;;;;;;;AACA,IAAAA,WAAA,GAAAC,OAAA;AACA,IAAAC,UAAA,GAAAD,OAAA;AAEA,IAAAE,WAAA,GAAAF,OAAA;AAEA,IAAAG,kBAAA,GAAAC,sBAAA,CAAAJ,OAAA;AACA,IAAAK,kBAAA,GAAAD,sBAAA,CAAAJ,OAAA;AACA,IAAAM,mBAAA,GAAAF,sBAAA,CAAAJ,OAAA;AACA,IAAAO,sBAAA,GAAAH,sBAAA,CAAAJ,OAAA;AACA,IAAAQ,kBAAA,GAAAJ,sBAAA,CAAAJ,OAAA;AACA,IAAAS,gBAAA,GAAAL,sBAAA,CAAAJ,OAAA;AACA,IAAAU,aAAA,GAAAN,sBAAA,CAAAJ,OAAA;AAEA,IAAAW,kBAAA,GAAAX,OAAA;AACA,IAAAY,OAAA,GAAAZ,OAAA;AAEA,IAAAa,aAAA,GAAAb,OAAA;AACA,IAAAc,UAAA,GAAAd,OAAA;AAaA;AACA;AACO,MAAMe,eAAe,GAC1BC,OAAqD,IAErD,IAAAC,oCAAiB,EAAC,cAAc,EAAE,eAAe,EAAE;EACjDC,cAAc,EAAE,CAAC,cAAc,CAAC;EAChCC,WAAW,EAAEC,0BAAiB;EAC9B,GAAGJ;AACL,CAAC,CAAC;;AAEJ;AACA;AADAK,OAAA,CAAAN,eAAA,GAAAA,eAAA;AAEO,MAAMO,eAAe,GAAG,SAAAA,CAC7BC,IAAmB,EAGI;EAAA,IAFvBC,GAAY,GAAAC,SAAA,CAAAC,MAAA,QAAAD,SAAA,QAAAE,SAAA,GAAAF,SAAA,MAAG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AE,SAAA,GAAAF,SAAA,MAAG,eAAe;EAAA,IAC9BT,OAAqD,GAAAS,SAAA,CAAAC,MAAA,OAAAD,SAAA,MAAAE,SAAA;EAErD,MAAMJ,IAAI,GAAG2B,aAAa,CAAC,UAAU,EAAEE,OAAO,CAAC;EAC/C,OAAOb,eAAe,CAAChB,IAAI,EAAEC,GAAG,EAAER,OAAO,CAAC;AAC5C,CAAC;;AAED;AACA;AACA;AAFAK,OAAA,CAAA2C,gBAAA,GAAAA,gBAAA;AAGO,MAAMnC,YAAY,GAAGA,CAAA,KAGtB;EACJ,MAAMoC,QAAQ,GAAG,IAAAC,uBAAW,EAAC,CAAC;EAC9B,MAAMtC,SAAS,GAAG,IAAAuC,uBAAW,EAACC,0BAAY,CAAC;EAE3C,OAAO;IACLxC,SAAS;IACTyC,YAAY,EAAGzC,SAAmB,IAAKqC,QAAQ,CAAC,IAAAK,0BAAe,EAAC1C,SAAS,CAAC;EAC5E,CAAC;AACH,CAAC;AAACP,OAAA,CAAAQ,YAAA,GAAAA,YAAA","ignoreList":[]}
|
|
@@ -264,7 +264,7 @@ class ConceptDetailModel extends _ResourceModel.default {
|
|
|
264
264
|
}
|
|
265
265
|
|
|
266
266
|
/**
|
|
267
|
-
* Retrieve
|
|
267
|
+
* Retrieve modelcatalog.js
|
|
268
268
|
*/
|
|
269
269
|
get entryDate() {
|
|
270
270
|
return (0, _filter.default)(this.data)?.[_Constants.TIMEVERSION_FILTER_NAME]?.value ?? null;
|
|
@@ -328,7 +328,7 @@ export default class ConceptDetailModel extends ResourceModel {
|
|
|
328
328
|
}
|
|
329
329
|
|
|
330
330
|
/**
|
|
331
|
-
* Retrieve
|
|
331
|
+
* Retrieve modelcatalog.js
|
|
332
332
|
*/
|
|
333
333
|
get entryDate(): string | null {
|
|
334
334
|
return this.data.filter?.[TIMEVERSION_FILTER_NAME]?.value ?? null;
|