@openmrs/esm-globals 10.0.1-pre.5652 → 10.0.1-pre.5664

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: 5 files with swc (224.21ms)
1
+ [0] Successfully compiled: 5 files with swc (265.19ms)
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
@@ -1 +1 @@
1
- {"version":3,"file":"type-utils.d.ts","sourceRoot":"","sources":["../src/type-utils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAE/D;;;;;;GAMG;AACH,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,gBAAgB,GAAG,OAAO,GAAG,MAAM,IAAI,gBAAgB,CAiCjG;AAED;;;;;;GAMG;AACH,wBAAgB,eAAe,CAAC,MAAM,EAAE,aAAa,GAAG,OAAO,GAAG,MAAM,IAAI,aAAa,CAgBxF"}
1
+ {"version":3,"file":"type-utils.d.ts","sourceRoot":"","sources":["../src/type-utils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAE/D;;;;;;GAMG;AACH,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,gBAAgB,GAAG,OAAO,GAAG,MAAM,IAAI,gBAAgB,CA6CjG;AAED;;;;;;GAMG;AACH,wBAAgB,eAAe,CAAC,MAAM,EAAE,aAAa,GAAG,OAAO,GAAG,MAAM,IAAI,aAAa,CAgBxF"}
@@ -17,13 +17,23 @@
17
17
  return false;
18
18
  }
19
19
  }
20
- if (Object.hasOwn(routes, 'workspaces')) {
21
- if (!Boolean(maybeRoutes.workspaces) || !Array.isArray(maybeRoutes.workspaces)) {
20
+ if (Object.hasOwn(routes, 'modals')) {
21
+ if (!Boolean(maybeRoutes.modals) || !Array.isArray(maybeRoutes.modals)) {
22
22
  return false;
23
23
  }
24
24
  }
25
- if (Object.hasOwn(routes, 'modals')) {
26
- if (!Boolean(maybeRoutes.modals) || !Array.isArray(maybeRoutes.modals)) {
25
+ if (Object.hasOwn(routes, 'workspaces2')) {
26
+ if (!Boolean(maybeRoutes.workspaces2) || !Array.isArray(maybeRoutes.workspaces2)) {
27
+ return false;
28
+ }
29
+ }
30
+ if (Object.hasOwn(routes, 'workspaceWindows2')) {
31
+ if (!Boolean(maybeRoutes.workspaceWindows2) || !Array.isArray(maybeRoutes.workspaceWindows2)) {
32
+ return false;
33
+ }
34
+ }
35
+ if (Object.hasOwn(routes, 'workspaceGroups2')) {
36
+ if (!Boolean(maybeRoutes.workspaceGroups2) || !Array.isArray(maybeRoutes.workspaceGroups2)) {
27
37
  return false;
28
38
  }
29
39
  }
package/dist/types.d.ts CHANGED
@@ -188,74 +188,6 @@ export type ModalDefinition = {
188
188
  */
189
189
  component: string;
190
190
  };
191
- export type WorkspaceWindowState = 'maximized' | 'hidden' | 'normal';
192
- /**
193
- * A definition of a workspace as extracted from an app's routes.json
194
- */
195
- export type WorkspaceDefinition = {
196
- /**
197
- * The name of this workspace. This is used to launch the workspace.
198
- */
199
- name: string;
200
- /**
201
- * The title of the workspace. This will be looked up as a key in the translations of the module
202
- * defining the workspace.
203
- */
204
- title: string;
205
- /**
206
- * The type of the workspace. Only one of each "type" of workspace is allowed to be open at a
207
- * time. The default is "form". If the right sidebar is in use, then the type determines which
208
- * right sidebar icon corresponds to the workspace.
209
- */
210
- type: string;
211
- canHide?: boolean;
212
- canMaximize?: boolean;
213
- /**
214
- * Controls the width of the workspace. The default is "narrow" and this should only be
215
- * changed to "wider" if the workspace itself has internal navigation, like the form editor.
216
- * The width "extra-wide" is for workspaces that contain their own sidebar.
217
- */
218
- width?: 'narrow' | 'wider' | 'extra-wide';
219
- /**
220
- * Launches the workspace in the preferred size, it defaults to the 'narrow' width
221
- */
222
- preferredWindowSize?: WorkspaceWindowState;
223
- /**
224
- * Workspaces can open either independently or as part of a "workspace group". A
225
- * "workspace group" groups related workspaces together, so that only one is visible
226
- * at a time. For example,
227
- *
228
- * @example
229
- *
230
- * {
231
- * name: 'order-basket',
232
- * type: 'order',
233
- * groups: ['ward-patient']
234
- * }
235
- *
236
- * This means that the 'order-basket' workspace can be opened independently, or only
237
- * in the 'ward-patient'.
238
- * If a workspace group is already open and a new workspace is launched, and the
239
- * groups in the newly launched workspace do not include the currently open group’s
240
- * name, the entire workspace group will close, and the new workspace will launch independently.
241
- *
242
- */
243
- groups: Array<string>;
244
- /**
245
- * The name of the component exported by this frontend module.
246
- */
247
- component: string;
248
- };
249
- export interface WorkspaceGroupDefinition {
250
- /**
251
- * Name of the workspace group. This is used to launch the workspace group
252
- */
253
- name: string;
254
- /**
255
- * List of workspace names which are part of the workspace group.
256
- */
257
- members?: Array<string>;
258
- }
259
191
  export interface WorkspaceGroupDefinition2 {
260
192
  name: string;
261
193
  closeable?: boolean;
@@ -340,10 +272,6 @@ export interface OpenmrsAppRoutes {
340
272
  featureFlags?: Array<FeatureFlagDefinition>;
341
273
  /** An array of all modals supported by this frontend module. Modals can be launched by name. */
342
274
  modals?: Array<ModalDefinition>;
343
- /** An array of all workspaces supported by this frontend module. Workspaces can be launched by name. */
344
- workspaces?: Array<WorkspaceDefinition>;
345
- /** An array of all workspace groups supported by this frontend module. */
346
- workspaceGroups?: Array<WorkspaceGroupDefinition>;
347
275
  /** An array of all workspace groups (v2) supported by this frontend module. */
348
276
  workspaceGroups2?: Array<WorkspaceGroupDefinition2>;
349
277
  /** An array of all workspace windows (v2) supported by this frontend module. */
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,SAAS,CAAC;AAEpC,OAAO,CAAC,MAAM,CAAC;IACb,MAAM,wBAAwB,EAAE,MAAM,CACpC,MAAM,EACN,MAAM,CAAC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CAAC,EAAE,KAAK,CAAC,cAAc,CAAC,CAAC;IAC9B,0KAA0K;IAC1K,UAAU,CAAC,EAAE,KAAK,CAAC,mBAAmB,CAAC,CAAC;IACxC,sFAAsF;IACtF,YAAY,CAAC,EAAE,KAAK,CAAC,qBAAqB,CAAC,CAAC;IAC5C,gGAAgG;IAChG,MAAM,CAAC,EAAE,KAAK,CAAC,eAAe,CAAC,CAAC;IAEhC,+EAA+E;IAC/E,gBAAgB,CAAC,EAAE,KAAK,CAAC,yBAAyB,CAAC,CAAC;IAEpD,gFAAgF;IAChF,iBAAiB,CAAC,EAAE,KAAK,CAAC,0BAA0B,CAAC,CAAC;IAEtD,yEAAyE;IACzE,WAAW,CAAC,EAAE,KAAK,CAAC,oBAAoB,CAAC,CAAC;CAC3C;AAED;;;GAGG;AACH,MAAM,WAAW,aAAa;IAC5B,+CAA+C;IAC/C,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,qEAAqE;IACrE,MAAM,EAAE,MAAM,CAAC,OAAO,CAAC,MAAM,EAAE,SAAS,CAAC,EAAE,gBAAgB,CAAC,CAAC;CAC9D;AAED,MAAM,WAAW,cAAc,CAAC,CAAC,GAAG,GAAG;IACrC,IAAI,OAAO,CAAC,CAAC,CAAC,CAAC;CAChB;AAKD,MAAM,MAAM,OAAO,GAAG,OAAO,GAAG,UAAU,GAAG,MAAM,GAAG,UAAU,GAAG,WAAW,GAAG,KAAK,GAAG,QAAQ,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@openmrs/esm-globals",
3
- "version": "10.0.1-pre.5652",
3
+ "version": "10.0.1-pre.5664",
4
4
  "license": "MPL-2.0",
5
5
  "type": "module",
6
6
  "module": "dist/index.js",
@@ -28,12 +28,6 @@ describe('isOpenmrsAppRoutes', () => {
28
28
  component: 'customModal',
29
29
  },
30
30
  ],
31
- workspaces: [
32
- {
33
- name: 'custom workspace',
34
- component: 'customWorkspace',
35
- },
36
- ],
37
31
  }),
38
32
  ).toBe(true);
39
33
  });
@@ -77,17 +71,16 @@ describe('isOpenmrsAppRoutes', () => {
77
71
  ).toBe(true);
78
72
  });
79
73
 
80
- it('should accept an object with only workspaces', () => {
81
- expect(
82
- isOpenmrsAppRoutes({
83
- workspaces: [
84
- {
85
- name: 'custom workspace',
86
- component: 'customWorkspace',
87
- },
88
- ],
89
- }),
90
- ).toBe(true);
74
+ it.each([
75
+ ['workspaces2', { name: 'custom workspace', component: 'customWorkspace', window: 'custom-window' }],
76
+ ['workspaceWindows2', { name: 'custom-window', group: 'custom-group' }],
77
+ ['workspaceGroups2', { name: 'custom-group' }],
78
+ ])('should accept an object with only %s', (key, definition) => {
79
+ expect(isOpenmrsAppRoutes({ [key]: [definition] })).toBe(true);
80
+ });
81
+
82
+ it.each(['workspaces2', 'workspaceWindows2', 'workspaceGroups2'])('should reject a non-array %s', (key) => {
83
+ expect(isOpenmrsAppRoutes({ [key]: {} })).toBe(false);
91
84
  });
92
85
 
93
86
  it('should report an empty object as valid', () => {
package/src/type-utils.ts CHANGED
@@ -23,14 +23,26 @@ export function isOpenmrsAppRoutes(routes: OpenmrsAppRoutes | unknown): routes i
23
23
  }
24
24
  }
25
25
 
26
- if (Object.hasOwn(routes, 'workspaces')) {
27
- if (!Boolean(maybeRoutes.workspaces) || !Array.isArray(maybeRoutes.workspaces)) {
26
+ if (Object.hasOwn(routes, 'modals')) {
27
+ if (!Boolean(maybeRoutes.modals) || !Array.isArray(maybeRoutes.modals)) {
28
28
  return false;
29
29
  }
30
30
  }
31
31
 
32
- if (Object.hasOwn(routes, 'modals')) {
33
- if (!Boolean(maybeRoutes.modals) || !Array.isArray(maybeRoutes.modals)) {
32
+ if (Object.hasOwn(routes, 'workspaces2')) {
33
+ if (!Boolean(maybeRoutes.workspaces2) || !Array.isArray(maybeRoutes.workspaces2)) {
34
+ return false;
35
+ }
36
+ }
37
+
38
+ if (Object.hasOwn(routes, 'workspaceWindows2')) {
39
+ if (!Boolean(maybeRoutes.workspaceWindows2) || !Array.isArray(maybeRoutes.workspaceWindows2)) {
40
+ return false;
41
+ }
42
+ }
43
+
44
+ if (Object.hasOwn(routes, 'workspaceGroups2')) {
45
+ if (!Boolean(maybeRoutes.workspaceGroups2) || !Array.isArray(maybeRoutes.workspaceGroups2)) {
34
46
  return false;
35
47
  }
36
48
  }
package/src/types.ts CHANGED
@@ -202,79 +202,6 @@ export type ModalDefinition = {
202
202
  component: string;
203
203
  };
204
204
 
205
- /* The possible states a workspace window can be opened in. */
206
- export type WorkspaceWindowState = 'maximized' | 'hidden' | 'normal';
207
-
208
- /**
209
- * A definition of a workspace as extracted from an app's routes.json
210
- */
211
- export type WorkspaceDefinition = {
212
- /**
213
- * The name of this workspace. This is used to launch the workspace.
214
- */
215
- name: string;
216
- /**
217
- * The title of the workspace. This will be looked up as a key in the translations of the module
218
- * defining the workspace.
219
- */
220
- title: string;
221
- /**
222
- * The type of the workspace. Only one of each "type" of workspace is allowed to be open at a
223
- * time. The default is "form". If the right sidebar is in use, then the type determines which
224
- * right sidebar icon corresponds to the workspace.
225
- */
226
- type: string;
227
- canHide?: boolean;
228
- canMaximize?: boolean;
229
- /**
230
- * Controls the width of the workspace. The default is "narrow" and this should only be
231
- * changed to "wider" if the workspace itself has internal navigation, like the form editor.
232
- * The width "extra-wide" is for workspaces that contain their own sidebar.
233
- */
234
- width?: 'narrow' | 'wider' | 'extra-wide';
235
- /**
236
- * Launches the workspace in the preferred size, it defaults to the 'narrow' width
237
- */
238
- preferredWindowSize?: WorkspaceWindowState;
239
-
240
- /**
241
- * Workspaces can open either independently or as part of a "workspace group". A
242
- * "workspace group" groups related workspaces together, so that only one is visible
243
- * at a time. For example,
244
- *
245
- * @example
246
- *
247
- * {
248
- * name: 'order-basket',
249
- * type: 'order',
250
- * groups: ['ward-patient']
251
- * }
252
- *
253
- * This means that the 'order-basket' workspace can be opened independently, or only
254
- * in the 'ward-patient'.
255
- * If a workspace group is already open and a new workspace is launched, and the
256
- * groups in the newly launched workspace do not include the currently open group’s
257
- * name, the entire workspace group will close, and the new workspace will launch independently.
258
- *
259
- */
260
- groups: Array<string>;
261
- /**
262
- * The name of the component exported by this frontend module.
263
- */
264
- component: string;
265
- };
266
-
267
- export interface WorkspaceGroupDefinition {
268
- /**
269
- * Name of the workspace group. This is used to launch the workspace group
270
- */
271
- name: string;
272
- /**
273
- * List of workspace names which are part of the workspace group.
274
- */
275
- members?: Array<string>;
276
- }
277
-
278
205
  export interface WorkspaceGroupDefinition2 {
279
206
  name: string;
280
207
  closeable?: boolean;
@@ -367,10 +294,6 @@ export interface OpenmrsAppRoutes {
367
294
  featureFlags?: Array<FeatureFlagDefinition>;
368
295
  /** An array of all modals supported by this frontend module. Modals can be launched by name. */
369
296
  modals?: Array<ModalDefinition>;
370
- /** An array of all workspaces supported by this frontend module. Workspaces can be launched by name. */
371
- workspaces?: Array<WorkspaceDefinition>;
372
- /** An array of all workspace groups supported by this frontend module. */
373
- workspaceGroups?: Array<WorkspaceGroupDefinition>;
374
297
 
375
298
  /** An array of all workspace groups (v2) supported by this frontend module. */
376
299
  workspaceGroups2?: Array<WorkspaceGroupDefinition2>;