@raystack/frontier 0.115.0 → 0.116.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/admin/dist/index.js +1180 -1184
- package/admin/dist/index.mjs +1076 -1080
- package/client/dist/index.d.ts +5 -1
- package/client/dist/index.js +1451 -1303
- package/client/dist/index.mjs +842 -693
- package/package.json +2 -2
package/admin/dist/index.js
CHANGED
|
@@ -105,8 +105,8 @@ function convertBillingAddressToString(address) {
|
|
|
105
105
|
// admin/views/roles/columns.tsx
|
|
106
106
|
var import_apsara = require("@raystack/apsara");
|
|
107
107
|
|
|
108
|
-
// esbuild-css-modules-plugin-namespace:/tmp/tmp-
|
|
109
|
-
var digest = "
|
|
108
|
+
// esbuild-css-modules-plugin-namespace:/tmp/tmp-2174-ce1XouvkIFsu/sdk/admin/views/roles/roles.module.css.js
|
|
109
|
+
var digest = "d3f598130cd9c77f88bce8bdc8b0ec29435b4018e6535f2657690aecd02fa294";
|
|
110
110
|
var css = `._tableRoot_1d549_1 {
|
|
111
111
|
width: 100%;
|
|
112
112
|
}
|
|
@@ -573,8 +573,8 @@ var UploadIcon = /* @__PURE__ */ (0, import_react.forwardRef)(function(_ref, for
|
|
|
573
573
|
// admin/components/PageHeader.tsx
|
|
574
574
|
var import_apsara2 = require("@raystack/apsara");
|
|
575
575
|
|
|
576
|
-
// esbuild-css-modules-plugin-namespace:/tmp/tmp-
|
|
577
|
-
var digest2 = "
|
|
576
|
+
// esbuild-css-modules-plugin-namespace:/tmp/tmp-2174-x448Q9kM6UBu/sdk/admin/components/page-header.module.css.js
|
|
577
|
+
var digest2 = "5aee4be5085091e9e4f844edbd79b04903b46dec26e9a56e72aabee2c371f315";
|
|
578
578
|
var css2 = `._breadcrumb_1kaun_1 {
|
|
579
579
|
list-style: none;
|
|
580
580
|
padding: 0;
|
|
@@ -696,8 +696,8 @@ function PageTitle({ title, appName }) {
|
|
|
696
696
|
return null;
|
|
697
697
|
}
|
|
698
698
|
|
|
699
|
-
// esbuild-css-modules-plugin-namespace:/tmp/tmp-
|
|
700
|
-
var digest3 = "
|
|
699
|
+
// esbuild-css-modules-plugin-namespace:/tmp/tmp-2174-wnexKpYz7VFe/sdk/admin/views/roles/roles.module.css.js
|
|
700
|
+
var digest3 = "87571efdf92176305356d77f654ddfcba7ddbadfd55c0776202dee3546ba93af";
|
|
701
701
|
var css3 = `._tableRoot_1d549_1 {
|
|
702
702
|
width: 100%;
|
|
703
703
|
}
|
|
@@ -884,13 +884,12 @@ var noDataChildren = /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_apsara5
|
|
|
884
884
|
|
|
885
885
|
// admin/views/invoices/index.tsx
|
|
886
886
|
var import_apsara8 = require("@raystack/apsara");
|
|
887
|
-
var import_react6 = require("react");
|
|
888
887
|
|
|
889
888
|
// admin/views/invoices/navbar.tsx
|
|
890
889
|
var import_apsara6 = require("@raystack/apsara");
|
|
891
890
|
|
|
892
|
-
// esbuild-css-modules-plugin-namespace:/tmp/tmp-
|
|
893
|
-
var digest4 = "
|
|
891
|
+
// esbuild-css-modules-plugin-namespace:/tmp/tmp-2174-YX1wGgklLgdY/sdk/admin/components/navbar.module.css.js
|
|
892
|
+
var digest4 = "56e50c7959ce4b05b481fe6ef4414b8bbc90943c69b3352928b81f0ee070e4cf";
|
|
894
893
|
var css4 = `._navbar_641ya_1 {
|
|
895
894
|
padding: var(--rs-space-4) var(--rs-space-7);
|
|
896
895
|
border-bottom: 0.5px solid var(--rs-color-border-base-primary);
|
|
@@ -984,8 +983,8 @@ var InvoicesNavabar = ({ searchQuery }) => {
|
|
|
984
983
|
] });
|
|
985
984
|
};
|
|
986
985
|
|
|
987
|
-
// esbuild-css-modules-plugin-namespace:/tmp/tmp-
|
|
988
|
-
var digest5 = "
|
|
986
|
+
// esbuild-css-modules-plugin-namespace:/tmp/tmp-2174-vKvg0qUCzRQ2/sdk/admin/views/invoices/invoices.module.css.js
|
|
987
|
+
var digest5 = "a5c21255352a28102e29ea4aa3eac71e34a2b7025b1c09d5b5be773b8fe1f97c";
|
|
989
988
|
var css5 = `._table_xk3nj_1 {
|
|
990
989
|
height: auto;
|
|
991
990
|
}
|
|
@@ -1066,8 +1065,8 @@ function formatInviteExpiry(expiresAt) {
|
|
|
1066
1065
|
};
|
|
1067
1066
|
}
|
|
1068
1067
|
|
|
1069
|
-
// esbuild-css-modules-plugin-namespace:/tmp/tmp-
|
|
1070
|
-
var digest6 = "
|
|
1068
|
+
// esbuild-css-modules-plugin-namespace:/tmp/tmp-2174-yD0vO6cKJHSb/sdk/admin/views/invoices/invoices.module.css.js
|
|
1069
|
+
var digest6 = "6824312eda9fbabe04ff0682a4494d9b7c95b89dc4de274e25ea624ca81b2983";
|
|
1071
1070
|
var css6 = `._table_xk3nj_1 {
|
|
1072
1071
|
height: auto;
|
|
1073
1072
|
}
|
|
@@ -1166,8 +1165,8 @@ var getColumns2 = ({ t }) => {
|
|
|
1166
1165
|
};
|
|
1167
1166
|
|
|
1168
1167
|
// admin/views/invoices/index.tsx
|
|
1169
|
-
var
|
|
1170
|
-
var
|
|
1168
|
+
var import_connect_query3 = require("@connectrpc/connect-query");
|
|
1169
|
+
var import_frontier4 = require("@raystack/proton/frontier");
|
|
1171
1170
|
|
|
1172
1171
|
// utils/connect-pagination.ts
|
|
1173
1172
|
var DEFAULT_PAGE_SIZE = 50;
|
|
@@ -1207,6 +1206,113 @@ function getGroupCountMapFromFirstPage(infiniteData) {
|
|
|
1207
1206
|
return { [groupKey]: groupCount };
|
|
1208
1207
|
}
|
|
1209
1208
|
|
|
1209
|
+
// shared/terminology.tsx
|
|
1210
|
+
var import_react5 = require("react");
|
|
1211
|
+
var import_jsx_runtime9 = require("react/jsx-runtime");
|
|
1212
|
+
var applyCase = (text, caseType) => {
|
|
1213
|
+
switch (caseType) {
|
|
1214
|
+
case "lower":
|
|
1215
|
+
return text.toLowerCase();
|
|
1216
|
+
case "upper":
|
|
1217
|
+
return text.toUpperCase();
|
|
1218
|
+
case "capital":
|
|
1219
|
+
return text.charAt(0).toUpperCase() + text.slice(1);
|
|
1220
|
+
default:
|
|
1221
|
+
return text;
|
|
1222
|
+
}
|
|
1223
|
+
};
|
|
1224
|
+
var createEntity = (singular, plural) => {
|
|
1225
|
+
return ({
|
|
1226
|
+
plural: isPlural = false,
|
|
1227
|
+
case: caseType
|
|
1228
|
+
} = {}) => {
|
|
1229
|
+
const text = isPlural ? plural : singular;
|
|
1230
|
+
return applyCase(text, caseType);
|
|
1231
|
+
};
|
|
1232
|
+
};
|
|
1233
|
+
var DEFAULT_TERMINOLOGY = {
|
|
1234
|
+
organization: { singular: "Organization", plural: "Organizations" },
|
|
1235
|
+
project: { singular: "Project", plural: "Projects" },
|
|
1236
|
+
team: { singular: "Team", plural: "Teams" },
|
|
1237
|
+
member: { singular: "Member", plural: "Members" },
|
|
1238
|
+
user: { singular: "User", plural: "Users" },
|
|
1239
|
+
appName: "Frontier"
|
|
1240
|
+
};
|
|
1241
|
+
function createTerminologyMap(terminology, defaults = DEFAULT_TERMINOLOGY) {
|
|
1242
|
+
const t = terminology || defaults;
|
|
1243
|
+
return {
|
|
1244
|
+
organization: createEntity(
|
|
1245
|
+
t.organization?.singular || defaults.organization.singular,
|
|
1246
|
+
t.organization?.plural || defaults.organization.plural
|
|
1247
|
+
),
|
|
1248
|
+
project: createEntity(
|
|
1249
|
+
t.project?.singular || defaults.project.singular,
|
|
1250
|
+
t.project?.plural || defaults.project.plural
|
|
1251
|
+
),
|
|
1252
|
+
team: createEntity(
|
|
1253
|
+
t.team?.singular || defaults.team.singular,
|
|
1254
|
+
t.team?.plural || defaults.team.plural
|
|
1255
|
+
),
|
|
1256
|
+
member: createEntity(
|
|
1257
|
+
t.member?.singular || defaults.member.singular,
|
|
1258
|
+
t.member?.plural || defaults.member.plural
|
|
1259
|
+
),
|
|
1260
|
+
user: createEntity(
|
|
1261
|
+
t.user?.singular || defaults.user.singular,
|
|
1262
|
+
t.user?.plural || defaults.user.plural
|
|
1263
|
+
),
|
|
1264
|
+
appName: createEntity(
|
|
1265
|
+
t.appName || defaults.appName,
|
|
1266
|
+
t.appName || defaults.appName
|
|
1267
|
+
)
|
|
1268
|
+
};
|
|
1269
|
+
}
|
|
1270
|
+
var TerminologyContext = (0, import_react5.createContext)(
|
|
1271
|
+
createTerminologyMap()
|
|
1272
|
+
);
|
|
1273
|
+
var TerminologyProvider = ({
|
|
1274
|
+
children,
|
|
1275
|
+
terminology,
|
|
1276
|
+
defaults
|
|
1277
|
+
}) => {
|
|
1278
|
+
const map = (0, import_react5.useMemo)(
|
|
1279
|
+
() => createTerminologyMap(terminology, defaults),
|
|
1280
|
+
[terminology, defaults]
|
|
1281
|
+
);
|
|
1282
|
+
return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(TerminologyContext.Provider, { value: map, children });
|
|
1283
|
+
};
|
|
1284
|
+
var useTerminology = () => {
|
|
1285
|
+
return (0, import_react5.useContext)(TerminologyContext);
|
|
1286
|
+
};
|
|
1287
|
+
|
|
1288
|
+
// admin/hooks/useLoadMore.ts
|
|
1289
|
+
var import_react6 = require("react");
|
|
1290
|
+
var useLoadMore = ({
|
|
1291
|
+
hasNextPage,
|
|
1292
|
+
isFetchingNextPage,
|
|
1293
|
+
fetchNextPage,
|
|
1294
|
+
isError,
|
|
1295
|
+
label
|
|
1296
|
+
}) => {
|
|
1297
|
+
const isLoadingMoreRef = (0, import_react6.useRef)(false);
|
|
1298
|
+
return (0, import_react6.useCallback)(async () => {
|
|
1299
|
+
if (!hasNextPage || isFetchingNextPage || isError || isLoadingMoreRef.current) {
|
|
1300
|
+
return;
|
|
1301
|
+
}
|
|
1302
|
+
isLoadingMoreRef.current = true;
|
|
1303
|
+
try {
|
|
1304
|
+
await fetchNextPage();
|
|
1305
|
+
} catch (error) {
|
|
1306
|
+
console.error(`Error loading more ${label}:`, error);
|
|
1307
|
+
} finally {
|
|
1308
|
+
isLoadingMoreRef.current = false;
|
|
1309
|
+
}
|
|
1310
|
+
}, [hasNextPage, isFetchingNextPage, isError, fetchNextPage, label]);
|
|
1311
|
+
};
|
|
1312
|
+
|
|
1313
|
+
// admin/hooks/useServerTableQuery.ts
|
|
1314
|
+
var import_react8 = require("react");
|
|
1315
|
+
|
|
1210
1316
|
// utils/transform-query.ts
|
|
1211
1317
|
var import_frontier2 = require("@raystack/proton/frontier");
|
|
1212
1318
|
var import_protobuf = require("@bufbuild/protobuf");
|
|
@@ -1300,84 +1406,90 @@ function transformDataTableQueryToRQLRequest(query, options = {}) {
|
|
|
1300
1406
|
return rqlRequest;
|
|
1301
1407
|
}
|
|
1302
1408
|
|
|
1303
|
-
//
|
|
1304
|
-
var
|
|
1305
|
-
var
|
|
1306
|
-
|
|
1307
|
-
|
|
1308
|
-
|
|
1309
|
-
|
|
1310
|
-
|
|
1311
|
-
|
|
1312
|
-
|
|
1313
|
-
|
|
1409
|
+
// hooks/index.ts
|
|
1410
|
+
var import_connect_query2 = require("@connectrpc/connect-query");
|
|
1411
|
+
var import_connect2 = require("@connectrpc/connect");
|
|
1412
|
+
|
|
1413
|
+
// utils/error.ts
|
|
1414
|
+
var import_connect = require("@connectrpc/connect");
|
|
1415
|
+
var DEFAULT_ERROR_MESSAGE = "Something went wrong";
|
|
1416
|
+
function handleConnectError(error, handlers) {
|
|
1417
|
+
const connectError = error instanceof import_connect.ConnectError ? error : new import_connect.ConnectError(
|
|
1418
|
+
typeof error === "string" ? error : error instanceof Error ? error.message : DEFAULT_ERROR_MESSAGE
|
|
1419
|
+
);
|
|
1420
|
+
const defaultHandler = handlers?.Default ?? ((err) => console.error(err.message));
|
|
1421
|
+
switch (connectError.code) {
|
|
1422
|
+
case import_connect.Code.AlreadyExists:
|
|
1423
|
+
handlers?.AlreadyExists ? handlers.AlreadyExists(connectError) : defaultHandler(connectError);
|
|
1424
|
+
break;
|
|
1425
|
+
case import_connect.Code.InvalidArgument:
|
|
1426
|
+
handlers?.InvalidArgument ? handlers.InvalidArgument(connectError) : defaultHandler(connectError);
|
|
1427
|
+
break;
|
|
1428
|
+
case import_connect.Code.PermissionDenied:
|
|
1429
|
+
handlers?.PermissionDenied ? handlers.PermissionDenied(connectError) : defaultHandler(connectError);
|
|
1430
|
+
break;
|
|
1431
|
+
case import_connect.Code.NotFound:
|
|
1432
|
+
handlers?.NotFound ? handlers.NotFound(connectError) : defaultHandler(connectError);
|
|
1433
|
+
break;
|
|
1434
|
+
case import_connect.Code.FailedPrecondition:
|
|
1435
|
+
handlers?.FailedPrecondition ? handlers.FailedPrecondition(connectError) : defaultHandler(connectError);
|
|
1436
|
+
break;
|
|
1314
1437
|
default:
|
|
1315
|
-
|
|
1438
|
+
defaultHandler(connectError);
|
|
1316
1439
|
}
|
|
1317
|
-
};
|
|
1318
|
-
var createEntity = (singular, plural) => {
|
|
1319
|
-
return ({
|
|
1320
|
-
plural: isPlural = false,
|
|
1321
|
-
case: caseType
|
|
1322
|
-
} = {}) => {
|
|
1323
|
-
const text = isPlural ? plural : singular;
|
|
1324
|
-
return applyCase(text, caseType);
|
|
1325
|
-
};
|
|
1326
|
-
};
|
|
1327
|
-
var DEFAULT_TERMINOLOGY = {
|
|
1328
|
-
organization: { singular: "Organization", plural: "Organizations" },
|
|
1329
|
-
project: { singular: "Project", plural: "Projects" },
|
|
1330
|
-
team: { singular: "Team", plural: "Teams" },
|
|
1331
|
-
member: { singular: "Member", plural: "Members" },
|
|
1332
|
-
user: { singular: "User", plural: "Users" },
|
|
1333
|
-
appName: "Frontier"
|
|
1334
|
-
};
|
|
1335
|
-
function createTerminologyMap(terminology, defaults = DEFAULT_TERMINOLOGY) {
|
|
1336
|
-
const t = terminology || defaults;
|
|
1337
|
-
return {
|
|
1338
|
-
organization: createEntity(
|
|
1339
|
-
t.organization?.singular || defaults.organization.singular,
|
|
1340
|
-
t.organization?.plural || defaults.organization.plural
|
|
1341
|
-
),
|
|
1342
|
-
project: createEntity(
|
|
1343
|
-
t.project?.singular || defaults.project.singular,
|
|
1344
|
-
t.project?.plural || defaults.project.plural
|
|
1345
|
-
),
|
|
1346
|
-
team: createEntity(
|
|
1347
|
-
t.team?.singular || defaults.team.singular,
|
|
1348
|
-
t.team?.plural || defaults.team.plural
|
|
1349
|
-
),
|
|
1350
|
-
member: createEntity(
|
|
1351
|
-
t.member?.singular || defaults.member.singular,
|
|
1352
|
-
t.member?.plural || defaults.member.plural
|
|
1353
|
-
),
|
|
1354
|
-
user: createEntity(
|
|
1355
|
-
t.user?.singular || defaults.user.singular,
|
|
1356
|
-
t.user?.plural || defaults.user.plural
|
|
1357
|
-
),
|
|
1358
|
-
appName: createEntity(
|
|
1359
|
-
t.appName || defaults.appName,
|
|
1360
|
-
t.appName || defaults.appName
|
|
1361
|
-
)
|
|
1362
|
-
};
|
|
1363
1440
|
}
|
|
1364
|
-
|
|
1365
|
-
|
|
1366
|
-
);
|
|
1367
|
-
var
|
|
1368
|
-
|
|
1369
|
-
|
|
1370
|
-
|
|
1371
|
-
|
|
1372
|
-
|
|
1373
|
-
|
|
1374
|
-
|
|
1375
|
-
|
|
1376
|
-
|
|
1377
|
-
};
|
|
1378
|
-
|
|
1379
|
-
|
|
1380
|
-
|
|
1441
|
+
|
|
1442
|
+
// hooks/index.ts
|
|
1443
|
+
var import_frontier3 = require("@raystack/proton/frontier");
|
|
1444
|
+
var import_react_query = require("@tanstack/react-query");
|
|
1445
|
+
var import_protobuf2 = require("@bufbuild/protobuf");
|
|
1446
|
+
|
|
1447
|
+
// hooks/useDebouncedValue.ts
|
|
1448
|
+
var import_react7 = require("react");
|
|
1449
|
+
function useDebouncedValue(value, delay) {
|
|
1450
|
+
const [debouncedValue, setDebouncedValue] = (0, import_react7.useState)(value);
|
|
1451
|
+
(0, import_react7.useEffect)(() => {
|
|
1452
|
+
const timer = setTimeout(() => setDebouncedValue(value), delay);
|
|
1453
|
+
return () => clearTimeout(timer);
|
|
1454
|
+
}, [value, delay]);
|
|
1455
|
+
return debouncedValue;
|
|
1456
|
+
}
|
|
1457
|
+
|
|
1458
|
+
// admin/hooks/useServerTableQuery.ts
|
|
1459
|
+
function useServerTableQuery({
|
|
1460
|
+
defaultSort,
|
|
1461
|
+
transformOptions,
|
|
1462
|
+
search,
|
|
1463
|
+
mapQuery,
|
|
1464
|
+
debounceMs = 200
|
|
1465
|
+
} = {}) {
|
|
1466
|
+
const [tableQuery, setTableQuery] = (0, import_react8.useState)(() => ({
|
|
1467
|
+
offset: 0,
|
|
1468
|
+
limit: DEFAULT_PAGE_SIZE,
|
|
1469
|
+
sort: defaultSort ? [defaultSort] : []
|
|
1470
|
+
}));
|
|
1471
|
+
const transformOptionsRef = (0, import_react8.useRef)(transformOptions);
|
|
1472
|
+
transformOptionsRef.current = transformOptions;
|
|
1473
|
+
const mapQueryRef = (0, import_react8.useRef)(mapQuery);
|
|
1474
|
+
mapQueryRef.current = mapQuery;
|
|
1475
|
+
const computedQuery = (0, import_react8.useMemo)(() => {
|
|
1476
|
+
const mapped = mapQueryRef.current ? mapQueryRef.current(tableQuery) : tableQuery;
|
|
1477
|
+
const rql = transformDataTableQueryToRQLRequest(
|
|
1478
|
+
mapped,
|
|
1479
|
+
transformOptionsRef.current
|
|
1480
|
+
);
|
|
1481
|
+
return search === void 0 ? rql : { ...rql, search };
|
|
1482
|
+
}, [tableQuery, search]);
|
|
1483
|
+
const rqlQuery = useDebouncedValue(computedQuery, debounceMs);
|
|
1484
|
+
const onTableQueryChange = (0, import_react8.useCallback)((query) => {
|
|
1485
|
+
setTableQuery({
|
|
1486
|
+
...query,
|
|
1487
|
+
offset: 0,
|
|
1488
|
+
limit: query.limit || DEFAULT_PAGE_SIZE
|
|
1489
|
+
});
|
|
1490
|
+
}, []);
|
|
1491
|
+
return { tableQuery, rqlQuery, onTableQueryChange };
|
|
1492
|
+
}
|
|
1381
1493
|
|
|
1382
1494
|
// admin/views/invoices/index.tsx
|
|
1383
1495
|
var import_jsx_runtime10 = require("react/jsx-runtime");
|
|
@@ -1397,16 +1509,18 @@ var NoInvoices = () => {
|
|
|
1397
1509
|
);
|
|
1398
1510
|
};
|
|
1399
1511
|
var DEFAULT_SORT = { name: "createdAt", order: "desc" };
|
|
1400
|
-
var INITIAL_QUERY = {
|
|
1401
|
-
offset: 0,
|
|
1402
|
-
limit: DEFAULT_PAGE_SIZE
|
|
1403
|
-
};
|
|
1404
1512
|
function InvoicesView({ appName } = {}) {
|
|
1405
1513
|
const t = useTerminology();
|
|
1406
|
-
const
|
|
1407
|
-
|
|
1408
|
-
|
|
1409
|
-
|
|
1514
|
+
const {
|
|
1515
|
+
tableQuery,
|
|
1516
|
+
rqlQuery: query,
|
|
1517
|
+
onTableQueryChange
|
|
1518
|
+
} = useServerTableQuery({
|
|
1519
|
+
defaultSort: DEFAULT_SORT,
|
|
1520
|
+
transformOptions: {
|
|
1521
|
+
fieldNameMapping: {
|
|
1522
|
+
createdAt: "created_at"
|
|
1523
|
+
}
|
|
1410
1524
|
}
|
|
1411
1525
|
});
|
|
1412
1526
|
const {
|
|
@@ -1417,8 +1531,8 @@ function InvoicesView({ appName } = {}) {
|
|
|
1417
1531
|
error,
|
|
1418
1532
|
isError,
|
|
1419
1533
|
hasNextPage
|
|
1420
|
-
} = (0,
|
|
1421
|
-
|
|
1534
|
+
} = (0, import_connect_query3.useInfiniteQuery)(
|
|
1535
|
+
import_frontier4.AdminServiceQueries.searchInvoices,
|
|
1422
1536
|
{ query },
|
|
1423
1537
|
{
|
|
1424
1538
|
pageParamKey: "query",
|
|
@@ -1430,22 +1544,13 @@ function InvoicesView({ appName } = {}) {
|
|
|
1430
1544
|
}
|
|
1431
1545
|
);
|
|
1432
1546
|
const data = infiniteData?.pages?.flatMap((page) => page?.invoices || []) || [];
|
|
1433
|
-
const
|
|
1434
|
-
|
|
1435
|
-
|
|
1436
|
-
|
|
1437
|
-
|
|
1438
|
-
|
|
1439
|
-
};
|
|
1440
|
-
const handleLoadMore = async () => {
|
|
1441
|
-
try {
|
|
1442
|
-
if (!hasNextPage)
|
|
1443
|
-
return;
|
|
1444
|
-
await fetchNextPage();
|
|
1445
|
-
} catch (error2) {
|
|
1446
|
-
console.error("Error loading more invoices:", error2);
|
|
1447
|
-
}
|
|
1448
|
-
};
|
|
1547
|
+
const handleLoadMore = useLoadMore({
|
|
1548
|
+
hasNextPage,
|
|
1549
|
+
isFetchingNextPage,
|
|
1550
|
+
isError,
|
|
1551
|
+
fetchNextPage,
|
|
1552
|
+
label: "invoices"
|
|
1553
|
+
});
|
|
1449
1554
|
const columns = getColumns2({ t });
|
|
1450
1555
|
const loading = isLoading || isFetchingNextPage;
|
|
1451
1556
|
if (isError) {
|
|
@@ -1500,15 +1605,15 @@ function InvoicesView({ appName } = {}) {
|
|
|
1500
1605
|
|
|
1501
1606
|
// admin/views/products/index.tsx
|
|
1502
1607
|
var import_apsara11 = require("@raystack/apsara");
|
|
1503
|
-
var
|
|
1504
|
-
var
|
|
1505
|
-
var
|
|
1608
|
+
var import_react9 = require("react");
|
|
1609
|
+
var import_connect_query4 = require("@connectrpc/connect-query");
|
|
1610
|
+
var import_frontier5 = require("@raystack/proton/frontier");
|
|
1506
1611
|
|
|
1507
1612
|
// admin/views/products/columns.tsx
|
|
1508
1613
|
var import_apsara9 = require("@raystack/apsara");
|
|
1509
1614
|
|
|
1510
|
-
// esbuild-css-modules-plugin-namespace:/tmp/tmp-
|
|
1511
|
-
var digest7 = "
|
|
1615
|
+
// esbuild-css-modules-plugin-namespace:/tmp/tmp-2174-hW24N89AmC1M/sdk/admin/views/products/products.module.css.js
|
|
1616
|
+
var digest7 = "b72e42f6c55dafec18976a86b2a3822129eee449f3a14630ec970f6608479c0c";
|
|
1512
1617
|
var css7 = `._tableRoot_3ccjp_1 {
|
|
1513
1618
|
width: 100%;
|
|
1514
1619
|
}
|
|
@@ -1660,8 +1765,8 @@ var getColumns3 = (onNavigateToPrices) => {
|
|
|
1660
1765
|
];
|
|
1661
1766
|
};
|
|
1662
1767
|
|
|
1663
|
-
// esbuild-css-modules-plugin-namespace:/tmp/tmp-
|
|
1664
|
-
var digest8 = "
|
|
1768
|
+
// esbuild-css-modules-plugin-namespace:/tmp/tmp-2174-MNzjZGMPJGH7/sdk/admin/views/products/products.module.css.js
|
|
1769
|
+
var digest8 = "e32077f27158614efe9913e86441920c7ab52260ca084e8099e811e00eb9c59e";
|
|
1665
1770
|
var css8 = `._tableRoot_3ccjp_1 {
|
|
1666
1771
|
width: 100%;
|
|
1667
1772
|
}
|
|
@@ -1718,8 +1823,8 @@ var products_module_css_default2 = { "tableRoot": "_tableRoot_3ccjp_1", "tableWr
|
|
|
1718
1823
|
// admin/views/products/details.tsx
|
|
1719
1824
|
var import_apsara10 = require("@raystack/apsara");
|
|
1720
1825
|
|
|
1721
|
-
// esbuild-css-modules-plugin-namespace:/tmp/tmp-
|
|
1722
|
-
var digest9 = "
|
|
1826
|
+
// esbuild-css-modules-plugin-namespace:/tmp/tmp-2174-bZ68DA6xAsOJ/sdk/admin/views/products/products.module.css.js
|
|
1827
|
+
var digest9 = "6a281f9c6225cc3658a8e8ae46c4415b4a02445142877bfda6b7dc9f060b7c7f";
|
|
1723
1828
|
var css9 = `._tableRoot_3ccjp_1 {
|
|
1724
1829
|
width: 100%;
|
|
1725
1830
|
}
|
|
@@ -1830,13 +1935,13 @@ function ProductsView({
|
|
|
1830
1935
|
isLoading: isProductsLoading,
|
|
1831
1936
|
error,
|
|
1832
1937
|
isError
|
|
1833
|
-
} = (0,
|
|
1938
|
+
} = (0, import_connect_query4.useQuery)(import_frontier5.FrontierServiceQueries.listProducts, {}, {
|
|
1834
1939
|
staleTime: Infinity
|
|
1835
1940
|
});
|
|
1836
1941
|
const products = productsResponse?.products || [];
|
|
1837
1942
|
const productMapById = reduceByKey(products ?? [], "id");
|
|
1838
1943
|
const product = selectedProductId ? productMapById[selectedProductId] ?? null : null;
|
|
1839
|
-
(0,
|
|
1944
|
+
(0, import_react9.useEffect)(() => {
|
|
1840
1945
|
if (selectedProductId && !isProductsLoading && !isError && !product) {
|
|
1841
1946
|
onCloseDetail?.();
|
|
1842
1947
|
}
|
|
@@ -1915,14 +2020,14 @@ var noDataChildren2 = /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
|
1915
2020
|
|
|
1916
2021
|
// admin/views/products/prices/index.tsx
|
|
1917
2022
|
var import_apsara13 = require("@raystack/apsara");
|
|
1918
|
-
var
|
|
1919
|
-
var
|
|
2023
|
+
var import_connect_query5 = require("@connectrpc/connect-query");
|
|
2024
|
+
var import_frontier6 = require("@raystack/proton/frontier");
|
|
1920
2025
|
|
|
1921
2026
|
// admin/views/products/prices/columns.tsx
|
|
1922
2027
|
var import_apsara12 = require("@raystack/apsara");
|
|
1923
2028
|
|
|
1924
|
-
// esbuild-css-modules-plugin-namespace:/tmp/tmp-
|
|
1925
|
-
var digest10 = "
|
|
2029
|
+
// esbuild-css-modules-plugin-namespace:/tmp/tmp-2174-7ZMPghJPFgOz/sdk/admin/views/products/prices/prices.module.css.js
|
|
2030
|
+
var digest10 = "3159226f1878a41869b93ae228af45f6f292ca36dc7152f1cc66871582b594f3";
|
|
1926
2031
|
var css10 = `._first-column_6e56r_1 {
|
|
1927
2032
|
padding-left: var(--rs-space-7);
|
|
1928
2033
|
}
|
|
@@ -2013,8 +2118,8 @@ var getColumns4 = (prices) => {
|
|
|
2013
2118
|
];
|
|
2014
2119
|
};
|
|
2015
2120
|
|
|
2016
|
-
// esbuild-css-modules-plugin-namespace:/tmp/tmp-
|
|
2017
|
-
var digest11 = "
|
|
2121
|
+
// esbuild-css-modules-plugin-namespace:/tmp/tmp-2174-oqwOiMqiWJyi/sdk/admin/views/products/products.module.css.js
|
|
2122
|
+
var digest11 = "577a5abf5dfa4412838cbad32bfb807305e75bb488819c4795ed9aa9ebb76c2f";
|
|
2018
2123
|
var css11 = `._tableRoot_3ccjp_1 {
|
|
2019
2124
|
width: 100%;
|
|
2020
2125
|
}
|
|
@@ -2080,8 +2185,8 @@ function ProductPricesView({
|
|
|
2080
2185
|
isLoading: isProductLoading,
|
|
2081
2186
|
error,
|
|
2082
2187
|
isError
|
|
2083
|
-
} = (0,
|
|
2084
|
-
|
|
2188
|
+
} = (0, import_connect_query5.useQuery)(
|
|
2189
|
+
import_frontier6.FrontierServiceQueries.getProduct,
|
|
2085
2190
|
{ id: productId ?? "" },
|
|
2086
2191
|
{ staleTime: Infinity }
|
|
2087
2192
|
);
|
|
@@ -2140,8 +2245,7 @@ var noDataChildren3 = /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_apsar
|
|
|
2140
2245
|
|
|
2141
2246
|
// admin/views/audit-logs/index.tsx
|
|
2142
2247
|
var import_apsara22 = require("@raystack/apsara");
|
|
2143
|
-
var
|
|
2144
|
-
var import_react10 = require("react");
|
|
2248
|
+
var import_react12 = require("react");
|
|
2145
2249
|
|
|
2146
2250
|
// admin/views/audit-logs/navbar.tsx
|
|
2147
2251
|
var import_apsara14 = require("@raystack/apsara");
|
|
@@ -2172,8 +2276,8 @@ function CpuChipIcon(props) {
|
|
|
2172
2276
|
);
|
|
2173
2277
|
}
|
|
2174
2278
|
|
|
2175
|
-
// esbuild-css-modules-plugin-namespace:/tmp/tmp-
|
|
2176
|
-
var digest12 = "
|
|
2279
|
+
// esbuild-css-modules-plugin-namespace:/tmp/tmp-2174-ACLZkTj7Umwp/sdk/admin/components/navbar.module.css.js
|
|
2280
|
+
var digest12 = "9f6587325c07a02afef1e4e248d0c655228f119dac7a4615e760a29a9a6e70fe";
|
|
2177
2281
|
var css12 = `._navbar_641ya_1 {
|
|
2178
2282
|
padding: var(--rs-space-4) var(--rs-space-7);
|
|
2179
2283
|
border-bottom: 0.5px solid var(--rs-color-border-base-primary);
|
|
@@ -2202,12 +2306,12 @@ var css12 = `._navbar_641ya_1 {
|
|
|
2202
2306
|
var navbar_module_css_default2 = { "navbar": "_navbar_641ya_1", "nav-chip": "_nav-chip_641ya_11", "navChip": "_nav-chip_641ya_11" };
|
|
2203
2307
|
|
|
2204
2308
|
// admin/views/audit-logs/navbar.tsx
|
|
2205
|
-
var
|
|
2206
|
-
var
|
|
2309
|
+
var import_react10 = require("react");
|
|
2310
|
+
var import_react_query2 = require("@tanstack/react-query");
|
|
2207
2311
|
|
|
2208
2312
|
// admin/views/audit-logs/util.ts
|
|
2209
|
-
var
|
|
2210
|
-
var
|
|
2313
|
+
var import_protobuf3 = require("@bufbuild/protobuf");
|
|
2314
|
+
var import_frontier7 = require("@raystack/proton/frontier");
|
|
2211
2315
|
var getAuditLogActorName = (actor, maxLength = 15) => {
|
|
2212
2316
|
if (actor?.type === ACTOR_TYPES.SYSTEM)
|
|
2213
2317
|
return "System";
|
|
@@ -2238,25 +2342,25 @@ var ACTOR_TYPES = {
|
|
|
2238
2342
|
};
|
|
2239
2343
|
var AUDIT_LOG_QUERY_KEY = ["audit-logs", "table-query"];
|
|
2240
2344
|
var auditLogToJson = (auditLog) => {
|
|
2241
|
-
return (0,
|
|
2345
|
+
return (0, import_protobuf3.toJsonString)(import_frontier7.AuditRecordSchema, auditLog, { prettySpaces: 2 });
|
|
2242
2346
|
};
|
|
2243
2347
|
|
|
2244
2348
|
// admin/views/audit-logs/navbar.tsx
|
|
2245
2349
|
var import_jsx_runtime17 = require("react/jsx-runtime");
|
|
2246
2350
|
var Navbar = ({ searchQuery, onExportCsv }) => {
|
|
2247
|
-
const [showSearch, setShowSearch] = (0,
|
|
2248
|
-
const [isDownloading, setIsDownloading] = (0,
|
|
2249
|
-
const queryClient = (0,
|
|
2250
|
-
const toggleSearch = (0,
|
|
2351
|
+
const [showSearch, setShowSearch] = (0, import_react10.useState)(searchQuery ? true : false);
|
|
2352
|
+
const [isDownloading, setIsDownloading] = (0, import_react10.useState)(false);
|
|
2353
|
+
const queryClient = (0, import_react_query2.useQueryClient)();
|
|
2354
|
+
const toggleSearch = (0, import_react10.useCallback)(() => {
|
|
2251
2355
|
setShowSearch((prev) => !prev);
|
|
2252
2356
|
}, []);
|
|
2253
|
-
const onSearchBlur = (0,
|
|
2357
|
+
const onSearchBlur = (0, import_react10.useCallback)((e) => {
|
|
2254
2358
|
const value = e.target.value;
|
|
2255
2359
|
if (!value) {
|
|
2256
2360
|
setShowSearch(false);
|
|
2257
2361
|
}
|
|
2258
2362
|
}, []);
|
|
2259
|
-
const onDownloadClick = (0,
|
|
2363
|
+
const onDownloadClick = (0, import_react10.useCallback)(async () => {
|
|
2260
2364
|
if (!onExportCsv)
|
|
2261
2365
|
return;
|
|
2262
2366
|
try {
|
|
@@ -2311,8 +2415,8 @@ var Navbar = ({ searchQuery, onExportCsv }) => {
|
|
|
2311
2415
|
};
|
|
2312
2416
|
var navbar_default = Navbar;
|
|
2313
2417
|
|
|
2314
|
-
// esbuild-css-modules-plugin-namespace:/tmp/tmp-
|
|
2315
|
-
var digest13 = "
|
|
2418
|
+
// esbuild-css-modules-plugin-namespace:/tmp/tmp-2174-Cpi8R9AEA5t7/sdk/admin/views/audit-logs/audit-logs.module.css.js
|
|
2419
|
+
var digest13 = "1de6169a68dd01567b0e9f41d74bf1ac1095d106122721a687d142a9966db4df";
|
|
2316
2420
|
var css13 = `._table_vb46j_1 {
|
|
2317
2421
|
height: auto;
|
|
2318
2422
|
}
|
|
@@ -2415,8 +2519,8 @@ var audit_logs_module_css_default = { "table": "_table_vb46j_1", "table-empty":
|
|
|
2415
2519
|
// admin/views/audit-logs/columns.tsx
|
|
2416
2520
|
var import_apsara16 = require("@raystack/apsara");
|
|
2417
2521
|
|
|
2418
|
-
// esbuild-css-modules-plugin-namespace:/tmp/tmp-
|
|
2419
|
-
var digest14 = "
|
|
2522
|
+
// esbuild-css-modules-plugin-namespace:/tmp/tmp-2174-Gvzjz88pX2C0/sdk/admin/views/audit-logs/audit-logs.module.css.js
|
|
2523
|
+
var digest14 = "36cca549723e0f59ac9d46300726159dd86c7967eece52f67256cafa23cf3e51";
|
|
2420
2524
|
var css14 = `._table_vb46j_1 {
|
|
2421
2525
|
height: auto;
|
|
2422
2526
|
}
|
|
@@ -2665,15 +2769,15 @@ var getColumns5 = ({
|
|
|
2665
2769
|
};
|
|
2666
2770
|
|
|
2667
2771
|
// admin/views/audit-logs/index.tsx
|
|
2668
|
-
var
|
|
2669
|
-
var
|
|
2772
|
+
var import_connect_query7 = require("@connectrpc/connect-query");
|
|
2773
|
+
var import_frontier9 = require("@raystack/proton/frontier");
|
|
2670
2774
|
|
|
2671
2775
|
// admin/views/audit-logs/sidepanel-details.tsx
|
|
2672
2776
|
var import_apsara20 = require("@raystack/apsara");
|
|
2673
2777
|
var import_apsara21 = require("@raystack/apsara");
|
|
2674
2778
|
|
|
2675
|
-
// esbuild-css-modules-plugin-namespace:/tmp/tmp-
|
|
2676
|
-
var digest15 = "
|
|
2779
|
+
// esbuild-css-modules-plugin-namespace:/tmp/tmp-2174-l4ZIHhTdUgAK/sdk/admin/views/audit-logs/audit-logs.module.css.js
|
|
2780
|
+
var digest15 = "284fec22f23545c8d3d71d4cb38f2c7745daba6f3ad83b374673bd97b5e91e87";
|
|
2677
2781
|
var css15 = `._table_vb46j_1 {
|
|
2678
2782
|
height: auto;
|
|
2679
2783
|
}
|
|
@@ -2801,8 +2905,8 @@ function MapIcon(props) {
|
|
|
2801
2905
|
// admin/views/audit-logs/sidepanel-log-dialog.tsx
|
|
2802
2906
|
var import_apsara17 = require("@raystack/apsara");
|
|
2803
2907
|
|
|
2804
|
-
// esbuild-css-modules-plugin-namespace:/tmp/tmp-
|
|
2805
|
-
var digest16 = "
|
|
2908
|
+
// esbuild-css-modules-plugin-namespace:/tmp/tmp-2174-gHgTlZvNMOGJ/sdk/admin/views/audit-logs/audit-logs.module.css.js
|
|
2909
|
+
var digest16 = "5650e454f69b2e4c7f6e939dc807775d286f16fc7b99af379ffdf98e5815c584";
|
|
2806
2910
|
var css16 = `._table_vb46j_1 {
|
|
2807
2911
|
height: auto;
|
|
2808
2912
|
}
|
|
@@ -3000,8 +3104,8 @@ function SidePanelLogDialog(props) {
|
|
|
3000
3104
|
// admin/views/audit-logs/sidepanel-list-link.tsx
|
|
3001
3105
|
var import_apsara18 = require("@raystack/apsara");
|
|
3002
3106
|
|
|
3003
|
-
// esbuild-css-modules-plugin-namespace:/tmp/tmp-
|
|
3004
|
-
var digest17 = "
|
|
3107
|
+
// esbuild-css-modules-plugin-namespace:/tmp/tmp-2174-z77FGobM61eI/sdk/admin/views/audit-logs/audit-logs.module.css.js
|
|
3108
|
+
var digest17 = "117a297720a225fb226cb3f98c536741264c9a8581f2249f313f231c37c27484";
|
|
3005
3109
|
var css17 = `._table_vb46j_1 {
|
|
3006
3110
|
height: auto;
|
|
3007
3111
|
}
|
|
@@ -3137,8 +3241,8 @@ function SidepanelListItemLink({
|
|
|
3137
3241
|
// admin/views/audit-logs/sidepanel-list-id.tsx
|
|
3138
3242
|
var import_apsara19 = require("@raystack/apsara");
|
|
3139
3243
|
|
|
3140
|
-
// esbuild-css-modules-plugin-namespace:/tmp/tmp-
|
|
3141
|
-
var digest18 = "
|
|
3244
|
+
// esbuild-css-modules-plugin-namespace:/tmp/tmp-2174-xYDmvKuajyQ9/sdk/admin/views/audit-logs/audit-logs.module.css.js
|
|
3245
|
+
var digest18 = "1e2cf50d2375951900821d448714af3e5ef82b0582b0d2095136f1302800c050";
|
|
3142
3246
|
var css18 = `._table_vb46j_1 {
|
|
3143
3247
|
height: auto;
|
|
3144
3248
|
}
|
|
@@ -3256,7 +3360,7 @@ function SidepanelListId({ id = "-" }) {
|
|
|
3256
3360
|
}
|
|
3257
3361
|
|
|
3258
3362
|
// admin/contexts/AdminConfigContext.tsx
|
|
3259
|
-
var
|
|
3363
|
+
var import_react11 = require("react");
|
|
3260
3364
|
var import_lodash = require("lodash");
|
|
3261
3365
|
|
|
3262
3366
|
// admin/utils/constants.ts
|
|
@@ -3273,6 +3377,7 @@ var DEFAULT_ROLES = {
|
|
|
3273
3377
|
ORG_VIEWER: "app_organization_viewer",
|
|
3274
3378
|
PROJECT_VIEWER: "app_project_viewer"
|
|
3275
3379
|
};
|
|
3380
|
+
var SHARED_QUERY_STALE_TIME = 30 * 1e3;
|
|
3276
3381
|
var defaultTerminology = {
|
|
3277
3382
|
organization: { singular: "Organization", plural: "Organizations" },
|
|
3278
3383
|
project: { singular: "Project", plural: "Projects" },
|
|
@@ -3291,7 +3396,7 @@ var defaultConfig = {
|
|
|
3291
3396
|
|
|
3292
3397
|
// admin/contexts/AdminConfigContext.tsx
|
|
3293
3398
|
var import_jsx_runtime26 = require("react/jsx-runtime");
|
|
3294
|
-
var AdminConfigContext = (0,
|
|
3399
|
+
var AdminConfigContext = (0, import_react11.createContext)(defaultConfig);
|
|
3295
3400
|
var AdminConfigProvider = ({
|
|
3296
3401
|
children,
|
|
3297
3402
|
config = {}
|
|
@@ -3308,7 +3413,7 @@ var AdminConfigProvider = ({
|
|
|
3308
3413
|
) });
|
|
3309
3414
|
};
|
|
3310
3415
|
var useAdminConfig = () => {
|
|
3311
|
-
const context = (0,
|
|
3416
|
+
const context = (0, import_react11.useContext)(AdminConfigContext);
|
|
3312
3417
|
return context || defaultConfig;
|
|
3313
3418
|
};
|
|
3314
3419
|
|
|
@@ -3339,10 +3444,10 @@ var useAdminPaths = () => {
|
|
|
3339
3444
|
};
|
|
3340
3445
|
|
|
3341
3446
|
// admin/hooks/useOrganizationLookup.ts
|
|
3342
|
-
var
|
|
3343
|
-
var
|
|
3344
|
-
var useOrganizationLookup = (orgId) => (0,
|
|
3345
|
-
|
|
3447
|
+
var import_connect_query6 = require("@connectrpc/connect-query");
|
|
3448
|
+
var import_frontier8 = require("@raystack/proton/frontier");
|
|
3449
|
+
var useOrganizationLookup = (orgId) => (0, import_connect_query6.useQuery)(
|
|
3450
|
+
import_frontier8.FrontierServiceQueries.getOrganization,
|
|
3346
3451
|
{ id: orgId || "" },
|
|
3347
3452
|
{
|
|
3348
3453
|
enabled: !!orgId,
|
|
@@ -3487,7 +3592,7 @@ function SidePanelDetails({
|
|
|
3487
3592
|
}
|
|
3488
3593
|
|
|
3489
3594
|
// admin/views/audit-logs/index.tsx
|
|
3490
|
-
var
|
|
3595
|
+
var import_react_query3 = require("@tanstack/react-query");
|
|
3491
3596
|
var import_jsx_runtime28 = require("react/jsx-runtime");
|
|
3492
3597
|
var NoAuditLogs = () => {
|
|
3493
3598
|
return /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
@@ -3504,10 +3609,6 @@ var NoAuditLogs = () => {
|
|
|
3504
3609
|
);
|
|
3505
3610
|
};
|
|
3506
3611
|
var DEFAULT_SORT2 = { name: "occurredAt", order: "desc" };
|
|
3507
|
-
var INITIAL_QUERY2 = {
|
|
3508
|
-
offset: 0,
|
|
3509
|
-
limit: DEFAULT_PAGE_SIZE
|
|
3510
|
-
};
|
|
3511
3612
|
var TRANSFORM_OPTIONS = {
|
|
3512
3613
|
fieldNameMapping: {
|
|
3513
3614
|
occurredAt: "occurred_at",
|
|
@@ -3521,19 +3622,20 @@ var TRANSFORM_OPTIONS = {
|
|
|
3521
3622
|
};
|
|
3522
3623
|
function AuditLogsView({ appName, onExportCsv, onNavigate } = {}) {
|
|
3523
3624
|
const t = useTerminology();
|
|
3524
|
-
const queryClient = (0,
|
|
3525
|
-
const
|
|
3526
|
-
|
|
3527
|
-
|
|
3528
|
-
|
|
3529
|
-
|
|
3530
|
-
|
|
3531
|
-
|
|
3532
|
-
|
|
3533
|
-
|
|
3534
|
-
|
|
3535
|
-
|
|
3536
|
-
const [
|
|
3625
|
+
const queryClient = (0, import_react_query3.useQueryClient)();
|
|
3626
|
+
const {
|
|
3627
|
+
tableQuery,
|
|
3628
|
+
rqlQuery,
|
|
3629
|
+
onTableQueryChange
|
|
3630
|
+
} = useServerTableQuery({
|
|
3631
|
+
defaultSort: DEFAULT_SORT2,
|
|
3632
|
+
transformOptions: TRANSFORM_OPTIONS
|
|
3633
|
+
});
|
|
3634
|
+
(0, import_react12.useEffect)(() => {
|
|
3635
|
+
queryClient.setQueryData(AUDIT_LOG_QUERY_KEY, rqlQuery);
|
|
3636
|
+
}, [queryClient, rqlQuery]);
|
|
3637
|
+
const [sidePanelOpen, setSidePanelOpen] = (0, import_react12.useState)(false);
|
|
3638
|
+
const [selectedAuditLog, setSelectedAuditLog] = (0, import_react12.useState)(
|
|
3537
3639
|
null
|
|
3538
3640
|
);
|
|
3539
3641
|
const {
|
|
@@ -3544,14 +3646,14 @@ function AuditLogsView({ appName, onExportCsv, onNavigate } = {}) {
|
|
|
3544
3646
|
error,
|
|
3545
3647
|
isError,
|
|
3546
3648
|
hasNextPage
|
|
3547
|
-
} = (0,
|
|
3548
|
-
|
|
3549
|
-
{ query:
|
|
3649
|
+
} = (0, import_connect_query7.useInfiniteQuery)(
|
|
3650
|
+
import_frontier9.AdminServiceQueries.listAuditRecords,
|
|
3651
|
+
{ query: rqlQuery },
|
|
3550
3652
|
{
|
|
3551
3653
|
pageParamKey: "query",
|
|
3552
3654
|
getNextPageParam: (lastPage) => getConnectNextPageParam(
|
|
3553
3655
|
lastPage,
|
|
3554
|
-
{ query:
|
|
3656
|
+
{ query: rqlQuery },
|
|
3555
3657
|
"auditRecords"
|
|
3556
3658
|
),
|
|
3557
3659
|
staleTime: 0,
|
|
@@ -3561,35 +3663,14 @@ function AuditLogsView({ appName, onExportCsv, onNavigate } = {}) {
|
|
|
3561
3663
|
}
|
|
3562
3664
|
);
|
|
3563
3665
|
const data = infiniteData?.pages?.flatMap((page) => page?.auditRecords || []) || [];
|
|
3564
|
-
const
|
|
3565
|
-
|
|
3566
|
-
|
|
3567
|
-
|
|
3568
|
-
|
|
3569
|
-
|
|
3570
|
-
|
|
3571
|
-
|
|
3572
|
-
updatedQuery,
|
|
3573
|
-
TRANSFORM_OPTIONS
|
|
3574
|
-
);
|
|
3575
|
-
queryClient.setQueryData(AUDIT_LOG_QUERY_KEY, updatedRQLRequest);
|
|
3576
|
-
setTableQuery({
|
|
3577
|
-
query: updatedQuery,
|
|
3578
|
-
rqlRequest: updatedRQLRequest
|
|
3579
|
-
});
|
|
3580
|
-
},
|
|
3581
|
-
[queryClient]
|
|
3582
|
-
);
|
|
3583
|
-
const handleLoadMore = async () => {
|
|
3584
|
-
try {
|
|
3585
|
-
if (!hasNextPage)
|
|
3586
|
-
return;
|
|
3587
|
-
await fetchNextPage();
|
|
3588
|
-
} catch (error2) {
|
|
3589
|
-
console.error("Error loading more audit logs:", error2);
|
|
3590
|
-
}
|
|
3591
|
-
};
|
|
3592
|
-
const columns = (0, import_react10.useMemo)(
|
|
3666
|
+
const handleLoadMore = useLoadMore({
|
|
3667
|
+
hasNextPage,
|
|
3668
|
+
isFetchingNextPage,
|
|
3669
|
+
isError,
|
|
3670
|
+
fetchNextPage,
|
|
3671
|
+
label: "audit logs"
|
|
3672
|
+
});
|
|
3673
|
+
const columns = (0, import_react12.useMemo)(
|
|
3593
3674
|
() => getColumns5({
|
|
3594
3675
|
groupCountMap: infiniteData ? getGroupCountMapFromFirstPage(infiniteData) : {},
|
|
3595
3676
|
t
|
|
@@ -3597,7 +3678,7 @@ function AuditLogsView({ appName, onExportCsv, onNavigate } = {}) {
|
|
|
3597
3678
|
[infiniteData, t]
|
|
3598
3679
|
);
|
|
3599
3680
|
const loading = isLoading || isFetchingNextPage;
|
|
3600
|
-
const onRowClick = (0,
|
|
3681
|
+
const onRowClick = (0, import_react12.useCallback)((row) => {
|
|
3601
3682
|
setSelectedAuditLog((_selectedLog) => {
|
|
3602
3683
|
if (_selectedLog?.id === row.id)
|
|
3603
3684
|
setSidePanelOpen((_value) => !_value);
|
|
@@ -3626,7 +3707,7 @@ function AuditLogsView({ appName, onExportCsv, onNavigate } = {}) {
|
|
|
3626
3707
|
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
3627
3708
|
import_apsara22.DataTable,
|
|
3628
3709
|
{
|
|
3629
|
-
query: tableQuery
|
|
3710
|
+
query: tableQuery,
|
|
3630
3711
|
columns,
|
|
3631
3712
|
data,
|
|
3632
3713
|
isLoading: loading,
|
|
@@ -3636,7 +3717,7 @@ function AuditLogsView({ appName, onExportCsv, onNavigate } = {}) {
|
|
|
3636
3717
|
onLoadMore: handleLoadMore,
|
|
3637
3718
|
onRowClick,
|
|
3638
3719
|
children: /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)(import_apsara22.Flex, { direction: "column", style: { width: "100%" }, children: [
|
|
3639
|
-
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)(navbar_default, { searchQuery: tableQuery.
|
|
3720
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)(navbar_default, { searchQuery: tableQuery.search, onExportCsv }),
|
|
3640
3721
|
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)(import_apsara22.DataTable.Toolbar, {}),
|
|
3641
3722
|
/* @__PURE__ */ (0, import_jsx_runtime28.jsxs)(import_apsara22.Flex, { className: audit_logs_module_css_default["table-content-container"], children: [
|
|
3642
3723
|
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
@@ -3673,8 +3754,8 @@ var import_apsara24 = require("@raystack/apsara");
|
|
|
3673
3754
|
// admin/views/admins/columns.tsx
|
|
3674
3755
|
var import_apsara23 = require("@raystack/apsara");
|
|
3675
3756
|
|
|
3676
|
-
// esbuild-css-modules-plugin-namespace:/tmp/tmp-
|
|
3677
|
-
var digest19 = "
|
|
3757
|
+
// esbuild-css-modules-plugin-namespace:/tmp/tmp-2174-UpjTipcg85Wk/sdk/admin/views/admins/admins.module.css.js
|
|
3758
|
+
var digest19 = "e389646c02d2a4c819664f1669c67ebc361c54d6a0512f255a712b8bc9611b3d";
|
|
3678
3759
|
var css19 = `._tableRoot_1tmha_1 {
|
|
3679
3760
|
width: 100%;
|
|
3680
3761
|
}
|
|
@@ -3769,8 +3850,8 @@ var getColumns6 = ({ onNavigateToOrg, t } = {}) => {
|
|
|
3769
3850
|
];
|
|
3770
3851
|
};
|
|
3771
3852
|
|
|
3772
|
-
// esbuild-css-modules-plugin-namespace:/tmp/tmp-
|
|
3773
|
-
var digest20 = "
|
|
3853
|
+
// esbuild-css-modules-plugin-namespace:/tmp/tmp-2174-UDnULMwPbB7D/sdk/admin/views/admins/admins.module.css.js
|
|
3854
|
+
var digest20 = "193f3be7a3c5690b3fc4367f699a1ce3fa776543256725a11a61d8ca1d0305be";
|
|
3774
3855
|
var css20 = `._tableRoot_1tmha_1 {
|
|
3775
3856
|
width: 100%;
|
|
3776
3857
|
}
|
|
@@ -3802,8 +3883,8 @@ var css20 = `._tableRoot_1tmha_1 {
|
|
|
3802
3883
|
var admins_module_css_default2 = { "tableRoot": "_tableRoot_1tmha_1", "tableWrapper": "_tableWrapper_1tmha_5", "header": "_header_1tmha_9", "first-column": "_first-column_1tmha_14", "firstColumn": "_first-column_1tmha_14" };
|
|
3803
3884
|
|
|
3804
3885
|
// admin/views/admins/index.tsx
|
|
3805
|
-
var
|
|
3806
|
-
var
|
|
3886
|
+
var import_connect_query8 = require("@connectrpc/connect-query");
|
|
3887
|
+
var import_frontier10 = require("@raystack/proton/frontier");
|
|
3807
3888
|
var import_jsx_runtime30 = require("react/jsx-runtime");
|
|
3808
3889
|
var pageHeader = {
|
|
3809
3890
|
title: "Super Admins",
|
|
@@ -3826,7 +3907,7 @@ function AdminsView({ onNavigateToOrg, icon } = {}) {
|
|
|
3826
3907
|
isLoading,
|
|
3827
3908
|
error,
|
|
3828
3909
|
isError
|
|
3829
|
-
} = (0,
|
|
3910
|
+
} = (0, import_connect_query8.useQuery)(import_frontier10.AdminServiceQueries.listPlatformUsers, {}, {
|
|
3830
3911
|
staleTime: Infinity
|
|
3831
3912
|
});
|
|
3832
3913
|
const columns = getColumns6({ onNavigateToOrg, t });
|
|
@@ -3881,8 +3962,8 @@ var import_apsara27 = require("@raystack/apsara");
|
|
|
3881
3962
|
// admin/views/plans/columns.tsx
|
|
3882
3963
|
var import_apsara25 = require("@raystack/apsara");
|
|
3883
3964
|
|
|
3884
|
-
// esbuild-css-modules-plugin-namespace:/tmp/tmp-
|
|
3885
|
-
var digest21 = "
|
|
3965
|
+
// esbuild-css-modules-plugin-namespace:/tmp/tmp-2174-8YgbJmApJSTQ/sdk/admin/views/plans/plans.module.css.js
|
|
3966
|
+
var digest21 = "3f70341a51dc2a5ee26e758e369d541d7356c31642edfa5302b9ec1209f2d0b8";
|
|
3886
3967
|
var css21 = `._tableRoot_1akba_1 {
|
|
3887
3968
|
width: 100%;
|
|
3888
3969
|
}
|
|
@@ -3973,8 +4054,8 @@ var getColumns7 = ({ onSelectPlan } = {}) => {
|
|
|
3973
4054
|
];
|
|
3974
4055
|
};
|
|
3975
4056
|
|
|
3976
|
-
// esbuild-css-modules-plugin-namespace:/tmp/tmp-
|
|
3977
|
-
var digest22 = "
|
|
4057
|
+
// esbuild-css-modules-plugin-namespace:/tmp/tmp-2174-ECPsZn6QGI5f/sdk/admin/views/plans/plans.module.css.js
|
|
4058
|
+
var digest22 = "742a954fa4495cc82f0e61713bd4d55d97d7f71cc312a7c918826c79a25cbeb6";
|
|
3978
4059
|
var css22 = `._tableRoot_1akba_1 {
|
|
3979
4060
|
width: 100%;
|
|
3980
4061
|
}
|
|
@@ -4018,8 +4099,8 @@ var css22 = `._tableRoot_1akba_1 {
|
|
|
4018
4099
|
var plans_module_css_default2 = { "tableRoot": "_tableRoot_1akba_1", "tableWrapper": "_tableWrapper_1akba_4", "table": "_table_1akba_1", "header": "_header_1akba_12", "first-column": "_first-column_1akba_17", "firstColumn": "_first-column_1akba_17", "sheetContent": "_sheetContent_1akba_21", "sheetContentBody": "_sheetContentBody_1akba_26" };
|
|
4019
4100
|
|
|
4020
4101
|
// admin/views/plans/index.tsx
|
|
4021
|
-
var
|
|
4022
|
-
var
|
|
4102
|
+
var import_connect_query9 = require("@connectrpc/connect-query");
|
|
4103
|
+
var import_frontier11 = require("@raystack/proton/frontier");
|
|
4023
4104
|
|
|
4024
4105
|
// admin/views/plans/details.tsx
|
|
4025
4106
|
var import_apsara26 = require("@raystack/apsara");
|
|
@@ -4058,7 +4139,7 @@ function PlansView({
|
|
|
4058
4139
|
isLoading: isPlansLoading,
|
|
4059
4140
|
error,
|
|
4060
4141
|
isError
|
|
4061
|
-
} = (0,
|
|
4142
|
+
} = (0, import_connect_query9.useQuery)(import_frontier11.FrontierServiceQueries.listPlans, {}, {
|
|
4062
4143
|
staleTime: Infinity
|
|
4063
4144
|
});
|
|
4064
4145
|
const plans = plansResponse?.plans || [];
|
|
@@ -4126,8 +4207,8 @@ var import_apsara29 = require("@raystack/apsara");
|
|
|
4126
4207
|
// admin/views/webhooks/webhooks/columns.tsx
|
|
4127
4208
|
var import_apsara28 = require("@raystack/apsara");
|
|
4128
4209
|
|
|
4129
|
-
// esbuild-css-modules-plugin-namespace:/tmp/tmp-
|
|
4130
|
-
var digest23 = "
|
|
4210
|
+
// esbuild-css-modules-plugin-namespace:/tmp/tmp-2174-aZGB2gjuzLZy/sdk/admin/views/webhooks/webhooks/webhooks.module.css.js
|
|
4211
|
+
var digest23 = "684d026b8a534050195ff532d11449c8a86f40bbfcaaed0abf81470031750feb";
|
|
4131
4212
|
var css23 = `._tableRoot_iq3pc_1 {
|
|
4132
4213
|
width: 100%;
|
|
4133
4214
|
}
|
|
@@ -4208,8 +4289,8 @@ var getColumns8 = () => {
|
|
|
4208
4289
|
];
|
|
4209
4290
|
};
|
|
4210
4291
|
|
|
4211
|
-
// esbuild-css-modules-plugin-namespace:/tmp/tmp-
|
|
4212
|
-
var digest24 = "
|
|
4292
|
+
// esbuild-css-modules-plugin-namespace:/tmp/tmp-2174-NPSnhTsMyIcu/sdk/admin/views/webhooks/webhooks/webhooks.module.css.js
|
|
4293
|
+
var digest24 = "df85d11bf4d80aa248e51d50bc57d89a778fe41876c06b62543e09cc1faad8af";
|
|
4213
4294
|
var css24 = `._tableRoot_iq3pc_1 {
|
|
4214
4295
|
width: 100%;
|
|
4215
4296
|
}
|
|
@@ -4254,11 +4335,11 @@ var css24 = `._tableRoot_iq3pc_1 {
|
|
|
4254
4335
|
var webhooks_module_css_default2 = { "tableRoot": "_tableRoot_iq3pc_1", "tableWrapper": "_tableWrapper_iq3pc_5", "table": "_table_iq3pc_1", "first-column": "_first-column_iq3pc_13", "firstColumn": "_first-column_iq3pc_13", "stateColumn": "_stateColumn_iq3pc_17", "dateColumn": "_dateColumn_iq3pc_21", "header": "_header_iq3pc_25" };
|
|
4255
4336
|
|
|
4256
4337
|
// admin/views/webhooks/webhooks/hooks/useWebhookQueries.ts
|
|
4257
|
-
var
|
|
4258
|
-
var
|
|
4338
|
+
var import_connect_query10 = require("@connectrpc/connect-query");
|
|
4339
|
+
var import_frontier12 = require("@raystack/proton/frontier");
|
|
4259
4340
|
function useWebhookQueries() {
|
|
4260
|
-
const listWebhooks = (0,
|
|
4261
|
-
|
|
4341
|
+
const listWebhooks = (0, import_connect_query10.useQuery)(
|
|
4342
|
+
import_frontier12.AdminServiceQueries.listWebhooks,
|
|
4262
4343
|
{},
|
|
4263
4344
|
{
|
|
4264
4345
|
staleTime: 0,
|
|
@@ -4321,9 +4402,9 @@ function WebhooksView({ icon } = {}) {
|
|
|
4321
4402
|
|
|
4322
4403
|
// admin/views/preferences/PreferencesView.tsx
|
|
4323
4404
|
var import_apsara33 = require("@raystack/apsara");
|
|
4324
|
-
var
|
|
4325
|
-
var
|
|
4326
|
-
var
|
|
4405
|
+
var import_connect_query12 = require("@connectrpc/connect-query");
|
|
4406
|
+
var import_frontier15 = require("@raystack/proton/frontier");
|
|
4407
|
+
var import_react_query5 = require("@tanstack/react-query");
|
|
4327
4408
|
|
|
4328
4409
|
// admin/views/preferences/index.tsx
|
|
4329
4410
|
var import_apsara31 = require("@raystack/apsara");
|
|
@@ -4331,8 +4412,8 @@ var import_apsara31 = require("@raystack/apsara");
|
|
|
4331
4412
|
// admin/views/preferences/columns.tsx
|
|
4332
4413
|
var import_apsara30 = require("@raystack/apsara");
|
|
4333
4414
|
|
|
4334
|
-
// esbuild-css-modules-plugin-namespace:/tmp/tmp-
|
|
4335
|
-
var digest25 = "
|
|
4415
|
+
// esbuild-css-modules-plugin-namespace:/tmp/tmp-2174-yjLiT30DAPbq/sdk/admin/views/preferences/preferences.module.css.js
|
|
4416
|
+
var digest25 = "ed0dc8837576c4c4c2e30424bd8f448b9400c7de0642cb29fd282d07a44c24d6";
|
|
4336
4417
|
var css25 = `._tableRoot_hre5m_1 {
|
|
4337
4418
|
width: 100%;
|
|
4338
4419
|
}
|
|
@@ -4423,8 +4504,8 @@ var getColumns9 = ({
|
|
|
4423
4504
|
];
|
|
4424
4505
|
};
|
|
4425
4506
|
|
|
4426
|
-
// esbuild-css-modules-plugin-namespace:/tmp/tmp-
|
|
4427
|
-
var digest26 = "
|
|
4507
|
+
// esbuild-css-modules-plugin-namespace:/tmp/tmp-2174-yPICgQ3R0rz4/sdk/admin/views/preferences/preferences.module.css.js
|
|
4508
|
+
var digest26 = "5aac611bb414abc142ffc8082f9fd52dbba4cf2036962f4dd6d8aeefa8f055fe";
|
|
4428
4509
|
var css26 = `._tableRoot_hre5m_1 {
|
|
4429
4510
|
width: 100%;
|
|
4430
4511
|
}
|
|
@@ -4518,11 +4599,11 @@ var noDataChildren5 = /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
|
|
|
4518
4599
|
|
|
4519
4600
|
// admin/views/preferences/details.tsx
|
|
4520
4601
|
var import_apsara32 = require("@raystack/apsara");
|
|
4521
|
-
var
|
|
4602
|
+
var import_react14 = require("react");
|
|
4522
4603
|
|
|
4523
4604
|
// ../node_modules/.pnpm/react-loading-skeleton@3.5.0_react@19.2.4/node_modules/react-loading-skeleton/dist/index.js
|
|
4524
|
-
var
|
|
4525
|
-
var SkeletonThemeContext =
|
|
4605
|
+
var import_react13 = __toESM(require("react"), 1);
|
|
4606
|
+
var SkeletonThemeContext = import_react13.default.createContext({});
|
|
4526
4607
|
var defaultEnableAnimation = true;
|
|
4527
4608
|
function styleOptionsToCssProperties({ baseColor, highlightColor, width, height, borderRadius, circle, direction, duration, enableAnimation = defaultEnableAnimation, customHighlightBackground }) {
|
|
4528
4609
|
const style = {};
|
|
@@ -4550,7 +4631,7 @@ function styleOptionsToCssProperties({ baseColor, highlightColor, width, height,
|
|
|
4550
4631
|
}
|
|
4551
4632
|
function Skeleton({ count = 1, wrapper: Wrapper, className: customClassName, containerClassName, containerTestId, circle = false, style: styleProp, ...originalPropsStyleOptions }) {
|
|
4552
4633
|
var _a, _b, _c;
|
|
4553
|
-
const contextStyleOptions =
|
|
4634
|
+
const contextStyleOptions = import_react13.default.useContext(SkeletonThemeContext);
|
|
4554
4635
|
const propsStyleOptions = { ...originalPropsStyleOptions };
|
|
4555
4636
|
for (const [key, value] of Object.entries(originalPropsStyleOptions)) {
|
|
4556
4637
|
if (typeof value === "undefined") {
|
|
@@ -4580,61 +4661,30 @@ function Skeleton({ count = 1, wrapper: Wrapper, className: customClassName, con
|
|
|
4580
4661
|
const fractionalWidth = typeof width === "number" ? width * fractionalPart : `calc(${width} * ${fractionalPart})`;
|
|
4581
4662
|
thisStyle = { ...thisStyle, width: fractionalWidth };
|
|
4582
4663
|
}
|
|
4583
|
-
const skeletonSpan =
|
|
4664
|
+
const skeletonSpan = import_react13.default.createElement("span", { className, style: thisStyle, key: i }, "\u200C");
|
|
4584
4665
|
if (inline) {
|
|
4585
4666
|
elements.push(skeletonSpan);
|
|
4586
4667
|
} else {
|
|
4587
|
-
elements.push(
|
|
4588
|
-
|
|
4668
|
+
elements.push(import_react13.default.createElement(
|
|
4669
|
+
import_react13.default.Fragment,
|
|
4589
4670
|
{ key: i },
|
|
4590
4671
|
skeletonSpan,
|
|
4591
|
-
|
|
4672
|
+
import_react13.default.createElement("br", null)
|
|
4592
4673
|
));
|
|
4593
4674
|
}
|
|
4594
4675
|
}
|
|
4595
|
-
return
|
|
4676
|
+
return import_react13.default.createElement("span", { className: containerClassName, "data-testid": containerTestId, "aria-live": "polite", "aria-busy": (_c = styleOptions.enableAnimation) !== null && _c !== void 0 ? _c : defaultEnableAnimation }, Wrapper ? elements.map((el, i) => import_react13.default.createElement(Wrapper, { key: i }, el)) : elements);
|
|
4596
4677
|
}
|
|
4597
4678
|
|
|
4598
4679
|
// admin/views/preferences/details.tsx
|
|
4599
|
-
var
|
|
4600
|
-
|
|
4601
|
-
// utils/error.ts
|
|
4602
|
-
var import_connect = require("@connectrpc/connect");
|
|
4603
|
-
var DEFAULT_ERROR_MESSAGE = "Something went wrong";
|
|
4604
|
-
function handleConnectError(error, handlers) {
|
|
4605
|
-
const connectError = error instanceof import_connect.ConnectError ? error : new import_connect.ConnectError(
|
|
4606
|
-
typeof error === "string" ? error : error instanceof Error ? error.message : DEFAULT_ERROR_MESSAGE
|
|
4607
|
-
);
|
|
4608
|
-
const defaultHandler = handlers?.Default ?? ((err) => console.error(err.message));
|
|
4609
|
-
switch (connectError.code) {
|
|
4610
|
-
case import_connect.Code.AlreadyExists:
|
|
4611
|
-
handlers?.AlreadyExists ? handlers.AlreadyExists(connectError) : defaultHandler(connectError);
|
|
4612
|
-
break;
|
|
4613
|
-
case import_connect.Code.InvalidArgument:
|
|
4614
|
-
handlers?.InvalidArgument ? handlers.InvalidArgument(connectError) : defaultHandler(connectError);
|
|
4615
|
-
break;
|
|
4616
|
-
case import_connect.Code.PermissionDenied:
|
|
4617
|
-
handlers?.PermissionDenied ? handlers.PermissionDenied(connectError) : defaultHandler(connectError);
|
|
4618
|
-
break;
|
|
4619
|
-
case import_connect.Code.NotFound:
|
|
4620
|
-
handlers?.NotFound ? handlers.NotFound(connectError) : defaultHandler(connectError);
|
|
4621
|
-
break;
|
|
4622
|
-
case import_connect.Code.FailedPrecondition:
|
|
4623
|
-
handlers?.FailedPrecondition ? handlers.FailedPrecondition(connectError) : defaultHandler(connectError);
|
|
4624
|
-
break;
|
|
4625
|
-
default:
|
|
4626
|
-
defaultHandler(connectError);
|
|
4627
|
-
}
|
|
4628
|
-
}
|
|
4629
|
-
|
|
4630
|
-
// admin/views/preferences/details.tsx
|
|
4631
|
-
var import_frontier12 = require("@raystack/proton/frontier");
|
|
4680
|
+
var import_connect_query11 = require("@connectrpc/connect-query");
|
|
4632
4681
|
var import_frontier13 = require("@raystack/proton/frontier");
|
|
4633
|
-
var
|
|
4634
|
-
var
|
|
4682
|
+
var import_frontier14 = require("@raystack/proton/frontier");
|
|
4683
|
+
var import_react_query4 = require("@tanstack/react-query");
|
|
4684
|
+
var import_protobuf4 = require("@bufbuild/protobuf");
|
|
4635
4685
|
var import_jsx_runtime38 = require("react/jsx-runtime");
|
|
4636
4686
|
function PreferenceValue({ value, trait, onChange }) {
|
|
4637
|
-
if (trait.inputType ===
|
|
4687
|
+
if (trait.inputType === import_frontier14.PreferenceTrait_InputType.CHECKBOX) {
|
|
4638
4688
|
const checked = value === "true";
|
|
4639
4689
|
return /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
|
|
4640
4690
|
import_apsara32.Switch,
|
|
@@ -4644,7 +4694,7 @@ function PreferenceValue({ value, trait, onChange }) {
|
|
|
4644
4694
|
"data-test-id": "admin-preference-select"
|
|
4645
4695
|
}
|
|
4646
4696
|
);
|
|
4647
|
-
} else if (trait.inputType ===
|
|
4697
|
+
} else if (trait.inputType === import_frontier14.PreferenceTrait_InputType.TEXT || trait.inputType === import_frontier14.PreferenceTrait_InputType.TEXTAREA) {
|
|
4648
4698
|
return /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
|
|
4649
4699
|
import_apsara32.Input,
|
|
4650
4700
|
{
|
|
@@ -4664,16 +4714,16 @@ function PreferenceDetails({
|
|
|
4664
4714
|
isLoading,
|
|
4665
4715
|
onCloseDetail
|
|
4666
4716
|
}) {
|
|
4667
|
-
const [value, setValue] = (0,
|
|
4668
|
-
const [originalValue, setOriginalValue] = (0,
|
|
4717
|
+
const [value, setValue] = (0, import_react14.useState)("");
|
|
4718
|
+
const [originalValue, setOriginalValue] = (0, import_react14.useState)("");
|
|
4669
4719
|
const preference = preferences?.find((p) => p.name === name);
|
|
4670
4720
|
const trait = traits?.find((t) => t.name === name);
|
|
4671
|
-
const queryClient = (0,
|
|
4672
|
-
const transport = (0,
|
|
4673
|
-
const { mutateAsync: createPreferences, isPending: isActionLoading } = (0,
|
|
4721
|
+
const queryClient = (0, import_react_query4.useQueryClient)();
|
|
4722
|
+
const transport = (0, import_connect_query11.useTransport)();
|
|
4723
|
+
const { mutateAsync: createPreferences, isPending: isActionLoading } = (0, import_connect_query11.useMutation)(import_frontier13.AdminServiceQueries.createPreferences, {
|
|
4674
4724
|
onSuccess: (data) => {
|
|
4675
|
-
const queryKey = (0,
|
|
4676
|
-
schema:
|
|
4725
|
+
const queryKey = (0, import_connect_query11.createConnectQueryKey)({
|
|
4726
|
+
schema: import_frontier13.AdminServiceQueries.listPreferences,
|
|
4677
4727
|
transport,
|
|
4678
4728
|
input: {},
|
|
4679
4729
|
cardinality: "finite"
|
|
@@ -4708,7 +4758,7 @@ function PreferenceDetails({
|
|
|
4708
4758
|
{ name: trait?.title ?? name }
|
|
4709
4759
|
]
|
|
4710
4760
|
};
|
|
4711
|
-
(0,
|
|
4761
|
+
(0, import_react14.useEffect)(() => {
|
|
4712
4762
|
const v = preference?.value !== "" && preference?.value !== void 0 ? preference?.value : trait?.default;
|
|
4713
4763
|
const newValue = v || "";
|
|
4714
4764
|
setValue(newValue);
|
|
@@ -4749,9 +4799,9 @@ function PreferenceDetails({
|
|
|
4749
4799
|
value: formatTimestamp(preference?.updatedAt, `${DATE_FORMAT} hh:mm:ss A`)
|
|
4750
4800
|
}
|
|
4751
4801
|
];
|
|
4752
|
-
const onSave = (0,
|
|
4802
|
+
const onSave = (0, import_react14.useCallback)(async () => {
|
|
4753
4803
|
try {
|
|
4754
|
-
await createPreferences((0,
|
|
4804
|
+
await createPreferences((0, import_protobuf4.create)(import_frontier13.CreatePreferencesRequestSchema, {
|
|
4755
4805
|
preferences: [
|
|
4756
4806
|
{
|
|
4757
4807
|
name,
|
|
@@ -4837,15 +4887,15 @@ function PreferencesView({
|
|
|
4837
4887
|
onSelectPreference,
|
|
4838
4888
|
icon
|
|
4839
4889
|
} = {}) {
|
|
4840
|
-
const transport = (0,
|
|
4841
|
-
const [preferencesQuery, traitsQuery] = (0,
|
|
4890
|
+
const transport = (0, import_connect_query12.useTransport)();
|
|
4891
|
+
const [preferencesQuery, traitsQuery] = (0, import_react_query5.useQueries)({
|
|
4842
4892
|
queries: [
|
|
4843
4893
|
{
|
|
4844
|
-
...(0,
|
|
4894
|
+
...(0, import_connect_query12.createQueryOptions)(import_frontier15.AdminServiceQueries.listPreferences, {}, { transport }),
|
|
4845
4895
|
staleTime: Infinity
|
|
4846
4896
|
},
|
|
4847
4897
|
{
|
|
4848
|
-
...(0,
|
|
4898
|
+
...(0, import_connect_query12.createQueryOptions)(import_frontier15.FrontierServiceQueries.describePreferences, {}, { transport }),
|
|
4849
4899
|
staleTime: Infinity
|
|
4850
4900
|
}
|
|
4851
4901
|
]
|
|
@@ -4896,8 +4946,8 @@ var import_apsara37 = require("@raystack/apsara");
|
|
|
4896
4946
|
// admin/views/users/list/navbar.tsx
|
|
4897
4947
|
var import_apsara35 = require("@raystack/apsara");
|
|
4898
4948
|
|
|
4899
|
-
// esbuild-css-modules-plugin-namespace:/tmp/tmp-
|
|
4900
|
-
var digest27 = "
|
|
4949
|
+
// esbuild-css-modules-plugin-namespace:/tmp/tmp-2174-DrwK1UCSLByp/sdk/admin/components/navbar.module.css.js
|
|
4950
|
+
var digest27 = "412d262e29496dce9b95eac75f8c7e1fe546d6fbea29b4d20d64f7a567dd053b";
|
|
4901
4951
|
var css27 = `._navbar_641ya_1 {
|
|
4902
4952
|
padding: var(--rs-space-4) var(--rs-space-7);
|
|
4903
4953
|
border-bottom: 0.5px solid var(--rs-color-border-base-primary);
|
|
@@ -4951,10 +5001,10 @@ function UsersIcon(props) {
|
|
|
4951
5001
|
var UsersIcon_default = UsersIcon;
|
|
4952
5002
|
|
|
4953
5003
|
// admin/views/users/list/navbar.tsx
|
|
4954
|
-
var
|
|
5004
|
+
var import_react16 = require("react");
|
|
4955
5005
|
|
|
4956
5006
|
// admin/views/users/list/invite-users.tsx
|
|
4957
|
-
var
|
|
5007
|
+
var import_react15 = require("react");
|
|
4958
5008
|
var import_apsara34 = require("@raystack/apsara");
|
|
4959
5009
|
|
|
4960
5010
|
// ../node_modules/.pnpm/zod@3.25.76/node_modules/zod/v3/external.js
|
|
@@ -9002,8 +9052,8 @@ var NEVER = INVALID;
|
|
|
9002
9052
|
var import_react_hook_form = require("react-hook-form");
|
|
9003
9053
|
var import_zod = require("@hookform/resolvers/zod");
|
|
9004
9054
|
|
|
9005
|
-
// esbuild-css-modules-plugin-namespace:/tmp/tmp-
|
|
9006
|
-
var digest28 = "
|
|
9055
|
+
// esbuild-css-modules-plugin-namespace:/tmp/tmp-2174-BMdoBVNYVYeB/sdk/admin/views/users/list/invite-users.module.css.js
|
|
9056
|
+
var digest28 = "4ab5697849412d8e95febd712f26ce1756d614551ee5158e94051a7d6f7b52ad";
|
|
9007
9057
|
var css28 = `._invite-users-dialog-body_daxb4_1 {
|
|
9008
9058
|
display: flex;
|
|
9009
9059
|
flex-direction: column;
|
|
@@ -9030,9 +9080,9 @@ var css28 = `._invite-users-dialog-body_daxb4_1 {
|
|
|
9030
9080
|
var invite_users_module_css_default = { "invite-users-dialog-body": "_invite-users-dialog-body_daxb4_1", "inviteUsersDialogBody": "_invite-users-dialog-body_daxb4_1", "invite-users-emails-textarea": "_invite-users-emails-textarea_daxb4_8", "inviteUsersEmailsTextarea": "_invite-users-emails-textarea_daxb4_8" };
|
|
9031
9081
|
|
|
9032
9082
|
// admin/views/users/list/invite-users.tsx
|
|
9033
|
-
var
|
|
9034
|
-
var
|
|
9035
|
-
var
|
|
9083
|
+
var import_connect_query13 = require("@connectrpc/connect-query");
|
|
9084
|
+
var import_frontier16 = require("@raystack/proton/frontier");
|
|
9085
|
+
var import_protobuf5 = require("@bufbuild/protobuf");
|
|
9036
9086
|
var import_jsx_runtime41 = require("react/jsx-runtime");
|
|
9037
9087
|
var createInviteSchema = (t) => objectType({
|
|
9038
9088
|
role: stringType().min(1, { message: "Role is required" }),
|
|
@@ -9047,15 +9097,16 @@ var createInviteSchema = (t) => objectType({
|
|
|
9047
9097
|
});
|
|
9048
9098
|
var InviteUser = () => {
|
|
9049
9099
|
const t = useTerminology();
|
|
9050
|
-
const [open, onOpenChange] = (0,
|
|
9100
|
+
const [open, onOpenChange] = (0, import_react15.useState)(false);
|
|
9051
9101
|
const {
|
|
9052
9102
|
data: organizations,
|
|
9053
9103
|
isLoading: isOrganizationsLoading,
|
|
9054
9104
|
error: organizationsError
|
|
9055
|
-
} = (0,
|
|
9056
|
-
|
|
9057
|
-
(0,
|
|
9105
|
+
} = (0, import_connect_query13.useQuery)(
|
|
9106
|
+
import_frontier16.AdminServiceQueries.searchOrganizations,
|
|
9107
|
+
(0, import_protobuf5.create)(import_frontier16.SearchOrganizationsRequestSchema, { query: {} }),
|
|
9058
9108
|
{
|
|
9109
|
+
enabled: open,
|
|
9059
9110
|
select: (data) => data?.organizations || []
|
|
9060
9111
|
}
|
|
9061
9112
|
);
|
|
@@ -9063,29 +9114,30 @@ var InviteUser = () => {
|
|
|
9063
9114
|
data: roles,
|
|
9064
9115
|
isLoading: isRolesLoading,
|
|
9065
9116
|
error: rolesError
|
|
9066
|
-
} = (0,
|
|
9067
|
-
|
|
9068
|
-
(0,
|
|
9117
|
+
} = (0, import_connect_query13.useQuery)(
|
|
9118
|
+
import_frontier16.FrontierServiceQueries.listRoles,
|
|
9119
|
+
(0, import_protobuf5.create)(import_frontier16.ListRolesRequestSchema, { scopes: [SCOPES.ORG] }),
|
|
9069
9120
|
{
|
|
9121
|
+
enabled: open,
|
|
9070
9122
|
select: (data) => data?.roles || []
|
|
9071
9123
|
}
|
|
9072
9124
|
);
|
|
9073
9125
|
const isLoading = isRolesLoading || isOrganizationsLoading;
|
|
9074
|
-
(0,
|
|
9126
|
+
(0, import_react15.useEffect)(() => {
|
|
9075
9127
|
if (organizationsError) {
|
|
9076
9128
|
console.error("Failed to fetch organizations:", organizationsError);
|
|
9077
9129
|
}
|
|
9078
9130
|
}, [organizationsError]);
|
|
9079
|
-
(0,
|
|
9131
|
+
(0, import_react15.useEffect)(() => {
|
|
9080
9132
|
if (rolesError) {
|
|
9081
9133
|
console.error("Failed to fetch roles:", rolesError);
|
|
9082
9134
|
}
|
|
9083
9135
|
}, [rolesError]);
|
|
9084
|
-
const defaultRoleId = (0,
|
|
9136
|
+
const defaultRoleId = (0, import_react15.useMemo)(
|
|
9085
9137
|
() => roles?.find((role) => role.name === DEFAULT_ROLES.ORG_VIEWER)?.id,
|
|
9086
9138
|
[roles]
|
|
9087
9139
|
);
|
|
9088
|
-
const inviteSchema2 = (0,
|
|
9140
|
+
const inviteSchema2 = (0, import_react15.useMemo)(() => createInviteSchema(t), [t]);
|
|
9089
9141
|
const {
|
|
9090
9142
|
formState: { errors, isSubmitting },
|
|
9091
9143
|
handleSubmit,
|
|
@@ -9097,8 +9149,8 @@ var InviteUser = () => {
|
|
|
9097
9149
|
role: defaultRoleId
|
|
9098
9150
|
}
|
|
9099
9151
|
});
|
|
9100
|
-
const { mutateAsync: inviteUser } = (0,
|
|
9101
|
-
|
|
9152
|
+
const { mutateAsync: inviteUser } = (0, import_connect_query13.useMutation)(
|
|
9153
|
+
import_frontier16.FrontierServiceQueries.createOrganizationInvitation,
|
|
9102
9154
|
{
|
|
9103
9155
|
onSuccess: (data) => {
|
|
9104
9156
|
const invitedCount = data?.invitations?.length ?? 0;
|
|
@@ -9265,8 +9317,8 @@ var InviteUser = () => {
|
|
|
9265
9317
|
// admin/views/users/list/navbar.tsx
|
|
9266
9318
|
var import_jsx_runtime42 = require("react/jsx-runtime");
|
|
9267
9319
|
var Navbar2 = ({ searchQuery, onExportUsers }) => {
|
|
9268
|
-
const [showSearch, setShowSearch] = (0,
|
|
9269
|
-
const [isDownloading, setIsDownloading] = (0,
|
|
9320
|
+
const [showSearch, setShowSearch] = (0, import_react16.useState)(searchQuery ? true : false);
|
|
9321
|
+
const [isDownloading, setIsDownloading] = (0, import_react16.useState)(false);
|
|
9270
9322
|
function toggleSearch() {
|
|
9271
9323
|
setShowSearch((prev) => !prev);
|
|
9272
9324
|
}
|
|
@@ -9332,8 +9384,8 @@ var Navbar2 = ({ searchQuery, onExportUsers }) => {
|
|
|
9332
9384
|
};
|
|
9333
9385
|
var navbar_default2 = Navbar2;
|
|
9334
9386
|
|
|
9335
|
-
// esbuild-css-modules-plugin-namespace:/tmp/tmp-
|
|
9336
|
-
var digest29 = "
|
|
9387
|
+
// esbuild-css-modules-plugin-namespace:/tmp/tmp-2174-LeRb3I6EYIKK/sdk/admin/views/users/list/list.module.css.js
|
|
9388
|
+
var digest29 = "8a1ba5522724ccfea6cc2db4aef0a908778b9b08dc6f7adbe1c91e72b2ef465e";
|
|
9337
9389
|
var css29 = `._table_1jm7t_1 {
|
|
9338
9390
|
height: auto;
|
|
9339
9391
|
}
|
|
@@ -9387,8 +9439,8 @@ var list_module_css_default = { "table": "_table_1jm7t_1", "table-empty": "_tabl
|
|
|
9387
9439
|
// admin/views/users/list/columns.tsx
|
|
9388
9440
|
var import_apsara36 = require("@raystack/apsara");
|
|
9389
9441
|
|
|
9390
|
-
// esbuild-css-modules-plugin-namespace:/tmp/tmp-
|
|
9391
|
-
var digest30 = "
|
|
9442
|
+
// esbuild-css-modules-plugin-namespace:/tmp/tmp-2174-gAcVnOQAWkRg/sdk/admin/views/users/list/list.module.css.js
|
|
9443
|
+
var digest30 = "a10a20da9790383bcf487708836a20fc03ae0ea2a6c1635beacfccaa8e71565c";
|
|
9392
9444
|
var css30 = `._table_1jm7t_1 {
|
|
9393
9445
|
height: auto;
|
|
9394
9446
|
}
|
|
@@ -9530,9 +9582,8 @@ var getColumns10 = ({
|
|
|
9530
9582
|
};
|
|
9531
9583
|
|
|
9532
9584
|
// admin/views/users/list/list.tsx
|
|
9533
|
-
var
|
|
9534
|
-
var
|
|
9535
|
-
var import_hooks2 = require("@raystack/apsara/hooks");
|
|
9585
|
+
var import_connect_query14 = require("@connectrpc/connect-query");
|
|
9586
|
+
var import_frontier17 = require("@raystack/proton/frontier");
|
|
9536
9587
|
var import_jsx_runtime44 = require("react/jsx-runtime");
|
|
9537
9588
|
var NoUsers = () => {
|
|
9538
9589
|
const t = useTerminology();
|
|
@@ -9550,20 +9601,19 @@ var NoUsers = () => {
|
|
|
9550
9601
|
);
|
|
9551
9602
|
};
|
|
9552
9603
|
var DEFAULT_SORT3 = { name: "createdAt", order: "desc" };
|
|
9553
|
-
var INITIAL_QUERY3 = {
|
|
9554
|
-
offset: 0,
|
|
9555
|
-
limit: DEFAULT_PAGE_SIZE
|
|
9556
|
-
};
|
|
9557
9604
|
var UsersList = ({ onExportUsers, onNavigateToUser }) => {
|
|
9558
9605
|
const t = useTerminology();
|
|
9559
|
-
const
|
|
9560
|
-
|
|
9561
|
-
|
|
9562
|
-
|
|
9563
|
-
|
|
9564
|
-
|
|
9565
|
-
|
|
9566
|
-
|
|
9606
|
+
const {
|
|
9607
|
+
tableQuery,
|
|
9608
|
+
rqlQuery: query,
|
|
9609
|
+
onTableQueryChange
|
|
9610
|
+
} = useServerTableQuery({
|
|
9611
|
+
defaultSort: DEFAULT_SORT3,
|
|
9612
|
+
transformOptions: {
|
|
9613
|
+
fieldNameMapping: {
|
|
9614
|
+
createdAt: "created_at",
|
|
9615
|
+
updatedAt: "updated_at"
|
|
9616
|
+
}
|
|
9567
9617
|
}
|
|
9568
9618
|
});
|
|
9569
9619
|
const {
|
|
@@ -9571,10 +9621,11 @@ var UsersList = ({ onExportUsers, onNavigateToUser }) => {
|
|
|
9571
9621
|
isLoading,
|
|
9572
9622
|
isFetchingNextPage,
|
|
9573
9623
|
fetchNextPage,
|
|
9624
|
+
hasNextPage,
|
|
9574
9625
|
error,
|
|
9575
9626
|
isError
|
|
9576
|
-
} = (0,
|
|
9577
|
-
|
|
9627
|
+
} = (0, import_connect_query14.useInfiniteQuery)(
|
|
9628
|
+
import_frontier17.AdminServiceQueries.searchUsers,
|
|
9578
9629
|
{ query },
|
|
9579
9630
|
{
|
|
9580
9631
|
pageParamKey: "query",
|
|
@@ -9587,20 +9638,13 @@ var UsersList = ({ onExportUsers, onNavigateToUser }) => {
|
|
|
9587
9638
|
);
|
|
9588
9639
|
const data = infiniteData?.pages?.flatMap((page) => page?.users || []) || [];
|
|
9589
9640
|
const groupCountMap = infiniteData ? getGroupCountMapFromFirstPage(infiniteData) : {};
|
|
9590
|
-
const
|
|
9591
|
-
|
|
9592
|
-
|
|
9593
|
-
|
|
9594
|
-
|
|
9595
|
-
|
|
9596
|
-
};
|
|
9597
|
-
const handleLoadMore = async () => {
|
|
9598
|
-
try {
|
|
9599
|
-
await fetchNextPage();
|
|
9600
|
-
} catch (error2) {
|
|
9601
|
-
console.error("Error loading more users:", error2);
|
|
9602
|
-
}
|
|
9603
|
-
};
|
|
9641
|
+
const handleLoadMore = useLoadMore({
|
|
9642
|
+
hasNextPage,
|
|
9643
|
+
isFetchingNextPage,
|
|
9644
|
+
isError,
|
|
9645
|
+
fetchNextPage,
|
|
9646
|
+
label: "users"
|
|
9647
|
+
});
|
|
9604
9648
|
const columns = getColumns10({ groupCountMap, onNavigateToUser });
|
|
9605
9649
|
const loading = isLoading || isFetchingNextPage;
|
|
9606
9650
|
const onRowClick = (row) => {
|
|
@@ -9661,7 +9705,7 @@ var UsersList = ({ onExportUsers, onNavigateToUser }) => {
|
|
|
9661
9705
|
var import_apsara53 = require("@raystack/apsara");
|
|
9662
9706
|
|
|
9663
9707
|
// admin/views/users/details/layout/layout.tsx
|
|
9664
|
-
var
|
|
9708
|
+
var import_react22 = require("react");
|
|
9665
9709
|
var import_apsara46 = require("@raystack/apsara");
|
|
9666
9710
|
|
|
9667
9711
|
// admin/views/users/details/layout/side-panel.tsx
|
|
@@ -9670,8 +9714,8 @@ var import_apsara44 = require("@raystack/apsara");
|
|
|
9670
9714
|
// admin/views/users/details/layout/side-panel-details.tsx
|
|
9671
9715
|
var import_apsara38 = require("@raystack/apsara");
|
|
9672
9716
|
|
|
9673
|
-
// esbuild-css-modules-plugin-namespace:/tmp/tmp-
|
|
9674
|
-
var digest31 = "
|
|
9717
|
+
// esbuild-css-modules-plugin-namespace:/tmp/tmp-2174-Wg6oHRCXY3b5/sdk/admin/views/users/details/layout/side-panel.module.css.js
|
|
9718
|
+
var digest31 = "7e9efea0924efbd0e3a8369609de5dfb85253baacc6222848e7354254e15686b";
|
|
9675
9719
|
var css31 = `._side-panel_cosj9_1 {
|
|
9676
9720
|
transform: all 0.3s ease-in-out;
|
|
9677
9721
|
padding-bottom: var(--rs-space-15);
|
|
@@ -9738,11 +9782,11 @@ var css31 = `._side-panel_cosj9_1 {
|
|
|
9738
9782
|
var side_panel_module_css_default = { "side-panel": "_side-panel_cosj9_1", "sidePanel": "_side-panel_cosj9_1", "side-panel-label": "_side-panel-label_cosj9_6", "sidePanelLabel": "_side-panel-label_cosj9_6", "text-overflow": "_text-overflow_cosj9_10", "textOverflow": "_text-overflow_cosj9_10", "list-header": "_list-header_cosj9_18", "listHeader": "_list-header_cosj9_18", "loader-header": "_loader-header_cosj9_21", "loaderHeader": "_loader-header_cosj9_21", "dropdown-item": "_dropdown-item_cosj9_30", "dropdownItem": "_dropdown-item_cosj9_30", "dropdown-menu-trigger": "_dropdown-menu-trigger_cosj9_35", "dropdownMenuTrigger": "_dropdown-menu-trigger_cosj9_35", "listLabel": "_listLabel_cosj9_50" };
|
|
9739
9783
|
|
|
9740
9784
|
// admin/views/users/details/user-context.tsx
|
|
9741
|
-
var
|
|
9742
|
-
var UserContext = (0,
|
|
9785
|
+
var import_react17 = require("react");
|
|
9786
|
+
var UserContext = (0, import_react17.createContext)(void 0);
|
|
9743
9787
|
var UserProvider = UserContext.Provider;
|
|
9744
9788
|
var useUser = () => {
|
|
9745
|
-
const context = (0,
|
|
9789
|
+
const context = (0, import_react17.useContext)(UserContext);
|
|
9746
9790
|
if (context === void 0) {
|
|
9747
9791
|
throw new Error("useUser must be used within a UserProvider");
|
|
9748
9792
|
}
|
|
@@ -9791,8 +9835,8 @@ var SidePanelDetails2 = () => {
|
|
|
9791
9835
|
// admin/views/users/details/layout/side-panel-membership.tsx
|
|
9792
9836
|
var import_apsara42 = require("@raystack/apsara");
|
|
9793
9837
|
|
|
9794
|
-
// esbuild-css-modules-plugin-namespace:/tmp/tmp-
|
|
9795
|
-
var digest32 = "
|
|
9838
|
+
// esbuild-css-modules-plugin-namespace:/tmp/tmp-2174-JCtQc4B4low7/sdk/admin/views/users/details/layout/side-panel.module.css.js
|
|
9839
|
+
var digest32 = "f02d5784fdf9ff00f18b77b3477d2093aa3e79a68252eac890b8bcb2ec35107f";
|
|
9796
9840
|
var css32 = `._side-panel_cosj9_1 {
|
|
9797
9841
|
transform: all 0.3s ease-in-out;
|
|
9798
9842
|
padding-bottom: var(--rs-space-15);
|
|
@@ -9861,8 +9905,8 @@ var side_panel_module_css_default2 = { "side-panel": "_side-panel_cosj9_1", "sid
|
|
|
9861
9905
|
// admin/views/users/details/layout/membership-dropdown.tsx
|
|
9862
9906
|
var import_apsara41 = require("@raystack/apsara");
|
|
9863
9907
|
|
|
9864
|
-
// esbuild-css-modules-plugin-namespace:/tmp/tmp-
|
|
9865
|
-
var digest33 = "
|
|
9908
|
+
// esbuild-css-modules-plugin-namespace:/tmp/tmp-2174-2u7PNh8EyO6P/sdk/admin/views/users/details/layout/side-panel.module.css.js
|
|
9909
|
+
var digest33 = "9bb99fc55d1ba41fae3f9f17dea2b8b8bb0a0bf09f3f1714f1c0fbd02b7b565e";
|
|
9866
9910
|
var css33 = `._side-panel_cosj9_1 {
|
|
9867
9911
|
transform: all 0.3s ease-in-out;
|
|
9868
9912
|
padding-bottom: var(--rs-space-15);
|
|
@@ -9929,25 +9973,26 @@ var css33 = `._side-panel_cosj9_1 {
|
|
|
9929
9973
|
var side_panel_module_css_default3 = { "side-panel": "_side-panel_cosj9_1", "sidePanel": "_side-panel_cosj9_1", "side-panel-label": "_side-panel-label_cosj9_6", "sidePanelLabel": "_side-panel-label_cosj9_6", "text-overflow": "_text-overflow_cosj9_10", "textOverflow": "_text-overflow_cosj9_10", "list-header": "_list-header_cosj9_18", "listHeader": "_list-header_cosj9_18", "loader-header": "_loader-header_cosj9_21", "loaderHeader": "_loader-header_cosj9_21", "dropdown-item": "_dropdown-item_cosj9_30", "dropdownItem": "_dropdown-item_cosj9_30", "dropdown-menu-trigger": "_dropdown-menu-trigger_cosj9_35", "dropdownMenuTrigger": "_dropdown-menu-trigger_cosj9_35", "listLabel": "_listLabel_cosj9_50" };
|
|
9930
9974
|
|
|
9931
9975
|
// admin/views/users/details/layout/membership-dropdown.tsx
|
|
9932
|
-
var
|
|
9933
|
-
var
|
|
9934
|
-
var
|
|
9976
|
+
var import_react20 = require("react");
|
|
9977
|
+
var import_frontier20 = require("@raystack/proton/frontier");
|
|
9978
|
+
var import_protobuf8 = require("@bufbuild/protobuf");
|
|
9935
9979
|
|
|
9936
9980
|
// admin/hooks/useOrganizationRoles.ts
|
|
9937
|
-
var
|
|
9938
|
-
var
|
|
9939
|
-
var
|
|
9940
|
-
var
|
|
9981
|
+
var import_react18 = require("react");
|
|
9982
|
+
var import_connect_query15 = require("@connectrpc/connect-query");
|
|
9983
|
+
var import_protobuf6 = require("@bufbuild/protobuf");
|
|
9984
|
+
var import_frontier18 = require("@raystack/proton/frontier");
|
|
9941
9985
|
var useOrganizationRoles = (orgId, { enabled = true } = {}) => {
|
|
9942
9986
|
const {
|
|
9943
9987
|
data: defaultRoles = [],
|
|
9944
9988
|
isLoading: isDefaultRolesLoading,
|
|
9945
9989
|
error: defaultRolesError
|
|
9946
|
-
} = (0,
|
|
9947
|
-
|
|
9948
|
-
(0,
|
|
9990
|
+
} = (0, import_connect_query15.useQuery)(
|
|
9991
|
+
import_frontier18.FrontierServiceQueries.listRoles,
|
|
9992
|
+
(0, import_protobuf6.create)(import_frontier18.ListRolesRequestSchema, { scopes: [SCOPES.ORG] }),
|
|
9949
9993
|
{
|
|
9950
9994
|
enabled,
|
|
9995
|
+
staleTime: SHARED_QUERY_STALE_TIME,
|
|
9951
9996
|
select: (data) => data?.roles || []
|
|
9952
9997
|
}
|
|
9953
9998
|
);
|
|
@@ -9955,18 +10000,19 @@ var useOrganizationRoles = (orgId, { enabled = true } = {}) => {
|
|
|
9955
10000
|
data: organizationRoles = [],
|
|
9956
10001
|
isLoading: isOrgRolesLoading,
|
|
9957
10002
|
error: orgRolesError
|
|
9958
|
-
} = (0,
|
|
9959
|
-
|
|
9960
|
-
(0,
|
|
10003
|
+
} = (0, import_connect_query15.useQuery)(
|
|
10004
|
+
import_frontier18.FrontierServiceQueries.listOrganizationRoles,
|
|
10005
|
+
(0, import_protobuf6.create)(import_frontier18.ListOrganizationRolesRequestSchema, {
|
|
9961
10006
|
orgId: orgId || "",
|
|
9962
10007
|
scopes: [SCOPES.ORG]
|
|
9963
10008
|
}),
|
|
9964
10009
|
{
|
|
9965
10010
|
enabled: enabled && !!orgId,
|
|
10011
|
+
staleTime: SHARED_QUERY_STALE_TIME,
|
|
9966
10012
|
select: (data) => data?.roles || []
|
|
9967
10013
|
}
|
|
9968
10014
|
);
|
|
9969
|
-
(0,
|
|
10015
|
+
(0, import_react18.useEffect)(() => {
|
|
9970
10016
|
if (defaultRolesError) {
|
|
9971
10017
|
console.error("Failed to fetch default roles:", defaultRolesError);
|
|
9972
10018
|
}
|
|
@@ -9974,11 +10020,11 @@ var useOrganizationRoles = (orgId, { enabled = true } = {}) => {
|
|
|
9974
10020
|
console.error("Failed to fetch organization roles:", orgRolesError);
|
|
9975
10021
|
}
|
|
9976
10022
|
}, [defaultRolesError, orgRolesError]);
|
|
9977
|
-
const roles = (0,
|
|
10023
|
+
const roles = (0, import_react18.useMemo)(
|
|
9978
10024
|
() => [...defaultRoles, ...organizationRoles],
|
|
9979
10025
|
[defaultRoles, organizationRoles]
|
|
9980
10026
|
);
|
|
9981
|
-
const titleById = (0,
|
|
10027
|
+
const titleById = (0, import_react18.useMemo)(
|
|
9982
10028
|
() => new Map(roles.map((role) => [role.id, role.title || role.name])),
|
|
9983
10029
|
[roles]
|
|
9984
10030
|
);
|
|
@@ -9992,10 +10038,10 @@ var useOrganizationRoles = (orgId, { enabled = true } = {}) => {
|
|
|
9992
10038
|
|
|
9993
10039
|
// admin/components/AssignRole.tsx
|
|
9994
10040
|
var import_apsara39 = require("@raystack/apsara");
|
|
9995
|
-
var
|
|
9996
|
-
var
|
|
9997
|
-
var
|
|
9998
|
-
var
|
|
10041
|
+
var import_frontier19 = require("@raystack/proton/frontier");
|
|
10042
|
+
var import_protobuf7 = require("@bufbuild/protobuf");
|
|
10043
|
+
var import_connect3 = require("@connectrpc/connect");
|
|
10044
|
+
var import_connect_query16 = require("@connectrpc/connect-query");
|
|
9999
10045
|
var import_react_hook_form2 = require("react-hook-form");
|
|
10000
10046
|
var import_zod2 = require("@hookform/resolvers/zod");
|
|
10001
10047
|
var import_jsx_runtime46 = require("react/jsx-runtime");
|
|
@@ -10021,14 +10067,14 @@ var AssignRole = ({
|
|
|
10021
10067
|
},
|
|
10022
10068
|
resolver: (0, import_zod2.zodResolver)(formSchema)
|
|
10023
10069
|
});
|
|
10024
|
-
const { mutateAsync: setMemberRole } = (0,
|
|
10025
|
-
|
|
10070
|
+
const { mutateAsync: setMemberRole } = (0, import_connect_query16.useMutation)(
|
|
10071
|
+
import_frontier19.FrontierServiceQueries.setOrganizationMemberRole
|
|
10026
10072
|
);
|
|
10027
10073
|
const selectedRoleId = watch("roleId");
|
|
10028
10074
|
const onSubmit = async (data) => {
|
|
10029
10075
|
try {
|
|
10030
10076
|
await setMemberRole(
|
|
10031
|
-
(0,
|
|
10077
|
+
(0, import_protobuf7.create)(import_frontier19.SetOrganizationMemberRoleRequestSchema, {
|
|
10032
10078
|
orgId: organizationId,
|
|
10033
10079
|
userId: user?.id,
|
|
10034
10080
|
roleId: data.roleId
|
|
@@ -10044,7 +10090,7 @@ var AssignRole = ({
|
|
|
10044
10090
|
} catch (error) {
|
|
10045
10091
|
import_apsara39.toastManager.add({
|
|
10046
10092
|
title: "Failed to assign role",
|
|
10047
|
-
description: error instanceof
|
|
10093
|
+
description: error instanceof import_connect3.ConnectError ? error.message : void 0,
|
|
10048
10094
|
type: "error"
|
|
10049
10095
|
});
|
|
10050
10096
|
console.error(error);
|
|
@@ -10113,7 +10159,7 @@ var AssignRole = ({
|
|
|
10113
10159
|
};
|
|
10114
10160
|
|
|
10115
10161
|
// admin/views/users/details/layout/suspend-user.tsx
|
|
10116
|
-
var
|
|
10162
|
+
var import_react19 = require("react");
|
|
10117
10163
|
var import_apsara40 = require("@raystack/apsara");
|
|
10118
10164
|
var import_jsx_runtime47 = require("react/jsx-runtime");
|
|
10119
10165
|
var SuspendUser = ({
|
|
@@ -10122,7 +10168,7 @@ var SuspendUser = ({
|
|
|
10122
10168
|
onSubmit
|
|
10123
10169
|
}) => {
|
|
10124
10170
|
const t = useTerminology();
|
|
10125
|
-
const [isSubmitting, setIsSubmitting] = (0,
|
|
10171
|
+
const [isSubmitting, setIsSubmitting] = (0, import_react19.useState)(false);
|
|
10126
10172
|
const handleSuspend = async () => {
|
|
10127
10173
|
try {
|
|
10128
10174
|
setIsSubmitting(true);
|
|
@@ -10186,8 +10232,8 @@ var MembershipDropdown = ({
|
|
|
10186
10232
|
data,
|
|
10187
10233
|
onReset
|
|
10188
10234
|
}) => {
|
|
10189
|
-
const [isAssignRoleDialogOpen, setIsAssignRoleDialogOpen] = (0,
|
|
10190
|
-
const [isSuspendDialogOpen, setIsSuspendDialogOpen] = (0,
|
|
10235
|
+
const [isAssignRoleDialogOpen, setIsAssignRoleDialogOpen] = (0, import_react20.useState)(false);
|
|
10236
|
+
const [isSuspendDialogOpen, setIsSuspendDialogOpen] = (0, import_react20.useState)(false);
|
|
10191
10237
|
const { user } = useUser();
|
|
10192
10238
|
const { roles, isLoading } = useOrganizationRoles(data?.orgId);
|
|
10193
10239
|
const toggleAssignRoleDialog = () => {
|
|
@@ -10204,9 +10250,9 @@ var MembershipDropdown = ({
|
|
|
10204
10250
|
toggleSuspendDialog();
|
|
10205
10251
|
onReset?.();
|
|
10206
10252
|
};
|
|
10207
|
-
const memoizedUser = (0,
|
|
10208
|
-
() => (0,
|
|
10209
|
-
|
|
10253
|
+
const memoizedUser = (0, import_react20.useMemo)(
|
|
10254
|
+
() => (0, import_protobuf8.create)(
|
|
10255
|
+
import_frontier20.SearchOrganizationUsersResponse_OrganizationUserSchema,
|
|
10210
10256
|
Object.assign(user ?? {}, {
|
|
10211
10257
|
roleNames: data?.roleNames || [],
|
|
10212
10258
|
roleTitles: data?.roleTitles || [],
|
|
@@ -10305,10 +10351,10 @@ var SidePanelMembership = ({
|
|
|
10305
10351
|
|
|
10306
10352
|
// admin/views/users/details/layout/side-panel-invitation.tsx
|
|
10307
10353
|
var import_apsara43 = require("@raystack/apsara");
|
|
10308
|
-
var
|
|
10354
|
+
var import_react21 = require("react");
|
|
10309
10355
|
|
|
10310
|
-
// esbuild-css-modules-plugin-namespace:/tmp/tmp-
|
|
10311
|
-
var digest34 = "
|
|
10356
|
+
// esbuild-css-modules-plugin-namespace:/tmp/tmp-2174-Ltp3ZRc6Mixx/sdk/admin/views/users/details/layout/side-panel.module.css.js
|
|
10357
|
+
var digest34 = "d10f34997944849a8a820a50150e59c12b2d3dcd273ead1a0cd54cacea9695ba";
|
|
10312
10358
|
var css34 = `._side-panel_cosj9_1 {
|
|
10313
10359
|
transform: all 0.3s ease-in-out;
|
|
10314
10360
|
padding-bottom: var(--rs-space-15);
|
|
@@ -10383,7 +10429,7 @@ var SidePanelInvitation = ({
|
|
|
10383
10429
|
}) => {
|
|
10384
10430
|
const { data: org } = useOrganizationLookup(data?.orgId);
|
|
10385
10431
|
const { titleById } = useOrganizationRoles(data?.orgId);
|
|
10386
|
-
const roleTitles = (0,
|
|
10432
|
+
const roleTitles = (0, import_react21.useMemo)(
|
|
10387
10433
|
() => (data?.roleIds || []).map((roleId) => titleById.get(roleId)).filter(Boolean).join(", "),
|
|
10388
10434
|
[titleById, data?.roleIds]
|
|
10389
10435
|
);
|
|
@@ -10429,8 +10475,8 @@ var SidePanelInvitation = ({
|
|
|
10429
10475
|
] });
|
|
10430
10476
|
};
|
|
10431
10477
|
|
|
10432
|
-
// esbuild-css-modules-plugin-namespace:/tmp/tmp-
|
|
10433
|
-
var digest35 = "
|
|
10478
|
+
// esbuild-css-modules-plugin-namespace:/tmp/tmp-2174-MrT6lNaEPk2w/sdk/admin/views/users/details/layout/side-panel.module.css.js
|
|
10479
|
+
var digest35 = "5e01d580c9700f6b5a3d52fef45251fce1e91964aa227b2764e9f6a8f21ce723";
|
|
10434
10480
|
var css35 = `._side-panel_cosj9_1 {
|
|
10435
10481
|
transform: all 0.3s ease-in-out;
|
|
10436
10482
|
padding-bottom: var(--rs-space-15);
|
|
@@ -10497,8 +10543,8 @@ var css35 = `._side-panel_cosj9_1 {
|
|
|
10497
10543
|
var side_panel_module_css_default5 = { "side-panel": "_side-panel_cosj9_1", "sidePanel": "_side-panel_cosj9_1", "side-panel-label": "_side-panel-label_cosj9_6", "sidePanelLabel": "_side-panel-label_cosj9_6", "text-overflow": "_text-overflow_cosj9_10", "textOverflow": "_text-overflow_cosj9_10", "list-header": "_list-header_cosj9_18", "listHeader": "_list-header_cosj9_18", "loader-header": "_loader-header_cosj9_21", "loaderHeader": "_loader-header_cosj9_21", "dropdown-item": "_dropdown-item_cosj9_30", "dropdownItem": "_dropdown-item_cosj9_30", "dropdown-menu-trigger": "_dropdown-menu-trigger_cosj9_35", "dropdownMenuTrigger": "_dropdown-menu-trigger_cosj9_35", "listLabel": "_listLabel_cosj9_50" };
|
|
10498
10544
|
|
|
10499
10545
|
// admin/views/users/details/layout/side-panel.tsx
|
|
10500
|
-
var
|
|
10501
|
-
var
|
|
10546
|
+
var import_frontier21 = require("@raystack/proton/frontier");
|
|
10547
|
+
var import_connect_query17 = require("@connectrpc/connect-query");
|
|
10502
10548
|
var import_jsx_runtime51 = require("react/jsx-runtime");
|
|
10503
10549
|
var UserDetailsSidePanel = () => {
|
|
10504
10550
|
const { user } = useUser();
|
|
@@ -10507,8 +10553,8 @@ var UserDetailsSidePanel = () => {
|
|
|
10507
10553
|
isLoading,
|
|
10508
10554
|
refetch: onReset,
|
|
10509
10555
|
error
|
|
10510
|
-
} = (0,
|
|
10511
|
-
|
|
10556
|
+
} = (0, import_connect_query17.useQuery)(
|
|
10557
|
+
import_frontier21.AdminServiceQueries.searchUserOrganizations,
|
|
10512
10558
|
{
|
|
10513
10559
|
id: user?.id || "",
|
|
10514
10560
|
query: {}
|
|
@@ -10523,8 +10569,8 @@ var UserDetailsSidePanel = () => {
|
|
|
10523
10569
|
data: invitationsResponse,
|
|
10524
10570
|
isLoading: isInvitationsLoading,
|
|
10525
10571
|
error: invitationsError
|
|
10526
|
-
} = (0,
|
|
10527
|
-
|
|
10572
|
+
} = (0, import_connect_query17.useQuery)(
|
|
10573
|
+
import_frontier21.FrontierServiceQueries.listUserInvitations,
|
|
10528
10574
|
// `id` is the user's email, not their uuid — invitations are keyed by email
|
|
10529
10575
|
// since the invitee may not have an account yet.
|
|
10530
10576
|
{
|
|
@@ -10573,8 +10619,8 @@ var UserDetailsSidePanel = () => {
|
|
|
10573
10619
|
);
|
|
10574
10620
|
};
|
|
10575
10621
|
|
|
10576
|
-
// esbuild-css-modules-plugin-namespace:/tmp/tmp-
|
|
10577
|
-
var digest36 = "
|
|
10622
|
+
// esbuild-css-modules-plugin-namespace:/tmp/tmp-2174-c8dvuUmHzHfN/sdk/admin/views/users/details/layout/layout.module.css.js
|
|
10623
|
+
var digest36 = "ac84cfb165afb9ae59916e0736fba02409b1aa3129e3251c731d30b4c609ee2d";
|
|
10578
10624
|
var css36 = `._page_190wz_1 {
|
|
10579
10625
|
height: 100vh;
|
|
10580
10626
|
width: 100%;
|
|
@@ -10608,8 +10654,8 @@ var layout_module_css_default = { "page": "_page_190wz_1", "main_content": "_mai
|
|
|
10608
10654
|
var import_apsara45 = require("@raystack/apsara");
|
|
10609
10655
|
var import_icons = require("@raystack/apsara/icons");
|
|
10610
10656
|
|
|
10611
|
-
// esbuild-css-modules-plugin-namespace:/tmp/tmp-
|
|
10612
|
-
var digest37 = "
|
|
10657
|
+
// esbuild-css-modules-plugin-namespace:/tmp/tmp-2174-jE4Mw8vW45Kw/sdk/admin/components/navbar.module.css.js
|
|
10658
|
+
var digest37 = "56f8249bcbf542ad3cc3cca02b078b8656735e89efcea630fa54cd9766a1ec83";
|
|
10613
10659
|
var css37 = `._navbar_641ya_1 {
|
|
10614
10660
|
padding: var(--rs-space-4) var(--rs-space-7);
|
|
10615
10661
|
border-bottom: 0.5px solid var(--rs-color-border-base-primary);
|
|
@@ -10710,7 +10756,7 @@ var UserDetailsNavbar = ({
|
|
|
10710
10756
|
// admin/views/users/details/layout/layout.tsx
|
|
10711
10757
|
var import_jsx_runtime53 = require("react/jsx-runtime");
|
|
10712
10758
|
var UserDetailsLayout = ({ children, currentPath, onNavigate }) => {
|
|
10713
|
-
const [showSidePanel, setShowSidePanel] = (0,
|
|
10759
|
+
const [showSidePanel, setShowSidePanel] = (0, import_react22.useState)(true);
|
|
10714
10760
|
function toggleSidePanel() {
|
|
10715
10761
|
setShowSidePanel(!showSidePanel);
|
|
10716
10762
|
}
|
|
@@ -10730,32 +10776,32 @@ var UserDetailsLayout = ({ children, currentPath, onNavigate }) => {
|
|
|
10730
10776
|
};
|
|
10731
10777
|
|
|
10732
10778
|
// admin/views/users/details/user-details.tsx
|
|
10733
|
-
var
|
|
10734
|
-
var
|
|
10779
|
+
var import_connect_query20 = require("@connectrpc/connect-query");
|
|
10780
|
+
var import_frontier24 = require("@raystack/proton/frontier");
|
|
10735
10781
|
|
|
10736
10782
|
// admin/views/users/details/security/security.tsx
|
|
10737
10783
|
var import_apsara52 = require("@raystack/apsara");
|
|
10738
10784
|
|
|
10739
10785
|
// admin/views/users/details/security/block-user.tsx
|
|
10740
|
-
var
|
|
10786
|
+
var import_react23 = require("react");
|
|
10741
10787
|
var import_apsara47 = require("@raystack/apsara");
|
|
10742
|
-
var
|
|
10743
|
-
var
|
|
10744
|
-
var
|
|
10788
|
+
var import_connect_query18 = require("@connectrpc/connect-query");
|
|
10789
|
+
var import_frontier22 = require("@raystack/proton/frontier");
|
|
10790
|
+
var import_react_query6 = require("@tanstack/react-query");
|
|
10745
10791
|
var import_jsx_runtime54 = require("react/jsx-runtime");
|
|
10746
10792
|
var BlockUserDialog = () => {
|
|
10747
10793
|
const t = useTerminology();
|
|
10748
|
-
const [isDialogOpen, setIsDialogOpen] = (0,
|
|
10794
|
+
const [isDialogOpen, setIsDialogOpen] = (0, import_react23.useState)(false);
|
|
10749
10795
|
const { user, reset } = useUser();
|
|
10750
|
-
const queryClient = (0,
|
|
10751
|
-
const transport = (0,
|
|
10796
|
+
const queryClient = (0, import_react_query6.useQueryClient)();
|
|
10797
|
+
const transport = (0, import_connect_query18.useTransport)();
|
|
10752
10798
|
const isActive = user?.state === "enabled";
|
|
10753
10799
|
const userName = getUserName(user);
|
|
10754
|
-
const optimisticUpdateState = (0,
|
|
10800
|
+
const optimisticUpdateState = (0, import_react23.useCallback)(
|
|
10755
10801
|
(state) => {
|
|
10756
10802
|
queryClient.setQueryData(
|
|
10757
|
-
(0,
|
|
10758
|
-
schema:
|
|
10803
|
+
(0, import_connect_query18.createConnectQueryKey)({
|
|
10804
|
+
schema: import_frontier22.FrontierServiceQueries.getUser,
|
|
10759
10805
|
transport,
|
|
10760
10806
|
input: { id: user?.id || "" },
|
|
10761
10807
|
cardinality: "finite"
|
|
@@ -10772,8 +10818,8 @@ var BlockUserDialog = () => {
|
|
|
10772
10818
|
},
|
|
10773
10819
|
[queryClient, transport, user?.id]
|
|
10774
10820
|
);
|
|
10775
|
-
const { mutateAsync: blockUser, isPending: isBlockingUser } = (0,
|
|
10776
|
-
|
|
10821
|
+
const { mutateAsync: blockUser, isPending: isBlockingUser } = (0, import_connect_query18.useMutation)(
|
|
10822
|
+
import_frontier22.FrontierServiceQueries.disableUser,
|
|
10777
10823
|
{
|
|
10778
10824
|
onSuccess: () => {
|
|
10779
10825
|
import_apsara47.toastManager.add({ title: `${t.user({ case: "capital" })} blocked successfully`, type: "success" });
|
|
@@ -10783,8 +10829,8 @@ var BlockUserDialog = () => {
|
|
|
10783
10829
|
}
|
|
10784
10830
|
}
|
|
10785
10831
|
);
|
|
10786
|
-
const { mutateAsync: unblockUser, isPending: isUnblockingUser } = (0,
|
|
10787
|
-
|
|
10832
|
+
const { mutateAsync: unblockUser, isPending: isUnblockingUser } = (0, import_connect_query18.useMutation)(
|
|
10833
|
+
import_frontier22.FrontierServiceQueries.enableUser,
|
|
10788
10834
|
{
|
|
10789
10835
|
onSuccess: () => {
|
|
10790
10836
|
import_apsara47.toastManager.add({ title: `${t.user({ case: "capital" })} unblocked successfully`, type: "success" });
|
|
@@ -10882,11 +10928,11 @@ var BlockUserDialog = () => {
|
|
|
10882
10928
|
};
|
|
10883
10929
|
|
|
10884
10930
|
// admin/views/users/details/security/sessions/index.tsx
|
|
10885
|
-
var
|
|
10931
|
+
var import_react25 = require("react");
|
|
10886
10932
|
var import_apsara51 = require("@raystack/apsara");
|
|
10887
10933
|
|
|
10888
10934
|
// admin/views/users/details/security/sessions/revoke-session-confirm.tsx
|
|
10889
|
-
var
|
|
10935
|
+
var import_react24 = require("react");
|
|
10890
10936
|
var import_apsara49 = require("@raystack/apsara");
|
|
10891
10937
|
|
|
10892
10938
|
// admin/views/users/details/security/sessions/revoke-session-final-confirm.tsx
|
|
@@ -10954,8 +11000,8 @@ var RevokeSessionFinalConfirm = ({
|
|
|
10954
11000
|
] }) });
|
|
10955
11001
|
};
|
|
10956
11002
|
|
|
10957
|
-
// esbuild-css-modules-plugin-namespace:/tmp/tmp-
|
|
10958
|
-
var digest38 = "
|
|
11003
|
+
// esbuild-css-modules-plugin-namespace:/tmp/tmp-2174-UVOEzI7s0aCH/sdk/admin/views/users/details/security/sessions/sessions.module.css.js
|
|
11004
|
+
var digest38 = "d89971f4ef2a7e9a96aa846d3d0e8c33721011679e32e59cec32eeb2b210d875";
|
|
10959
11005
|
var css38 = `._sessionsContainer_jptao_1 {
|
|
10960
11006
|
border: 1px solid var(--rs-color-border-base-primary);
|
|
10961
11007
|
border-radius: var(--rs-radius-2);
|
|
@@ -11018,7 +11064,7 @@ var sessions_module_css_default = { "sessionsContainer": "_sessionsContainer_jpt
|
|
|
11018
11064
|
// admin/views/users/details/security/sessions/revoke-session-confirm.tsx
|
|
11019
11065
|
var import_jsx_runtime56 = require("react/jsx-runtime");
|
|
11020
11066
|
var RevokeSessionConfirm = ({ isOpen, onOpenChange, sessionInfo, onRevokeConfirm, isLoading = false }) => {
|
|
11021
|
-
const [isFinalConfirmOpen, setIsFinalConfirmOpen] = (0,
|
|
11067
|
+
const [isFinalConfirmOpen, setIsFinalConfirmOpen] = (0, import_react24.useState)(false);
|
|
11022
11068
|
const handleRevoke = () => {
|
|
11023
11069
|
setIsFinalConfirmOpen(true);
|
|
11024
11070
|
};
|
|
@@ -11092,8 +11138,8 @@ var RevokeSessionConfirm = ({ isOpen, onOpenChange, sessionInfo, onRevokeConfirm
|
|
|
11092
11138
|
// admin/views/users/details/security/sessions/session-skeleton.tsx
|
|
11093
11139
|
var import_apsara50 = require("@raystack/apsara");
|
|
11094
11140
|
|
|
11095
|
-
// esbuild-css-modules-plugin-namespace:/tmp/tmp-
|
|
11096
|
-
var digest39 = "
|
|
11141
|
+
// esbuild-css-modules-plugin-namespace:/tmp/tmp-2174-GU9QcCH4ndoA/sdk/admin/views/users/details/security/sessions/sessions.module.css.js
|
|
11142
|
+
var digest39 = "5143948c869c8ef264f83097ea24c0e595d4e3db064d98ce52afaf2f4d4b5547";
|
|
11097
11143
|
var css39 = `._sessionsContainer_jptao_1 {
|
|
11098
11144
|
border: 1px solid var(--rs-color-border-base-primary);
|
|
11099
11145
|
border-radius: var(--rs-radius-2);
|
|
@@ -11166,14 +11212,14 @@ var SessionSkeleton = ({ count = 3 }) => {
|
|
|
11166
11212
|
};
|
|
11167
11213
|
|
|
11168
11214
|
// admin/views/users/details/security/sessions/index.tsx
|
|
11169
|
-
var
|
|
11170
|
-
var
|
|
11171
|
-
var
|
|
11215
|
+
var import_connect_query19 = require("@connectrpc/connect-query");
|
|
11216
|
+
var import_react_query7 = require("@tanstack/react-query");
|
|
11217
|
+
var import_frontier23 = require("@raystack/proton/frontier");
|
|
11172
11218
|
var import_dayjs3 = __toESM(require("dayjs"));
|
|
11173
11219
|
var import_relativeTime2 = __toESM(require("dayjs/plugin/relativeTime"));
|
|
11174
11220
|
|
|
11175
|
-
// esbuild-css-modules-plugin-namespace:/tmp/tmp-
|
|
11176
|
-
var digest40 = "
|
|
11221
|
+
// esbuild-css-modules-plugin-namespace:/tmp/tmp-2174-CePJTJi8GHXT/sdk/admin/views/users/details/security/sessions/sessions.module.css.js
|
|
11222
|
+
var digest40 = "3c99cd0ba62ec1e93fe5ed838760d6330491a936a44bb33b532578a29ce87d0a";
|
|
11177
11223
|
var css40 = `._sessionsContainer_jptao_1 {
|
|
11178
11224
|
border: 1px solid var(--rs-color-border-base-primary);
|
|
11179
11225
|
border-radius: var(--rs-radius-2);
|
|
@@ -11265,16 +11311,16 @@ var formatDeviceDisplay = (browser, operatingSystem) => {
|
|
|
11265
11311
|
};
|
|
11266
11312
|
var UserSessions = () => {
|
|
11267
11313
|
const { user } = useUser();
|
|
11268
|
-
const queryClient = (0,
|
|
11269
|
-
const transport = (0,
|
|
11270
|
-
const [isRevokeDialogOpen, setIsRevokeDialogOpen] = (0,
|
|
11271
|
-
const [selectedSession, setSelectedSession] = (0,
|
|
11314
|
+
const queryClient = (0, import_react_query7.useQueryClient)();
|
|
11315
|
+
const transport = (0, import_connect_query19.useTransport)();
|
|
11316
|
+
const [isRevokeDialogOpen, setIsRevokeDialogOpen] = (0, import_react25.useState)(false);
|
|
11317
|
+
const [selectedSession, setSelectedSession] = (0, import_react25.useState)(null);
|
|
11272
11318
|
const {
|
|
11273
11319
|
data: sessionsData,
|
|
11274
11320
|
isLoading,
|
|
11275
11321
|
error
|
|
11276
|
-
} = (0,
|
|
11277
|
-
|
|
11322
|
+
} = (0, import_connect_query19.useQuery)(
|
|
11323
|
+
import_frontier23.AdminServiceQueries.listUserSessions,
|
|
11278
11324
|
{ userId: user?.id || "" },
|
|
11279
11325
|
{
|
|
11280
11326
|
enabled: !!user?.id
|
|
@@ -11283,11 +11329,11 @@ var UserSessions = () => {
|
|
|
11283
11329
|
const {
|
|
11284
11330
|
mutate: revokeUserSession,
|
|
11285
11331
|
isPending: isRevokingSession
|
|
11286
|
-
} = (0,
|
|
11332
|
+
} = (0, import_connect_query19.useMutation)(import_frontier23.AdminServiceQueries.revokeUserSession, {
|
|
11287
11333
|
onSuccess: () => {
|
|
11288
11334
|
queryClient.invalidateQueries({
|
|
11289
|
-
queryKey: (0,
|
|
11290
|
-
schema:
|
|
11335
|
+
queryKey: (0, import_connect_query19.createConnectQueryKey)({
|
|
11336
|
+
schema: import_frontier23.AdminServiceQueries.listUserSessions,
|
|
11291
11337
|
transport,
|
|
11292
11338
|
input: { userId: user?.id || "" },
|
|
11293
11339
|
cardinality: "finite"
|
|
@@ -11382,8 +11428,8 @@ var UserSessions = () => {
|
|
|
11382
11428
|
] });
|
|
11383
11429
|
};
|
|
11384
11430
|
|
|
11385
|
-
// esbuild-css-modules-plugin-namespace:/tmp/tmp-
|
|
11386
|
-
var digest41 = "
|
|
11431
|
+
// esbuild-css-modules-plugin-namespace:/tmp/tmp-2174-vAKayzNBMkDQ/sdk/admin/views/users/details/security/security.module.css.js
|
|
11432
|
+
var digest41 = "be454821a823e28ee79cf09b44ff8d4518f112b46830a3ac360445973665a8f7";
|
|
11387
11433
|
var css41 = `._container_4259p_1 {
|
|
11388
11434
|
width: 100%;
|
|
11389
11435
|
}
|
|
@@ -11439,8 +11485,8 @@ var UserDetailContent = ({ user, refetch, currentPath, onNavigate }) => {
|
|
|
11439
11485
|
};
|
|
11440
11486
|
var UserDetailsByUserId = ({ userId, currentPath, onNavigate }) => {
|
|
11441
11487
|
const t = useTerminology();
|
|
11442
|
-
const { data, isLoading, refetch } = (0,
|
|
11443
|
-
|
|
11488
|
+
const { data, isLoading, refetch } = (0, import_connect_query20.useQuery)(
|
|
11489
|
+
import_frontier24.FrontierServiceQueries.getUser,
|
|
11444
11490
|
{ id: userId },
|
|
11445
11491
|
{
|
|
11446
11492
|
enabled: !!userId,
|
|
@@ -11503,14 +11549,14 @@ function UsersView({
|
|
|
11503
11549
|
// admin/views/organizations/list/index.tsx
|
|
11504
11550
|
var import_apsara58 = require("@raystack/apsara");
|
|
11505
11551
|
var import_icons3 = require("@raystack/apsara/icons");
|
|
11506
|
-
var
|
|
11552
|
+
var import_react29 = require("react");
|
|
11507
11553
|
|
|
11508
11554
|
// admin/views/organizations/list/navbar.tsx
|
|
11509
11555
|
var import_apsara54 = require("@raystack/apsara");
|
|
11510
11556
|
var import_icons2 = require("@raystack/apsara/icons");
|
|
11511
11557
|
|
|
11512
|
-
// esbuild-css-modules-plugin-namespace:/tmp/tmp-
|
|
11513
|
-
var digest42 = "
|
|
11558
|
+
// esbuild-css-modules-plugin-namespace:/tmp/tmp-2174-dTWDKDmc4z1V/sdk/admin/components/navbar.module.css.js
|
|
11559
|
+
var digest42 = "9aa29f5802aeb30b3ccaa72c0fba49f0d6630d3c2781150b7bf47ab984e1562c";
|
|
11514
11560
|
var css42 = `._navbar_641ya_1 {
|
|
11515
11561
|
padding: var(--rs-space-4) var(--rs-space-7);
|
|
11516
11562
|
border-bottom: 0.5px solid var(--rs-color-border-base-primary);
|
|
@@ -11539,7 +11585,7 @@ var css42 = `._navbar_641ya_1 {
|
|
|
11539
11585
|
var navbar_module_css_default5 = { "navbar": "_navbar_641ya_1", "nav-chip": "_nav-chip_641ya_11", "navChip": "_nav-chip_641ya_11" };
|
|
11540
11586
|
|
|
11541
11587
|
// admin/views/organizations/list/navbar.tsx
|
|
11542
|
-
var
|
|
11588
|
+
var import_react26 = require("react");
|
|
11543
11589
|
var import_jsx_runtime62 = require("react/jsx-runtime");
|
|
11544
11590
|
var OrganizationsNavabar = ({
|
|
11545
11591
|
searchQuery,
|
|
@@ -11547,8 +11593,8 @@ var OrganizationsNavabar = ({
|
|
|
11547
11593
|
onExportCsv
|
|
11548
11594
|
}) => {
|
|
11549
11595
|
const t = useTerminology();
|
|
11550
|
-
const [showSearch, setShowSearch] = (0,
|
|
11551
|
-
const [isDownloading, setIsDownloading] = (0,
|
|
11596
|
+
const [showSearch, setShowSearch] = (0, import_react26.useState)(searchQuery ? true : false);
|
|
11597
|
+
const [isDownloading, setIsDownloading] = (0, import_react26.useState)(false);
|
|
11552
11598
|
function toggleSearch() {
|
|
11553
11599
|
setShowSearch((prev) => !prev);
|
|
11554
11600
|
}
|
|
@@ -11626,8 +11672,8 @@ var OrganizationsNavabar = ({
|
|
|
11626
11672
|
] });
|
|
11627
11673
|
};
|
|
11628
11674
|
|
|
11629
|
-
// esbuild-css-modules-plugin-namespace:/tmp/tmp-
|
|
11630
|
-
var digest43 = "
|
|
11675
|
+
// esbuild-css-modules-plugin-namespace:/tmp/tmp-2174-U8kSii3Kl796/sdk/admin/views/organizations/list/list.module.css.js
|
|
11676
|
+
var digest43 = "7c6452b623433c27ef45e29d997659af1b2b354596fb4db280f80d7c5f70fbe2";
|
|
11631
11677
|
var css43 = `._table_w4mi3_1 {
|
|
11632
11678
|
height: auto;
|
|
11633
11679
|
}
|
|
@@ -11725,8 +11771,8 @@ var list_module_css_default3 = { "table": "_table_w4mi3_1", "table-empty": "_tab
|
|
|
11725
11771
|
// admin/views/organizations/list/columns.tsx
|
|
11726
11772
|
var import_apsara55 = require("@raystack/apsara");
|
|
11727
11773
|
|
|
11728
|
-
// esbuild-css-modules-plugin-namespace:/tmp/tmp-
|
|
11729
|
-
var digest44 = "
|
|
11774
|
+
// esbuild-css-modules-plugin-namespace:/tmp/tmp-2174-l4g7eY8LpaKl/sdk/admin/views/organizations/list/list.module.css.js
|
|
11775
|
+
var digest44 = "ed47e8430652326f197347aa4a6a77a517305d84c5c30ec2f19928df8da7c45a";
|
|
11730
11776
|
var css44 = `._table_w4mi3_1 {
|
|
11731
11777
|
height: auto;
|
|
11732
11778
|
}
|
|
@@ -11969,15 +12015,15 @@ var getColumns11 = ({
|
|
|
11969
12015
|
};
|
|
11970
12016
|
|
|
11971
12017
|
// admin/views/organizations/list/index.tsx
|
|
11972
|
-
var
|
|
11973
|
-
var
|
|
11974
|
-
var
|
|
12018
|
+
var import_connect_query22 = require("@connectrpc/connect-query");
|
|
12019
|
+
var import_frontier26 = require("@raystack/proton/frontier");
|
|
12020
|
+
var import_protobuf9 = require("@bufbuild/protobuf");
|
|
11975
12021
|
|
|
11976
12022
|
// admin/views/organizations/list/create.tsx
|
|
11977
|
-
var
|
|
12023
|
+
var import_react28 = require("react");
|
|
11978
12024
|
|
|
11979
|
-
// esbuild-css-modules-plugin-namespace:/tmp/tmp-
|
|
11980
|
-
var digest45 = "
|
|
12025
|
+
// esbuild-css-modules-plugin-namespace:/tmp/tmp-2174-IwjYMQGqkoML/sdk/admin/views/organizations/list/list.module.css.js
|
|
12026
|
+
var digest45 = "29f2a49b0e07ae01e65f4006e95beca3b40e370252599e10b25887c996c45477";
|
|
11981
12027
|
var css45 = `._table_w4mi3_1 {
|
|
11982
12028
|
height: auto;
|
|
11983
12029
|
}
|
|
@@ -12076,13 +12122,13 @@ var list_module_css_default5 = { "table": "_table_w4mi3_1", "table-empty": "_tab
|
|
|
12076
12122
|
var import_apsara57 = require("@raystack/apsara");
|
|
12077
12123
|
|
|
12078
12124
|
// client/components/image-upload/image-upload.tsx
|
|
12079
|
-
var
|
|
12125
|
+
var import_react27 = require("react");
|
|
12080
12126
|
var import_react_image_crop = __toESM(require("react-image-crop"));
|
|
12081
12127
|
var import_apsara56 = require("@raystack/apsara");
|
|
12082
12128
|
var import_ReactCrop = require("react-image-crop/dist/ReactCrop.css");
|
|
12083
12129
|
|
|
12084
|
-
// esbuild-css-modules-plugin-namespace:/tmp/tmp-
|
|
12085
|
-
var digest46 = "
|
|
12130
|
+
// esbuild-css-modules-plugin-namespace:/tmp/tmp-2174-2eNl9927IhRb/sdk/client/components/image-upload/image-upload.module.css.js
|
|
12131
|
+
var digest46 = "1a49af3fcf4f8dd9beee37238f118b76f47e88788d58b37cc2a77b5c33421d70";
|
|
12086
12132
|
var css46 = `._iconButton_1ifr2_1 {
|
|
12087
12133
|
position: relative;
|
|
12088
12134
|
width: var(--rs-space-14);
|
|
@@ -12176,8 +12222,8 @@ var image_upload_module_css_default = { "iconButton": "_iconButton_1ifr2_1", "av
|
|
|
12176
12222
|
// client/components/image-upload/image-upload.tsx
|
|
12177
12223
|
var import_jsx_runtime64 = require("react/jsx-runtime");
|
|
12178
12224
|
function CropDialog({ open, onOpenChange, imgSrc, onSave }) {
|
|
12179
|
-
const [crop, setCrop] = (0,
|
|
12180
|
-
const imgRef = (0,
|
|
12225
|
+
const [crop, setCrop] = (0, import_react27.useState)();
|
|
12226
|
+
const imgRef = (0, import_react27.useRef)(null);
|
|
12181
12227
|
function onImageLoad(e) {
|
|
12182
12228
|
const { naturalWidth: width, naturalHeight: height } = e.currentTarget;
|
|
12183
12229
|
const newCrop = (0, import_react_image_crop.centerCrop)(
|
|
@@ -12294,9 +12340,9 @@ function ImageUpload({
|
|
|
12294
12340
|
initials,
|
|
12295
12341
|
...rest
|
|
12296
12342
|
}) {
|
|
12297
|
-
const inputRef = (0,
|
|
12298
|
-
const [imgSrc, setImgSrc] = (0,
|
|
12299
|
-
const [showCropDialog, setShowCropDialog] = (0,
|
|
12343
|
+
const inputRef = (0, import_react27.useRef)(null);
|
|
12344
|
+
const [imgSrc, setImgSrc] = (0, import_react27.useState)("");
|
|
12345
|
+
const [showCropDialog, setShowCropDialog] = (0, import_react27.useState)(false);
|
|
12300
12346
|
function onUploadIconClick() {
|
|
12301
12347
|
if (inputRef.current) {
|
|
12302
12348
|
inputRef.current.value = "";
|
|
@@ -12385,9 +12431,9 @@ function ImageUpload({
|
|
|
12385
12431
|
var import_lodash2 = require("lodash");
|
|
12386
12432
|
var import_react_hook_form3 = require("react-hook-form");
|
|
12387
12433
|
var import_zod5 = require("@hookform/resolvers/zod");
|
|
12388
|
-
var
|
|
12389
|
-
var
|
|
12390
|
-
var
|
|
12434
|
+
var import_connect_query21 = require("@connectrpc/connect-query");
|
|
12435
|
+
var import_connect4 = require("@connectrpc/connect");
|
|
12436
|
+
var import_frontier25 = require("@raystack/proton/frontier");
|
|
12391
12437
|
var import_jsx_runtime65 = require("react/jsx-runtime");
|
|
12392
12438
|
var orgCreateSchema = external_exports.object({
|
|
12393
12439
|
avatar: external_exports.string().optional(),
|
|
@@ -12407,8 +12453,8 @@ function CreateOrganizationPanel({
|
|
|
12407
12453
|
onSuccess
|
|
12408
12454
|
}) {
|
|
12409
12455
|
const t = useTerminology();
|
|
12410
|
-
const [countries, setCountries] = (0,
|
|
12411
|
-
(0,
|
|
12456
|
+
const [countries, setCountries] = (0, import_react28.useState)(countriesProp);
|
|
12457
|
+
(0, import_react28.useEffect)(() => {
|
|
12412
12458
|
if (countriesProp.length > 0) {
|
|
12413
12459
|
setCountries(countriesProp);
|
|
12414
12460
|
}
|
|
@@ -12430,16 +12476,16 @@ function CreateOrganizationPanel({
|
|
|
12430
12476
|
},
|
|
12431
12477
|
resolver: (0, import_zod5.zodResolver)(orgCreateSchema)
|
|
12432
12478
|
});
|
|
12433
|
-
const uniqueSuffix = (0,
|
|
12434
|
-
const debouncedGenerateSlug = (0,
|
|
12479
|
+
const uniqueSuffix = (0, import_react28.useMemo)(() => randomSuffix(), []);
|
|
12480
|
+
const debouncedGenerateSlug = (0, import_react28.useMemo)(
|
|
12435
12481
|
() => (0, import_lodash2.debounce)((title) => {
|
|
12436
12482
|
const baseSlug = generateSlug(title);
|
|
12437
12483
|
setValue("name", baseSlug ? `${baseSlug}-${uniqueSuffix}` : "");
|
|
12438
12484
|
}, 300),
|
|
12439
12485
|
[setValue, uniqueSuffix]
|
|
12440
12486
|
);
|
|
12441
|
-
(0,
|
|
12442
|
-
const handleTitleChange = (0,
|
|
12487
|
+
(0, import_react28.useEffect)(() => () => debouncedGenerateSlug.cancel(), [debouncedGenerateSlug]);
|
|
12488
|
+
const handleTitleChange = (0, import_react28.useCallback)(
|
|
12443
12489
|
(e) => {
|
|
12444
12490
|
if (dirtyFields.name)
|
|
12445
12491
|
return;
|
|
@@ -12447,11 +12493,11 @@ function CreateOrganizationPanel({
|
|
|
12447
12493
|
},
|
|
12448
12494
|
[debouncedGenerateSlug, dirtyFields.name]
|
|
12449
12495
|
);
|
|
12450
|
-
const { mutateAsync: createOrganization, isPending } = (0,
|
|
12451
|
-
|
|
12496
|
+
const { mutateAsync: createOrganization, isPending } = (0, import_connect_query21.useMutation)(
|
|
12497
|
+
import_frontier25.AdminServiceQueries.adminCreateOrganization,
|
|
12452
12498
|
{
|
|
12453
12499
|
onError: (error) => {
|
|
12454
|
-
if (error?.code ===
|
|
12500
|
+
if (error?.code === import_connect4.Code.AlreadyExists) {
|
|
12455
12501
|
setError("name", {
|
|
12456
12502
|
message: `${t.organization({ case: "capital" })} URL is already taken`
|
|
12457
12503
|
});
|
|
@@ -12639,7 +12685,6 @@ function CreateOrganizationPanel({
|
|
|
12639
12685
|
}
|
|
12640
12686
|
|
|
12641
12687
|
// admin/views/organizations/list/index.tsx
|
|
12642
|
-
var import_hooks3 = require("@raystack/apsara/hooks");
|
|
12643
12688
|
var import_jsx_runtime66 = require("react/jsx-runtime");
|
|
12644
12689
|
var NoOrganizations = () => {
|
|
12645
12690
|
const t = useTerminology();
|
|
@@ -12681,10 +12726,6 @@ var ZeroState = ({ openCreatePanel }) => {
|
|
|
12681
12726
|
) });
|
|
12682
12727
|
};
|
|
12683
12728
|
var DEFAULT_SORT4 = { name: "createdAt", order: "desc" };
|
|
12684
|
-
var INITIAL_QUERY4 = {
|
|
12685
|
-
offset: 0,
|
|
12686
|
-
limit: DEFAULT_PAGE_SIZE
|
|
12687
|
-
};
|
|
12688
12729
|
var OrganizationListView = ({
|
|
12689
12730
|
appName,
|
|
12690
12731
|
onNavigateToOrg,
|
|
@@ -12694,19 +12735,22 @@ var OrganizationListView = ({
|
|
|
12694
12735
|
countries = []
|
|
12695
12736
|
} = {}) => {
|
|
12696
12737
|
const t = useTerminology();
|
|
12697
|
-
const [showCreatePanel, setShowCreatePanel] = (0,
|
|
12698
|
-
const
|
|
12699
|
-
|
|
12700
|
-
|
|
12701
|
-
|
|
12702
|
-
|
|
12703
|
-
|
|
12704
|
-
|
|
12705
|
-
|
|
12706
|
-
|
|
12707
|
-
|
|
12708
|
-
|
|
12709
|
-
|
|
12738
|
+
const [showCreatePanel, setShowCreatePanel] = (0, import_react29.useState)(false);
|
|
12739
|
+
const {
|
|
12740
|
+
tableQuery,
|
|
12741
|
+
rqlQuery: query,
|
|
12742
|
+
onTableQueryChange
|
|
12743
|
+
} = useServerTableQuery({
|
|
12744
|
+
defaultSort: DEFAULT_SORT4,
|
|
12745
|
+
transformOptions: {
|
|
12746
|
+
fieldNameMapping: {
|
|
12747
|
+
createdBy: "created_by",
|
|
12748
|
+
planName: "plan_name",
|
|
12749
|
+
subscriptionCycleEndAt: "subscription_cycle_end_at",
|
|
12750
|
+
paymentMode: "payment_mode",
|
|
12751
|
+
subscriptionState: "subscription_state",
|
|
12752
|
+
createdAt: "created_at"
|
|
12753
|
+
}
|
|
12710
12754
|
}
|
|
12711
12755
|
});
|
|
12712
12756
|
const {
|
|
@@ -12714,10 +12758,11 @@ var OrganizationListView = ({
|
|
|
12714
12758
|
isLoading,
|
|
12715
12759
|
isFetchingNextPage,
|
|
12716
12760
|
fetchNextPage,
|
|
12761
|
+
hasNextPage,
|
|
12717
12762
|
error,
|
|
12718
12763
|
isError
|
|
12719
|
-
} = (0,
|
|
12720
|
-
|
|
12764
|
+
} = (0, import_connect_query22.useInfiniteQuery)(
|
|
12765
|
+
import_frontier26.AdminServiceQueries.searchOrganizations,
|
|
12721
12766
|
{ query },
|
|
12722
12767
|
{
|
|
12723
12768
|
pageParamKey: "query",
|
|
@@ -12728,34 +12773,27 @@ var OrganizationListView = ({
|
|
|
12728
12773
|
retryDelay: 1e3
|
|
12729
12774
|
}
|
|
12730
12775
|
);
|
|
12731
|
-
const { data: plans = [], isLoading: isPlansLoading, error: plansError } = (0,
|
|
12732
|
-
|
|
12733
|
-
(0,
|
|
12776
|
+
const { data: plans = [], isLoading: isPlansLoading, error: plansError } = (0, import_connect_query22.useQuery)(
|
|
12777
|
+
import_frontier26.FrontierServiceQueries.listPlans,
|
|
12778
|
+
(0, import_protobuf9.create)(import_frontier26.ListPlansRequestSchema, {}),
|
|
12734
12779
|
{
|
|
12735
12780
|
select: (data2) => data2?.plans || []
|
|
12736
12781
|
}
|
|
12737
12782
|
);
|
|
12738
|
-
(0,
|
|
12783
|
+
(0, import_react29.useEffect)(() => {
|
|
12739
12784
|
if (plansError) {
|
|
12740
12785
|
console.error("Failed to fetch plans:", plansError);
|
|
12741
12786
|
}
|
|
12742
12787
|
}, [plansError]);
|
|
12743
12788
|
const data = infiniteData?.pages?.flatMap((page) => page?.organizations || []) || [];
|
|
12744
12789
|
const groupCountMap = infiniteData ? getGroupCountMapFromFirstPage(infiniteData) : {};
|
|
12745
|
-
const
|
|
12746
|
-
|
|
12747
|
-
|
|
12748
|
-
|
|
12749
|
-
|
|
12750
|
-
|
|
12751
|
-
};
|
|
12752
|
-
const handleLoadMore = async () => {
|
|
12753
|
-
try {
|
|
12754
|
-
await fetchNextPage();
|
|
12755
|
-
} catch (error2) {
|
|
12756
|
-
console.error("Error loading more organizations:", error2);
|
|
12757
|
-
}
|
|
12758
|
-
};
|
|
12790
|
+
const handleLoadMore = useLoadMore({
|
|
12791
|
+
hasNextPage,
|
|
12792
|
+
isFetchingNextPage,
|
|
12793
|
+
isError,
|
|
12794
|
+
fetchNextPage,
|
|
12795
|
+
label: "organizations"
|
|
12796
|
+
});
|
|
12759
12797
|
function closeCreateOrgPanel() {
|
|
12760
12798
|
setShowCreatePanel(false);
|
|
12761
12799
|
}
|
|
@@ -12841,17 +12879,17 @@ var OrganizationListView = ({
|
|
|
12841
12879
|
};
|
|
12842
12880
|
|
|
12843
12881
|
// admin/views/organizations/details/index.tsx
|
|
12844
|
-
var
|
|
12845
|
-
var
|
|
12846
|
-
var
|
|
12847
|
-
var
|
|
12882
|
+
var import_react43 = require("react");
|
|
12883
|
+
var import_connect_query31 = require("@connectrpc/connect-query");
|
|
12884
|
+
var import_react_query12 = require("@tanstack/react-query");
|
|
12885
|
+
var import_protobuf19 = require("@bufbuild/protobuf");
|
|
12848
12886
|
|
|
12849
12887
|
// admin/views/organizations/details/layout/navbar.tsx
|
|
12850
12888
|
var import_icons4 = require("@raystack/apsara/icons");
|
|
12851
12889
|
var import_apsara61 = require("@raystack/apsara");
|
|
12852
12890
|
|
|
12853
|
-
// esbuild-css-modules-plugin-namespace:/tmp/tmp-
|
|
12854
|
-
var digest47 = "
|
|
12891
|
+
// esbuild-css-modules-plugin-namespace:/tmp/tmp-2174-Ld80BIZrZvrj/sdk/admin/views/organizations/details/layout/layout.module.css.js
|
|
12892
|
+
var digest47 = "07b7ed44215f23d99821917e37cb24bb2ebec6700406a778cd98ab15322e33d5";
|
|
12855
12893
|
var css47 = `._page_1nlk4_1 {
|
|
12856
12894
|
width: 100%;
|
|
12857
12895
|
height: 100vh;
|
|
@@ -12931,8 +12969,8 @@ var css47 = `._page_1nlk4_1 {
|
|
|
12931
12969
|
})();
|
|
12932
12970
|
var layout_module_css_default2 = { "page": "_page_1nlk4_1", "main_content": "_main_content_1nlk4_7", "mainContent": "_main_content_1nlk4_7", "main_content_with_sidepanel": "_main_content_with_sidepanel_1nlk4_12", "mainContentWithSidepanel": "_main_content_with_sidepanel_1nlk4_12", "navbar-action-menu-content": "_navbar-action-menu-content_1nlk4_17", "navbarActionMenuContent": "_navbar-action-menu-content_1nlk4_17", "navbar-action-menu-item": "_navbar-action-menu-item_1nlk4_21", "navbarActionMenuItem": "_navbar-action-menu-item_1nlk4_21", "side-panel-section-item-label": "_side-panel-section-item-label_1nlk4_26", "sidePanelSectionItemLabel": "_side-panel-section-item-label_1nlk4_26", "invite-users-dialog-body": "_invite-users-dialog-body_1nlk4_30", "inviteUsersDialogBody": "_invite-users-dialog-body_1nlk4_30", "invite-users-dialog-label": "_invite-users-dialog-label_1nlk4_37", "inviteUsersDialogLabel": "_invite-users-dialog-label_1nlk4_37", "invite-users-dialog-roles-content": "_invite-users-dialog-roles-content_1nlk4_41", "inviteUsersDialogRolesContent": "_invite-users-dialog-roles-content_1nlk4_41", "form-error-message": "_form-error-message_1nlk4_46", "formErrorMessage": "_form-error-message_1nlk4_46", "invite-users-emails-textarea": "_invite-users-emails-textarea_1nlk4_50", "inviteUsersEmailsTextarea": "_invite-users-emails-textarea_1nlk4_50", "add-token-dialog-tokens-field": "_add-token-dialog-tokens-field_1nlk4_56", "addTokenDialogTokensField": "_add-token-dialog-tokens-field_1nlk4_56" };
|
|
12933
12971
|
|
|
12934
|
-
// esbuild-css-modules-plugin-namespace:/tmp/tmp-
|
|
12935
|
-
var digest48 = "
|
|
12972
|
+
// esbuild-css-modules-plugin-namespace:/tmp/tmp-2174-BDx5xZQUlJL4/sdk/admin/components/navbar.module.css.js
|
|
12973
|
+
var digest48 = "e27ea0e2bb30157b1a16a0fe89c419e10defea0048600f50e18261e30afaa2bf";
|
|
12936
12974
|
var css48 = `._navbar_641ya_1 {
|
|
12937
12975
|
padding: var(--rs-space-4) var(--rs-space-7);
|
|
12938
12976
|
border-bottom: 0.5px solid var(--rs-color-border-base-primary);
|
|
@@ -12962,10 +13000,10 @@ var navbar_module_css_default6 = { "navbar": "_navbar_641ya_1", "nav-chip": "_na
|
|
|
12962
13000
|
|
|
12963
13001
|
// admin/views/organizations/details/layout/invite-users-dialog.tsx
|
|
12964
13002
|
var import_apsara59 = require("@raystack/apsara");
|
|
12965
|
-
var
|
|
13003
|
+
var import_react31 = require("react");
|
|
12966
13004
|
|
|
12967
|
-
// esbuild-css-modules-plugin-namespace:/tmp/tmp-
|
|
12968
|
-
var digest49 = "
|
|
13005
|
+
// esbuild-css-modules-plugin-namespace:/tmp/tmp-2174-WLTx4kLY2Mjh/sdk/admin/views/organizations/details/layout/layout.module.css.js
|
|
13006
|
+
var digest49 = "ce0c576729e53734f49c9b67a6b526c1cd6af1e4ac9c11b5bd4c4ec6a14438ff";
|
|
12969
13007
|
var css49 = `._page_1nlk4_1 {
|
|
12970
13008
|
width: 100%;
|
|
12971
13009
|
height: 100vh;
|
|
@@ -13046,12 +13084,12 @@ var css49 = `._page_1nlk4_1 {
|
|
|
13046
13084
|
var layout_module_css_default3 = { "page": "_page_1nlk4_1", "main_content": "_main_content_1nlk4_7", "mainContent": "_main_content_1nlk4_7", "main_content_with_sidepanel": "_main_content_with_sidepanel_1nlk4_12", "mainContentWithSidepanel": "_main_content_with_sidepanel_1nlk4_12", "navbar-action-menu-content": "_navbar-action-menu-content_1nlk4_17", "navbarActionMenuContent": "_navbar-action-menu-content_1nlk4_17", "navbar-action-menu-item": "_navbar-action-menu-item_1nlk4_21", "navbarActionMenuItem": "_navbar-action-menu-item_1nlk4_21", "side-panel-section-item-label": "_side-panel-section-item-label_1nlk4_26", "sidePanelSectionItemLabel": "_side-panel-section-item-label_1nlk4_26", "invite-users-dialog-body": "_invite-users-dialog-body_1nlk4_30", "inviteUsersDialogBody": "_invite-users-dialog-body_1nlk4_30", "invite-users-dialog-label": "_invite-users-dialog-label_1nlk4_37", "inviteUsersDialogLabel": "_invite-users-dialog-label_1nlk4_37", "invite-users-dialog-roles-content": "_invite-users-dialog-roles-content_1nlk4_41", "inviteUsersDialogRolesContent": "_invite-users-dialog-roles-content_1nlk4_41", "form-error-message": "_form-error-message_1nlk4_46", "formErrorMessage": "_form-error-message_1nlk4_46", "invite-users-emails-textarea": "_invite-users-emails-textarea_1nlk4_50", "inviteUsersEmailsTextarea": "_invite-users-emails-textarea_1nlk4_50", "add-token-dialog-tokens-field": "_add-token-dialog-tokens-field_1nlk4_56", "addTokenDialogTokensField": "_add-token-dialog-tokens-field_1nlk4_56" };
|
|
13047
13085
|
|
|
13048
13086
|
// admin/views/organizations/details/contexts/organization-context.tsx
|
|
13049
|
-
var
|
|
13050
|
-
var
|
|
13051
|
-
var
|
|
13087
|
+
var import_frontier27 = require("@raystack/proton/frontier");
|
|
13088
|
+
var import_protobuf10 = require("@bufbuild/protobuf");
|
|
13089
|
+
var import_react30 = require("react");
|
|
13052
13090
|
var defaultOrganiztionContextValue = {
|
|
13053
13091
|
roles: [],
|
|
13054
|
-
organization: (0,
|
|
13092
|
+
organization: (0, import_protobuf10.create)(import_frontier27.OrganizationSchema),
|
|
13055
13093
|
updateOrganization: async () => {
|
|
13056
13094
|
},
|
|
13057
13095
|
isBillingAccountLoading: false,
|
|
@@ -13069,8 +13107,6 @@ var defaultOrganiztionContextValue = {
|
|
|
13069
13107
|
onChange: () => {
|
|
13070
13108
|
}
|
|
13071
13109
|
},
|
|
13072
|
-
orgMembersMap: {},
|
|
13073
|
-
isOrgMembersMapLoading: false,
|
|
13074
13110
|
updateKYCDetails: () => {
|
|
13075
13111
|
},
|
|
13076
13112
|
kycDetails: void 0,
|
|
@@ -13080,7 +13116,7 @@ var defaultOrganiztionContextValue = {
|
|
|
13080
13116
|
countries: void 0,
|
|
13081
13117
|
organizationTypes: void 0
|
|
13082
13118
|
};
|
|
13083
|
-
var OrganizationContext = (0,
|
|
13119
|
+
var OrganizationContext = (0, import_react30.createContext)(defaultOrganiztionContextValue);
|
|
13084
13120
|
|
|
13085
13121
|
// admin/views/organizations/details/layout/invite-users-dialog.tsx
|
|
13086
13122
|
var import_zod6 = require("@hookform/resolvers/zod");
|
|
@@ -13095,10 +13131,10 @@ var PROJECT_NAMESPACE = "app/project";
|
|
|
13095
13131
|
var DEFAULT_INVITE_ROLE = "app_organization_viewer";
|
|
13096
13132
|
|
|
13097
13133
|
// admin/views/organizations/details/layout/invite-users-dialog.tsx
|
|
13098
|
-
var
|
|
13099
|
-
var
|
|
13100
|
-
var
|
|
13101
|
-
var
|
|
13134
|
+
var import_connect_query23 = require("@connectrpc/connect-query");
|
|
13135
|
+
var import_react_query8 = require("@tanstack/react-query");
|
|
13136
|
+
var import_frontier28 = require("@raystack/proton/frontier");
|
|
13137
|
+
var import_protobuf11 = require("@bufbuild/protobuf");
|
|
13102
13138
|
var import_jsx_runtime67 = require("react/jsx-runtime");
|
|
13103
13139
|
var inviteSchema = objectType({
|
|
13104
13140
|
role: stringType().min(1, { message: "Role is required" }),
|
|
@@ -13110,11 +13146,11 @@ var inviteSchema = objectType({
|
|
|
13110
13146
|
});
|
|
13111
13147
|
var InviteUsersDialog = ({ onOpenChange }) => {
|
|
13112
13148
|
const t = useTerminology();
|
|
13113
|
-
const { roles = [], organization } = (0,
|
|
13114
|
-
const queryClient = (0,
|
|
13115
|
-
const transport = (0,
|
|
13149
|
+
const { roles = [], organization } = (0, import_react31.useContext)(OrganizationContext);
|
|
13150
|
+
const queryClient = (0, import_react_query8.useQueryClient)();
|
|
13151
|
+
const transport = (0, import_connect_query23.useTransport)();
|
|
13116
13152
|
const organizationId = organization?.id || "";
|
|
13117
|
-
const defaultRoleId = (0,
|
|
13153
|
+
const defaultRoleId = (0, import_react31.useMemo)(
|
|
13118
13154
|
() => roles?.find((role) => role.name === DEFAULT_INVITE_ROLE)?.id,
|
|
13119
13155
|
[roles]
|
|
13120
13156
|
);
|
|
@@ -13124,13 +13160,13 @@ var InviteUsersDialog = ({ onOpenChange }) => {
|
|
|
13124
13160
|
role: defaultRoleId
|
|
13125
13161
|
}
|
|
13126
13162
|
});
|
|
13127
|
-
const { mutateAsync: createInvitation } = (0,
|
|
13128
|
-
|
|
13163
|
+
const { mutateAsync: createInvitation } = (0, import_connect_query23.useMutation)(
|
|
13164
|
+
import_frontier28.FrontierServiceQueries.createOrganizationInvitation,
|
|
13129
13165
|
{
|
|
13130
13166
|
onSuccess: (data) => {
|
|
13131
13167
|
queryClient.invalidateQueries({
|
|
13132
|
-
queryKey: (0,
|
|
13133
|
-
schema:
|
|
13168
|
+
queryKey: (0, import_connect_query23.createConnectQueryKey)({
|
|
13169
|
+
schema: import_frontier28.FrontierServiceQueries.listOrganizationInvitations,
|
|
13134
13170
|
transport,
|
|
13135
13171
|
input: { orgId: organizationId },
|
|
13136
13172
|
cardinality: "finite"
|
|
@@ -13150,7 +13186,7 @@ var InviteUsersDialog = ({ onOpenChange }) => {
|
|
|
13150
13186
|
return;
|
|
13151
13187
|
try {
|
|
13152
13188
|
await createInvitation(
|
|
13153
|
-
(0,
|
|
13189
|
+
(0, import_protobuf11.create)(import_frontier28.CreateOrganizationInvitationRequestSchema, {
|
|
13154
13190
|
orgId: organizationId,
|
|
13155
13191
|
userIds: data.emails,
|
|
13156
13192
|
roleIds: data.role ? [data.role] : []
|
|
@@ -13242,11 +13278,11 @@ var InviteUsersDialog = ({ onOpenChange }) => {
|
|
|
13242
13278
|
|
|
13243
13279
|
// admin/views/organizations/details/layout/add-tokens-dialog.tsx
|
|
13244
13280
|
var import_apsara60 = require("@raystack/apsara");
|
|
13245
|
-
var
|
|
13281
|
+
var import_react32 = require("react");
|
|
13246
13282
|
var import_react_hook_form5 = require("react-hook-form");
|
|
13247
13283
|
|
|
13248
|
-
// esbuild-css-modules-plugin-namespace:/tmp/tmp-
|
|
13249
|
-
var digest50 = "
|
|
13284
|
+
// esbuild-css-modules-plugin-namespace:/tmp/tmp-2174-1SiV4l7iVBBe/sdk/admin/views/organizations/details/layout/layout.module.css.js
|
|
13285
|
+
var digest50 = "d179fe63e60303efc85417ab1007d51ca555f6d7ec429d1914bf3ce78f42bb48";
|
|
13250
13286
|
var css50 = `._page_1nlk4_1 {
|
|
13251
13287
|
width: 100%;
|
|
13252
13288
|
height: 100vh;
|
|
@@ -13328,10 +13364,10 @@ var layout_module_css_default4 = { "page": "_page_1nlk4_1", "main_content": "_ma
|
|
|
13328
13364
|
|
|
13329
13365
|
// admin/views/organizations/details/layout/add-tokens-dialog.tsx
|
|
13330
13366
|
var import_zod7 = require("@hookform/resolvers/zod");
|
|
13331
|
-
var
|
|
13332
|
-
var
|
|
13333
|
-
var
|
|
13334
|
-
var
|
|
13367
|
+
var import_connect_query24 = require("@connectrpc/connect-query");
|
|
13368
|
+
var import_react_query9 = require("@tanstack/react-query");
|
|
13369
|
+
var import_frontier29 = require("@raystack/proton/frontier");
|
|
13370
|
+
var import_protobuf12 = require("@bufbuild/protobuf");
|
|
13335
13371
|
var import_jsx_runtime68 = require("react/jsx-runtime");
|
|
13336
13372
|
var addTokensSchema = objectType({
|
|
13337
13373
|
product: stringType(),
|
|
@@ -13341,9 +13377,14 @@ var addTokensSchema = objectType({
|
|
|
13341
13377
|
}).min(1).transform((num) => num.toString())
|
|
13342
13378
|
});
|
|
13343
13379
|
var AddTokensDialog = ({ onOpenChange }) => {
|
|
13344
|
-
const {
|
|
13345
|
-
|
|
13346
|
-
|
|
13380
|
+
const {
|
|
13381
|
+
organization,
|
|
13382
|
+
billingAccount,
|
|
13383
|
+
fetchTokenBalance,
|
|
13384
|
+
tokenProductId
|
|
13385
|
+
} = (0, import_react32.useContext)(OrganizationContext);
|
|
13386
|
+
const queryClient = (0, import_react_query9.useQueryClient)();
|
|
13387
|
+
const transport = (0, import_connect_query24.useTransport)();
|
|
13347
13388
|
const organisationId = organization?.id || "";
|
|
13348
13389
|
const billingAccountId = billingAccount?.id || "";
|
|
13349
13390
|
const methods = (0, import_react_hook_form5.useForm)({
|
|
@@ -13353,13 +13394,13 @@ var AddTokensDialog = ({ onOpenChange }) => {
|
|
|
13353
13394
|
product: tokenProductId || defaultConfig.token_product_id || "token"
|
|
13354
13395
|
}
|
|
13355
13396
|
});
|
|
13356
|
-
const { mutateAsync: delegatedCheckout } = (0,
|
|
13357
|
-
|
|
13397
|
+
const { mutateAsync: delegatedCheckout } = (0, import_connect_query24.useMutation)(
|
|
13398
|
+
import_frontier29.AdminServiceQueries.delegatedCheckout,
|
|
13358
13399
|
{
|
|
13359
13400
|
onSuccess: () => {
|
|
13360
13401
|
queryClient.invalidateQueries({
|
|
13361
|
-
queryKey: (0,
|
|
13362
|
-
schema:
|
|
13402
|
+
queryKey: (0, import_connect_query24.createConnectQueryKey)({
|
|
13403
|
+
schema: import_frontier29.FrontierServiceQueries.searchOrganizationTokens,
|
|
13363
13404
|
transport,
|
|
13364
13405
|
input: { id: organisationId },
|
|
13365
13406
|
cardinality: "infinite"
|
|
@@ -13379,14 +13420,15 @@ var AddTokensDialog = ({ onOpenChange }) => {
|
|
|
13379
13420
|
}
|
|
13380
13421
|
}
|
|
13381
13422
|
);
|
|
13423
|
+
const canCheckout = !!organisationId && !!billingAccountId;
|
|
13382
13424
|
const onSubmit = async (product_body) => {
|
|
13383
|
-
if (!
|
|
13425
|
+
if (!canCheckout)
|
|
13384
13426
|
return;
|
|
13385
13427
|
await delegatedCheckout(
|
|
13386
|
-
(0,
|
|
13428
|
+
(0, import_protobuf12.create)(import_frontier29.DelegatedCheckoutRequestSchema, {
|
|
13387
13429
|
orgId: organisationId,
|
|
13388
13430
|
billingId: billingAccountId,
|
|
13389
|
-
productBody: (0,
|
|
13431
|
+
productBody: (0, import_protobuf12.create)(import_frontier29.CheckoutProductBodySchema, {
|
|
13390
13432
|
product: product_body.product,
|
|
13391
13433
|
quantity: BigInt(product_body.quantity)
|
|
13392
13434
|
})
|
|
@@ -13443,6 +13485,7 @@ var AddTokensDialog = ({ onOpenChange }) => {
|
|
|
13443
13485
|
"data-test-id": "add-tokens-invite-button",
|
|
13444
13486
|
type: "submit",
|
|
13445
13487
|
loaderText: "Adding...",
|
|
13488
|
+
disabled: !canCheckout || isSubmitting,
|
|
13446
13489
|
loading: isSubmitting,
|
|
13447
13490
|
children: "Add"
|
|
13448
13491
|
}
|
|
@@ -13452,7 +13495,7 @@ var AddTokensDialog = ({ onOpenChange }) => {
|
|
|
13452
13495
|
};
|
|
13453
13496
|
|
|
13454
13497
|
// admin/views/organizations/details/layout/navbar.tsx
|
|
13455
|
-
var
|
|
13498
|
+
var import_react33 = require("react");
|
|
13456
13499
|
var import_jsx_runtime69 = require("react/jsx-runtime");
|
|
13457
13500
|
var DropdownItem = ({ item }) => {
|
|
13458
13501
|
return /* @__PURE__ */ (0, import_jsx_runtime69.jsxs)(
|
|
@@ -13480,11 +13523,11 @@ var NavbarActionMenu = ({
|
|
|
13480
13523
|
onExportTokens
|
|
13481
13524
|
}) => {
|
|
13482
13525
|
const t = useTerminology();
|
|
13483
|
-
const [isInviteUsersDialogOpen, setIsInviteUsersDialogOpen] = (0,
|
|
13484
|
-
const [isAddTokensDialogOpen, setIsAddTokensDialogOpen] = (0,
|
|
13485
|
-
const [isMembersDownloading, setIsMembersDownloading] = (0,
|
|
13486
|
-
const [isProjectsDownloading, setIsProjectsDownloading] = (0,
|
|
13487
|
-
const [isTokensDownloading, setIsTokensDownloading] = (0,
|
|
13526
|
+
const [isInviteUsersDialogOpen, setIsInviteUsersDialogOpen] = (0, import_react33.useState)(false);
|
|
13527
|
+
const [isAddTokensDialogOpen, setIsAddTokensDialogOpen] = (0, import_react33.useState)(false);
|
|
13528
|
+
const [isMembersDownloading, setIsMembersDownloading] = (0, import_react33.useState)(false);
|
|
13529
|
+
const [isProjectsDownloading, setIsProjectsDownloading] = (0, import_react33.useState)(false);
|
|
13530
|
+
const [isTokensDownloading, setIsTokensDownloading] = (0, import_react33.useState)(false);
|
|
13488
13531
|
const openInviteUsersDialog = () => {
|
|
13489
13532
|
setIsInviteUsersDialogOpen(true);
|
|
13490
13533
|
};
|
|
@@ -13660,7 +13703,7 @@ var OrganizationsDetailsNavabar = ({
|
|
|
13660
13703
|
}) => {
|
|
13661
13704
|
const t = useTerminology();
|
|
13662
13705
|
const adminPaths = useAdminPaths();
|
|
13663
|
-
const { search } = (0,
|
|
13706
|
+
const { search } = (0, import_react33.useContext)(OrganizationContext);
|
|
13664
13707
|
function handleSearchChange(e) {
|
|
13665
13708
|
const value = e.target.value;
|
|
13666
13709
|
search.onChange(value);
|
|
@@ -13753,8 +13796,8 @@ var OrganizationsDetailsNavabar = ({
|
|
|
13753
13796
|
] });
|
|
13754
13797
|
};
|
|
13755
13798
|
|
|
13756
|
-
// esbuild-css-modules-plugin-namespace:/tmp/tmp-
|
|
13757
|
-
var digest51 = "
|
|
13799
|
+
// esbuild-css-modules-plugin-namespace:/tmp/tmp-2174-2rextYA6hCZn/sdk/admin/views/organizations/details/layout/layout.module.css.js
|
|
13800
|
+
var digest51 = "f0928a695be5ee9290c5d68c60077f14ea8042fa0db52599e2e93496d7ad6e13";
|
|
13758
13801
|
var css51 = `._page_1nlk4_1 {
|
|
13759
13802
|
width: 100%;
|
|
13760
13803
|
height: 100vh;
|
|
@@ -13843,8 +13886,8 @@ var import_apsara67 = require("@raystack/apsara");
|
|
|
13843
13886
|
// admin/views/organizations/details/side-panel/org-details-section.tsx
|
|
13844
13887
|
var import_apsara62 = require("@raystack/apsara");
|
|
13845
13888
|
|
|
13846
|
-
// esbuild-css-modules-plugin-namespace:/tmp/tmp-
|
|
13847
|
-
var digest52 = "
|
|
13889
|
+
// esbuild-css-modules-plugin-namespace:/tmp/tmp-2174-0AHZL2b3bShv/sdk/admin/views/organizations/details/side-panel/side-panel.module.css.js
|
|
13890
|
+
var digest52 = "1eecc0472572b4df4d766cdf13bd5ff414408f223372d4f0b7031e6feb205ac3";
|
|
13848
13891
|
var css52 = `._side-panel-section-item-label_slrfc_1 {
|
|
13849
13892
|
width: 120px;
|
|
13850
13893
|
}
|
|
@@ -13908,12 +13951,12 @@ var css52 = `._side-panel-section-item-label_slrfc_1 {
|
|
|
13908
13951
|
var side_panel_module_css_default6 = { "side-panel-section-item-label": "_side-panel-section-item-label_slrfc_1", "sidePanelSectionItemLabel": "_side-panel-section-item-label_slrfc_1", "org-details-section-org-id": "_org-details-section-org-id_slrfc_5", "orgDetailsSectionOrgId": "_org-details-section-org-id_slrfc_5", "kyc_link": "_kyc_link_slrfc_6", "kycLink": "_kyc_link_slrfc_6", "kyc-status-icon": "_kyc-status-icon_slrfc_13", "kycStatusIcon": "_kyc-status-icon_slrfc_13", "billing-header": "_billing-header_slrfc_18", "billingHeader": "_billing-header_slrfc_18", "billing-edit": "_billing-edit_slrfc_25", "billingEdit": "_billing-edit_slrfc_25", "billing-section": "_billing-section_slrfc_30", "billingSection": "_billing-section_slrfc_30", "billing-edit-disabled": "_billing-edit-disabled_slrfc_38", "billingEditDisabled": "_billing-edit-disabled_slrfc_38" };
|
|
13909
13952
|
|
|
13910
13953
|
// admin/views/organizations/details/side-panel/org-details-section.tsx
|
|
13911
|
-
var
|
|
13954
|
+
var import_react34 = require("react");
|
|
13912
13955
|
var import_jsx_runtime70 = require("react/jsx-runtime");
|
|
13913
13956
|
var OrganizationDetailsSection = ({
|
|
13914
13957
|
organization
|
|
13915
13958
|
}) => {
|
|
13916
|
-
const { appUrl } = (0,
|
|
13959
|
+
const { appUrl } = (0, import_react34.useContext)(OrganizationContext);
|
|
13917
13960
|
return /* @__PURE__ */ (0, import_jsx_runtime70.jsxs)(import_apsara62.List, { children: [
|
|
13918
13961
|
/* @__PURE__ */ (0, import_jsx_runtime70.jsx)(import_apsara62.List.Header, { children: "Organization Details" }),
|
|
13919
13962
|
/* @__PURE__ */ (0, import_jsx_runtime70.jsxs)(import_apsara62.List.Item, { children: [
|
|
@@ -13969,10 +14012,10 @@ var OrganizationDetailsSection = ({
|
|
|
13969
14012
|
|
|
13970
14013
|
// admin/views/organizations/details/side-panel/kyc-section.tsx
|
|
13971
14014
|
var import_apsara63 = require("@raystack/apsara");
|
|
13972
|
-
var
|
|
14015
|
+
var import_react35 = require("react");
|
|
13973
14016
|
|
|
13974
|
-
// esbuild-css-modules-plugin-namespace:/tmp/tmp-
|
|
13975
|
-
var digest53 = "
|
|
14017
|
+
// esbuild-css-modules-plugin-namespace:/tmp/tmp-2174-gc2kCfziJqhM/sdk/admin/views/organizations/details/side-panel/side-panel.module.css.js
|
|
14018
|
+
var digest53 = "2b9112ca6764d8c6b16bf71c03dc96733798550f71a4bdd1ea4b31476f533bff";
|
|
13976
14019
|
var css53 = `._side-panel-section-item-label_slrfc_1 {
|
|
13977
14020
|
width: 120px;
|
|
13978
14021
|
}
|
|
@@ -14039,7 +14082,7 @@ var side_panel_module_css_default7 = { "side-panel-section-item-label": "_side-p
|
|
|
14039
14082
|
var import_icons5 = require("@raystack/apsara/icons");
|
|
14040
14083
|
var import_jsx_runtime71 = require("react/jsx-runtime");
|
|
14041
14084
|
var KYCDetailsSection = () => {
|
|
14042
|
-
const { isKYCLoading, kycDetails } = (0,
|
|
14085
|
+
const { isKYCLoading, kycDetails } = (0, import_react35.useContext)(OrganizationContext);
|
|
14043
14086
|
return /* @__PURE__ */ (0, import_jsx_runtime71.jsxs)(import_apsara63.List, { children: [
|
|
14044
14087
|
/* @__PURE__ */ (0, import_jsx_runtime71.jsx)(import_apsara63.List.Header, { children: "KYC Details" }),
|
|
14045
14088
|
/* @__PURE__ */ (0, import_jsx_runtime71.jsxs)(import_apsara63.List.Item, { children: [
|
|
@@ -14092,11 +14135,11 @@ var KYCDetailsSection = () => {
|
|
|
14092
14135
|
};
|
|
14093
14136
|
|
|
14094
14137
|
// admin/views/organizations/details/side-panel/plan-details-section.tsx
|
|
14095
|
-
var
|
|
14138
|
+
var import_react36 = require("react");
|
|
14096
14139
|
var import_apsara64 = require("@raystack/apsara");
|
|
14097
14140
|
|
|
14098
|
-
// esbuild-css-modules-plugin-namespace:/tmp/tmp-
|
|
14099
|
-
var digest54 = "
|
|
14141
|
+
// esbuild-css-modules-plugin-namespace:/tmp/tmp-2174-NgMTxPFA1kQJ/sdk/admin/views/organizations/details/side-panel/side-panel.module.css.js
|
|
14142
|
+
var digest54 = "5ef0ec236021858eb33ee0a39b02a59d95566861110471ff8e8872b6e8403717";
|
|
14100
14143
|
var css54 = `._side-panel-section-item-label_slrfc_1 {
|
|
14101
14144
|
width: 120px;
|
|
14102
14145
|
}
|
|
@@ -14160,17 +14203,17 @@ var css54 = `._side-panel-section-item-label_slrfc_1 {
|
|
|
14160
14203
|
var side_panel_module_css_default8 = { "side-panel-section-item-label": "_side-panel-section-item-label_slrfc_1", "sidePanelSectionItemLabel": "_side-panel-section-item-label_slrfc_1", "org-details-section-org-id": "_org-details-section-org-id_slrfc_5", "orgDetailsSectionOrgId": "_org-details-section-org-id_slrfc_5", "kyc_link": "_kyc_link_slrfc_6", "kycLink": "_kyc_link_slrfc_6", "kyc-status-icon": "_kyc-status-icon_slrfc_13", "kycStatusIcon": "_kyc-status-icon_slrfc_13", "billing-header": "_billing-header_slrfc_18", "billingHeader": "_billing-header_slrfc_18", "billing-edit": "_billing-edit_slrfc_25", "billingEdit": "_billing-edit_slrfc_25", "billing-section": "_billing-section_slrfc_30", "billingSection": "_billing-section_slrfc_30", "billing-edit-disabled": "_billing-edit-disabled_slrfc_38", "billingEditDisabled": "_billing-edit-disabled_slrfc_38" };
|
|
14161
14204
|
|
|
14162
14205
|
// admin/views/organizations/details/side-panel/plan-details-section.tsx
|
|
14163
|
-
var
|
|
14164
|
-
var
|
|
14165
|
-
var
|
|
14206
|
+
var import_connect_query25 = require("@connectrpc/connect-query");
|
|
14207
|
+
var import_frontier30 = require("@raystack/proton/frontier");
|
|
14208
|
+
var import_protobuf13 = require("@bufbuild/protobuf");
|
|
14166
14209
|
var import_jsx_runtime72 = require("react/jsx-runtime");
|
|
14167
14210
|
var PlanDetailsSection = () => {
|
|
14168
|
-
const { billingAccount, organization } = (0,
|
|
14211
|
+
const { billingAccount, organization } = (0, import_react36.useContext)(OrganizationContext);
|
|
14169
14212
|
const billingAccountId = billingAccount?.id || "";
|
|
14170
14213
|
const organizationId = organization?.id || "";
|
|
14171
|
-
const { data: activeSubscription, isLoading: isSubscriptionLoading, error: subscriptionsError } = (0,
|
|
14172
|
-
|
|
14173
|
-
(0,
|
|
14214
|
+
const { data: activeSubscription, isLoading: isSubscriptionLoading, error: subscriptionsError } = (0, import_connect_query25.useQuery)(
|
|
14215
|
+
import_frontier30.FrontierServiceQueries.listSubscriptions,
|
|
14216
|
+
(0, import_protobuf13.create)(import_frontier30.ListSubscriptionsRequestSchema, {
|
|
14174
14217
|
orgId: organizationId
|
|
14175
14218
|
}),
|
|
14176
14219
|
{
|
|
@@ -14186,9 +14229,9 @@ var PlanDetailsSection = () => {
|
|
|
14186
14229
|
if (subscriptionsError) {
|
|
14187
14230
|
console.error("Error fetching subscriptions:", subscriptionsError);
|
|
14188
14231
|
}
|
|
14189
|
-
const { data: planData, isLoading: isPlanLoading, error: planError } = (0,
|
|
14190
|
-
|
|
14191
|
-
(0,
|
|
14232
|
+
const { data: planData, isLoading: isPlanLoading, error: planError } = (0, import_connect_query25.useQuery)(
|
|
14233
|
+
import_frontier30.FrontierServiceQueries.getPlan,
|
|
14234
|
+
(0, import_protobuf13.create)(import_frontier30.GetPlanRequestSchema, {
|
|
14192
14235
|
id: activeSubscription?.planId ?? ""
|
|
14193
14236
|
}),
|
|
14194
14237
|
{
|
|
@@ -14226,8 +14269,8 @@ var PlanDetailsSection = () => {
|
|
|
14226
14269
|
var import_apsara65 = require("@raystack/apsara");
|
|
14227
14270
|
var import_icons6 = require("@raystack/apsara/icons");
|
|
14228
14271
|
|
|
14229
|
-
// esbuild-css-modules-plugin-namespace:/tmp/tmp-
|
|
14230
|
-
var digest55 = "
|
|
14272
|
+
// esbuild-css-modules-plugin-namespace:/tmp/tmp-2174-gxfJNmtx0O2P/sdk/admin/views/organizations/details/side-panel/side-panel.module.css.js
|
|
14273
|
+
var digest55 = "b2a79b90d458a0a1f2403b9ccf27608cc29715d99c00963670164b1ac3403736";
|
|
14231
14274
|
var css55 = `._side-panel-section-item-label_slrfc_1 {
|
|
14232
14275
|
width: 120px;
|
|
14233
14276
|
}
|
|
@@ -14291,10 +14334,10 @@ var css55 = `._side-panel-section-item-label_slrfc_1 {
|
|
|
14291
14334
|
var side_panel_module_css_default9 = { "side-panel-section-item-label": "_side-panel-section-item-label_slrfc_1", "sidePanelSectionItemLabel": "_side-panel-section-item-label_slrfc_1", "org-details-section-org-id": "_org-details-section-org-id_slrfc_5", "orgDetailsSectionOrgId": "_org-details-section-org-id_slrfc_5", "kyc_link": "_kyc_link_slrfc_6", "kycLink": "_kyc_link_slrfc_6", "kyc-status-icon": "_kyc-status-icon_slrfc_13", "kycStatusIcon": "_kyc-status-icon_slrfc_13", "billing-header": "_billing-header_slrfc_18", "billingHeader": "_billing-header_slrfc_18", "billing-edit": "_billing-edit_slrfc_25", "billingEdit": "_billing-edit_slrfc_25", "billing-section": "_billing-section_slrfc_30", "billingSection": "_billing-section_slrfc_30", "billing-edit-disabled": "_billing-edit-disabled_slrfc_38", "billingEditDisabled": "_billing-edit-disabled_slrfc_38" };
|
|
14292
14335
|
|
|
14293
14336
|
// admin/views/organizations/details/side-panel/tokens-details-section.tsx
|
|
14294
|
-
var
|
|
14295
|
-
var
|
|
14296
|
-
var
|
|
14297
|
-
var
|
|
14337
|
+
var import_react37 = require("react");
|
|
14338
|
+
var import_connect_query26 = require("@connectrpc/connect-query");
|
|
14339
|
+
var import_frontier31 = require("@raystack/proton/frontier");
|
|
14340
|
+
var import_protobuf14 = require("@bufbuild/protobuf");
|
|
14298
14341
|
var import_jsx_runtime73 = require("react/jsx-runtime");
|
|
14299
14342
|
var TokensDetailsSection = () => {
|
|
14300
14343
|
const {
|
|
@@ -14302,13 +14345,14 @@ var TokensDetailsSection = () => {
|
|
|
14302
14345
|
billingAccount,
|
|
14303
14346
|
organization,
|
|
14304
14347
|
isTokenBalanceLoading,
|
|
14348
|
+
isBillingAccountLoading,
|
|
14305
14349
|
billingAccountDetails
|
|
14306
|
-
} = (0,
|
|
14350
|
+
} = (0, import_react37.useContext)(OrganizationContext);
|
|
14307
14351
|
const organizationId = organization?.id || "";
|
|
14308
14352
|
const billingAccountId = billingAccount?.id || "";
|
|
14309
|
-
const { data: tokensUsed = "0", isLoading: isTokensLoading, error } = (0,
|
|
14310
|
-
|
|
14311
|
-
(0,
|
|
14353
|
+
const { data: tokensUsed = "0", isLoading: isTokensLoading, error } = (0, import_connect_query26.useQuery)(
|
|
14354
|
+
import_frontier31.FrontierServiceQueries.totalDebitedTransactions,
|
|
14355
|
+
(0, import_protobuf14.create)(import_frontier31.TotalDebitedTransactionsRequestSchema, {
|
|
14312
14356
|
orgId: organizationId,
|
|
14313
14357
|
billingId: billingAccountId
|
|
14314
14358
|
}),
|
|
@@ -14317,12 +14361,12 @@ var TokensDetailsSection = () => {
|
|
|
14317
14361
|
select: (data) => String(data?.debited?.amount || "0")
|
|
14318
14362
|
}
|
|
14319
14363
|
);
|
|
14320
|
-
(0,
|
|
14364
|
+
(0, import_react37.useEffect)(() => {
|
|
14321
14365
|
if (error) {
|
|
14322
14366
|
console.error("Error fetching debited transactions:", error);
|
|
14323
14367
|
}
|
|
14324
14368
|
}, [error]);
|
|
14325
|
-
const isLoading = isTokensLoading;
|
|
14369
|
+
const isLoading = isBillingAccountLoading || isTokensLoading;
|
|
14326
14370
|
return /* @__PURE__ */ (0, import_jsx_runtime73.jsxs)(import_apsara65.List, { children: [
|
|
14327
14371
|
/* @__PURE__ */ (0, import_jsx_runtime73.jsx)(import_apsara65.List.Header, { children: "Tokens" }),
|
|
14328
14372
|
/* @__PURE__ */ (0, import_jsx_runtime73.jsxs)(import_apsara65.List.Item, { children: [
|
|
@@ -14360,8 +14404,8 @@ var TokensDetailsSection = () => {
|
|
|
14360
14404
|
// admin/views/organizations/details/side-panel/billing-details-section.tsx
|
|
14361
14405
|
var import_apsara66 = require("@raystack/apsara");
|
|
14362
14406
|
|
|
14363
|
-
// esbuild-css-modules-plugin-namespace:/tmp/tmp-
|
|
14364
|
-
var digest56 = "
|
|
14407
|
+
// esbuild-css-modules-plugin-namespace:/tmp/tmp-2174-nJEqFvKRUd02/sdk/admin/views/organizations/details/side-panel/side-panel.module.css.js
|
|
14408
|
+
var digest56 = "600aa746b474b8f3684381fb3a380260c361b69c8e3bef4eb3a0a545c08584a0";
|
|
14365
14409
|
var css56 = `._side-panel-section-item-label_slrfc_1 {
|
|
14366
14410
|
width: 120px;
|
|
14367
14411
|
}
|
|
@@ -14425,18 +14469,22 @@ var css56 = `._side-panel-section-item-label_slrfc_1 {
|
|
|
14425
14469
|
var side_panel_module_css_default10 = { "side-panel-section-item-label": "_side-panel-section-item-label_slrfc_1", "sidePanelSectionItemLabel": "_side-panel-section-item-label_slrfc_1", "org-details-section-org-id": "_org-details-section-org-id_slrfc_5", "orgDetailsSectionOrgId": "_org-details-section-org-id_slrfc_5", "kyc_link": "_kyc_link_slrfc_6", "kycLink": "_kyc_link_slrfc_6", "kyc-status-icon": "_kyc-status-icon_slrfc_13", "kycStatusIcon": "_kyc-status-icon_slrfc_13", "billing-header": "_billing-header_slrfc_18", "billingHeader": "_billing-header_slrfc_18", "billing-edit": "_billing-edit_slrfc_25", "billingEdit": "_billing-edit_slrfc_25", "billing-section": "_billing-section_slrfc_30", "billingSection": "_billing-section_slrfc_30", "billing-edit-disabled": "_billing-edit-disabled_slrfc_38", "billingEditDisabled": "_billing-edit-disabled_slrfc_38" };
|
|
14426
14470
|
|
|
14427
14471
|
// admin/views/organizations/details/side-panel/billing-details-section.tsx
|
|
14428
|
-
var
|
|
14429
|
-
var
|
|
14430
|
-
var
|
|
14431
|
-
var
|
|
14472
|
+
var import_react38 = require("react");
|
|
14473
|
+
var import_connect_query27 = require("@connectrpc/connect-query");
|
|
14474
|
+
var import_frontier32 = require("@raystack/proton/frontier");
|
|
14475
|
+
var import_protobuf15 = require("@bufbuild/protobuf");
|
|
14432
14476
|
var import_jsx_runtime74 = require("react/jsx-runtime");
|
|
14433
14477
|
var BillingDetailsSection = () => {
|
|
14434
|
-
const { billingAccount, organization } = (0,
|
|
14478
|
+
const { billingAccount, organization, isBillingAccountLoading } = (0, import_react38.useContext)(OrganizationContext);
|
|
14435
14479
|
const organizationId = organization?.id || "";
|
|
14436
14480
|
const billingAccountId = billingAccount?.id || "";
|
|
14437
|
-
const {
|
|
14438
|
-
|
|
14439
|
-
|
|
14481
|
+
const {
|
|
14482
|
+
data: upcomingInvoice,
|
|
14483
|
+
isLoading: isUpcomingInvoiceLoading,
|
|
14484
|
+
error
|
|
14485
|
+
} = (0, import_connect_query27.useQuery)(
|
|
14486
|
+
import_frontier32.FrontierServiceQueries.getUpcomingInvoice,
|
|
14487
|
+
(0, import_protobuf15.create)(import_frontier32.GetUpcomingInvoiceRequestSchema, {
|
|
14440
14488
|
orgId: organizationId,
|
|
14441
14489
|
billingId: billingAccountId
|
|
14442
14490
|
}),
|
|
@@ -14445,14 +14493,15 @@ var BillingDetailsSection = () => {
|
|
|
14445
14493
|
select: (data) => data?.invoice
|
|
14446
14494
|
}
|
|
14447
14495
|
);
|
|
14448
|
-
(0,
|
|
14496
|
+
(0, import_react38.useEffect)(() => {
|
|
14449
14497
|
if (error) {
|
|
14450
14498
|
console.error("Error fetching upcoming invoice:", error);
|
|
14451
14499
|
}
|
|
14452
14500
|
}, [error]);
|
|
14501
|
+
const isLoading = isBillingAccountLoading || isUpcomingInvoiceLoading;
|
|
14453
14502
|
const due_date = upcomingInvoice?.dueDate || upcomingInvoice?.periodEndAt;
|
|
14454
14503
|
const stripeLink = billingAccount?.providerId ? "https://dashboard.stripe.com/customers/" + billingAccount?.providerId : "";
|
|
14455
|
-
const { mutateAsync: createCheckout, isPending: isPortalLoading } = (0,
|
|
14504
|
+
const { mutateAsync: createCheckout, isPending: isPortalLoading } = (0, import_connect_query27.useMutation)(import_frontier32.FrontierServiceQueries.createCheckout, {
|
|
14456
14505
|
onError: (error2) => {
|
|
14457
14506
|
import_apsara66.toastManager.add({
|
|
14458
14507
|
title: "Something went wrong",
|
|
@@ -14469,7 +14518,7 @@ var BillingDetailsSection = () => {
|
|
|
14469
14518
|
const returnUrl = window.location.href;
|
|
14470
14519
|
try {
|
|
14471
14520
|
const resp = await createCheckout(
|
|
14472
|
-
(0,
|
|
14521
|
+
(0, import_protobuf15.create)(import_frontier32.CreateCheckoutRequestSchema, {
|
|
14473
14522
|
orgId: organizationId,
|
|
14474
14523
|
cancelUrl: returnUrl,
|
|
14475
14524
|
successUrl: returnUrl,
|
|
@@ -14586,14 +14635,14 @@ function OrgSidePanel({ organization }) {
|
|
|
14586
14635
|
}
|
|
14587
14636
|
|
|
14588
14637
|
// admin/views/organizations/details/layout/index.tsx
|
|
14589
|
-
var
|
|
14638
|
+
var import_react42 = require("react");
|
|
14590
14639
|
var import_icons7 = require("@raystack/apsara/icons");
|
|
14591
14640
|
|
|
14592
14641
|
// admin/views/organizations/details/edit/kyc.tsx
|
|
14593
14642
|
var import_apsara68 = require("@raystack/apsara");
|
|
14594
14643
|
|
|
14595
|
-
// esbuild-css-modules-plugin-namespace:/tmp/tmp-
|
|
14596
|
-
var digest57 = "
|
|
14644
|
+
// esbuild-css-modules-plugin-namespace:/tmp/tmp-2174-hFckG9RxUxoA/sdk/admin/views/organizations/details/edit/edit.module.css.js
|
|
14645
|
+
var digest57 = "ef56c159b58665e6cf71a7eb19178fe9ecb6e45f0b2beb05064a5a9ba3300d4d";
|
|
14597
14646
|
var css57 = `._drawer-content_18xgg_1 {
|
|
14598
14647
|
min-width: 500px;
|
|
14599
14648
|
padding: 0;
|
|
@@ -14642,13 +14691,13 @@ var css57 = `._drawer-content_18xgg_1 {
|
|
|
14642
14691
|
var edit_module_css_default = { "drawer-content": "_drawer-content_18xgg_1", "drawerContent": "_drawer-content_18xgg_1", "side-panel": "_side-panel_18xgg_7", "sidePanel": "_side-panel_18xgg_7", "side-panel-form": "_side-panel-form_18xgg_15", "sidePanelForm": "_side-panel-form_18xgg_15", "side-panel-content": "_side-panel-content_18xgg_22", "sidePanelContent": "_side-panel-content_18xgg_22", "side-panel-footer": "_side-panel-footer_18xgg_26", "sidePanelFooter": "_side-panel-footer_18xgg_26", "select-content": "_select-content_18xgg_31", "selectContent": "_select-content_18xgg_31" };
|
|
14643
14692
|
|
|
14644
14693
|
// admin/views/organizations/details/edit/kyc.tsx
|
|
14645
|
-
var
|
|
14694
|
+
var import_react39 = require("react");
|
|
14646
14695
|
var import_react_hook_form6 = require("react-hook-form");
|
|
14647
14696
|
var import_zod9 = require("@hookform/resolvers/zod");
|
|
14648
|
-
var
|
|
14649
|
-
var
|
|
14650
|
-
var
|
|
14651
|
-
var
|
|
14697
|
+
var import_connect_query28 = require("@connectrpc/connect-query");
|
|
14698
|
+
var import_react_query10 = require("@tanstack/react-query");
|
|
14699
|
+
var import_frontier33 = require("@raystack/proton/frontier");
|
|
14700
|
+
var import_protobuf16 = require("@bufbuild/protobuf");
|
|
14652
14701
|
var import_jsx_runtime76 = require("react/jsx-runtime");
|
|
14653
14702
|
var kycUpdateSchema = external_exports.object({
|
|
14654
14703
|
status: external_exports.boolean(),
|
|
@@ -14663,9 +14712,9 @@ var kycUpdateSchema = external_exports.object({
|
|
|
14663
14712
|
}
|
|
14664
14713
|
});
|
|
14665
14714
|
function EditKYCPanel({ open = false, onClose }) {
|
|
14666
|
-
const { organization, kycDetails, updateKYCDetails } = (0,
|
|
14667
|
-
const queryClient = (0,
|
|
14668
|
-
const transport = (0,
|
|
14715
|
+
const { organization, kycDetails, updateKYCDetails } = (0, import_react39.useContext)(OrganizationContext);
|
|
14716
|
+
const queryClient = (0, import_react_query10.useQueryClient)();
|
|
14717
|
+
const transport = (0, import_connect_query28.useTransport)();
|
|
14669
14718
|
const orgId = organization?.id || "";
|
|
14670
14719
|
const {
|
|
14671
14720
|
handleSubmit,
|
|
@@ -14680,15 +14729,15 @@ function EditKYCPanel({ open = false, onClose }) {
|
|
|
14680
14729
|
});
|
|
14681
14730
|
const {
|
|
14682
14731
|
mutateAsync: setOrganizationKycMutation
|
|
14683
|
-
} = (0,
|
|
14732
|
+
} = (0, import_connect_query28.useMutation)(import_frontier33.AdminServiceQueries.setOrganizationKyc, {
|
|
14684
14733
|
onSuccess: (data) => {
|
|
14685
14734
|
const newKycDetails = data.organizationKyc;
|
|
14686
14735
|
if (newKycDetails) {
|
|
14687
14736
|
updateKYCDetails(newKycDetails);
|
|
14688
14737
|
}
|
|
14689
14738
|
queryClient.invalidateQueries({
|
|
14690
|
-
queryKey: (0,
|
|
14691
|
-
schema:
|
|
14739
|
+
queryKey: (0, import_connect_query28.createConnectQueryKey)({
|
|
14740
|
+
schema: import_frontier33.FrontierServiceQueries.getOrganizationKyc,
|
|
14692
14741
|
transport,
|
|
14693
14742
|
input: { orgId },
|
|
14694
14743
|
cardinality: "finite"
|
|
@@ -14707,7 +14756,7 @@ function EditKYCPanel({ open = false, onClose }) {
|
|
|
14707
14756
|
return;
|
|
14708
14757
|
}
|
|
14709
14758
|
await setOrganizationKycMutation(
|
|
14710
|
-
(0,
|
|
14759
|
+
(0, import_protobuf16.create)(import_frontier33.SetOrganizationKycRequestSchema, {
|
|
14711
14760
|
orgId,
|
|
14712
14761
|
status: data.status,
|
|
14713
14762
|
link: data.link || ""
|
|
@@ -14817,10 +14866,10 @@ function EditKYCPanel({ open = false, onClose }) {
|
|
|
14817
14866
|
}
|
|
14818
14867
|
|
|
14819
14868
|
// admin/views/organizations/details/edit/organization.tsx
|
|
14820
|
-
var
|
|
14869
|
+
var import_react40 = require("react");
|
|
14821
14870
|
|
|
14822
|
-
// esbuild-css-modules-plugin-namespace:/tmp/tmp-
|
|
14823
|
-
var digest58 = "
|
|
14871
|
+
// esbuild-css-modules-plugin-namespace:/tmp/tmp-2174-3DZApJ2hXqvk/sdk/admin/views/organizations/details/edit/edit.module.css.js
|
|
14872
|
+
var digest58 = "7316bcc98111dcdafd82d0f10e35d0a2cee9fb3f73b11710e4377cc2ff85500a";
|
|
14824
14873
|
var css58 = `._drawer-content_18xgg_1 {
|
|
14825
14874
|
min-width: 500px;
|
|
14826
14875
|
padding: 0;
|
|
@@ -14872,10 +14921,10 @@ var edit_module_css_default2 = { "drawer-content": "_drawer-content_18xgg_1", "d
|
|
|
14872
14921
|
var import_apsara69 = require("@raystack/apsara");
|
|
14873
14922
|
var import_react_hook_form7 = require("react-hook-form");
|
|
14874
14923
|
var import_zod11 = require("@hookform/resolvers/zod");
|
|
14875
|
-
var
|
|
14876
|
-
var
|
|
14877
|
-
var
|
|
14878
|
-
var
|
|
14924
|
+
var import_connect_query29 = require("@connectrpc/connect-query");
|
|
14925
|
+
var import_react_query11 = require("@tanstack/react-query");
|
|
14926
|
+
var import_frontier34 = require("@raystack/proton/frontier");
|
|
14927
|
+
var import_protobuf17 = require("@bufbuild/protobuf");
|
|
14879
14928
|
var import_jsx_runtime77 = require("react/jsx-runtime");
|
|
14880
14929
|
var orgUpdateSchema = external_exports.object({
|
|
14881
14930
|
avatar: external_exports.string().optional(),
|
|
@@ -14915,12 +14964,12 @@ function getDefaultValue(organization, industries) {
|
|
|
14915
14964
|
}
|
|
14916
14965
|
function EditOrganizationPanel({ open = false, onClose }) {
|
|
14917
14966
|
const t = useTerminology();
|
|
14918
|
-
const { organization, appUrl, countries: countriesFromContext = [], organizationTypes: industries = [] } = (0,
|
|
14919
|
-
const [countries, setCountries] = (0,
|
|
14920
|
-
const queryClient = (0,
|
|
14921
|
-
const transport = (0,
|
|
14967
|
+
const { organization, appUrl, countries: countriesFromContext = [], organizationTypes: industries = [] } = (0, import_react40.useContext)(OrganizationContext);
|
|
14968
|
+
const [countries, setCountries] = (0, import_react40.useState)(countriesFromContext);
|
|
14969
|
+
const queryClient = (0, import_react_query11.useQueryClient)();
|
|
14970
|
+
const transport = (0, import_connect_query29.useTransport)();
|
|
14922
14971
|
const orgId = organization?.id || "";
|
|
14923
|
-
(0,
|
|
14972
|
+
(0, import_react40.useEffect)(() => {
|
|
14924
14973
|
if (countriesFromContext.length > 0)
|
|
14925
14974
|
setCountries(countriesFromContext);
|
|
14926
14975
|
}, [countriesFromContext]);
|
|
@@ -14939,11 +14988,11 @@ function EditOrganizationPanel({ open = false, onClose }) {
|
|
|
14939
14988
|
mutateAsync: updateOrganizationMutation,
|
|
14940
14989
|
error: mutationError,
|
|
14941
14990
|
isPending: isSubmitting
|
|
14942
|
-
} = (0,
|
|
14991
|
+
} = (0, import_connect_query29.useMutation)(import_frontier34.FrontierServiceQueries.updateOrganization, {
|
|
14943
14992
|
onSuccess: () => {
|
|
14944
14993
|
queryClient.invalidateQueries({
|
|
14945
|
-
queryKey: (0,
|
|
14946
|
-
schema:
|
|
14994
|
+
queryKey: (0, import_connect_query29.createConnectQueryKey)({
|
|
14995
|
+
schema: import_frontier34.FrontierServiceQueries.getOrganization,
|
|
14947
14996
|
transport,
|
|
14948
14997
|
input: { id: orgId },
|
|
14949
14998
|
cardinality: "finite"
|
|
@@ -14952,7 +15001,7 @@ function EditOrganizationPanel({ open = false, onClose }) {
|
|
|
14952
15001
|
onClose();
|
|
14953
15002
|
}
|
|
14954
15003
|
});
|
|
14955
|
-
(0,
|
|
15004
|
+
(0, import_react40.useEffect)(() => {
|
|
14956
15005
|
if (mutationError) {
|
|
14957
15006
|
if (mutationError.message?.includes("already exists")) {
|
|
14958
15007
|
setError("name", { message: `${t.organization({ case: "capital" })} name already exists` });
|
|
@@ -14973,7 +15022,7 @@ function EditOrganizationPanel({ open = false, onClose }) {
|
|
|
14973
15022
|
country: data.country
|
|
14974
15023
|
}
|
|
14975
15024
|
};
|
|
14976
|
-
await updateOrganizationMutation((0,
|
|
15025
|
+
await updateOrganizationMutation((0, import_protobuf17.create)(import_frontier34.UpdateOrganizationRequestSchema, {
|
|
14977
15026
|
id: orgId,
|
|
14978
15027
|
body: payload
|
|
14979
15028
|
}));
|
|
@@ -15175,8 +15224,8 @@ function EditOrganizationPanel({ open = false, onClose }) {
|
|
|
15175
15224
|
// admin/views/organizations/details/edit/billing.tsx
|
|
15176
15225
|
var import_apsara70 = require("@raystack/apsara");
|
|
15177
15226
|
|
|
15178
|
-
// esbuild-css-modules-plugin-namespace:/tmp/tmp-
|
|
15179
|
-
var digest59 = "
|
|
15227
|
+
// esbuild-css-modules-plugin-namespace:/tmp/tmp-2174-1EkAW0jj3HLk/sdk/admin/views/organizations/details/edit/edit.module.css.js
|
|
15228
|
+
var digest59 = "73e36fcd11647532d1b2a212fe3b88608948126046c07b1b31d8440033a407c7";
|
|
15180
15229
|
var css59 = `._drawer-content_18xgg_1 {
|
|
15181
15230
|
min-width: 500px;
|
|
15182
15231
|
padding: 0;
|
|
@@ -15225,12 +15274,12 @@ var css59 = `._drawer-content_18xgg_1 {
|
|
|
15225
15274
|
var edit_module_css_default3 = { "drawer-content": "_drawer-content_18xgg_1", "drawerContent": "_drawer-content_18xgg_1", "side-panel": "_side-panel_18xgg_7", "sidePanel": "_side-panel_18xgg_7", "side-panel-form": "_side-panel-form_18xgg_15", "sidePanelForm": "_side-panel-form_18xgg_15", "side-panel-content": "_side-panel-content_18xgg_22", "sidePanelContent": "_side-panel-content_18xgg_22", "side-panel-footer": "_side-panel-footer_18xgg_26", "sidePanelFooter": "_side-panel-footer_18xgg_26", "select-content": "_select-content_18xgg_31", "selectContent": "_select-content_18xgg_31" };
|
|
15226
15275
|
|
|
15227
15276
|
// admin/views/organizations/details/edit/billing.tsx
|
|
15228
|
-
var
|
|
15277
|
+
var import_react41 = require("react");
|
|
15229
15278
|
var import_react_hook_form8 = require("react-hook-form");
|
|
15230
15279
|
var import_zod13 = require("@hookform/resolvers/zod");
|
|
15231
|
-
var
|
|
15232
|
-
var
|
|
15233
|
-
var
|
|
15280
|
+
var import_connect_query30 = require("@connectrpc/connect-query");
|
|
15281
|
+
var import_frontier35 = require("@raystack/proton/frontier");
|
|
15282
|
+
var import_protobuf18 = require("@bufbuild/protobuf");
|
|
15234
15283
|
var import_jsx_runtime78 = require("react/jsx-runtime");
|
|
15235
15284
|
var billingDetailsUpdateSchema = external_exports.object({
|
|
15236
15285
|
tokenPaymentType: external_exports.enum(["prepaid", "postpaid"]),
|
|
@@ -15273,7 +15322,7 @@ function EditBillingPanel({ open = false, onClose }) {
|
|
|
15273
15322
|
billingAccountDetails,
|
|
15274
15323
|
isBillingAccountLoading: isLoading,
|
|
15275
15324
|
fetchBillingAccountDetails
|
|
15276
|
-
} = (0,
|
|
15325
|
+
} = (0, import_react41.useContext)(OrganizationContext);
|
|
15277
15326
|
const organizationId = billingAccount?.orgId || "";
|
|
15278
15327
|
const billingId = billingAccount?.id || "";
|
|
15279
15328
|
const {
|
|
@@ -15286,7 +15335,7 @@ function EditBillingPanel({ open = false, onClose }) {
|
|
|
15286
15335
|
} = (0, import_react_hook_form8.useForm)({
|
|
15287
15336
|
resolver: (0, import_zod13.zodResolver)(billingDetailsUpdateSchema)
|
|
15288
15337
|
});
|
|
15289
|
-
const billingDetailsData = (0,
|
|
15338
|
+
const billingDetailsData = (0, import_react41.useMemo)(() => {
|
|
15290
15339
|
const creditMin = billingAccountDetails?.creditMin || 0n;
|
|
15291
15340
|
const absoluteCreditMin = creditMin < 0n ? creditMin * BigInt(-1) : creditMin;
|
|
15292
15341
|
const dueInDays = billingAccountDetails?.dueInDays || 0n;
|
|
@@ -15297,13 +15346,13 @@ function EditBillingPanel({ open = false, onClose }) {
|
|
|
15297
15346
|
dueInDays: dueInDays.toString()
|
|
15298
15347
|
};
|
|
15299
15348
|
}, [billingAccountDetails]);
|
|
15300
|
-
(0,
|
|
15349
|
+
(0, import_react41.useEffect)(() => {
|
|
15301
15350
|
if (billingDetailsData) {
|
|
15302
15351
|
reset(billingDetailsData);
|
|
15303
15352
|
}
|
|
15304
15353
|
}, [billingDetailsData, reset]);
|
|
15305
|
-
const { mutateAsync: updateBillingDetails } = (0,
|
|
15306
|
-
|
|
15354
|
+
const { mutateAsync: updateBillingDetails } = (0, import_connect_query30.useMutation)(
|
|
15355
|
+
import_frontier35.AdminServiceQueries.updateBillingAccountDetails,
|
|
15307
15356
|
{
|
|
15308
15357
|
onError: (error) => {
|
|
15309
15358
|
import_apsara70.toastManager.add({
|
|
@@ -15315,13 +15364,16 @@ function EditBillingPanel({ open = false, onClose }) {
|
|
|
15315
15364
|
}
|
|
15316
15365
|
}
|
|
15317
15366
|
);
|
|
15367
|
+
const canSave = !!organizationId && !!billingId;
|
|
15318
15368
|
const onSubmit = async (data) => {
|
|
15369
|
+
if (!canSave)
|
|
15370
|
+
return;
|
|
15319
15371
|
try {
|
|
15320
15372
|
const creditMinValue = data.tokenPaymentType === "prepaid" ? 0n : BigInt(data.creditMin);
|
|
15321
15373
|
const dueInDaysValue = data.tokenPaymentType === "prepaid" ? 0n : BigInt(data.dueInDays);
|
|
15322
15374
|
const creditMinForApi = data.tokenPaymentType === "postpaid" ? -creditMinValue : creditMinValue;
|
|
15323
15375
|
await updateBillingDetails(
|
|
15324
|
-
(0,
|
|
15376
|
+
(0, import_protobuf18.create)(import_frontier35.UpdateBillingAccountDetailsRequestSchema, {
|
|
15325
15377
|
orgId: organizationId,
|
|
15326
15378
|
id: billingId,
|
|
15327
15379
|
creditMin: creditMinForApi,
|
|
@@ -15339,7 +15391,7 @@ function EditBillingPanel({ open = false, onClose }) {
|
|
|
15339
15391
|
console.error("Failed to update billing details:", error);
|
|
15340
15392
|
}
|
|
15341
15393
|
};
|
|
15342
|
-
const onValueChange = (0,
|
|
15394
|
+
const onValueChange = (0, import_react41.useCallback)((value) => {
|
|
15343
15395
|
const paymentType = value;
|
|
15344
15396
|
setValue("tokenPaymentType", paymentType);
|
|
15345
15397
|
if (paymentType === "prepaid") {
|
|
@@ -15448,7 +15500,7 @@ function EditBillingPanel({ open = false, onClose }) {
|
|
|
15448
15500
|
{
|
|
15449
15501
|
"data-test-id": "save-update-billing-details-button",
|
|
15450
15502
|
type: "submit",
|
|
15451
|
-
disabled: isLoading || isSubmitting,
|
|
15503
|
+
disabled: isLoading || !canSave || isSubmitting,
|
|
15452
15504
|
loading: isSubmitting,
|
|
15453
15505
|
loaderText: "Saving...",
|
|
15454
15506
|
children: "Save"
|
|
@@ -15476,10 +15528,10 @@ var OrganizationDetailsLayout = ({
|
|
|
15476
15528
|
onNavigate
|
|
15477
15529
|
}) => {
|
|
15478
15530
|
const t = useTerminology();
|
|
15479
|
-
const [showSidePanel, setShowSidePanel] = (0,
|
|
15480
|
-
const [showKYCPanel, setShowKYCPanel] = (0,
|
|
15481
|
-
const [showEditOrgPanel, setShowEditOrgPanel] = (0,
|
|
15482
|
-
const [showEditBillingPanel, setShowEditBillingPanel] = (0,
|
|
15531
|
+
const [showSidePanel, setShowSidePanel] = (0, import_react42.useState)(true);
|
|
15532
|
+
const [showKYCPanel, setShowKYCPanel] = (0, import_react42.useState)(false);
|
|
15533
|
+
const [showEditOrgPanel, setShowEditOrgPanel] = (0, import_react42.useState)(false);
|
|
15534
|
+
const [showEditBillingPanel, setShowEditBillingPanel] = (0, import_react42.useState)(false);
|
|
15483
15535
|
function toggleSidePanel() {
|
|
15484
15536
|
setShowSidePanel(!showSidePanel);
|
|
15485
15537
|
}
|
|
@@ -15554,7 +15606,7 @@ var OrganizationDetailsLayout = ({
|
|
|
15554
15606
|
};
|
|
15555
15607
|
|
|
15556
15608
|
// admin/views/organizations/details/index.tsx
|
|
15557
|
-
var
|
|
15609
|
+
var import_frontier36 = require("@raystack/proton/frontier");
|
|
15558
15610
|
var import_jsx_runtime80 = require("react/jsx-runtime");
|
|
15559
15611
|
var OrganizationDetailsView = ({
|
|
15560
15612
|
organizationId,
|
|
@@ -15569,24 +15621,26 @@ var OrganizationDetailsView = ({
|
|
|
15569
15621
|
onNavigate,
|
|
15570
15622
|
children
|
|
15571
15623
|
}) => {
|
|
15572
|
-
const [isSearchVisible, setIsSearchVisible] = (0,
|
|
15573
|
-
const [searchQuery, setSearchQuery] = (0,
|
|
15574
|
-
const queryClient = (0,
|
|
15575
|
-
const transport = (0,
|
|
15624
|
+
const [isSearchVisible, setIsSearchVisible] = (0, import_react43.useState)(false);
|
|
15625
|
+
const [searchQuery, setSearchQuery] = (0, import_react43.useState)("");
|
|
15626
|
+
const queryClient = (0, import_react_query12.useQueryClient)();
|
|
15627
|
+
const transport = (0, import_connect_query31.useTransport)();
|
|
15576
15628
|
const {
|
|
15577
15629
|
data: organization,
|
|
15578
15630
|
isLoading: isOrganizationLoading,
|
|
15579
15631
|
error: organizationError
|
|
15580
|
-
} = (0,
|
|
15581
|
-
|
|
15632
|
+
} = (0, import_connect_query31.useQuery)(
|
|
15633
|
+
import_frontier36.FrontierServiceQueries.getOrganization,
|
|
15582
15634
|
{ id: organizationId },
|
|
15583
15635
|
{
|
|
15584
15636
|
enabled: !!organizationId,
|
|
15637
|
+
// Holds the page's seed; edit and block/unblock invalidate this key.
|
|
15638
|
+
staleTime: SHARED_QUERY_STALE_TIME,
|
|
15585
15639
|
select: (data) => data?.organization
|
|
15586
15640
|
}
|
|
15587
15641
|
);
|
|
15588
15642
|
const getOrganizationQueryKey = [
|
|
15589
|
-
|
|
15643
|
+
import_frontier36.FrontierServiceQueries.getOrganization,
|
|
15590
15644
|
{ id: organizationId }
|
|
15591
15645
|
];
|
|
15592
15646
|
async function updateOrganization(org) {
|
|
@@ -15596,25 +15650,25 @@ var OrganizationDetailsView = ({
|
|
|
15596
15650
|
data: kycData,
|
|
15597
15651
|
isLoading: isKYCLoading,
|
|
15598
15652
|
error: kycError
|
|
15599
|
-
} = (0,
|
|
15600
|
-
|
|
15653
|
+
} = (0, import_connect_query31.useQuery)(
|
|
15654
|
+
import_frontier36.FrontierServiceQueries.getOrganizationKyc,
|
|
15601
15655
|
{ orgId: organizationId || "" },
|
|
15602
15656
|
{
|
|
15603
15657
|
enabled: !!organizationId
|
|
15604
15658
|
}
|
|
15605
15659
|
);
|
|
15606
|
-
const kycDetails = (0,
|
|
15660
|
+
const kycDetails = (0, import_react43.useMemo)(() => kycData?.organizationKyc, [kycData]);
|
|
15607
15661
|
function updateKYCDetails(kyc) {
|
|
15608
15662
|
if (!organizationId)
|
|
15609
15663
|
return;
|
|
15610
15664
|
queryClient.setQueryData(
|
|
15611
|
-
(0,
|
|
15612
|
-
schema:
|
|
15665
|
+
(0, import_connect_query31.createConnectQueryKey)({
|
|
15666
|
+
schema: import_frontier36.FrontierServiceQueries.getOrganizationKyc,
|
|
15613
15667
|
transport,
|
|
15614
15668
|
input: { orgId: organizationId },
|
|
15615
15669
|
cardinality: "finite"
|
|
15616
15670
|
}),
|
|
15617
|
-
(0,
|
|
15671
|
+
(0, import_protobuf19.create)(import_frontier36.GetOrganizationKycResponseSchema, { organizationKyc: kyc })
|
|
15618
15672
|
);
|
|
15619
15673
|
}
|
|
15620
15674
|
const { roles, isLoading: isRolesLoading } = useOrganizationRoles(
|
|
@@ -15622,29 +15676,11 @@ var OrganizationDetailsView = ({
|
|
|
15622
15676
|
{ enabled: !!organizationId }
|
|
15623
15677
|
);
|
|
15624
15678
|
const {
|
|
15625
|
-
data:
|
|
15626
|
-
isLoading:
|
|
15627
|
-
error:
|
|
15628
|
-
} = (0,
|
|
15629
|
-
|
|
15630
|
-
{ id: organizationId || "" },
|
|
15631
|
-
{
|
|
15632
|
-
enabled: !!organizationId,
|
|
15633
|
-
select: (data) => {
|
|
15634
|
-
const users = data?.users || [];
|
|
15635
|
-
return users.reduce(
|
|
15636
|
-
(acc, user) => {
|
|
15637
|
-
const id = user.id || "";
|
|
15638
|
-
acc[id] = user;
|
|
15639
|
-
return acc;
|
|
15640
|
-
},
|
|
15641
|
-
{}
|
|
15642
|
-
);
|
|
15643
|
-
}
|
|
15644
|
-
}
|
|
15645
|
-
);
|
|
15646
|
-
const { data: firstBillingAccountId = "", error: billingAccountsError } = (0, import_connect_query30.useQuery)(
|
|
15647
|
-
import_frontier35.FrontierServiceQueries.listBillingAccounts,
|
|
15679
|
+
data: firstBillingAccountId = "",
|
|
15680
|
+
isLoading: isBillingAccountsLoading,
|
|
15681
|
+
error: billingAccountsError
|
|
15682
|
+
} = (0, import_connect_query31.useQuery)(
|
|
15683
|
+
import_frontier36.FrontierServiceQueries.listBillingAccounts,
|
|
15648
15684
|
{ orgId: organizationId || "" },
|
|
15649
15685
|
{
|
|
15650
15686
|
enabled: !!organizationId,
|
|
@@ -15656,9 +15692,9 @@ var OrganizationDetailsView = ({
|
|
|
15656
15692
|
isLoading: isBillingAccountLoading,
|
|
15657
15693
|
error: billingAccountError,
|
|
15658
15694
|
refetch: fetchBillingAccountDetails
|
|
15659
|
-
} = (0,
|
|
15660
|
-
|
|
15661
|
-
(0,
|
|
15695
|
+
} = (0, import_connect_query31.useQuery)(
|
|
15696
|
+
import_frontier36.FrontierServiceQueries.getBillingAccount,
|
|
15697
|
+
(0, import_protobuf19.create)(import_frontier36.GetBillingAccountRequestSchema, {
|
|
15662
15698
|
id: firstBillingAccountId,
|
|
15663
15699
|
withBillingDetails: true
|
|
15664
15700
|
}),
|
|
@@ -15672,14 +15708,15 @@ var OrganizationDetailsView = ({
|
|
|
15672
15708
|
);
|
|
15673
15709
|
const billingAccount = billingAccountData?.billingAccount;
|
|
15674
15710
|
const billingAccountDetails = billingAccountData?.billingAccountDetails;
|
|
15711
|
+
const isBillingLoading = isBillingAccountsLoading || isBillingAccountLoading;
|
|
15675
15712
|
const {
|
|
15676
15713
|
data: tokenBalance = "0",
|
|
15677
15714
|
isLoading: isTokenBalanceLoading,
|
|
15678
15715
|
error: tokenBalanceError,
|
|
15679
15716
|
refetch: fetchTokenBalance
|
|
15680
|
-
} = (0,
|
|
15681
|
-
|
|
15682
|
-
(0,
|
|
15717
|
+
} = (0, import_connect_query31.useQuery)(
|
|
15718
|
+
import_frontier36.FrontierServiceQueries.getBillingBalance,
|
|
15719
|
+
(0, import_protobuf19.create)(import_frontier36.GetBillingBalanceRequestSchema, {
|
|
15683
15720
|
id: firstBillingAccountId
|
|
15684
15721
|
}),
|
|
15685
15722
|
{
|
|
@@ -15687,16 +15724,13 @@ var OrganizationDetailsView = ({
|
|
|
15687
15724
|
select: (data) => String(data?.balance?.amount || "0")
|
|
15688
15725
|
}
|
|
15689
15726
|
);
|
|
15690
|
-
(0,
|
|
15727
|
+
(0, import_react43.useEffect)(() => {
|
|
15691
15728
|
if (organizationError) {
|
|
15692
15729
|
console.error("Failed to fetch organization:", organizationError);
|
|
15693
15730
|
}
|
|
15694
15731
|
if (kycError) {
|
|
15695
15732
|
console.error("Failed to fetch KYC details:", kycError);
|
|
15696
15733
|
}
|
|
15697
|
-
if (orgMembersError) {
|
|
15698
|
-
console.error("Failed to fetch organization members:", orgMembersError);
|
|
15699
|
-
}
|
|
15700
15734
|
if (billingAccountsError) {
|
|
15701
15735
|
console.error("Failed to fetch billing accounts:", billingAccountsError);
|
|
15702
15736
|
}
|
|
@@ -15712,12 +15746,11 @@ var OrganizationDetailsView = ({
|
|
|
15712
15746
|
}, [
|
|
15713
15747
|
organizationError,
|
|
15714
15748
|
kycError,
|
|
15715
|
-
orgMembersError,
|
|
15716
15749
|
billingAccountsError,
|
|
15717
15750
|
billingAccountError,
|
|
15718
15751
|
tokenBalanceError
|
|
15719
15752
|
]);
|
|
15720
|
-
const isLoading = isOrganizationLoading || isRolesLoading
|
|
15753
|
+
const isLoading = isOrganizationLoading || isRolesLoading;
|
|
15721
15754
|
return /* @__PURE__ */ (0, import_jsx_runtime80.jsx)(
|
|
15722
15755
|
OrganizationContext.Provider,
|
|
15723
15756
|
{
|
|
@@ -15727,13 +15760,11 @@ var OrganizationDetailsView = ({
|
|
|
15727
15760
|
roles,
|
|
15728
15761
|
billingAccount,
|
|
15729
15762
|
billingAccountDetails,
|
|
15730
|
-
isBillingAccountLoading,
|
|
15763
|
+
isBillingAccountLoading: isBillingLoading,
|
|
15731
15764
|
fetchBillingAccountDetails,
|
|
15732
15765
|
tokenBalance,
|
|
15733
|
-
isTokenBalanceLoading,
|
|
15766
|
+
isTokenBalanceLoading: isBillingAccountsLoading || isTokenBalanceLoading,
|
|
15734
15767
|
fetchTokenBalance,
|
|
15735
|
-
orgMembersMap,
|
|
15736
|
-
isOrgMembersMapLoading,
|
|
15737
15768
|
updateKYCDetails,
|
|
15738
15769
|
kycDetails,
|
|
15739
15770
|
isKYCLoading,
|
|
@@ -15768,8 +15799,8 @@ var OrganizationDetailsView = ({
|
|
|
15768
15799
|
// admin/views/organizations/details/security/index.tsx
|
|
15769
15800
|
var import_apsara74 = require("@raystack/apsara");
|
|
15770
15801
|
|
|
15771
|
-
// esbuild-css-modules-plugin-namespace:/tmp/tmp-
|
|
15772
|
-
var digest60 = "
|
|
15802
|
+
// esbuild-css-modules-plugin-namespace:/tmp/tmp-2174-UwlxjAOOaSEE/sdk/admin/views/organizations/details/security/security.module.css.js
|
|
15803
|
+
var digest60 = "e3f4d9576f6838f9bb0aa1986c50330f68ed26f3266bbe24bd4b38f2236007aa";
|
|
15773
15804
|
var css60 = `._container_gfopt_1 {
|
|
15774
15805
|
width: 100%;
|
|
15775
15806
|
}
|
|
@@ -15820,29 +15851,29 @@ var css60 = `._container_gfopt_1 {
|
|
|
15820
15851
|
var security_module_css_default2 = { "container": "_container_gfopt_1", "content": "_content_gfopt_5", "domains-list": "_domains-list_gfopt_11", "domainsList": "_domains-list_gfopt_11", "domains-list-status": "_domains-list-status_gfopt_18", "domainsListStatus": "_domains-list-status_gfopt_18", "domains-list-empty": "_domains-list-empty_gfopt_22", "domainsListEmpty": "_domains-list-empty_gfopt_22", "domains-list-item": "_domains-list-item_gfopt_28", "domainsListItem": "_domains-list-item_gfopt_28" };
|
|
15821
15852
|
|
|
15822
15853
|
// admin/views/organizations/details/security/index.tsx
|
|
15823
|
-
var
|
|
15854
|
+
var import_react46 = require("react");
|
|
15824
15855
|
|
|
15825
15856
|
// admin/views/organizations/details/security/block-organization.tsx
|
|
15826
15857
|
var import_apsara72 = require("@raystack/apsara");
|
|
15827
|
-
var
|
|
15828
|
-
var
|
|
15829
|
-
var
|
|
15830
|
-
var
|
|
15831
|
-
var
|
|
15858
|
+
var import_react44 = require("react");
|
|
15859
|
+
var import_connect_query32 = require("@connectrpc/connect-query");
|
|
15860
|
+
var import_frontier37 = require("@raystack/proton/frontier");
|
|
15861
|
+
var import_protobuf20 = require("@bufbuild/protobuf");
|
|
15862
|
+
var import_react_query13 = require("@tanstack/react-query");
|
|
15832
15863
|
var import_jsx_runtime81 = require("react/jsx-runtime");
|
|
15833
15864
|
var BlockOrganizationDialog = () => {
|
|
15834
15865
|
const t = useTerminology();
|
|
15835
|
-
const { organization } = (0,
|
|
15836
|
-
const queryClient = (0,
|
|
15837
|
-
const transport = (0,
|
|
15838
|
-
const [isDialogOpen, setIsDialogOpen] = (0,
|
|
15839
|
-
const { mutateAsync: disableOrganization, isPending: isDisabling } = (0,
|
|
15840
|
-
|
|
15866
|
+
const { organization } = (0, import_react44.useContext)(OrganizationContext);
|
|
15867
|
+
const queryClient = (0, import_react_query13.useQueryClient)();
|
|
15868
|
+
const transport = (0, import_connect_query32.useTransport)();
|
|
15869
|
+
const [isDialogOpen, setIsDialogOpen] = (0, import_react44.useState)(false);
|
|
15870
|
+
const { mutateAsync: disableOrganization, isPending: isDisabling } = (0, import_connect_query32.useMutation)(
|
|
15871
|
+
import_frontier37.FrontierServiceQueries.disableOrganization,
|
|
15841
15872
|
{
|
|
15842
15873
|
onSuccess: async () => {
|
|
15843
15874
|
await queryClient.invalidateQueries({
|
|
15844
|
-
queryKey: (0,
|
|
15845
|
-
schema:
|
|
15875
|
+
queryKey: (0, import_connect_query32.createConnectQueryKey)({
|
|
15876
|
+
schema: import_frontier37.FrontierServiceQueries.getOrganization,
|
|
15846
15877
|
transport,
|
|
15847
15878
|
input: { id: organization?.id },
|
|
15848
15879
|
cardinality: "finite"
|
|
@@ -15861,13 +15892,13 @@ var BlockOrganizationDialog = () => {
|
|
|
15861
15892
|
}
|
|
15862
15893
|
}
|
|
15863
15894
|
);
|
|
15864
|
-
const { mutateAsync: enableOrganization, isPending: isEnabling } = (0,
|
|
15865
|
-
|
|
15895
|
+
const { mutateAsync: enableOrganization, isPending: isEnabling } = (0, import_connect_query32.useMutation)(
|
|
15896
|
+
import_frontier37.FrontierServiceQueries.enableOrganization,
|
|
15866
15897
|
{
|
|
15867
15898
|
onSuccess: async () => {
|
|
15868
15899
|
await queryClient.invalidateQueries({
|
|
15869
|
-
queryKey: (0,
|
|
15870
|
-
schema:
|
|
15900
|
+
queryKey: (0, import_connect_query32.createConnectQueryKey)({
|
|
15901
|
+
schema: import_frontier37.FrontierServiceQueries.getOrganization,
|
|
15871
15902
|
transport,
|
|
15872
15903
|
input: { id: organization?.id },
|
|
15873
15904
|
cardinality: "finite"
|
|
@@ -15888,14 +15919,14 @@ var BlockOrganizationDialog = () => {
|
|
|
15888
15919
|
);
|
|
15889
15920
|
async function onBlockOrganization() {
|
|
15890
15921
|
await disableOrganization(
|
|
15891
|
-
(0,
|
|
15922
|
+
(0, import_protobuf20.create)(import_frontier37.DisableOrganizationRequestSchema, {
|
|
15892
15923
|
id: organization?.id || ""
|
|
15893
15924
|
})
|
|
15894
15925
|
);
|
|
15895
15926
|
}
|
|
15896
15927
|
async function onUnblockOrganization() {
|
|
15897
15928
|
await enableOrganization(
|
|
15898
|
-
(0,
|
|
15929
|
+
(0, import_protobuf20.create)(import_frontier37.EnableOrganizationRequestSchema, {
|
|
15899
15930
|
id: organization?.id || ""
|
|
15900
15931
|
})
|
|
15901
15932
|
);
|
|
@@ -15987,8 +16018,8 @@ var BlockOrganizationSection = () => {
|
|
|
15987
16018
|
// admin/views/organizations/details/security/domains-list.tsx
|
|
15988
16019
|
var import_apsara73 = require("@raystack/apsara");
|
|
15989
16020
|
|
|
15990
|
-
// esbuild-css-modules-plugin-namespace:/tmp/tmp-
|
|
15991
|
-
var digest61 = "
|
|
16021
|
+
// esbuild-css-modules-plugin-namespace:/tmp/tmp-2174-6MPjLAf1sj0t/sdk/admin/views/organizations/details/security/security.module.css.js
|
|
16022
|
+
var digest61 = "baa19ccc8e1d35bd056e9cf106c4e582b2c9fc192a1b82e34c20dd214e134d08";
|
|
15992
16023
|
var css61 = `._container_gfopt_1 {
|
|
15993
16024
|
width: 100%;
|
|
15994
16025
|
}
|
|
@@ -16039,26 +16070,26 @@ var css61 = `._container_gfopt_1 {
|
|
|
16039
16070
|
var security_module_css_default3 = { "container": "_container_gfopt_1", "content": "_content_gfopt_5", "domains-list": "_domains-list_gfopt_11", "domainsList": "_domains-list_gfopt_11", "domains-list-status": "_domains-list-status_gfopt_18", "domainsListStatus": "_domains-list-status_gfopt_18", "domains-list-empty": "_domains-list-empty_gfopt_22", "domainsListEmpty": "_domains-list-empty_gfopt_22", "domains-list-item": "_domains-list-item_gfopt_28", "domainsListItem": "_domains-list-item_gfopt_28" };
|
|
16040
16071
|
|
|
16041
16072
|
// admin/views/organizations/details/security/domains-list.tsx
|
|
16042
|
-
var
|
|
16043
|
-
var
|
|
16044
|
-
var
|
|
16045
|
-
var
|
|
16046
|
-
var
|
|
16073
|
+
var import_react45 = require("react");
|
|
16074
|
+
var import_connect_query33 = require("@connectrpc/connect-query");
|
|
16075
|
+
var import_react_query14 = require("@tanstack/react-query");
|
|
16076
|
+
var import_frontier38 = require("@raystack/proton/frontier");
|
|
16077
|
+
var import_protobuf21 = require("@bufbuild/protobuf");
|
|
16047
16078
|
var import_jsx_runtime82 = require("react/jsx-runtime");
|
|
16048
16079
|
var DeleteDomainDialog = ({
|
|
16049
16080
|
domain
|
|
16050
16081
|
}) => {
|
|
16051
|
-
const { organization } = (0,
|
|
16052
|
-
const [isDialogOpen, setIsDialogOpen] = (0,
|
|
16053
|
-
const queryClient = (0,
|
|
16054
|
-
const transport = (0,
|
|
16055
|
-
const { mutateAsync: deleteDomain, isPending } = (0,
|
|
16056
|
-
|
|
16082
|
+
const { organization } = (0, import_react45.useContext)(OrganizationContext);
|
|
16083
|
+
const [isDialogOpen, setIsDialogOpen] = (0, import_react45.useState)(false);
|
|
16084
|
+
const queryClient = (0, import_react_query14.useQueryClient)();
|
|
16085
|
+
const transport = (0, import_connect_query33.useTransport)();
|
|
16086
|
+
const { mutateAsync: deleteDomain, isPending } = (0, import_connect_query33.useMutation)(
|
|
16087
|
+
import_frontier38.FrontierServiceQueries.deleteOrganizationDomain,
|
|
16057
16088
|
{
|
|
16058
16089
|
onSuccess: () => {
|
|
16059
16090
|
queryClient.invalidateQueries({
|
|
16060
|
-
queryKey: (0,
|
|
16061
|
-
schema:
|
|
16091
|
+
queryKey: (0, import_connect_query33.createConnectQueryKey)({
|
|
16092
|
+
schema: import_frontier38.FrontierServiceQueries.listOrganizationDomains,
|
|
16062
16093
|
transport,
|
|
16063
16094
|
input: { orgId: organization?.id || "" },
|
|
16064
16095
|
cardinality: "finite"
|
|
@@ -16079,7 +16110,7 @@ var DeleteDomainDialog = ({
|
|
|
16079
16110
|
);
|
|
16080
16111
|
const handleDelete = async () => {
|
|
16081
16112
|
await deleteDomain(
|
|
16082
|
-
(0,
|
|
16113
|
+
(0, import_protobuf21.create)(import_frontier38.DeleteOrganizationDomainRequestSchema, {
|
|
16083
16114
|
orgId: domain?.orgId || "",
|
|
16084
16115
|
id: domain?.id || ""
|
|
16085
16116
|
})
|
|
@@ -16195,10 +16226,10 @@ var DomainsList = ({
|
|
|
16195
16226
|
};
|
|
16196
16227
|
|
|
16197
16228
|
// admin/views/organizations/details/security/index.tsx
|
|
16198
|
-
var
|
|
16199
|
-
var
|
|
16200
|
-
var
|
|
16201
|
-
var
|
|
16229
|
+
var import_connect_query34 = require("@connectrpc/connect-query");
|
|
16230
|
+
var import_frontier39 = require("@raystack/proton/frontier");
|
|
16231
|
+
var import_protobuf22 = require("@bufbuild/protobuf");
|
|
16232
|
+
var import_react47 = require("react");
|
|
16202
16233
|
var import_jsx_runtime83 = require("react/jsx-runtime");
|
|
16203
16234
|
var AddDomainSection = () => {
|
|
16204
16235
|
return /* @__PURE__ */ (0, import_jsx_runtime83.jsxs)(import_apsara74.Flex, { gap: 5, justify: "between", children: [
|
|
@@ -16224,10 +16255,10 @@ var AddDomainSection = () => {
|
|
|
16224
16255
|
] });
|
|
16225
16256
|
};
|
|
16226
16257
|
var OrganizationSecurity = () => {
|
|
16227
|
-
const { organization } = (0,
|
|
16228
|
-
const { data: domains, isLoading, error, refetch } = (0,
|
|
16229
|
-
|
|
16230
|
-
(0,
|
|
16258
|
+
const { organization } = (0, import_react46.useContext)(OrganizationContext);
|
|
16259
|
+
const { data: domains, isLoading, error, refetch } = (0, import_connect_query34.useQuery)(
|
|
16260
|
+
import_frontier39.FrontierServiceQueries.listOrganizationDomains,
|
|
16261
|
+
(0, import_protobuf22.create)(import_frontier39.ListOrganizationDomainsRequestSchema, {
|
|
16231
16262
|
orgId: organization?.id
|
|
16232
16263
|
}),
|
|
16233
16264
|
{
|
|
@@ -16235,7 +16266,7 @@ var OrganizationSecurity = () => {
|
|
|
16235
16266
|
select: (data) => data?.domains || []
|
|
16236
16267
|
}
|
|
16237
16268
|
);
|
|
16238
|
-
(0,
|
|
16269
|
+
(0, import_react47.useEffect)(() => {
|
|
16239
16270
|
if (error) {
|
|
16240
16271
|
import_apsara74.toastManager.add({
|
|
16241
16272
|
title: "Something went wrong",
|
|
@@ -16268,8 +16299,8 @@ var OrganizationSecurity = () => {
|
|
|
16268
16299
|
// admin/views/organizations/details/members/index.tsx
|
|
16269
16300
|
var import_apsara81 = require("@raystack/apsara");
|
|
16270
16301
|
|
|
16271
|
-
// esbuild-css-modules-plugin-namespace:/tmp/tmp-
|
|
16272
|
-
var digest62 = "
|
|
16302
|
+
// esbuild-css-modules-plugin-namespace:/tmp/tmp-2174-VxTmjE0yI9E1/sdk/admin/views/organizations/details/members/members.module.css.js
|
|
16303
|
+
var digest62 = "6d7a5fafb7918b780345e681954280485cb13f278a1d2a0569657659b3da517f";
|
|
16273
16304
|
var css62 = `._container_1865w_1 {
|
|
16274
16305
|
width: 100%;
|
|
16275
16306
|
}
|
|
@@ -16387,13 +16418,13 @@ var css62 = `._container_1865w_1 {
|
|
|
16387
16418
|
var members_module_css_default = { "container": "_container_1865w_1", "name-column": "_name-column_1865w_5", "nameColumn": "_name-column_1865w_5", "empty-state": "_empty-state_1865w_9", "emptyState": "_empty-state_1865w_9", "empty-state-subheading": "_empty-state-subheading_1865w_13", "emptyStateSubheading": "_empty-state-subheading_1865w_13", "zero-state-container": "_zero-state-container_1865w_18", "zeroStateContainer": "_zero-state-container_1865w_18", "table": "_table_1865w_22", "table-wrapper": "_table-wrapper_1865w_27", "tableWrapper": "_table-wrapper_1865w_27", "table-header": "_table-header_1865w_33", "tableHeader": "_table-header_1865w_33", "table-action-column": "_table-action-column_1865w_38", "tableActionColumn": "_table-action-column_1865w_38", "toolbar": "_toolbar_1865w_43", "invites-dialog-content": "_invites-dialog-content_1865w_52", "invitesDialogContent": "_invites-dialog-content_1865w_52", "invites-dialog-body": "_invites-dialog-body_1865w_59", "invitesDialogBody": "_invites-dialog-body_1865w_59", "invites-table-wrapper": "_invites-table-wrapper_1865w_67", "invitesTableWrapper": "_invites-table-wrapper_1865w_67", "invites-table-scroll": "_invites-table-scroll_1865w_73", "invitesTableScroll": "_invites-table-scroll_1865w_73", "invites-action-column": "_invites-action-column_1865w_79", "invitesActionColumn": "_invites-action-column_1865w_79", "invites-remove-item": "_invites-remove-item_1865w_84", "invitesRemoveItem": "_invites-remove-item_1865w_84", "invites-email-column": "_invites-email-column_1865w_90", "invitesEmailColumn": "_invites-email-column_1865w_90" };
|
|
16388
16419
|
|
|
16389
16420
|
// admin/views/organizations/details/members/index.tsx
|
|
16390
|
-
var
|
|
16421
|
+
var import_react49 = require("react");
|
|
16391
16422
|
|
|
16392
16423
|
// admin/views/organizations/details/members/columns.tsx
|
|
16393
16424
|
var import_apsara75 = require("@raystack/apsara");
|
|
16394
16425
|
|
|
16395
|
-
// esbuild-css-modules-plugin-namespace:/tmp/tmp-
|
|
16396
|
-
var digest63 = "
|
|
16426
|
+
// esbuild-css-modules-plugin-namespace:/tmp/tmp-2174-I7dWBJrk17zO/sdk/admin/views/organizations/details/members/members.module.css.js
|
|
16427
|
+
var digest63 = "f27587e0cc6241bdb08ea45ceb2e4b1b8cd1e19aa663e606b9bf1c1b0189ce82";
|
|
16397
16428
|
var css63 = `._container_1865w_1 {
|
|
16398
16429
|
width: 100%;
|
|
16399
16430
|
}
|
|
@@ -16694,11 +16725,11 @@ var import_connect_query38 = require("@connectrpc/connect-query");
|
|
|
16694
16725
|
var import_react_query16 = require("@tanstack/react-query");
|
|
16695
16726
|
|
|
16696
16727
|
// admin/views/organizations/details/members/update-role.tsx
|
|
16697
|
-
var
|
|
16698
|
-
var
|
|
16699
|
-
var
|
|
16728
|
+
var import_frontier40 = require("@raystack/proton/frontier");
|
|
16729
|
+
var import_protobuf23 = require("@bufbuild/protobuf");
|
|
16730
|
+
var import_connect_query35 = require("@connectrpc/connect-query");
|
|
16700
16731
|
var import_apsara76 = require("@raystack/apsara");
|
|
16701
|
-
var
|
|
16732
|
+
var import_connect5 = require("@connectrpc/connect");
|
|
16702
16733
|
var import_jsx_runtime86 = require("react/jsx-runtime");
|
|
16703
16734
|
var UpdateRole = ({
|
|
16704
16735
|
handle,
|
|
@@ -16724,13 +16755,13 @@ function UpdateRoleContent({
|
|
|
16724
16755
|
onClose,
|
|
16725
16756
|
onRoleUpdate
|
|
16726
16757
|
}) {
|
|
16727
|
-
const { mutateAsync: setMemberRole, isPending } = (0,
|
|
16728
|
-
|
|
16758
|
+
const { mutateAsync: setMemberRole, isPending } = (0, import_connect_query35.useMutation)(
|
|
16759
|
+
import_frontier40.FrontierServiceQueries.setOrganizationMemberRole
|
|
16729
16760
|
);
|
|
16730
16761
|
async function onSubmit() {
|
|
16731
16762
|
try {
|
|
16732
16763
|
await setMemberRole(
|
|
16733
|
-
(0,
|
|
16764
|
+
(0, import_protobuf23.create)(import_frontier40.SetOrganizationMemberRoleRequestSchema, {
|
|
16734
16765
|
orgId: organizationId,
|
|
16735
16766
|
userId: payload.user.id,
|
|
16736
16767
|
roleId: payload.role.id
|
|
@@ -16745,7 +16776,7 @@ function UpdateRoleContent({
|
|
|
16745
16776
|
} catch (error) {
|
|
16746
16777
|
import_apsara76.toastManager.add({
|
|
16747
16778
|
title: "Failed to assign role",
|
|
16748
|
-
description: error instanceof
|
|
16779
|
+
description: error instanceof import_connect5.ConnectError ? error.message : void 0,
|
|
16749
16780
|
type: "error"
|
|
16750
16781
|
});
|
|
16751
16782
|
console.error(error);
|
|
@@ -16783,9 +16814,9 @@ function UpdateRoleContent({
|
|
|
16783
16814
|
}
|
|
16784
16815
|
|
|
16785
16816
|
// admin/views/organizations/details/members/remove-member.tsx
|
|
16786
|
-
var
|
|
16787
|
-
var
|
|
16788
|
-
var
|
|
16817
|
+
var import_frontier41 = require("@raystack/proton/frontier");
|
|
16818
|
+
var import_protobuf24 = require("@bufbuild/protobuf");
|
|
16819
|
+
var import_connect_query36 = require("@connectrpc/connect-query");
|
|
16789
16820
|
var import_apsara77 = require("@raystack/apsara");
|
|
16790
16821
|
var import_jsx_runtime87 = require("react/jsx-runtime");
|
|
16791
16822
|
var RemoveMember = ({
|
|
@@ -16795,15 +16826,15 @@ var RemoveMember = ({
|
|
|
16795
16826
|
onClose
|
|
16796
16827
|
}) => {
|
|
16797
16828
|
const t = useTerminology();
|
|
16798
|
-
const { mutateAsync: removeOrganizationMember, isPending } = (0,
|
|
16799
|
-
|
|
16829
|
+
const { mutateAsync: removeOrganizationMember, isPending } = (0, import_connect_query36.useMutation)(
|
|
16830
|
+
import_frontier41.FrontierServiceQueries.removeOrganizationMember
|
|
16800
16831
|
);
|
|
16801
16832
|
async function onSubmit() {
|
|
16802
16833
|
try {
|
|
16803
16834
|
if (!user)
|
|
16804
16835
|
return;
|
|
16805
16836
|
await removeOrganizationMember(
|
|
16806
|
-
(0,
|
|
16837
|
+
(0, import_protobuf24.create)(import_frontier41.RemoveOrganizationMemberRequestSchema, {
|
|
16807
16838
|
orgId: organizationId,
|
|
16808
16839
|
principalId: user?.id || "",
|
|
16809
16840
|
principalType: "app/user"
|
|
@@ -16880,33 +16911,15 @@ var RemoveMember = ({
|
|
|
16880
16911
|
] }) });
|
|
16881
16912
|
};
|
|
16882
16913
|
|
|
16883
|
-
// hooks/index.ts
|
|
16884
|
-
var import_connect_query36 = require("@connectrpc/connect-query");
|
|
16885
|
-
var import_connect5 = require("@connectrpc/connect");
|
|
16886
|
-
var import_frontier41 = require("@raystack/proton/frontier");
|
|
16887
|
-
var import_react_query14 = require("@tanstack/react-query");
|
|
16888
|
-
var import_protobuf24 = require("@bufbuild/protobuf");
|
|
16889
|
-
|
|
16890
|
-
// hooks/useDebouncedValue.ts
|
|
16891
|
-
var import_react46 = require("react");
|
|
16892
|
-
function useDebouncedValue(value, delay) {
|
|
16893
|
-
const [debouncedValue, setDebouncedValue] = (0, import_react46.useState)(value);
|
|
16894
|
-
(0, import_react46.useEffect)(() => {
|
|
16895
|
-
const timer = setTimeout(() => setDebouncedValue(value), delay);
|
|
16896
|
-
return () => clearTimeout(timer);
|
|
16897
|
-
}, [value, delay]);
|
|
16898
|
-
return debouncedValue;
|
|
16899
|
-
}
|
|
16900
|
-
|
|
16901
16914
|
// admin/views/organizations/details/members/invited-members-dialog.tsx
|
|
16902
|
-
var
|
|
16915
|
+
var import_react48 = require("react");
|
|
16903
16916
|
var import_apsara80 = require("@raystack/apsara");
|
|
16904
16917
|
|
|
16905
16918
|
// admin/views/organizations/details/members/invited-members-columns.tsx
|
|
16906
16919
|
var import_apsara78 = require("@raystack/apsara");
|
|
16907
16920
|
|
|
16908
|
-
// esbuild-css-modules-plugin-namespace:/tmp/tmp-
|
|
16909
|
-
var digest64 = "
|
|
16921
|
+
// esbuild-css-modules-plugin-namespace:/tmp/tmp-2174-2ed1WRP1p7hG/sdk/admin/views/organizations/details/members/members.module.css.js
|
|
16922
|
+
var digest64 = "e713ff75fbd0a20d0b0c648a73bf32087a1400a6c78caeb52fb15db814c8499e";
|
|
16910
16923
|
var css64 = `._container_1865w_1 {
|
|
16911
16924
|
width: 100%;
|
|
16912
16925
|
}
|
|
@@ -17228,8 +17241,8 @@ function RemoveInviteContent({
|
|
|
17228
17241
|
] });
|
|
17229
17242
|
}
|
|
17230
17243
|
|
|
17231
|
-
// esbuild-css-modules-plugin-namespace:/tmp/tmp-
|
|
17232
|
-
var digest65 = "
|
|
17244
|
+
// esbuild-css-modules-plugin-namespace:/tmp/tmp-2174-5aGLoopMaOyW/sdk/admin/views/organizations/details/members/members.module.css.js
|
|
17245
|
+
var digest65 = "0bba7b8458990ec76ddebfd5d0c5fa5940c4d2e9e74c4a9a0f94be25f9a5a19e";
|
|
17233
17246
|
var css65 = `._container_1865w_1 {
|
|
17234
17247
|
width: 100%;
|
|
17235
17248
|
}
|
|
@@ -17369,9 +17382,9 @@ var InvitedMembersDialog = ({
|
|
|
17369
17382
|
onClose
|
|
17370
17383
|
}) => {
|
|
17371
17384
|
const t = useTerminology();
|
|
17372
|
-
const [isInviteDialogOpen, setIsInviteDialogOpen] = (0,
|
|
17385
|
+
const [isInviteDialogOpen, setIsInviteDialogOpen] = (0, import_react48.useState)(false);
|
|
17373
17386
|
const { titleById } = useOrganizationRoles(organizationId);
|
|
17374
|
-
const columns = (0,
|
|
17387
|
+
const columns = (0, import_react48.useMemo)(
|
|
17375
17388
|
() => getInvitedMembersColumns({
|
|
17376
17389
|
roleTitleById: titleById,
|
|
17377
17390
|
removeInviteHandle
|
|
@@ -17456,10 +17469,6 @@ var import_jsx_runtime91 = require("react/jsx-runtime");
|
|
|
17456
17469
|
var updateRoleDialogHandle = import_apsara81.AlertDialog.createHandle();
|
|
17457
17470
|
var NO_INVITATIONS = [];
|
|
17458
17471
|
var DEFAULT_SORT6 = { name: "orgJoinedAt", order: "desc" };
|
|
17459
|
-
var INITIAL_QUERY5 = {
|
|
17460
|
-
offset: 0,
|
|
17461
|
-
limit: DEFAULT_PAGE_SIZE
|
|
17462
|
-
};
|
|
17463
17472
|
var TRANSFORM_OPTIONS2 = {
|
|
17464
17473
|
fieldNameMapping: {
|
|
17465
17474
|
orgJoinedAt: "org_joined_at",
|
|
@@ -17512,7 +17521,7 @@ var ErrorState = () => {
|
|
|
17512
17521
|
};
|
|
17513
17522
|
function OrganizationMembersView() {
|
|
17514
17523
|
const t = useTerminology();
|
|
17515
|
-
const { roles = [], organization, search } = (0,
|
|
17524
|
+
const { roles = [], organization, search } = (0, import_react49.useContext)(OrganizationContext);
|
|
17516
17525
|
const {
|
|
17517
17526
|
onChange: onSearchChange,
|
|
17518
17527
|
setVisibility: setSearchVisibility,
|
|
@@ -17521,8 +17530,8 @@ function OrganizationMembersView() {
|
|
|
17521
17530
|
const queryClient = (0, import_react_query16.useQueryClient)();
|
|
17522
17531
|
const transport = (0, import_connect_query38.useTransport)();
|
|
17523
17532
|
const organizationId = organization?.id || "";
|
|
17524
|
-
const [removeMemberConfig, setRemoveMemberConfig] = (0,
|
|
17525
|
-
const [isInvitesDialogOpen, setIsInvitesDialogOpen] = (0,
|
|
17533
|
+
const [removeMemberConfig, setRemoveMemberConfig] = (0, import_react49.useState)({ isOpen: false, user: null });
|
|
17534
|
+
const [isInvitesDialogOpen, setIsInvitesDialogOpen] = (0, import_react49.useState)(false);
|
|
17526
17535
|
const {
|
|
17527
17536
|
data: invitations = NO_INVITATIONS,
|
|
17528
17537
|
isLoading: isInvitationsLoading,
|
|
@@ -17538,15 +17547,15 @@ function OrganizationMembersView() {
|
|
|
17538
17547
|
}
|
|
17539
17548
|
);
|
|
17540
17549
|
const title = `${t.member({ plural: true, case: "capital" })} | ${organization?.title} | ${t.organization({ plural: true, case: "capital" })}`;
|
|
17541
|
-
const
|
|
17542
|
-
|
|
17543
|
-
|
|
17544
|
-
|
|
17545
|
-
|
|
17546
|
-
|
|
17547
|
-
|
|
17548
|
-
|
|
17549
|
-
|
|
17550
|
+
const {
|
|
17551
|
+
tableQuery,
|
|
17552
|
+
rqlQuery: query,
|
|
17553
|
+
onTableQueryChange
|
|
17554
|
+
} = useServerTableQuery({
|
|
17555
|
+
defaultSort: DEFAULT_SORT6,
|
|
17556
|
+
transformOptions: TRANSFORM_OPTIONS2,
|
|
17557
|
+
search: searchQuery || ""
|
|
17558
|
+
});
|
|
17550
17559
|
const {
|
|
17551
17560
|
data: infiniteData,
|
|
17552
17561
|
isLoading,
|
|
@@ -17576,15 +17585,14 @@ function OrganizationMembersView() {
|
|
|
17576
17585
|
const showZeroState = !isLoading && !isError && !hasActiveQuery && data.length === 0;
|
|
17577
17586
|
const showToolbar = data.length > 0 || Boolean(tableQuery.filters?.length);
|
|
17578
17587
|
const showInvitesBtn = invitations.length > 0;
|
|
17579
|
-
const
|
|
17580
|
-
|
|
17581
|
-
|
|
17582
|
-
|
|
17583
|
-
|
|
17584
|
-
|
|
17585
|
-
|
|
17586
|
-
|
|
17587
|
-
(0, import_react48.useEffect)(() => {
|
|
17588
|
+
const fetchMore = useLoadMore({
|
|
17589
|
+
hasNextPage,
|
|
17590
|
+
isFetchingNextPage,
|
|
17591
|
+
isError,
|
|
17592
|
+
fetchNextPage,
|
|
17593
|
+
label: "members"
|
|
17594
|
+
});
|
|
17595
|
+
(0, import_react49.useEffect)(() => {
|
|
17588
17596
|
if (invitationsError) {
|
|
17589
17597
|
console.error(
|
|
17590
17598
|
"Failed to fetch organization invitations:",
|
|
@@ -17592,7 +17600,7 @@ function OrganizationMembersView() {
|
|
|
17592
17600
|
);
|
|
17593
17601
|
}
|
|
17594
17602
|
}, [invitationsError]);
|
|
17595
|
-
(0,
|
|
17603
|
+
(0, import_react49.useEffect)(() => {
|
|
17596
17604
|
setSearchVisibility(true);
|
|
17597
17605
|
return () => {
|
|
17598
17606
|
onSearchChange("");
|
|
@@ -17612,14 +17620,26 @@ function OrganizationMembersView() {
|
|
|
17612
17620
|
handleRemoveMemberAction: openRemoveMemberDialog
|
|
17613
17621
|
});
|
|
17614
17622
|
async function invalidateMembersQuery() {
|
|
17615
|
-
|
|
17616
|
-
|
|
17617
|
-
|
|
17618
|
-
|
|
17619
|
-
|
|
17620
|
-
|
|
17623
|
+
if (!organizationId)
|
|
17624
|
+
return;
|
|
17625
|
+
await Promise.all([
|
|
17626
|
+
queryClient.invalidateQueries({
|
|
17627
|
+
queryKey: (0, import_connect_query38.createConnectQueryKey)({
|
|
17628
|
+
schema: import_frontier43.AdminServiceQueries.searchOrganizationUsers,
|
|
17629
|
+
transport,
|
|
17630
|
+
input: { id: organizationId },
|
|
17631
|
+
cardinality: "infinite"
|
|
17632
|
+
})
|
|
17633
|
+
}),
|
|
17634
|
+
queryClient.invalidateQueries({
|
|
17635
|
+
queryKey: (0, import_connect_query38.createConnectQueryKey)({
|
|
17636
|
+
schema: import_frontier43.FrontierServiceQueries.listOrganizationUsers,
|
|
17637
|
+
transport,
|
|
17638
|
+
input: { id: organizationId },
|
|
17639
|
+
cardinality: "finite"
|
|
17640
|
+
})
|
|
17621
17641
|
})
|
|
17622
|
-
|
|
17642
|
+
]);
|
|
17623
17643
|
}
|
|
17624
17644
|
async function updateMember() {
|
|
17625
17645
|
await invalidateMembersQuery();
|
|
@@ -17716,8 +17736,8 @@ function OrganizationMembersView() {
|
|
|
17716
17736
|
// admin/views/organizations/details/projects/index.tsx
|
|
17717
17737
|
var import_apsara90 = require("@raystack/apsara");
|
|
17718
17738
|
|
|
17719
|
-
// esbuild-css-modules-plugin-namespace:/tmp/tmp-
|
|
17720
|
-
var digest66 = "
|
|
17739
|
+
// esbuild-css-modules-plugin-namespace:/tmp/tmp-2174-BHjz4ippYAZ3/sdk/admin/views/organizations/details/projects/projects.module.css.js
|
|
17740
|
+
var digest66 = "8b8fe00e91528c5c223bb5212194bffcb4001db7fa3e2280b4e3278211506255";
|
|
17721
17741
|
var css66 = `._container_1ky10_1 {
|
|
17722
17742
|
width: 100%;
|
|
17723
17743
|
}
|
|
@@ -17793,13 +17813,13 @@ var css66 = `._container_1ky10_1 {
|
|
|
17793
17813
|
var projects_module_css_default = { "container": "_container_1ky10_1", "title-column": "_title-column_1ky10_5", "titleColumn": "_title-column_1ky10_5", "empty-state": "_empty-state_1ky10_9", "emptyState": "_empty-state_1ky10_9", "empty-state-subheading": "_empty-state-subheading_1ky10_13", "emptyStateSubheading": "_empty-state-subheading_1ky10_13", "zero-state-container": "_zero-state-container_1ky10_18", "zeroStateContainer": "_zero-state-container_1ky10_18", "table": "_table_1ky10_22", "table-wrapper": "_table-wrapper_1ky10_27", "tableWrapper": "_table-wrapper_1ky10_27", "table-header": "_table-header_1ky10_33", "tableHeader": "_table-header_1ky10_33", "table-action-column": "_table-action-column_1ky10_38", "tableActionColumn": "_table-action-column_1ky10_38", "flex1": "_flex1_1ky10_58" };
|
|
17794
17814
|
|
|
17795
17815
|
// admin/views/organizations/details/projects/index.tsx
|
|
17796
|
-
var
|
|
17816
|
+
var import_react54 = require("react");
|
|
17797
17817
|
|
|
17798
17818
|
// admin/views/organizations/details/projects/columns.tsx
|
|
17799
17819
|
var import_apsara84 = require("@raystack/apsara");
|
|
17800
17820
|
|
|
17801
|
-
// esbuild-css-modules-plugin-namespace:/tmp/tmp-
|
|
17802
|
-
var digest67 = "
|
|
17821
|
+
// esbuild-css-modules-plugin-namespace:/tmp/tmp-2174-hq5kcZOXAt14/sdk/admin/views/organizations/details/projects/projects.module.css.js
|
|
17822
|
+
var digest67 = "cdfb780c1f2e2a602e18926bb02100a7059952640a242cc0f025c19fc4e9d372";
|
|
17803
17823
|
var css67 = `._container_1ky10_1 {
|
|
17804
17824
|
width: 100%;
|
|
17805
17825
|
}
|
|
@@ -18003,28 +18023,51 @@ function RenameProjectDialog({
|
|
|
18003
18023
|
}
|
|
18004
18024
|
|
|
18005
18025
|
// admin/views/organizations/details/projects/columns.tsx
|
|
18006
|
-
var
|
|
18026
|
+
var import_react51 = require("react");
|
|
18007
18027
|
|
|
18008
18028
|
// admin/views/organizations/details/projects/use-add-project-members.tsx
|
|
18009
|
-
var
|
|
18029
|
+
var import_react50 = require("react");
|
|
18010
18030
|
var import_apsara83 = require("@raystack/apsara");
|
|
18031
|
+
var import_connect_query41 = require("@connectrpc/connect-query");
|
|
18032
|
+
var import_frontier46 = require("@raystack/proton/frontier");
|
|
18033
|
+
var import_protobuf28 = require("@bufbuild/protobuf");
|
|
18034
|
+
|
|
18035
|
+
// admin/hooks/useOrgMembersMap.ts
|
|
18011
18036
|
var import_connect_query40 = require("@connectrpc/connect-query");
|
|
18012
18037
|
var import_frontier45 = require("@raystack/proton/frontier");
|
|
18013
|
-
var
|
|
18038
|
+
var toMembersMap = (data) => (data?.users || []).reduce(
|
|
18039
|
+
(acc, user) => {
|
|
18040
|
+
acc[user.id || ""] = user;
|
|
18041
|
+
return acc;
|
|
18042
|
+
},
|
|
18043
|
+
{}
|
|
18044
|
+
);
|
|
18045
|
+
var useOrgMembersMap = (orgId) => (0, import_connect_query40.useQuery)(
|
|
18046
|
+
import_frontier45.FrontierServiceQueries.listOrganizationUsers,
|
|
18047
|
+
{ id: orgId || "" },
|
|
18048
|
+
{
|
|
18049
|
+
enabled: !!orgId,
|
|
18050
|
+
staleTime: SHARED_QUERY_STALE_TIME,
|
|
18051
|
+
select: toMembersMap
|
|
18052
|
+
}
|
|
18053
|
+
);
|
|
18054
|
+
|
|
18055
|
+
// admin/views/organizations/details/projects/use-add-project-members.tsx
|
|
18014
18056
|
function useAddProjectMembers({ projectId }) {
|
|
18015
18057
|
const t = useTerminology();
|
|
18016
18058
|
const memberLabel = t.member({ case: "capital" });
|
|
18017
|
-
const {
|
|
18018
|
-
const
|
|
18019
|
-
const
|
|
18020
|
-
|
|
18021
|
-
|
|
18059
|
+
const { organization } = (0, import_react50.useContext)(OrganizationContext);
|
|
18060
|
+
const { data: orgMembersMap = {} } = useOrgMembersMap(organization?.id);
|
|
18061
|
+
const [searchQuery, setSearchQuery] = (0, import_react50.useState)("");
|
|
18062
|
+
const { data: projectMembers, isLoading, refetch } = (0, import_connect_query41.useQuery)(
|
|
18063
|
+
import_frontier46.FrontierServiceQueries.listProjectUsers,
|
|
18064
|
+
(0, import_protobuf28.create)(import_frontier46.ListProjectUsersRequestSchema, { id: projectId }),
|
|
18022
18065
|
{
|
|
18023
18066
|
enabled: !!projectId,
|
|
18024
18067
|
select: (data) => data?.users || []
|
|
18025
18068
|
}
|
|
18026
18069
|
);
|
|
18027
|
-
const nonMembers = (0,
|
|
18070
|
+
const nonMembers = (0, import_react50.useMemo)(() => {
|
|
18028
18071
|
if (!projectMembers)
|
|
18029
18072
|
return [];
|
|
18030
18073
|
const memberSet = new Set(projectMembers.map((member) => member.id));
|
|
@@ -18034,34 +18077,34 @@ function useAddProjectMembers({ projectId }) {
|
|
|
18034
18077
|
return aName < bName ? -1 : 1;
|
|
18035
18078
|
});
|
|
18036
18079
|
}, [projectMembers, orgMembersMap]);
|
|
18037
|
-
const eligibleMembers = (0,
|
|
18080
|
+
const eligibleMembers = (0, import_react50.useMemo)(() => {
|
|
18038
18081
|
return searchQuery ? nonMembers.filter((member) => {
|
|
18039
18082
|
const name = member.title || member.email || "";
|
|
18040
18083
|
return name.toLowerCase().includes(searchQuery.toLowerCase());
|
|
18041
18084
|
}) : nonMembers;
|
|
18042
18085
|
}, [nonMembers, searchQuery]);
|
|
18043
|
-
const { data: rolesData } = (0,
|
|
18044
|
-
|
|
18045
|
-
(0, import_protobuf28.create)(
|
|
18086
|
+
const { data: rolesData } = (0, import_connect_query41.useQuery)(
|
|
18087
|
+
import_frontier46.FrontierServiceQueries.listRoles,
|
|
18088
|
+
(0, import_protobuf28.create)(import_frontier46.ListRolesRequestSchema, {
|
|
18046
18089
|
state: "enabled",
|
|
18047
18090
|
scopes: [SCOPES.PROJECT]
|
|
18048
18091
|
}),
|
|
18049
18092
|
{ enabled: !!projectId }
|
|
18050
18093
|
);
|
|
18051
|
-
const viewerRoleId = (0,
|
|
18094
|
+
const viewerRoleId = (0, import_react50.useMemo)(
|
|
18052
18095
|
() => rolesData?.roles?.find((r) => r.name === DEFAULT_ROLES.PROJECT_VIEWER)?.id ?? "",
|
|
18053
18096
|
[rolesData]
|
|
18054
18097
|
);
|
|
18055
|
-
const { mutateAsync: setProjectMemberRole } = (0,
|
|
18056
|
-
|
|
18098
|
+
const { mutateAsync: setProjectMemberRole } = (0, import_connect_query41.useMutation)(
|
|
18099
|
+
import_frontier46.FrontierServiceQueries.setProjectMemberRole
|
|
18057
18100
|
);
|
|
18058
|
-
const addMember = (0,
|
|
18101
|
+
const addMember = (0, import_react50.useCallback)(
|
|
18059
18102
|
async (userId) => {
|
|
18060
18103
|
if (!userId || !projectId || !viewerRoleId)
|
|
18061
18104
|
return;
|
|
18062
18105
|
try {
|
|
18063
18106
|
await setProjectMemberRole(
|
|
18064
|
-
(0, import_protobuf28.create)(
|
|
18107
|
+
(0, import_protobuf28.create)(import_frontier46.SetProjectMemberRoleRequestSchema, {
|
|
18065
18108
|
projectId,
|
|
18066
18109
|
principalId: userId,
|
|
18067
18110
|
principalType: SCOPES.USER,
|
|
@@ -18194,8 +18237,8 @@ function ProjectActions({
|
|
|
18194
18237
|
handleProjectUpdate,
|
|
18195
18238
|
canAddMember
|
|
18196
18239
|
}) {
|
|
18197
|
-
const [open, setOpen] = (0,
|
|
18198
|
-
const [isRenameDialogOpen, setIsRenameDialogOpen] = (0,
|
|
18240
|
+
const [open, setOpen] = (0, import_react51.useState)(false);
|
|
18241
|
+
const [isRenameDialogOpen, setIsRenameDialogOpen] = (0, import_react51.useState)(false);
|
|
18199
18242
|
const preventClickBubbling = (e) => {
|
|
18200
18243
|
e.stopPropagation();
|
|
18201
18244
|
};
|
|
@@ -18326,8 +18369,8 @@ var getColumns13 = ({
|
|
|
18326
18369
|
};
|
|
18327
18370
|
|
|
18328
18371
|
// admin/views/organizations/details/projects/index.tsx
|
|
18329
|
-
var
|
|
18330
|
-
var
|
|
18372
|
+
var import_frontier50 = require("@raystack/proton/frontier");
|
|
18373
|
+
var import_connect_query45 = require("@connectrpc/connect-query");
|
|
18331
18374
|
|
|
18332
18375
|
// admin/assets/icons/ProjectsIcon.tsx
|
|
18333
18376
|
var import_jsx_runtime94 = require("react/jsx-runtime");
|
|
@@ -18365,14 +18408,13 @@ function ProjectsIcon(props) {
|
|
|
18365
18408
|
|
|
18366
18409
|
// admin/views/organizations/details/projects/members/index.tsx
|
|
18367
18410
|
var import_apsara89 = require("@raystack/apsara");
|
|
18368
|
-
var
|
|
18369
|
-
var
|
|
18411
|
+
var import_react53 = require("react");
|
|
18412
|
+
var import_frontier49 = require("@raystack/proton/frontier");
|
|
18370
18413
|
var import_protobuf31 = require("@bufbuild/protobuf");
|
|
18371
|
-
var
|
|
18372
|
-
var import_hooks5 = require("@raystack/apsara/hooks");
|
|
18414
|
+
var import_connect_query44 = require("@connectrpc/connect-query");
|
|
18373
18415
|
|
|
18374
|
-
// esbuild-css-modules-plugin-namespace:/tmp/tmp-
|
|
18375
|
-
var digest68 = "
|
|
18416
|
+
// esbuild-css-modules-plugin-namespace:/tmp/tmp-2174-H81N0dVojTOW/sdk/admin/views/organizations/details/projects/members/members.module.css.js
|
|
18417
|
+
var digest68 = "0428d15f4746a169ee95b986b7e60e8754d59ab636a24864f0745dee323e323e";
|
|
18376
18418
|
var css68 = `._flex1_c0wok_1 {
|
|
18377
18419
|
flex: 1;
|
|
18378
18420
|
}
|
|
@@ -18480,8 +18522,8 @@ var css68 = `._flex1_c0wok_1 {
|
|
|
18480
18522
|
})();
|
|
18481
18523
|
var members_module_css_default5 = { "flex1": "_flex1_c0wok_1", "dialog-content": "_dialog-content_c0wok_5", "dialogContent": "_dialog-content_c0wok_5", "dialog-body": "_dialog-body_c0wok_10", "dialogBody": "_dialog-body_c0wok_10", "empty-state": "_empty-state_c0wok_14", "emptyState": "_empty-state_c0wok_14", "empty-state-subheading": "_empty-state-subheading_c0wok_18", "emptyStateSubheading": "_empty-state-subheading_c0wok_18", "table": "_table_c0wok_23", "table-wrapper": "_table-wrapper_c0wok_28", "tableWrapper": "_table-wrapper_c0wok_28", "table-header": "_table-header_c0wok_34", "tableHeader": "_table-header_c0wok_34", "table-search": "_table-search_c0wok_39", "tableSearch": "_table-search_c0wok_39", "table-content-wrapper": "_table-content-wrapper_c0wok_43", "tableContentWrapper": "_table-content-wrapper_c0wok_43", "table-action-column": "_table-action-column_c0wok_52", "tableActionColumn": "_table-action-column_c0wok_52", "table-action-dropdown": "_table-action-dropdown_c0wok_71", "tableActionDropdown": "_table-action-dropdown_c0wok_71", "action-dialog-content": "_action-dialog-content_c0wok_76", "actionDialogContent": "_action-dialog-content_c0wok_76", "add-member-dropdown": "_add-member-dropdown_c0wok_80", "addMemberDropdown": "_add-member-dropdown_c0wok_80", "add-member-dropdown-member": "_add-member-dropdown-member_c0wok_85", "addMemberDropdownMember": "_add-member-dropdown-member_c0wok_85", "add-member-dropdown-member-name": "_add-member-dropdown-member-name_c0wok_89", "addMemberDropdownMemberName": "_add-member-dropdown-member-name_c0wok_89" };
|
|
18482
18524
|
|
|
18483
|
-
// esbuild-css-modules-plugin-namespace:/tmp/tmp-
|
|
18484
|
-
var digest69 = "
|
|
18525
|
+
// esbuild-css-modules-plugin-namespace:/tmp/tmp-2174-jB61js6AecAi/sdk/admin/views/organizations/details/projects/members/members.module.css.js
|
|
18526
|
+
var digest69 = "0d6c9c434bcc80384378544482ac3386ebcd7c4c4ddf7ed9b0395c05bd150ce2";
|
|
18485
18527
|
var css69 = `._flex1_c0wok_1 {
|
|
18486
18528
|
flex: 1;
|
|
18487
18529
|
}
|
|
@@ -18723,8 +18765,8 @@ var getColumns14 = ({
|
|
|
18723
18765
|
];
|
|
18724
18766
|
};
|
|
18725
18767
|
|
|
18726
|
-
// esbuild-css-modules-plugin-namespace:/tmp/tmp-
|
|
18727
|
-
var digest70 = "
|
|
18768
|
+
// esbuild-css-modules-plugin-namespace:/tmp/tmp-2174-TLGFj8eyS5Ln/sdk/admin/views/organizations/details/projects/members/members.module.css.js
|
|
18769
|
+
var digest70 = "8b70303f9ef7c7d9d8e30f7f0fcbcc129ff2328b227c373f0ea2726b2453c8b6";
|
|
18728
18770
|
var css70 = `._flex1_c0wok_1 {
|
|
18729
18771
|
flex: 1;
|
|
18730
18772
|
}
|
|
@@ -18833,10 +18875,10 @@ var css70 = `._flex1_c0wok_1 {
|
|
|
18833
18875
|
var members_module_css_default7 = { "flex1": "_flex1_c0wok_1", "dialog-content": "_dialog-content_c0wok_5", "dialogContent": "_dialog-content_c0wok_5", "dialog-body": "_dialog-body_c0wok_10", "dialogBody": "_dialog-body_c0wok_10", "empty-state": "_empty-state_c0wok_14", "emptyState": "_empty-state_c0wok_14", "empty-state-subheading": "_empty-state-subheading_c0wok_18", "emptyStateSubheading": "_empty-state-subheading_c0wok_18", "table": "_table_c0wok_23", "table-wrapper": "_table-wrapper_c0wok_28", "tableWrapper": "_table-wrapper_c0wok_28", "table-header": "_table-header_c0wok_34", "tableHeader": "_table-header_c0wok_34", "table-search": "_table-search_c0wok_39", "tableSearch": "_table-search_c0wok_39", "table-content-wrapper": "_table-content-wrapper_c0wok_43", "tableContentWrapper": "_table-content-wrapper_c0wok_43", "table-action-column": "_table-action-column_c0wok_52", "tableActionColumn": "_table-action-column_c0wok_52", "table-action-dropdown": "_table-action-dropdown_c0wok_71", "tableActionDropdown": "_table-action-dropdown_c0wok_71", "action-dialog-content": "_action-dialog-content_c0wok_76", "actionDialogContent": "_action-dialog-content_c0wok_76", "add-member-dropdown": "_add-member-dropdown_c0wok_80", "addMemberDropdown": "_add-member-dropdown_c0wok_80", "add-member-dropdown-member": "_add-member-dropdown-member_c0wok_85", "addMemberDropdownMember": "_add-member-dropdown-member_c0wok_85", "add-member-dropdown-member-name": "_add-member-dropdown-member-name_c0wok_89", "addMemberDropdownMemberName": "_add-member-dropdown-member-name_c0wok_89" };
|
|
18834
18876
|
|
|
18835
18877
|
// admin/views/organizations/details/projects/members/update-role.tsx
|
|
18836
|
-
var
|
|
18878
|
+
var import_frontier47 = require("@raystack/proton/frontier");
|
|
18837
18879
|
var import_protobuf29 = require("@bufbuild/protobuf");
|
|
18838
18880
|
var import_connect6 = require("@connectrpc/connect");
|
|
18839
|
-
var
|
|
18881
|
+
var import_connect_query42 = require("@connectrpc/connect-query");
|
|
18840
18882
|
var import_apsara86 = require("@raystack/apsara");
|
|
18841
18883
|
var import_jsx_runtime96 = require("react/jsx-runtime");
|
|
18842
18884
|
var UpdateRole2 = ({
|
|
@@ -18863,13 +18905,13 @@ function UpdateRoleContent2({
|
|
|
18863
18905
|
onClose,
|
|
18864
18906
|
onRoleUpdate
|
|
18865
18907
|
}) {
|
|
18866
|
-
const { mutateAsync: setProjectMemberRole, isPending } = (0,
|
|
18867
|
-
|
|
18908
|
+
const { mutateAsync: setProjectMemberRole, isPending } = (0, import_connect_query42.useMutation)(
|
|
18909
|
+
import_frontier47.FrontierServiceQueries.setProjectMemberRole
|
|
18868
18910
|
);
|
|
18869
18911
|
async function onSubmit() {
|
|
18870
18912
|
try {
|
|
18871
18913
|
await setProjectMemberRole(
|
|
18872
|
-
(0, import_protobuf29.create)(
|
|
18914
|
+
(0, import_protobuf29.create)(import_frontier47.SetProjectMemberRoleRequestSchema, {
|
|
18873
18915
|
projectId,
|
|
18874
18916
|
principalId: payload.user.id || "",
|
|
18875
18917
|
principalType: SCOPES.USER,
|
|
@@ -18930,13 +18972,13 @@ function UpdateRoleContent2({
|
|
|
18930
18972
|
}
|
|
18931
18973
|
|
|
18932
18974
|
// admin/views/organizations/details/projects/members/remove-member.tsx
|
|
18933
|
-
var
|
|
18934
|
-
var
|
|
18975
|
+
var import_react52 = require("react");
|
|
18976
|
+
var import_frontier48 = require("@raystack/proton/frontier");
|
|
18935
18977
|
var import_protobuf30 = require("@bufbuild/protobuf");
|
|
18936
|
-
var
|
|
18978
|
+
var import_connect_query43 = require("@connectrpc/connect-query");
|
|
18937
18979
|
|
|
18938
|
-
// esbuild-css-modules-plugin-namespace:/tmp/tmp-
|
|
18939
|
-
var digest71 = "
|
|
18980
|
+
// esbuild-css-modules-plugin-namespace:/tmp/tmp-2174-fHLmLMI4LtdJ/sdk/admin/views/organizations/details/projects/members/members.module.css.js
|
|
18981
|
+
var digest71 = "d4bfb3b205e139922cc4bfb9b3b59bbe8813c28ac9b811bdd30c948030105334";
|
|
18940
18982
|
var css71 = `._flex1_c0wok_1 {
|
|
18941
18983
|
flex: 1;
|
|
18942
18984
|
}
|
|
@@ -19054,9 +19096,9 @@ var RemoveMember2 = ({
|
|
|
19054
19096
|
onClose
|
|
19055
19097
|
}) => {
|
|
19056
19098
|
const t = useTerminology();
|
|
19057
|
-
const [isSubmitting, setIsSubmitting] = (0,
|
|
19058
|
-
const { mutateAsync: removeProjectMember } = (0,
|
|
19059
|
-
|
|
19099
|
+
const [isSubmitting, setIsSubmitting] = (0, import_react52.useState)(false);
|
|
19100
|
+
const { mutateAsync: removeProjectMember } = (0, import_connect_query43.useMutation)(
|
|
19101
|
+
import_frontier48.FrontierServiceQueries.removeProjectMember
|
|
19060
19102
|
);
|
|
19061
19103
|
async function onSubmit() {
|
|
19062
19104
|
try {
|
|
@@ -19064,7 +19106,7 @@ var RemoveMember2 = ({
|
|
|
19064
19106
|
return;
|
|
19065
19107
|
setIsSubmitting(true);
|
|
19066
19108
|
await removeProjectMember(
|
|
19067
|
-
(0, import_protobuf30.create)(
|
|
19109
|
+
(0, import_protobuf30.create)(import_frontier48.RemoveProjectMemberRequestSchema, {
|
|
19068
19110
|
projectId,
|
|
19069
19111
|
principalId: user.id,
|
|
19070
19112
|
principalType: "app/user"
|
|
@@ -19154,8 +19196,8 @@ var RemoveMember2 = ({
|
|
|
19154
19196
|
// admin/views/organizations/details/projects/members/add-members-dropdown.tsx
|
|
19155
19197
|
var import_apsara88 = require("@raystack/apsara");
|
|
19156
19198
|
|
|
19157
|
-
// esbuild-css-modules-plugin-namespace:/tmp/tmp-
|
|
19158
|
-
var digest72 = "
|
|
19199
|
+
// esbuild-css-modules-plugin-namespace:/tmp/tmp-2174-xiXpgVRP0VhP/sdk/admin/views/organizations/details/projects/members/members.module.css.js
|
|
19200
|
+
var digest72 = "6cea043109a125c2503aa53bea8170094ca6b1c0331a29e75c37ee71553a3622";
|
|
19159
19201
|
var css72 = `._flex1_c0wok_1 {
|
|
19160
19202
|
flex: 1;
|
|
19161
19203
|
}
|
|
@@ -19345,35 +19387,32 @@ var NoMembers2 = () => {
|
|
|
19345
19387
|
}
|
|
19346
19388
|
);
|
|
19347
19389
|
};
|
|
19348
|
-
var INITIAL_QUERY6 = {
|
|
19349
|
-
offset: 0,
|
|
19350
|
-
limit: DEFAULT_PAGE_SIZE
|
|
19351
|
-
};
|
|
19352
19390
|
var updateRoleDialogHandle2 = import_apsara89.AlertDialog.createHandle();
|
|
19353
19391
|
var ProjectMembersDialog = ({
|
|
19354
19392
|
projectId,
|
|
19355
19393
|
onClose,
|
|
19356
19394
|
canAddMember
|
|
19357
19395
|
}) => {
|
|
19358
|
-
const
|
|
19359
|
-
|
|
19360
|
-
|
|
19361
|
-
|
|
19362
|
-
|
|
19363
|
-
|
|
19364
|
-
|
|
19365
|
-
|
|
19366
|
-
const
|
|
19367
|
-
|
|
19368
|
-
|
|
19396
|
+
const {
|
|
19397
|
+
tableQuery,
|
|
19398
|
+
rqlQuery,
|
|
19399
|
+
onTableQueryChange
|
|
19400
|
+
} = useServerTableQuery({
|
|
19401
|
+
// This endpoint ignores sort, so keep it out of the request.
|
|
19402
|
+
mapQuery: (query) => ({ ...query, sort: void 0 })
|
|
19403
|
+
});
|
|
19404
|
+
const [removeMemberConfig, setRemoveMemberConfig] = (0, import_react53.useState)({ isOpen: false, user: null });
|
|
19405
|
+
const { data: project, isLoading: isProjectLoading, error: projectError } = (0, import_connect_query44.useQuery)(
|
|
19406
|
+
import_frontier49.FrontierServiceQueries.getProject,
|
|
19407
|
+
(0, import_protobuf31.create)(import_frontier49.GetProjectRequestSchema, { id: projectId }),
|
|
19369
19408
|
{
|
|
19370
19409
|
enabled: !!projectId,
|
|
19371
19410
|
select: (data2) => data2?.project
|
|
19372
19411
|
}
|
|
19373
19412
|
);
|
|
19374
|
-
const { data: projectRoles = [], isLoading: isProjectRolesLoading, error: rolesError } = (0,
|
|
19375
|
-
|
|
19376
|
-
(0, import_protobuf31.create)(
|
|
19413
|
+
const { data: projectRoles = [], isLoading: isProjectRolesLoading, error: rolesError } = (0, import_connect_query44.useQuery)(
|
|
19414
|
+
import_frontier49.FrontierServiceQueries.listRoles,
|
|
19415
|
+
(0, import_protobuf31.create)(import_frontier49.ListRolesRequestSchema, { scopes: [PROJECT_NAMESPACE] }),
|
|
19377
19416
|
{
|
|
19378
19417
|
select: (data2) => data2?.roles || []
|
|
19379
19418
|
}
|
|
@@ -19387,18 +19426,19 @@ var ProjectMembersDialog = ({
|
|
|
19387
19426
|
const {
|
|
19388
19427
|
data: infiniteData,
|
|
19389
19428
|
isLoading: isMembersLoading,
|
|
19429
|
+
isError,
|
|
19390
19430
|
isFetchingNextPage,
|
|
19391
19431
|
fetchNextPage,
|
|
19392
19432
|
hasNextPage,
|
|
19393
19433
|
refetch
|
|
19394
|
-
} = (0,
|
|
19395
|
-
|
|
19396
|
-
{ id: projectId, query:
|
|
19434
|
+
} = (0, import_connect_query44.useInfiniteQuery)(
|
|
19435
|
+
import_frontier49.AdminServiceQueries.searchProjectUsers,
|
|
19436
|
+
{ id: projectId, query: rqlQuery },
|
|
19397
19437
|
{
|
|
19398
19438
|
pageParamKey: "query",
|
|
19399
19439
|
getNextPageParam: (lastPage) => getConnectNextPageParam(
|
|
19400
19440
|
lastPage,
|
|
19401
|
-
{ query:
|
|
19441
|
+
{ query: rqlQuery },
|
|
19402
19442
|
"projectUsers"
|
|
19403
19443
|
),
|
|
19404
19444
|
staleTime: 0,
|
|
@@ -19408,45 +19448,26 @@ var ProjectMembersDialog = ({
|
|
|
19408
19448
|
}
|
|
19409
19449
|
);
|
|
19410
19450
|
const data = infiniteData?.pages?.flatMap((page) => page?.projectUsers || []) || [];
|
|
19411
|
-
const
|
|
19412
|
-
|
|
19413
|
-
|
|
19414
|
-
|
|
19415
|
-
|
|
19416
|
-
|
|
19417
|
-
|
|
19418
|
-
};
|
|
19419
|
-
const updatedRQLRequest = transformDataTableQueryToRQLRequest(
|
|
19420
|
-
updatedQuery,
|
|
19421
|
-
{}
|
|
19422
|
-
);
|
|
19423
|
-
setTableQuery({
|
|
19424
|
-
query: updatedQuery,
|
|
19425
|
-
rqlRequest: updatedRQLRequest
|
|
19426
|
-
});
|
|
19427
|
-
}, []);
|
|
19428
|
-
const handleLoadMore = (0, import_react52.useCallback)(async () => {
|
|
19429
|
-
try {
|
|
19430
|
-
if (!hasNextPage)
|
|
19431
|
-
return;
|
|
19432
|
-
await fetchNextPage();
|
|
19433
|
-
} catch (error) {
|
|
19434
|
-
console.error("Error loading more project members:", error);
|
|
19435
|
-
}
|
|
19436
|
-
}, [hasNextPage, fetchNextPage]);
|
|
19451
|
+
const handleLoadMore = useLoadMore({
|
|
19452
|
+
hasNextPage,
|
|
19453
|
+
isFetchingNextPage,
|
|
19454
|
+
isError,
|
|
19455
|
+
fetchNextPage,
|
|
19456
|
+
label: "project members"
|
|
19457
|
+
});
|
|
19437
19458
|
async function refetchMembers() {
|
|
19438
19459
|
await refetch();
|
|
19439
19460
|
}
|
|
19440
|
-
const openRemoveMemberDialog = (0,
|
|
19461
|
+
const openRemoveMemberDialog = (0, import_react53.useCallback)(
|
|
19441
19462
|
(user) => {
|
|
19442
19463
|
setRemoveMemberConfig({ isOpen: true, user });
|
|
19443
19464
|
},
|
|
19444
19465
|
[]
|
|
19445
19466
|
);
|
|
19446
|
-
const closeRemoveMemberDialog = (0,
|
|
19467
|
+
const closeRemoveMemberDialog = (0, import_react53.useCallback)(() => {
|
|
19447
19468
|
setRemoveMemberConfig({ isOpen: false, user: null });
|
|
19448
19469
|
}, []);
|
|
19449
|
-
const columns = (0,
|
|
19470
|
+
const columns = (0, import_react53.useMemo)(
|
|
19450
19471
|
() => getColumns14({
|
|
19451
19472
|
roles: projectRoles,
|
|
19452
19473
|
updateRoleHandle: updateRoleDialogHandle2,
|
|
@@ -19489,12 +19510,11 @@ var ProjectMembersDialog = ({
|
|
|
19489
19510
|
/* @__PURE__ */ (0, import_jsx_runtime99.jsx)(import_apsara89.Dialog.Body, { className: members_module_css_default5["dialog-body"], children: /* @__PURE__ */ (0, import_jsx_runtime99.jsx)(
|
|
19490
19511
|
import_apsara89.DataTable,
|
|
19491
19512
|
{
|
|
19492
|
-
query: tableQuery
|
|
19513
|
+
query: tableQuery,
|
|
19493
19514
|
columns,
|
|
19494
19515
|
data,
|
|
19495
19516
|
isLoading,
|
|
19496
19517
|
mode: "server",
|
|
19497
|
-
defaultSort: { name: "", order: "desc" },
|
|
19498
19518
|
onTableQueryChange,
|
|
19499
19519
|
onLoadMore: handleLoadMore,
|
|
19500
19520
|
children: /* @__PURE__ */ (0, import_jsx_runtime99.jsxs)(
|
|
@@ -19538,10 +19558,6 @@ var ProjectMembersDialog = ({
|
|
|
19538
19558
|
// admin/views/organizations/details/projects/index.tsx
|
|
19539
19559
|
var import_jsx_runtime100 = require("react/jsx-runtime");
|
|
19540
19560
|
var DEFAULT_SORT7 = { name: "createdAt", order: "desc" };
|
|
19541
|
-
var INITIAL_QUERY7 = {
|
|
19542
|
-
offset: 0,
|
|
19543
|
-
limit: DEFAULT_PAGE_SIZE
|
|
19544
|
-
};
|
|
19545
19561
|
var TRANSFORM_OPTIONS3 = {
|
|
19546
19562
|
fieldNameMapping: {
|
|
19547
19563
|
createdAt: "created_at",
|
|
@@ -19593,27 +19609,32 @@ var ErrorState2 = () => {
|
|
|
19593
19609
|
};
|
|
19594
19610
|
function OrganizationProjectsView() {
|
|
19595
19611
|
const t = useTerminology();
|
|
19596
|
-
const { organization, search
|
|
19612
|
+
const { organization, search } = (0, import_react54.useContext)(OrganizationContext);
|
|
19613
|
+
const {
|
|
19614
|
+
data: orgMembersMap = {},
|
|
19615
|
+
isLoading: isOrgMembersMapLoading,
|
|
19616
|
+
error: orgMembersError
|
|
19617
|
+
} = useOrgMembersMap(organization?.id);
|
|
19597
19618
|
const {
|
|
19598
19619
|
onChange: onSearchChange,
|
|
19599
19620
|
setVisibility: setSearchVisibility,
|
|
19600
19621
|
query: searchQuery
|
|
19601
19622
|
} = search;
|
|
19602
19623
|
const organizationId = organization?.id || "";
|
|
19603
|
-
const [memberDialogConfig, setMemberDialogConfig] = (0,
|
|
19624
|
+
const [memberDialogConfig, setMemberDialogConfig] = (0, import_react54.useState)({
|
|
19604
19625
|
open: false,
|
|
19605
19626
|
projectId: ""
|
|
19606
19627
|
});
|
|
19607
|
-
const [tableQuery, setTableQuery] = (0, import_react53.useState)(INITIAL_QUERY7);
|
|
19608
19628
|
const title = `${t.project({ plural: true, case: "capital" })} | ${organization?.title} | ${t.organization({ plural: true, case: "capital" })}`;
|
|
19609
|
-
const
|
|
19610
|
-
|
|
19611
|
-
|
|
19612
|
-
|
|
19613
|
-
|
|
19614
|
-
|
|
19615
|
-
|
|
19616
|
-
|
|
19629
|
+
const {
|
|
19630
|
+
tableQuery,
|
|
19631
|
+
rqlQuery: query,
|
|
19632
|
+
onTableQueryChange
|
|
19633
|
+
} = useServerTableQuery({
|
|
19634
|
+
defaultSort: DEFAULT_SORT7,
|
|
19635
|
+
transformOptions: TRANSFORM_OPTIONS3,
|
|
19636
|
+
search: searchQuery || ""
|
|
19637
|
+
});
|
|
19617
19638
|
const {
|
|
19618
19639
|
data: infiniteData,
|
|
19619
19640
|
isLoading,
|
|
@@ -19622,8 +19643,8 @@ function OrganizationProjectsView() {
|
|
|
19622
19643
|
hasNextPage,
|
|
19623
19644
|
refetch: refetchOrgProjects,
|
|
19624
19645
|
isError
|
|
19625
|
-
} = (0,
|
|
19626
|
-
|
|
19646
|
+
} = (0, import_connect_query45.useInfiniteQuery)(
|
|
19647
|
+
import_frontier50.AdminServiceQueries.searchOrganizationProjects,
|
|
19627
19648
|
{ id: organizationId, query },
|
|
19628
19649
|
{
|
|
19629
19650
|
enabled: !!organizationId,
|
|
@@ -19641,18 +19662,22 @@ function OrganizationProjectsView() {
|
|
|
19641
19662
|
searchQuery?.trim() || tableQuery.filters?.length
|
|
19642
19663
|
);
|
|
19643
19664
|
const showZeroState = !isLoading && !isError && !hasActiveQuery && data.length === 0;
|
|
19644
|
-
const
|
|
19645
|
-
|
|
19646
|
-
|
|
19647
|
-
|
|
19648
|
-
|
|
19649
|
-
|
|
19650
|
-
|
|
19651
|
-
};
|
|
19665
|
+
const fetchMore = useLoadMore({
|
|
19666
|
+
hasNextPage,
|
|
19667
|
+
isFetchingNextPage,
|
|
19668
|
+
isError,
|
|
19669
|
+
fetchNextPage,
|
|
19670
|
+
label: "projects"
|
|
19671
|
+
});
|
|
19652
19672
|
function handleProjectUpdate(project) {
|
|
19653
19673
|
refetchOrgProjects();
|
|
19654
19674
|
}
|
|
19655
|
-
(0,
|
|
19675
|
+
(0, import_react54.useEffect)(() => {
|
|
19676
|
+
if (orgMembersError) {
|
|
19677
|
+
console.error("Failed to fetch organization members:", orgMembersError);
|
|
19678
|
+
}
|
|
19679
|
+
}, [orgMembersError]);
|
|
19680
|
+
(0, import_react54.useEffect)(() => {
|
|
19656
19681
|
setSearchVisibility(true);
|
|
19657
19682
|
return () => {
|
|
19658
19683
|
onSearchChange("");
|
|
@@ -19720,8 +19745,8 @@ function OrganizationProjectsView() {
|
|
|
19720
19745
|
// admin/views/organizations/details/invoices/index.tsx
|
|
19721
19746
|
var import_apsara92 = require("@raystack/apsara");
|
|
19722
19747
|
|
|
19723
|
-
// esbuild-css-modules-plugin-namespace:/tmp/tmp-
|
|
19724
|
-
var digest73 = "
|
|
19748
|
+
// esbuild-css-modules-plugin-namespace:/tmp/tmp-2174-T3mUYeRMWntf/sdk/admin/views/organizations/details/invoices/invoices.module.css.js
|
|
19749
|
+
var digest73 = "99004e83358249d3ffa895e107290042968bc070d13c4a74201e77c495cea14e";
|
|
19725
19750
|
var css73 = `._empty-state_ptbbe_1 {
|
|
19726
19751
|
height: 100%;
|
|
19727
19752
|
}
|
|
@@ -19799,10 +19824,10 @@ function BanknotesIcon(props) {
|
|
|
19799
19824
|
}
|
|
19800
19825
|
|
|
19801
19826
|
// admin/views/organizations/details/invoices/index.tsx
|
|
19802
|
-
var
|
|
19827
|
+
var import_react55 = require("react");
|
|
19803
19828
|
|
|
19804
|
-
// esbuild-css-modules-plugin-namespace:/tmp/tmp-
|
|
19805
|
-
var digest74 = "
|
|
19829
|
+
// esbuild-css-modules-plugin-namespace:/tmp/tmp-2174-NsmJDn8MJpSG/sdk/admin/views/organizations/details/invoices/invoices.module.css.js
|
|
19830
|
+
var digest74 = "946a124be1eed62644099862d0b33c43c498386aa10795fb6bd5ffe2bf7946c4";
|
|
19806
19831
|
var css74 = `._empty-state_ptbbe_1 {
|
|
19807
19832
|
height: 100%;
|
|
19808
19833
|
}
|
|
@@ -19929,14 +19954,10 @@ var getColumns15 = ({
|
|
|
19929
19954
|
];
|
|
19930
19955
|
|
|
19931
19956
|
// admin/views/organizations/details/invoices/index.tsx
|
|
19932
|
-
var
|
|
19933
|
-
var
|
|
19957
|
+
var import_frontier51 = require("@raystack/proton/frontier");
|
|
19958
|
+
var import_connect_query46 = require("@connectrpc/connect-query");
|
|
19934
19959
|
var import_jsx_runtime103 = require("react/jsx-runtime");
|
|
19935
19960
|
var DEFAULT_SORT8 = { name: "createdAt", order: "desc" };
|
|
19936
|
-
var INITIAL_QUERY8 = {
|
|
19937
|
-
offset: 0,
|
|
19938
|
-
limit: DEFAULT_PAGE_SIZE
|
|
19939
|
-
};
|
|
19940
19961
|
var TRANSFORM_OPTIONS4 = {
|
|
19941
19962
|
fieldNameMapping: {
|
|
19942
19963
|
createdAt: "created_at",
|
|
@@ -20007,26 +20028,24 @@ var ErrorState3 = () => {
|
|
|
20007
20028
|
};
|
|
20008
20029
|
function OrganizationInvoicesView() {
|
|
20009
20030
|
const t = useTerminology();
|
|
20010
|
-
const { organization, search } = (0,
|
|
20031
|
+
const { organization, search } = (0, import_react55.useContext)(OrganizationContext);
|
|
20011
20032
|
const organizationId = organization?.id || "";
|
|
20012
20033
|
const {
|
|
20013
20034
|
onChange: onSearchChange,
|
|
20014
20035
|
setVisibility: setSearchVisibility,
|
|
20015
20036
|
query: searchQuery
|
|
20016
20037
|
} = search;
|
|
20017
|
-
const [tableQuery, setTableQuery] = (0, import_react54.useState)(INITIAL_QUERY8);
|
|
20018
20038
|
const title = `Invoices | ${organization?.title} | ${t.organization({ plural: true, case: "capital" })}`;
|
|
20019
|
-
const
|
|
20020
|
-
|
|
20021
|
-
|
|
20022
|
-
|
|
20023
|
-
|
|
20024
|
-
|
|
20025
|
-
|
|
20026
|
-
|
|
20027
|
-
|
|
20028
|
-
}
|
|
20029
|
-
const query = useDebouncedValue(computedQuery, 200);
|
|
20039
|
+
const {
|
|
20040
|
+
tableQuery,
|
|
20041
|
+
rqlQuery: query,
|
|
20042
|
+
onTableQueryChange
|
|
20043
|
+
} = useServerTableQuery({
|
|
20044
|
+
defaultSort: DEFAULT_SORT8,
|
|
20045
|
+
transformOptions: TRANSFORM_OPTIONS4,
|
|
20046
|
+
search: searchQuery || "",
|
|
20047
|
+
mapQuery: convertAmountFiltersToCents
|
|
20048
|
+
});
|
|
20030
20049
|
const {
|
|
20031
20050
|
data: infiniteData,
|
|
20032
20051
|
isLoading,
|
|
@@ -20034,8 +20053,8 @@ function OrganizationInvoicesView() {
|
|
|
20034
20053
|
fetchNextPage,
|
|
20035
20054
|
hasNextPage,
|
|
20036
20055
|
isError
|
|
20037
|
-
} = (0,
|
|
20038
|
-
|
|
20056
|
+
} = (0, import_connect_query46.useInfiniteQuery)(
|
|
20057
|
+
import_frontier51.FrontierServiceQueries.searchOrganizationInvoices,
|
|
20039
20058
|
{ id: organizationId, query },
|
|
20040
20059
|
{
|
|
20041
20060
|
enabled: !!organizationId,
|
|
@@ -20058,15 +20077,14 @@ function OrganizationInvoicesView() {
|
|
|
20058
20077
|
);
|
|
20059
20078
|
const showZeroState = !isLoading && !isError && !hasActiveQuery && data.length === 0;
|
|
20060
20079
|
const groupCountMap = infiniteData ? getGroupCountMapFromFirstPage(infiniteData) : {};
|
|
20061
|
-
const
|
|
20062
|
-
|
|
20063
|
-
|
|
20064
|
-
|
|
20065
|
-
|
|
20066
|
-
|
|
20067
|
-
|
|
20068
|
-
|
|
20069
|
-
(0, import_react54.useEffect)(() => {
|
|
20080
|
+
const fetchMore = useLoadMore({
|
|
20081
|
+
hasNextPage,
|
|
20082
|
+
isFetchingNextPage,
|
|
20083
|
+
isError,
|
|
20084
|
+
fetchNextPage,
|
|
20085
|
+
label: "invoices"
|
|
20086
|
+
});
|
|
20087
|
+
(0, import_react55.useEffect)(() => {
|
|
20070
20088
|
setSearchVisibility(true);
|
|
20071
20089
|
return () => {
|
|
20072
20090
|
onSearchChange("");
|
|
@@ -20109,8 +20127,8 @@ function OrganizationInvoicesView() {
|
|
|
20109
20127
|
// admin/views/organizations/details/tokens/index.tsx
|
|
20110
20128
|
var import_apsara94 = require("@raystack/apsara");
|
|
20111
20129
|
|
|
20112
|
-
// esbuild-css-modules-plugin-namespace:/tmp/tmp-
|
|
20113
|
-
var digest75 = "
|
|
20130
|
+
// esbuild-css-modules-plugin-namespace:/tmp/tmp-2174-kT6e13HA7bEQ/sdk/admin/views/organizations/details/tokens/tokens.module.css.js
|
|
20131
|
+
var digest75 = "7945f2d1cbbffb24a25fe626a7fcd654e773aa06c01c9669386f978105f5da7c";
|
|
20114
20132
|
var css75 = `._empty-state_sg42h_1 {
|
|
20115
20133
|
height: 100%;
|
|
20116
20134
|
}
|
|
@@ -20170,12 +20188,12 @@ var tokens_module_css_default = { "empty-state": "_empty-state_sg42h_1", "emptyS
|
|
|
20170
20188
|
|
|
20171
20189
|
// admin/views/organizations/details/tokens/index.tsx
|
|
20172
20190
|
var import_icons8 = require("@raystack/apsara/icons");
|
|
20173
|
-
var
|
|
20174
|
-
var
|
|
20175
|
-
var
|
|
20191
|
+
var import_react56 = require("react");
|
|
20192
|
+
var import_frontier52 = require("@raystack/proton/frontier");
|
|
20193
|
+
var import_connect_query47 = require("@connectrpc/connect-query");
|
|
20176
20194
|
|
|
20177
|
-
// esbuild-css-modules-plugin-namespace:/tmp/tmp-
|
|
20178
|
-
var digest76 = "
|
|
20195
|
+
// esbuild-css-modules-plugin-namespace:/tmp/tmp-2174-obUSNE4px2VB/sdk/admin/views/organizations/details/tokens/tokens.module.css.js
|
|
20196
|
+
var digest76 = "74adfea7968fef0e578c4d1bd804bee52080329112f4d3efa761991c52ee8750";
|
|
20179
20197
|
var css76 = `._empty-state_sg42h_1 {
|
|
20180
20198
|
height: 100%;
|
|
20181
20199
|
}
|
|
@@ -20311,10 +20329,6 @@ var getColumns16 = ({ t }) => {
|
|
|
20311
20329
|
// admin/views/organizations/details/tokens/index.tsx
|
|
20312
20330
|
var import_jsx_runtime105 = require("react/jsx-runtime");
|
|
20313
20331
|
var DEFAULT_SORT9 = { name: "createdAt", order: "desc" };
|
|
20314
|
-
var INITIAL_QUERY9 = {
|
|
20315
|
-
offset: 0,
|
|
20316
|
-
limit: DEFAULT_PAGE_SIZE
|
|
20317
|
-
};
|
|
20318
20332
|
var TRANSFORM_OPTIONS5 = {
|
|
20319
20333
|
fieldNameMapping: {
|
|
20320
20334
|
createdAt: "created_at",
|
|
@@ -20368,23 +20382,23 @@ var ErrorState4 = () => {
|
|
|
20368
20382
|
};
|
|
20369
20383
|
function OrganizationTokensView() {
|
|
20370
20384
|
const t = useTerminology();
|
|
20371
|
-
const { organization, search } = (0,
|
|
20385
|
+
const { organization, search } = (0, import_react56.useContext)(OrganizationContext);
|
|
20372
20386
|
const organizationId = organization?.id || "";
|
|
20373
20387
|
const {
|
|
20374
20388
|
onChange: onSearchChange,
|
|
20375
20389
|
setVisibility: setSearchVisibility,
|
|
20376
20390
|
query: searchQuery
|
|
20377
20391
|
} = search;
|
|
20378
|
-
const [tableQuery, setTableQuery] = (0, import_react55.useState)(INITIAL_QUERY9);
|
|
20379
20392
|
const title = `Tokens | ${organization?.title} | ${t.organization({ plural: true, case: "capital" })}`;
|
|
20380
|
-
const
|
|
20381
|
-
|
|
20382
|
-
|
|
20383
|
-
|
|
20384
|
-
|
|
20385
|
-
|
|
20386
|
-
|
|
20387
|
-
|
|
20393
|
+
const {
|
|
20394
|
+
tableQuery,
|
|
20395
|
+
rqlQuery: query,
|
|
20396
|
+
onTableQueryChange
|
|
20397
|
+
} = useServerTableQuery({
|
|
20398
|
+
defaultSort: DEFAULT_SORT9,
|
|
20399
|
+
transformOptions: TRANSFORM_OPTIONS5,
|
|
20400
|
+
search: searchQuery || ""
|
|
20401
|
+
});
|
|
20388
20402
|
const {
|
|
20389
20403
|
data: infiniteData,
|
|
20390
20404
|
isLoading,
|
|
@@ -20392,8 +20406,8 @@ function OrganizationTokensView() {
|
|
|
20392
20406
|
fetchNextPage,
|
|
20393
20407
|
hasNextPage,
|
|
20394
20408
|
isError
|
|
20395
|
-
} = (0,
|
|
20396
|
-
|
|
20409
|
+
} = (0, import_connect_query47.useInfiniteQuery)(
|
|
20410
|
+
import_frontier52.FrontierServiceQueries.searchOrganizationTokens,
|
|
20397
20411
|
{ id: organizationId, query },
|
|
20398
20412
|
{
|
|
20399
20413
|
enabled: !!organizationId,
|
|
@@ -20415,22 +20429,21 @@ function OrganizationTokensView() {
|
|
|
20415
20429
|
searchQuery?.trim() || tableQuery.filters?.length
|
|
20416
20430
|
);
|
|
20417
20431
|
const showZeroState = !isLoading && !isError && !hasActiveQuery && data.length === 0;
|
|
20418
|
-
const
|
|
20419
|
-
|
|
20420
|
-
|
|
20421
|
-
|
|
20422
|
-
|
|
20423
|
-
|
|
20424
|
-
|
|
20425
|
-
|
|
20426
|
-
(0, import_react55.useEffect)(() => {
|
|
20432
|
+
const fetchMore = useLoadMore({
|
|
20433
|
+
hasNextPage,
|
|
20434
|
+
isFetchingNextPage,
|
|
20435
|
+
isError,
|
|
20436
|
+
fetchNextPage,
|
|
20437
|
+
label: "tokens"
|
|
20438
|
+
});
|
|
20439
|
+
(0, import_react56.useEffect)(() => {
|
|
20427
20440
|
setSearchVisibility(true);
|
|
20428
20441
|
return () => {
|
|
20429
20442
|
onSearchChange("");
|
|
20430
20443
|
setSearchVisibility(false);
|
|
20431
20444
|
};
|
|
20432
20445
|
}, [setSearchVisibility, onSearchChange]);
|
|
20433
|
-
const columns = (0,
|
|
20446
|
+
const columns = (0, import_react56.useMemo)(() => getColumns16({ t }), [t]);
|
|
20434
20447
|
return /* @__PURE__ */ (0, import_jsx_runtime105.jsxs)(import_apsara94.Flex, { justify: "center", children: [
|
|
20435
20448
|
/* @__PURE__ */ (0, import_jsx_runtime105.jsx)(PageTitle, { title }),
|
|
20436
20449
|
/* @__PURE__ */ (0, import_jsx_runtime105.jsx)(
|
|
@@ -20466,8 +20479,8 @@ function OrganizationTokensView() {
|
|
|
20466
20479
|
// admin/views/organizations/details/apis/index.tsx
|
|
20467
20480
|
var import_apsara97 = require("@raystack/apsara");
|
|
20468
20481
|
|
|
20469
|
-
// esbuild-css-modules-plugin-namespace:/tmp/tmp-
|
|
20470
|
-
var digest77 = "
|
|
20482
|
+
// esbuild-css-modules-plugin-namespace:/tmp/tmp-2174-0LhmuhkFxXQ5/sdk/admin/views/organizations/details/apis/apis.module.css.js
|
|
20483
|
+
var digest77 = "3a178b8495ff7a6f3b21d583d2030d6d1fc99de3ebf54579524b82249027fe0e";
|
|
20471
20484
|
var css77 = `._empty-state_1819g_1 {
|
|
20472
20485
|
height: 100%;
|
|
20473
20486
|
}
|
|
@@ -20550,13 +20563,13 @@ var css77 = `._empty-state_1819g_1 {
|
|
|
20550
20563
|
var apis_module_css_default = { "empty-state": "_empty-state_1819g_1", "emptyState": "_empty-state_1819g_1", "empty-state-subheading": "_empty-state-subheading_1819g_5", "emptyStateSubheading": "_empty-state-subheading_1819g_5", "zero-state-container": "_zero-state-container_1819g_10", "zeroStateContainer": "_zero-state-container_1819g_10", "table": "_table_1819g_14", "table-wrapper": "_table-wrapper_1819g_19", "tableWrapper": "_table-wrapper_1819g_19", "table-header": "_table-header_1819g_25", "tableHeader": "_table-header_1819g_25", "first-column": "_first-column_1819g_30", "firstColumn": "_first-column_1819g_30", "details-dialog": "_details-dialog_1819g_34", "detailsDialog": "_details-dialog_1819g_34", "skeleton": "_skeleton_1819g_42", "tab-root": "_tab-root_1819g_46", "tabRoot": "_tab-root_1819g_46", "tab-content": "_tab-content_1819g_51", "tabContent": "_tab-content_1819g_51", "list-item": "_list-item_1819g_56", "listItem": "_list-item_1819g_56", "dialog-body": "_dialog-body_1819g_64", "dialogBody": "_dialog-body_1819g_64" };
|
|
20551
20564
|
|
|
20552
20565
|
// admin/views/organizations/details/apis/index.tsx
|
|
20553
|
-
var
|
|
20566
|
+
var import_react58 = require("react");
|
|
20554
20567
|
|
|
20555
20568
|
// admin/views/organizations/details/apis/columns.tsx
|
|
20556
20569
|
var import_apsara95 = require("@raystack/apsara");
|
|
20557
20570
|
|
|
20558
|
-
// esbuild-css-modules-plugin-namespace:/tmp/tmp-
|
|
20559
|
-
var digest78 = "
|
|
20571
|
+
// esbuild-css-modules-plugin-namespace:/tmp/tmp-2174-iJznml3g22E5/sdk/admin/views/organizations/details/apis/apis.module.css.js
|
|
20572
|
+
var digest78 = "cd5444965eaa2a774805f5eb6c2959aefa0e009c7f720c459b7a00776eb146f8";
|
|
20560
20573
|
var css78 = `._empty-state_1819g_1 {
|
|
20561
20574
|
height: 100%;
|
|
20562
20575
|
}
|
|
@@ -20681,8 +20694,8 @@ function getColumns17(options) {
|
|
|
20681
20694
|
// admin/views/organizations/details/apis/details-dialog.tsx
|
|
20682
20695
|
var import_apsara96 = require("@raystack/apsara");
|
|
20683
20696
|
|
|
20684
|
-
// esbuild-css-modules-plugin-namespace:/tmp/tmp-
|
|
20685
|
-
var digest79 = "
|
|
20697
|
+
// esbuild-css-modules-plugin-namespace:/tmp/tmp-2174-024jgGOfHY58/sdk/admin/views/organizations/details/apis/apis.module.css.js
|
|
20698
|
+
var digest79 = "8debdc9460b469db085e88ea2605cbacc11e77b679334c5ed1e44e1bb27caa68";
|
|
20686
20699
|
var css79 = `._empty-state_1819g_1 {
|
|
20687
20700
|
height: 100%;
|
|
20688
20701
|
}
|
|
@@ -20765,9 +20778,9 @@ var css79 = `._empty-state_1819g_1 {
|
|
|
20765
20778
|
var apis_module_css_default3 = { "empty-state": "_empty-state_1819g_1", "emptyState": "_empty-state_1819g_1", "empty-state-subheading": "_empty-state-subheading_1819g_5", "emptyStateSubheading": "_empty-state-subheading_1819g_5", "zero-state-container": "_zero-state-container_1819g_10", "zeroStateContainer": "_zero-state-container_1819g_10", "table": "_table_1819g_14", "table-wrapper": "_table-wrapper_1819g_19", "tableWrapper": "_table-wrapper_1819g_19", "table-header": "_table-header_1819g_25", "tableHeader": "_table-header_1819g_25", "first-column": "_first-column_1819g_30", "firstColumn": "_first-column_1819g_30", "details-dialog": "_details-dialog_1819g_34", "detailsDialog": "_details-dialog_1819g_34", "skeleton": "_skeleton_1819g_42", "tab-root": "_tab-root_1819g_46", "tabRoot": "_tab-root_1819g_46", "tab-content": "_tab-content_1819g_51", "tabContent": "_tab-content_1819g_51", "list-item": "_list-item_1819g_56", "listItem": "_list-item_1819g_56", "dialog-body": "_dialog-body_1819g_64", "dialogBody": "_dialog-body_1819g_64" };
|
|
20766
20779
|
|
|
20767
20780
|
// admin/views/organizations/details/apis/details-dialog.tsx
|
|
20768
|
-
var
|
|
20769
|
-
var
|
|
20770
|
-
var
|
|
20781
|
+
var import_react57 = require("react");
|
|
20782
|
+
var import_connect_query48 = require("@connectrpc/connect-query");
|
|
20783
|
+
var import_frontier53 = require("@raystack/proton/frontier");
|
|
20771
20784
|
var import_protobuf32 = require("@bufbuild/protobuf");
|
|
20772
20785
|
var import_jsx_runtime107 = require("react/jsx-runtime");
|
|
20773
20786
|
var ServiceUserDetailsDialog = ({
|
|
@@ -20776,15 +20789,15 @@ var ServiceUserDetailsDialog = ({
|
|
|
20776
20789
|
}) => {
|
|
20777
20790
|
const t = useTerminology();
|
|
20778
20791
|
const { id = "", orgId = "", title = "" } = serviceUser || {};
|
|
20779
|
-
const projectsRequest = (0,
|
|
20780
|
-
() => (0, import_protobuf32.create)(
|
|
20792
|
+
const projectsRequest = (0, import_react57.useMemo)(
|
|
20793
|
+
() => (0, import_protobuf32.create)(import_frontier53.ListServiceUserProjectsRequestSchema, {
|
|
20781
20794
|
orgId,
|
|
20782
20795
|
id
|
|
20783
20796
|
}),
|
|
20784
20797
|
[orgId, id]
|
|
20785
20798
|
);
|
|
20786
|
-
const tokensRequest = (0,
|
|
20787
|
-
() => (0, import_protobuf32.create)(
|
|
20799
|
+
const tokensRequest = (0, import_react57.useMemo)(
|
|
20800
|
+
() => (0, import_protobuf32.create)(import_frontier53.ListServiceUserTokensRequestSchema, {
|
|
20788
20801
|
orgId,
|
|
20789
20802
|
id
|
|
20790
20803
|
}),
|
|
@@ -20794,7 +20807,7 @@ var ServiceUserDetailsDialog = ({
|
|
|
20794
20807
|
data: projects = [],
|
|
20795
20808
|
isLoading: isProjectLoading,
|
|
20796
20809
|
error: projectError
|
|
20797
|
-
} = (0,
|
|
20810
|
+
} = (0, import_connect_query48.useQuery)(import_frontier53.FrontierServiceQueries.listServiceUserProjects, projectsRequest, {
|
|
20798
20811
|
enabled: !!orgId && !!id,
|
|
20799
20812
|
select: (data) => data?.projects || []
|
|
20800
20813
|
});
|
|
@@ -20802,11 +20815,11 @@ var ServiceUserDetailsDialog = ({
|
|
|
20802
20815
|
data: tokens = [],
|
|
20803
20816
|
isLoading: isTokenLoading,
|
|
20804
20817
|
error: tokenError
|
|
20805
|
-
} = (0,
|
|
20818
|
+
} = (0, import_connect_query48.useQuery)(import_frontier53.FrontierServiceQueries.listServiceUserTokens, tokensRequest, {
|
|
20806
20819
|
enabled: !!orgId && !!id,
|
|
20807
20820
|
select: (data) => data?.tokens || []
|
|
20808
20821
|
});
|
|
20809
|
-
(0,
|
|
20822
|
+
(0, import_react57.useEffect)(() => {
|
|
20810
20823
|
if (projectError) {
|
|
20811
20824
|
import_apsara96.toastManager.add({
|
|
20812
20825
|
title: "Something went wrong",
|
|
@@ -20824,7 +20837,7 @@ var ServiceUserDetailsDialog = ({
|
|
|
20824
20837
|
console.error("Unable to fetch tokens:", tokenError);
|
|
20825
20838
|
}
|
|
20826
20839
|
}, [projectError, tokenError]);
|
|
20827
|
-
const onOpenChange = (0,
|
|
20840
|
+
const onOpenChange = (0, import_react57.useCallback)(
|
|
20828
20841
|
(val) => {
|
|
20829
20842
|
if (!val) {
|
|
20830
20843
|
onClose();
|
|
@@ -20889,8 +20902,8 @@ var ServiceUserDetailsDialog = ({
|
|
|
20889
20902
|
};
|
|
20890
20903
|
|
|
20891
20904
|
// admin/views/organizations/details/apis/index.tsx
|
|
20892
|
-
var
|
|
20893
|
-
var
|
|
20905
|
+
var import_connect_query49 = require("@connectrpc/connect-query");
|
|
20906
|
+
var import_frontier54 = require("@raystack/proton/frontier");
|
|
20894
20907
|
var import_jsx_runtime108 = require("react/jsx-runtime");
|
|
20895
20908
|
var NoCredentials = () => {
|
|
20896
20909
|
return /* @__PURE__ */ (0, import_jsx_runtime108.jsx)(
|
|
@@ -20932,10 +20945,6 @@ var ErrorState5 = () => {
|
|
|
20932
20945
|
);
|
|
20933
20946
|
};
|
|
20934
20947
|
var DEFAULT_SORT10 = { name: "createdAt", order: "desc" };
|
|
20935
|
-
var INITIAL_QUERY10 = {
|
|
20936
|
-
offset: 0,
|
|
20937
|
-
limit: DEFAULT_PAGE_SIZE
|
|
20938
|
-
};
|
|
20939
20948
|
var TRANSFORM_OPTIONS6 = {
|
|
20940
20949
|
fieldNameMapping: {
|
|
20941
20950
|
createdAt: "created_at"
|
|
@@ -20943,27 +20952,27 @@ var TRANSFORM_OPTIONS6 = {
|
|
|
20943
20952
|
};
|
|
20944
20953
|
function OrganizationApisView() {
|
|
20945
20954
|
const t = useTerminology();
|
|
20946
|
-
const { organization, search } = (0,
|
|
20955
|
+
const { organization, search } = (0, import_react58.useContext)(OrganizationContext);
|
|
20947
20956
|
const organizationId = organization?.id || "";
|
|
20948
20957
|
const {
|
|
20949
20958
|
onChange: onSearchChange,
|
|
20950
20959
|
setVisibility: setSearchVisibility,
|
|
20951
20960
|
query: searchQuery
|
|
20952
20961
|
} = search;
|
|
20953
|
-
const
|
|
20954
|
-
|
|
20955
|
-
|
|
20956
|
-
|
|
20957
|
-
|
|
20958
|
-
|
|
20959
|
-
|
|
20960
|
-
|
|
20961
|
-
|
|
20962
|
-
const [selectedServiceUser, setSelectedServiceUser] = (0,
|
|
20962
|
+
const {
|
|
20963
|
+
tableQuery,
|
|
20964
|
+
rqlQuery: query,
|
|
20965
|
+
onTableQueryChange
|
|
20966
|
+
} = useServerTableQuery({
|
|
20967
|
+
defaultSort: DEFAULT_SORT10,
|
|
20968
|
+
transformOptions: TRANSFORM_OPTIONS6,
|
|
20969
|
+
search: searchQuery || ""
|
|
20970
|
+
});
|
|
20971
|
+
const [selectedServiceUser, setSelectedServiceUser] = (0, import_react58.useState)(
|
|
20963
20972
|
null
|
|
20964
20973
|
);
|
|
20965
20974
|
const title = `API | ${organization?.title} | ${t.organization({ plural: true, case: "capital" })}`;
|
|
20966
|
-
(0,
|
|
20975
|
+
(0, import_react58.useEffect)(() => {
|
|
20967
20976
|
setSearchVisibility(true);
|
|
20968
20977
|
return () => {
|
|
20969
20978
|
onSearchChange("");
|
|
@@ -20978,8 +20987,8 @@ function OrganizationApisView() {
|
|
|
20978
20987
|
error,
|
|
20979
20988
|
isError,
|
|
20980
20989
|
hasNextPage
|
|
20981
|
-
} = (0,
|
|
20982
|
-
|
|
20990
|
+
} = (0, import_connect_query49.useInfiniteQuery)(
|
|
20991
|
+
import_frontier54.AdminServiceQueries.searchOrganizationServiceUsers,
|
|
20983
20992
|
{ id: organizationId, query },
|
|
20984
20993
|
{
|
|
20985
20994
|
pageParamKey: "query",
|
|
@@ -20996,27 +21005,22 @@ function OrganizationApisView() {
|
|
|
20996
21005
|
}
|
|
20997
21006
|
);
|
|
20998
21007
|
const data = infiniteData?.pages?.flatMap((page) => page?.organizationServiceUsers || []) || [];
|
|
20999
|
-
const
|
|
21000
|
-
|
|
21001
|
-
|
|
21002
|
-
|
|
21003
|
-
|
|
21004
|
-
|
|
21005
|
-
|
|
21006
|
-
await fetchNextPage();
|
|
21007
|
-
} catch (error2) {
|
|
21008
|
-
console.error("Error loading more service users:", error2);
|
|
21009
|
-
}
|
|
21010
|
-
};
|
|
21008
|
+
const handleLoadMore = useLoadMore({
|
|
21009
|
+
hasNextPage,
|
|
21010
|
+
isFetchingNextPage,
|
|
21011
|
+
isError,
|
|
21012
|
+
fetchNextPage,
|
|
21013
|
+
label: "service users"
|
|
21014
|
+
});
|
|
21011
21015
|
const loading = isLoading || isFetchingNextPage;
|
|
21012
21016
|
const hasActiveQuery = Boolean(
|
|
21013
21017
|
searchQuery?.trim() || tableQuery.filters?.length
|
|
21014
21018
|
);
|
|
21015
21019
|
const showZeroState = !isLoading && !isError && !hasActiveQuery && data.length === 0;
|
|
21016
|
-
const onDialogClose = (0,
|
|
21020
|
+
const onDialogClose = (0, import_react58.useCallback)(() => {
|
|
21017
21021
|
setSelectedServiceUser(null);
|
|
21018
21022
|
}, []);
|
|
21019
|
-
const onRowClick = (0,
|
|
21023
|
+
const onRowClick = (0, import_react58.useCallback)(
|
|
21020
21024
|
(row) => {
|
|
21021
21025
|
setSelectedServiceUser(row);
|
|
21022
21026
|
},
|
|
@@ -21025,7 +21029,7 @@ function OrganizationApisView() {
|
|
|
21025
21029
|
if (isError) {
|
|
21026
21030
|
console.error("ConnectRPC Error:", error);
|
|
21027
21031
|
}
|
|
21028
|
-
const columns = (0,
|
|
21032
|
+
const columns = (0, import_react58.useMemo)(
|
|
21029
21033
|
() => getColumns17({
|
|
21030
21034
|
groupCountMap: infiniteData ? getGroupCountMapFromFirstPage(infiniteData) : {},
|
|
21031
21035
|
t
|
|
@@ -21074,9 +21078,9 @@ function OrganizationApisView() {
|
|
|
21074
21078
|
|
|
21075
21079
|
// admin/views/organizations/details/pat/index.tsx
|
|
21076
21080
|
var import_apsara100 = require("@raystack/apsara");
|
|
21077
|
-
var
|
|
21078
|
-
var
|
|
21079
|
-
var
|
|
21081
|
+
var import_react60 = require("react");
|
|
21082
|
+
var import_connect_query51 = require("@connectrpc/connect-query");
|
|
21083
|
+
var import_frontier56 = require("@raystack/proton/frontier");
|
|
21080
21084
|
|
|
21081
21085
|
// admin/views/organizations/details/pat/columns.tsx
|
|
21082
21086
|
var import_apsara98 = require("@raystack/apsara");
|
|
@@ -21092,8 +21096,8 @@ var getInitials = function(name = "") {
|
|
|
21092
21096
|
return initials;
|
|
21093
21097
|
};
|
|
21094
21098
|
|
|
21095
|
-
// esbuild-css-modules-plugin-namespace:/tmp/tmp-
|
|
21096
|
-
var digest80 = "
|
|
21099
|
+
// esbuild-css-modules-plugin-namespace:/tmp/tmp-2174-NfqZ3ng6pPLx/sdk/admin/views/organizations/details/pat/pat.module.css.js
|
|
21100
|
+
var digest80 = "da68b86b1d270dfb8cd3721fab96cdb140a785a21f62ec7d536d08c4e726b21c";
|
|
21097
21101
|
var css80 = `._empty-state_3m4sa_1 {
|
|
21098
21102
|
height: 100%;
|
|
21099
21103
|
}
|
|
@@ -21248,13 +21252,13 @@ function getColumns18({
|
|
|
21248
21252
|
}
|
|
21249
21253
|
|
|
21250
21254
|
// admin/views/organizations/details/pat/components/pat-details-dialog.tsx
|
|
21251
|
-
var
|
|
21255
|
+
var import_react59 = require("react");
|
|
21252
21256
|
var import_apsara99 = require("@raystack/apsara");
|
|
21253
|
-
var
|
|
21254
|
-
var
|
|
21257
|
+
var import_connect_query50 = require("@connectrpc/connect-query");
|
|
21258
|
+
var import_frontier55 = require("@raystack/proton/frontier");
|
|
21255
21259
|
|
|
21256
|
-
// esbuild-css-modules-plugin-namespace:/tmp/tmp-
|
|
21257
|
-
var digest81 = "
|
|
21260
|
+
// esbuild-css-modules-plugin-namespace:/tmp/tmp-2174-DdwqZCQZLtwk/sdk/admin/views/organizations/details/pat/components/pat-details-dialog.module.css.js
|
|
21261
|
+
var digest81 = "e9f9add4632277aaee155df484b6ffa606a50e958e49318bc0e9f7f0454d77b8";
|
|
21258
21262
|
var css81 = `._details-dialog_1dwlo_1 {
|
|
21259
21263
|
width: 100%;
|
|
21260
21264
|
max-width: 400px;
|
|
@@ -21328,25 +21332,25 @@ function PatDetailsDialog({
|
|
|
21328
21332
|
}) {
|
|
21329
21333
|
const t = useTerminology();
|
|
21330
21334
|
const open = pat !== null;
|
|
21331
|
-
const projectScope = (0,
|
|
21335
|
+
const projectScope = (0, import_react59.useMemo)(
|
|
21332
21336
|
() => pat?.scopes?.find((s) => s.resourceType === SCOPES.PROJECT),
|
|
21333
21337
|
[pat]
|
|
21334
21338
|
);
|
|
21335
|
-
const orgScope = (0,
|
|
21339
|
+
const orgScope = (0, import_react59.useMemo)(
|
|
21336
21340
|
() => pat?.scopes?.find((s) => s.resourceType === SCOPES.ORG),
|
|
21337
21341
|
[pat]
|
|
21338
21342
|
);
|
|
21339
|
-
const scopeProjectIds = (0,
|
|
21340
|
-
const scopeProjects = (0,
|
|
21343
|
+
const scopeProjectIds = (0, import_react59.useMemo)(() => projectScope?.resourceIds ?? [], [projectScope]);
|
|
21344
|
+
const scopeProjects = (0, import_react59.useMemo)(
|
|
21341
21345
|
() => scopeProjectIds.map((id) => projectsMap[id]).filter((p) => Boolean(p)),
|
|
21342
21346
|
[scopeProjectIds, projectsMap]
|
|
21343
21347
|
);
|
|
21344
|
-
const { data: rolesData, isLoading: isRolesLoading } = (0,
|
|
21345
|
-
|
|
21348
|
+
const { data: rolesData, isLoading: isRolesLoading } = (0, import_connect_query50.useQuery)(
|
|
21349
|
+
import_frontier55.FrontierServiceQueries.listRolesForPAT,
|
|
21346
21350
|
{ scopes: [SCOPES.ORG, SCOPES.PROJECT] },
|
|
21347
21351
|
{ enabled: open }
|
|
21348
21352
|
);
|
|
21349
|
-
const rolesMap = (0,
|
|
21353
|
+
const rolesMap = (0, import_react59.useMemo)(() => {
|
|
21350
21354
|
const map = {};
|
|
21351
21355
|
(rolesData?.roles ?? []).forEach((role) => {
|
|
21352
21356
|
if (role.id)
|
|
@@ -21445,8 +21449,8 @@ function PatDetailsDialog({
|
|
|
21445
21449
|
] }) });
|
|
21446
21450
|
}
|
|
21447
21451
|
|
|
21448
|
-
// esbuild-css-modules-plugin-namespace:/tmp/tmp-
|
|
21449
|
-
var digest82 = "
|
|
21452
|
+
// esbuild-css-modules-plugin-namespace:/tmp/tmp-2174-rIGiRILJ9NEe/sdk/admin/views/organizations/details/pat/pat.module.css.js
|
|
21453
|
+
var digest82 = "e0d79584faeb6f5d36a0e0a5b218ba27011294639e821482b5f13ea05f60cfb4";
|
|
21450
21454
|
var css82 = `._empty-state_3m4sa_1 {
|
|
21451
21455
|
height: 100%;
|
|
21452
21456
|
}
|
|
@@ -21507,10 +21511,6 @@ var pat_module_css_default2 = { "empty-state": "_empty-state_3m4sa_1", "emptySta
|
|
|
21507
21511
|
// admin/views/organizations/details/pat/index.tsx
|
|
21508
21512
|
var import_jsx_runtime111 = require("react/jsx-runtime");
|
|
21509
21513
|
var DEFAULT_SORT11 = { name: "createdAt", order: "desc" };
|
|
21510
|
-
var INITIAL_QUERY11 = {
|
|
21511
|
-
offset: 0,
|
|
21512
|
-
limit: DEFAULT_PAGE_SIZE
|
|
21513
|
-
};
|
|
21514
21514
|
var TRANSFORM_OPTIONS7 = {
|
|
21515
21515
|
fieldNameMapping: {
|
|
21516
21516
|
createdAt: "created_at",
|
|
@@ -21561,27 +21561,24 @@ var ErrorState6 = () => {
|
|
|
21561
21561
|
};
|
|
21562
21562
|
function OrganizationPatView() {
|
|
21563
21563
|
const t = useTerminology();
|
|
21564
|
-
const { organization, search } = (0,
|
|
21564
|
+
const { organization, search } = (0, import_react60.useContext)(OrganizationContext);
|
|
21565
21565
|
const organizationId = organization?.id || "";
|
|
21566
21566
|
const {
|
|
21567
21567
|
onChange: onSearchChange,
|
|
21568
21568
|
setVisibility: setSearchVisibility,
|
|
21569
21569
|
query: searchQuery
|
|
21570
21570
|
} = search;
|
|
21571
|
-
const [
|
|
21572
|
-
const [selectedPat, setSelectedPat] = (0, import_react59.useState)(null);
|
|
21571
|
+
const [selectedPat, setSelectedPat] = (0, import_react60.useState)(null);
|
|
21573
21572
|
const title = `PAT | ${organization?.title} | ${t.organization({ plural: true, case: "capital" })}`;
|
|
21574
|
-
const
|
|
21575
|
-
|
|
21576
|
-
|
|
21577
|
-
|
|
21578
|
-
|
|
21579
|
-
|
|
21580
|
-
|
|
21581
|
-
|
|
21582
|
-
|
|
21583
|
-
}, [tableQuery, searchQuery]);
|
|
21584
|
-
const query = useDebouncedValue(computedQuery, 200);
|
|
21573
|
+
const {
|
|
21574
|
+
tableQuery,
|
|
21575
|
+
rqlQuery: query,
|
|
21576
|
+
onTableQueryChange
|
|
21577
|
+
} = useServerTableQuery({
|
|
21578
|
+
defaultSort: DEFAULT_SORT11,
|
|
21579
|
+
transformOptions: TRANSFORM_OPTIONS7,
|
|
21580
|
+
search: searchQuery || ""
|
|
21581
|
+
});
|
|
21585
21582
|
const {
|
|
21586
21583
|
data: infiniteData,
|
|
21587
21584
|
isLoading,
|
|
@@ -21589,8 +21586,8 @@ function OrganizationPatView() {
|
|
|
21589
21586
|
fetchNextPage,
|
|
21590
21587
|
hasNextPage,
|
|
21591
21588
|
isError
|
|
21592
|
-
} = (0,
|
|
21593
|
-
|
|
21589
|
+
} = (0, import_connect_query51.useInfiniteQuery)(
|
|
21590
|
+
import_frontier56.AdminServiceQueries.searchOrganizationPATs,
|
|
21594
21591
|
{ orgId: organizationId, query },
|
|
21595
21592
|
{
|
|
21596
21593
|
enabled: !!organizationId,
|
|
@@ -21602,15 +21599,15 @@ function OrganizationPatView() {
|
|
|
21602
21599
|
retryDelay: 1e3
|
|
21603
21600
|
}
|
|
21604
21601
|
);
|
|
21605
|
-
const { data: projects = [] } = (0,
|
|
21606
|
-
|
|
21602
|
+
const { data: projects = [] } = (0, import_connect_query51.useQuery)(
|
|
21603
|
+
import_frontier56.FrontierServiceQueries.listOrganizationProjects,
|
|
21607
21604
|
{ id: organizationId, state: "", withMemberCount: false },
|
|
21608
21605
|
{
|
|
21609
21606
|
enabled: !!organizationId,
|
|
21610
21607
|
select: (data2) => data2?.projects || []
|
|
21611
21608
|
}
|
|
21612
21609
|
);
|
|
21613
|
-
const projectsMap = (0,
|
|
21610
|
+
const projectsMap = (0, import_react60.useMemo)(
|
|
21614
21611
|
() => projects.reduce(
|
|
21615
21612
|
(acc, project) => {
|
|
21616
21613
|
if (project.id)
|
|
@@ -21621,7 +21618,7 @@ function OrganizationPatView() {
|
|
|
21621
21618
|
),
|
|
21622
21619
|
[projects]
|
|
21623
21620
|
);
|
|
21624
|
-
const data = (0,
|
|
21621
|
+
const data = (0, import_react60.useMemo)(
|
|
21625
21622
|
() => infiniteData?.pages?.flatMap((page) => page?.organizationPats ?? []) ?? [],
|
|
21626
21623
|
[infiniteData]
|
|
21627
21624
|
);
|
|
@@ -21630,32 +21627,31 @@ function OrganizationPatView() {
|
|
|
21630
21627
|
searchQuery?.trim() || tableQuery.filters?.length
|
|
21631
21628
|
);
|
|
21632
21629
|
const showZeroState = !isLoading && !isError && !hasActiveQuery && data.length === 0;
|
|
21633
|
-
const
|
|
21634
|
-
|
|
21635
|
-
|
|
21636
|
-
|
|
21637
|
-
|
|
21638
|
-
|
|
21639
|
-
|
|
21640
|
-
|
|
21641
|
-
(0, import_react59.useEffect)(() => {
|
|
21630
|
+
const fetchMore = useLoadMore({
|
|
21631
|
+
hasNextPage,
|
|
21632
|
+
isFetchingNextPage,
|
|
21633
|
+
isError,
|
|
21634
|
+
fetchNextPage,
|
|
21635
|
+
label: "personal access tokens"
|
|
21636
|
+
});
|
|
21637
|
+
(0, import_react60.useEffect)(() => {
|
|
21642
21638
|
setSearchVisibility(true);
|
|
21643
21639
|
return () => {
|
|
21644
21640
|
onSearchChange("");
|
|
21645
21641
|
setSearchVisibility(false);
|
|
21646
21642
|
};
|
|
21647
21643
|
}, [setSearchVisibility, onSearchChange]);
|
|
21648
|
-
const columns = (0,
|
|
21644
|
+
const columns = (0, import_react60.useMemo)(
|
|
21649
21645
|
() => getColumns18({ projectsMap }),
|
|
21650
21646
|
[projectsMap]
|
|
21651
21647
|
);
|
|
21652
|
-
const onRowClick = (0,
|
|
21648
|
+
const onRowClick = (0, import_react60.useCallback)(
|
|
21653
21649
|
(row) => {
|
|
21654
21650
|
setSelectedPat(row);
|
|
21655
21651
|
},
|
|
21656
21652
|
[]
|
|
21657
21653
|
);
|
|
21658
|
-
const onDialogClose = (0,
|
|
21654
|
+
const onDialogClose = (0, import_react60.useCallback)(() => {
|
|
21659
21655
|
setSelectedPat(null);
|
|
21660
21656
|
}, []);
|
|
21661
21657
|
return /* @__PURE__ */ (0, import_jsx_runtime111.jsxs)(import_apsara100.Flex, { justify: "center", children: [
|