@uxland/primary-shell 7.47.6 → 8.0.0-rc.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{component-CQxI1o5p.js → component-BY2raxSF.js} +2 -2
- package/dist/{component-CQxI1o5p.js.map → component-BY2raxSF.js.map} +1 -1
- package/dist/index-BZNo-mYO.js +43465 -0
- package/dist/index-BZNo-mYO.js.map +1 -0
- package/dist/index.js +16 -20
- package/dist/index.umd.cjs +6023 -7710
- package/dist/index.umd.cjs.map +1 -1
- package/dist/{plugin-DohFiwSH.js → plugin-IG9tBP6I.js} +1125 -1138
- package/dist/plugin-IG9tBP6I.js.map +1 -0
- package/dist/primary/shell/src/api/api.d.ts +0 -2
- package/dist/primary/shell/src/api/interaction-service/interaction-service-impl.d.ts +1 -1
- package/dist/primary/shell/src/api/region-manager/regions.d.ts +0 -1
- package/dist/primary/shell/src/features/exit/handler.d.ts +0 -1
- package/dist/primary/shell/src/index.d.ts +0 -1
- package/dist/primary/shell/src/locales.d.ts +0 -4
- package/dist/styles.css +1 -1
- package/package.json +13 -13
- package/src/UI/components/bootstrapper.ts +0 -2
- package/src/UI/components/primaria-shell/shell-header/template.ts +6 -14
- package/src/UI/components/primaria-shell/template.ts +5 -5
- package/src/UI/shared-components/primaria-character-limit-badge/primaria-character-limit-badge.ts +2 -2
- package/src/UI/shared-components/primaria-nav-tree-menu/template.ts +1 -1
- package/src/api/api.ts +2 -6
- package/src/api/interaction-service/interaction-service-impl.tsx +1 -1
- package/src/api/pdf-viewer-manager/pdf-visor/pdf-selector/template.ts +6 -8
- package/src/api/region-manager/regions.ts +1 -6
- package/src/features/exit/handler.test.ts +0 -60
- package/src/features/exit/handler.ts +0 -23
- package/src/index.ts +2 -1
- package/src/locales.ts +0 -4
- package/dist/index-DSO8ViDu.js +0 -45602
- package/dist/index-DSO8ViDu.js.map +0 -1
- package/dist/plugin-DohFiwSH.js.map +0 -1
- package/dist/primary/shell/src/UI/components/quick-actions-menu/quick-actions-menu.d.ts +0 -8
- package/dist/primary/shell/src/UI/components/quick-actions-menu/template.d.ts +0 -2
- package/dist/primary/shell/src/api/plugin-busy-manager/plugin-busy-list/component.d.ts +0 -9
- package/dist/primary/shell/src/api/plugin-busy-manager/plugin-busy-list/template.d.ts +0 -2
- package/dist/primary/shell/src/api/plugin-busy-manager/plugin-busy-manager.d.ts +0 -26
- package/dist/primary/shell/src/api/plugin-busy-manager/plugin-busy-manager.test.d.ts +0 -1
- package/src/UI/components/quick-actions-menu/quick-actions-menu.ts +0 -54
- package/src/UI/components/quick-actions-menu/template.ts +0 -10
- package/src/api/plugin-busy-manager/plugin-busy-list/component.ts +0 -16
- package/src/api/plugin-busy-manager/plugin-busy-list/styles.css +0 -27
- package/src/api/plugin-busy-manager/plugin-busy-list/template.ts +0 -20
- package/src/api/plugin-busy-manager/plugin-busy-manager.test.ts +0 -72
- package/src/api/plugin-busy-manager/plugin-busy-manager.ts +0 -57
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@uxland/primary-shell",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "8.0.0-rc.1",
|
|
4
4
|
"description": "Primaria Shell",
|
|
5
5
|
"author": "UXLand <dev@uxland.es>",
|
|
6
6
|
"homepage": "https://github.com/uxland/harmonix/tree/app#readme",
|
|
@@ -21,6 +21,14 @@
|
|
|
21
21
|
"type": "git",
|
|
22
22
|
"url": "git+https://github.com/uxland/harmonix.git"
|
|
23
23
|
},
|
|
24
|
+
"scripts": {
|
|
25
|
+
"serve": "vite",
|
|
26
|
+
"start": "ng serve --host 0.0.0.0",
|
|
27
|
+
"build": "vite build",
|
|
28
|
+
"preview": "vite preview",
|
|
29
|
+
"publish-rc": "npm publish --tag rc",
|
|
30
|
+
"test": "vitest"
|
|
31
|
+
},
|
|
24
32
|
"bugs": {
|
|
25
33
|
"url": "https://github.com/uxland/harmonix/issues"
|
|
26
34
|
},
|
|
@@ -29,7 +37,8 @@
|
|
|
29
37
|
"@uxland/harmonix-adapters": "^1.2.2"
|
|
30
38
|
},
|
|
31
39
|
"devDependencies": {
|
|
32
|
-
"@
|
|
40
|
+
"@primaria/plugins-core": "workspace:*",
|
|
41
|
+
"@salut/design-system-salut": "../../design-system-salut-3.0.2.tgz",
|
|
33
42
|
"@types/react": "^19.0.12",
|
|
34
43
|
"@uxland/lit-utilities": "^1.0.0",
|
|
35
44
|
"@uxland/localization": "^1.0.3",
|
|
@@ -46,15 +55,6 @@
|
|
|
46
55
|
"reflect-metadata": "^0.2.2",
|
|
47
56
|
"tslib": "^2.3.0",
|
|
48
57
|
"uxl-quill": "^1.0.1",
|
|
49
|
-
"vite": "^7.0.0"
|
|
50
|
-
"@primaria/plugins-core": "1.0.26"
|
|
51
|
-
},
|
|
52
|
-
"scripts": {
|
|
53
|
-
"serve": "vite",
|
|
54
|
-
"start": "ng serve --host 0.0.0.0",
|
|
55
|
-
"build": "vite build",
|
|
56
|
-
"preview": "vite preview",
|
|
57
|
-
"publish-rc": "npm publish --tag rc",
|
|
58
|
-
"test": "vitest"
|
|
58
|
+
"vite": "^7.0.0"
|
|
59
59
|
}
|
|
60
|
-
}
|
|
60
|
+
}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { customElement } from "lit/decorators.js";
|
|
2
2
|
import { PrimariaShell } from "./primaria-shell/primaria-shell";
|
|
3
3
|
import { PrimariaErrorView } from "./error-view/component";
|
|
4
|
-
import { QuickActionsMenu } from "./quick-actions-menu/quick-actions-menu";
|
|
5
4
|
import { PrimariaShellHeader } from "./primaria-shell/shell-header/shell-header";
|
|
6
5
|
import { PocEventsEcap } from "./poc-events-ecap/poc-events-ecap";
|
|
7
6
|
import { PrimariaAccordion } from "./primaria-accordion/primaria-accordion";
|
|
@@ -16,7 +15,6 @@ export const useComponents = () => {
|
|
|
16
15
|
//@ts-ignore
|
|
17
16
|
customElement("primaria-shell-header")(PrimariaShellHeader);
|
|
18
17
|
customElement("primaria-error-view")(PrimariaErrorView);
|
|
19
|
-
customElement("quick-actions-menu")(QuickActionsMenu);
|
|
20
18
|
customElement('header-divider')(HeaderDivider);
|
|
21
19
|
//@ts-ignore
|
|
22
20
|
customElement("communication-action-menu")(CommunicationActionMenu);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { html
|
|
1
|
+
import { html } from "lit";
|
|
2
2
|
import salutLogo from "../../../../UI/images/Salut_Logotip.svg";
|
|
3
3
|
import { PrimariaShellHeader } from "./shell-header";
|
|
4
4
|
import { when } from "lit/directives/when.js";
|
|
@@ -8,6 +8,7 @@ export const template = (props: PrimariaShellHeader) => {
|
|
|
8
8
|
const workCenterElements = [{ label: props.professional?.workCenter, value: "1" }];
|
|
9
9
|
const roleElements = [{ label: props.professional?.role, value: "1" }];
|
|
10
10
|
const specialityElements = [{ label: props.professional?.speciality, value: "1" }];
|
|
11
|
+
const selectedValue = ["1"];
|
|
11
12
|
|
|
12
13
|
return html`
|
|
13
14
|
<div class="header">
|
|
@@ -23,20 +24,11 @@ export const template = (props: PrimariaShellHeader) => {
|
|
|
23
24
|
<header-divider></header-divider>
|
|
24
25
|
${when(
|
|
25
26
|
props.professional,
|
|
26
|
-
() => html`<dss-header-menu-professional
|
|
27
|
+
() => html`<dss-header-menu-professional hideViewDetails @primary-action=${props.logout} name="${props.professional.firstName} ${props.professional?.familyName} ${props.professional?.lastName}" center="${props.professional.workCenter}" collegiate="${props.professional.registrationNumber}">
|
|
27
28
|
<dss-avatar size="xl" name="${props.professional.firstName}" surname="${props.professional?.familyName}" slot="avatar"></dss-avatar>
|
|
28
|
-
<dss-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
</dss-input-dropdown>
|
|
32
|
-
<dss-input-dropdown icon="business_center" type="default" .elements=${roleElements} selectedvalue="["1"]">
|
|
33
|
-
<label slot="label" for="preferences2">${translate("header.role")}</label>
|
|
34
|
-
<input id="preferences2" slot="input" type="text" class="dss-input" readonly="">
|
|
35
|
-
</dss-input-dropdown>
|
|
36
|
-
<dss-input-dropdown icon="people_alt" type="default" .elements=${specialityElements} selectedvalue="["1"]">
|
|
37
|
-
<label slot="label" for="preferences3">${translate("header.speciality")}</label>
|
|
38
|
-
<input id="preferences3" slot="input" type="text" class="dss-input" readonly="">
|
|
39
|
-
</dss-input-dropdown>
|
|
29
|
+
<dss-select icon="maps_home_work" label=${translate("header.workCenter")} .elements=${workCenterElements} .selectedValue=${selectedValue} readonly></dss-select>
|
|
30
|
+
<dss-select icon="business_center" label=${translate("header.role")} .elements=${roleElements} .selectedValue=${selectedValue} readonly></dss-select>
|
|
31
|
+
<dss-select icon="people_alt" label=${translate("header.speciality")} .elements=${specialityElements} .selectedValue=${selectedValue} readonly></dss-select>
|
|
40
32
|
</dss-header-menu-professional>`,
|
|
41
33
|
)}
|
|
42
34
|
</div>
|
|
@@ -17,10 +17,10 @@ export const template = (props: PrimariaShell) => html`
|
|
|
17
17
|
<div id="menu-region-container"></div>
|
|
18
18
|
<!-- <primaria-region id="menu-region" name=${shellApi.regionManager.regions.shell.navigationMenu}></primaria-region> -->
|
|
19
19
|
<div class="quick-actions-content">
|
|
20
|
-
<
|
|
21
|
-
<div class="${props.sidebarExpanded ? "create-button-opened" : "create-button-closed"} "
|
|
20
|
+
<span>
|
|
21
|
+
<div class="${props.sidebarExpanded ? "create-button-opened" : "create-button-closed"} ">
|
|
22
22
|
<div class="${props.quickActionBusy ? "create-button-icon-badge" : ""}">
|
|
23
|
-
${props.quickActionBusy ? html`<dss-notification-badge
|
|
23
|
+
${props.quickActionBusy ? html`<dss-notification-badge variant="sidemenu" inverted dot></dss-notification-badge>` : nothing}
|
|
24
24
|
<dss-icon class="${props.sidebarExpanded ? "icon" : ""}" icon="add_circle_outline" size="md"></dss-icon>
|
|
25
25
|
</div>
|
|
26
26
|
${props.sidebarExpanded ? translate("actions.create") : nothing}
|
|
@@ -32,8 +32,8 @@ export const template = (props: PrimariaShell) => html`
|
|
|
32
32
|
: nothing
|
|
33
33
|
}
|
|
34
34
|
</div>
|
|
35
|
-
<dss-action-menu id="quick-actions-region-container"
|
|
36
|
-
</
|
|
35
|
+
<dss-action-menu id="quick-actions-region-container"></dss-action-menu>
|
|
36
|
+
</span>
|
|
37
37
|
</div>
|
|
38
38
|
<div class="bottom-content">
|
|
39
39
|
<div class="bottom-content-first">
|
package/src/UI/shared-components/primaria-character-limit-badge/primaria-character-limit-badge.ts
CHANGED
|
@@ -16,9 +16,9 @@ export class PrimariaCharacterLimitBadge extends LitElement {
|
|
|
16
16
|
return html`
|
|
17
17
|
<dss-alert
|
|
18
18
|
class="limit-alert"
|
|
19
|
-
|
|
19
|
+
status="warning"
|
|
20
20
|
size="md"
|
|
21
|
-
|
|
21
|
+
titleText="${this.label} ${this.characterCount}/${this.characterLimit}"
|
|
22
22
|
></dss-alert>
|
|
23
23
|
`;
|
|
24
24
|
}
|
|
@@ -9,7 +9,7 @@ export const template = (props: PrimariaNavTreeMenu) => html`
|
|
|
9
9
|
class="${classMap({ "menu-active": props.showActionMenu })}"
|
|
10
10
|
></primaria-nav-item>
|
|
11
11
|
<dss-action-menu
|
|
12
|
-
@
|
|
12
|
+
@close=${props.handleCloseMenu}
|
|
13
13
|
?hidden=${!props.showActionMenu}
|
|
14
14
|
>
|
|
15
15
|
${props.config.actionMenuItems?.map((item) =>
|
package/src/api/api.ts
CHANGED
|
@@ -9,12 +9,11 @@ import { createActivityMonitor } from "./activity-monitor/activity-monitor";
|
|
|
9
9
|
import { HttpClient, createHttpClient } from "./http-client/http-client";
|
|
10
10
|
import { PrimariaInteractionService } from "./interaction-service";
|
|
11
11
|
import { createSessionRefreshTimer } from "./session-refresh-timer/session-refresh-timer";
|
|
12
|
-
import {
|
|
12
|
+
import { PrimariaInteractionServiceImpl } from "./interaction-service/interaction-service-impl";
|
|
13
13
|
import { createLocaleManager } from "./localization/localization";
|
|
14
14
|
import { PrimariaNotificationService } from "./notification-service/notification-service";
|
|
15
15
|
import { PrimariaNotificationServiceImpl } from "./notification-service/notification.service-impl";
|
|
16
16
|
import { PdfViewerManager, createPdfViewerManager } from "./pdf-viewer-manager/pdf-viewer-manager";
|
|
17
|
-
import { PluginBusyManager, PluginBusyManagerImpl } from "./plugin-busy-manager/plugin-busy-manager";
|
|
18
17
|
import { QuickActionBusyManager, QuickActionBusyManagerImpl } from "./quick-action-busy-manager/quick-action-busy-manager";
|
|
19
18
|
import { PrimariaRegionManager, createRegionManagerProxy } from "./region-manager/region-manager";
|
|
20
19
|
import { TokenManager, createTokenManager } from "./token-manager/token-manager";
|
|
@@ -35,7 +34,6 @@ export interface PrimariaApi extends HarmonixApi {
|
|
|
35
34
|
tokenManager: TokenManager;
|
|
36
35
|
userManager: UserManager;
|
|
37
36
|
ecapEventManager: EcapEventManager;
|
|
38
|
-
pluginBusyManager: PluginBusyManager;
|
|
39
37
|
exitGuardManager: ExitGuardManager;
|
|
40
38
|
quickActionBusyManager: QuickActionBusyManager;
|
|
41
39
|
pdfViewerManager: PdfViewerManager;
|
|
@@ -50,10 +48,9 @@ export const activityMonitor = createActivityMonitor();
|
|
|
50
48
|
export const sessionRefreshTimer = createSessionRefreshTimer(tokenManager, activityMonitor);
|
|
51
49
|
const globalStateManager: PrimariaGlobalStateManager = createGlobalStateManager(broker);
|
|
52
50
|
const contextManager = createContextManager();
|
|
53
|
-
const pluginBusyManager = new PluginBusyManagerImpl();
|
|
54
51
|
const exitGuardManager = new ExitGuardManagerImpl();
|
|
55
52
|
const quickActionBusyManager = new QuickActionBusyManagerImpl(broker);
|
|
56
|
-
const interactionService = new
|
|
53
|
+
const interactionService = new PrimariaInteractionServiceImpl();
|
|
57
54
|
const notificationService = new PrimariaNotificationServiceImpl();
|
|
58
55
|
const ecapEventManager = createEcapEventManager(globalStateManager);
|
|
59
56
|
const pdfViewerManager = createPdfViewerManager(broker, notificationService);
|
|
@@ -79,7 +76,6 @@ export const primariaApiFactory: ApiFactory<PrimariaApi> = (pluginInfo: PluginIn
|
|
|
79
76
|
tokenManager,
|
|
80
77
|
userManager,
|
|
81
78
|
ecapEventManager,
|
|
82
|
-
pluginBusyManager,
|
|
83
79
|
exitGuardManager,
|
|
84
80
|
quickActionBusyManager,
|
|
85
81
|
interactionService,
|
|
@@ -25,7 +25,7 @@ const defaultOptions: ConfirmationOptions = {
|
|
|
25
25
|
const isWebComponentConstructor = (component: unknown): component is new () => HTMLElement =>
|
|
26
26
|
typeof component === "function" && component.prototype instanceof HTMLElement;
|
|
27
27
|
|
|
28
|
-
export class
|
|
28
|
+
export class PrimariaInteractionServiceImpl extends PrimariaInteractionService {
|
|
29
29
|
private readonly openDialogCancellers = new Set<() => void>();
|
|
30
30
|
|
|
31
31
|
confirm<TData = undefined, TResult = undefined>(
|
|
@@ -7,14 +7,12 @@ export const template = (props: PdfSelector) => {
|
|
|
7
7
|
const pdfitem = (pdf: IPdfDocument) => {
|
|
8
8
|
return html`
|
|
9
9
|
<div class="pdf-item">
|
|
10
|
-
<dss-checkbox
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
>
|
|
17
|
-
</dss-checkbox>
|
|
10
|
+
<dss-checkbox
|
|
11
|
+
hideLabel
|
|
12
|
+
label=${pdf.data.name || "Sense nom"}
|
|
13
|
+
?checked=${props.activePdfs.some((p) => p.id === pdf.id)}
|
|
14
|
+
@change=${() => props.setActivePdf(pdf.id)}
|
|
15
|
+
></dss-checkbox>
|
|
18
16
|
<div class="container">
|
|
19
17
|
<dss-icon-button class="close-button" size="md" variant="error" icon="close" @click=${() => props.removePdf(pdf.id)}></dss-icon-button>
|
|
20
18
|
<div class="data">
|
|
@@ -22,14 +22,9 @@ export const clinicalMonitoringRegions = {
|
|
|
22
22
|
export const activityHistoryRegions = {
|
|
23
23
|
customFilters: "clinical-monitoring-activity-history-filters-region",
|
|
24
24
|
};
|
|
25
|
+
|
|
25
26
|
export const administrativeManagementRegions = {
|
|
26
27
|
widgets: "administrative-management-widgets-region",
|
|
27
28
|
tabs: "administrative-management-tabs-region",
|
|
28
29
|
detail: "administrative-management-detail-region",
|
|
29
30
|
};
|
|
30
|
-
|
|
31
|
-
export type PrimariaRegionNames =
|
|
32
|
-
| (typeof shellRegions)[keyof typeof shellRegions]
|
|
33
|
-
| (typeof clinicalMonitoringRegions)[keyof typeof clinicalMonitoringRegions]
|
|
34
|
-
| (typeof activityHistoryRegions)[keyof typeof activityHistoryRegions]
|
|
35
|
-
| (typeof administrativeManagementRegions)[keyof typeof administrativeManagementRegions];
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { beforeEach, describe, expect, it, vi } from "vitest";
|
|
2
2
|
import { PrimariaApi } from "../../api/api";
|
|
3
|
-
import { PluginBusyList } from "../../api/plugin-busy-manager/plugin-busy-list/component";
|
|
4
3
|
import { disposeShell, raiseCloseEvent, raiseCustomCloseEvent } from "../../disposer";
|
|
5
4
|
import { disposePlugins } from "../../handle-plugins";
|
|
6
5
|
import { ExitShellHandler } from "./handler";
|
|
@@ -21,12 +20,6 @@ const createMockApi = (): PrimariaApi =>
|
|
|
21
20
|
exitGuardManager: {
|
|
22
21
|
canExit: vi.fn().mockResolvedValue(true),
|
|
23
22
|
},
|
|
24
|
-
pluginBusyManager: {
|
|
25
|
-
getTasks: vi.fn().mockReturnValue([]),
|
|
26
|
-
},
|
|
27
|
-
interactionService: {
|
|
28
|
-
confirm: vi.fn(),
|
|
29
|
-
},
|
|
30
23
|
notificationService: {
|
|
31
24
|
error: vi.fn(),
|
|
32
25
|
},
|
|
@@ -131,59 +124,6 @@ describe("ExitShellHandler", () => {
|
|
|
131
124
|
expect(raiseCustomCloseEvent).not.toHaveBeenCalled();
|
|
132
125
|
});
|
|
133
126
|
|
|
134
|
-
describe("legacy pluginBusyManager fallback", () => {
|
|
135
|
-
it("asks for confirmation when canExit allows but legacy busy tasks exist", async () => {
|
|
136
|
-
const busyTasks = [{ taskId: "t1", taskDescription: "saving draft" }];
|
|
137
|
-
const message = { ecapEvent: {} } as ExitShell;
|
|
138
|
-
(mockApi.exitGuardManager.canExit as any).mockResolvedValue(true);
|
|
139
|
-
(mockApi.pluginBusyManager.getTasks as any).mockReturnValue(busyTasks);
|
|
140
|
-
(mockApi.interactionService.confirm as any).mockResolvedValue({ confirmed: true });
|
|
141
|
-
(disposePlugins as any).mockResolvedValue(undefined);
|
|
142
|
-
|
|
143
|
-
await handler.handle(message);
|
|
144
|
-
|
|
145
|
-
expect(mockApi.interactionService.confirm).toHaveBeenCalledWith(
|
|
146
|
-
{ busyTasks },
|
|
147
|
-
{ component: PluginBusyList },
|
|
148
|
-
{
|
|
149
|
-
title: "actions.askExit",
|
|
150
|
-
state: "error",
|
|
151
|
-
confirmButtonText: "Sí",
|
|
152
|
-
cancelButtonText: "No",
|
|
153
|
-
},
|
|
154
|
-
);
|
|
155
|
-
expect(disposePlugins).toHaveBeenCalled();
|
|
156
|
-
expect(disposeShell).toHaveBeenCalled();
|
|
157
|
-
expect(raiseCustomCloseEvent).toHaveBeenCalledWith(message);
|
|
158
|
-
});
|
|
159
|
-
|
|
160
|
-
it("aborts the exit when the legacy busy-task confirmation is declined", async () => {
|
|
161
|
-
const busyTasks = [{ taskId: "t1", taskDescription: "saving draft" }];
|
|
162
|
-
const message = { ecapEvent: {} } as ExitShell;
|
|
163
|
-
(mockApi.exitGuardManager.canExit as any).mockResolvedValue(true);
|
|
164
|
-
(mockApi.pluginBusyManager.getTasks as any).mockReturnValue(busyTasks);
|
|
165
|
-
(mockApi.interactionService.confirm as any).mockResolvedValue({ confirmed: false });
|
|
166
|
-
|
|
167
|
-
await handler.handle(message);
|
|
168
|
-
|
|
169
|
-
expect(mockApi.interactionService.confirm).toHaveBeenCalled();
|
|
170
|
-
expect(disposePlugins).not.toHaveBeenCalled();
|
|
171
|
-
expect(disposeShell).not.toHaveBeenCalled();
|
|
172
|
-
expect(raiseCustomCloseEvent).not.toHaveBeenCalled();
|
|
173
|
-
expect(raiseCloseEvent).not.toHaveBeenCalled();
|
|
174
|
-
});
|
|
175
|
-
|
|
176
|
-
it("does not consult legacy busy tasks when an ExitGuard already vetoed the exit", async () => {
|
|
177
|
-
const message = { ecapEvent: {} } as ExitShell;
|
|
178
|
-
(mockApi.exitGuardManager.canExit as any).mockResolvedValue(false);
|
|
179
|
-
|
|
180
|
-
await handler.handle(message);
|
|
181
|
-
|
|
182
|
-
expect(mockApi.pluginBusyManager.getTasks).not.toHaveBeenCalled();
|
|
183
|
-
expect(mockApi.interactionService.confirm).not.toHaveBeenCalled();
|
|
184
|
-
});
|
|
185
|
-
});
|
|
186
|
-
|
|
187
127
|
describe("ordre de tancament: vistes abans que plugins", () => {
|
|
188
128
|
/**
|
|
189
129
|
* Els cleanups dels `useEffect` s'executen en desmuntar-se el component i poden enviar
|
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
import { inject } from "inversify";
|
|
2
2
|
import { PrimariaApi } from "../../api/api";
|
|
3
|
-
import { PluginBusyList } from "../../api/plugin-busy-manager/plugin-busy-list/component";
|
|
4
|
-
import { PluginTask } from "../../api/plugin-busy-manager/plugin-busy-manager";
|
|
5
3
|
import { disposeShell, raiseCloseEvent, raiseCustomCloseEvent } from "../../disposer";
|
|
6
4
|
import { disposePlugins } from "../../handle-plugins";
|
|
7
5
|
import { TYPES } from "../../infrastructure/ioc/types";
|
|
@@ -17,14 +15,6 @@ export class ExitShellHandler {
|
|
|
17
15
|
const canExit = await this.api.exitGuardManager.canExit();
|
|
18
16
|
if (!canExit) return;
|
|
19
17
|
|
|
20
|
-
// Backwards-compat: external plugins still using the deprecated pluginBusyManager
|
|
21
|
-
// would otherwise lose their exit-confirmation modal. Remove once all consumers migrate.
|
|
22
|
-
const busyTasks = this.api.pluginBusyManager.getTasks();
|
|
23
|
-
if (busyTasks.length > 0) {
|
|
24
|
-
const { confirmed } = await this.askForClose(busyTasks);
|
|
25
|
-
if (!confirmed) return;
|
|
26
|
-
}
|
|
27
|
-
|
|
28
18
|
// Per si un plugin tarda molt en fer dispose, màxim deixarem 5 segons, per no interrompre el tancar infinitament
|
|
29
19
|
await Promise.race([
|
|
30
20
|
this.unmountViewsAndDisposePlugins(), // S'intenta executar un dispose normal
|
|
@@ -58,19 +48,6 @@ export class ExitShellHandler {
|
|
|
58
48
|
return new Promise<void>((resolve) => setTimeout(resolve, ms));
|
|
59
49
|
}
|
|
60
50
|
|
|
61
|
-
private askForClose(busyTasks: PluginTask[]) {
|
|
62
|
-
return this.api.interactionService.confirm(
|
|
63
|
-
{ busyTasks },
|
|
64
|
-
{ component: PluginBusyList },
|
|
65
|
-
{
|
|
66
|
-
title: translate("actions.askExit"),
|
|
67
|
-
state: "error",
|
|
68
|
-
confirmButtonText: "Sí",
|
|
69
|
-
cancelButtonText: "No",
|
|
70
|
-
},
|
|
71
|
-
);
|
|
72
|
-
}
|
|
73
|
-
|
|
74
51
|
private emitClose(exitEvent?: ExitShell): void {
|
|
75
52
|
if (exitEvent) {
|
|
76
53
|
raiseCustomCloseEvent(exitEvent);
|
package/src/index.ts
CHANGED
|
@@ -10,10 +10,11 @@ if (typeof document !== "undefined") {
|
|
|
10
10
|
}
|
|
11
11
|
export * from "./bootstrapper";
|
|
12
12
|
export * from "./disposer";
|
|
13
|
-
export * from "./api/region-manager/regions";
|
|
14
13
|
export * from "./handle-plugins";
|
|
15
14
|
// Superfície pública explícita: `primariaApiFactory`, `activityMonitor` i
|
|
16
15
|
// `sessionRefreshTimer` són singletons interns del shell i no s'exposen.
|
|
16
|
+
// Les constants de regió (`shellRegions`, `clinicalMonitoringRegions`...) tampoc:
|
|
17
|
+
// des de la v8 els plugins han d'usar `api.regionManager.regions.*`.
|
|
17
18
|
// `shellApi` es manté només perquè els hosts (app/sandbox) l'usen per arrencar;
|
|
18
19
|
// els plugins han d'usar l'`api` que reben a `initialize(api)`.
|
|
19
20
|
export type { PrimariaApi } from "./api/api";
|
package/src/locales.ts
CHANGED
|
@@ -35,7 +35,6 @@ export const locales = {
|
|
|
35
35
|
create: "Crear",
|
|
36
36
|
toggleMenuClose: "Tancar menú",
|
|
37
37
|
toggleMenuOpen: "Expandir menú",
|
|
38
|
-
askExit: "Atenció, vols sortir igualment?",
|
|
39
38
|
},
|
|
40
39
|
errors: {
|
|
41
40
|
session: "Hi ha hagut un error amb la sessió. Siusplau, tanca i torna a obrir l'aplicació.",
|
|
@@ -47,9 +46,6 @@ export const locales = {
|
|
|
47
46
|
role: "Tipus de profesional",
|
|
48
47
|
speciality: "Àmbit treball",
|
|
49
48
|
},
|
|
50
|
-
busyManager: {
|
|
51
|
-
title: "Tasques pendents:",
|
|
52
|
-
},
|
|
53
49
|
pdfManager: {
|
|
54
50
|
uploaded: "Document disponible al visor de resultats",
|
|
55
51
|
alreadyUploaded: "Ja s'ha carregat un document amb aquest nom",
|