@7365admin1/layer-common 4.63.0 → 4.63.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.63.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- c3912eb: Worker nouns: fall back to the deployment's `APP` code when the app sets no `appSlug` (hygiene, M&E, pest, pool, landscape), so hygiene shows Cleaners instead of the neutral Staff.
|
|
8
|
+
|
|
3
9
|
## 4.63.0
|
|
4
10
|
|
|
5
11
|
### Minor Changes
|
|
@@ -1685,11 +1691,11 @@
|
|
|
1685
1691
|
`utils/console-tier.ts` + `composables/useConsoleTier.ts` mirror the server's
|
|
1686
1692
|
own rule from two endpoints the console already calls, unprojected:
|
|
1687
1693
|
|
|
1688
|
-
|
|
1689
|
-
|
|
1694
|
+
GET /api/members/user/:user/app/admin the Seven365 staff membership
|
|
1695
|
+
GET /api/roles/id/:role that membership's role document
|
|
1690
1696
|
|
|
1691
|
-
|
|
1692
|
-
|
|
1697
|
+
owner = member.type === "admin" && role.type === "admin" && role.default === true
|
|
1698
|
+
staff = member.type === "admin" && role.type === "admin"
|
|
1693
1699
|
|
|
1694
1700
|
`role.default` is the marker because it is the only property of a platform
|
|
1695
1701
|
staff role no API caller can set - `role.controller.ts` validates create and
|
|
@@ -133,7 +133,7 @@
|
|
|
133
133
|
|
|
134
134
|
<script setup lang="ts">
|
|
135
135
|
import useInventory, { saveBlob } from "../composables/useInventory";
|
|
136
|
-
import useWorkerTerm from "../composables/useWorkerTerm";
|
|
136
|
+
import useWorkerTerm, { workerAppKey } from "../composables/useWorkerTerm";
|
|
137
137
|
import useUtils from "../composables/useUtils";
|
|
138
138
|
import useFile from "../composables/useFile";
|
|
139
139
|
|
|
@@ -152,7 +152,7 @@ const usagePhotos = (row: any) => [
|
|
|
152
152
|
const notify = inject<(text: string, color?: string) => void>("inventoryNotify", () => {});
|
|
153
153
|
|
|
154
154
|
const worker = useWorkerTerm({ providers: true });
|
|
155
|
-
const appSlug =
|
|
155
|
+
const appSlug = workerAppKey();
|
|
156
156
|
|
|
157
157
|
const now = new Date();
|
|
158
158
|
const month = ref(`${now.getFullYear()}-${String(now.getMonth() + 1).padStart(2, "0")}`);
|
|
@@ -3,8 +3,15 @@ import { workerTerm } from "../utils/worker-terms";
|
|
|
3
3
|
/**
|
|
4
4
|
* The worker noun for the app this page runs in ("Cleaner" in Hygiene,
|
|
5
5
|
* "Security officer" in Security, ...). See utils/worker-terms.ts.
|
|
6
|
-
*
|
|
6
|
+
* Keyed by `runtimeConfig.public.appSlug`, else the deployment's `APP` code
|
|
7
|
+
* ("cleaning_services", "security_agency", ...) - hygiene, M&E, pest, pool and
|
|
8
|
+
* landscape set only `APP`. Neither = the neutral "Staff".
|
|
7
9
|
*/
|
|
10
|
+
export function workerAppKey(): string | undefined {
|
|
11
|
+
const pub = useRuntimeConfig().public ?? {};
|
|
12
|
+
return (pub.appSlug || pub.APP || undefined) as string | undefined;
|
|
13
|
+
}
|
|
14
|
+
|
|
8
15
|
export default function useWorkerTerm(opts?: { providers?: boolean }) {
|
|
9
|
-
return workerTerm(
|
|
16
|
+
return workerTerm(workerAppKey(), opts);
|
|
10
17
|
}
|
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.63.
|
|
5
|
+
"version": "4.63.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.",
|
package/utils/worker-terms.ts
CHANGED
|
@@ -4,8 +4,8 @@
|
|
|
4
4
|
* A cleaning company's workers are cleaners, not technicians. Every screen,
|
|
5
5
|
* export and mobile app takes the noun from here, keyed by the app it runs in
|
|
6
6
|
* (`appSlug`, e.g. "iservice365-web-app-hygiene" or
|
|
7
|
-
* "iservice365-hygiene-mobile-app"); a service-type code
|
|
8
|
-
* "security_agency", ...) resolves the same way. Only the words change -
|
|
7
|
+
* "iservice365-hygiene-mobile-app"); a service-type or deployment `APP` code
|
|
8
|
+
* ("cleaning_services", "security_agency", ...) resolves the same way. Only the words change -
|
|
9
9
|
* field names and API keys (`technician`, `usedByTechnicians`,
|
|
10
10
|
* `/reports/technicians`) stay as they are.
|
|
11
11
|
*
|