@jskit-ai/workspaces-web 0.1.33 → 0.1.35
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/package.descriptor.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export default Object.freeze({
|
|
2
2
|
packageVersion: 1,
|
|
3
3
|
packageId: "@jskit-ai/workspaces-web",
|
|
4
|
-
version: "0.1.
|
|
4
|
+
version: "0.1.35",
|
|
5
5
|
kind: "runtime",
|
|
6
6
|
description: "Workspace web module: workspace selector, tools widget, workspace surfaces, and members/settings UI.",
|
|
7
7
|
dependsOn: [
|
|
@@ -166,8 +166,8 @@ export default Object.freeze({
|
|
|
166
166
|
mutations: {
|
|
167
167
|
dependencies: {
|
|
168
168
|
runtime: {
|
|
169
|
-
"@jskit-ai/workspaces-core": "0.1.
|
|
170
|
-
"@jskit-ai/users-web": "0.1.
|
|
169
|
+
"@jskit-ai/workspaces-core": "0.1.35",
|
|
170
|
+
"@jskit-ai/users-web": "0.1.74",
|
|
171
171
|
"vuetify": "^4.0.0"
|
|
172
172
|
},
|
|
173
173
|
dev: {}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jskit-ai/workspaces-web",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.35",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"test": "node --test"
|
|
@@ -15,12 +15,12 @@
|
|
|
15
15
|
"dependencies": {
|
|
16
16
|
"@tanstack/vue-query": "5.92.12",
|
|
17
17
|
"@mdi/js": "^7.4.47",
|
|
18
|
-
"@jskit-ai/http-runtime": "0.1.
|
|
19
|
-
"@jskit-ai/kernel": "0.1.
|
|
20
|
-
"@jskit-ai/shell-web": "0.1.
|
|
21
|
-
"@jskit-ai/users-core": "0.1.
|
|
22
|
-
"@jskit-ai/users-web": "0.1.
|
|
23
|
-
"@jskit-ai/workspaces-core": "0.1.
|
|
18
|
+
"@jskit-ai/http-runtime": "0.1.58",
|
|
19
|
+
"@jskit-ai/kernel": "0.1.59",
|
|
20
|
+
"@jskit-ai/shell-web": "0.1.58",
|
|
21
|
+
"@jskit-ai/users-core": "0.1.69",
|
|
22
|
+
"@jskit-ai/users-web": "0.1.74",
|
|
23
|
+
"@jskit-ai/workspaces-core": "0.1.35",
|
|
24
24
|
"vuetify": "^4.0.0"
|
|
25
25
|
},
|
|
26
26
|
"peerDependencies": {
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
<script setup>
|
|
2
2
|
import { computed } from "vue";
|
|
3
3
|
import { useRoute } from "vue-router";
|
|
4
|
-
import { useQuery } from "@tanstack/vue-query";
|
|
5
4
|
import { mdiEmailAlertOutline } from "@mdi/js";
|
|
6
5
|
import { appendQueryString } from "@jskit-ai/kernel/shared/support";
|
|
7
6
|
import {
|
|
@@ -41,68 +40,13 @@ function resolveReturnToHref() {
|
|
|
41
40
|
return resolveReturnTo();
|
|
42
41
|
}
|
|
43
42
|
|
|
44
|
-
function countPendingInvites(entries = []) {
|
|
45
|
-
if (!Array.isArray(entries)) {
|
|
46
|
-
return 0;
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
let total = 0;
|
|
50
|
-
for (const entry of entries) {
|
|
51
|
-
if (!entry || typeof entry !== "object") {
|
|
52
|
-
continue;
|
|
53
|
-
}
|
|
54
|
-
total += 1;
|
|
55
|
-
}
|
|
56
|
-
return total;
|
|
57
|
-
}
|
|
58
|
-
|
|
59
43
|
const authenticated = computed(() => placementContext.value?.auth?.authenticated === true);
|
|
60
|
-
|
|
61
|
-
const bootstrapSummaryQuery = useQuery({
|
|
62
|
-
queryKey: ["local-main", "account", "invites-cue", "bootstrap"],
|
|
63
|
-
enabled: authenticated,
|
|
64
|
-
staleTime: 5_000,
|
|
65
|
-
refetchInterval: 15_000,
|
|
66
|
-
queryFn: async () => {
|
|
67
|
-
const response = await fetch("/api/bootstrap", {
|
|
68
|
-
method: "GET",
|
|
69
|
-
credentials: "include",
|
|
70
|
-
headers: {
|
|
71
|
-
accept: "application/json"
|
|
72
|
-
}
|
|
73
|
-
});
|
|
74
|
-
if (!response.ok) {
|
|
75
|
-
throw new Error(`Bootstrap request failed with status ${response.status}.`);
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
return response.json();
|
|
79
|
-
}
|
|
80
|
-
});
|
|
81
|
-
|
|
82
44
|
const placementPendingInvitesCount = computed(() =>
|
|
83
45
|
normalizePendingInvitesCount(placementContext.value?.pendingInvitesCount)
|
|
84
46
|
);
|
|
85
|
-
const
|
|
86
|
-
const payload = bootstrapSummaryQuery.data.value;
|
|
87
|
-
const invitesEnabled = payload?.app?.features?.workspaceInvites === true;
|
|
88
|
-
if (!invitesEnabled) {
|
|
89
|
-
return 0;
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
return countPendingInvites(payload?.pendingInvites);
|
|
93
|
-
});
|
|
94
|
-
const pendingInvitesCount = computed(() =>
|
|
95
|
-
Math.max(placementPendingInvitesCount.value, bootstrapPendingInvitesCount.value)
|
|
96
|
-
);
|
|
97
|
-
|
|
47
|
+
const pendingInvitesCount = computed(() => placementPendingInvitesCount.value);
|
|
98
48
|
const placementWorkspaceInvitesEnabled = computed(() => placementContext.value?.workspaceInvitesEnabled === true);
|
|
99
|
-
const
|
|
100
|
-
const payload = bootstrapSummaryQuery.data.value;
|
|
101
|
-
return payload?.app?.features?.workspaceInvites === true;
|
|
102
|
-
});
|
|
103
|
-
const workspaceInvitesEnabled = computed(
|
|
104
|
-
() => placementWorkspaceInvitesEnabled.value || bootstrapWorkspaceInvitesEnabled.value
|
|
105
|
-
);
|
|
49
|
+
const workspaceInvitesEnabled = computed(() => placementWorkspaceInvitesEnabled.value);
|
|
106
50
|
|
|
107
51
|
const isVisible = computed(() => {
|
|
108
52
|
return (
|
|
@@ -67,6 +67,25 @@ test("workspaces-web installs an app-owned account invites section wrapper", asy
|
|
|
67
67
|
});
|
|
68
68
|
});
|
|
69
69
|
|
|
70
|
+
test("workspaces-web installs an account invites cue scaffold that reads placement runtime state", async () => {
|
|
71
|
+
const source = await readFile(
|
|
72
|
+
path.join(PACKAGE_DIR, "templates", "packages", "main", "src", "client", "components", "AccountPendingInvitesCue.vue"),
|
|
73
|
+
"utf8"
|
|
74
|
+
);
|
|
75
|
+
|
|
76
|
+
assert.doesNotMatch(source, /\bfetch\s*\(/);
|
|
77
|
+
assert.doesNotMatch(source, /\buseQuery\b/);
|
|
78
|
+
assert.match(source, /placementContext\.value\?\.pendingInvitesCount/);
|
|
79
|
+
assert.match(source, /placementContext\.value\?\.workspaceInvitesEnabled/);
|
|
80
|
+
assert.deepEqual(findFileMutation("users-web-main-component-account-pending-invites-cue"), {
|
|
81
|
+
from: "templates/packages/main/src/client/components/AccountPendingInvitesCue.vue",
|
|
82
|
+
to: "packages/main/src/client/components/AccountPendingInvitesCue.vue",
|
|
83
|
+
reason: "Install app-owned account pending invites cue component scaffold.",
|
|
84
|
+
category: "workspaces-web",
|
|
85
|
+
id: "users-web-main-component-account-pending-invites-cue"
|
|
86
|
+
});
|
|
87
|
+
});
|
|
88
|
+
|
|
70
89
|
test("workspaces-web admin settings index template is a simple developer-owned stub", async () => {
|
|
71
90
|
const source = await readFile(
|
|
72
91
|
path.join(PACKAGE_DIR, "templates", "src", "pages", "admin", "workspace", "settings", "index.vue"),
|