@burdenoff/microfe-devportal 2026.720.2 → 2026.720.3
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/devportal/pages/ApplicationDetailPage.d.ts.map +1 -1
- package/dist/devportal/pages/ApplicationDetailPage.js +32 -3
- package/dist/devportal/pages/ApplicationDetailPage.js.map +1 -1
- package/dist/devportal/pages/ApplicationsPage.d.ts.map +1 -1
- package/dist/devportal/pages/ApplicationsPage.js +281 -214
- package/dist/devportal/pages/ApplicationsPage.js.map +1 -1
- package/dist/devportal/types/index.d.ts +1 -1
- package/dist/devportal/types/index.d.ts.map +1 -1
- package/dist/devportal/types/index.js.map +1 -1
- package/dist/generated/global-types.d.ts +2 -1
- package/dist/generated/global-types.d.ts.map +1 -1
- package/package.json +1 -1
|
@@ -1,27 +1,46 @@
|
|
|
1
1
|
import { useDevportal as e } from "../providers/DevportalProvider.js";
|
|
2
2
|
import { EmptyState as t } from "../components/EmptyState.js";
|
|
3
|
-
import { useDeactivateAppMutation as n,
|
|
4
|
-
import { getErrorMessage as
|
|
5
|
-
import { PageLayout as
|
|
6
|
-
import { APP_STATUS_COLORS as
|
|
7
|
-
import { SelectionCheckbox as
|
|
8
|
-
import { AppCard as
|
|
9
|
-
import { ConfirmDialog as
|
|
10
|
-
import { PermissionGuard as
|
|
3
|
+
import { useDeactivateAppMutation as n, useGetApplicationsQuery as r } from "../../generated/global-operations.js";
|
|
4
|
+
import { getErrorMessage as i } from "../hooks/useGraphQL.js";
|
|
5
|
+
import { PageLayout as a } from "../components/PageLayout.js";
|
|
6
|
+
import { APP_STATUS_COLORS as o, APP_TYPE_LABELS as s } from "../utils/constants.js";
|
|
7
|
+
import { SelectionCheckbox as c } from "../components/SelectionCheckbox.js";
|
|
8
|
+
import { AppCard as l } from "../components/AppCard.js";
|
|
9
|
+
import { ConfirmDialog as ee } from "../components/ConfirmDialog.js";
|
|
10
|
+
import { PermissionGuard as te } from "../components/PermissionGuard.js";
|
|
11
11
|
import "../components/index.js";
|
|
12
|
-
import { useDevportalPermission as
|
|
12
|
+
import { useDevportalPermission as u } from "../hooks/usePermission.js";
|
|
13
13
|
import "../hooks/index.js";
|
|
14
|
-
import { DEVPORTAL_PERMISSIONS as
|
|
15
|
-
import { useMemo as
|
|
16
|
-
import { useI18n as
|
|
17
|
-
import { AlertCircle as
|
|
18
|
-
import { jsx as
|
|
19
|
-
import { EmphasisPanel as
|
|
14
|
+
import { DEVPORTAL_PERMISSIONS as d } from "../constants/permissions.js";
|
|
15
|
+
import { useMemo as f, useState as p } from "react";
|
|
16
|
+
import { useI18n as ne } from "@burdenoff/fe-libs/shared/providers/shell/I18nProvider";
|
|
17
|
+
import { AlertCircle as re, AppWindow as m, Archive as ie, Grid as ae, List as h, Loader2 as g, Plus as _, Search as oe } from "lucide-react";
|
|
18
|
+
import { jsx as v, jsxs as y } from "react/jsx-runtime";
|
|
19
|
+
import { EmphasisPanel as se, GlassCard as b } from "@burdenoff/fe-libs/ui";
|
|
20
20
|
//#region src/devportal/pages/ApplicationsPage.tsx
|
|
21
|
-
function
|
|
21
|
+
function ce(e, t, n) {
|
|
22
22
|
return `${e} ${t} application${t === 1 ? "" : "s"}${n > 0 ? ` • ${n} failed` : ""}`;
|
|
23
23
|
}
|
|
24
|
-
function
|
|
24
|
+
function le({ status: e }) {
|
|
25
|
+
return /* @__PURE__ */ v("span", {
|
|
26
|
+
className: `inline-flex items-center rounded-full px-2 py-0.5 text-xs font-medium ${{
|
|
27
|
+
ACTIVE: "bg-status-success-bg-subtle text-status-success-text",
|
|
28
|
+
PUBLISHED: "bg-status-success-bg-subtle text-status-success-text",
|
|
29
|
+
DRAFT: "bg-bg-sunken text-text-secondary",
|
|
30
|
+
SUBMITTED: "bg-status-warning-bg-subtle text-status-warning-text",
|
|
31
|
+
IN_REVIEW: "bg-status-warning-bg-subtle text-status-warning-text",
|
|
32
|
+
APPROVED: "bg-status-success-bg-subtle text-status-success-text",
|
|
33
|
+
UNLISTED: "bg-status-warning-bg-subtle text-status-warning-text",
|
|
34
|
+
REJECTED: "bg-status-error-bg-subtle text-status-error-text",
|
|
35
|
+
SUSPENDED: "bg-status-error-bg-subtle text-status-error-text",
|
|
36
|
+
INACTIVE: "bg-bg-sunken text-text-muted",
|
|
37
|
+
REVOKED: "bg-status-error-bg-subtle text-status-error-text",
|
|
38
|
+
DEPRECATED: "bg-bg-sunken text-text-muted"
|
|
39
|
+
}[e] ?? "bg-bg-sunken text-text-secondary"}`,
|
|
40
|
+
children: e === "INACTIVE" || e === "REVOKED" ? "Deactivated" : e.replace(/_/g, " ")
|
|
41
|
+
});
|
|
42
|
+
}
|
|
43
|
+
function ue(e) {
|
|
25
44
|
let t = Array.isArray(e.screenshots) ? e.screenshots.length > 0 ? e.screenshots : void 0 : e.screenshots, n = e.pricingDetails && typeof e.pricingDetails == "object" ? e.pricingDetails : void 0;
|
|
26
45
|
return {
|
|
27
46
|
id: e.id,
|
|
@@ -68,345 +87,393 @@ function fe(e) {
|
|
|
68
87
|
};
|
|
69
88
|
}
|
|
70
89
|
var x = () => {
|
|
71
|
-
let { navigate: x, basePath: S, activeOrgId: C } = e(), { t:
|
|
72
|
-
let n =
|
|
90
|
+
let { navigate: x, basePath: S, activeOrgId: C } = e(), { t: w } = ne(), T = (e, t) => {
|
|
91
|
+
let n = w(e);
|
|
73
92
|
return n === e ? t : n;
|
|
74
|
-
},
|
|
93
|
+
}, E = u(d.APP_CREATE), D = u(d.APP_UPDATE), [O, k] = p("list"), [A, de] = p(""), [j, M] = p(""), [N, fe] = p(""), [P, F] = p(/* @__PURE__ */ new Set()), [I, L] = p(null), [R, z] = p(null), { data: B, loading: pe, error: V, refetch: H } = r({
|
|
75
94
|
variables: {
|
|
76
95
|
limit: 50,
|
|
77
96
|
offset: 0,
|
|
78
|
-
status:
|
|
97
|
+
status: j || void 0,
|
|
79
98
|
organizationId: C ?? void 0
|
|
80
99
|
},
|
|
81
100
|
fetchPolicy: "cache-and-network"
|
|
82
|
-
}),
|
|
101
|
+
}), U = f(() => B?.applications?.edges?.map((e) => ue(e.node)) ?? [], [B?.applications?.edges]), [me] = n(), W = (e) => {
|
|
83
102
|
x?.(`${S}${e}`);
|
|
84
|
-
},
|
|
85
|
-
let t = !C || e.developerOrganizationId === C, n = !A || e.name.toLowerCase().includes(A.toLowerCase()) || e.shortDescription?.toLowerCase().includes(A.toLowerCase()), r = !
|
|
103
|
+
}, G = U.filter((e) => {
|
|
104
|
+
let t = !C || e.developerOrganizationId === C, n = !A || e.name.toLowerCase().includes(A.toLowerCase()) || e.shortDescription?.toLowerCase().includes(A.toLowerCase()), r = !N || e.appType === N;
|
|
86
105
|
return t && n && r;
|
|
87
|
-
}),
|
|
88
|
-
total:
|
|
89
|
-
active:
|
|
90
|
-
draft:
|
|
91
|
-
published:
|
|
92
|
-
}), [
|
|
93
|
-
|
|
106
|
+
}), K = f(() => ({
|
|
107
|
+
total: B?.applications?.totalCount ?? G.length,
|
|
108
|
+
active: G.filter((e) => e.status === "ACTIVE").length,
|
|
109
|
+
draft: G.filter((e) => e.status === "DRAFT").length,
|
|
110
|
+
published: G.filter((e) => e.status === "PUBLISHED").length
|
|
111
|
+
}), [G, B?.applications?.totalCount]), q = f(() => U.filter((e) => P.has(e.id)), [U, P]), J = f(() => q.filter((e) => e.status !== "INACTIVE" && e.status !== "REVOKED"), [q]), Y = G.length > 0 && G.every((e) => P.has(e.id)), X = G.some((e) => P.has(e.id)) && !Y, Z = (e, t) => {
|
|
112
|
+
F((n) => {
|
|
94
113
|
let r = new Set(n);
|
|
95
114
|
return t ? r.add(e) : r.delete(e), r;
|
|
96
115
|
});
|
|
97
|
-
},
|
|
98
|
-
|
|
116
|
+
}, Q = (e) => {
|
|
117
|
+
F((t) => {
|
|
99
118
|
let n = new Set(t);
|
|
100
|
-
return
|
|
119
|
+
return G.forEach((t) => {
|
|
101
120
|
e ? n.add(t.id) : n.delete(t.id);
|
|
102
121
|
}), n;
|
|
103
122
|
});
|
|
104
|
-
}, $ = () =>
|
|
105
|
-
return
|
|
106
|
-
title:
|
|
107
|
-
description:
|
|
108
|
-
children: /* @__PURE__ */
|
|
123
|
+
}, $ = () => F(/* @__PURE__ */ new Set());
|
|
124
|
+
return pe && !B ? /* @__PURE__ */ v(a, {
|
|
125
|
+
title: T("devportal.myApplications", "My Applications"),
|
|
126
|
+
description: T("devportal.manageYourApps", "Manage your developer applications"),
|
|
127
|
+
children: /* @__PURE__ */ y("div", {
|
|
109
128
|
className: "flex items-center justify-center py-12",
|
|
110
|
-
children: [/* @__PURE__ */
|
|
129
|
+
children: [/* @__PURE__ */ v(g, { className: "h-8 w-8 animate-spin text-text-secondary" }), /* @__PURE__ */ v("span", {
|
|
111
130
|
className: "ml-2 text-text-secondary",
|
|
112
|
-
children:
|
|
131
|
+
children: T("devportal.loadingApplications", "Loading applications...")
|
|
113
132
|
})]
|
|
114
133
|
})
|
|
115
|
-
}) :
|
|
116
|
-
title:
|
|
117
|
-
description:
|
|
118
|
-
children: /* @__PURE__ */
|
|
134
|
+
}) : V ? /* @__PURE__ */ v(a, {
|
|
135
|
+
title: T("devportal.myApplications", "My Applications"),
|
|
136
|
+
description: T("devportal.manageYourApps", "Manage your developer applications"),
|
|
137
|
+
children: /* @__PURE__ */ y("div", {
|
|
119
138
|
className: "rounded-lg border border-status-error-border/50 bg-status-error-bg/10 p-6 text-center",
|
|
120
139
|
children: [
|
|
121
|
-
/* @__PURE__ */
|
|
122
|
-
/* @__PURE__ */
|
|
140
|
+
/* @__PURE__ */ v(re, { className: "mx-auto h-8 w-8 text-status-error-text" }),
|
|
141
|
+
/* @__PURE__ */ v("h3", {
|
|
123
142
|
className: "mt-2 font-medium text-status-error-text",
|
|
124
|
-
children:
|
|
143
|
+
children: T("devportal.failedToLoadApplications", "Failed to load applications")
|
|
125
144
|
}),
|
|
126
|
-
/* @__PURE__ */
|
|
145
|
+
/* @__PURE__ */ v("p", {
|
|
127
146
|
className: "mt-1 text-sm text-text-secondary",
|
|
128
|
-
children:
|
|
147
|
+
children: i(V)
|
|
129
148
|
}),
|
|
130
|
-
/* @__PURE__ */
|
|
131
|
-
onClick: () =>
|
|
149
|
+
/* @__PURE__ */ v("button", {
|
|
150
|
+
onClick: () => H(),
|
|
132
151
|
className: "mt-4 rounded-md bg-action-primary-bg px-4 py-2 text-sm font-medium text-action-primary-text hover:bg-action-primary-bg/90",
|
|
133
|
-
children:
|
|
152
|
+
children: T("devportal.tryAgain", "Try Again")
|
|
134
153
|
})
|
|
135
154
|
]
|
|
136
155
|
})
|
|
137
|
-
}) : /* @__PURE__ */
|
|
156
|
+
}) : /* @__PURE__ */ v(te, {
|
|
138
157
|
authOnly: !0,
|
|
139
|
-
children: /* @__PURE__ */
|
|
140
|
-
title:
|
|
141
|
-
description:
|
|
142
|
-
purpose:
|
|
143
|
-
actions: /* @__PURE__ */
|
|
144
|
-
onClick: () =>
|
|
145
|
-
disabled: !
|
|
146
|
-
"aria-disabled": !
|
|
147
|
-
title:
|
|
158
|
+
children: /* @__PURE__ */ y(a, {
|
|
159
|
+
title: T("devportal.myApplications", "My Applications"),
|
|
160
|
+
description: T("devportal.manageYourApps", "Manage your developer applications"),
|
|
161
|
+
purpose: T("devportal.applicationsPurpose", "Applications are the integrations you build on the platform — OAuth apps, store listings, and API consumers. Create one here to get client credentials, request scopes, and ship to the marketplace."),
|
|
162
|
+
actions: /* @__PURE__ */ y("button", {
|
|
163
|
+
onClick: () => W("/apps/new"),
|
|
164
|
+
disabled: !E.allowed,
|
|
165
|
+
"aria-disabled": !E.allowed,
|
|
166
|
+
title: E.allowed ? void 0 : T("devportal.common.noPermission", "You do not have permission to perform this action"),
|
|
148
167
|
className: "inline-flex items-center gap-2 rounded-md bg-action-primary-bg px-4 py-2 text-sm font-medium text-action-primary-text hover:bg-action-primary-bg/90 transition-colors disabled:opacity-50 disabled:cursor-not-allowed focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-primary",
|
|
149
|
-
children: [/* @__PURE__ */ _
|
|
168
|
+
children: [/* @__PURE__ */ v(_, {
|
|
150
169
|
size: 16,
|
|
151
170
|
"aria-hidden": "true"
|
|
152
|
-
}),
|
|
171
|
+
}), T("devportal.createApp", "Create App")]
|
|
153
172
|
}),
|
|
154
173
|
children: [
|
|
155
|
-
/* @__PURE__ */
|
|
174
|
+
/* @__PURE__ */ y("div", {
|
|
156
175
|
className: "flex flex-col gap-4 sm:flex-row sm:items-center sm:justify-between",
|
|
157
|
-
children: [/* @__PURE__ */
|
|
176
|
+
children: [/* @__PURE__ */ y("div", {
|
|
158
177
|
className: "flex flex-1 items-center gap-4",
|
|
159
178
|
children: [
|
|
160
|
-
/* @__PURE__ */
|
|
179
|
+
/* @__PURE__ */ y("div", {
|
|
161
180
|
className: "relative flex-1 max-w-md",
|
|
162
|
-
children: [/* @__PURE__ */
|
|
181
|
+
children: [/* @__PURE__ */ v(oe, {
|
|
163
182
|
size: 16,
|
|
164
183
|
className: "absolute left-3 top-1/2 -translate-y-1/2 text-text-secondary"
|
|
165
|
-
}), /* @__PURE__ */
|
|
184
|
+
}), /* @__PURE__ */ v("input", {
|
|
166
185
|
type: "text",
|
|
167
|
-
placeholder:
|
|
186
|
+
placeholder: T("devportal.searchApplications", "Search applications..."),
|
|
168
187
|
value: A,
|
|
169
|
-
onChange: (e) =>
|
|
188
|
+
onChange: (e) => de(e.target.value),
|
|
170
189
|
className: "w-full rounded-md border bg-bg-surface pl-9 pr-4 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-primary"
|
|
171
190
|
})]
|
|
172
191
|
}),
|
|
173
|
-
/* @__PURE__ */
|
|
174
|
-
value:
|
|
175
|
-
onChange: (e) =>
|
|
192
|
+
/* @__PURE__ */ y("select", {
|
|
193
|
+
value: j,
|
|
194
|
+
onChange: (e) => M(e.target.value),
|
|
176
195
|
className: "rounded-md border bg-bg-surface px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-primary",
|
|
177
|
-
children: [/* @__PURE__ */
|
|
196
|
+
children: [/* @__PURE__ */ v("option", {
|
|
178
197
|
value: "",
|
|
179
|
-
children:
|
|
180
|
-
}), Object.keys(
|
|
198
|
+
children: T("devportal.allStatus", "All Status")
|
|
199
|
+
}), Object.keys(o).map((e) => /* @__PURE__ */ v("option", {
|
|
181
200
|
value: e,
|
|
182
201
|
children: e.replace(/_/g, " ")
|
|
183
202
|
}, e))]
|
|
184
203
|
}),
|
|
185
|
-
/* @__PURE__ */
|
|
186
|
-
value:
|
|
187
|
-
onChange: (e) =>
|
|
204
|
+
/* @__PURE__ */ y("select", {
|
|
205
|
+
value: N,
|
|
206
|
+
onChange: (e) => fe(e.target.value),
|
|
188
207
|
className: "rounded-md border bg-bg-surface px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-primary",
|
|
189
|
-
children: [/* @__PURE__ */
|
|
208
|
+
children: [/* @__PURE__ */ v("option", {
|
|
190
209
|
value: "",
|
|
191
|
-
children:
|
|
192
|
-
}), Object.entries(
|
|
210
|
+
children: T("devportal.allTypes", "All Types")
|
|
211
|
+
}), Object.entries(s).map(([e, t]) => /* @__PURE__ */ v("option", {
|
|
193
212
|
value: e,
|
|
194
213
|
children: t
|
|
195
214
|
}, e))]
|
|
196
215
|
})
|
|
197
216
|
]
|
|
198
|
-
}), /* @__PURE__ */
|
|
217
|
+
}), /* @__PURE__ */ y("div", {
|
|
199
218
|
className: "flex items-center gap-1 rounded-md border p-1",
|
|
200
|
-
children: [/* @__PURE__ */
|
|
219
|
+
children: [/* @__PURE__ */ v("button", {
|
|
201
220
|
onClick: () => k("grid"),
|
|
202
221
|
className: `rounded p-1.5 ${O === "grid" ? "bg-bg-sunken" : "hover:bg-bg-sunken/50"}`,
|
|
203
222
|
title: "Grid view",
|
|
204
|
-
children: /* @__PURE__ */
|
|
205
|
-
}), /* @__PURE__ */
|
|
223
|
+
children: /* @__PURE__ */ v(ae, { size: 16 })
|
|
224
|
+
}), /* @__PURE__ */ v("button", {
|
|
206
225
|
onClick: () => k("list"),
|
|
207
226
|
className: `rounded p-1.5 ${O === "list" ? "bg-bg-sunken" : "hover:bg-bg-sunken/50"}`,
|
|
208
|
-
title: "
|
|
209
|
-
children: /* @__PURE__ */
|
|
227
|
+
title: "Table view",
|
|
228
|
+
children: /* @__PURE__ */ v(h, { size: 16 })
|
|
210
229
|
})]
|
|
211
230
|
})]
|
|
212
231
|
}),
|
|
213
|
-
/* @__PURE__ */
|
|
232
|
+
/* @__PURE__ */ v(se, {
|
|
214
233
|
className: "mt-4",
|
|
215
|
-
children: /* @__PURE__ */
|
|
234
|
+
children: /* @__PURE__ */ y("div", {
|
|
216
235
|
className: "grid grid-cols-2 gap-4 sm:grid-cols-4",
|
|
217
236
|
children: [
|
|
218
|
-
/* @__PURE__ */
|
|
237
|
+
/* @__PURE__ */ y(b, {
|
|
219
238
|
treatment: "metric",
|
|
220
239
|
className: "p-4",
|
|
221
|
-
children: [/* @__PURE__ */
|
|
240
|
+
children: [/* @__PURE__ */ v("p", {
|
|
222
241
|
className: "text-sm text-text-secondary",
|
|
223
|
-
children:
|
|
224
|
-
}), /* @__PURE__ */
|
|
242
|
+
children: T("devportal.totalApps", "Total Apps")
|
|
243
|
+
}), /* @__PURE__ */ v("p", {
|
|
225
244
|
className: "mt-1 text-2xl font-semibold tabular-nums",
|
|
226
|
-
children:
|
|
245
|
+
children: K.total
|
|
227
246
|
})]
|
|
228
247
|
}),
|
|
229
|
-
/* @__PURE__ */
|
|
248
|
+
/* @__PURE__ */ y(b, {
|
|
230
249
|
treatment: "metric",
|
|
231
250
|
className: "p-4",
|
|
232
|
-
children: [/* @__PURE__ */
|
|
251
|
+
children: [/* @__PURE__ */ v("p", {
|
|
233
252
|
className: "text-sm text-status-success-text",
|
|
234
|
-
children:
|
|
235
|
-
}), /* @__PURE__ */
|
|
253
|
+
children: T("devportal.active", "Active")
|
|
254
|
+
}), /* @__PURE__ */ v("p", {
|
|
236
255
|
className: "mt-1 text-2xl font-semibold tabular-nums",
|
|
237
|
-
children:
|
|
256
|
+
children: K.active
|
|
238
257
|
})]
|
|
239
258
|
}),
|
|
240
|
-
/* @__PURE__ */
|
|
259
|
+
/* @__PURE__ */ y(b, {
|
|
241
260
|
treatment: "metric",
|
|
242
261
|
className: "p-4",
|
|
243
|
-
children: [/* @__PURE__ */
|
|
262
|
+
children: [/* @__PURE__ */ v("p", {
|
|
244
263
|
className: "text-sm text-text-secondary",
|
|
245
|
-
children:
|
|
246
|
-
}), /* @__PURE__ */
|
|
264
|
+
children: T("devportal.published", "Published")
|
|
265
|
+
}), /* @__PURE__ */ v("p", {
|
|
247
266
|
className: "mt-1 text-2xl font-semibold tabular-nums",
|
|
248
|
-
children:
|
|
267
|
+
children: K.published
|
|
249
268
|
})]
|
|
250
269
|
}),
|
|
251
|
-
/* @__PURE__ */
|
|
270
|
+
/* @__PURE__ */ y(b, {
|
|
252
271
|
treatment: "metric",
|
|
253
272
|
className: "p-4",
|
|
254
|
-
children: [/* @__PURE__ */
|
|
273
|
+
children: [/* @__PURE__ */ v("p", {
|
|
255
274
|
className: "text-sm text-text-secondary",
|
|
256
|
-
children:
|
|
257
|
-
}), /* @__PURE__ */
|
|
275
|
+
children: T("devportal.draft", "Draft")
|
|
276
|
+
}), /* @__PURE__ */ v("p", {
|
|
258
277
|
className: "mt-1 text-2xl font-semibold tabular-nums",
|
|
259
|
-
children:
|
|
278
|
+
children: K.draft
|
|
260
279
|
})]
|
|
261
280
|
})
|
|
262
281
|
]
|
|
263
282
|
})
|
|
264
283
|
}),
|
|
265
|
-
|
|
266
|
-
className: `rounded-lg border px-4 py-3 text-sm ${
|
|
267
|
-
children: /* @__PURE__ */
|
|
284
|
+
R && /* @__PURE__ */ v("div", {
|
|
285
|
+
className: `rounded-lg border px-4 py-3 text-sm ${R.type === "success" ? "border-border-subtle bg-status-success-bg-subtle text-status-success-text" : "border-status-error-border/40 bg-status-error-bg/10 text-status-error-text"}`,
|
|
286
|
+
children: /* @__PURE__ */ y("div", {
|
|
268
287
|
className: "flex items-center justify-between gap-3",
|
|
269
|
-
children: [/* @__PURE__ */
|
|
270
|
-
onClick: () =>
|
|
288
|
+
children: [/* @__PURE__ */ v("span", { children: R.message }), /* @__PURE__ */ v("button", {
|
|
289
|
+
onClick: () => z(null),
|
|
271
290
|
className: "text-xs font-medium underline underline-offset-2",
|
|
272
291
|
children: "Dismiss"
|
|
273
292
|
})]
|
|
274
293
|
})
|
|
275
294
|
}),
|
|
276
|
-
|
|
295
|
+
G.length > 0 && /* @__PURE__ */ v("div", {
|
|
277
296
|
className: "rounded-card border border-border-seam bg-bg-surface p-4 shadow-[var(--shadow-pop)]",
|
|
278
|
-
children: /* @__PURE__ */
|
|
297
|
+
children: /* @__PURE__ */ y("div", {
|
|
279
298
|
className: "flex flex-col gap-3 lg:flex-row lg:items-center lg:justify-between",
|
|
280
|
-
children: [/* @__PURE__ */
|
|
299
|
+
children: [/* @__PURE__ */ y("div", {
|
|
281
300
|
className: "flex flex-wrap items-center gap-3",
|
|
282
|
-
children: [/* @__PURE__ */
|
|
301
|
+
children: [/* @__PURE__ */ y("div", {
|
|
283
302
|
className: "flex items-center gap-2",
|
|
284
|
-
children: [/* @__PURE__ */
|
|
285
|
-
checked:
|
|
286
|
-
indeterminate:
|
|
287
|
-
onChange:
|
|
303
|
+
children: [/* @__PURE__ */ v(c, {
|
|
304
|
+
checked: Y,
|
|
305
|
+
indeterminate: X,
|
|
306
|
+
onChange: Q,
|
|
288
307
|
ariaLabel: "Select all visible applications"
|
|
289
|
-
}), /* @__PURE__ */
|
|
308
|
+
}), /* @__PURE__ */ v("span", {
|
|
290
309
|
className: "text-sm font-medium",
|
|
291
310
|
children: "Select all visible"
|
|
292
311
|
})]
|
|
293
|
-
}),
|
|
312
|
+
}), P.size > 0 && /* @__PURE__ */ v("button", {
|
|
294
313
|
onClick: $,
|
|
295
314
|
className: "text-sm text-text-secondary hover:text-text-primary",
|
|
296
315
|
children: "Clear selection"
|
|
297
316
|
})]
|
|
298
|
-
}), /* @__PURE__ */
|
|
317
|
+
}), /* @__PURE__ */ y("div", {
|
|
299
318
|
className: "flex flex-wrap items-center gap-2",
|
|
300
|
-
children: [
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
]
|
|
319
|
-
}),
|
|
320
|
-
/* @__PURE__ */ v("button", {
|
|
321
|
-
onClick: () => z("delete"),
|
|
322
|
-
disabled: Y.length === 0 || !E.allowed,
|
|
323
|
-
"aria-disabled": Y.length === 0 || !E.allowed,
|
|
324
|
-
title: E.allowed ? void 0 : w("devportal.common.noPermission", "You do not have permission to perform this action"),
|
|
325
|
-
className: "inline-flex items-center gap-2 rounded-md border border-status-error-bg px-3 py-2 text-sm font-medium text-status-error-text transition-colors hover:bg-status-error-bg-subtle disabled:cursor-not-allowed disabled:opacity-50 focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-primary",
|
|
326
|
-
children: [
|
|
327
|
-
/* @__PURE__ */ _(ue, {
|
|
328
|
-
size: 16,
|
|
329
|
-
"aria-hidden": "true"
|
|
330
|
-
}),
|
|
331
|
-
w("devportal.deleteSelected", "Delete Selected"),
|
|
332
|
-
Y.length > 0 ? ` (${Y.length})` : ""
|
|
333
|
-
]
|
|
334
|
-
})
|
|
335
|
-
]
|
|
319
|
+
children: [/* @__PURE__ */ y("span", {
|
|
320
|
+
className: "rounded-full bg-bg-sunken px-3 py-1 text-sm font-medium text-text-secondary",
|
|
321
|
+
children: [P.size, " selected"]
|
|
322
|
+
}), /* @__PURE__ */ y("button", {
|
|
323
|
+
onClick: () => L("deactivate"),
|
|
324
|
+
disabled: J.length === 0 || !D.allowed,
|
|
325
|
+
"aria-disabled": J.length === 0 || !D.allowed,
|
|
326
|
+
title: D.allowed ? void 0 : T("devportal.common.noPermission", "You do not have permission to perform this action"),
|
|
327
|
+
className: "inline-flex items-center gap-2 rounded-md border border-status-warning-bg px-3 py-2 text-sm font-medium text-status-warning-text transition-colors hover:bg-status-warning-bg-subtle disabled:cursor-not-allowed disabled:opacity-50 focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-primary",
|
|
328
|
+
children: [
|
|
329
|
+
/* @__PURE__ */ v(ie, {
|
|
330
|
+
size: 16,
|
|
331
|
+
"aria-hidden": "true"
|
|
332
|
+
}),
|
|
333
|
+
T("devportal.deactivateSelected", "Deactivate Selected"),
|
|
334
|
+
J.length > 0 ? ` (${J.length})` : ""
|
|
335
|
+
]
|
|
336
|
+
})]
|
|
336
337
|
})]
|
|
337
338
|
})
|
|
338
339
|
}),
|
|
339
|
-
/* @__PURE__ */
|
|
340
|
+
/* @__PURE__ */ y("p", {
|
|
340
341
|
className: "text-sm text-text-secondary",
|
|
341
342
|
children: [
|
|
342
|
-
|
|
343
|
+
G.length,
|
|
343
344
|
" application",
|
|
344
|
-
|
|
345
|
+
G.length === 1 ? "" : "s",
|
|
345
346
|
" found"
|
|
346
347
|
]
|
|
347
348
|
}),
|
|
348
|
-
|
|
349
|
+
G.length > 0 ? O === "grid" ? /* @__PURE__ */ v("div", {
|
|
349
350
|
className: "grid gap-4 grid-cols-1 sm:grid-cols-2 lg:grid-cols-3",
|
|
350
|
-
children:
|
|
351
|
-
app: e,
|
|
352
|
-
selected: I.has(e.id),
|
|
353
|
-
onToggleSelect: (t) => Q(e.id, t)
|
|
354
|
-
}, e.id))
|
|
355
|
-
}) : /* @__PURE__ */ _("div", {
|
|
356
|
-
className: "space-y-2",
|
|
357
|
-
children: q.map((e) => /* @__PURE__ */ _(oe, {
|
|
351
|
+
children: G.map((e) => /* @__PURE__ */ v(l, {
|
|
358
352
|
app: e,
|
|
359
|
-
selected:
|
|
360
|
-
onToggleSelect: (t) =>
|
|
353
|
+
selected: P.has(e.id),
|
|
354
|
+
onToggleSelect: (t) => Z(e.id, t)
|
|
361
355
|
}, e.id))
|
|
362
|
-
}) : /* @__PURE__ */
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
356
|
+
}) : /* @__PURE__ */ v("div", {
|
|
357
|
+
className: "overflow-x-auto rounded-lg border border-border-seam",
|
|
358
|
+
children: /* @__PURE__ */ y("table", {
|
|
359
|
+
className: "w-full text-sm",
|
|
360
|
+
children: [/* @__PURE__ */ v("thead", { children: /* @__PURE__ */ y("tr", {
|
|
361
|
+
className: "border-b border-border-seam bg-bg-sunken text-left",
|
|
362
|
+
children: [
|
|
363
|
+
/* @__PURE__ */ v("th", {
|
|
364
|
+
className: "w-10 px-4 py-3",
|
|
365
|
+
children: /* @__PURE__ */ v(c, {
|
|
366
|
+
checked: Y,
|
|
367
|
+
indeterminate: X,
|
|
368
|
+
onChange: Q,
|
|
369
|
+
ariaLabel: "Select all"
|
|
370
|
+
})
|
|
371
|
+
}),
|
|
372
|
+
/* @__PURE__ */ v("th", {
|
|
373
|
+
className: "px-4 py-3 font-medium text-text-secondary",
|
|
374
|
+
children: "Name"
|
|
375
|
+
}),
|
|
376
|
+
/* @__PURE__ */ v("th", {
|
|
377
|
+
className: "px-4 py-3 font-medium text-text-secondary",
|
|
378
|
+
children: "Status"
|
|
379
|
+
}),
|
|
380
|
+
/* @__PURE__ */ v("th", {
|
|
381
|
+
className: "px-4 py-3 font-medium text-text-secondary",
|
|
382
|
+
children: "Type"
|
|
383
|
+
}),
|
|
384
|
+
/* @__PURE__ */ v("th", {
|
|
385
|
+
className: "px-4 py-3 font-medium text-text-secondary",
|
|
386
|
+
children: "Created"
|
|
387
|
+
}),
|
|
388
|
+
/* @__PURE__ */ v("th", { className: "px-4 py-3 font-medium text-text-secondary" })
|
|
389
|
+
]
|
|
390
|
+
}) }), /* @__PURE__ */ v("tbody", {
|
|
391
|
+
className: "divide-y divide-border-seam",
|
|
392
|
+
children: G.map((e) => /* @__PURE__ */ y("tr", {
|
|
393
|
+
className: `hover:bg-bg-surface-hover transition-colors ${P.has(e.id) ? "bg-action-primary-bg/5" : ""}`,
|
|
394
|
+
children: [
|
|
395
|
+
/* @__PURE__ */ v("td", {
|
|
396
|
+
className: "w-10 px-4 py-3",
|
|
397
|
+
children: /* @__PURE__ */ v(c, {
|
|
398
|
+
checked: P.has(e.id),
|
|
399
|
+
onChange: (t) => Z(e.id, t),
|
|
400
|
+
ariaLabel: `Select ${e.name}`
|
|
401
|
+
})
|
|
402
|
+
}),
|
|
403
|
+
/* @__PURE__ */ v("td", {
|
|
404
|
+
className: "px-4 py-3",
|
|
405
|
+
children: /* @__PURE__ */ y("button", {
|
|
406
|
+
onClick: () => W(`/apps/${e.id}`),
|
|
407
|
+
className: "group flex items-center gap-3 text-left",
|
|
408
|
+
children: [e.iconUrl ? /* @__PURE__ */ v("img", {
|
|
409
|
+
src: e.iconUrl,
|
|
410
|
+
alt: "",
|
|
411
|
+
className: "h-8 w-8 rounded object-cover"
|
|
412
|
+
}) : /* @__PURE__ */ v("div", {
|
|
413
|
+
className: "flex h-8 w-8 items-center justify-center rounded bg-bg-sunken text-text-secondary",
|
|
414
|
+
children: /* @__PURE__ */ v(m, { size: 14 })
|
|
415
|
+
}), /* @__PURE__ */ y("div", { children: [/* @__PURE__ */ v("p", {
|
|
416
|
+
className: "font-medium text-text-primary group-hover:text-action-primary-text transition-colors",
|
|
417
|
+
children: e.name
|
|
418
|
+
}), e.shortDescription && /* @__PURE__ */ v("p", {
|
|
419
|
+
className: "text-xs text-text-secondary line-clamp-1",
|
|
420
|
+
children: e.shortDescription
|
|
421
|
+
})] })]
|
|
422
|
+
})
|
|
423
|
+
}),
|
|
424
|
+
/* @__PURE__ */ v("td", {
|
|
425
|
+
className: "px-4 py-3",
|
|
426
|
+
children: /* @__PURE__ */ v(le, { status: e.status })
|
|
427
|
+
}),
|
|
428
|
+
/* @__PURE__ */ v("td", {
|
|
429
|
+
className: "px-4 py-3 text-text-secondary",
|
|
430
|
+
children: s[e.appType] || e.appType
|
|
431
|
+
}),
|
|
432
|
+
/* @__PURE__ */ v("td", {
|
|
433
|
+
className: "px-4 py-3 text-text-secondary tabular-nums",
|
|
434
|
+
children: new Date(e.createdAt).toLocaleDateString()
|
|
435
|
+
}),
|
|
436
|
+
/* @__PURE__ */ v("td", {
|
|
437
|
+
className: "px-4 py-3 text-right",
|
|
438
|
+
children: /* @__PURE__ */ v("button", {
|
|
439
|
+
onClick: () => W(`/apps/${e.id}`),
|
|
440
|
+
className: "rounded-md px-3 py-1.5 text-xs font-medium text-text-secondary hover:bg-bg-sunken hover:text-text-primary transition-colors",
|
|
441
|
+
children: "View"
|
|
442
|
+
})
|
|
443
|
+
})
|
|
444
|
+
]
|
|
445
|
+
}, e.id))
|
|
446
|
+
})]
|
|
447
|
+
})
|
|
448
|
+
}) : /* @__PURE__ */ v(t, {
|
|
449
|
+
illustration: A || j || N ? "empty-search" : "empty-data",
|
|
450
|
+
icon: /* @__PURE__ */ v(m, { size: 32 }),
|
|
451
|
+
title: T("devportal.noApplicationsFound", "No applications found"),
|
|
452
|
+
description: A || j || N ? T("devportal.tryAdjustingFilters", "Try adjusting your filters") : T("devportal.createFirstApp", "Create your first application to get started"),
|
|
453
|
+
action: !A && !j && !N ? /* @__PURE__ */ y("button", {
|
|
454
|
+
onClick: () => W("/apps/new"),
|
|
369
455
|
className: "inline-flex items-center gap-2 rounded-md bg-action-primary-bg px-4 py-2 text-sm font-medium text-action-primary-text hover:bg-action-primary-bg/90",
|
|
370
|
-
children: [/* @__PURE__ */ _
|
|
456
|
+
children: [/* @__PURE__ */ v(_, { size: 16 }), T("devportal.createApp", "Create App")]
|
|
371
457
|
}) : void 0
|
|
372
458
|
}),
|
|
373
|
-
/* @__PURE__ */
|
|
374
|
-
open:
|
|
459
|
+
/* @__PURE__ */ v(ee, {
|
|
460
|
+
open: I === "deactivate",
|
|
375
461
|
onOpenChange: (e) => {
|
|
376
|
-
e ||
|
|
462
|
+
e || L(null);
|
|
377
463
|
},
|
|
378
464
|
onConfirm: async () => {
|
|
379
|
-
if (
|
|
380
|
-
let e = await Promise.allSettled(
|
|
381
|
-
|
|
465
|
+
if (J.length === 0) return;
|
|
466
|
+
let e = await Promise.allSettled(J.map((e) => me({ variables: { id: e.id } }))), t = e.filter((e) => e.status === "fulfilled").length, n = e.length - t;
|
|
467
|
+
z({
|
|
382
468
|
type: n === 0 ? "success" : "error",
|
|
383
|
-
message:
|
|
384
|
-
}), $(),
|
|
469
|
+
message: ce("Deactivated", t, n)
|
|
470
|
+
}), $(), L(null), await H();
|
|
385
471
|
},
|
|
386
472
|
title: "Deactivate selected applications",
|
|
387
|
-
description: `Deactivate ${
|
|
473
|
+
description: `Deactivate ${J.length} selected application${J.length === 1 ? "" : "s"}? Users and integrations may lose access until these apps are re-enabled.`,
|
|
388
474
|
confirmLabel: "Deactivate",
|
|
389
475
|
cancelLabel: "Cancel",
|
|
390
476
|
variant: "warning"
|
|
391
|
-
}),
|
|
392
|
-
/* @__PURE__ */ _(a, {
|
|
393
|
-
open: R === "delete",
|
|
394
|
-
onOpenChange: (e) => {
|
|
395
|
-
e || z(null);
|
|
396
|
-
},
|
|
397
|
-
onConfirm: async () => {
|
|
398
|
-
if (Y.length === 0) return;
|
|
399
|
-
let e = await Promise.allSettled(Y.map((e) => he({ variables: { id: e.id } }))), t = e.filter((e) => e.status === "fulfilled").length, n = e.length - t;
|
|
400
|
-
V({
|
|
401
|
-
type: n === 0 ? "success" : "error",
|
|
402
|
-
message: b("Deleted", t, n)
|
|
403
|
-
}), $(), z(null), await W();
|
|
404
|
-
},
|
|
405
|
-
title: "Delete selected applications",
|
|
406
|
-
description: `Delete ${Y.length} selected application${Y.length === 1 ? "" : "s"}? This cannot be undone.`,
|
|
407
|
-
confirmLabel: "Delete",
|
|
408
|
-
cancelLabel: "Cancel",
|
|
409
|
-
variant: "danger"
|
|
410
477
|
})
|
|
411
478
|
]
|
|
412
479
|
})
|