@uxland/primary-shell 4.2.0 → 4.3.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/dist/index.js +1786 -1590
- package/dist/index.js.map +1 -1
- package/dist/index.umd.cjs +226 -208
- package/dist/index.umd.cjs.map +1 -1
- package/dist/primary/shell/src/UI/components/shell-header/shell-header.d.ts +1 -0
- package/dist/primary/shell/src/api/api.d.ts +2 -0
- package/dist/primary/shell/src/api/http-client/http-client.d.ts +3 -2
- package/dist/primary/shell/src/api/plugin-busy-manager/plugin-busy-list/component.d.ts +12 -0
- package/dist/primary/shell/src/api/plugin-busy-manager/plugin-busy-list/template.d.ts +3 -0
- package/dist/primary/shell/src/api/plugin-busy-manager/plugin-busy-manager.d.ts +19 -0
- package/dist/primary/shell/src/api/plugin-busy-manager/plugin-busy-manager.test.d.ts +1 -0
- package/dist/primary/shell/src/api/token-manager/token-manager.d.ts +1 -1
- package/dist/primary/shell/src/events.d.ts +1 -0
- package/dist/primary/shell/src/features/exit/bootstrapper.d.ts +2 -0
- package/dist/primary/shell/src/features/exit/handler.d.ts +10 -0
- package/dist/primary/shell/src/features/exit/request.d.ts +4 -0
- package/dist/primary/shell/src/handle-plugins.d.ts +2 -2
- package/dist/primary/shell/src/internal-plugins/activity-history/activity-history-item/add/add-async-history-items/validate-add-async-items-command.d.ts +4 -0
- package/dist/primary/shell/src/internal-plugins/activity-history/activity-history-item/add/add-history-items/reducer.d.ts +1 -1
- package/dist/primary/shell/src/internal-plugins/activity-history/activity-history-item/domain/model.d.ts +3 -0
- package/dist/primary/shell/src/internal-plugins/activity-history/activity-history-item/filter/UI/active-filters-badges/active-filters-badges.d.ts +4 -1
- package/dist/primary/shell/src/internal-plugins/activity-history/activity-history-item/filter/UI/active-filters-header/active-filters-header.d.ts +1 -2
- package/dist/primary/shell/src/internal-plugins/activity-history/activity-history-item/filter/common-filters/selectors.d.ts +152 -0
- package/dist/primary/shell/src/internal-plugins/activity-history/activity-history-item/filter/utils.d.ts +2 -0
- package/dist/primary/shell/src/internal-plugins/activity-history/activity-history-item/list/UI/timeline/activity-history-timeline.d.ts +2 -0
- package/dist/primary/shell/src/internal-plugins/activity-history/handle-views.d.ts +4 -0
- package/dist/primary/shell/src/internal-plugins/activity-history/infrastructure/ioc/container.d.ts +1 -0
- package/dist/primary/shell/src/internal-plugins/activity-history/infrastructure/ioc/types.d.ts +0 -1
- package/dist/primary/shell/src/internal-plugins/activity-history/localization.d.ts +1 -0
- package/dist/primary/shell/src/internal-plugins/activity-history/main.d.ts +0 -1
- package/dist/primary/shell/src/locales.d.ts +4 -0
- package/package.json +1 -1
- package/src/UI/components/index.ts +3 -2
- package/src/UI/components/shell-header/shell-header.ts +5 -0
- package/src/UI/components/shell-header/template.ts +2 -2
- package/src/api/api.ts +10 -3
- package/src/api/broker/factory.ts +1 -1
- package/src/api/http-client/http-client.test.ts +60 -6
- package/src/api/http-client/http-client.ts +17 -10
- package/src/api/plugin-busy-manager/plugin-busy-list/component.ts +19 -0
- package/src/api/plugin-busy-manager/plugin-busy-list/styles.css +20 -0
- package/src/api/plugin-busy-manager/plugin-busy-list/template.ts +13 -0
- package/src/api/plugin-busy-manager/plugin-busy-manager.test.ts +49 -0
- package/src/api/plugin-busy-manager/plugin-busy-manager.ts +38 -0
- package/src/api/token-manager/token-manager.test.ts +0 -12
- package/src/api/token-manager/token-manager.ts +12 -7
- package/src/disposer.ts +0 -1
- package/src/events.ts +1 -0
- package/src/features/bootstrapper.ts +3 -0
- package/src/features/exit/bootstrapper.ts +17 -0
- package/src/features/exit/handler.ts +51 -0
- package/src/features/exit/request.ts +3 -0
- package/src/handle-plugins.ts +7 -6
- package/src/handle-views.ts +4 -1
- package/src/internal-plugins/activity-history/activity-history-item/add/add-async-history-items/handler.ts +2 -0
- package/src/internal-plugins/activity-history/activity-history-item/add/add-async-history-items/validate-add-async-items-command.ts +15 -0
- package/src/internal-plugins/activity-history/activity-history-item/add/add-history-items/reducer.ts +10 -7
- package/src/internal-plugins/activity-history/activity-history-item/domain/model.ts +4 -0
- package/src/internal-plugins/activity-history/activity-history-item/filter/UI/active-filters-badges/active-filters-badges.ts +13 -5
- package/src/internal-plugins/activity-history/activity-history-item/filter/UI/active-filters-badges/template.ts +26 -2
- package/src/internal-plugins/activity-history/activity-history-item/filter/UI/active-filters-header/active-filters-header.ts +5 -8
- package/src/internal-plugins/activity-history/activity-history-item/filter/UI/active-filters-header/template.ts +6 -1
- package/src/internal-plugins/activity-history/activity-history-item/filter/common-filters/selectors.ts +10 -0
- package/src/internal-plugins/activity-history/activity-history-item/filter/custom-filters/set-custom-filter-value/reducer.ts +7 -1
- package/src/internal-plugins/activity-history/activity-history-item/filter/utils.ts +9 -0
- package/src/internal-plugins/activity-history/activity-history-item/list/UI/timeline/activity-history-timeline.ts +30 -0
- package/src/internal-plugins/activity-history/activity-history-item/list/UI/timeline/template.ts +7 -4
- package/src/internal-plugins/activity-history/handle-views.ts +17 -0
- package/src/internal-plugins/activity-history/infrastructure/ioc/container.ts +5 -0
- package/src/internal-plugins/activity-history/infrastructure/ioc/types.ts +0 -1
- package/src/internal-plugins/activity-history/localization.ts +7 -8
- package/src/internal-plugins/activity-history/main.ts +4 -10
- package/src/locales.ts +8 -4
- package/dist/primary/shell/src/internal-plugins/activity-history/utils/get-locale-manager-dependency.d.ts +0 -1
- package/src/internal-plugins/activity-history/utils/get-locale-manager-dependency.ts +0 -7
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { PayloadAction } from "@reduxjs/toolkit";
|
|
2
2
|
import { SetCustomFilterValuePayload } from "./request";
|
|
3
|
+
import { IActivityHistoryCustomFilter, IActivityHistoryCustomFilterGroup } from "../../model";
|
|
3
4
|
|
|
4
5
|
export function setCustomFilterValueReducer(
|
|
5
6
|
state,
|
|
@@ -22,8 +23,13 @@ export function setCustomFilterValueReducer(
|
|
|
22
23
|
});
|
|
23
24
|
}
|
|
24
25
|
|
|
25
|
-
const setMultipleOptionsFilterValue = (
|
|
26
|
+
const setMultipleOptionsFilterValue = (
|
|
27
|
+
filter: IActivityHistoryCustomFilter,
|
|
28
|
+
payload: SetCustomFilterValuePayload,
|
|
29
|
+
) => {
|
|
26
30
|
const { optionId, enabled } = payload;
|
|
31
|
+
//Si el option ya estaba habilitado, no cambiamos nada
|
|
32
|
+
if (filter.enabledValues?.some((id) => id === optionId) && enabled) return filter;
|
|
27
33
|
return {
|
|
28
34
|
...filter,
|
|
29
35
|
enabledValues: enabled
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { translate } from "../../localization";
|
|
2
|
+
|
|
3
|
+
export const formatShowFilterTitle = (title: string) => {
|
|
4
|
+
const filterTitle = title.replace(/veure/gi, "").trim();
|
|
5
|
+
return filterTitle.charAt(0).toUpperCase() + filterTitle.slice(1);
|
|
6
|
+
};
|
|
7
|
+
|
|
8
|
+
export const normalizeDeletedFilterBooleanValue = (value) =>
|
|
9
|
+
value === true ? translate("filters.deleted") : value;
|
|
@@ -40,6 +40,36 @@ export class ActivityHistoryTimeline extends LitElement {
|
|
|
40
40
|
this._hasUpdatedOnce = true;
|
|
41
41
|
}
|
|
42
42
|
|
|
43
|
+
async updated(changedProperties) {
|
|
44
|
+
if (changedProperties.has("historyGroups") && this.historyGroups?.length) {
|
|
45
|
+
// Resolver los elementos antes de actualizar el template
|
|
46
|
+
await this.prepareComponents(this.historyGroups);
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
async prepareComponents(historyGroups) {
|
|
51
|
+
for (const group of historyGroups) {
|
|
52
|
+
// Resolver items del grupo principal
|
|
53
|
+
group.items = await Promise.all(
|
|
54
|
+
group.items.map(async (item) => ({
|
|
55
|
+
...item,
|
|
56
|
+
component: await item.componentFactory({ item }),
|
|
57
|
+
})),
|
|
58
|
+
);
|
|
59
|
+
|
|
60
|
+
// Resolver subgrupos
|
|
61
|
+
for (const subGroup of group.subGroups) {
|
|
62
|
+
subGroup.items = await Promise.all(
|
|
63
|
+
subGroup.items.map(async (item) => ({
|
|
64
|
+
...item,
|
|
65
|
+
component: await item.componentFactory({ item }),
|
|
66
|
+
})),
|
|
67
|
+
);
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
this.requestUpdate(); // 🔥 Forzar actualización del template
|
|
71
|
+
}
|
|
72
|
+
|
|
43
73
|
highlightMatch(text: string, searchString: string): string {
|
|
44
74
|
if (!this.searchString || this.searchString.length < 2) return text;
|
|
45
75
|
const regex = new RegExp(`(${searchString})`, "gi");
|
package/src/internal-plugins/activity-history/activity-history-item/list/UI/timeline/template.ts
CHANGED
|
@@ -9,6 +9,7 @@ import { ifDefined } from "lit/directives/if-defined.js";
|
|
|
9
9
|
import {
|
|
10
10
|
IActivityHistoryGroup,
|
|
11
11
|
IActivityHistoryItem,
|
|
12
|
+
IActivityHistoryItemWithComponent,
|
|
12
13
|
IActivityHistorySubGroup,
|
|
13
14
|
} from "../../../domain/model";
|
|
14
15
|
import { translate } from "../../../../localization";
|
|
@@ -27,8 +28,9 @@ export const template = (props: ActivityHistoryTimeline) => {
|
|
|
27
28
|
<div class="visit__items">
|
|
28
29
|
${repeat(
|
|
29
30
|
itemGroup.items,
|
|
30
|
-
(item
|
|
31
|
-
|
|
31
|
+
(item) => item.id,
|
|
32
|
+
(item: IActivityHistoryItemWithComponent) =>
|
|
33
|
+
html`<div class="item">${item.component}</div> `,
|
|
32
34
|
)}
|
|
33
35
|
${repeat(
|
|
34
36
|
itemGroup.subGroups,
|
|
@@ -38,8 +40,9 @@ export const template = (props: ActivityHistoryTimeline) => {
|
|
|
38
40
|
${diagnosticHeaderTemplate(subGroup.items[0])}
|
|
39
41
|
<div class="diagnostics__items">${repeat(
|
|
40
42
|
subGroup.items,
|
|
41
|
-
(item
|
|
42
|
-
|
|
43
|
+
(item) => item.id,
|
|
44
|
+
(item: IActivityHistoryItemWithComponent) =>
|
|
45
|
+
html`<div class="item">${item?.component}</div> `,
|
|
43
46
|
)}</div>
|
|
44
47
|
</div>
|
|
45
48
|
`,
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { PrimariaApi } from "../../api/api";
|
|
2
|
+
import { clinicalMonitoringRegions } from "../../api/region-manager/regions";
|
|
3
|
+
import { ActivityHistoryMain } from "./activity-history-item/list/UI/main-view/activity-history-main";
|
|
4
|
+
import { container } from "./infrastructure/ioc/container";
|
|
5
|
+
import { TYPES } from "./infrastructure/ioc/types";
|
|
6
|
+
|
|
7
|
+
export const registerViews = (api: PrimariaApi) => {
|
|
8
|
+
api.regionManager.registerView(clinicalMonitoringRegions.content, {
|
|
9
|
+
id: api.pluginInfo.pluginId,
|
|
10
|
+
factory: () => Promise.resolve(new ActivityHistoryMain()),
|
|
11
|
+
});
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
export const unregisterViews = () => {
|
|
15
|
+
const api = container.get(TYPES.primaryApi) as PrimariaApi;
|
|
16
|
+
api.regionManager.removeView(clinicalMonitoringRegions.content, api.pluginInfo.pluginId);
|
|
17
|
+
};
|
|
@@ -12,3 +12,8 @@ export const bindDeps = (api: PrimariaApi) => {
|
|
|
12
12
|
container.bind(TYPES.primaryApi).toConstantValue(api);
|
|
13
13
|
container.bind(TYPES.store).toConstantValue(store);
|
|
14
14
|
};
|
|
15
|
+
|
|
16
|
+
export const unbindDeps = () => {
|
|
17
|
+
container.unbind(TYPES.primaryApi);
|
|
18
|
+
container.unbind(TYPES.store);
|
|
19
|
+
};
|
|
@@ -1,7 +1,4 @@
|
|
|
1
1
|
import { PrimariaApi } from "../../api/api";
|
|
2
|
-
import { container } from "./infrastructure/ioc/container";
|
|
3
|
-
import { TYPES } from "./infrastructure/ioc/types";
|
|
4
|
-
import { getLocaleManagerDependency } from "./utils/get-locale-manager-dependency";
|
|
5
2
|
|
|
6
3
|
type LocaleKeys<T> = T extends object
|
|
7
4
|
? {
|
|
@@ -17,15 +14,15 @@ export type ActivityHistoryLocales = LocaleKeys<
|
|
|
17
14
|
|
|
18
15
|
const defaultLang = "ca";
|
|
19
16
|
|
|
17
|
+
let pluginLocaleManager;
|
|
18
|
+
|
|
20
19
|
export const initializeLocalization = async (api: PrimariaApi) => {
|
|
21
|
-
|
|
22
|
-
container.bind(TYPES.localeManager).toConstantValue(pluginLocaleManager);
|
|
20
|
+
pluginLocaleManager = await api.createLocaleManager(locales);
|
|
23
21
|
};
|
|
24
22
|
|
|
25
23
|
export const translate = (path: ActivityHistoryLocales) => {
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
else return path;
|
|
24
|
+
if (pluginLocaleManager) return (pluginLocaleManager as any).translate(path);
|
|
25
|
+
return path;
|
|
29
26
|
};
|
|
30
27
|
|
|
31
28
|
export const locales = {
|
|
@@ -74,6 +71,8 @@ export const locales = {
|
|
|
74
71
|
|
|
75
72
|
selected: "seleccionats",
|
|
76
73
|
applyFilters: "Aplicar filtres",
|
|
74
|
+
|
|
75
|
+
deleted: "Eliminats",
|
|
77
76
|
},
|
|
78
77
|
tooltips: {
|
|
79
78
|
subjective: "Subjectiu",
|
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
import { PrimariaApi } from "../../api/api";
|
|
2
|
-
import { clinicalMonitoringRegions } from "../../api/region-manager/regions";
|
|
3
2
|
import {
|
|
4
3
|
bootstrapActivityHistoryItem,
|
|
5
4
|
teardownActivityHistoryItem,
|
|
6
5
|
} from "./activity-history-item/bootstrapper";
|
|
7
|
-
import {
|
|
8
|
-
import { bindDeps } from "./infrastructure/ioc/container";
|
|
6
|
+
import { registerViews, unregisterViews } from "./handle-views";
|
|
7
|
+
import { bindDeps, unbindDeps } from "./infrastructure/ioc/container";
|
|
9
8
|
import { initializeLocalization } from "./localization";
|
|
10
9
|
|
|
11
10
|
const bootstrapFeatures = (api: PrimariaApi) => {
|
|
@@ -26,12 +25,7 @@ export const initialize = async (api: PrimariaApi) => {
|
|
|
26
25
|
|
|
27
26
|
export const dispose = () => {
|
|
28
27
|
teardownFeatures();
|
|
28
|
+
unregisterViews();
|
|
29
|
+
unbindDeps();
|
|
29
30
|
return Promise.resolve();
|
|
30
31
|
};
|
|
31
|
-
|
|
32
|
-
export const registerViews = (api: PrimariaApi) => {
|
|
33
|
-
api.regionManager.registerView(clinicalMonitoringRegions.content, {
|
|
34
|
-
id: api.pluginInfo.pluginId,
|
|
35
|
-
factory: () => Promise.resolve(new ActivityHistoryMain()),
|
|
36
|
-
});
|
|
37
|
-
};
|
package/src/locales.ts
CHANGED
|
@@ -31,19 +31,23 @@ export const locales = {
|
|
|
31
31
|
ca: {
|
|
32
32
|
[primariaShellId]: {
|
|
33
33
|
title: "Estació de Treball Clínica",
|
|
34
|
-
actions:{
|
|
34
|
+
actions: {
|
|
35
35
|
create: "Crear",
|
|
36
36
|
toggleMenuClose: "Tancar menú",
|
|
37
37
|
toggleMenuOpen: "Expandir menú",
|
|
38
|
+
askExit: "Atenció, vols sortir igualment?",
|
|
38
39
|
},
|
|
39
|
-
clinicalMonitoring:{
|
|
40
|
+
clinicalMonitoring: {
|
|
40
41
|
title: "Seguiment clínic",
|
|
41
42
|
},
|
|
42
43
|
header: {
|
|
43
44
|
workCenter: "Centre treball",
|
|
44
45
|
role: "Rol",
|
|
45
46
|
speciality: "Àmbit treball",
|
|
46
|
-
}
|
|
47
|
-
|
|
47
|
+
},
|
|
48
|
+
busyManager: {
|
|
49
|
+
title: "Tasques pendents a desar:",
|
|
50
|
+
},
|
|
51
|
+
},
|
|
48
52
|
},
|
|
49
53
|
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const getLocaleManagerDependency: () => unknown;
|