@uxland/primary-shell 7.40.4 → 7.41.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-WwbxsvZ9.js → component-DQ89sOAa.js} +2 -2
- package/dist/{component-WwbxsvZ9.js.map → component-DQ89sOAa.js.map} +1 -1
- package/dist/{index-BPEC-whC.js → index-DatOFmmM.js} +582 -567
- package/dist/index-DatOFmmM.js.map +1 -0
- package/dist/index.js +1 -1
- package/dist/index.umd.cjs +2 -2
- package/dist/index.umd.cjs.map +1 -1
- package/dist/primary/shell/src/api/region-manager/region-manager.d.ts +1 -0
- package/package.json +1 -1
- package/src/UI/internal-views/doctor-nav-menu.ts +1 -1
- package/src/api/region-manager/region-manager.test.ts +12 -0
- package/src/api/region-manager/region-manager.ts +18 -0
- package/dist/index-BPEC-whC.js.map +0 -1
|
@@ -13,6 +13,7 @@ export interface PrimariaRegionManager extends HarmonixRegionManager {
|
|
|
13
13
|
registerNavigationMenu(view: HarmonixViewDefinition): Promise<void>;
|
|
14
14
|
registerMainView(view: HarmonixViewDefinition): Promise<void>;
|
|
15
15
|
activateMainView(viewId: string): Promise<void>;
|
|
16
|
+
activatePluginView(regionName: string, pluginId: string, viewId: string): Promise<void>;
|
|
16
17
|
getCurrentMainViewActive(): string | undefined;
|
|
17
18
|
_destroy(): void;
|
|
18
19
|
}
|
package/package.json
CHANGED
|
@@ -180,7 +180,7 @@ export const registerDoctorClinicalPathwaysMenuActions = () => {
|
|
|
180
180
|
id: "1",
|
|
181
181
|
sortHint: "0010",
|
|
182
182
|
icon: "open_in_new",
|
|
183
|
-
label: "Proces d'atenció - ARES",
|
|
183
|
+
label: "Proces d'atenció - ARES (Obsolet)",
|
|
184
184
|
callbackFn: () => navigateToEcap("PROCES_ATENCIO"),
|
|
185
185
|
},
|
|
186
186
|
{
|
|
@@ -106,6 +106,18 @@ describe("RegionManagerProxy", () => {
|
|
|
106
106
|
expect(broker.publish).toHaveBeenCalledWith(BROKER_EVENTS.shell.mainViewChanged, { viewId: "view1" });
|
|
107
107
|
});
|
|
108
108
|
|
|
109
|
+
it("activatePluginView should activate using the owner pluginId, not the caller's", async () => {
|
|
110
|
+
await proxy.activatePluginView("test-region", "other-plugin", "view1");
|
|
111
|
+
expect(regionMock.activate).toHaveBeenCalledWith("other-plugin::view1");
|
|
112
|
+
expect(broker.publish).not.toHaveBeenCalled();
|
|
113
|
+
});
|
|
114
|
+
|
|
115
|
+
it("activatePluginView should notify when activating in the main region", async () => {
|
|
116
|
+
await proxy.activatePluginView(proxy.regions.shell.main, "other-plugin", "view1");
|
|
117
|
+
expect(regionMock.activate).toHaveBeenCalledWith("other-plugin::view1");
|
|
118
|
+
expect(broker.publish).toHaveBeenCalledWith(BROKER_EVENTS.shell.mainViewChanged, { viewId: "view1" });
|
|
119
|
+
});
|
|
120
|
+
|
|
109
121
|
it("getCurrentMainViewActive should return id of the active main view", () => {
|
|
110
122
|
const result = proxy.getCurrentMainViewActive();
|
|
111
123
|
expect(result).toBe("view1");
|
|
@@ -16,6 +16,7 @@ export interface PrimariaRegionManager extends HarmonixRegionManager {
|
|
|
16
16
|
registerNavigationMenu(view: HarmonixViewDefinition): Promise<void>;
|
|
17
17
|
registerMainView(view: HarmonixViewDefinition): Promise<void>;
|
|
18
18
|
activateMainView(viewId: string): Promise<void>;
|
|
19
|
+
activatePluginView(regionName: string, pluginId: string, viewId: string): Promise<void>;
|
|
19
20
|
getCurrentMainViewActive(): string | undefined;
|
|
20
21
|
_destroy(): void;
|
|
21
22
|
}
|
|
@@ -130,6 +131,23 @@ class RegionManagerProxy implements PrimariaRegionManager {
|
|
|
130
131
|
this._notifyMainViewChanged(viewId);
|
|
131
132
|
return Promise.resolve();
|
|
132
133
|
}
|
|
134
|
+
/**
|
|
135
|
+
* Activates a view that was registered by another plugin.
|
|
136
|
+
*
|
|
137
|
+
* Unlike `activateView`, which always prefixes with the calling plugin's id, this method
|
|
138
|
+
* lets an orchestrator activate views owned by a different plugin by passing the owner's
|
|
139
|
+
* pluginId explicitly. Use only when crossing plugin boundaries.
|
|
140
|
+
*
|
|
141
|
+
* @param {string} regionName - The name of the region where the view is located.
|
|
142
|
+
* @param {string} pluginId - The id of the plugin that registered the view.
|
|
143
|
+
* @param {string} viewId - The id of the view to be activated.
|
|
144
|
+
* @return {Promise<void>} A promise that resolves when the view is successfully activated.
|
|
145
|
+
*/
|
|
146
|
+
activatePluginView(regionName: string, pluginId: string, viewId: string): Promise<void> {
|
|
147
|
+
this.regionManager.getRegion(regionName).activate(`${pluginId}::${viewId}`);
|
|
148
|
+
if (regionName === this.regions.shell.main) this._notifyMainViewChanged(viewId);
|
|
149
|
+
return Promise.resolve();
|
|
150
|
+
}
|
|
133
151
|
|
|
134
152
|
getCurrentMainViewActive() {
|
|
135
153
|
const mainView = this.regionManager.getRegion(this.regions.shell.main).currentActiveViews[0] as HarmonixViewDefinition;
|