@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.
@@ -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: Record<string, string>): void;
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: Record<string, string>): void;
11
+ publish(eventType: string, accio: string, payload?: Record<string, string>): void;
12
12
  private createEcapEvent;
13
13
  private raiseEcapEvent;
14
14
  }
@@ -1,2 +1,3 @@
1
1
  export declare const disposeShell: () => void;
2
2
  export declare const raiseCloseEvent: () => void;
3
+ export declare const raiseCustomCloseEvent: (event: string) => void;
@@ -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(message: ExitShell): Promise<void>;
7
+ handle({ ecapEvent }: ExitShell): Promise<void>;
8
8
  private askForClose;
9
9
  private timeout;
10
+ private emitClose;
10
11
  }
@@ -1,4 +1,6 @@
1
1
  import { IRequest } from '../..';
2
2
 
3
3
  export declare class ExitShell implements IRequest<void> {
4
+ ecapEvent?: string | undefined;
5
+ constructor(ecapEvent?: string | undefined);
4
6
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@uxland/primary-shell",
3
- "version": "5.3.4",
3
+ "version": "5.3.6",
4
4
  "description": "Primaria Shell",
5
5
  "author": "UXLand <dev@uxland.es>",
6
6
  "homepage": "https://github.com/uxland/harmonix/tree/app#readme",
@@ -94,7 +94,6 @@
94
94
  }
95
95
  }
96
96
  .create-button-opened {
97
- padding: 1px;
98
97
  cursor: pointer;
99
98
  background-color: #f0f0f0;
100
99
  color: var(--color-primary-700);
@@ -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: Record<string, string>): void;
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: Record<string, string>) {
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
@@ -7,3 +7,7 @@ export const disposeShell = () => {
7
7
  export const raiseCloseEvent = () => {
8
8
  shellApi.ecapEventManager.publish("CLOSE_FORM", "", {});
9
9
  };
10
+
11
+ export const raiseCustomCloseEvent = (event: string) => {
12
+ shellApi.ecapEventManager.publish(event, "", {});
13
+ };
@@ -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(message: ExitShell): Promise<void> {
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
- raiseCloseEvent();
27
+ this.emitClose(ecapEvent);
28
28
  } catch (error) {
29
29
  this.api.notificationService.error(error.message);
30
- raiseCloseEvent();
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
  }
@@ -1,3 +1,5 @@
1
1
  import { IRequest } from "@uxland/primary-shell";
2
2
 
3
- export class ExitShell implements IRequest<void> {}
3
+ export class ExitShell implements IRequest<void> {
4
+ constructor(public ecapEvent?: string) {}
5
+ }
@@ -20,10 +20,5 @@ export const hasItemDivider = (
20
20
  return true;
21
21
  }
22
22
 
23
- const currentDate = new Date(item.date).getTime();
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
  };
@@ -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(