@7365admin1/layer-common 4.2.9-staging.277 → 4.2.9-staging.278

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.
@@ -2034,15 +2034,27 @@ const selectedVisitorObject = computed<Record<string, any>>(() => {
2034
2034
  ];
2035
2035
  includedKeys.unshift(...(typeFieldMap[type] ?? []));
2036
2036
 
2037
- let locationString = "N/A";
2038
-
2039
- if (obj?.block?.name || obj?.level?.name || obj?.unitName) {
2040
- locationString = `${obj.block?.name} / ${obj.level?.name} / ${obj.unitName}`;
2041
- } else if (obj?.block?.name) {
2042
- locationString = obj.block?.name;
2043
- } else {
2044
- locationString = "N/A";
2045
- }
2037
+ /**
2038
+ * V-07: THE DETAIL DIALOG PRINTED `undefined / undefined / 12-34`.
2039
+ *
2040
+ * The guard was an OR over the three parts, but the string interpolated all
2041
+ * THREE unconditionally - so a visitor recorded against a unit with no block
2042
+ * and no level (every walk-in registered from the unit number alone) got the
2043
+ * word `undefined` twice, joined by the separators, in front of a perfectly
2044
+ * good unit. The `else if (block)` branch below it could never run: the OR
2045
+ * above had already matched on the same block.
2046
+ *
2047
+ * Only the parts that EXIST are joined now, which is the same rule
2048
+ * `useSecurityUtils().formatLocation` already applies everywhere else, so a
2049
+ * full location still reads `Block A / Level 12 / 12-34` exactly as before
2050
+ * and a partial one reads `12-34` instead of two undefineds.
2051
+ */
2052
+ const locationParts = [obj?.block?.name, obj?.level?.name, obj?.unitName]
2053
+ .filter((part) => part !== null && part !== undefined && part !== "");
2054
+
2055
+ const locationString = locationParts.length
2056
+ ? locationParts.join(" / ")
2057
+ : "N/A";
2046
2058
 
2047
2059
  return {
2048
2060
  ...Object.fromEntries(
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.2.9-staging.277",
5
+ "version": "4.2.9-staging.278",
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.",