@elevasis/ui 2.21.0 → 2.23.0
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/app/index.js +2 -2
- package/dist/{chunk-DMYELNGA.js → chunk-3HEUGBOT.js} +1 -1
- package/dist/{chunk-EGKNRM6P.js → chunk-7PGEGSUM.js} +2 -2
- package/dist/{chunk-KVW56ERD.js → chunk-AXXTN44Z.js} +5 -3
- package/dist/{chunk-I5WRKH25.js → chunk-D3KQAABP.js} +1 -1
- package/dist/{chunk-S7RL77QS.js → chunk-DDZOHLHB.js} +1 -1
- package/dist/{chunk-EDX6WIN3.js → chunk-EPV7NU2E.js} +24 -10
- package/dist/{chunk-ATEHYDL3.js → chunk-FXWETLEB.js} +6 -2
- package/dist/{chunk-7GG6OSD7.js → chunk-GUJUK6EH.js} +2830 -2381
- package/dist/{chunk-GBMNCNHX.js → chunk-KVJ3LFH2.js} +3 -1
- package/dist/{chunk-VQESMHQV.js → chunk-LJWV4TWV.js} +1 -2
- package/dist/{chunk-BJWIKEQG.js → chunk-N6WLOWOD.js} +6 -14
- package/dist/{chunk-XLZZOFGM.js → chunk-PTUOINQ2.js} +275 -76
- package/dist/{chunk-CZK67OHH.js → chunk-PXGSJNBH.js} +3 -3
- package/dist/{chunk-TIIPYB2Z.js → chunk-QZJM3RYI.js} +1 -1
- package/dist/{chunk-7YQKVWSD.js → chunk-SQ5JGELM.js} +25 -5
- package/dist/{chunk-RX4UWZZR.js → chunk-TKAYX2SP.js} +8 -3
- package/dist/{chunk-Q5HC6ENG.js → chunk-XOTJNW4Q.js} +1 -1
- package/dist/{chunk-LQU62KHD.js → chunk-YU6MBDVO.js} +1993 -870
- package/dist/{chunk-ULZ2B3NC.js → chunk-ZBCTB5CA.js} +1 -1
- package/dist/components/index.css +85 -85
- package/dist/components/index.d.ts +1651 -1388
- package/dist/components/index.js +253 -40
- package/dist/components/navigation/index.css +589 -0
- package/dist/components/navigation/index.js +3 -3
- package/dist/features/auth/index.css +2 -2
- package/dist/features/auth/index.d.ts +188 -10
- package/dist/features/crm/index.css +2 -2
- package/dist/features/crm/index.d.ts +193 -10
- package/dist/features/crm/index.js +10 -10
- package/dist/features/dashboard/index.css +2 -2
- package/dist/features/dashboard/index.js +9 -9
- package/dist/features/delivery/index.css +85 -85
- package/dist/features/delivery/index.d.ts +193 -10
- package/dist/features/delivery/index.js +10 -10
- package/dist/features/lead-gen/index.css +2 -2
- package/dist/features/lead-gen/index.d.ts +5 -0
- package/dist/features/lead-gen/index.js +10 -10
- package/dist/features/monitoring/index.css +85 -85
- package/dist/features/monitoring/index.d.ts +6 -1
- package/dist/features/monitoring/index.js +11 -11
- package/dist/features/monitoring/requests/index.css +2 -2
- package/dist/features/monitoring/requests/index.d.ts +5 -0
- package/dist/features/monitoring/requests/index.js +9 -9
- package/dist/features/operations/index.css +2 -2
- package/dist/features/operations/index.d.ts +7 -4
- package/dist/features/operations/index.js +12 -12
- package/dist/features/seo/index.d.ts +5 -0
- package/dist/features/settings/index.css +2 -2
- package/dist/features/settings/index.d.ts +214 -16
- package/dist/features/settings/index.js +11 -11
- package/dist/graph/index.css +2 -2
- package/dist/hooks/delivery/index.css +2 -2
- package/dist/hooks/delivery/index.d.ts +188 -10
- package/dist/hooks/index.css +85 -85
- package/dist/hooks/index.d.ts +1843 -1538
- package/dist/hooks/index.js +8 -8
- package/dist/hooks/published.css +85 -85
- package/dist/hooks/published.d.ts +1843 -1538
- package/dist/hooks/published.js +8 -8
- package/dist/index.css +12 -12
- package/dist/index.d.ts +346 -35
- package/dist/index.js +9 -9
- package/dist/initialization/index.d.ts +188 -10
- package/dist/layout/index.js +2 -2
- package/dist/organization/index.css +589 -0
- package/dist/organization/index.js +1 -1
- package/dist/profile/index.d.ts +188 -10
- package/dist/provider/index.css +384 -0
- package/dist/provider/index.d.ts +6 -0
- package/dist/provider/index.js +7 -7
- package/dist/provider/published.css +463 -0
- package/dist/provider/published.d.ts +6 -0
- package/dist/provider/published.js +4 -4
- package/dist/supabase/index.d.ts +367 -20
- package/dist/test-utils/index.d.ts +46 -2
- package/dist/test-utils/index.js +102 -1
- package/dist/theme/index.js +2 -2
- package/dist/types/index.d.ts +199 -13
- package/package.json +4 -4
- /package/dist/{chunk-6GUW5GGF.js → chunk-6Z3G4U2R.js} +0 -0
|
@@ -3,8 +3,10 @@ import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
|
3
3
|
import { cloneElement } from 'react';
|
|
4
4
|
|
|
5
5
|
// src/components/modal/CustomModal.tsx
|
|
6
|
+
var FULL_SIZE = "80%";
|
|
6
7
|
var CustomModal = ({ children, opened, onClose, loading, style, size }) => {
|
|
7
8
|
const canClose = loading === true ? false : true;
|
|
9
|
+
const resolvedSize = size === "full" ? FULL_SIZE : size;
|
|
8
10
|
return /* @__PURE__ */ jsx(
|
|
9
11
|
Modal,
|
|
10
12
|
{
|
|
@@ -16,7 +18,7 @@ var CustomModal = ({ children, opened, onClose, loading, style, size }) => {
|
|
|
16
18
|
closeOnEscape: canClose,
|
|
17
19
|
centered: true,
|
|
18
20
|
style,
|
|
19
|
-
size,
|
|
21
|
+
size: resolvedSize,
|
|
20
22
|
children
|
|
21
23
|
}
|
|
22
24
|
);
|
|
@@ -38,7 +38,6 @@ function createFeatureAccessHook({
|
|
|
38
38
|
};
|
|
39
39
|
};
|
|
40
40
|
}
|
|
41
|
-
var createUseFeatureAccess = createFeatureAccessHook;
|
|
42
41
|
|
|
43
42
|
// ../core/src/organization-model/helpers.ts
|
|
44
43
|
function defaultPathFor(id) {
|
|
@@ -333,4 +332,4 @@ function ElevasisFeaturesProvider({
|
|
|
333
332
|
return /* @__PURE__ */ jsx(ElevasisFeaturesContext.Provider, { value, children });
|
|
334
333
|
}
|
|
335
334
|
|
|
336
|
-
export { ElevasisFeaturesProvider, createFeatureAccessHook,
|
|
335
|
+
export { ElevasisFeaturesProvider, createFeatureAccessHook, useElevasisFeatures, useOptionalElevasisFeatures };
|
|
@@ -4,10 +4,10 @@ import { TableSelectionToolbar, SortableHeader } from './chunk-TUMSNGTX.js';
|
|
|
4
4
|
import { SubshellNavItem } from './chunk-CEWTOKE7.js';
|
|
5
5
|
import { SubshellSidebarSection } from './chunk-IIMU5YAJ.js';
|
|
6
6
|
import { FilterBar } from './chunk-PDHTXPSF.js';
|
|
7
|
-
import { CustomModal } from './chunk-
|
|
8
|
-
import { useProjectRealtime, useTableSort, sortData, usePaginationState, useTableSelection, useProjectActivities } from './chunk-
|
|
7
|
+
import { CustomModal } from './chunk-KVJ3LFH2.js';
|
|
8
|
+
import { useProjectRealtime, useTableSort, sortData, usePaginationState, useTableSelection, useProjectActivities } from './chunk-GUJUK6EH.js';
|
|
9
9
|
import { useCreateTask, useCreateMilestone, useProjectMilestones, useUpdateTask, useProjects, useDeleteProject, useProject, useProjectNotes, useUpdateMilestone, useCreateNote, showApiErrorNotification, projectKeys } from './chunk-Z6FAH4XV.js';
|
|
10
|
-
import { SubshellContentContainer } from './chunk-
|
|
10
|
+
import { SubshellContentContainer } from './chunk-TKAYX2SP.js';
|
|
11
11
|
import { StatusBadge, EmptyState, PageTitleCaption, CenteredErrorState, StatCard, CardHeader } from './chunk-XUYBOO32.js';
|
|
12
12
|
import { useRouterContext } from './chunk-Q7DJKLEN.js';
|
|
13
13
|
import { PAGE_SIZE_DEFAULT, formatTimeAgo, formatDate, formatRelativeTime } from './chunk-SGXXJE52.js';
|
|
@@ -1097,7 +1097,7 @@ function renderMilestoneBullet(status) {
|
|
|
1097
1097
|
function getMilestoneSurfaceStyles(status) {
|
|
1098
1098
|
const normalizedStatus = status ?? "upcoming";
|
|
1099
1099
|
const accent = normalizedStatus === "completed" ? "var(--color-primary)" : normalizedStatus === "in_progress" ? "color-mix(in srgb, var(--color-primary) 72%, white)" : "color-mix(in srgb, var(--color-primary) 36%, var(--color-border))";
|
|
1100
|
-
const background = normalizedStatus === "completed" ? "var(--color-primary)" : normalizedStatus === "in_progress" ? "linear-gradient(180deg, color-mix(in srgb, var(--color-primary) 3%, transparent) 0%, transparent 100%)" : "linear-gradient(180deg, color-mix(in srgb, var(--color-primary) 1.5%, transparent) 0%, transparent 100%)";
|
|
1100
|
+
const background = normalizedStatus === "completed" ? "linear-gradient(180deg, color-mix(in srgb, var(--color-primary) 1.5%, transparent) 0%, transparent 100%)" : normalizedStatus === "in_progress" ? "linear-gradient(180deg, color-mix(in srgb, var(--color-primary) 3%, transparent) 0%, transparent 100%)" : "linear-gradient(180deg, color-mix(in srgb, var(--color-primary) 1.5%, transparent) 0%, transparent 100%)";
|
|
1101
1101
|
return {
|
|
1102
1102
|
accent,
|
|
1103
1103
|
background
|
|
@@ -1482,7 +1482,7 @@ function ProjectDetailPage({ projectId, onBack, backLabel = "Projects" }) {
|
|
|
1482
1482
|
{
|
|
1483
1483
|
fw: 700,
|
|
1484
1484
|
size: "lg",
|
|
1485
|
-
c:
|
|
1485
|
+
c: "var(--color-text)",
|
|
1486
1486
|
children: milestone.name
|
|
1487
1487
|
}
|
|
1488
1488
|
),
|
|
@@ -1501,15 +1501,7 @@ function ProjectDetailPage({ projectId, onBack, backLabel = "Projects" }) {
|
|
|
1501
1501
|
}
|
|
1502
1502
|
)
|
|
1503
1503
|
] }),
|
|
1504
|
-
milestone.description && /* @__PURE__ */ jsx(
|
|
1505
|
-
Text,
|
|
1506
|
-
{
|
|
1507
|
-
size: "sm",
|
|
1508
|
-
c: milestone.status === "completed" ? "color-mix(in srgb, var(--color-background) 82%, transparent)" : "var(--color-text-dimmed)",
|
|
1509
|
-
maw: 900,
|
|
1510
|
-
children: milestone.description
|
|
1511
|
-
}
|
|
1512
|
-
)
|
|
1504
|
+
milestone.description && /* @__PURE__ */ jsx(Text, { size: "sm", c: "var(--color-text-dimmed)", maw: 900, children: milestone.description })
|
|
1513
1505
|
] }),
|
|
1514
1506
|
/* @__PURE__ */ jsxs(Group, { gap: "xs", wrap: "wrap", children: [
|
|
1515
1507
|
milestone.due_date && /* @__PURE__ */ jsxs(
|
|
@@ -1,21 +1,23 @@
|
|
|
1
1
|
import { AppShellLoader } from './chunk-M25JL54Z.js';
|
|
2
2
|
import { FilterBar } from './chunk-PDHTXPSF.js';
|
|
3
|
-
import { CustomModal } from './chunk-
|
|
4
|
-
import { useAvailablePresets } from './chunk-
|
|
5
|
-
import { useDeleteCredential, useCreateCredential, useCredentials, MEMBERSHIP_STATUS_COLORS, transformMembershipToTableRow, useUserMemberships, useUpdateWebhookEndpoint, useResources, useDeleteWebhookEndpoint, useCreateWebhookEndpoint, useListWebhookEndpoints, useUpdateMemberConfig, useOrganizationMembers, useUpdateCredential, CredentialSchemas } from './chunk-
|
|
6
|
-
import { showErrorNotification } from './chunk-Z6FAH4XV.js';
|
|
3
|
+
import { CustomModal } from './chunk-KVJ3LFH2.js';
|
|
4
|
+
import { useAvailablePresets } from './chunk-QZJM3RYI.js';
|
|
5
|
+
import { useDeleteCredential, useCreateCredential, useCredentials, MEMBERSHIP_STATUS_COLORS, transformMembershipToTableRow, useUserMemberships, useUpdateWebhookEndpoint, useResources, useDeleteWebhookEndpoint, useCreateWebhookEndpoint, useListWebhookEndpoints, useOrgRoles, useAssignRole, useRevokeRole, useHasPermission, useUpdateMemberConfig, useOrganizationMembers, useUpdateCredential, CredentialSchemas } from './chunk-GUJUK6EH.js';
|
|
6
|
+
import { showApiErrorNotification, showErrorNotification, showSuccessNotification } from './chunk-Z6FAH4XV.js';
|
|
7
7
|
import { ListSkeleton, EmptyState, PageTitleCaption, CardHeader, APIErrorAlert, StatCard } from './chunk-XUYBOO32.js';
|
|
8
|
-
import {
|
|
8
|
+
import { RoleBadge } from './chunk-SQ5JGELM.js';
|
|
9
|
+
import { isAPIClientError, formatDateTime, OAUTH_POPUP_CHECK_INTERVAL, OAUTH_FLOW_TIMEOUT } from './chunk-SGXXJE52.js';
|
|
9
10
|
import { useInitialization } from './chunk-DK2HVHCY.js';
|
|
10
11
|
import { useElevasisServices } from './chunk-IRW7JMQ4.js';
|
|
11
|
-
import { Table, Group,
|
|
12
|
-
import { IconSettings, IconKey, IconCalendar, IconPencil, IconTrash, IconAlertTriangle, IconInfoCircle, IconExclamationMark, IconPlus, IconAlertCircle, IconUsers, IconSearch, IconBuilding, IconWebhook, IconCheck, IconCopy, IconUser, IconMail, IconRefresh, IconPalette, IconEye, IconSparkles, IconTrendingUp, IconClock, IconPlayerPause, IconPlayerPlay, IconActivity, IconBrandDropbox, IconBrandGoogleDrive, IconPlug, IconEdit, IconUserX, IconUserCheck } from '@tabler/icons-react';
|
|
12
|
+
import { createUseExternalEvents, Text, Table, Group, Tooltip, ActionIcon, Stack, Title, Button, Select, TextInput, Alert, PasswordInput, Anchor, Paper, Card, Switch, Badge, Center, Loader, Box, Code, CopyButton, ThemeIcon, SimpleGrid, UnstyledButton, Divider, Textarea, Tabs, MultiSelect } from '@mantine/core';
|
|
13
|
+
import { IconSettings, IconShieldOff, IconKey, IconCalendar, IconPencil, IconTrash, IconAlertTriangle, IconInfoCircle, IconExclamationMark, IconPlus, IconAlertCircle, IconUsers, IconSearch, IconBuilding, IconWebhook, IconCheck, IconCopy, IconUser, IconMail, IconRefresh, IconPalette, IconEye, IconSparkles, IconTrendingUp, IconClock, IconPlayerPause, IconPlayerPlay, IconActivity, IconShieldLock, IconAdjustments, IconBrandDropbox, IconBrandGoogleDrive, IconPlug, IconEdit, IconUserX, IconUserCheck } from '@tabler/icons-react';
|
|
13
14
|
import { z } from 'zod';
|
|
14
|
-
import {
|
|
15
|
+
import { randomId } from '@mantine/hooks';
|
|
16
|
+
import { notifications } from '@mantine/notifications';
|
|
15
17
|
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
18
|
+
import { useState, useEffect, useRef, useMemo, useCallback } from 'react';
|
|
16
19
|
import { useForm } from '@mantine/form';
|
|
17
20
|
import { useMutation, useQueryClient } from '@tanstack/react-query';
|
|
18
|
-
import { notifications } from '@mantine/notifications';
|
|
19
21
|
import { create } from 'zustand';
|
|
20
22
|
|
|
21
23
|
// ../core/src/integrations/oauth/provider-registry.ts
|
|
@@ -160,6 +162,63 @@ function buildCredentialValue(type, formValues) {
|
|
|
160
162
|
}
|
|
161
163
|
return value;
|
|
162
164
|
}
|
|
165
|
+
var [useModalsEvents, createEvent] = createUseExternalEvents("mantine-modals");
|
|
166
|
+
var openModal = (payload) => {
|
|
167
|
+
const id = payload.modalId || randomId();
|
|
168
|
+
createEvent("openModal")({ ...payload, modalId: id });
|
|
169
|
+
return id;
|
|
170
|
+
};
|
|
171
|
+
var openConfirmModal = (payload) => {
|
|
172
|
+
const id = payload.modalId || randomId();
|
|
173
|
+
createEvent("openConfirmModal")({ ...payload, modalId: id });
|
|
174
|
+
return id;
|
|
175
|
+
};
|
|
176
|
+
var openContextModal = (payload) => {
|
|
177
|
+
const id = payload.modalId || randomId();
|
|
178
|
+
createEvent("openContextModal")({ ...payload, modalId: id });
|
|
179
|
+
return id;
|
|
180
|
+
};
|
|
181
|
+
var closeModal = createEvent("closeModal");
|
|
182
|
+
var closeAllModals = createEvent("closeAllModals");
|
|
183
|
+
var updateModal = (payload) => createEvent("updateModal")(payload);
|
|
184
|
+
var updateContextModal = (payload) => createEvent("updateContextModal")(payload);
|
|
185
|
+
var modals = {
|
|
186
|
+
open: openModal,
|
|
187
|
+
close: closeModal,
|
|
188
|
+
closeAll: closeAllModals,
|
|
189
|
+
openConfirmModal,
|
|
190
|
+
openContextModal,
|
|
191
|
+
updateModal,
|
|
192
|
+
updateContextModal
|
|
193
|
+
};
|
|
194
|
+
function showAuthError(error) {
|
|
195
|
+
if (isAPIClientError(error)) {
|
|
196
|
+
if (error.code === "LAST_OWNER_PROTECTED") {
|
|
197
|
+
modals.openConfirmModal({
|
|
198
|
+
title: "Last owner protection",
|
|
199
|
+
children: /* @__PURE__ */ jsx(Text, { size: "sm", children: "You are the only active owner. Promote another active member to owner before changing this role." }),
|
|
200
|
+
labels: { confirm: "Open members", cancel: "Cancel" },
|
|
201
|
+
onConfirm: () => {
|
|
202
|
+
if (typeof window !== "undefined") {
|
|
203
|
+
window.location.href = "/settings/organization";
|
|
204
|
+
}
|
|
205
|
+
}
|
|
206
|
+
});
|
|
207
|
+
return;
|
|
208
|
+
}
|
|
209
|
+
if (error.code === "FORBIDDEN") {
|
|
210
|
+
notifications.show({
|
|
211
|
+
title: "Permission required",
|
|
212
|
+
message: error.message,
|
|
213
|
+
color: "red",
|
|
214
|
+
position: "top-right",
|
|
215
|
+
icon: /* @__PURE__ */ jsx(IconShieldOff, { size: 16 })
|
|
216
|
+
});
|
|
217
|
+
return;
|
|
218
|
+
}
|
|
219
|
+
}
|
|
220
|
+
showApiErrorNotification(error);
|
|
221
|
+
}
|
|
163
222
|
function CredentialList({ credentials, isLoading, onEdit }) {
|
|
164
223
|
const [deleteCredential, setDeleteCredential] = useState(null);
|
|
165
224
|
const deleteMutation = useDeleteCredential();
|
|
@@ -1158,10 +1217,11 @@ function EditWebhookEndpointModal({ opened, endpoint, onClose }) {
|
|
|
1158
1217
|
] })
|
|
1159
1218
|
] }) }) });
|
|
1160
1219
|
}
|
|
1161
|
-
function
|
|
1162
|
-
return
|
|
1220
|
+
function formatKeyDisplay(keyPrefix) {
|
|
1221
|
+
if (!keyPrefix) return "Unavailable";
|
|
1222
|
+
return `${keyPrefix}...`;
|
|
1163
1223
|
}
|
|
1164
|
-
function WebhookEndpointList({ endpoints, isLoading
|
|
1224
|
+
function WebhookEndpointList({ endpoints, isLoading }) {
|
|
1165
1225
|
const [deleteTarget, setDeleteTarget] = useState(null);
|
|
1166
1226
|
const [editTarget, setEditTarget] = useState(null);
|
|
1167
1227
|
const deleteMutation = useDeleteWebhookEndpoint();
|
|
@@ -1200,14 +1260,13 @@ function WebhookEndpointList({ endpoints, isLoading, apiUrl }) {
|
|
|
1200
1260
|
/* @__PURE__ */ jsx(Table.Th, { children: "Name" }),
|
|
1201
1261
|
/* @__PURE__ */ jsx(Table.Th, { children: "Status" }),
|
|
1202
1262
|
/* @__PURE__ */ jsx(Table.Th, { children: "Target Resource" }),
|
|
1203
|
-
/* @__PURE__ */ jsx(Table.Th, { children: "
|
|
1263
|
+
/* @__PURE__ */ jsx(Table.Th, { children: "Key" }),
|
|
1204
1264
|
/* @__PURE__ */ jsx(Table.Th, { children: "Last Triggered" }),
|
|
1205
1265
|
/* @__PURE__ */ jsx(Table.Th, { children: "Requests" }),
|
|
1206
1266
|
/* @__PURE__ */ jsx(Table.Th, { w: 120 })
|
|
1207
1267
|
] }) }),
|
|
1208
1268
|
/* @__PURE__ */ jsx(Table.Tbody, { children: endpoints.map((endpoint) => {
|
|
1209
|
-
const
|
|
1210
|
-
const truncatedUrl = webhookUrl.length > 50 ? `...${endpoint.key.slice(-16)}` : webhookUrl;
|
|
1269
|
+
const keyDisplay = formatKeyDisplay(endpoint.keyPrefix);
|
|
1211
1270
|
const isToggling = updateMutation.isPending;
|
|
1212
1271
|
return /* @__PURE__ */ jsxs(Table.Tr, { children: [
|
|
1213
1272
|
/* @__PURE__ */ jsx(Table.Td, { children: /* @__PURE__ */ jsxs(Group, { gap: "xs", children: [
|
|
@@ -1219,19 +1278,14 @@ function WebhookEndpointList({ endpoints, isLoading, apiUrl }) {
|
|
|
1219
1278
|
] }) }),
|
|
1220
1279
|
/* @__PURE__ */ jsx(Table.Td, { children: /* @__PURE__ */ jsx(Badge, { color: endpoint.status === "active" ? "teal" : "gray", variant: "light", children: endpoint.status }) }),
|
|
1221
1280
|
/* @__PURE__ */ jsx(Table.Td, { children: endpoint.resourceId ? /* @__PURE__ */ jsx(Code, { children: endpoint.resourceId }) : /* @__PURE__ */ jsx(Text, { size: "sm", c: "dimmed", fs: "italic", children: "Not configured" }) }),
|
|
1222
|
-
/* @__PURE__ */ jsx(Table.Td, { children: /* @__PURE__ */
|
|
1223
|
-
|
|
1224
|
-
|
|
1225
|
-
|
|
1226
|
-
|
|
1227
|
-
|
|
1228
|
-
|
|
1229
|
-
|
|
1230
|
-
size: "sm",
|
|
1231
|
-
children: copied ? /* @__PURE__ */ jsx(IconCheck, { size: 12 }) : /* @__PURE__ */ jsx(IconCopy, { size: 12 })
|
|
1232
|
-
}
|
|
1233
|
-
) }) })
|
|
1234
|
-
] }) }),
|
|
1281
|
+
/* @__PURE__ */ jsx(Table.Td, { children: /* @__PURE__ */ jsx(
|
|
1282
|
+
Tooltip,
|
|
1283
|
+
{
|
|
1284
|
+
label: "Full URL is shown only at creation. Use the prefix to identify which endpoint this is.",
|
|
1285
|
+
position: "top",
|
|
1286
|
+
children: /* @__PURE__ */ jsx(Paper, { withBorder: true, style: { display: "inline-flex", alignItems: "center", padding: "2px 8px" }, children: /* @__PURE__ */ jsx(Text, { size: "xs", c: "dimmed", ff: "monospace", style: { userSelect: "all" }, children: keyDisplay }) })
|
|
1287
|
+
}
|
|
1288
|
+
) }),
|
|
1235
1289
|
/* @__PURE__ */ jsx(Table.Td, { children: /* @__PURE__ */ jsxs(Group, { gap: 4, children: [
|
|
1236
1290
|
/* @__PURE__ */ jsx(IconClock, { size: 14, style: { opacity: 0.5 } }),
|
|
1237
1291
|
/* @__PURE__ */ jsx(Text, { size: "sm", c: "dimmed", children: formatDateTime(endpoint.lastTriggeredAt) })
|
|
@@ -1398,7 +1452,7 @@ function CreateWebhookEndpointModal({ opened, onClose, onSuccess }) {
|
|
|
1398
1452
|
] })
|
|
1399
1453
|
] }) }) });
|
|
1400
1454
|
}
|
|
1401
|
-
function
|
|
1455
|
+
function getWebhookUrl(apiUrl, key) {
|
|
1402
1456
|
return `${apiUrl}/api/webhooks/inbound/${key}`;
|
|
1403
1457
|
}
|
|
1404
1458
|
function WebhookEndpointSettings({ apiUrl }) {
|
|
@@ -1444,7 +1498,7 @@ function WebhookEndpointSettings({ apiUrl }) {
|
|
|
1444
1498
|
}
|
|
1445
1499
|
)
|
|
1446
1500
|
] }),
|
|
1447
|
-
/* @__PURE__ */ jsx(Paper, { withBorder: true, children: /* @__PURE__ */ jsx(WebhookEndpointList, { endpoints, isLoading
|
|
1501
|
+
/* @__PURE__ */ jsx(Paper, { withBorder: true, children: /* @__PURE__ */ jsx(WebhookEndpointList, { endpoints, isLoading }) }),
|
|
1448
1502
|
/* @__PURE__ */ jsx(
|
|
1449
1503
|
CreateWebhookEndpointModal,
|
|
1450
1504
|
{
|
|
@@ -1453,34 +1507,133 @@ function WebhookEndpointSettings({ apiUrl }) {
|
|
|
1453
1507
|
onSuccess: handleEndpointCreated
|
|
1454
1508
|
}
|
|
1455
1509
|
),
|
|
1456
|
-
newEndpoint && /* @__PURE__ */ jsx(
|
|
1510
|
+
newEndpoint && newEndpoint.key && /* @__PURE__ */ jsx(
|
|
1457
1511
|
WebhookUrlDisplayModal,
|
|
1458
1512
|
{
|
|
1459
1513
|
opened: true,
|
|
1460
1514
|
endpoint: newEndpoint,
|
|
1461
|
-
webhookUrl:
|
|
1515
|
+
webhookUrl: getWebhookUrl(apiUrl, newEndpoint.key),
|
|
1462
1516
|
onClose: () => setNewEndpoint(null)
|
|
1463
1517
|
}
|
|
1464
1518
|
)
|
|
1465
1519
|
] });
|
|
1466
1520
|
}
|
|
1467
|
-
function
|
|
1468
|
-
const
|
|
1469
|
-
const
|
|
1521
|
+
function diffRoles(current, next) {
|
|
1522
|
+
const adds = next.filter((id) => !current.includes(id));
|
|
1523
|
+
const removes = current.filter((id) => !next.includes(id));
|
|
1524
|
+
return { adds, removes };
|
|
1525
|
+
}
|
|
1526
|
+
function MemberAccessModal({ opened, onClose, orgId, member, defaultTab = "roles" }) {
|
|
1527
|
+
const [activeTab, setActiveTab] = useState(defaultTab);
|
|
1470
1528
|
useEffect(() => {
|
|
1471
|
-
if (
|
|
1472
|
-
|
|
1473
|
-
|
|
1474
|
-
|
|
1529
|
+
if (opened) setActiveTab(defaultTab);
|
|
1530
|
+
}, [opened, defaultTab]);
|
|
1531
|
+
const handleClose = () => {
|
|
1532
|
+
onClose();
|
|
1533
|
+
};
|
|
1534
|
+
if (!member) return null;
|
|
1535
|
+
return /* @__PURE__ */ jsx(CustomModal, { opened, onClose: handleClose, size: "xl", children: /* @__PURE__ */ jsxs(Stack, { p: "md", gap: "md", children: [
|
|
1536
|
+
/* @__PURE__ */ jsxs(Stack, { gap: 4, children: [
|
|
1537
|
+
/* @__PURE__ */ jsx(Title, { order: 3, children: "Member access" }),
|
|
1538
|
+
/* @__PURE__ */ jsxs(Group, { gap: "xs", children: [
|
|
1539
|
+
/* @__PURE__ */ jsx(Text, { fw: 500, children: member.name }),
|
|
1540
|
+
/* @__PURE__ */ jsx(Badge, { variant: "light", size: "sm", children: member.role })
|
|
1541
|
+
] }),
|
|
1542
|
+
/* @__PURE__ */ jsx(Text, { size: "sm", c: "dimmed", children: member.email })
|
|
1543
|
+
] }),
|
|
1544
|
+
/* @__PURE__ */ jsxs(Tabs, { value: activeTab, onChange: (v) => setActiveTab(v ?? "roles"), children: [
|
|
1545
|
+
/* @__PURE__ */ jsxs(Tabs.List, { children: [
|
|
1546
|
+
/* @__PURE__ */ jsx(Tabs.Tab, { value: "roles", leftSection: /* @__PURE__ */ jsx(IconShieldLock, { size: 14 }), children: "Roles" }),
|
|
1547
|
+
/* @__PURE__ */ jsx(Tabs.Tab, { value: "features", leftSection: /* @__PURE__ */ jsx(IconAdjustments, { size: 14 }), children: "Feature access" })
|
|
1548
|
+
] }),
|
|
1549
|
+
/* @__PURE__ */ jsx(Tabs.Panel, { value: "roles", pt: "md", children: /* @__PURE__ */ jsx(RolesTabPanel, { orgId, member, onSaved: onClose }) }),
|
|
1550
|
+
/* @__PURE__ */ jsx(Tabs.Panel, { value: "features", pt: "md", children: /* @__PURE__ */ jsx(FeaturesTabPanel, { member, onSaved: onClose }) })
|
|
1551
|
+
] })
|
|
1552
|
+
] }) });
|
|
1553
|
+
}
|
|
1554
|
+
function RolesTabPanel({ orgId, member, onSaved }) {
|
|
1555
|
+
const { data: rolesData, isLoading: rolesLoading } = useOrgRoles(orgId ?? void 0);
|
|
1556
|
+
const assignMutation = useAssignRole();
|
|
1557
|
+
const revokeMutation = useRevokeRole();
|
|
1558
|
+
const canManagePrivileged = useHasPermission("roles.manage");
|
|
1559
|
+
const allRoles = rolesData?.roles ?? [];
|
|
1560
|
+
const currentRoleIds = useMemo(() => {
|
|
1561
|
+
const matched = allRoles.find((r) => r.slug === member.role);
|
|
1562
|
+
return matched ? [matched.id] : [];
|
|
1563
|
+
}, [allRoles, member.role]);
|
|
1564
|
+
const [selectedIds, setSelectedIds] = useState(currentRoleIds);
|
|
1565
|
+
const [saving, setSaving] = useState(false);
|
|
1475
1566
|
useEffect(() => {
|
|
1476
|
-
|
|
1477
|
-
|
|
1567
|
+
setSelectedIds(currentRoleIds);
|
|
1568
|
+
}, [currentRoleIds, member.id]);
|
|
1569
|
+
const options = allRoles.map((r) => ({
|
|
1570
|
+
value: r.id,
|
|
1571
|
+
label: r.name + (r.is_system ? " (built-in)" : ""),
|
|
1572
|
+
disabled: !canManagePrivileged && (r.slug === "owner" || r.slug === "admin")
|
|
1573
|
+
}));
|
|
1574
|
+
const hasZeroRoles = selectedIds.length === 0;
|
|
1575
|
+
const isUnchanged = selectedIds.length === currentRoleIds.length && selectedIds.every((id) => currentRoleIds.includes(id));
|
|
1576
|
+
async function handleSave() {
|
|
1577
|
+
if (hasZeroRoles || isUnchanged) return;
|
|
1578
|
+
setSaving(true);
|
|
1579
|
+
try {
|
|
1580
|
+
const { adds, removes } = diffRoles(currentRoleIds, selectedIds);
|
|
1581
|
+
await Promise.all([
|
|
1582
|
+
...adds.map((roleId) => assignMutation.mutateAsync({ membershipId: member.id, roleId })),
|
|
1583
|
+
...removes.map((roleId) => revokeMutation.mutateAsync({ membershipId: member.id, roleId }))
|
|
1584
|
+
]);
|
|
1585
|
+
showSuccessNotification("Roles updated");
|
|
1586
|
+
onSaved();
|
|
1587
|
+
} catch (err) {
|
|
1588
|
+
showAuthError(err);
|
|
1589
|
+
} finally {
|
|
1590
|
+
setSaving(false);
|
|
1478
1591
|
}
|
|
1479
|
-
}
|
|
1480
|
-
|
|
1592
|
+
}
|
|
1593
|
+
return /* @__PURE__ */ jsxs(Stack, { gap: "sm", children: [
|
|
1594
|
+
/* @__PURE__ */ jsx(Text, { size: "sm", c: "dimmed", children: "Select the roles assigned to this member. Each role grants a bundle of permissions; the member's effective permissions are the union of all assigned roles." }),
|
|
1595
|
+
/* @__PURE__ */ jsx(
|
|
1596
|
+
MultiSelect,
|
|
1597
|
+
{
|
|
1598
|
+
data: options,
|
|
1599
|
+
value: selectedIds,
|
|
1600
|
+
onChange: setSelectedIds,
|
|
1601
|
+
placeholder: rolesLoading ? "Loading roles..." : "Select roles",
|
|
1602
|
+
disabled: saving || rolesLoading,
|
|
1603
|
+
searchable: true,
|
|
1604
|
+
clearable: false
|
|
1605
|
+
}
|
|
1606
|
+
),
|
|
1607
|
+
!canManagePrivileged && /* @__PURE__ */ jsxs(Alert, { color: "blue", variant: "light", children: [
|
|
1608
|
+
"Only owners (with ",
|
|
1609
|
+
/* @__PURE__ */ jsx("code", { children: "roles.manage" }),
|
|
1610
|
+
") can grant or revoke the owner / admin system roles."
|
|
1611
|
+
] }),
|
|
1612
|
+
!rolesLoading && hasZeroRoles && currentRoleIds.length > 0 && /* @__PURE__ */ jsx(Text, { size: "xs", c: "red", children: "At least one role is required for an active membership." }),
|
|
1613
|
+
/* @__PURE__ */ jsxs(Group, { justify: "flex-end", mt: "md", children: [
|
|
1614
|
+
/* @__PURE__ */ jsx(Button, { variant: "default", onClick: onSaved, disabled: saving, children: "Cancel" }),
|
|
1615
|
+
/* @__PURE__ */ jsx(
|
|
1616
|
+
Button,
|
|
1617
|
+
{
|
|
1618
|
+
leftSection: /* @__PURE__ */ jsx(IconCheck, { size: 14 }),
|
|
1619
|
+
loading: saving,
|
|
1620
|
+
disabled: hasZeroRoles || isUnchanged,
|
|
1621
|
+
onClick: handleSave,
|
|
1622
|
+
children: "Save roles"
|
|
1623
|
+
}
|
|
1624
|
+
)
|
|
1625
|
+
] })
|
|
1626
|
+
] });
|
|
1627
|
+
}
|
|
1628
|
+
function FeaturesTabPanel({ member, onSaved }) {
|
|
1629
|
+
const [localConfig, setLocalConfig] = useState(member.config);
|
|
1630
|
+
const mutation = useUpdateMemberConfig();
|
|
1631
|
+
useEffect(() => {
|
|
1632
|
+
setLocalConfig(member.config);
|
|
1633
|
+
}, [member.config, member.id]);
|
|
1481
1634
|
const handleSave = async () => {
|
|
1482
1635
|
if (!localConfig) {
|
|
1483
|
-
|
|
1636
|
+
onSaved();
|
|
1484
1637
|
return;
|
|
1485
1638
|
}
|
|
1486
1639
|
try {
|
|
@@ -1488,22 +1641,13 @@ function MemberConfigModal({ opened, onClose, member }) {
|
|
|
1488
1641
|
membershipId: member.id,
|
|
1489
1642
|
config: localConfig
|
|
1490
1643
|
});
|
|
1491
|
-
|
|
1644
|
+
showSuccessNotification("Feature access updated");
|
|
1645
|
+
onSaved();
|
|
1492
1646
|
} catch {
|
|
1493
1647
|
}
|
|
1494
1648
|
};
|
|
1495
|
-
|
|
1496
|
-
|
|
1497
|
-
onClose();
|
|
1498
|
-
}
|
|
1499
|
-
};
|
|
1500
|
-
return /* @__PURE__ */ jsx(CustomModal, { opened, onClose: handleClose, size: "md", loading: mutation.isPending, children: /* @__PURE__ */ jsxs(Stack, { children: [
|
|
1501
|
-
/* @__PURE__ */ jsx(Title, { order: 3, children: "Configure Member Access" }),
|
|
1502
|
-
/* @__PURE__ */ jsxs(Group, { gap: "xs", children: [
|
|
1503
|
-
/* @__PURE__ */ jsx(Text, { fw: 500, children: member.name }),
|
|
1504
|
-
/* @__PURE__ */ jsx(Badge, { variant: "light", size: "sm", children: member.role })
|
|
1505
|
-
] }),
|
|
1506
|
-
/* @__PURE__ */ jsx(Text, { size: "sm", c: "dimmed", children: member.email }),
|
|
1649
|
+
return /* @__PURE__ */ jsxs(Stack, { gap: "sm", children: [
|
|
1650
|
+
/* @__PURE__ */ jsx(Text, { size: "sm", c: "dimmed", children: "Override which features and surfaces this member can see in the Command Center. Defaults follow the organization's feature configuration." }),
|
|
1507
1651
|
/* @__PURE__ */ jsx(
|
|
1508
1652
|
MembershipFeaturePanel,
|
|
1509
1653
|
{
|
|
@@ -1512,11 +1656,11 @@ function MemberConfigModal({ opened, onClose, member }) {
|
|
|
1512
1656
|
disabled: mutation.isPending
|
|
1513
1657
|
}
|
|
1514
1658
|
),
|
|
1515
|
-
/* @__PURE__ */ jsxs(Group, { justify: "
|
|
1516
|
-
/* @__PURE__ */ jsx(Button, { variant: "
|
|
1517
|
-
/* @__PURE__ */ jsx(Button, {
|
|
1659
|
+
/* @__PURE__ */ jsxs(Group, { justify: "flex-end", mt: "md", children: [
|
|
1660
|
+
/* @__PURE__ */ jsx(Button, { variant: "default", onClick: onSaved, disabled: mutation.isPending, children: "Cancel" }),
|
|
1661
|
+
/* @__PURE__ */ jsx(Button, { leftSection: /* @__PURE__ */ jsx(IconCheck, { size: 14 }), loading: mutation.isPending, onClick: handleSave, children: "Save feature access" })
|
|
1518
1662
|
] })
|
|
1519
|
-
] })
|
|
1663
|
+
] });
|
|
1520
1664
|
}
|
|
1521
1665
|
function transformMemberForModal(member) {
|
|
1522
1666
|
const firstName = member.user?.firstName || "";
|
|
@@ -1534,8 +1678,10 @@ function OrgMembersList({ orgId }) {
|
|
|
1534
1678
|
const { data: members, isLoading, error } = useOrganizationMembers(orgId);
|
|
1535
1679
|
const [selectedMember, setSelectedMember] = useState(null);
|
|
1536
1680
|
const [modalOpened, setModalOpened] = useState(false);
|
|
1537
|
-
const
|
|
1681
|
+
const [defaultTab, setDefaultTab] = useState("roles");
|
|
1682
|
+
const openModal2 = (member, tab) => {
|
|
1538
1683
|
setSelectedMember(member);
|
|
1684
|
+
setDefaultTab(tab);
|
|
1539
1685
|
setModalOpened(true);
|
|
1540
1686
|
};
|
|
1541
1687
|
const handleModalClose = () => {
|
|
@@ -1570,28 +1716,27 @@ function OrgMembersList({ orgId }) {
|
|
|
1570
1716
|
return /* @__PURE__ */ jsxs(Table.Tr, { children: [
|
|
1571
1717
|
/* @__PURE__ */ jsx(Table.Td, { children: /* @__PURE__ */ jsx(Text, { fw: 500, size: "sm", children: displayName }) }),
|
|
1572
1718
|
/* @__PURE__ */ jsx(Table.Td, { children: /* @__PURE__ */ jsx(Text, { size: "sm", c: "dimmed", children: member.user?.email || "Unknown" }) }),
|
|
1573
|
-
/* @__PURE__ */ jsx(Table.Td, { children: /* @__PURE__ */ jsx(
|
|
1574
|
-
|
|
1575
|
-
/* @__PURE__ */ jsx(Table.Td, { children: /* @__PURE__ */ jsx(Group, { gap: "xs", children: /* @__PURE__ */ jsx(
|
|
1576
|
-
ActionIcon,
|
|
1719
|
+
/* @__PURE__ */ jsx(Table.Td, { children: /* @__PURE__ */ jsx(
|
|
1720
|
+
RoleBadge,
|
|
1577
1721
|
{
|
|
1578
|
-
|
|
1579
|
-
|
|
1580
|
-
|
|
1581
|
-
onClick: () => handleConfigClick(member),
|
|
1582
|
-
title: "Configure member access",
|
|
1583
|
-
children: /* @__PURE__ */ jsx(IconSettings, { size: 14 })
|
|
1722
|
+
slug: member.role.slug,
|
|
1723
|
+
name: member.role.slug.charAt(0).toUpperCase() + member.role.slug.slice(1),
|
|
1724
|
+
isSystem: true
|
|
1584
1725
|
}
|
|
1585
|
-
) })
|
|
1726
|
+
) }),
|
|
1727
|
+
/* @__PURE__ */ jsx(Table.Td, { children: /* @__PURE__ */ jsx(MembershipStatusBadge, { status: member.status }) }),
|
|
1728
|
+
/* @__PURE__ */ jsx(Table.Td, { children: /* @__PURE__ */ jsx(Tooltip, { label: "Edit member access", withArrow: true, children: /* @__PURE__ */ jsx(ActionIcon, { variant: "light", size: "sm", color: "gray", onClick: () => openModal2(member, "roles"), children: /* @__PURE__ */ jsx(IconPencil, { size: 14 }) }) }) })
|
|
1586
1729
|
] }, member.id);
|
|
1587
1730
|
}) })
|
|
1588
1731
|
] }) }),
|
|
1589
1732
|
/* @__PURE__ */ jsx(
|
|
1590
|
-
|
|
1733
|
+
MemberAccessModal,
|
|
1591
1734
|
{
|
|
1592
1735
|
opened: modalOpened,
|
|
1593
1736
|
onClose: handleModalClose,
|
|
1594
|
-
|
|
1737
|
+
orgId,
|
|
1738
|
+
member: selectedMember ? transformMemberForModal(selectedMember) : null,
|
|
1739
|
+
defaultTab
|
|
1595
1740
|
}
|
|
1596
1741
|
)
|
|
1597
1742
|
] });
|
|
@@ -1660,6 +1805,60 @@ function OrganizationSettings({ user, currentMembership, isOrgAdmin }) {
|
|
|
1660
1805
|
] }) })
|
|
1661
1806
|
] });
|
|
1662
1807
|
}
|
|
1808
|
+
function MemberConfigModal({ opened, onClose, member }) {
|
|
1809
|
+
const [localConfig, setLocalConfig] = useState(void 0);
|
|
1810
|
+
const mutation = useUpdateMemberConfig();
|
|
1811
|
+
useEffect(() => {
|
|
1812
|
+
if (member) {
|
|
1813
|
+
setLocalConfig(member.config);
|
|
1814
|
+
}
|
|
1815
|
+
}, [member]);
|
|
1816
|
+
useEffect(() => {
|
|
1817
|
+
if (!opened) {
|
|
1818
|
+
setLocalConfig(void 0);
|
|
1819
|
+
}
|
|
1820
|
+
}, [opened]);
|
|
1821
|
+
if (!member) return null;
|
|
1822
|
+
const handleSave = async () => {
|
|
1823
|
+
if (!localConfig) {
|
|
1824
|
+
onClose();
|
|
1825
|
+
return;
|
|
1826
|
+
}
|
|
1827
|
+
try {
|
|
1828
|
+
await mutation.mutateAsync({
|
|
1829
|
+
membershipId: member.id,
|
|
1830
|
+
config: localConfig
|
|
1831
|
+
});
|
|
1832
|
+
onClose();
|
|
1833
|
+
} catch {
|
|
1834
|
+
}
|
|
1835
|
+
};
|
|
1836
|
+
const handleClose = () => {
|
|
1837
|
+
if (!mutation.isPending) {
|
|
1838
|
+
onClose();
|
|
1839
|
+
}
|
|
1840
|
+
};
|
|
1841
|
+
return /* @__PURE__ */ jsx(CustomModal, { opened, onClose: handleClose, size: "md", loading: mutation.isPending, children: /* @__PURE__ */ jsxs(Stack, { children: [
|
|
1842
|
+
/* @__PURE__ */ jsx(Title, { order: 3, children: "Configure Member Access" }),
|
|
1843
|
+
/* @__PURE__ */ jsxs(Group, { gap: "xs", children: [
|
|
1844
|
+
/* @__PURE__ */ jsx(Text, { fw: 500, children: member.name }),
|
|
1845
|
+
/* @__PURE__ */ jsx(Badge, { variant: "light", size: "sm", children: member.role })
|
|
1846
|
+
] }),
|
|
1847
|
+
/* @__PURE__ */ jsx(Text, { size: "sm", c: "dimmed", children: member.email }),
|
|
1848
|
+
/* @__PURE__ */ jsx(
|
|
1849
|
+
MembershipFeaturePanel,
|
|
1850
|
+
{
|
|
1851
|
+
currentConfig: localConfig ?? member.config,
|
|
1852
|
+
onConfigChange: (newConfig) => setLocalConfig(newConfig),
|
|
1853
|
+
disabled: mutation.isPending
|
|
1854
|
+
}
|
|
1855
|
+
),
|
|
1856
|
+
/* @__PURE__ */ jsxs(Group, { justify: "space-between", mt: "md", children: [
|
|
1857
|
+
/* @__PURE__ */ jsx(Button, { variant: "light", onClick: handleClose, disabled: mutation.isPending, children: "Cancel" }),
|
|
1858
|
+
/* @__PURE__ */ jsx(Button, { onClick: handleSave, loading: mutation.isPending, children: "Save Changes" })
|
|
1859
|
+
] })
|
|
1860
|
+
] }) });
|
|
1861
|
+
}
|
|
1663
1862
|
function useOAuthFlow({ apiUrl }) {
|
|
1664
1863
|
const [isAuthorizing, setIsAuthorizing] = useState(false);
|
|
1665
1864
|
const [error, setError] = useState(null);
|
|
@@ -1983,4 +2182,4 @@ var settingsManifest = {
|
|
|
1983
2182
|
icon: IconSettings
|
|
1984
2183
|
};
|
|
1985
2184
|
|
|
1986
|
-
export { AccountSettings, AppearanceSettings, CreateCredentialModal, CreateWebhookEndpointModal, CredentialList, CredentialSettings, EditCredentialModal, EditWebhookEndpointModal, MemberConfigModal, MembershipFeaturePanel, MembershipStatusBadge, OAuthConnectModal, OAuthIntegrationsCard, OrgMembersList, OrganizationMembershipsList, OrganizationSettings, WebhookEndpointList, WebhookEndpointSettings, WebhookUrlDisplayModal, settingsManifest };
|
|
2185
|
+
export { AccountSettings, AppearanceSettings, CreateCredentialModal, CreateWebhookEndpointModal, CredentialList, CredentialSettings, EditCredentialModal, EditWebhookEndpointModal, MemberAccessModal, MemberConfigModal, MembershipFeaturePanel, MembershipStatusBadge, OAuthConnectModal, OAuthIntegrationsCard, OrgMembersList, OrganizationMembershipsList, OrganizationSettings, WebhookEndpointList, WebhookEndpointSettings, WebhookUrlDisplayModal, settingsManifest, showAuthError };
|
|
@@ -3,10 +3,10 @@ import { TableSelectionToolbar, SortableHeader } from './chunk-TUMSNGTX.js';
|
|
|
3
3
|
import { SubshellNavItem } from './chunk-CEWTOKE7.js';
|
|
4
4
|
import { SubshellSidebarSection } from './chunk-IIMU5YAJ.js';
|
|
5
5
|
import { FilterBar } from './chunk-PDHTXPSF.js';
|
|
6
|
-
import { CustomModal } from './chunk-
|
|
7
|
-
import { acquisitionListKeys, useListsTelemetry, useLists, useCreateList, useTableSort, sortData, usePaginationState, useTableSelection, useList, useListProgress, useListExecutions, useContacts, useCompanies, useCompanyFacets, useDeleteCompanies, useDeleteContacts } from './chunk-
|
|
6
|
+
import { CustomModal } from './chunk-KVJ3LFH2.js';
|
|
7
|
+
import { acquisitionListKeys, useListsTelemetry, useLists, useCreateList, useTableSort, sortData, usePaginationState, useTableSelection, useList, useListProgress, useListExecutions, useContacts, useCompanies, useCompanyFacets, useDeleteCompanies, useDeleteContacts } from './chunk-GUJUK6EH.js';
|
|
8
8
|
import { showApiErrorNotification, showSuccessNotification } from './chunk-Z6FAH4XV.js';
|
|
9
|
-
import { SubshellContentContainer } from './chunk-
|
|
9
|
+
import { SubshellContentContainer } from './chunk-TKAYX2SP.js';
|
|
10
10
|
import { PageTitleCaption, CenteredErrorState, StatCard, CardHeader, EmptyState } from './chunk-XUYBOO32.js';
|
|
11
11
|
import { useRouterContext } from './chunk-Q7DJKLEN.js';
|
|
12
12
|
import { useElevasisServices } from './chunk-IRW7JMQ4.js';
|
|
@@ -1,10 +1,16 @@
|
|
|
1
1
|
import { useUserProfile } from './chunk-QHSW4WHM.js';
|
|
2
2
|
import { useAuthContext } from './chunk-BRJ3QZ4E.js';
|
|
3
3
|
import { useState, useRef, useEffect, useCallback } from 'react';
|
|
4
|
-
import { Button, Loader, Menu, Text
|
|
5
|
-
import { IconChevronDown, IconBuilding, IconCheck } from '@tabler/icons-react';
|
|
4
|
+
import { Badge, Group, Button, Loader, Menu, Text } from '@mantine/core';
|
|
5
|
+
import { IconLock, IconChevronDown, IconBuilding, IconCheck } from '@tabler/icons-react';
|
|
6
6
|
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
7
7
|
|
|
8
|
+
function RoleBadge({ name, isSystem }) {
|
|
9
|
+
return /* @__PURE__ */ jsx(Badge, { color: isSystem ? "gray" : "primary", variant: "light", children: /* @__PURE__ */ jsxs(Group, { gap: 4, wrap: "nowrap", children: [
|
|
10
|
+
isSystem && /* @__PURE__ */ jsx(IconLock, { size: 10 }),
|
|
11
|
+
name
|
|
12
|
+
] }) });
|
|
13
|
+
}
|
|
8
14
|
function OrganizationSwitcher({
|
|
9
15
|
currentOrganization,
|
|
10
16
|
memberships,
|
|
@@ -64,7 +70,14 @@ function OrganizationSwitcher({
|
|
|
64
70
|
Menu.Item,
|
|
65
71
|
{
|
|
66
72
|
leftSection: /* @__PURE__ */ jsx(IconBuilding, { size: 14 }),
|
|
67
|
-
rightSection: /* @__PURE__ */ jsx(
|
|
73
|
+
rightSection: /* @__PURE__ */ jsx(
|
|
74
|
+
RoleBadge,
|
|
75
|
+
{
|
|
76
|
+
slug: membership.role.slug,
|
|
77
|
+
name: membership.role.slug.charAt(0).toUpperCase() + membership.role.slug.slice(1),
|
|
78
|
+
isSystem: true
|
|
79
|
+
}
|
|
80
|
+
),
|
|
68
81
|
onClick: () => {
|
|
69
82
|
const workosOrgId = membership.organization?.workos_org_id;
|
|
70
83
|
if (!workosOrgId) {
|
|
@@ -84,7 +97,14 @@ function OrganizationSwitcher({
|
|
|
84
97
|
Menu.Item,
|
|
85
98
|
{
|
|
86
99
|
leftSection: /* @__PURE__ */ jsx(IconBuilding, { size: 14 }),
|
|
87
|
-
rightSection: /* @__PURE__ */ jsx(
|
|
100
|
+
rightSection: /* @__PURE__ */ jsx(
|
|
101
|
+
RoleBadge,
|
|
102
|
+
{
|
|
103
|
+
slug: membership.role.slug,
|
|
104
|
+
name: membership.role.slug.charAt(0).toUpperCase() + membership.role.slug.slice(1),
|
|
105
|
+
isSystem: true
|
|
106
|
+
}
|
|
107
|
+
),
|
|
88
108
|
onClick: () => {
|
|
89
109
|
const workosOrgId = membership.organization?.workos_org_id;
|
|
90
110
|
if (!workosOrgId) {
|
|
@@ -346,4 +366,4 @@ function createUseOrgInitialization(useOrganizations, useApiClient) {
|
|
|
346
366
|
};
|
|
347
367
|
}
|
|
348
368
|
|
|
349
|
-
export { OrganizationSwitcher, createOrganizationsSlice, createUseOrgInitialization, createUseOrganizations };
|
|
369
|
+
export { OrganizationSwitcher, RoleBadge, createOrganizationsSlice, createUseOrgInitialization, createUseOrganizations };
|