@jskit-ai/users-web 0.1.4
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 +507 -0
- package/package.json +31 -0
- package/src/client/components/ConsoleSettingsClientElement.vue +24 -0
- package/src/client/components/MembersAdminClientElement.vue +404 -0
- package/src/client/components/ProfileClientElement.vue +242 -0
- package/src/client/components/UsersProfileSurfaceSwitchMenuItem.vue +39 -0
- package/src/client/components/UsersShellMenuLinkItem.vue +140 -0
- package/src/client/components/UsersSurfaceAwareMenuLinkItem.vue +87 -0
- package/src/client/components/UsersWorkspaceMembersMenuItem.vue +36 -0
- package/src/client/components/UsersWorkspacePermissionMenuItem.vue +90 -0
- package/src/client/components/UsersWorkspaceSelector.vue +237 -0
- package/src/client/components/UsersWorkspaceSettingsMenuItem.vue +39 -0
- package/src/client/components/UsersWorkspaceToolsWidget.vue +23 -0
- package/src/client/components/WorkspaceMembersClientElement.vue +663 -0
- package/src/client/components/WorkspaceSettingsClientElement.vue +230 -0
- package/src/client/components/WorkspacesClientElement.vue +514 -0
- package/src/client/composables/accountSettingsAvatarUploadRuntime.js +241 -0
- package/src/client/composables/accountSettingsInvitesRuntime.js +88 -0
- package/src/client/composables/accountSettingsRuntimeConstants.js +77 -0
- package/src/client/composables/accountSettingsRuntimeHelpers.js +75 -0
- package/src/client/composables/errorMessageHelpers.js +66 -0
- package/src/client/composables/internal/useOperationScope.js +144 -0
- package/src/client/composables/modelStateHelpers.js +49 -0
- package/src/client/composables/operationUiHelpers.js +121 -0
- package/src/client/composables/operationValidationHelpers.js +52 -0
- package/src/client/composables/refValueHelpers.js +19 -0
- package/src/client/composables/scopeHelpers.js +145 -0
- package/src/client/composables/useAccess.js +109 -0
- package/src/client/composables/useAccountSettingsRuntime.js +533 -0
- package/src/client/composables/useAddEdit.js +135 -0
- package/src/client/composables/useAddEditCore.js +137 -0
- package/src/client/composables/useBootstrapQuery.js +52 -0
- package/src/client/composables/useCommand.js +112 -0
- package/src/client/composables/useCommandCore.js +130 -0
- package/src/client/composables/useEndpointResource.js +104 -0
- package/src/client/composables/useFieldErrorBag.js +61 -0
- package/src/client/composables/useList.js +85 -0
- package/src/client/composables/useListCore.js +65 -0
- package/src/client/composables/usePagedCollection.js +125 -0
- package/src/client/composables/usePaths.js +108 -0
- package/src/client/composables/useRealtimeQueryInvalidation.js +105 -0
- package/src/client/composables/useScopeRuntime.js +107 -0
- package/src/client/composables/useSurfaceRouteContext.js +31 -0
- package/src/client/composables/useUiFeedback.js +96 -0
- package/src/client/composables/useView.js +89 -0
- package/src/client/composables/useViewCore.js +104 -0
- package/src/client/composables/useWorkspaceRouteContext.js +28 -0
- package/src/client/composables/useWorkspaceSurfaceId.js +43 -0
- package/src/client/index.js +7 -0
- package/src/client/lib/bootstrap.js +95 -0
- package/src/client/lib/httpClient.js +67 -0
- package/src/client/lib/menuIcons.js +192 -0
- package/src/client/lib/permissions.js +34 -0
- package/src/client/lib/profileSurfaceMenuLinks.js +142 -0
- package/src/client/lib/surfaceAccessPolicy.js +350 -0
- package/src/client/lib/theme.js +99 -0
- package/src/client/lib/workspaceLinkResolver.js +207 -0
- package/src/client/lib/workspaceSurfaceContext.js +82 -0
- package/src/client/lib/workspaceSurfacePaths.js +163 -0
- package/src/client/providers/UsersWebClientProvider.js +85 -0
- package/src/client/runtime/bootstrapPlacementRouteGuards.js +371 -0
- package/src/client/runtime/bootstrapPlacementRuntime.js +413 -0
- package/src/client/runtime/bootstrapPlacementRuntimeConstants.js +32 -0
- package/src/client/runtime/bootstrapPlacementRuntimeHelpers.js +157 -0
- package/src/client/support/contractGuards.js +34 -0
- package/src/client/support/realtimeWorkspace.js +12 -0
- package/src/client/support/runtimeNormalization.js +27 -0
- package/src/client/support/workspaceQueryKeys.js +15 -0
- package/templates/packages/main/src/client/components/AccountPendingInvitesCue.vue +162 -0
- package/templates/src/components/WorkspaceNotFoundCard.vue +33 -0
- package/templates/src/components/account/settings/AccountSettingsClientElement.vue +153 -0
- package/templates/src/components/account/settings/AccountSettingsInvitesSection.vue +77 -0
- package/templates/src/components/account/settings/AccountSettingsNotificationsSection.vue +55 -0
- package/templates/src/components/account/settings/AccountSettingsPreferencesSection.vue +125 -0
- package/templates/src/components/account/settings/AccountSettingsProfileSection.vue +94 -0
- package/templates/src/composables/useWorkspaceNotFoundState.js +48 -0
- package/templates/src/pages/account/index.vue +17 -0
- package/templates/src/pages/admin/members/index.vue +7 -0
- package/templates/src/pages/admin/workspace/settings/index.vue +16 -0
- package/templates/src/pages/console/settings/index.vue +16 -0
- package/templates/src/surfaces/admin/index.vue +29 -0
- package/templates/src/surfaces/admin/root.vue +20 -0
- package/templates/src/surfaces/app/index.vue +27 -0
- package/templates/src/surfaces/app/root.vue +20 -0
- package/test/bootstrap.test.js +38 -0
- package/test/bootstrapPlacementRuntime.test.js +991 -0
- package/test/errorMessageHelpers.test.js +28 -0
- package/test/exportsContract.test.js +39 -0
- package/test/menuIcons.test.js +33 -0
- package/test/permissions.test.js +35 -0
- package/test/profileSurfaceMenuLinks.test.js +207 -0
- package/test/refValueHelpers.test.js +14 -0
- package/test/scopeHelpers.test.js +57 -0
- package/test/surfaceAccessPolicy.test.js +129 -0
- package/test/theme.test.js +95 -0
- package/test/workspaceLinkResolver.test.js +61 -0
- package/test/workspaceSurfacePaths.test.js +39 -0
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import assert from "node:assert/strict";
|
|
2
|
+
import test from "node:test";
|
|
3
|
+
import { resolveWorkspaceShellLinkPath } from "../src/client/lib/workspaceLinkResolver.js";
|
|
4
|
+
|
|
5
|
+
function createContext({ defaultSurfaceId = "dashboard", enabledSurfaceIds = ["dashboard"], surfacesById = {} } = {}) {
|
|
6
|
+
return {
|
|
7
|
+
surfaceConfig: {
|
|
8
|
+
defaultSurfaceId,
|
|
9
|
+
enabledSurfaceIds,
|
|
10
|
+
surfacesById
|
|
11
|
+
}
|
|
12
|
+
};
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
test("resolveWorkspaceShellLinkPath resolves workspace path for known workspace surfaces", () => {
|
|
16
|
+
const context = {
|
|
17
|
+
surfaceConfig: {
|
|
18
|
+
defaultSurfaceId: "dashboard",
|
|
19
|
+
enabledSurfaceIds: ["dashboard"],
|
|
20
|
+
surfacesById: {
|
|
21
|
+
dashboard: {
|
|
22
|
+
routeBase: "/dashboard",
|
|
23
|
+
requiresWorkspace: true
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
const path = resolveWorkspaceShellLinkPath({
|
|
30
|
+
context,
|
|
31
|
+
surface: "dashboard",
|
|
32
|
+
mode: "workspace",
|
|
33
|
+
workspaceSlug: "acme"
|
|
34
|
+
});
|
|
35
|
+
|
|
36
|
+
assert.equal(path, "/w/acme");
|
|
37
|
+
});
|
|
38
|
+
|
|
39
|
+
test("resolveWorkspaceShellLinkPath returns empty path for unknown non-default workspace surface", () => {
|
|
40
|
+
const context = createContext();
|
|
41
|
+
const path = resolveWorkspaceShellLinkPath({
|
|
42
|
+
context,
|
|
43
|
+
surface: "admin",
|
|
44
|
+
mode: "workspace",
|
|
45
|
+
workspaceSlug: "acme"
|
|
46
|
+
});
|
|
47
|
+
|
|
48
|
+
assert.equal(path, "");
|
|
49
|
+
});
|
|
50
|
+
|
|
51
|
+
test("resolveWorkspaceShellLinkPath returns empty path for unknown console-like surface ids", () => {
|
|
52
|
+
const context = createContext();
|
|
53
|
+
const path = resolveWorkspaceShellLinkPath({
|
|
54
|
+
context,
|
|
55
|
+
surface: "console",
|
|
56
|
+
mode: "workspace",
|
|
57
|
+
workspaceSlug: "acme"
|
|
58
|
+
});
|
|
59
|
+
|
|
60
|
+
assert.equal(path, "");
|
|
61
|
+
});
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import assert from "node:assert/strict";
|
|
2
|
+
import test from "node:test";
|
|
3
|
+
|
|
4
|
+
import {
|
|
5
|
+
resolveAccountSettingsPathFromPlacementContext,
|
|
6
|
+
resolveSurfaceWorkspacePathFromPlacementContext
|
|
7
|
+
} from "../src/client/lib/workspaceSurfacePaths.js";
|
|
8
|
+
|
|
9
|
+
test("resolveSurfaceWorkspacePathFromPlacementContext returns empty path without workspace slug", () => {
|
|
10
|
+
const context = {
|
|
11
|
+
surfaceConfig: {
|
|
12
|
+
defaultSurfaceId: "home",
|
|
13
|
+
enabledSurfaceIds: ["home", "app", "admin", "console"],
|
|
14
|
+
surfacesById: {
|
|
15
|
+
home: { id: "home", routeBase: "/home", requiresWorkspace: false },
|
|
16
|
+
app: { id: "app", routeBase: "/w/:workspaceSlug", requiresWorkspace: true },
|
|
17
|
+
admin: { id: "admin", routeBase: "/w/:workspaceSlug/admin", requiresWorkspace: true },
|
|
18
|
+
console: { id: "console", routeBase: "/console", requiresWorkspace: false }
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
assert.equal(resolveSurfaceWorkspacePathFromPlacementContext(context, "app", "", "/"), "");
|
|
24
|
+
});
|
|
25
|
+
|
|
26
|
+
test("resolveAccountSettingsPathFromPlacementContext uses account surface route when available", () => {
|
|
27
|
+
const context = {
|
|
28
|
+
surfaceConfig: {
|
|
29
|
+
defaultSurfaceId: "home",
|
|
30
|
+
enabledSurfaceIds: ["home", "account"],
|
|
31
|
+
surfacesById: {
|
|
32
|
+
home: { id: "home", routeBase: "/home", requiresWorkspace: false },
|
|
33
|
+
account: { id: "account", routeBase: "/profile", requiresWorkspace: false }
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
assert.equal(resolveAccountSettingsPathFromPlacementContext(context), "/profile");
|
|
39
|
+
});
|