@openmrs/esm-routes 8.0.1-pre.3648 → 8.0.1-pre.3663

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.
@@ -1,3 +1,3 @@
1
- [0] Successfully compiled: 9 files with swc (149.42ms)
1
+ [0] Successfully compiled: 9 files with swc (128.05ms)
2
2
  [0] swc --strip-leading-paths src -d dist exited with code 0
3
3
  [1] tsc --project tsconfig.build.json exited with code 0
@@ -130,13 +130,27 @@ To fix this, ensure that you define the "name" field inside the workspace defini
130
130
  });
131
131
  }
132
132
  export function tryRegisterWorkspaceGroups2(appName, workspaceGroupDefs) {
133
- registerWorkspaceGroups2(workspaceGroupDefs);
133
+ registerWorkspaceGroups2(appName, workspaceGroupDefs);
134
134
  }
135
135
  export function tryRegisterWorkspace2(appName, workspaceDefs) {
136
136
  registerWorkspaces2(appName, workspaceDefs);
137
137
  }
138
138
  export function tryRegisterWorkspaceWindows2(appName, workspaceWindowDefs) {
139
139
  registerWorkspaceWindows2(appName, workspaceWindowDefs);
140
+ // register each window with icon as an extension to the slot with
141
+ // its workspace group name as slotName. This allows for configuration
142
+ // of the icons in the group, similar to extensions in extension slots
143
+ for (const windowDef of workspaceWindowDefs){
144
+ if (windowDef.icon) {
145
+ const extension = {
146
+ name: windowDef.name,
147
+ component: windowDef.icon,
148
+ slot: windowDef.group,
149
+ order: windowDef.order
150
+ };
151
+ tryRegisterExtension(appName, extension);
152
+ }
153
+ }
140
154
  }
141
155
  /**
142
156
  * This function registers a feature flag definition with the framework.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@openmrs/esm-routes",
3
- "version": "8.0.1-pre.3648",
3
+ "version": "8.0.1-pre.3663",
4
4
  "license": "MPL-2.0",
5
5
  "description": "Utilities for working with the routes registry",
6
6
  "type": "module",
@@ -55,12 +55,12 @@
55
55
  "single-spa": "6.x"
56
56
  },
57
57
  "devDependencies": {
58
- "@openmrs/esm-config": "8.0.1-pre.3648",
59
- "@openmrs/esm-dynamic-loading": "8.0.1-pre.3648",
60
- "@openmrs/esm-extensions": "8.0.1-pre.3648",
61
- "@openmrs/esm-feature-flags": "8.0.1-pre.3648",
62
- "@openmrs/esm-globals": "8.0.1-pre.3648",
63
- "@openmrs/esm-utils": "8.0.1-pre.3648",
58
+ "@openmrs/esm-config": "8.0.1-pre.3663",
59
+ "@openmrs/esm-dynamic-loading": "8.0.1-pre.3663",
60
+ "@openmrs/esm-extensions": "8.0.1-pre.3663",
61
+ "@openmrs/esm-feature-flags": "8.0.1-pre.3663",
62
+ "@openmrs/esm-globals": "8.0.1-pre.3663",
63
+ "@openmrs/esm-utils": "8.0.1-pre.3663",
64
64
  "@swc/cli": "^0.7.7",
65
65
  "@swc/core": "^1.11.29",
66
66
  "@vitest/coverage-v8": "^4.0.7",
@@ -191,7 +191,7 @@ To fix this, ensure that you define the "name" field inside the workspace defini
191
191
  }
192
192
 
193
193
  export function tryRegisterWorkspaceGroups2(appName: string, workspaceGroupDefs: Array<WorkspaceGroupDefinition2>) {
194
- registerWorkspaceGroups2(workspaceGroupDefs);
194
+ registerWorkspaceGroups2(appName, workspaceGroupDefs);
195
195
  }
196
196
 
197
197
  export function tryRegisterWorkspace2(appName: string, workspaceDefs: Array<WorkspaceDefinition2>) {
@@ -200,6 +200,21 @@ export function tryRegisterWorkspace2(appName: string, workspaceDefs: Array<Work
200
200
 
201
201
  export function tryRegisterWorkspaceWindows2(appName: string, workspaceWindowDefs: Array<WorkspaceWindowDefinition2>) {
202
202
  registerWorkspaceWindows2(appName, workspaceWindowDefs);
203
+
204
+ // register each window with icon as an extension to the slot with
205
+ // its workspace group name as slotName. This allows for configuration
206
+ // of the icons in the group, similar to extensions in extension slots
207
+ for (const windowDef of workspaceWindowDefs) {
208
+ if (windowDef.icon) {
209
+ const extension: ExtensionDefinition = {
210
+ name: windowDef.name,
211
+ component: windowDef.icon,
212
+ slot: windowDef.group,
213
+ order: windowDef.order,
214
+ };
215
+ tryRegisterExtension(appName, extension);
216
+ }
217
+ }
203
218
  }
204
219
 
205
220
  /**