@burdenoff/microfe-workspaces 2026.1109.1 → 2026.1110.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/dist/WorkspacesRoot.js +10 -9
- package/dist/WorkspacesRoutes.js +1 -2
- package/dist/components/CreateProjectDialog.js +22 -22
- package/dist/components/CreateWorkspaceDialog.js +8 -9
- package/dist/components/InviteMemberDialog.js +18 -23
- package/dist/components/MemberListItem.js +16 -17
- package/dist/components/ProjectCard.js +14 -15
- package/dist/components/ProjectMemberPickerDialog.js +92 -93
- package/dist/components/RenameProjectDialog.js +12 -17
- package/dist/components/WorkspaceCard.js +6 -7
- package/dist/components/WorkspaceContextPathSync.js +4 -5
- package/dist/components/WorkspacesErrorBoundary.js +6 -11
- package/dist/components/index.js +8 -7
- package/dist/components/tags/ProjectTagsWidget.js +56 -57
- package/dist/components/tags/WorkspaceTagsEditor.js +2 -3
- package/dist/constants/permissions.js +1 -2
- package/dist/generated/global-operations.js +1 -2
- package/dist/generated/wspace-operations.js +1 -2
- package/dist/hooks/index.js +9 -8
- package/dist/hooks/useMemberMutations.js +165 -166
- package/dist/hooks/useOpenWorkspace.js +1 -2
- package/dist/hooks/useOrgsWithPermission.js +2 -3
- package/dist/hooks/usePendingInvitations.d.ts +1 -1
- package/dist/hooks/usePendingInvitations.js +2 -3
- package/dist/hooks/useProjectMemberMutations.js +23 -24
- package/dist/hooks/useProjectMembers.d.ts +2 -2
- package/dist/hooks/useProjectMembers.js +2 -3
- package/dist/hooks/useProjectMutations.js +68 -69
- package/dist/hooks/useProjects.d.ts +3 -3
- package/dist/hooks/useProjects.js +5 -6
- package/dist/hooks/useScopedNavigation.js +1 -2
- package/dist/hooks/useTenants.d.ts +2 -2
- package/dist/hooks/useTenants.js +3 -4
- package/dist/hooks/useTr.js +1 -2
- package/dist/hooks/useWorkspaceActivity.d.ts +1 -1
- package/dist/hooks/useWorkspaceActivity.js +2 -3
- package/dist/hooks/useWorkspaceMembers.d.ts +5 -5
- package/dist/hooks/useWorkspaceMembers.js +7 -8
- package/dist/hooks/useWorkspaceMutations.js +70 -71
- package/dist/hooks/useWorkspacePermissions.js +1 -2
- package/dist/hooks/useWorkspaceRoles.d.ts +1 -1
- package/dist/hooks/useWorkspaceRoles.js +3 -4
- package/dist/hooks/useWorkspaces.d.ts +3 -3
- package/dist/hooks/useWorkspaces.js +4 -5
- package/dist/hooks/useWorkspacesEventEmitter.js +1 -2
- package/dist/hooks/useWorkspacesPageView.js +1 -2
- package/dist/index.js +15 -15
- package/dist/pages/ActivityListPage.js +28 -29
- package/dist/pages/CreateWorkspacePage.js +137 -138
- package/dist/pages/InviteAcceptancePage.js +65 -66
- package/dist/pages/MembersListPage.js +203 -204
- package/dist/pages/PendingInvitesPage.js +63 -64
- package/dist/pages/ProjectDetailPage.js +71 -72
- package/dist/pages/ProjectMembersPage.js +116 -117
- package/dist/pages/ProjectsListPage.js +62 -67
- package/dist/pages/WorkspaceDetailPage.js +153 -154
- package/dist/pages/WorkspaceInvitePage.js +88 -92
- package/dist/pages/WorkspaceSettingsPage.js +32 -33
- package/dist/pages/WorkspacesListPage.js +40 -41
- package/dist/pages/dashboard/DashboardCustomizer.js +98 -94
- package/dist/pages/dashboard/DashboardGrid.js +1 -2
- package/dist/pages/dashboard/DashboardPage.js +12 -13
- package/dist/pages/dashboard/WidgetWrapper.js +3 -3
- package/dist/pages/dashboard/config.js +3 -4
- package/dist/pages/dashboard/hooks/useDashboardData.d.ts +5 -5
- package/dist/pages/dashboard/hooks/useDashboardData.js +9 -10
- package/dist/pages/dashboard/hooks/useDashboardPreferences.js +7 -8
- package/dist/pages/dashboard/reorder.js +11 -14
- package/dist/pages/dashboard/widgets/AgentsWidget.js +13 -14
- package/dist/pages/dashboard/widgets/GroupsWidget.js +9 -10
- package/dist/pages/dashboard/widgets/MembersWidget.js +10 -11
- package/dist/pages/dashboard/widgets/ProjectsWidget.js +11 -12
- package/dist/pages/dashboard/widgets/QuickActionsWidget.js +28 -29
- package/dist/pages/dashboard/widgets/RecentActivityWidget.js +22 -23
- package/dist/pages/dashboard/widgets/SessionsWidget.js +28 -29
- package/dist/pages/dashboard/widgets/StorageWidget.js +19 -20
- package/dist/pages/dashboard/widgets/TagCloudWidget.js +9 -10
- package/dist/pages/dashboard/widgets/TipsWidget.js +5 -6
- package/dist/pages/dashboard/widgets/UpcomingEventsWidget.js +17 -18
- package/dist/pages/dashboard/widgets/VibesWidget.js +13 -14
- package/dist/pages/dashboard/widgets/WelcomeWidget.js +11 -12
- package/dist/pages/dashboard/widgets/WorkflowRunsWidget.js +16 -17
- package/dist/pages/dashboard/widgets/WorkflowStatsWidget.js +11 -12
- package/dist/pages/dashboard/widgets/WorkflowsOverviewWidget.js +17 -18
- package/dist/pages/dashboard/widgets/WorkspacesWidget.js +7 -8
- package/dist/pages/dashboard/widgets/tipsCatalog.js +1 -2
- package/dist/providers/WorkspacesProvider.js +1 -2
- package/dist/store/workspacesStore.d.ts +1 -1
- package/dist/store/workspacesStore.js +1 -2
- package/dist/test/happydom.d.ts +1 -0
- package/dist/translations/en.js +1 -2
- package/dist/utils/formatters.js +1 -2
- package/dist/utils/i18n.js +1 -2
- package/dist/utils/invitationDisplay.js +1 -2
- package/dist/utils/nativeBridge.js +1 -2
- package/dist/utils/pinnedRequest.js +2 -3
- package/dist/utils/projectTags.js +2 -3
- package/dist/utils/slug.js +1 -2
- package/dist/utils/telemetryError.js +13 -16
- package/dist/utils/tokenHelpers.js +1 -2
- package/dist/utils/workspaceBulkInviteCsv.js +3 -8
- package/package.json +72 -55
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
1
|
+
import { captureRequestActor as e, pinnedFetch as t } from "../utils/pinnedRequest.js";
|
|
2
|
+
import { useWorkspacesContext as n } from "../providers/WorkspacesProvider.js";
|
|
3
|
+
import { useWorkspacesEventEmitter as r } from "./useWorkspacesEventEmitter.js";
|
|
4
|
+
import { DeleteWorkspaceDocument as i, UpdateWorkspaceDocument as a } from "../generated/wspace-operations.js";
|
|
5
|
+
import { ActivateGlobalWorkspaceDocument as o, ArchiveGlobalWorkspaceDocument as s, UpdateGlobalWorkspaceDocument as c } from "../generated/global-operations.js";
|
|
6
6
|
import { safeTelemetryError as l } from "../utils/telemetryError.js";
|
|
7
7
|
import { useMutation as u, useQueryClient as d } from "@tanstack/react-query";
|
|
8
8
|
import { print as f } from "graphql";
|
|
9
|
-
|
|
9
|
+
// src/hooks/useWorkspaceMutations.ts
|
|
10
10
|
var p = "\n mutation CreateGlobalWorkspace($input: CreateWorkspaceInput!) {\n createWorkspace(input: $input) {\n id\n name\n slug\n type\n status\n tenantId\n organizationId\n createdAt\n }\n }\n";
|
|
11
11
|
function m(e, t) {
|
|
12
12
|
e.invalidateQueries({ queryKey: ["workspaces"] }), t && (e.invalidateQueries({ queryKey: ["workspace", t] }), e.invalidateQueries({ queryKey: [
|
|
@@ -16,62 +16,62 @@ function m(e, t) {
|
|
|
16
16
|
] })), e.invalidateQueries({ queryKey: ["myWorkspaces"] }), e.invalidateQueries({ queryKey: ["myTenants"] }), e.invalidateQueries({ queryKey: ["myOrganizations"] }), e.invalidateQueries({ queryKey: ["dashboard", "global"] });
|
|
17
17
|
}
|
|
18
18
|
var h = () => {
|
|
19
|
-
let { authToken:
|
|
19
|
+
let { authToken: i, currentUser: a, onWorkspaceCreate: o } = n(), s = d(), { emit: c } = r();
|
|
20
20
|
return u({
|
|
21
|
-
mutationFn: async (
|
|
22
|
-
let r =
|
|
23
|
-
authToken:
|
|
24
|
-
currentUser:
|
|
25
|
-
}), {
|
|
21
|
+
mutationFn: async (n) => {
|
|
22
|
+
let r = e({
|
|
23
|
+
authToken: i,
|
|
24
|
+
currentUser: a
|
|
25
|
+
}), o = await t(r, {
|
|
26
26
|
gateway: "global",
|
|
27
27
|
query: p,
|
|
28
|
-
variables: { input:
|
|
28
|
+
variables: { input: n }
|
|
29
29
|
});
|
|
30
|
-
if (
|
|
31
|
-
return
|
|
30
|
+
if (o.errors?.length) throw Error(o.errors[0]?.message || "Failed to create workspace");
|
|
31
|
+
return o.data.createWorkspace;
|
|
32
32
|
},
|
|
33
33
|
onSuccess: (e) => {
|
|
34
|
-
m(
|
|
34
|
+
m(s, e.id), c("workspace.created", {
|
|
35
35
|
workspaceId: e.id,
|
|
36
36
|
source: "microfe-workspaces"
|
|
37
|
-
}),
|
|
37
|
+
}), o && o(e);
|
|
38
38
|
},
|
|
39
39
|
onError: (e) => {
|
|
40
|
-
|
|
40
|
+
c("workspace.create_failed", {
|
|
41
41
|
source: "microfe-workspaces",
|
|
42
42
|
errorMessage: l(e)
|
|
43
43
|
});
|
|
44
44
|
}
|
|
45
45
|
});
|
|
46
46
|
}, g = () => {
|
|
47
|
-
let { authToken:
|
|
47
|
+
let { authToken: i, currentUser: o } = n(), s = d(), { emit: p } = r();
|
|
48
48
|
return u({
|
|
49
|
-
mutationFn: async ({ id:
|
|
50
|
-
let
|
|
51
|
-
authToken:
|
|
52
|
-
currentUser:
|
|
53
|
-
}), { name: l, ...u } =
|
|
49
|
+
mutationFn: async ({ id: n, input: r }) => {
|
|
50
|
+
let s = e({
|
|
51
|
+
authToken: i,
|
|
52
|
+
currentUser: o
|
|
53
|
+
}), { name: l, ...u } = r, d;
|
|
54
54
|
if (l !== void 0) {
|
|
55
|
-
let
|
|
55
|
+
let e = await t(s, {
|
|
56
56
|
gateway: "global",
|
|
57
|
-
query: f(
|
|
57
|
+
query: f(c),
|
|
58
58
|
variables: {
|
|
59
|
-
id:
|
|
59
|
+
id: n,
|
|
60
60
|
input: { name: l }
|
|
61
61
|
}
|
|
62
62
|
});
|
|
63
|
-
if (
|
|
64
|
-
d =
|
|
63
|
+
if (e.errors?.length) throw Error(e.errors[0]?.message || "GraphQL error");
|
|
64
|
+
d = e.data.updateWorkspace;
|
|
65
65
|
}
|
|
66
66
|
if (!Object.values(u).some((e) => e !== void 0)) {
|
|
67
67
|
if (!d) throw Error("No workspace changes were provided");
|
|
68
68
|
return d;
|
|
69
69
|
}
|
|
70
|
-
let p = await
|
|
70
|
+
let p = await t(s, {
|
|
71
71
|
gateway: "workspace",
|
|
72
|
-
query: f(
|
|
72
|
+
query: f(a),
|
|
73
73
|
variables: {
|
|
74
|
-
id:
|
|
74
|
+
id: n,
|
|
75
75
|
input: u
|
|
76
76
|
}
|
|
77
77
|
});
|
|
@@ -82,10 +82,10 @@ var h = () => {
|
|
|
82
82
|
};
|
|
83
83
|
},
|
|
84
84
|
onSuccess: (e) => {
|
|
85
|
-
|
|
85
|
+
s.setQueryData(["workspace", e.id], (t) => ({
|
|
86
86
|
...t,
|
|
87
87
|
...e
|
|
88
|
-
})), m(
|
|
88
|
+
})), m(s, e.id), p("workspace.updated", {
|
|
89
89
|
workspaceId: e.id,
|
|
90
90
|
source: "microfe-workspaces"
|
|
91
91
|
});
|
|
@@ -99,28 +99,28 @@ var h = () => {
|
|
|
99
99
|
}
|
|
100
100
|
});
|
|
101
101
|
}, _ = () => {
|
|
102
|
-
let { authToken:
|
|
102
|
+
let { authToken: a, currentUser: o } = n(), s = d(), { emit: c } = r();
|
|
103
103
|
return u({
|
|
104
|
-
mutationFn: async (
|
|
105
|
-
let
|
|
106
|
-
authToken:
|
|
107
|
-
currentUser:
|
|
108
|
-
}), {
|
|
104
|
+
mutationFn: async (n) => {
|
|
105
|
+
let r = e({
|
|
106
|
+
authToken: a,
|
|
107
|
+
currentUser: o
|
|
108
|
+
}), s = await t(r, {
|
|
109
109
|
gateway: "workspace",
|
|
110
|
-
query: f(
|
|
111
|
-
variables: { id:
|
|
110
|
+
query: f(i),
|
|
111
|
+
variables: { id: n }
|
|
112
112
|
});
|
|
113
|
-
if (
|
|
114
|
-
return
|
|
113
|
+
if (s.errors?.length) throw Error(s.errors[0]?.message || "GraphQL error");
|
|
114
|
+
return s.data.deleteWorkspace;
|
|
115
115
|
},
|
|
116
116
|
onSuccess: (e, t) => {
|
|
117
|
-
m(
|
|
117
|
+
m(s, t), c("workspace.deleted", {
|
|
118
118
|
workspaceId: t,
|
|
119
119
|
source: "microfe-workspaces"
|
|
120
120
|
});
|
|
121
121
|
},
|
|
122
122
|
onError: (e, t) => {
|
|
123
|
-
|
|
123
|
+
c("workspace.delete_failed", {
|
|
124
124
|
workspaceId: t,
|
|
125
125
|
source: "microfe-workspaces",
|
|
126
126
|
errorMessage: l(e)
|
|
@@ -128,28 +128,28 @@ var h = () => {
|
|
|
128
128
|
}
|
|
129
129
|
});
|
|
130
130
|
}, v = () => {
|
|
131
|
-
let { authToken:
|
|
131
|
+
let { authToken: i, currentUser: a } = n(), o = d(), { emit: c } = r();
|
|
132
132
|
return u({
|
|
133
|
-
mutationFn: async (
|
|
134
|
-
let r =
|
|
135
|
-
authToken:
|
|
136
|
-
currentUser:
|
|
137
|
-
}), {
|
|
133
|
+
mutationFn: async (n) => {
|
|
134
|
+
let r = e({
|
|
135
|
+
authToken: i,
|
|
136
|
+
currentUser: a
|
|
137
|
+
}), o = await t(r, {
|
|
138
138
|
gateway: "global",
|
|
139
|
-
query: f(
|
|
140
|
-
variables: { id:
|
|
139
|
+
query: f(s),
|
|
140
|
+
variables: { id: n }
|
|
141
141
|
});
|
|
142
|
-
if (
|
|
143
|
-
return
|
|
142
|
+
if (o.errors?.length) throw Error(o.errors[0]?.message || "GraphQL error");
|
|
143
|
+
return o.data.archiveWorkspace;
|
|
144
144
|
},
|
|
145
145
|
onSuccess: (e) => {
|
|
146
|
-
m(
|
|
146
|
+
m(o, e.id), c("workspace.archived", {
|
|
147
147
|
workspaceId: e.id,
|
|
148
148
|
source: "microfe-workspaces"
|
|
149
149
|
});
|
|
150
150
|
},
|
|
151
151
|
onError: (e, t) => {
|
|
152
|
-
|
|
152
|
+
c("workspace.archive_failed", {
|
|
153
153
|
workspaceId: t,
|
|
154
154
|
source: "microfe-workspaces",
|
|
155
155
|
errorMessage: l(e)
|
|
@@ -157,28 +157,28 @@ var h = () => {
|
|
|
157
157
|
}
|
|
158
158
|
});
|
|
159
159
|
}, y = () => {
|
|
160
|
-
let { authToken:
|
|
160
|
+
let { authToken: i, currentUser: a } = n(), s = d(), { emit: c } = r();
|
|
161
161
|
return u({
|
|
162
|
-
mutationFn: async (
|
|
163
|
-
let
|
|
164
|
-
authToken:
|
|
165
|
-
currentUser:
|
|
166
|
-
}), {
|
|
162
|
+
mutationFn: async (n) => {
|
|
163
|
+
let r = e({
|
|
164
|
+
authToken: i,
|
|
165
|
+
currentUser: a
|
|
166
|
+
}), s = await t(r, {
|
|
167
167
|
gateway: "global",
|
|
168
|
-
query: f(
|
|
169
|
-
variables: { id:
|
|
168
|
+
query: f(o),
|
|
169
|
+
variables: { id: n }
|
|
170
170
|
});
|
|
171
|
-
if (
|
|
172
|
-
return
|
|
171
|
+
if (s.errors?.length) throw Error(s.errors[0]?.message || "GraphQL error");
|
|
172
|
+
return s.data.activateWorkspace;
|
|
173
173
|
},
|
|
174
174
|
onSuccess: (e) => {
|
|
175
|
-
m(
|
|
175
|
+
m(s, e.id), c("workspace.reactivated", {
|
|
176
176
|
workspaceId: e.id,
|
|
177
177
|
source: "microfe-workspaces"
|
|
178
178
|
});
|
|
179
179
|
},
|
|
180
180
|
onError: (e, t) => {
|
|
181
|
-
|
|
181
|
+
c("workspace.reactivate_failed", {
|
|
182
182
|
workspaceId: t,
|
|
183
183
|
source: "microfe-workspaces",
|
|
184
184
|
errorMessage: l(e)
|
|
@@ -186,5 +186,4 @@ var h = () => {
|
|
|
186
186
|
}
|
|
187
187
|
});
|
|
188
188
|
};
|
|
189
|
-
//#endregion
|
|
190
189
|
export { v as useArchiveWorkspace, h as useCreateWorkspace, _ as useDeleteWorkspace, y as useReactivateWorkspace, g as useUpdateWorkspace };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { WORKSPACE_PERMISSIONS as e } from "../constants/permissions.js";
|
|
2
2
|
import { usePermissions as t } from "@burdenoff/fe-libs/shared/providers/shell";
|
|
3
|
-
|
|
3
|
+
// src/hooks/useWorkspacePermissions.ts
|
|
4
4
|
function n() {
|
|
5
5
|
let { hasPermission: n, isLoading: r } = t();
|
|
6
6
|
return {
|
|
@@ -31,5 +31,4 @@ function n() {
|
|
|
31
31
|
canViewActivity: n(e.ACTIVITY_READ)
|
|
32
32
|
};
|
|
33
33
|
}
|
|
34
|
-
//#endregion
|
|
35
34
|
export { n as useWorkspacePermissions };
|
|
@@ -8,5 +8,5 @@ interface GraphqlErrorLike {
|
|
|
8
8
|
message?: string | null;
|
|
9
9
|
}
|
|
10
10
|
export declare function isUnsupportedProductRoleFilterError(errors: readonly GraphqlErrorLike[]): boolean;
|
|
11
|
-
export declare const useWorkspaceRoles: (workspaceIdOverride?: string) => import('@tanstack/react-query').UseQueryResult<
|
|
11
|
+
export declare const useWorkspaceRoles: (workspaceIdOverride?: string) => import('@tanstack/react-query').UseQueryResult<WorkspaceRoleOption[], Error>;
|
|
12
12
|
export {};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { useWorkspacesContext as e } from "../providers/WorkspacesProvider.js";
|
|
2
2
|
import { useQuery as t } from "@tanstack/react-query";
|
|
3
3
|
import { graphqlFetch as n } from "@burdenoff/fe-libs/shared/graphql";
|
|
4
|
-
|
|
4
|
+
// src/hooks/useWorkspaceRoles.ts
|
|
5
5
|
var r = "\n query GetWorkspaceRoles($scopeId: String!, $filter: RoleFilterInput, $pagination: PaginationInput) {\n roles(scopeId: $scopeId, filter: $filter, pagination: $pagination) {\n id\n name\n description\n isSystem\n }\n }\n", i = "\n query GetWorkspaceRoles($scopeId: String!, $pagination: PaginationInput) {\n roles(scopeId: $scopeId, pagination: $pagination) {\n id\n name\n description\n isSystem\n }\n }\n";
|
|
6
6
|
function a(e) {
|
|
7
7
|
return e.some(({ message: e }) => e?.includes("RoleFilterInput") ? (e.includes("product") || e.includes("includePlatformRoles")) && (e.includes("not defined") || e.includes("Unknown field")) : !1);
|
|
@@ -44,8 +44,7 @@ var o = (o) => {
|
|
|
44
44
|
return e.data?.roles ?? [];
|
|
45
45
|
},
|
|
46
46
|
enabled: !!u,
|
|
47
|
-
staleTime:
|
|
47
|
+
staleTime: 3e5
|
|
48
48
|
});
|
|
49
49
|
};
|
|
50
|
-
|
|
51
|
-
export { o as useWorkspaceRoles };
|
|
50
|
+
export { a as isUnsupportedProductRoleFilterError, o as useWorkspaceRoles };
|
|
@@ -3,12 +3,12 @@ import { WorkspaceFilters, WorkspaceList, Workspace, PaginationInput } from '../
|
|
|
3
3
|
* Hook to fetch all workspaces with filtering and pagination
|
|
4
4
|
* Uses workspace token for authorization (x-workspace-id header)
|
|
5
5
|
*/
|
|
6
|
-
export declare const useWorkspaces: (filters?: WorkspaceFilters, pagination?: PaginationInput) => import('@tanstack/react-query').UseQueryResult<
|
|
6
|
+
export declare const useWorkspaces: (filters?: WorkspaceFilters, pagination?: PaginationInput) => import('@tanstack/react-query').UseQueryResult<WorkspaceList, Error>;
|
|
7
7
|
/**
|
|
8
8
|
* Hook to fetch a single workspace by ID
|
|
9
9
|
* Uses workspace token for authorization (x-workspace-id header)
|
|
10
10
|
*/
|
|
11
|
-
export declare const useWorkspace: (id: string) => import('@tanstack/react-query').UseQueryResult<
|
|
11
|
+
export declare const useWorkspace: (id: string) => import('@tanstack/react-query').UseQueryResult<Workspace, Error>;
|
|
12
12
|
/**
|
|
13
13
|
* Hook to fetch current user's workspaces
|
|
14
14
|
* NOTE: Uses global gateway because workspace listing is managed at the global/tenant layer
|
|
@@ -16,4 +16,4 @@ export declare const useWorkspace: (id: string) => import('@tanstack/react-query
|
|
|
16
16
|
export declare const useMyWorkspaces: (pagination?: {
|
|
17
17
|
limit?: number;
|
|
18
18
|
offset?: number;
|
|
19
|
-
}) => import('@tanstack/react-query').UseQueryResult<
|
|
19
|
+
}) => import('@tanstack/react-query').UseQueryResult<WorkspaceList, Error>;
|
|
@@ -4,7 +4,7 @@ import { GetGlobalMyWorkspacesDocument as r } from "../generated/global-operatio
|
|
|
4
4
|
import { useQuery as i } from "@tanstack/react-query";
|
|
5
5
|
import { print as a } from "graphql";
|
|
6
6
|
import { graphqlFetch as o } from "@burdenoff/fe-libs/shared/graphql";
|
|
7
|
-
|
|
7
|
+
// src/hooks/useWorkspaces.ts
|
|
8
8
|
var s = (t, r) => {
|
|
9
9
|
let { authToken: s, tenantId: c } = e();
|
|
10
10
|
return i({
|
|
@@ -28,7 +28,7 @@ var s = (t, r) => {
|
|
|
28
28
|
if (e.errors?.length) throw Error(e.errors[0]?.message || "GraphQL error");
|
|
29
29
|
return e.data.workspaces;
|
|
30
30
|
},
|
|
31
|
-
staleTime:
|
|
31
|
+
staleTime: 3e5,
|
|
32
32
|
retry: 1
|
|
33
33
|
});
|
|
34
34
|
}, c = (n) => {
|
|
@@ -47,7 +47,7 @@ var s = (t, r) => {
|
|
|
47
47
|
return e.data.workspace;
|
|
48
48
|
},
|
|
49
49
|
enabled: !!n,
|
|
50
|
-
staleTime:
|
|
50
|
+
staleTime: 3e5
|
|
51
51
|
});
|
|
52
52
|
}, l = (t) => {
|
|
53
53
|
let { authToken: n } = e();
|
|
@@ -66,8 +66,7 @@ var s = (t, r) => {
|
|
|
66
66
|
if (e.errors?.length) throw Error(e.errors[0]?.message || "GraphQL error");
|
|
67
67
|
return e.data.myWorkspaces;
|
|
68
68
|
},
|
|
69
|
-
staleTime:
|
|
69
|
+
staleTime: 3e5
|
|
70
70
|
});
|
|
71
71
|
};
|
|
72
|
-
//#endregion
|
|
73
72
|
export { l as useMyWorkspaces, c as useWorkspace, s as useWorkspaces };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { useCallback as e } from "react";
|
|
2
2
|
import { useEventBus as t } from "@burdenoff/fe-libs/shared/events";
|
|
3
|
-
|
|
3
|
+
// src/hooks/useWorkspacesEventEmitter.ts
|
|
4
4
|
function n() {
|
|
5
5
|
let n = t();
|
|
6
6
|
return { emit: e((e, t = {}) => {
|
|
@@ -9,5 +9,4 @@ function n() {
|
|
|
9
9
|
} catch {}
|
|
10
10
|
}, [n]) };
|
|
11
11
|
}
|
|
12
|
-
//#endregion
|
|
13
12
|
export { n as useWorkspacesEventEmitter };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { useWorkspacesEventEmitter as e } from "./useWorkspacesEventEmitter.js";
|
|
2
2
|
import { useEffect as t, useRef as n } from "react";
|
|
3
|
-
|
|
3
|
+
// src/hooks/useWorkspacesPageView.ts
|
|
4
4
|
var r = (e) => typeof e == "string" && e.length > 0;
|
|
5
5
|
function i(i, a) {
|
|
6
6
|
let { emit: o } = e(), s = a?.workspaceId, c = a?.projectId, l = a?.requireParams ?? !1, u = a ? "workspaceId" in a : !1, d = a ? "projectId" in a : !1, f = n(null);
|
|
@@ -25,5 +25,4 @@ function i(i, a) {
|
|
|
25
25
|
d
|
|
26
26
|
]);
|
|
27
27
|
}
|
|
28
|
-
//#endregion
|
|
29
28
|
export { i as useWorkspacesPageView };
|
package/dist/index.js
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { WorkspacesErrorBoundary as
|
|
3
|
-
import {
|
|
4
|
-
import { useMyWorkspaces as
|
|
5
|
-
import { useMyPendingInvitations as
|
|
6
|
-
import { getMemberRoleClasses as
|
|
7
|
-
import { WorkspaceCard as
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import { useInfiniteWorkspaceMembers as
|
|
11
|
-
import { useAcceptInvitation as
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
1
|
+
import { WorkspacesRoot as e } from "./WorkspacesRoot.js";
|
|
2
|
+
import { WorkspacesErrorBoundary as t } from "./components/WorkspacesErrorBoundary.js";
|
|
3
|
+
import { DashboardPage as n } from "./pages/dashboard/DashboardPage.js";
|
|
4
|
+
import { useMyWorkspaces as r, useWorkspace as i, useWorkspaces as a } from "./hooks/useWorkspaces.js";
|
|
5
|
+
import { useMyPendingInvitations as o } from "./hooks/usePendingInvitations.js";
|
|
6
|
+
import { getMemberRoleClasses as s, getMemberRoleLabel as c, getProjectStatusClasses as l, getProjectStatusIconClass as u, getProjectStatusLabel as d, getWorkspaceStatusBgClass as f, getWorkspaceStatusClasses as p, getWorkspaceStatusIconClass as m, getWorkspaceStatusLabel as h } from "./utils/tokenHelpers.js";
|
|
7
|
+
import { WorkspaceCard as g } from "./components/WorkspaceCard.js";
|
|
8
|
+
import { InviteAcceptancePage as _ } from "./pages/InviteAcceptancePage.js";
|
|
9
|
+
import { PendingInvitesPage as v } from "./pages/PendingInvitesPage.js";
|
|
10
|
+
import { useInfiniteWorkspaceMembers as y, useInvitation as b, useUserWorkspaces as x, useWorkspaceInvitations as S, useWorkspaceMember as C, useWorkspaceMembers as w } from "./hooks/useWorkspaceMembers.js";
|
|
11
|
+
import { useAcceptInvitation as T, useAddWorkspaceMember as E, useBulkCreateInvitations as D, useCancelInvitation as O, useCreateInvitation as k, useDeleteInvitation as A, useRejectInvitation as j, useRemoveUserFromWorkspace as M, useRemoveWorkspaceMember as N, useResendInvitation as P, useUpdateInvitation as F } from "./hooks/useMemberMutations.js";
|
|
12
|
+
import { WorkspaceInvitePage as I } from "./pages/WorkspaceInvitePage.js";
|
|
13
|
+
import { WorkspacesProvider as L, useWorkspacesContext as R } from "./providers/WorkspacesProvider.js";
|
|
14
14
|
import { useMyProjects as z, useProject as B, useProjectMembersCount as V, useProjects as H } from "./hooks/useProjects.js";
|
|
15
|
-
import {
|
|
15
|
+
import { useWorkspacesStore as U } from "./store/workspacesStore.js";
|
|
16
16
|
import { useArchiveWorkspace as W, useCreateWorkspace as G, useDeleteWorkspace as K, useReactivateWorkspace as q, useUpdateWorkspace as J } from "./hooks/useWorkspaceMutations.js";
|
|
17
17
|
import { useArchiveProject as Y, useCreateProject as X, useDeleteProject as Z, useTagProject as Q, useUnarchiveProject as $, useUntagProject as ee, useUpdateProject as te } from "./hooks/useProjectMutations.js";
|
|
18
18
|
import { useMyOrganizations as ne, useMyTenants as re } from "./hooks/useTenants.js";
|
|
@@ -25,4 +25,4 @@ import { MemberListItem as ge } from "./components/MemberListItem.js";
|
|
|
25
25
|
import { InviteMemberDialog as _e } from "./components/InviteMemberDialog.js";
|
|
26
26
|
import "./components/index.js";
|
|
27
27
|
import { enTranslations as ve } from "./translations/en.js";
|
|
28
|
-
export { he as CreateProjectDialog, ie as CreateWorkspaceDialog,
|
|
28
|
+
export { he as CreateProjectDialog, ie as CreateWorkspaceDialog, n as DashboardPage, _ as InviteAcceptancePage, _e as InviteMemberDialog, ge as MemberListItem, v as PendingInvitesPage, me as ProjectCard, g as WorkspaceCard, I as WorkspaceInvitePage, t as WorkspacesErrorBoundary, L as WorkspacesProvider, e as WorkspacesRoot, ve as enTranslations, ae as formatDate, oe as formatDateTime, se as formatFileSize, ce as formatProjectStatus, le as formatRelativeTime, ue as formatWorkspaceStatus, de as getInitials, s as getMemberRoleClasses, c as getMemberRoleLabel, l as getProjectStatusClasses, u as getProjectStatusIconClass, d as getProjectStatusLabel, f as getWorkspaceStatusBgClass, p as getWorkspaceStatusClasses, m as getWorkspaceStatusIconClass, h as getWorkspaceStatusLabel, fe as toTitleCase, pe as truncate, T as useAcceptInvitation, E as useAddWorkspaceMember, Y as useArchiveProject, W as useArchiveWorkspace, D as useBulkCreateInvitations, O as useCancelInvitation, k as useCreateInvitation, X as useCreateProject, G as useCreateWorkspace, A as useDeleteInvitation, Z as useDeleteProject, K as useDeleteWorkspace, y as useInfiniteWorkspaceMembers, b as useInvitation, ne as useMyOrganizations, o as useMyPendingInvitations, z as useMyProjects, re as useMyTenants, r as useMyWorkspaces, B as useProject, V as useProjectMembersCount, H as useProjects, q as useReactivateWorkspace, j as useRejectInvitation, M as useRemoveUserFromWorkspace, N as useRemoveWorkspaceMember, P as useResendInvitation, Q as useTagProject, $ as useUnarchiveProject, ee as useUntagProject, F as useUpdateInvitation, te as useUpdateProject, J as useUpdateWorkspace, x as useUserWorkspaces, i as useWorkspace, S as useWorkspaceInvitations, C as useWorkspaceMember, w as useWorkspaceMembers, a as useWorkspaces, R as useWorkspacesContext, U as useWorkspacesStore };
|
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
1
|
+
import { useWorkspaceActivity as e } from "../hooks/useWorkspaceActivity.js";
|
|
2
|
+
import { useWorkspacePermissions as t } from "../hooks/useWorkspacePermissions.js";
|
|
3
|
+
import { useWorkspacesPageView as n } from "../hooks/useWorkspacesPageView.js";
|
|
4
4
|
import { formatDate as r } from "../utils/formatters.js";
|
|
5
|
-
import {
|
|
5
|
+
import { tWithFallback as i } from "../utils/i18n.js";
|
|
6
6
|
import { jsx as a, jsxs as o } from "react/jsx-runtime";
|
|
7
7
|
import { CardContent as s, CardHeader as c, CardTitle as l, GlassCard as u, IllustratedEmptyState as d, PagePurpose as f, Skeleton as p } from "@burdenoff/fe-libs/ui";
|
|
8
8
|
import { useI18n as m } from "@burdenoff/fe-libs/shared/providers/shell/I18nProvider";
|
|
9
9
|
import { useParams as h } from "react-router";
|
|
10
|
-
|
|
10
|
+
// src/pages/ActivityListPage.tsx
|
|
11
11
|
function g() {
|
|
12
12
|
let { t: g } = m(), { workspaceId: _ } = h();
|
|
13
|
-
|
|
13
|
+
n("workspaces.activity", {
|
|
14
14
|
workspaceId: _,
|
|
15
15
|
requireParams: !0
|
|
16
16
|
});
|
|
17
|
-
let { data: v, isLoading: y, error: b } =
|
|
17
|
+
let { data: v, isLoading: y, error: b } = e(_), { canViewActivity: x, isLoading: S } = t();
|
|
18
18
|
return S ? /* @__PURE__ */ o("div", {
|
|
19
19
|
className: "space-y-4 p-6",
|
|
20
20
|
children: [/* @__PURE__ */ a(p, { className: "h-10 w-1/3" }), /* @__PURE__ */ a(p, { className: "h-64" })]
|
|
@@ -23,83 +23,83 @@ function g() {
|
|
|
23
23
|
children: [
|
|
24
24
|
/* @__PURE__ */ o("div", { children: [/* @__PURE__ */ a("h1", {
|
|
25
25
|
className: "text-2xl sm:text-3xl font-bold",
|
|
26
|
-
children:
|
|
26
|
+
children: i(g, "activityList.title", "Activity")
|
|
27
27
|
}), /* @__PURE__ */ a("p", {
|
|
28
28
|
className: "text-text-secondary",
|
|
29
|
-
children:
|
|
29
|
+
children: i(g, "activityList.description", "Track workspace activity")
|
|
30
30
|
})] }),
|
|
31
|
-
/* @__PURE__ */ a(f, { children:
|
|
31
|
+
/* @__PURE__ */ a(f, { children: i(g, "activityList.purpose", "This is the audit trail for the workspace — a running log of who did what and when. Use it to catch up after time away, confirm a change went through, or investigate when and by whom a project or member was modified.") }),
|
|
32
32
|
y ? /* @__PURE__ */ a(u, {
|
|
33
33
|
treatment: "plain",
|
|
34
34
|
className: "border-border-seam",
|
|
35
35
|
children: /* @__PURE__ */ a(s, {
|
|
36
36
|
className: "py-8 text-sm text-text-muted",
|
|
37
|
-
children:
|
|
37
|
+
children: i(g, "activityList.loading", "Loading activity…")
|
|
38
38
|
})
|
|
39
39
|
}) : b ? /* @__PURE__ */ a(u, {
|
|
40
40
|
treatment: "plain",
|
|
41
41
|
className: "border-border-seam",
|
|
42
42
|
children: /* @__PURE__ */ a(s, {
|
|
43
43
|
className: "py-8 text-sm text-status-error-text",
|
|
44
|
-
children: b instanceof Error ? b.message :
|
|
44
|
+
children: b instanceof Error ? b.message : i(g, "activityList.loadError", "Failed to load activity")
|
|
45
45
|
})
|
|
46
46
|
}) : (v?.length ?? 0) === 0 ? /* @__PURE__ */ a(d, {
|
|
47
47
|
illustration: "empty-data",
|
|
48
|
-
title:
|
|
49
|
-
description:
|
|
48
|
+
title: i(g, "activityList.emptyTitle", "No recent activity"),
|
|
49
|
+
description: i(g, "activityList.emptyDescription", "Recent workspace actions will appear here as your team creates, updates, and manages work.")
|
|
50
50
|
}) : /* @__PURE__ */ a("div", {
|
|
51
51
|
className: "space-y-3",
|
|
52
|
-
children: v?.map((
|
|
52
|
+
children: v?.map((e) => /* @__PURE__ */ o(u, {
|
|
53
53
|
treatment: "insight",
|
|
54
54
|
className: "border-border-seam",
|
|
55
55
|
children: [/* @__PURE__ */ a(c, {
|
|
56
56
|
className: "pb-2",
|
|
57
57
|
children: /* @__PURE__ */ a(l, {
|
|
58
58
|
className: "text-base",
|
|
59
|
-
children:
|
|
59
|
+
children: e.description || e.action
|
|
60
60
|
})
|
|
61
61
|
}), /* @__PURE__ */ o(s, {
|
|
62
62
|
className: "space-y-1 text-sm text-text-muted",
|
|
63
63
|
children: [
|
|
64
64
|
/* @__PURE__ */ o("p", { children: [
|
|
65
|
-
|
|
65
|
+
i(g, "activityList.labelAction", "Action"),
|
|
66
66
|
":",
|
|
67
67
|
" ",
|
|
68
68
|
/* @__PURE__ */ a("span", {
|
|
69
69
|
className: "text-text-primary",
|
|
70
|
-
children:
|
|
70
|
+
children: e.action
|
|
71
71
|
})
|
|
72
72
|
] }),
|
|
73
|
-
|
|
74
|
-
|
|
73
|
+
e.resourceType && /* @__PURE__ */ o("p", { children: [
|
|
74
|
+
i(g, "activityList.labelResource", "Resource"),
|
|
75
75
|
":",
|
|
76
76
|
" ",
|
|
77
77
|
/* @__PURE__ */ a("span", {
|
|
78
78
|
className: "text-text-primary",
|
|
79
|
-
children:
|
|
79
|
+
children: e.resourceType
|
|
80
80
|
})
|
|
81
81
|
] }),
|
|
82
82
|
/* @__PURE__ */ o("p", { children: [
|
|
83
|
-
|
|
83
|
+
i(g, "activityList.labelWhen", "When"),
|
|
84
84
|
":",
|
|
85
85
|
" ",
|
|
86
86
|
/* @__PURE__ */ a("span", {
|
|
87
87
|
className: "text-text-primary",
|
|
88
|
-
children: r(
|
|
88
|
+
children: r(e.timestamp)
|
|
89
89
|
})
|
|
90
90
|
] }),
|
|
91
91
|
/* @__PURE__ */ o("p", { children: [
|
|
92
|
-
|
|
92
|
+
i(g, "activityList.labelActor", "Actor"),
|
|
93
93
|
":",
|
|
94
94
|
" ",
|
|
95
95
|
/* @__PURE__ */ a("span", {
|
|
96
96
|
className: "break-all text-text-primary",
|
|
97
|
-
children:
|
|
97
|
+
children: e.userId
|
|
98
98
|
})
|
|
99
99
|
] })
|
|
100
100
|
]
|
|
101
101
|
})]
|
|
102
|
-
},
|
|
102
|
+
}, e.id))
|
|
103
103
|
})
|
|
104
104
|
]
|
|
105
105
|
}) : /* @__PURE__ */ a("div", {
|
|
@@ -108,13 +108,12 @@ function g() {
|
|
|
108
108
|
className: "text-center space-y-2",
|
|
109
109
|
children: [/* @__PURE__ */ a("h2", {
|
|
110
110
|
className: "text-lg font-semibold",
|
|
111
|
-
children:
|
|
111
|
+
children: i(g, "activityList.accessDenied", "Access Denied")
|
|
112
112
|
}), /* @__PURE__ */ a("p", {
|
|
113
113
|
className: "text-sm text-text-secondary",
|
|
114
|
-
children:
|
|
114
|
+
children: i(g, "activityList.accessDeniedDescription", "You don't have permission to view activity.")
|
|
115
115
|
})]
|
|
116
116
|
})
|
|
117
117
|
});
|
|
118
118
|
}
|
|
119
|
-
//#endregion
|
|
120
119
|
export { g as ActivityListPage };
|