@uxland/primary-shell 5.3.4 → 5.3.6
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 +19 -14
- package/dist/index.js.map +1 -1
- package/dist/index.umd.cjs +7 -7
- package/dist/index.umd.cjs.map +1 -1
- package/dist/primary/shell/src/api/ecap-event-manager/ecap-event-manager.d.ts +2 -2
- package/dist/primary/shell/src/disposer.d.ts +1 -0
- package/dist/primary/shell/src/features/exit/handler.d.ts +2 -1
- package/dist/primary/shell/src/features/exit/request.d.ts +2 -0
- package/package.json +1 -1
- package/src/UI/components/primaria-shell/styles.css +0 -1
- package/src/UI/internal-views/upper-nav-views.ts +1 -1
- package/src/api/ecap-event-manager/ecap-event-manager.ts +3 -3
- package/src/disposer.ts +4 -0
- package/src/features/exit/handler.ts +12 -4
- package/src/features/exit/request.ts +3 -1
- package/src/internal-plugins/activity-history/activity-history-item/domain/business-rules.ts +1 -6
- package/src/internal-plugins/activity-history/activity-history-item/list/UI/timeline/template.ts +1 -0
|
@@ -5,10 +5,10 @@ export declare abstract class EcapEventManager {
|
|
|
5
5
|
* @param eventType - Event type.
|
|
6
6
|
* @param url - Asociated URL to event.
|
|
7
7
|
*/
|
|
8
|
-
abstract publish(eventType: string, accio: string, payload
|
|
8
|
+
abstract publish(eventType: string, accio: string, payload?: Record<string, string>): void;
|
|
9
9
|
}
|
|
10
10
|
declare class EcapEventManagerImpl implements EcapEventManager {
|
|
11
|
-
publish(eventType: string, accio: string, payload
|
|
11
|
+
publish(eventType: string, accio: string, payload?: Record<string, string>): void;
|
|
12
12
|
private createEcapEvent;
|
|
13
13
|
private raiseEcapEvent;
|
|
14
14
|
}
|
|
@@ -4,7 +4,8 @@ import { ExitShell } from './request';
|
|
|
4
4
|
export declare class ExitShellHandler {
|
|
5
5
|
private api;
|
|
6
6
|
constructor(api: PrimariaApi);
|
|
7
|
-
handle(
|
|
7
|
+
handle({ ecapEvent }: ExitShell): Promise<void>;
|
|
8
8
|
private askForClose;
|
|
9
9
|
private timeout;
|
|
10
|
+
private emitClose;
|
|
10
11
|
}
|
package/package.json
CHANGED
|
@@ -35,7 +35,7 @@ const upperNavMenuItems: MenuItemConfig[] = [
|
|
|
35
35
|
label: "Pàgina inici",
|
|
36
36
|
type: "item",
|
|
37
37
|
sortHint: "0010",
|
|
38
|
-
callbackFn: () => shellApi.broker.send(new ExitShell()),
|
|
38
|
+
callbackFn: () => shellApi.broker.send(new ExitShell("OBRIR_PI")),
|
|
39
39
|
},
|
|
40
40
|
{
|
|
41
41
|
id: "processes",
|
|
@@ -7,12 +7,12 @@ export abstract class EcapEventManager {
|
|
|
7
7
|
* @param eventType - Event type.
|
|
8
8
|
* @param url - Asociated URL to event.
|
|
9
9
|
*/
|
|
10
|
-
abstract publish(eventType: string, accio: string, payload
|
|
10
|
+
abstract publish(eventType: string, accio: string, payload?: Record<string, string>): void;
|
|
11
11
|
}
|
|
12
12
|
|
|
13
13
|
class EcapEventManagerImpl implements EcapEventManager {
|
|
14
|
-
publish(eventType: string, accio: string, payload
|
|
15
|
-
const ecapEvent = this.createEcapEvent(eventType, accio, payload);
|
|
14
|
+
publish(eventType: string, accio: string, payload?: Record<string, string>) {
|
|
15
|
+
const ecapEvent = this.createEcapEvent(eventType, accio, payload ?? {});
|
|
16
16
|
this.raiseEcapEvent(ecapEvent);
|
|
17
17
|
}
|
|
18
18
|
|
package/src/disposer.ts
CHANGED
|
@@ -2,7 +2,7 @@ import { PrimariaApi } from "@uxland/primary-shell";
|
|
|
2
2
|
import { TYPES } from "../../infrastructure/ioc/types";
|
|
3
3
|
import { inject } from "inversify";
|
|
4
4
|
import { ExitShell } from "./request";
|
|
5
|
-
import { disposeShell, raiseCloseEvent } from "../../disposer";
|
|
5
|
+
import { disposeShell, raiseCloseEvent, raiseCustomCloseEvent } from "../../disposer";
|
|
6
6
|
import { disposePlugins } from "../../handle-plugins";
|
|
7
7
|
import { PluginBusyTask } from "../../api/plugin-busy-manager/plugin-busy-manager";
|
|
8
8
|
import { PluginBusyList } from "../../api/plugin-busy-manager/plugin-busy-list/component";
|
|
@@ -10,7 +10,7 @@ import { translate } from "../../locales";
|
|
|
10
10
|
|
|
11
11
|
export class ExitShellHandler {
|
|
12
12
|
constructor(@inject(TYPES.primaryApi) private api: PrimariaApi) {}
|
|
13
|
-
async handle(
|
|
13
|
+
async handle({ ecapEvent }: ExitShell): Promise<void> {
|
|
14
14
|
try {
|
|
15
15
|
const busyTasks = this.api.pluginBusyManager.getBusyPluginTasks();
|
|
16
16
|
if (busyTasks.length > 0) {
|
|
@@ -24,10 +24,10 @@ export class ExitShellHandler {
|
|
|
24
24
|
this.timeout(5000), // Si passen 5s, es segueix amb l'execució
|
|
25
25
|
]);
|
|
26
26
|
disposeShell();
|
|
27
|
-
|
|
27
|
+
this.emitClose(ecapEvent);
|
|
28
28
|
} catch (error) {
|
|
29
29
|
this.api.notificationService.error(error.message);
|
|
30
|
-
|
|
30
|
+
this.emitClose(ecapEvent);
|
|
31
31
|
}
|
|
32
32
|
}
|
|
33
33
|
|
|
@@ -43,4 +43,12 @@ export class ExitShellHandler {
|
|
|
43
43
|
private timeout(ms: number) {
|
|
44
44
|
return new Promise<void>((resolve) => setTimeout(resolve, ms));
|
|
45
45
|
}
|
|
46
|
+
|
|
47
|
+
private emitClose(ecapEvent?: string): void {
|
|
48
|
+
if (ecapEvent) {
|
|
49
|
+
raiseCustomCloseEvent(ecapEvent);
|
|
50
|
+
} else {
|
|
51
|
+
raiseCloseEvent();
|
|
52
|
+
}
|
|
53
|
+
}
|
|
46
54
|
}
|
package/src/internal-plugins/activity-history/activity-history-item/domain/business-rules.ts
CHANGED
|
@@ -20,10 +20,5 @@ export const hasItemDivider = (
|
|
|
20
20
|
return true;
|
|
21
21
|
}
|
|
22
22
|
|
|
23
|
-
|
|
24
|
-
const nextDate = new Date(items[currentIndex + 1].date).getTime();
|
|
25
|
-
|
|
26
|
-
const diffMinutes = Math.abs(nextDate - currentDate) / (1000 * 60);
|
|
27
|
-
|
|
28
|
-
return diffMinutes > 15;
|
|
23
|
+
return !item.diagnostics.length;
|
|
29
24
|
};
|
package/src/internal-plugins/activity-history/activity-history-item/list/UI/timeline/template.ts
CHANGED
|
@@ -98,6 +98,7 @@ const renderProfessionalValues = (props: ActivityHistoryTimeline, item: IActivit
|
|
|
98
98
|
showRole ? props.highlighted(item.professional.role.description) : null,
|
|
99
99
|
props.highlighted(item.center.description),
|
|
100
100
|
props.highlighted(item.professional.speciality.description),
|
|
101
|
+
props.highlighted(item.service.description),
|
|
101
102
|
].filter(Boolean);
|
|
102
103
|
|
|
103
104
|
const professionalValues = professionalItems.map(
|