@uxland/primary-shell 7.46.10 → 7.46.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-B4MBATTL.js → component-BzmmJiBs.js} +2 -2
- package/dist/{component-B4MBATTL.js.map → component-BzmmJiBs.js.map} +1 -1
- package/dist/{index-BgG_JnBV.js → index-BRK-x41J.js} +245 -309
- package/dist/index-BRK-x41J.js.map +1 -0
- package/dist/index.js +1 -1
- package/dist/index.umd.cjs +50 -82
- package/dist/index.umd.cjs.map +1 -1
- package/dist/{plugin-Ki8G_OEU.js → plugin-B4gkpTjT.js} +2 -2
- package/dist/{plugin-Ki8G_OEU.js.map → plugin-B4gkpTjT.js.map} +1 -1
- package/dist/primary/shell/src/UI/components/clinical-pathways-action-menu/clinical-pathways-action-menu.d.ts +4 -12
- package/dist/primary/shell/src/UI/components/communication-action-menu/communication-action-menu.d.ts +4 -12
- package/dist/primary/shell/src/UI/components/petitioner-action-menu/petitioner-action-menu.d.ts +4 -12
- package/dist/primary/shell/src/UI/components/sidenav-action-menu/sidenav-action-menu.d.ts +27 -0
- package/dist/primary/shell/src/UI/components/sidenav-action-menu/template.d.ts +2 -0
- package/dist/primary/shell/src/features/get-visi-id/action.d.ts +1 -1
- package/package.json +2 -2
- package/src/UI/components/clinical-pathways-action-menu/clinical-pathways-action-menu.ts +6 -41
- package/src/UI/components/communication-action-menu/communication-action-menu.ts +6 -41
- package/src/UI/components/petitioner-action-menu/petitioner-action-menu.ts +6 -41
- package/src/UI/components/sidenav-action-menu/sidenav-action-menu.ts +62 -0
- package/src/UI/components/{petitioner-action-menu → sidenav-action-menu}/template.ts +3 -3
- package/src/UI/internal-views/doctor-nav-menu.ts +2 -2
- package/src/features/get-visi-id/action.ts +6 -2
- package/dist/index-BgG_JnBV.js.map +0 -1
- package/dist/primary/shell/src/UI/components/clinical-pathways-action-menu/template.d.ts +0 -2
- package/dist/primary/shell/src/UI/components/communication-action-menu/template.d.ts +0 -2
- package/dist/primary/shell/src/UI/components/petitioner-action-menu/template.d.ts +0 -2
- package/src/UI/components/clinical-pathways-action-menu/template.ts +0 -24
- package/src/UI/components/communication-action-menu/styles.css +0 -29
- package/src/UI/components/communication-action-menu/template.ts +0 -24
- package/src/UI/components/petitioner-action-menu/styles.css +0 -29
- /package/src/UI/components/{clinical-pathways-action-menu → sidenav-action-menu}/styles.css +0 -0
|
@@ -1,15 +1,7 @@
|
|
|
1
1
|
import { IRegion } from '@uxland/regions';
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
export declare class ClinicalPathwaysActionMenu extends
|
|
2
|
+
import { SidenavActionMenu } from '../sidenav-action-menu/sidenav-action-menu';
|
|
3
|
+
/** Menú "Vies clíniques" del menú de navegació: aporta la regió `clinicalPathwaysSidenav`. */
|
|
4
|
+
export declare class ClinicalPathwaysActionMenu extends SidenavActionMenu {
|
|
5
5
|
constructor(icon: string, label: string);
|
|
6
|
-
|
|
7
|
-
clinicalPathwaysSidenavRegion: IRegion | undefined;
|
|
8
|
-
static styles: import('lit').CSSResult;
|
|
9
|
-
firstUpdated(_changedProps: PropertyValues<ClinicalPathwaysActionMenu>): void;
|
|
10
|
-
observeHostResize(): void;
|
|
11
|
-
render(): import('lit').TemplateResult<1>;
|
|
12
|
-
icon: string;
|
|
13
|
-
label: string;
|
|
6
|
+
sidenavRegion: IRegion | undefined;
|
|
14
7
|
}
|
|
15
|
-
export {};
|
|
@@ -1,15 +1,7 @@
|
|
|
1
1
|
import { IRegion } from '@uxland/regions';
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
export declare class CommunicationActionMenu extends
|
|
2
|
+
import { SidenavActionMenu } from '../sidenav-action-menu/sidenav-action-menu';
|
|
3
|
+
/** Menú "Comunicació" del menú de navegació: aporta la regió `communicationSidenav`. */
|
|
4
|
+
export declare class CommunicationActionMenu extends SidenavActionMenu {
|
|
5
5
|
constructor(icon: string, label: string);
|
|
6
|
-
|
|
7
|
-
comminucationSidenavRegion: IRegion | undefined;
|
|
8
|
-
static styles: import('lit').CSSResult;
|
|
9
|
-
firstUpdated(_changedProps: PropertyValues<CommunicationActionMenu>): void;
|
|
10
|
-
observeHostResize(): void;
|
|
11
|
-
render(): import('lit').TemplateResult<1>;
|
|
12
|
-
icon: string;
|
|
13
|
-
label: string;
|
|
6
|
+
sidenavRegion: IRegion | undefined;
|
|
14
7
|
}
|
|
15
|
-
export {};
|
package/dist/primary/shell/src/UI/components/petitioner-action-menu/petitioner-action-menu.d.ts
CHANGED
|
@@ -1,15 +1,7 @@
|
|
|
1
1
|
import { IRegion } from '@uxland/regions';
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
export declare class PetitionerActionMenu extends
|
|
2
|
+
import { SidenavActionMenu } from '../sidenav-action-menu/sidenav-action-menu';
|
|
3
|
+
/** Menú "Peticionari" del menú de navegació: aporta la regió `petitionerSidenav`. */
|
|
4
|
+
export declare class PetitionerActionMenu extends SidenavActionMenu {
|
|
5
5
|
constructor(icon: string, label: string);
|
|
6
|
-
|
|
7
|
-
petitionerSidenavRegion: IRegion | undefined;
|
|
8
|
-
static styles: import('lit').CSSResult;
|
|
9
|
-
firstUpdated(_changedProps: PropertyValues<PetitionerActionMenu>): void;
|
|
10
|
-
observeHostResize(): void;
|
|
11
|
-
render(): import('lit').TemplateResult<1>;
|
|
12
|
-
icon: string;
|
|
13
|
-
label: string;
|
|
6
|
+
sidenavRegion: IRegion | undefined;
|
|
14
7
|
}
|
|
15
|
-
export {};
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { PropertyValues } from 'lit';
|
|
2
|
+
/** Id del contenidor de la regió, derivat del seu nom. */
|
|
3
|
+
export declare const regionContainerId: (regionName: string) => string;
|
|
4
|
+
declare const SidenavActionMenu_base: any;
|
|
5
|
+
/**
|
|
6
|
+
* Base dels menús del menú de navegació que despleguen un `dss-action-menu` amb una regió a
|
|
7
|
+
* dins: "Comunicació", "Vies clíniques" i "Peticionari".
|
|
8
|
+
*
|
|
9
|
+
* Els tres eren el mateix component copiat tres vegades (styles.css idèntics i templates que
|
|
10
|
+
* només diferien en l'id del contenidor). Cada subclasse només aporta el seu `@region`, que no
|
|
11
|
+
* es pot parametritzar: el decorador escriu la metadada al constructor de la classe, així que
|
|
12
|
+
* una sola classe compartida tindria una única regió per a totes les instàncies.
|
|
13
|
+
*/
|
|
14
|
+
export declare class SidenavActionMenu extends SidenavActionMenu_base {
|
|
15
|
+
constructor(icon: string, label: string, regionName: string);
|
|
16
|
+
showText: boolean;
|
|
17
|
+
icon: string;
|
|
18
|
+
label: string;
|
|
19
|
+
regionName: string;
|
|
20
|
+
get containerId(): string;
|
|
21
|
+
static styles: import('lit').CSSResult;
|
|
22
|
+
firstUpdated(_changedProps: PropertyValues<SidenavActionMenu>): void;
|
|
23
|
+
/** Amaga el text quan el menú es col·lapsa. */
|
|
24
|
+
observeHostResize(): void;
|
|
25
|
+
render(): import('lit').TemplateResult<1>;
|
|
26
|
+
}
|
|
27
|
+
export {};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { PrimariaApi } from '../../api/api';
|
|
2
|
-
export declare const getVisiId: (api: PrimariaApi) => Promise<string>;
|
|
2
|
+
export declare const getVisiId: (api: PrimariaApi) => Promise<string | undefined>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@uxland/primary-shell",
|
|
3
|
-
"version": "7.46.
|
|
3
|
+
"version": "7.46.12",
|
|
4
4
|
"description": "Primaria Shell",
|
|
5
5
|
"author": "UXLand <dev@uxland.es>",
|
|
6
6
|
"homepage": "https://github.com/uxland/harmonix/tree/app#readme",
|
|
@@ -47,7 +47,7 @@
|
|
|
47
47
|
"tslib": "^2.3.0",
|
|
48
48
|
"uxl-quill": "^1.0.1",
|
|
49
49
|
"vite": "^7.0.0",
|
|
50
|
-
"@primaria/plugins-core": "1.0.
|
|
50
|
+
"@primaria/plugins-core": "1.0.20"
|
|
51
51
|
},
|
|
52
52
|
"scripts": {
|
|
53
53
|
"serve": "vite",
|
|
@@ -1,48 +1,13 @@
|
|
|
1
1
|
import { IRegion, region } from "@uxland/regions";
|
|
2
|
-
import { LitElement, PropertyValues, css, html, unsafeCSS } from "lit";
|
|
3
|
-
import { property, state } from "lit/decorators.js";
|
|
4
|
-
import { PrimariaRegionHost } from "../../../api/api";
|
|
5
2
|
import { shellRegions } from "../../../api/region-manager/regions";
|
|
6
|
-
import
|
|
7
|
-
import { template } from "./template";
|
|
3
|
+
import { SidenavActionMenu, regionContainerId } from "../sidenav-action-menu/sidenav-action-menu";
|
|
8
4
|
|
|
9
|
-
|
|
5
|
+
/** Menú "Vies clíniques" del menú de navegació: aporta la regió `clinicalPathwaysSidenav`. */
|
|
6
|
+
export class ClinicalPathwaysActionMenu extends SidenavActionMenu {
|
|
10
7
|
constructor(icon: string, label: string) {
|
|
11
|
-
super();
|
|
12
|
-
this.icon = icon;
|
|
13
|
-
this.label = label;
|
|
8
|
+
super(icon, label, shellRegions.clinicalPathwaysSidenav);
|
|
14
9
|
}
|
|
15
10
|
|
|
16
|
-
@
|
|
17
|
-
|
|
18
|
-
@region({ targetId: "clinical-pathways-sidenav-region-container", name: shellRegions.clinicalPathwaysSidenav })
|
|
19
|
-
clinicalPathwaysSidenavRegion: IRegion | undefined;
|
|
20
|
-
|
|
21
|
-
static styles = css`
|
|
22
|
-
${unsafeCSS(styles)}
|
|
23
|
-
`;
|
|
24
|
-
|
|
25
|
-
firstUpdated(_changedProps: PropertyValues<ClinicalPathwaysActionMenu>) {
|
|
26
|
-
super.firstUpdated(_changedProps);
|
|
27
|
-
this.observeHostResize();
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
observeHostResize() {
|
|
31
|
-
const parentElement = this.parentElement;
|
|
32
|
-
const observer = new ResizeObserver((entries) => {
|
|
33
|
-
for (const entry of entries) {
|
|
34
|
-
const width = entry.target.clientWidth;
|
|
35
|
-
this.showText = width > 100;
|
|
36
|
-
}
|
|
37
|
-
});
|
|
38
|
-
|
|
39
|
-
observer.observe(parentElement as HTMLElement);
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
render() {
|
|
43
|
-
return html`${template(this)}`;
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
@property({ type: String }) icon = "";
|
|
47
|
-
@property({ type: String }) label = "";
|
|
11
|
+
@region({ targetId: regionContainerId(shellRegions.clinicalPathwaysSidenav), name: shellRegions.clinicalPathwaysSidenav })
|
|
12
|
+
sidenavRegion: IRegion | undefined;
|
|
48
13
|
}
|
|
@@ -1,48 +1,13 @@
|
|
|
1
1
|
import { IRegion, region } from "@uxland/regions";
|
|
2
|
-
import { LitElement, PropertyValues, css, html, unsafeCSS } from "lit";
|
|
3
|
-
import { property, state } from "lit/decorators.js";
|
|
4
|
-
import { PrimariaRegionHost } from "../../../api/api";
|
|
5
2
|
import { shellRegions } from "../../../api/region-manager/regions";
|
|
6
|
-
import
|
|
7
|
-
import { template } from "./template";
|
|
3
|
+
import { SidenavActionMenu, regionContainerId } from "../sidenav-action-menu/sidenav-action-menu";
|
|
8
4
|
|
|
9
|
-
|
|
5
|
+
/** Menú "Comunicació" del menú de navegació: aporta la regió `communicationSidenav`. */
|
|
6
|
+
export class CommunicationActionMenu extends SidenavActionMenu {
|
|
10
7
|
constructor(icon: string, label: string) {
|
|
11
|
-
super();
|
|
12
|
-
this.icon = icon;
|
|
13
|
-
this.label = label;
|
|
8
|
+
super(icon, label, shellRegions.communicationSidenav);
|
|
14
9
|
}
|
|
15
10
|
|
|
16
|
-
@
|
|
17
|
-
|
|
18
|
-
@region({ targetId: "communication-sidenav-region-container", name: shellRegions.communicationSidenav })
|
|
19
|
-
comminucationSidenavRegion: IRegion | undefined;
|
|
20
|
-
|
|
21
|
-
static styles = css`
|
|
22
|
-
${unsafeCSS(styles)}
|
|
23
|
-
`;
|
|
24
|
-
|
|
25
|
-
firstUpdated(_changedProps: PropertyValues<CommunicationActionMenu>) {
|
|
26
|
-
super.firstUpdated(_changedProps);
|
|
27
|
-
this.observeHostResize();
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
observeHostResize() {
|
|
31
|
-
const parentElement = this.parentElement;
|
|
32
|
-
const observer = new ResizeObserver((entries) => {
|
|
33
|
-
for (const entry of entries) {
|
|
34
|
-
const width = entry.target.clientWidth;
|
|
35
|
-
this.showText = width > 100;
|
|
36
|
-
}
|
|
37
|
-
});
|
|
38
|
-
|
|
39
|
-
observer.observe(parentElement as HTMLElement);
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
render() {
|
|
43
|
-
return html`${template(this)}`;
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
@property({ type: String }) icon = "";
|
|
47
|
-
@property({ type: String }) label = "";
|
|
11
|
+
@region({ targetId: regionContainerId(shellRegions.communicationSidenav), name: shellRegions.communicationSidenav })
|
|
12
|
+
sidenavRegion: IRegion | undefined;
|
|
48
13
|
}
|
|
@@ -1,48 +1,13 @@
|
|
|
1
1
|
import { IRegion, region } from "@uxland/regions";
|
|
2
|
-
import { LitElement, PropertyValues, css, html, unsafeCSS } from "lit";
|
|
3
|
-
import { property, state } from "lit/decorators.js";
|
|
4
|
-
import { PrimariaRegionHost } from "../../../api/api";
|
|
5
2
|
import { shellRegions } from "../../../api/region-manager/regions";
|
|
6
|
-
import
|
|
7
|
-
import { template } from "./template";
|
|
3
|
+
import { SidenavActionMenu, regionContainerId } from "../sidenav-action-menu/sidenav-action-menu";
|
|
8
4
|
|
|
9
|
-
|
|
5
|
+
/** Menú "Peticionari" del menú de navegació: aporta la regió `petitionerSidenav`. */
|
|
6
|
+
export class PetitionerActionMenu extends SidenavActionMenu {
|
|
10
7
|
constructor(icon: string, label: string) {
|
|
11
|
-
super();
|
|
12
|
-
this.icon = icon;
|
|
13
|
-
this.label = label;
|
|
8
|
+
super(icon, label, shellRegions.petitionerSidenav);
|
|
14
9
|
}
|
|
15
10
|
|
|
16
|
-
@
|
|
17
|
-
|
|
18
|
-
@region({ targetId: "petitioner-sidenav-region-container", name: shellRegions.petitionerSidenav })
|
|
19
|
-
petitionerSidenavRegion: IRegion | undefined;
|
|
20
|
-
|
|
21
|
-
static styles = css`
|
|
22
|
-
${unsafeCSS(styles)}
|
|
23
|
-
`;
|
|
24
|
-
|
|
25
|
-
firstUpdated(_changedProps: PropertyValues<PetitionerActionMenu>) {
|
|
26
|
-
super.firstUpdated(_changedProps);
|
|
27
|
-
this.observeHostResize();
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
observeHostResize() {
|
|
31
|
-
const parentElement = this.parentElement;
|
|
32
|
-
const observer = new ResizeObserver((entries) => {
|
|
33
|
-
for (const entry of entries) {
|
|
34
|
-
const width = entry.target.clientWidth;
|
|
35
|
-
this.showText = width > 100;
|
|
36
|
-
}
|
|
37
|
-
});
|
|
38
|
-
|
|
39
|
-
observer.observe(parentElement as HTMLElement);
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
render() {
|
|
43
|
-
return html`${template(this)}`;
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
@property({ type: String }) icon = "";
|
|
47
|
-
@property({ type: String }) label = "";
|
|
11
|
+
@region({ targetId: regionContainerId(shellRegions.petitionerSidenav), name: shellRegions.petitionerSidenav })
|
|
12
|
+
sidenavRegion: IRegion | undefined;
|
|
48
13
|
}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { LitElement, PropertyValues, css, html, unsafeCSS } from "lit";
|
|
2
|
+
import { property, state } from "lit/decorators.js";
|
|
3
|
+
import { PrimariaRegionHost } from "../../../api/api";
|
|
4
|
+
import styles from "./styles.css?inline";
|
|
5
|
+
import { template } from "./template";
|
|
6
|
+
|
|
7
|
+
/** Id del contenidor de la regió, derivat del seu nom. */
|
|
8
|
+
export const regionContainerId = (regionName: string) => `${regionName}-container`;
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* Base dels menús del menú de navegació que despleguen un `dss-action-menu` amb una regió a
|
|
12
|
+
* dins: "Comunicació", "Vies clíniques" i "Peticionari".
|
|
13
|
+
*
|
|
14
|
+
* Els tres eren el mateix component copiat tres vegades (styles.css idèntics i templates que
|
|
15
|
+
* només diferien en l'id del contenidor). Cada subclasse només aporta el seu `@region`, que no
|
|
16
|
+
* es pot parametritzar: el decorador escriu la metadada al constructor de la classe, així que
|
|
17
|
+
* una sola classe compartida tindria una única regió per a totes les instàncies.
|
|
18
|
+
*/
|
|
19
|
+
export class SidenavActionMenu extends PrimariaRegionHost(LitElement) {
|
|
20
|
+
constructor(icon: string, label: string, regionName: string) {
|
|
21
|
+
super();
|
|
22
|
+
this.icon = icon;
|
|
23
|
+
this.label = label;
|
|
24
|
+
this.regionName = regionName;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
@state() showText = false;
|
|
28
|
+
|
|
29
|
+
@property({ type: String }) icon = "";
|
|
30
|
+
@property({ type: String }) label = "";
|
|
31
|
+
@property({ type: String }) regionName = "";
|
|
32
|
+
|
|
33
|
+
get containerId() {
|
|
34
|
+
return regionContainerId(this.regionName);
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
static styles = css`
|
|
38
|
+
${unsafeCSS(styles)}
|
|
39
|
+
`;
|
|
40
|
+
|
|
41
|
+
firstUpdated(_changedProps: PropertyValues<SidenavActionMenu>) {
|
|
42
|
+
super.firstUpdated(_changedProps);
|
|
43
|
+
this.observeHostResize();
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
/** Amaga el text quan el menú es col·lapsa. */
|
|
47
|
+
observeHostResize() {
|
|
48
|
+
const parentElement = this.parentElement;
|
|
49
|
+
const observer = new ResizeObserver((entries) => {
|
|
50
|
+
for (const entry of entries) {
|
|
51
|
+
const width = entry.target.clientWidth;
|
|
52
|
+
this.showText = width > 100;
|
|
53
|
+
}
|
|
54
|
+
});
|
|
55
|
+
|
|
56
|
+
observer.observe(parentElement as HTMLElement);
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
render() {
|
|
60
|
+
return html`${template(this)}`;
|
|
61
|
+
}
|
|
62
|
+
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { html, nothing } from "lit";
|
|
2
|
-
import {
|
|
2
|
+
import { SidenavActionMenu } from "./sidenav-action-menu";
|
|
3
3
|
|
|
4
|
-
export const template = (props:
|
|
4
|
+
export const template = (props: SidenavActionMenu) => {
|
|
5
5
|
return html`
|
|
6
6
|
<div class="item" ?expanded=${props.showText}>
|
|
7
7
|
<div class="icon-label">
|
|
@@ -16,7 +16,7 @@ export const template = (props: PetitionerActionMenu) => {
|
|
|
16
16
|
: nothing
|
|
17
17
|
}
|
|
18
18
|
</div>
|
|
19
|
-
<dss-action-menu id
|
|
19
|
+
<dss-action-menu id=${props.containerId} slot="content" >
|
|
20
20
|
</dss-action-menu>
|
|
21
21
|
${props.showText ? html`<dss-icon icon="chevron_right" size="md"></dss-icon>` : nothing}
|
|
22
22
|
</div>
|
|
@@ -72,7 +72,7 @@ const doctorNavMenuItems: MenuItemConfig[] = [
|
|
|
72
72
|
label: "Prescripció",
|
|
73
73
|
callbackFn: async () => {
|
|
74
74
|
const visiId = await getVisiId(shellApi);
|
|
75
|
-
navigateToEcap("PRESCRIPCIO_ACTIVA", "NO_TANCAR", { VisiId: visiId });
|
|
75
|
+
navigateToEcap("PRESCRIPCIO_ACTIVA", "NO_TANCAR", visiId ? { VisiId: visiId } : {});
|
|
76
76
|
},
|
|
77
77
|
},
|
|
78
78
|
{
|
|
@@ -108,7 +108,7 @@ const doctorNavMenuItems: MenuItemConfig[] = [
|
|
|
108
108
|
sortHint: "0100",
|
|
109
109
|
callbackFn: async () => {
|
|
110
110
|
const visiId = await getVisiId(shellApi);
|
|
111
|
-
navigateToEcap("REV_IT", "NO_TANCAR", { VisiId: visiId });
|
|
111
|
+
navigateToEcap("REV_IT", "NO_TANCAR", visiId ? { VisiId: visiId } : {});
|
|
112
112
|
},
|
|
113
113
|
},
|
|
114
114
|
{
|
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
import { PrimariaApi } from "../../api/api";
|
|
2
2
|
|
|
3
|
-
export const getVisiId = async (api: PrimariaApi): Promise<string> => {
|
|
3
|
+
export const getVisiId = async (api: PrimariaApi): Promise<string | undefined> => {
|
|
4
4
|
const context = api.contextManager.getContext();
|
|
5
5
|
if (context.visi_id) return context.visi_id as string;
|
|
6
|
-
|
|
6
|
+
try {
|
|
7
|
+
return (await api.broker.send("get_visi_id")) as string;
|
|
8
|
+
} catch {
|
|
9
|
+
return undefined;
|
|
10
|
+
}
|
|
7
11
|
};
|