@7365admin1/layer-common 4.123.0 → 4.123.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/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # @iservice365/layer-common
2
2
 
3
+ ## 4.123.1
4
+
5
+ ### Patch Changes
6
+
7
+ - 2a14035: Robots Setup: "Floors on the map" now names the robot that reports a floor the map lacks and lists the map's floors; a lift whose gateway exists but is not connected offers "Open lift queue" instead of "Connect gateway" (which would replace its code).
8
+
3
9
  ## 4.123.0
4
10
 
5
11
  ### Minor Changes
@@ -3252,11 +3258,11 @@ Monthly report: a month that had patrols opens the list of that month's patrol r
3252
3258
  `utils/console-tier.ts` + `composables/useConsoleTier.ts` mirror the server's
3253
3259
  own rule from two endpoints the console already calls, unprojected:
3254
3260
 
3255
- GET /api/members/user/:user/app/admin the Seven365 staff membership
3256
- GET /api/roles/id/:role that membership's role document
3261
+ GET /api/members/user/:user/app/admin the Seven365 staff membership
3262
+ GET /api/roles/id/:role that membership's role document
3257
3263
 
3258
- owner = member.type === "admin" && role.type === "admin" && role.default === true
3259
- staff = member.type === "admin" && role.type === "admin"
3264
+ owner = member.type === "admin" && role.type === "admin" && role.default === true
3265
+ staff = member.type === "admin" && role.type === "admin"
3260
3266
 
3261
3267
  `role.default` is the marker because it is the only property of a platform
3262
3268
  staff role no API caller can set - `role.controller.ts` validates create and
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@7365admin1/layer-common",
3
3
  "license": "MIT",
4
4
  "type": "module",
5
- "version": "4.123.0",
5
+ "version": "4.123.1",
6
6
  "author": "7365admin1",
7
7
  "main": "./nuxt.config.ts",
8
8
  "//files": "What a consumer extending this layer actually loads. Without this npm ships the whole working tree - the changesets, the CI workflows, the render harness in tools/ and any scratch directory that happened to exist at publish time. Nuxt resolves a layer by directory, so every runtime directory below has to stay listed; adding a new top-level runtime directory means adding it here too.",
@@ -186,14 +186,12 @@ export function robotSetupSteps(input: TSetupInput): TSetupStep[] {
186
186
 
187
187
  // 5. Floors present: one per floor the robots report.
188
188
  const floors = floorsOf(map);
189
- const reported = [
190
- ...new Set<number>(
191
- Object.values(input.states ?? {})
192
- .filter((s) => s?.ok && s.floorKnown === true && Number.isInteger(s.floorNo))
193
- .map((s) => Number(s.floorNo)),
194
- ),
195
- ];
189
+ const onFloor = (robots ?? [])
190
+ .map((r) => ({ name: String(r?.name || "A robot"), s: input.states?.[String(r?._id)] }))
191
+ .filter((x) => x.s?.ok && x.s.floorKnown === true && Number.isInteger(x.s.floorNo));
192
+ const reported = [...new Set<number>(onFloor.map((x) => Number(x.s!.floorNo)))];
196
193
  const missing = reported.filter((f) => !floors.includes(f));
194
+ const who = (f: number) => onFloor.filter((x) => Number(x.s!.floorNo) === f).map((x) => x.name).join(", ");
197
195
  if (map === undefined) {
198
196
  steps.push({ key: "floors", title: "Floors on the map", status: "check", reason: "Could not read the saved building map.", button: { label: "Open building map", target: "map" } });
199
197
  } else if (!map) {
@@ -206,7 +204,7 @@ export function robotSetupSteps(input: TSetupInput): TSetupStep[] {
206
204
  reason: !floors.length
207
205
  ? "The saved map has no floors. Use Edit map → Add floor."
208
206
  : missing.length
209
- ? `Robots report ${missing.map(floorName).join(", ")}, which the map does not have. Add ${missing.length === 1 ? "it" : "them"} in Edit map → Add floor.`
207
+ ? `${missing.map((f) => `${who(f)} report${who(f).includes(",") ? "" : "s"} ${floorName(f)}`).join("; ")} - the map has no such floor (it has ${floors.map(floorName).join(", ")}). Add it in Edit map → Add floor, or check the floor set in the robot's own app.`
210
208
  : `${floors.map(floorName).join(", ")}${reported.length ? " - every floor the robots report." : "."}`,
211
209
  button: { label: "Edit floors", target: "map" },
212
210
  });
@@ -268,7 +266,8 @@ export function robotSetupSteps(input: TSetupInput): TSetupStep[] {
268
266
  ? "Floor and door are read from the real lift."
269
267
  : "Floor and door not decoded yet - waiting on the lift company's register list."
270
268
  : undefined,
271
- button: { label: up.length ? "Open lift queue" : "Connect gateway", target: "lifts" },
269
+ // An existing (not connected) gateway is checked on the lift queue; Connect there would replace its code.
270
+ button: { label: up.length || gws.length ? "Open lift queue" : "Connect gateway", target: "lifts" },
272
271
  });
273
272
  }
274
273