autosolutions-os 0.3.11 → 0.3.13

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/CHANGELOG.md CHANGED
@@ -1,5 +1,71 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.3.13 - 2026-11-04
4
+
5
+ The Hub's permissions in every menu. The core now keeps one setting per
6
+ person, per company, per item of the menu (core migration hub_permissions,
7
+ 4 Nov 2026: View for a dashboard, Member or Admin for a tool), and
8
+ `os_context()` returns the items the person holds in the acting company.
9
+
10
+ ### autosolutions-os
11
+
12
+ - `OsContext.items` (optional): menu id to level (`OsItemLevel`, "view",
13
+ "member" or "admin"). Absent from a core older than the permissions.
14
+
15
+ ### autosolutions-os/nav
16
+
17
+ - `itemLocks(items)`: every row of the menu map the items do not name, with
18
+ "Ask your company admin to switch this on for you". Nothing while the core
19
+ has not answered (`null`) or for a core without items (`undefined`): the
20
+ rows stay as before, and the pages and the server check again.
21
+ - `withItemLocks(catalogueLinks(...), items)`: the catalogue's links and
22
+ locks with those applied. A row the person may not open is locked and never
23
+ a link, even when its app is held: Ops Hub serves thirteen rows, and holding
24
+ one of them holds the app. A reason the catalogue gave stays.
25
+
26
+ - `OS_HUB_ROW_ITEMS` and `hubPanelLocks(items)`: the default Hub panel's
27
+ rows the person may not open (the seven Smart Comms views need Smart Comms
28
+ Hub, each tool its own item, Configuration none), for osFrame's new
29
+ `hubLocked` option, used when no `hubItems` are passed: a locked panel row
30
+ is shown, disabled, and never a link.
31
+
32
+ ### autosolutions-os/frame and autosolutions-os/core-view
33
+
34
+ - `OsWorkspaceFrame` applies them, so a sample page, a Finance report, an
35
+ Ops Hub row or a Hub tool the person may not open is greyed in every app's
36
+ menu, with the reason, and does not open. `useCoreFrame` (Ops Hub, Asset
37
+ Portal) does the same from the Hub's session: its `frameOptions` carry
38
+ `hubLocked` and the item locks. An app needs no code change. The Hub's own
39
+ panel still comes from the Hub (`hubItems`).
40
+
41
+ ## 0.3.12 - 2026-11-04
42
+
43
+ A review of every tab after 0.3.11 found two rows that opened sample pages in
44
+ the Hub, marked " (*)", while Ops Hub already had real pages for them:
45
+ Commercial > Customers and Operations > Customer OTIF. The owner said yes to
46
+ linking both.
47
+
48
+ ### autosolutions-os/nav
49
+
50
+ - `OS_TOOL_LINKS["customers"]` is Ops Hub's `/customers` (its New view; At
51
+ risk and Lapsed are views of the same page), and
52
+ `OS_TOOL_LINKS["order-otif"]` is Ops Hub's `/customer-otif` (Order OTIF).
53
+ Like Ops Hub's other rows: linked for someone who holds Ops Hub, locked for
54
+ someone who does not, and the fixed address in `staticLinks()`.
55
+ - Both rows lose the sample mark and get no other: both pages show real
56
+ NetSuite data, and Ops Hub has a page for every view the map gives them
57
+ (Customers: New, At risk, Lapsed; Customer OTIF: Order OTIF). So
58
+ `OS_TOOL_DATA` is unchanged: Retailer sell out (POS) is still the one
59
+ incomplete row.
60
+ - Someone who does not hold Ops Hub sees both rows locked, where they opened
61
+ the Hub's sample pages before, as Ops Hub's other rows are.
62
+ - Unchanged: every id, tab, route and other link.
63
+ - Apps take this release with a lockfile bump. An app whose tests list the
64
+ sample rows, or the rows that open Ops Hub, adds these two. Ops Hub lists
65
+ both as its own tools today (`ADOPTED_TOOLS` in its `ops-nav.ts`): when it
66
+ takes this release it empties that list, since its test asks for exactly
67
+ the rows that open Ops Hub, and the two would count twice.
68
+
3
69
  ## 0.3.11 - 2026-11-04
4
70
 
5
71
  The owner's three marks, so people can tell which tabs to trust: " (*)" for
package/README.md CHANGED
@@ -134,6 +134,17 @@ import { OsWorkspaceFrame } from "autosolutions-os/frame";
134
134
  With no `search` the bar's field is the OS menu search. An app with a search
135
135
  of its own passes it: `search={{ placeholder: "Search", value: query, onChange: setQuery }}`.
136
136
 
137
+ Since 0.3.13 the frame greys every row the person may not open: the core's
138
+ `os_context()` returns `items`, the items of the menu they hold in the acting
139
+ company (the Hub's permissions: View for a dashboard, Member or Admin for a
140
+ tool), and every row it does not name is locked with "Ask your company admin
141
+ to switch this on for you", even when its app is held (Ops Hub serves thirteen
142
+ rows). Until the core answers, and with a core without `items`, nothing new
143
+ is locked (the pages and the server check again). `itemLocks(items)` and
144
+ `withItemLocks(catalogueLinks(...), items)` (`autosolutions-os/nav`) do the
145
+ same for a frame of your own, and `hubPanelLocks(items)` (osFrame's
146
+ `hubLocked`) greys the default Hub panel's rows the same way.
147
+
137
148
  It works with any router: it reads `location` and calls `onNavigate(href)` for
138
149
  paths inside the app, and opens other apps itself, in the same tab. The rows
139
150
  for other apps are links (`<a href>` with `?tenant=`), and so are this app's
@@ -260,6 +271,10 @@ why).
260
271
  for someone who holds it, and is locked for someone who does not, like
261
272
  Ops Hub's tools. In the Hub a locked row's page files under its function,
262
273
  with no row picked.
274
+ - Three rows the map marks In progress open Ops Hub's real pages the same
275
+ way: Commercial > Retailer sell out (POS) its POS dashboard (0.3.6), and
276
+ Commercial > Customers and Operations > Customer OTIF its Customers and
277
+ Order OTIF pages (0.3.12).
263
278
  - Admin appears when `my_admin_scope()` says the person manages something; pass
264
279
  `admin` to decide it yourself.
265
280
  - Every app shows the Hub panel (0.3.0, `OS_HUB_MENU`, the design's): Smart
package/dist/context.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import { type OsApp, type OsContext, type OsContextStatus, type OsTenant } from "./contextCache.js";
2
- export { loadOsContext, invalidateOsContext, refreshOsContext, retryOsContext, watchOsAuth, type OsApp, type OsContext, type OsContextStatus, type OsTenant, } from "./contextCache.js";
2
+ export { loadOsContext, invalidateOsContext, refreshOsContext, retryOsContext, watchOsAuth, type OsApp, type OsContext, type OsContextStatus, type OsItemLevel, type OsTenant, } from "./contextCache.js";
3
3
  /** The context and where it stands, for a component that shows the difference. */
4
4
  export declare function useOsContextState(os: unknown): {
5
5
  context: OsContext | null;
@@ -19,10 +19,18 @@ export type OsApp = {
19
19
  designKey: string | null;
20
20
  labelUrl: string | null;
21
21
  };
22
+ /** A person's level on one item of the OS menu (core migration hub_permissions). */
23
+ export type OsItemLevel = "view" | "member" | "admin";
22
24
  export type OsContext = {
23
25
  tenant: OsTenant | null;
24
26
  tenants: OsTenant[];
25
27
  apps: OsApp[];
28
+ /**
29
+ * The items of the OS menu this person may open in the acting company, by
30
+ * menu id (0.3.13): a dashboard's level is "view", a tool's "member" or
31
+ * "admin". Absent from a core older than the Hub's permissions (4 Nov 2026).
32
+ */
33
+ items?: Record<string, OsItemLevel>;
26
34
  };
27
35
  /**
28
36
  * Where a reader's context stands: still being read, read, or failed (and
@@ -36,6 +36,8 @@ export type CoreFrameSource = "core" | "checking" | "static";
36
36
  export type CoreFrameOptionsForOsFrame = {
37
37
  links: Record<string, string>;
38
38
  locked: Record<string, string>;
39
+ /** The default Hub panel's rows the person may not open (0.3.13). */
40
+ hubLocked: Record<string, string>;
39
41
  admin: boolean;
40
42
  tenantSlug: string | null;
41
43
  };
package/dist/coreView.js CHANGED
@@ -32,7 +32,7 @@ import { retryOsContext } from "./context.js";
32
32
  import { followOsPerson } from "./contextCache.js";
33
33
  import { createCoreViewClient, hubSession } from "./coreReader.js";
34
34
  import { myAdminScope } from "./identity.js";
35
- import { catalogueLinks, staticLinks } from "./nav.js";
35
+ import { catalogueLinks, hubPanelLocks, staticLinks, withItemLocks } from "./nav.js";
36
36
  import { useOsPlate } from "./plate.js";
37
37
  export { CORE_VIEW_FUNCTIONS, createCoreViewClient, hubSession, } from "./coreReader.js";
38
38
  /** How often a page that stays open looks at the shared cookie again, besides focus and coming back into view. */
@@ -118,12 +118,17 @@ export function useCoreFrame({ appKey, email, fallback, companySwitch = "os" })
118
118
  const slug = current?.slug ?? null;
119
119
  const frameOptions = useMemo(() => {
120
120
  if (source === "static") {
121
- return { links: staticLinks(fallback.tenantSlug), locked: {}, admin: false, tenantSlug: fallback.tenantSlug };
121
+ return { links: staticLinks(fallback.tenantSlug), locked: {}, hubLocked: {}, admin: false, tenantSlug: fallback.tenantSlug };
122
122
  }
123
- /* "checking": apps is null, so nothing is linked and other apps' rows read as being checked. */
124
- const { links, locked } = catalogueLinks(source === "core" ? apps ?? null : null, source === "core" ? slug : null);
125
- return { links, locked, admin: source === "core" && manages, tenantSlug: source === "core" ? slug : null };
126
- }, [source, apps, slug, manages, fallback.tenantSlug]);
123
+ /* "checking": apps is null, so nothing is linked and other apps' rows read as being checked.
124
+ The core's items then lock every row the person may not open (0.3.13). */
125
+ const items = source === "core" ? context?.items : undefined;
126
+ const { links, locked } = withItemLocks(catalogueLinks(source === "core" ? apps ?? null : null, source === "core" ? slug : null), items);
127
+ return {
128
+ links, locked, hubLocked: hubPanelLocks(items),
129
+ admin: source === "core" && manages, tenantSlug: source === "core" ? slug : null,
130
+ };
131
+ }, [source, apps, context?.items, slug, manages, fallback.tenantSlug]);
127
132
  const staticPlate = useMemo(() => ({
128
133
  ...(fallback.companySrc ? { companySrc: fallback.companySrc } : {}),
129
134
  ...(fallback.companyName ? { companyName: fallback.companyName } : {}),
package/dist/frame.js CHANGED
@@ -30,7 +30,7 @@ import { useCallback, useEffect, useId, useMemo, useState } from "react";
30
30
  import { TopBar, WorkspaceFrame } from "autosolutions-design-system";
31
31
  import { retryOsContext, watchOsAuth } from "./context.js";
32
32
  import { myAdminScope } from "./identity.js";
33
- import { catalogueLinks, osFrame } from "./nav.js";
33
+ import { catalogueLinks, hubPanelLocks, osFrame, withItemLocks } from "./nav.js";
34
34
  import { useOsPlate } from "./plate.js";
35
35
  import { useMenuSearch } from "./search.js";
36
36
  /* This app's own rows and tabs as links to their paths. Rows for other apps
@@ -92,19 +92,24 @@ export function OsWorkspaceFrame({ os, auth, appKey, tools, hubItems, location,
92
92
  void retryOsContext(os);
93
93
  }, [location]);
94
94
  const apps = context?.apps;
95
+ /* The items this person may open (0.3.13): null until the core answers,
96
+ undefined from a core older than the Hub's permissions. */
97
+ const items = context ? context.items : null;
95
98
  const slug = current?.slug ?? null;
96
99
  const frame = useMemo(() => {
97
100
  /* Only the catalogue says what this person holds. Until it arrives (or
98
101
  while a failed read is asked again) nothing is linked and nothing is
99
- "not held" or "not linked": other apps' tools read as being checked. */
100
- const { links, locked } = catalogueLinks(apps ?? null, slug);
102
+ "not held" or "not linked": other apps' tools read as being checked.
103
+ The items then lock every row the person may not open, whatever serves
104
+ it (0.3.13). */
105
+ const { links, locked } = withItemLocks(catalogueLinks(apps ?? null, slug), items);
101
106
  return osFrame({
102
107
  appKey, links, locked, admin: admin ?? manages, tenantSlug: slug,
103
108
  ...(tools ? { tools } : {}),
104
- ...(hubItems ? { hubItems } : {}),
109
+ ...(hubItems ? { hubItems } : { hubLocked: hubPanelLocks(items) }),
105
110
  ...(homePath ? { homePath } : {}),
106
111
  });
107
- }, [appKey, apps, admin, manages, slug, tools, hubItems, homePath]);
112
+ }, [appKey, apps, items, admin, manages, slug, tools, hubItems, homePath]);
108
113
  const linkTo = hrefFor === undefined ? (path) => path : hrefFor;
109
114
  const sections = useMemo(() => (linkTo ? linked(frame.sections, linkTo) : frame.sections), [frame, hrefFor]);
110
115
  /* `false` tells the frame a click went nowhere (Settings on the page
package/dist/index.d.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  export { coreUrl, corePublishableKey, coreProjectRef, companyMarkUrl, appLabelUrl, HUB_URL, PARENT_DOMAIN } from "./config.js";
2
2
  export { createOsClient, resetOsClient, type OsClient } from "./client.js";
3
3
  export { adoptSharedSession, followSharedSession, publishSessionChanges, sharedSessionCookieName, joinChunks } from "./session.js";
4
- export { loadOsContext, invalidateOsContext, refreshOsContext, retryOsContext, watchOsAuth, useOsContext, useOsContextState, useTenant, useApps, groupApps, markFor, labelFor, withTenantHint, type OsContext, type OsContextStatus, type OsTenant, type OsApp, } from "./context.js";
4
+ export { loadOsContext, invalidateOsContext, refreshOsContext, retryOsContext, watchOsAuth, useOsContext, useOsContextState, useTenant, useApps, groupApps, markFor, labelFor, withTenantHint, type OsContext, type OsContextStatus, type OsItemLevel, type OsTenant, type OsApp, } from "./context.js";
5
5
  export { isEntitled, isActiveMember, appRole, appVariant, currentTenant, toolAllowed, myAdminScope, canManageCurrentCompany, type AdminScope, } from "./identity.js";
6
6
  export { OsAppSwitcher, OsAppSwitcherPlate, OsCompanySwitcher, OsBar, useCompanySwitch } from "./chrome.js";
7
7
  export { OsAuthGate, type OsAuthGateProps } from "./gate.js";
package/dist/nav.d.ts CHANGED
@@ -186,6 +186,14 @@ export type OsToolLink = {
186
186
  * reaches a menu (catalogueLinks and staticLinks read nothing else), so its
187
187
  * catalogue row, which the app switcher still lists for the people who hold
188
188
  * it, puts no row in any app's menu.
189
+ *
190
+ * Since 0.3.12 (the owner's yes of 4 November 2026): Commercial > Customers
191
+ * opens Ops Hub's Customers page (/customers: New, At risk and Lapsed, from
192
+ * NetSuite sales) and Operations > Customer OTIF its Order OTIF page
193
+ * (/customer-otif, against NetSuite's ship-by dates), real data, not their
194
+ * sample pages in the Hub. Ops Hub has a page for every view the map gives
195
+ * them, so neither is in OS_TOOL_DATA: no mark. Ops Hub's own menu had them
196
+ * already (its ADOPTED_TOOLS).
189
197
  */
190
198
  export declare const OS_TOOL_LINKS: Record<string, OsToolLink>;
191
199
  /** The Hub's own pages, for the rail's Hub, Admin and Settings rows in other apps. */
@@ -326,6 +334,45 @@ export declare function catalogueLinks(apps: ReadonlyArray<{
326
334
  links: Record<string, string>;
327
335
  locked: Record<string, string>;
328
336
  };
337
+ /**
338
+ * The rows of the menu map a person may not open (0.3.13). Since the core's
339
+ * permissions (migration hub_permissions, 4 Nov 2026) os_context().items
340
+ * names every item of the map the person holds in the acting company, a
341
+ * dashboard or a tool, whatever serves it; every row it does not name is
342
+ * locked, sample pages and Finance included, with "Ask your company admin to
343
+ * switch this on for you". Until the core has answered (`null`, or a read
344
+ * that failed and is being asked again), and from a core older than the
345
+ * permissions (`undefined`), nothing is locked here: the rows stay as they
346
+ * were before 0.3.13, the catalogue's own "Checking your access…" rows
347
+ * included, and the pages and the server check again.
348
+ */
349
+ export declare function itemLocks(items: Readonly<Record<string, string>> | null | undefined): Record<string, string>;
350
+ /**
351
+ * catalogueLinks' answer with itemLocks applied (0.3.13): a row the person may
352
+ * not open is locked even when its app is held, and is never a link. Ops Hub
353
+ * serves thirteen rows, and holding one of them holds the app. A reason the
354
+ * catalogue gave already stays.
355
+ */
356
+ export declare function withItemLocks(base: {
357
+ links: Record<string, string>;
358
+ locked: Record<string, string>;
359
+ }, items: Readonly<Record<string, string>> | null | undefined): {
360
+ links: Record<string, string>;
361
+ locked: Record<string, string>;
362
+ };
363
+ /**
364
+ * The Hub panel's rows and the item each needs (0.3.13): the seven Smart Comms
365
+ * views share Smart Comms Hub, each tool has its own, and Configuration
366
+ * (everyone's settings) needs none.
367
+ */
368
+ export declare const OS_HUB_ROW_ITEMS: Readonly<Record<string, string>>;
369
+ /**
370
+ * The rows of the default Hub panel (OS_HUB_MENU) a person may not open, by
371
+ * row id (0.3.13), for osFrame's `hubLocked`. As itemLocks: nothing while
372
+ * the core has not answered or has no items. The Hub passes its own panel
373
+ * (`hubItems`) and decides these itself.
374
+ */
375
+ export declare function hubPanelLocks(items: Readonly<Record<string, string>> | null | undefined): Record<string, string>;
329
376
  /** A route inside this app. `path` may carry a query, e.g. "/launcher?section=signature". */
330
377
  export type OsRoute = {
331
378
  /** Where a click goes. */
@@ -436,6 +483,11 @@ export type OsFrameOptions = {
436
483
  * goes to the Hub, as before 0.3.0.
437
484
  */
438
485
  hubItems?: OsHubSection[];
486
+ /**
487
+ * Row id of the default Hub panel to the reason it is off (hubPanelLocks,
488
+ * 0.3.13). Used only when `hubItems` is not given.
489
+ */
490
+ hubLocked?: Record<string, string>;
439
491
  /** Tool id to address, for tools served by other apps (catalogueLinks or staticLinks). Used as given. */
440
492
  links?: Record<string, string>;
441
493
  /** Tool id to the reason its row is off (catalogueLinks): wins over the tool's page in the Hub. */
package/dist/nav.js CHANGED
@@ -253,6 +253,14 @@ const opsHub = (path) => ({ app: "ops_hub", url: OPS_HUB, path });
253
253
  * reaches a menu (catalogueLinks and staticLinks read nothing else), so its
254
254
  * catalogue row, which the app switcher still lists for the people who hold
255
255
  * it, puts no row in any app's menu.
256
+ *
257
+ * Since 0.3.12 (the owner's yes of 4 November 2026): Commercial > Customers
258
+ * opens Ops Hub's Customers page (/customers: New, At risk and Lapsed, from
259
+ * NetSuite sales) and Operations > Customer OTIF its Order OTIF page
260
+ * (/customer-otif, against NetSuite's ship-by dates), real data, not their
261
+ * sample pages in the Hub. Ops Hub has a page for every view the map gives
262
+ * them, so neither is in OS_TOOL_DATA: no mark. Ops Hub's own menu had them
263
+ * already (its ADOPTED_TOOLS).
256
264
  */
257
265
  export const OS_TOOL_LINKS = {
258
266
  "live-ecomm-sales": { app: "alive_reporting", url: "https://e-sales.autosolutions.app" },
@@ -269,6 +277,8 @@ export const OS_TOOL_LINKS = {
269
277
  "open-orders": opsHub("/customer-orders"),
270
278
  /* Ops Hub's POS dashboard (0.3.6). */
271
279
  "retailer-sell-out": opsHub("/pos-dashboard"),
280
+ /* Ops Hub's Customers page, on its New view (0.3.12). */
281
+ "customers": opsHub("/customers"),
272
282
  "crm": { app: "enxgy_crm", url: "https://e-crm.autosolutions.app" },
273
283
  "key-accounts": { app: "key_accounts", url: "https://key-accounts.autosolutions.app" },
274
284
  /* Operations' Overview is Ops Hub's home dashboard (owner, 0.3.3). */
@@ -278,6 +288,8 @@ export const OS_TOOL_LINKS = {
278
288
  "open-purchase-orders": opsHub("/po-pipeline"),
279
289
  "shipment-tracker": opsHub("/shipment-tracker"),
280
290
  "inventory-value": opsHub("/inventory-health?view=valuation"),
291
+ /* Ops Hub's Order OTIF page (0.3.12). */
292
+ "order-otif": opsHub("/customer-otif"),
281
293
  "action-queue": opsHub("/action-queue"),
282
294
  "ordering-tool": opsHub("/ordering"),
283
295
  "carton-label-generator": { app: "label_maker", url: "https://label-maker.autosolutions.app" },
@@ -471,6 +483,80 @@ export function catalogueLinks(apps, tenantSlug = null) {
471
483
  }
472
484
  return { links, locked };
473
485
  }
486
+ /**
487
+ * The rows of the menu map a person may not open (0.3.13). Since the core's
488
+ * permissions (migration hub_permissions, 4 Nov 2026) os_context().items
489
+ * names every item of the map the person holds in the acting company, a
490
+ * dashboard or a tool, whatever serves it; every row it does not name is
491
+ * locked, sample pages and Finance included, with "Ask your company admin to
492
+ * switch this on for you". Until the core has answered (`null`, or a read
493
+ * that failed and is being asked again), and from a core older than the
494
+ * permissions (`undefined`), nothing is locked here: the rows stay as they
495
+ * were before 0.3.13, the catalogue's own "Checking your access…" rows
496
+ * included, and the pages and the server check again.
497
+ */
498
+ export function itemLocks(items) {
499
+ const out = {};
500
+ if (!items)
501
+ return out;
502
+ for (const groups of Object.values(OS_MENU)) {
503
+ for (const group of groups) {
504
+ for (const tool of group.items) {
505
+ if (!Object.prototype.hasOwnProperty.call(items, tool.id))
506
+ out[tool.id] = HINTS.locked;
507
+ }
508
+ }
509
+ }
510
+ return out;
511
+ }
512
+ /**
513
+ * catalogueLinks' answer with itemLocks applied (0.3.13): a row the person may
514
+ * not open is locked even when its app is held, and is never a link. Ops Hub
515
+ * serves thirteen rows, and holding one of them holds the app. A reason the
516
+ * catalogue gave already stays.
517
+ */
518
+ export function withItemLocks(base, items) {
519
+ const links = { ...base.links };
520
+ const locked = { ...base.locked };
521
+ for (const [id, reason] of Object.entries(itemLocks(items))) {
522
+ delete links[id];
523
+ locked[id] = locked[id] ?? reason;
524
+ }
525
+ return { links, locked };
526
+ }
527
+ /**
528
+ * The Hub panel's rows and the item each needs (0.3.13): the seven Smart Comms
529
+ * views share Smart Comms Hub, each tool has its own, and Configuration
530
+ * (everyone's settings) needs none.
531
+ */
532
+ export const OS_HUB_ROW_ITEMS = {
533
+ overview: "hub-comms",
534
+ inbox: "hub-comms",
535
+ calendar: "hub-comms",
536
+ tasks: "hub-comms",
537
+ slack: "hub-comms",
538
+ monday: "hub-comms",
539
+ accounts: "hub-comms",
540
+ agent: "hub-agent",
541
+ voice: "hub-voice",
542
+ signature: "hub-signature",
543
+ };
544
+ /**
545
+ * The rows of the default Hub panel (OS_HUB_MENU) a person may not open, by
546
+ * row id (0.3.13), for osFrame's `hubLocked`. As itemLocks: nothing while
547
+ * the core has not answered or has no items. The Hub passes its own panel
548
+ * (`hubItems`) and decides these itself.
549
+ */
550
+ export function hubPanelLocks(items) {
551
+ const out = {};
552
+ if (!items)
553
+ return out;
554
+ for (const [row, item] of Object.entries(OS_HUB_ROW_ITEMS)) {
555
+ if (!Object.prototype.hasOwnProperty.call(items, item))
556
+ out[row] = HINTS.locked;
557
+ }
558
+ return out;
559
+ }
474
560
  /**
475
561
  * The Hub's panel (0.3.0), the design's: Smart Comms Hub, its eight views,
476
562
  * then Tools (the owner's name since 0.3.9; Assistants before). Every app
@@ -568,7 +654,7 @@ function best(routes, location, exact = false) {
568
654
  * company, the footer, and the only routing logic the frame needs.
569
655
  */
570
656
  export function osFrame(options) {
571
- const { appKey, tools = [], hubItems, admin = false, hubUrl = HUB_URL, tenantSlug = null, } = options;
657
+ const { appKey, tools = [], hubItems, hubLocked = {}, admin = false, hubUrl = HUB_URL, tenantSlug = null, } = options;
572
658
  const links = underMenuIds(options.links ?? {});
573
659
  const locked = underMenuIds(options.locked ?? {});
574
660
  const isHub = appKey === "hub";
@@ -588,7 +674,12 @@ export function osFrame(options) {
588
674
  ? hubItems.map((section) => ({ ...section, items: [...section.items] }))
589
675
  : OS_HUB_MENU.map((section) => ({
590
676
  ...(section.title ? { title: section.title } : {}),
591
- items: section.items.map((row) => inHub({ id: row.id, label: row.label, ...(row.icon ? { icon: row.icon } : {}) }, row.path ?? HUB_PATHS.home, row.match)),
677
+ items: section.items.map((row) => {
678
+ const base = { id: row.id, label: row.label, ...(row.icon ? { icon: row.icon } : {}) };
679
+ /* A row the person may not open (0.3.13): shown, locked, never a link. */
680
+ const reason = hubLocked[row.id];
681
+ return reason ? { ...base, disabled: true, title: reason } : inHub(base, row.path ?? HUB_PATHS.home, row.match);
682
+ }),
592
683
  }));
593
684
  }
594
685
  for (const [fn, groups] of Object.entries(OS_MENU)) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "autosolutions-os",
3
- "version": "0.3.11",
3
+ "version": "0.3.13",
4
4
  "description": "One sign-in, one company switcher, one app grid. What every AutoSolutions app imports instead of copying.",
5
5
  "type": "module",
6
6
  "license": "UNLICENSED",