@uxland/primary-shell 7.29.6 → 7.29.12
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-DIEgkBBL.js → component-ArjwXoXT.js} +2 -2
- package/dist/{component-DIEgkBBL.js.map → component-ArjwXoXT.js.map} +1 -1
- package/dist/{index-CBLcIQsk.js → index-CRH7Fdpk.js} +153 -139
- package/dist/index-CRH7Fdpk.js.map +1 -0
- package/dist/index.js +16 -17
- package/dist/index.umd.cjs +48 -49
- package/dist/index.umd.cjs.map +1 -1
- package/dist/primary/shell/src/UI/shared-components/primaria-nav-tree-menu/primaria-nav-tree-menu.d.ts +1 -1
- package/dist/primary/shell/src/api/broker/broker-events.d.ts +10 -0
- package/dist/primary/shell/src/index.d.ts +0 -1
- package/package.json +2 -2
- package/src/UI/components/clinical-pathways-action-menu/styles.css +4 -0
- package/src/UI/components/communication-action-menu/styles.css +4 -0
- package/src/UI/components/navigation-tooltip/tooltip-manager.ts +3 -3
- package/src/UI/components/primaria-shell/primaria-shell.ts +10 -10
- package/src/UI/shared-components/primaria-nav-item/primaria-nav-item.ts +2 -2
- package/src/UI/shared-components/primaria-nav-item/styles.css +4 -0
- package/src/UI/shared-components/primaria-nav-item/template.ts +3 -4
- package/src/UI/shared-components/primaria-nav-tree-menu/primaria-nav-tree-menu.ts +6 -5
- package/src/UI/shared-components/primaria-nav-tree-menu/template.ts +35 -39
- package/src/api/broker/broker-events.ts +10 -0
- package/src/api/http-client/http-client.test.ts +6 -6
- package/src/api/http-client/http-client.ts +3 -3
- package/src/api/quick-action-busy-manager/quick-action-busy-manager.test.ts +3 -3
- package/src/api/quick-action-busy-manager/quick-action-busy-manager.ts +2 -2
- package/src/api/region-manager/region-manager.test.ts +3 -3
- package/src/api/region-manager/region-manager.ts +2 -2
- package/src/features/visit/finalize-visit/component/template.ts +2 -2
- package/src/index.ts +0 -1
- package/dist/index-CBLcIQsk.js.map +0 -1
- package/dist/primary/shell/src/events.d.ts +0 -9
- package/src/events.ts +0 -9
|
@@ -3,9 +3,9 @@ import { PrimariaNavItemConfig, PrimariaNavTreeMenuConfig } from '../typings';
|
|
|
3
3
|
export declare class PrimariaNavTreeMenu extends LitElement {
|
|
4
4
|
static styles: import('lit').CSSResult;
|
|
5
5
|
config: PrimariaNavTreeMenuConfig;
|
|
6
|
-
primariaNavItemConfig: PrimariaNavItemConfig;
|
|
7
6
|
showActionMenu: boolean;
|
|
8
7
|
constructor(config: PrimariaNavTreeMenuConfig);
|
|
8
|
+
get primariaNavItemConfig(): PrimariaNavItemConfig;
|
|
9
9
|
handleItemClick: () => void;
|
|
10
10
|
handleCloseMenu: () => void;
|
|
11
11
|
render(): import('lit').TemplateResult<1>;
|
|
@@ -13,6 +13,16 @@ export declare const BROKER_EVENTS: {
|
|
|
13
13
|
readonly addHistoryItemRequest: "add_history_item_request";
|
|
14
14
|
readonly addHistoryItemsRequest: "add_history_items_request";
|
|
15
15
|
readonly updateHistoryItemRequest: "update_history_item_request";
|
|
16
|
+
readonly removeHistoryItemRequest: "remove_history_item_request";
|
|
17
|
+
};
|
|
18
|
+
readonly shell: {
|
|
19
|
+
readonly appCrashed: "appCrashed";
|
|
20
|
+
readonly mainViewChanged: "mainViewChanged";
|
|
21
|
+
readonly refreshTokenFailed: "refreshTokenFailed";
|
|
22
|
+
readonly mpidHeaderInvalid: "mpidHeaderInvalid";
|
|
23
|
+
readonly quickActionBusyChanged: "quickActionBusyChanged";
|
|
24
|
+
readonly scrollToNavItemRequested: "scrollToNavItemRequested";
|
|
25
|
+
readonly scrollToNavItemCompleted: "scrollToNavItemCompleted";
|
|
16
26
|
};
|
|
17
27
|
};
|
|
18
28
|
export type BrokerEvents = typeof BROKER_EVENTS;
|
|
@@ -4,7 +4,6 @@ export * from './api/region-manager/regions';
|
|
|
4
4
|
export * from './handle-plugins';
|
|
5
5
|
export * from './api/api';
|
|
6
6
|
export * from './api/broker/primaria-broker';
|
|
7
|
-
export { BROKER_EVENTS } from './api/broker/broker-events';
|
|
8
7
|
export type { PrimariaContextManager, EcapContext } from './api/context-manager/context-manager';
|
|
9
8
|
export * from './UI/index';
|
|
10
9
|
export { PrimariaNavItem } from './UI/shared-components/primaria-nav-item/primaria-nav-item';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@uxland/primary-shell",
|
|
3
|
-
"version": "7.29.
|
|
3
|
+
"version": "7.29.12",
|
|
4
4
|
"description": "Primaria Shell",
|
|
5
5
|
"author": "UXLand <dev@uxland.es>",
|
|
6
6
|
"homepage": "https://github.com/uxland/harmonix/tree/app#readme",
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
"url": "https://github.com/uxland/harmonix/issues"
|
|
26
26
|
},
|
|
27
27
|
"dependencies": {
|
|
28
|
-
"@uxland/harmonix": "^1.1.
|
|
28
|
+
"@uxland/harmonix": "^1.1.3",
|
|
29
29
|
"@uxland/harmonix-adapters": "^1.2.2"
|
|
30
30
|
},
|
|
31
31
|
"devDependencies": {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { shellApi } from "../../../api/api";
|
|
2
|
-
import {
|
|
2
|
+
import { BROKER_EVENTS } from "../../../api/broker/broker-events";
|
|
3
3
|
import { renderNavigationTooltip } from "./navigation-tooltip";
|
|
4
4
|
|
|
5
5
|
const scrollToNavItem = (
|
|
@@ -7,14 +7,14 @@ const scrollToNavItem = (
|
|
|
7
7
|
): Promise<{ scrollTop: number; containerTop: number; itemIndex: number; itemAbsoluteY: number }> => {
|
|
8
8
|
return new Promise((resolve) => {
|
|
9
9
|
const subscription = shellApi.broker.subscribe(
|
|
10
|
-
|
|
10
|
+
BROKER_EVENTS.shell.scrollToNavItemCompleted,
|
|
11
11
|
(data: { scrollTop: number; containerTop: number; itemIndex: number; itemAbsoluteY: number }) => {
|
|
12
12
|
subscription.dispose();
|
|
13
13
|
resolve(data);
|
|
14
14
|
},
|
|
15
15
|
);
|
|
16
16
|
|
|
17
|
-
shellApi.broker.publish(
|
|
17
|
+
shellApi.broker.publish(BROKER_EVENTS.shell.scrollToNavItemRequested, navItemMenuKey);
|
|
18
18
|
|
|
19
19
|
// Fallback timeout in case the event doesn't arrive
|
|
20
20
|
setTimeout(() => {
|
|
@@ -3,7 +3,7 @@ import { LitElement, css, html, unsafeCSS } from "lit";
|
|
|
3
3
|
import { state } from "lit/decorators.js";
|
|
4
4
|
import { PrimariaRegionHost, shellApi } from "../../../api/api";
|
|
5
5
|
import { disposeShell } from "../../../disposer";
|
|
6
|
-
import {
|
|
6
|
+
import { BROKER_EVENTS } from "../../../api/broker/broker-events";
|
|
7
7
|
import { translate } from "../../../locales";
|
|
8
8
|
import { shellViews } from "./constants";
|
|
9
9
|
import styles from "./styles.css?inline";
|
|
@@ -67,31 +67,31 @@ export class PrimariaShell extends PrimariaRegionHost(LitElement) {
|
|
|
67
67
|
|
|
68
68
|
_subscribeEvents() {
|
|
69
69
|
this.subscriptions.push(
|
|
70
|
-
shellApi.broker.subscribe(
|
|
70
|
+
shellApi.broker.subscribe(BROKER_EVENTS.shell.appCrashed, (error: { message: string }) => {
|
|
71
71
|
this._handleError(error);
|
|
72
72
|
}),
|
|
73
73
|
);
|
|
74
74
|
|
|
75
75
|
this.subscriptions.push(
|
|
76
|
-
shellApi.broker.subscribe(
|
|
76
|
+
shellApi.broker.subscribe(BROKER_EVENTS.shell.refreshTokenFailed, (detail: any) => {
|
|
77
77
|
this._handleError({ message: translate("errors.session") });
|
|
78
78
|
}),
|
|
79
79
|
);
|
|
80
80
|
|
|
81
81
|
this.subscriptions.push(
|
|
82
|
-
shellApi.broker.subscribe(
|
|
82
|
+
shellApi.broker.subscribe(BROKER_EVENTS.shell.mpidHeaderInvalid, (detail: any) => {
|
|
83
83
|
this._handleError({ message: translate("errors.invalidPatient") });
|
|
84
84
|
}),
|
|
85
85
|
);
|
|
86
86
|
|
|
87
87
|
this.subscriptions.push(
|
|
88
|
-
shellApi.broker.subscribe(
|
|
88
|
+
shellApi.broker.subscribe(BROKER_EVENTS.shell.quickActionBusyChanged, (detail: { busy: boolean }) => {
|
|
89
89
|
this.quickActionBusy = detail.busy;
|
|
90
90
|
}),
|
|
91
91
|
);
|
|
92
92
|
|
|
93
93
|
this.subscriptions.push(
|
|
94
|
-
shellApi.broker.subscribe(
|
|
94
|
+
shellApi.broker.subscribe(BROKER_EVENTS.shell.scrollToNavItemRequested, (navItemMenuKey: string) => {
|
|
95
95
|
this._scrollToNavItem(navItemMenuKey);
|
|
96
96
|
}),
|
|
97
97
|
);
|
|
@@ -119,7 +119,7 @@ export class PrimariaShell extends PrimariaRegionHost(LitElement) {
|
|
|
119
119
|
const targetView = allViews.find((view: any) => view.id === viewId);
|
|
120
120
|
|
|
121
121
|
if (!targetView) {
|
|
122
|
-
shellApi.broker.publish(
|
|
122
|
+
shellApi.broker.publish(BROKER_EVENTS.shell.scrollToNavItemCompleted, {
|
|
123
123
|
scrollTop: 0,
|
|
124
124
|
containerTop: 0,
|
|
125
125
|
itemIndex: -1,
|
|
@@ -137,7 +137,7 @@ export class PrimariaShell extends PrimariaRegionHost(LitElement) {
|
|
|
137
137
|
const targetIndex = sortedViews.findIndex((view: any) => view.id === viewId);
|
|
138
138
|
|
|
139
139
|
if (targetIndex === -1) {
|
|
140
|
-
shellApi.broker.publish(
|
|
140
|
+
shellApi.broker.publish(BROKER_EVENTS.shell.scrollToNavItemCompleted, {
|
|
141
141
|
scrollTop: 0,
|
|
142
142
|
containerTop: 0,
|
|
143
143
|
itemIndex: -1,
|
|
@@ -147,7 +147,7 @@ export class PrimariaShell extends PrimariaRegionHost(LitElement) {
|
|
|
147
147
|
|
|
148
148
|
const menuContainer = this.shadowRoot?.querySelector("#menu-region-container") as HTMLElement;
|
|
149
149
|
if (!menuContainer) {
|
|
150
|
-
shellApi.broker.publish(
|
|
150
|
+
shellApi.broker.publish(BROKER_EVENTS.shell.scrollToNavItemCompleted, {
|
|
151
151
|
scrollTop: 0,
|
|
152
152
|
containerTop: 0,
|
|
153
153
|
itemIndex: targetIndex,
|
|
@@ -187,7 +187,7 @@ export class PrimariaShell extends PrimariaRegionHost(LitElement) {
|
|
|
187
187
|
itemIndex: targetIndex,
|
|
188
188
|
itemAbsoluteY: itemAbsoluteY,
|
|
189
189
|
};
|
|
190
|
-
shellApi.broker.publish(
|
|
190
|
+
shellApi.broker.publish(BROKER_EVENTS.shell.scrollToNavItemCompleted, data);
|
|
191
191
|
}, 300);
|
|
192
192
|
}
|
|
193
193
|
}
|
|
@@ -2,7 +2,7 @@ import { regionView } from "@uxland/regions";
|
|
|
2
2
|
import { LitElement, PropertyValues, css, html, unsafeCSS } from "lit";
|
|
3
3
|
import { property, state } from "lit/decorators.js";
|
|
4
4
|
import { shellApi } from "../../../api/api";
|
|
5
|
-
import {
|
|
5
|
+
import { BROKER_EVENTS } from "../../../api/broker/broker-events";
|
|
6
6
|
import { PrimariaNavItemConfig } from "../typings";
|
|
7
7
|
import styles from "./styles.css?inline";
|
|
8
8
|
import { template } from "./template";
|
|
@@ -47,7 +47,7 @@ export class PrimariaNavItem extends regionView(LitElement) {
|
|
|
47
47
|
}
|
|
48
48
|
|
|
49
49
|
_subscribeEvents() {
|
|
50
|
-
const subscription = shellApi.broker.subscribe(
|
|
50
|
+
const subscription = shellApi.broker.subscribe(BROKER_EVENTS.shell.mainViewChanged, (payload: { viewId: string }) => {
|
|
51
51
|
this.isActive = payload.viewId === this.view?.id;
|
|
52
52
|
});
|
|
53
53
|
this.subscriptions.push(subscription);
|
|
@@ -4,12 +4,11 @@ import { classMap } from "lit/directives/class-map.js";
|
|
|
4
4
|
|
|
5
5
|
export const template = (props: PrimariaNavItem) => {
|
|
6
6
|
return html`
|
|
7
|
-
<div
|
|
8
|
-
class=${classMap({ item: true, active: props.isActive })}
|
|
9
|
-
@click=${props.config.callbackFn}
|
|
7
|
+
<div
|
|
8
|
+
class=${classMap({ item: true, active: props.isActive })}
|
|
10
9
|
?expanded=${props.showText}
|
|
11
10
|
>
|
|
12
|
-
<div class="icon-label">
|
|
11
|
+
<div class="icon-label" @click=${props.config.callbackFn}>
|
|
13
12
|
<dss-icon icon=${props.config.icon} size="md" ?fill=${props.config.fill} style=${props.config.rotateIcon ? "transform: rotate(180deg);" : ""}></dss-icon>
|
|
14
13
|
${props.showText ? html`<span>${props.config.label}</span>` : ""}
|
|
15
14
|
</div>
|
|
@@ -10,16 +10,18 @@ export class PrimariaNavTreeMenu extends LitElement {
|
|
|
10
10
|
`;
|
|
11
11
|
|
|
12
12
|
@property({ type: Object }) config: PrimariaNavTreeMenuConfig;
|
|
13
|
-
@state() primariaNavItemConfig: PrimariaNavItemConfig;
|
|
14
13
|
|
|
15
14
|
@state() showActionMenu = false;
|
|
16
15
|
|
|
17
16
|
constructor(config: PrimariaNavTreeMenuConfig) {
|
|
18
17
|
super();
|
|
19
18
|
this.config = config;
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
get primariaNavItemConfig(): PrimariaNavItemConfig {
|
|
22
|
+
return {
|
|
23
|
+
icon: this.config.icon,
|
|
24
|
+
label: this.config.label,
|
|
23
25
|
showArrow: true,
|
|
24
26
|
callbackFn: this.handleItemClick,
|
|
25
27
|
};
|
|
@@ -27,7 +29,6 @@ export class PrimariaNavTreeMenu extends LitElement {
|
|
|
27
29
|
|
|
28
30
|
handleItemClick = () => {
|
|
29
31
|
this.showActionMenu = true;
|
|
30
|
-
this.requestUpdate();
|
|
31
32
|
};
|
|
32
33
|
|
|
33
34
|
handleCloseMenu = () => {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { html
|
|
1
|
+
import { html } from "lit";
|
|
2
2
|
import { PrimariaNavTreeMenu } from "./primaria-nav-tree-menu";
|
|
3
3
|
import { classMap } from "lit/directives/class-map.js";
|
|
4
4
|
|
|
@@ -6,45 +6,41 @@ export const template = (props: PrimariaNavTreeMenu) => html`
|
|
|
6
6
|
<div class="wrapper">
|
|
7
7
|
<primaria-nav-item
|
|
8
8
|
.config=${props.primariaNavItemConfig}
|
|
9
|
-
@click=${props.handleItemClick}
|
|
10
9
|
class="${classMap({ "menu-active": props.showActionMenu })}"
|
|
11
10
|
></primaria-nav-item>
|
|
12
|
-
|
|
13
|
-
props.
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
`
|
|
47
|
-
: nothing
|
|
48
|
-
}
|
|
11
|
+
<dss-action-menu
|
|
12
|
+
@onCloseActionMenu=${props.handleCloseMenu}
|
|
13
|
+
?hidden=${!props.showActionMenu}
|
|
14
|
+
>
|
|
15
|
+
${props.config.actionMenuItems?.map((item) =>
|
|
16
|
+
item.hasNestedMenu
|
|
17
|
+
? html`
|
|
18
|
+
<dss-action-menu-item
|
|
19
|
+
righticon=${item.icon}
|
|
20
|
+
.label=${item.label}
|
|
21
|
+
hasnestedmenu
|
|
22
|
+
>
|
|
23
|
+
<dss-action-menu>
|
|
24
|
+
${item.nestedMenuItems?.map(
|
|
25
|
+
(nestedItem) => html`
|
|
26
|
+
<dss-action-menu-item
|
|
27
|
+
righticon=${nestedItem.icon}
|
|
28
|
+
.label=${nestedItem.label}
|
|
29
|
+
@click=${nestedItem.callbackFn}
|
|
30
|
+
></dss-action-menu-item>
|
|
31
|
+
`,
|
|
32
|
+
)}
|
|
33
|
+
</dss-action-menu>
|
|
34
|
+
</dss-action-menu-item>
|
|
35
|
+
`
|
|
36
|
+
: html`
|
|
37
|
+
<dss-action-menu-item
|
|
38
|
+
righticon=${item.icon}
|
|
39
|
+
.label=${item.label}
|
|
40
|
+
@click=${item.callbackFn}
|
|
41
|
+
></dss-action-menu-item>
|
|
42
|
+
`,
|
|
43
|
+
)}
|
|
44
|
+
</dss-action-menu>
|
|
49
45
|
</div>
|
|
50
46
|
`;
|
|
@@ -13,6 +13,16 @@ export const BROKER_EVENTS = {
|
|
|
13
13
|
addHistoryItemRequest: "add_history_item_request",
|
|
14
14
|
addHistoryItemsRequest: "add_history_items_request",
|
|
15
15
|
updateHistoryItemRequest: "update_history_item_request",
|
|
16
|
+
removeHistoryItemRequest: "remove_history_item_request",
|
|
17
|
+
},
|
|
18
|
+
shell: {
|
|
19
|
+
appCrashed: "appCrashed",
|
|
20
|
+
mainViewChanged: "mainViewChanged",
|
|
21
|
+
refreshTokenFailed: "refreshTokenFailed",
|
|
22
|
+
mpidHeaderInvalid: "mpidHeaderInvalid",
|
|
23
|
+
quickActionBusyChanged: "quickActionBusyChanged",
|
|
24
|
+
scrollToNavItemRequested: "scrollToNavItemRequested",
|
|
25
|
+
scrollToNavItemCompleted: "scrollToNavItemCompleted",
|
|
16
26
|
},
|
|
17
27
|
} as const;
|
|
18
28
|
|
|
@@ -3,7 +3,7 @@ import AxiosMockAdapter from "axios-mock-adapter";
|
|
|
3
3
|
import { beforeEach, describe, expect, it, vi } from "vitest";
|
|
4
4
|
import { TokenManager, createTokenManager } from "../token-manager/token-manager";
|
|
5
5
|
import { createAxiosInstance } from "./http-client";
|
|
6
|
-
import {
|
|
6
|
+
import { BROKER_EVENTS } from "../broker/broker-events";
|
|
7
7
|
import { createBroker } from "../broker/factory";
|
|
8
8
|
|
|
9
9
|
const access_token =
|
|
@@ -91,8 +91,8 @@ describe("HTTP Client", () => {
|
|
|
91
91
|
);
|
|
92
92
|
|
|
93
93
|
expect(axiosMockInstance.history.get?.length).toBe(1); // No retry happened
|
|
94
|
-
expect(brokerSpy).toHaveBeenCalledWith(
|
|
95
|
-
expect(brokerSpy).toHaveBeenCalledWith(
|
|
94
|
+
expect(brokerSpy).toHaveBeenCalledWith(BROKER_EVENTS.shell.refreshTokenFailed, expect.any(Object));
|
|
95
|
+
expect(brokerSpy).toHaveBeenCalledWith(BROKER_EVENTS.shell.refreshTokenFailed, {
|
|
96
96
|
request: expect.objectContaining({ url: "/api/clinical-course" }),
|
|
97
97
|
});
|
|
98
98
|
});
|
|
@@ -139,7 +139,7 @@ describe("HTTP Client", () => {
|
|
|
139
139
|
await expect(axiosInstance.get("/api/clinical-course")).rejects.toThrow(
|
|
140
140
|
"Mpid header value is invalid",
|
|
141
141
|
);
|
|
142
|
-
expect(brokerSpy).toHaveBeenCalledWith(
|
|
142
|
+
expect(brokerSpy).toHaveBeenCalledWith(BROKER_EVENTS.shell.mpidHeaderInvalid, expect.any(Object));
|
|
143
143
|
});
|
|
144
144
|
|
|
145
145
|
it("should make a request with header and respond succesful if x-catsalut-mpid has valid value ", async () => {
|
|
@@ -200,8 +200,8 @@ describe("HTTP Client", () => {
|
|
|
200
200
|
);
|
|
201
201
|
|
|
202
202
|
expect(axiosMockInstance.history.get?.length).toBe(1); // No retry happened
|
|
203
|
-
expect(brokerSpy).toHaveBeenCalledWith(
|
|
204
|
-
expect(brokerSpy).toHaveBeenCalledWith(
|
|
203
|
+
expect(brokerSpy).toHaveBeenCalledWith(BROKER_EVENTS.shell.refreshTokenFailed, expect.any(Object));
|
|
204
|
+
expect(brokerSpy).toHaveBeenCalledWith(BROKER_EVENTS.shell.refreshTokenFailed, {
|
|
205
205
|
request: expect.objectContaining({ url: "/api/clinical-course" }),
|
|
206
206
|
});
|
|
207
207
|
});
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import axios, { AxiosRequestConfig, AxiosResponse } from "axios";
|
|
2
2
|
import { TokenManager } from "../token-manager/token-manager";
|
|
3
|
-
import {
|
|
3
|
+
import { BROKER_EVENTS } from "../broker/broker-events";
|
|
4
4
|
import { PrimariaBroker } from "../broker/primaria-broker";
|
|
5
5
|
import { jwtDecode } from "jwt-decode";
|
|
6
6
|
|
|
@@ -52,7 +52,7 @@ export const createAxiosInstance = (
|
|
|
52
52
|
return response;
|
|
53
53
|
} catch (error) {
|
|
54
54
|
if (error instanceof InvalidMpidHeaderError) {
|
|
55
|
-
broker.publish(
|
|
55
|
+
broker.publish(BROKER_EVENTS.shell.mpidHeaderInvalid, {
|
|
56
56
|
request: response.config,
|
|
57
57
|
});
|
|
58
58
|
}
|
|
@@ -69,7 +69,7 @@ export const createAxiosInstance = (
|
|
|
69
69
|
return instance(originalRequest);
|
|
70
70
|
} catch (refreshError) {
|
|
71
71
|
console.error("Error refreshing token:", refreshError);
|
|
72
|
-
broker.publish(
|
|
72
|
+
broker.publish(BROKER_EVENTS.shell.refreshTokenFailed, {
|
|
73
73
|
request: originalRequest,
|
|
74
74
|
});
|
|
75
75
|
return Promise.reject(error);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { describe, it, expect, vi, beforeEach } from "vitest";
|
|
2
2
|
import { QuickActionBusyManagerImpl } from "./quick-action-busy-manager";
|
|
3
|
-
import {
|
|
3
|
+
import { BROKER_EVENTS } from "../broker/broker-events";
|
|
4
4
|
|
|
5
5
|
describe("QuickActionBusyManagerImpl", () => {
|
|
6
6
|
let brokerMock: any;
|
|
@@ -17,7 +17,7 @@ describe("QuickActionBusyManagerImpl", () => {
|
|
|
17
17
|
it("should add a task and emit event", () => {
|
|
18
18
|
const task = { taskId: "qa1" };
|
|
19
19
|
manager.addTask(task);
|
|
20
|
-
expect(brokerMock.publish).toHaveBeenCalledWith(
|
|
20
|
+
expect(brokerMock.publish).toHaveBeenCalledWith(BROKER_EVENTS.shell.quickActionBusyChanged, {
|
|
21
21
|
busy: true,
|
|
22
22
|
});
|
|
23
23
|
});
|
|
@@ -37,7 +37,7 @@ describe("QuickActionBusyManagerImpl", () => {
|
|
|
37
37
|
const task = { taskId: "qa1" };
|
|
38
38
|
manager.addTask(task);
|
|
39
39
|
manager.removeTask("qa1");
|
|
40
|
-
expect(brokerMock.publish).toHaveBeenCalledWith(
|
|
40
|
+
expect(brokerMock.publish).toHaveBeenCalledWith(BROKER_EVENTS.shell.quickActionBusyChanged, {
|
|
41
41
|
busy: false,
|
|
42
42
|
});
|
|
43
43
|
});
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { BROKER_EVENTS } from "../broker/broker-events";
|
|
2
2
|
import { PrimariaBroker } from "../broker/primaria-broker";
|
|
3
3
|
|
|
4
4
|
export interface QuickActionTask {
|
|
@@ -45,6 +45,6 @@ export class QuickActionBusyManagerImpl implements QuickActionBusyManager {
|
|
|
45
45
|
|
|
46
46
|
private emitBusyChanged(): void {
|
|
47
47
|
const busy = this.isBusy();
|
|
48
|
-
this.broker.publish(
|
|
48
|
+
this.broker.publish(BROKER_EVENTS.shell.quickActionBusyChanged, { busy });
|
|
49
49
|
}
|
|
50
50
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { describe, it, expect, vi, beforeEach } from "vitest";
|
|
2
2
|
import { createRegionManagerProxy } from "./region-manager";
|
|
3
|
-
import {
|
|
3
|
+
import { BROKER_EVENTS } from "../broker/broker-events";
|
|
4
4
|
|
|
5
5
|
const pluginId = "test-plugin";
|
|
6
6
|
const mockView = { id: "view1" };
|
|
@@ -48,7 +48,7 @@ describe("RegionManagerProxy", () => {
|
|
|
48
48
|
it("activateView should activate the view and notify if region is main", async () => {
|
|
49
49
|
await proxy.activateView(proxy.regions.shell.main, "view1");
|
|
50
50
|
expect(regionMock.activate).toHaveBeenCalledWith(`${pluginId}::view1`);
|
|
51
|
-
expect(broker.publish).toHaveBeenCalledWith(
|
|
51
|
+
expect(broker.publish).toHaveBeenCalledWith(BROKER_EVENTS.shell.mainViewChanged, { viewId: "view1" });
|
|
52
52
|
});
|
|
53
53
|
|
|
54
54
|
it("deactivateView should deactivate the view", async () => {
|
|
@@ -102,7 +102,7 @@ describe("RegionManagerProxy", () => {
|
|
|
102
102
|
it("activateMainView should activate main view and notify broker", async () => {
|
|
103
103
|
await proxy.activateMainView("view1");
|
|
104
104
|
expect(regionMock.activate).toHaveBeenCalledWith(`${pluginId}::view1`);
|
|
105
|
-
expect(broker.publish).toHaveBeenCalledWith(
|
|
105
|
+
expect(broker.publish).toHaveBeenCalledWith(BROKER_EVENTS.shell.mainViewChanged, { viewId: "view1" });
|
|
106
106
|
});
|
|
107
107
|
|
|
108
108
|
it("getCurrentMainViewActive should return id of the active main view", () => {
|
|
@@ -3,7 +3,7 @@ import { PluginInfo } from "../../handle-plugins";
|
|
|
3
3
|
import { IRegion } from "@uxland/regions";
|
|
4
4
|
import { shellRegions, clinicalMonitoringRegions, activityHistoryRegions } from "./regions";
|
|
5
5
|
import { PrimariaBroker } from "../broker/primaria-broker";
|
|
6
|
-
import {
|
|
6
|
+
import { BROKER_EVENTS } from "../broker/broker-events";
|
|
7
7
|
|
|
8
8
|
export interface PrimariaRegionManager extends HarmonixRegionManager {
|
|
9
9
|
regions: {
|
|
@@ -133,7 +133,7 @@ class RegionManagerProxy implements PrimariaRegionManager {
|
|
|
133
133
|
}
|
|
134
134
|
|
|
135
135
|
_notifyMainViewChanged(viewId: string) {
|
|
136
|
-
this.broker.publish(
|
|
136
|
+
this.broker.publish(BROKER_EVENTS.shell.mainViewChanged, { viewId });
|
|
137
137
|
}
|
|
138
138
|
|
|
139
139
|
_destroy() {
|
|
@@ -4,6 +4,6 @@ import { translate } from "../../../../locales";
|
|
|
4
4
|
|
|
5
5
|
export const template = (props: FinalizeVisitButton) => {
|
|
6
6
|
return html`
|
|
7
|
-
|
|
8
|
-
`;
|
|
7
|
+
<dss-button @click=${props.finalizeVisitHandler} variant="subtle" size="md" icon="door_front" label=${translate("actions.finalizeVisit")}></dss-button>
|
|
8
|
+
`;
|
|
9
9
|
};
|
package/src/index.ts
CHANGED
|
@@ -14,7 +14,6 @@ export * from "./api/region-manager/regions";
|
|
|
14
14
|
export * from "./handle-plugins";
|
|
15
15
|
export * from "./api/api";
|
|
16
16
|
export * from "./api/broker/primaria-broker";
|
|
17
|
-
export { BROKER_EVENTS } from "./api/broker/broker-events";
|
|
18
17
|
export type { PrimariaContextManager, EcapContext } from "./api/context-manager/context-manager";
|
|
19
18
|
export * from "./UI/index";
|
|
20
19
|
export { PrimariaNavItem } from "./UI/shared-components/primaria-nav-item/primaria-nav-item";
|