@streamoid/settings 0.4.6 → 0.4.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.mts +1 -25
- package/dist/index.d.ts +1 -25
- package/dist/index.js +8 -81
- package/dist/index.mjs +8 -81
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -1090,30 +1090,6 @@ interface MemberListFrameProps {
|
|
|
1090
1090
|
children?: ReactNode;
|
|
1091
1091
|
}
|
|
1092
1092
|
declare function MemberListFrame({ header, emptyText, isEmpty, grow, maxHeight, contentMinWidth, children, }: MemberListFrameProps): react.JSX.Element;
|
|
1093
|
-
/**
|
|
1094
|
-
* A small pill marking a workspace member who is *also* a member of the
|
|
1095
|
-
* organization above this workspace.
|
|
1096
|
-
*
|
|
1097
|
-
* It answers a question neither list used to acknowledge: removing someone
|
|
1098
|
-
* here may not remove all their access. Per the org contract, admins of the
|
|
1099
|
-
* parent organization keep implicit access to its workspaces, and a workspace
|
|
1100
|
-
* set to organization-wide visibility is readable by every org member.
|
|
1101
|
-
*
|
|
1102
|
-
* Derived by intersecting this workspace's members with the organization's, so
|
|
1103
|
-
* it states a fact both APIs already report — it is not a guess at an
|
|
1104
|
-
* "inherited permission" flag, which no endpoint exposes.
|
|
1105
|
-
*
|
|
1106
|
-
* ONLY ADMINS GET A CHIP NOW. The other state read "in org", which told you
|
|
1107
|
-
* that someone in the workspace list is also in the organization -- true of
|
|
1108
|
-
* nearly everyone, actionable for no one, and one more thing to read on every
|
|
1109
|
-
* row. An org admin is different: they keep access to this workspace whatever
|
|
1110
|
-
* is set here, and they are who you ask for permissions. That is worth a chip;
|
|
1111
|
-
* "also in the org" is not.
|
|
1112
|
-
*/
|
|
1113
|
-
declare function OrgMembershipTag({ organizationName, isOrgAdmin, }: {
|
|
1114
|
-
organizationName?: string | null;
|
|
1115
|
-
isOrgAdmin?: boolean;
|
|
1116
|
-
}): react.JSX.Element;
|
|
1117
1093
|
|
|
1118
1094
|
type SettingsTooltipPlacement = "right" | "top" | "bottom";
|
|
1119
1095
|
interface SettingsTooltipProps {
|
|
@@ -1280,4 +1256,4 @@ declare function SettingsAdaptersProvider({ adapters, children, }: {
|
|
|
1280
1256
|
*/
|
|
1281
1257
|
declare function useSettingsAdapters(): SettingsAdapters;
|
|
1282
1258
|
|
|
1283
|
-
export { APP_KEYS, type ApiToken, type AppKey, type AvailableCreditsResponse, BillingContent, type BillingEventPayload, type BillingProduct, type BillingSubscription, BuyCreditsModal, type BuyCreditsPayload, type BuyCreditsResponse, ConfirmDeleteModal, ConfirmLeaveModal, type CreatedToken, type CustomCreditInfo, type CustomCreditResponse, DEFAULT_PERMISSIONS, DEFAULT_USER_LANGUAGE, ExportDateModal, InviteUpdateModal, type InvoicePdfResponse, MemberListFrame, type MemberListFrameProps, type MemberListTab, MemberListToolbar, type MemberListToolbarProps, type MemberPermissionsPayload,
|
|
1259
|
+
export { APP_KEYS, type ApiToken, type AppKey, type AvailableCreditsResponse, BillingContent, type BillingEventPayload, type BillingProduct, type BillingSubscription, BuyCreditsModal, type BuyCreditsPayload, type BuyCreditsResponse, ConfirmDeleteModal, ConfirmLeaveModal, type CreatedToken, type CustomCreditInfo, type CustomCreditResponse, DEFAULT_PERMISSIONS, DEFAULT_USER_LANGUAGE, ExportDateModal, InviteUpdateModal, type InvoicePdfResponse, MemberListFrame, type MemberListFrameProps, type MemberListTab, MemberListToolbar, type MemberListToolbarProps, type MemberPermissionsPayload, OrganizationContent, type OrganizationData, type OrganizationInvite, OrganizationInviteModal, type OrganizationInviteModalProps, type OrganizationJoinRequest, type OrganizationMember, OrganizationModal, type OrganizationView, type OrganizationWorkspaceItem, type Price, type PriceMetadata, type ProductsResponse, ProfileAvatar, ProfileTab, ReferralTab, SCOPE_LABELS, ScopeHeader, type ScopeHeaderProps, type ServiceItem, type SettingsAdapters, SettingsAdaptersProvider, type SettingsApiAdapter, type SettingsAuthAdapter, type SettingsAuthUser, SettingsContent, type SettingsContentProps, type SettingsImageUploadAdapter, type SettingsNavigationAdapter, type SettingsOrganizationAdapter, type SettingsOrganizationCurrent, type SettingsOrganizationListItem, type SettingsScope, type SettingsTab, type SettingsToastAdapter, SettingsTooltip, type SettingsTooltipPlacement, type SettingsTooltipProps, type SettingsWorkspaceAdapter, type SettingsWorkspaceCurrent, type SettingsWorkspaceListItem, SiconKey, type StoreItem, type SubscriptionPlan, type SubscriptionResponse, TAB_DESCRIPTIONS, TAB_LABELS, TAB_SCOPE, TAB_TO_URL, type TeamMember, TeamsContent, type TokenExpiry, TokensContent, URL_TO_TAB, USER_LANGUAGES, type UpdateSubscriptionPayload, type UpdateSubscriptionResponse, type UsageHistoryItem, type UsageHistoryResponse, type UserLanguage, type UserPermissions, type WorkspaceData, WorkspaceGeneralTab, type WorkspaceGeneralTabProps, type WorkspaceInvite, WorkspaceListTab, type WorkspaceMember, WorkspaceModal, WorkspaceTab, countLabel, resolveSettingsTabFromPath, useSettingsAdapters, userLanguageLabel };
|
package/dist/index.d.ts
CHANGED
|
@@ -1090,30 +1090,6 @@ interface MemberListFrameProps {
|
|
|
1090
1090
|
children?: ReactNode;
|
|
1091
1091
|
}
|
|
1092
1092
|
declare function MemberListFrame({ header, emptyText, isEmpty, grow, maxHeight, contentMinWidth, children, }: MemberListFrameProps): react.JSX.Element;
|
|
1093
|
-
/**
|
|
1094
|
-
* A small pill marking a workspace member who is *also* a member of the
|
|
1095
|
-
* organization above this workspace.
|
|
1096
|
-
*
|
|
1097
|
-
* It answers a question neither list used to acknowledge: removing someone
|
|
1098
|
-
* here may not remove all their access. Per the org contract, admins of the
|
|
1099
|
-
* parent organization keep implicit access to its workspaces, and a workspace
|
|
1100
|
-
* set to organization-wide visibility is readable by every org member.
|
|
1101
|
-
*
|
|
1102
|
-
* Derived by intersecting this workspace's members with the organization's, so
|
|
1103
|
-
* it states a fact both APIs already report — it is not a guess at an
|
|
1104
|
-
* "inherited permission" flag, which no endpoint exposes.
|
|
1105
|
-
*
|
|
1106
|
-
* ONLY ADMINS GET A CHIP NOW. The other state read "in org", which told you
|
|
1107
|
-
* that someone in the workspace list is also in the organization -- true of
|
|
1108
|
-
* nearly everyone, actionable for no one, and one more thing to read on every
|
|
1109
|
-
* row. An org admin is different: they keep access to this workspace whatever
|
|
1110
|
-
* is set here, and they are who you ask for permissions. That is worth a chip;
|
|
1111
|
-
* "also in the org" is not.
|
|
1112
|
-
*/
|
|
1113
|
-
declare function OrgMembershipTag({ organizationName, isOrgAdmin, }: {
|
|
1114
|
-
organizationName?: string | null;
|
|
1115
|
-
isOrgAdmin?: boolean;
|
|
1116
|
-
}): react.JSX.Element;
|
|
1117
1093
|
|
|
1118
1094
|
type SettingsTooltipPlacement = "right" | "top" | "bottom";
|
|
1119
1095
|
interface SettingsTooltipProps {
|
|
@@ -1280,4 +1256,4 @@ declare function SettingsAdaptersProvider({ adapters, children, }: {
|
|
|
1280
1256
|
*/
|
|
1281
1257
|
declare function useSettingsAdapters(): SettingsAdapters;
|
|
1282
1258
|
|
|
1283
|
-
export { APP_KEYS, type ApiToken, type AppKey, type AvailableCreditsResponse, BillingContent, type BillingEventPayload, type BillingProduct, type BillingSubscription, BuyCreditsModal, type BuyCreditsPayload, type BuyCreditsResponse, ConfirmDeleteModal, ConfirmLeaveModal, type CreatedToken, type CustomCreditInfo, type CustomCreditResponse, DEFAULT_PERMISSIONS, DEFAULT_USER_LANGUAGE, ExportDateModal, InviteUpdateModal, type InvoicePdfResponse, MemberListFrame, type MemberListFrameProps, type MemberListTab, MemberListToolbar, type MemberListToolbarProps, type MemberPermissionsPayload,
|
|
1259
|
+
export { APP_KEYS, type ApiToken, type AppKey, type AvailableCreditsResponse, BillingContent, type BillingEventPayload, type BillingProduct, type BillingSubscription, BuyCreditsModal, type BuyCreditsPayload, type BuyCreditsResponse, ConfirmDeleteModal, ConfirmLeaveModal, type CreatedToken, type CustomCreditInfo, type CustomCreditResponse, DEFAULT_PERMISSIONS, DEFAULT_USER_LANGUAGE, ExportDateModal, InviteUpdateModal, type InvoicePdfResponse, MemberListFrame, type MemberListFrameProps, type MemberListTab, MemberListToolbar, type MemberListToolbarProps, type MemberPermissionsPayload, OrganizationContent, type OrganizationData, type OrganizationInvite, OrganizationInviteModal, type OrganizationInviteModalProps, type OrganizationJoinRequest, type OrganizationMember, OrganizationModal, type OrganizationView, type OrganizationWorkspaceItem, type Price, type PriceMetadata, type ProductsResponse, ProfileAvatar, ProfileTab, ReferralTab, SCOPE_LABELS, ScopeHeader, type ScopeHeaderProps, type ServiceItem, type SettingsAdapters, SettingsAdaptersProvider, type SettingsApiAdapter, type SettingsAuthAdapter, type SettingsAuthUser, SettingsContent, type SettingsContentProps, type SettingsImageUploadAdapter, type SettingsNavigationAdapter, type SettingsOrganizationAdapter, type SettingsOrganizationCurrent, type SettingsOrganizationListItem, type SettingsScope, type SettingsTab, type SettingsToastAdapter, SettingsTooltip, type SettingsTooltipPlacement, type SettingsTooltipProps, type SettingsWorkspaceAdapter, type SettingsWorkspaceCurrent, type SettingsWorkspaceListItem, SiconKey, type StoreItem, type SubscriptionPlan, type SubscriptionResponse, TAB_DESCRIPTIONS, TAB_LABELS, TAB_SCOPE, TAB_TO_URL, type TeamMember, TeamsContent, type TokenExpiry, TokensContent, URL_TO_TAB, USER_LANGUAGES, type UpdateSubscriptionPayload, type UpdateSubscriptionResponse, type UsageHistoryItem, type UsageHistoryResponse, type UserLanguage, type UserPermissions, type WorkspaceData, WorkspaceGeneralTab, type WorkspaceGeneralTabProps, type WorkspaceInvite, WorkspaceListTab, type WorkspaceMember, WorkspaceModal, WorkspaceTab, countLabel, resolveSettingsTabFromPath, useSettingsAdapters, userLanguageLabel };
|
package/dist/index.js
CHANGED
|
@@ -31,7 +31,6 @@ __export(index_exports, {
|
|
|
31
31
|
InviteUpdateModal: () => InviteUpdateModal,
|
|
32
32
|
MemberListFrame: () => MemberListFrame,
|
|
33
33
|
MemberListToolbar: () => MemberListToolbar,
|
|
34
|
-
OrgMembershipTag: () => OrgMembershipTag,
|
|
35
34
|
OrganizationContent: () => OrganizationContent,
|
|
36
35
|
OrganizationInviteModal: () => OrganizationInviteModal,
|
|
37
36
|
OrganizationModal: () => OrganizationModal,
|
|
@@ -3815,31 +3814,6 @@ function MemberListFrame({
|
|
|
3815
3814
|
}
|
|
3816
3815
|
);
|
|
3817
3816
|
}
|
|
3818
|
-
function OrgMembershipTag({
|
|
3819
|
-
organizationName,
|
|
3820
|
-
isOrgAdmin
|
|
3821
|
-
}) {
|
|
3822
|
-
const org = organizationName?.trim() || "the organization";
|
|
3823
|
-
return /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
3824
|
-
"span",
|
|
3825
|
-
{
|
|
3826
|
-
className: "shrink-0 whitespace-nowrap",
|
|
3827
|
-
style: {
|
|
3828
|
-
fontFamily: T7.font,
|
|
3829
|
-
fontSize: T7.fsXs,
|
|
3830
|
-
fontWeight: 500,
|
|
3831
|
-
lineHeight: T7.lhSm,
|
|
3832
|
-
padding: "1px 8px",
|
|
3833
|
-
borderRadius: "var(--radius-full)",
|
|
3834
|
-
color: isOrgAdmin ? T7.primary : T7.muted,
|
|
3835
|
-
border: `1px solid ${isOrgAdmin ? T7.primary : T7.borderSubtle}`,
|
|
3836
|
-
backgroundColor: "transparent"
|
|
3837
|
-
},
|
|
3838
|
-
title: `Admin of ${org} \u2014 keeps access to this workspace regardless of what is set here. Manage under Organization \u203A People.`,
|
|
3839
|
-
children: "Org admin"
|
|
3840
|
-
}
|
|
3841
|
-
);
|
|
3842
|
-
}
|
|
3843
3817
|
function RoleChip({
|
|
3844
3818
|
role,
|
|
3845
3819
|
label
|
|
@@ -4258,8 +4232,6 @@ function AccessIcons({ permissions }) {
|
|
|
4258
4232
|
function TeamRow({
|
|
4259
4233
|
member,
|
|
4260
4234
|
variant,
|
|
4261
|
-
orgMembership,
|
|
4262
|
-
organizationName,
|
|
4263
4235
|
onClick,
|
|
4264
4236
|
onCancelInvite,
|
|
4265
4237
|
onResendInvite
|
|
@@ -4325,22 +4297,13 @@ function TeamRow({
|
|
|
4325
4297
|
]
|
|
4326
4298
|
}
|
|
4327
4299
|
),
|
|
4328
|
-
/* @__PURE__ */ (0, import_jsx_runtime12.
|
|
4329
|
-
|
|
4330
|
-
|
|
4331
|
-
|
|
4332
|
-
|
|
4333
|
-
|
|
4334
|
-
|
|
4335
|
-
),
|
|
4336
|
-
orgMembership && /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
4337
|
-
OrgMembershipTag,
|
|
4338
|
-
{
|
|
4339
|
-
organizationName,
|
|
4340
|
-
isOrgAdmin: orgMembership.isOrgAdmin
|
|
4341
|
-
}
|
|
4342
|
-
)
|
|
4343
|
-
] }),
|
|
4300
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)("div", { className: "flex items-center shrink-0", style: { gap: 6 }, children: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
4301
|
+
RoleChip,
|
|
4302
|
+
{
|
|
4303
|
+
role: member.permissions.role === "admin" ? "admin" : "member",
|
|
4304
|
+
label: member.permissions.role === "admin" ? "Workspace admin" : "Member"
|
|
4305
|
+
}
|
|
4306
|
+
) }),
|
|
4344
4307
|
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(AccessIcons, { permissions: member.permissions }),
|
|
4345
4308
|
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
4346
4309
|
"div",
|
|
@@ -4407,7 +4370,7 @@ function TeamsContent({
|
|
|
4407
4370
|
organizationName,
|
|
4408
4371
|
hiddenApps
|
|
4409
4372
|
} = {}) {
|
|
4410
|
-
const { auth, api,
|
|
4373
|
+
const { auth, api, workspace, toast } = useSettingsAdapters();
|
|
4411
4374
|
const user = auth.user;
|
|
4412
4375
|
const [activeTab, setActiveTab] = (0, import_react8.useState)("active");
|
|
4413
4376
|
const [activeMembers, setActiveMembers] = (0, import_react8.useState)([]);
|
|
@@ -4417,9 +4380,6 @@ function TeamsContent({
|
|
|
4417
4380
|
const [highestRole, setHighestRole] = (0, import_react8.useState)("admin");
|
|
4418
4381
|
const [searchQuery, setSearchQuery] = (0, import_react8.useState)("");
|
|
4419
4382
|
const [loadingData, setLoadingData] = (0, import_react8.useState)(false);
|
|
4420
|
-
const [orgMemberRoles, setOrgMemberRoles] = (0, import_react8.useState)(
|
|
4421
|
-
() => /* @__PURE__ */ new Map()
|
|
4422
|
-
);
|
|
4423
4383
|
const [modal, setModal] = (0, import_react8.useState)({
|
|
4424
4384
|
open: false,
|
|
4425
4385
|
mode: "invite"
|
|
@@ -4498,37 +4458,6 @@ function TeamsContent({
|
|
|
4498
4458
|
}
|
|
4499
4459
|
}
|
|
4500
4460
|
];
|
|
4501
|
-
const organizationId = organization.current?.id ?? null;
|
|
4502
|
-
(0, import_react8.useEffect)(() => {
|
|
4503
|
-
if (!organizationId) {
|
|
4504
|
-
setOrgMemberRoles(/* @__PURE__ */ new Map());
|
|
4505
|
-
return;
|
|
4506
|
-
}
|
|
4507
|
-
let cancelled = false;
|
|
4508
|
-
organization.fetchMembers().then((members2) => {
|
|
4509
|
-
if (cancelled) return;
|
|
4510
|
-
const next = /* @__PURE__ */ new Map();
|
|
4511
|
-
for (const m of members2) {
|
|
4512
|
-
const email = m.user?.email?.trim().toLowerCase();
|
|
4513
|
-
if (email) next.set(email, m.role);
|
|
4514
|
-
}
|
|
4515
|
-
setOrgMemberRoles(next);
|
|
4516
|
-
}).catch(() => {
|
|
4517
|
-
if (!cancelled) setOrgMemberRoles(/* @__PURE__ */ new Map());
|
|
4518
|
-
});
|
|
4519
|
-
return () => {
|
|
4520
|
-
cancelled = true;
|
|
4521
|
-
};
|
|
4522
|
-
}, [organizationId, organization]);
|
|
4523
|
-
const orgMembershipFor = (0, import_react8.useCallback)(
|
|
4524
|
-
(email) => {
|
|
4525
|
-
const key = email?.trim().toLowerCase();
|
|
4526
|
-
if (!key || orgMemberRoles.size === 0) return void 0;
|
|
4527
|
-
const role = orgMemberRoles.get(key);
|
|
4528
|
-
return role ? { isOrgAdmin: role === "admin" } : void 0;
|
|
4529
|
-
},
|
|
4530
|
-
[orgMemberRoles]
|
|
4531
|
-
);
|
|
4532
4461
|
const fetchData = (0, import_react8.useCallback)(async () => {
|
|
4533
4462
|
setLoadingData(true);
|
|
4534
4463
|
try {
|
|
@@ -4859,8 +4788,6 @@ function TeamsContent({
|
|
|
4859
4788
|
{
|
|
4860
4789
|
member,
|
|
4861
4790
|
variant: activeTab,
|
|
4862
|
-
orgMembership: orgMembershipFor(member.userEmail),
|
|
4863
|
-
organizationName,
|
|
4864
4791
|
onClick: activeTab === "active" ? () => openUpdateModal(member) : void 0,
|
|
4865
4792
|
onCancelInvite: () => void handleCancelPendingInvite(member),
|
|
4866
4793
|
onResendInvite: () => void handleResendPendingInvite(member)
|
package/dist/index.mjs
CHANGED
|
@@ -3797,31 +3797,6 @@ function MemberListFrame({
|
|
|
3797
3797
|
}
|
|
3798
3798
|
);
|
|
3799
3799
|
}
|
|
3800
|
-
function OrgMembershipTag({
|
|
3801
|
-
organizationName,
|
|
3802
|
-
isOrgAdmin
|
|
3803
|
-
}) {
|
|
3804
|
-
const org = organizationName?.trim() || "the organization";
|
|
3805
|
-
return /* @__PURE__ */ jsx11(
|
|
3806
|
-
"span",
|
|
3807
|
-
{
|
|
3808
|
-
className: "shrink-0 whitespace-nowrap",
|
|
3809
|
-
style: {
|
|
3810
|
-
fontFamily: T7.font,
|
|
3811
|
-
fontSize: T7.fsXs,
|
|
3812
|
-
fontWeight: 500,
|
|
3813
|
-
lineHeight: T7.lhSm,
|
|
3814
|
-
padding: "1px 8px",
|
|
3815
|
-
borderRadius: "var(--radius-full)",
|
|
3816
|
-
color: isOrgAdmin ? T7.primary : T7.muted,
|
|
3817
|
-
border: `1px solid ${isOrgAdmin ? T7.primary : T7.borderSubtle}`,
|
|
3818
|
-
backgroundColor: "transparent"
|
|
3819
|
-
},
|
|
3820
|
-
title: `Admin of ${org} \u2014 keeps access to this workspace regardless of what is set here. Manage under Organization \u203A People.`,
|
|
3821
|
-
children: "Org admin"
|
|
3822
|
-
}
|
|
3823
|
-
);
|
|
3824
|
-
}
|
|
3825
3800
|
function RoleChip({
|
|
3826
3801
|
role,
|
|
3827
3802
|
label
|
|
@@ -4240,8 +4215,6 @@ function AccessIcons({ permissions }) {
|
|
|
4240
4215
|
function TeamRow({
|
|
4241
4216
|
member,
|
|
4242
4217
|
variant,
|
|
4243
|
-
orgMembership,
|
|
4244
|
-
organizationName,
|
|
4245
4218
|
onClick,
|
|
4246
4219
|
onCancelInvite,
|
|
4247
4220
|
onResendInvite
|
|
@@ -4307,22 +4280,13 @@ function TeamRow({
|
|
|
4307
4280
|
]
|
|
4308
4281
|
}
|
|
4309
4282
|
),
|
|
4310
|
-
/* @__PURE__ */
|
|
4311
|
-
|
|
4312
|
-
|
|
4313
|
-
|
|
4314
|
-
|
|
4315
|
-
|
|
4316
|
-
|
|
4317
|
-
),
|
|
4318
|
-
orgMembership && /* @__PURE__ */ jsx12(
|
|
4319
|
-
OrgMembershipTag,
|
|
4320
|
-
{
|
|
4321
|
-
organizationName,
|
|
4322
|
-
isOrgAdmin: orgMembership.isOrgAdmin
|
|
4323
|
-
}
|
|
4324
|
-
)
|
|
4325
|
-
] }),
|
|
4283
|
+
/* @__PURE__ */ jsx12("div", { className: "flex items-center shrink-0", style: { gap: 6 }, children: /* @__PURE__ */ jsx12(
|
|
4284
|
+
RoleChip,
|
|
4285
|
+
{
|
|
4286
|
+
role: member.permissions.role === "admin" ? "admin" : "member",
|
|
4287
|
+
label: member.permissions.role === "admin" ? "Workspace admin" : "Member"
|
|
4288
|
+
}
|
|
4289
|
+
) }),
|
|
4326
4290
|
/* @__PURE__ */ jsx12(AccessIcons, { permissions: member.permissions }),
|
|
4327
4291
|
/* @__PURE__ */ jsx12(
|
|
4328
4292
|
"div",
|
|
@@ -4389,7 +4353,7 @@ function TeamsContent({
|
|
|
4389
4353
|
organizationName,
|
|
4390
4354
|
hiddenApps
|
|
4391
4355
|
} = {}) {
|
|
4392
|
-
const { auth, api,
|
|
4356
|
+
const { auth, api, workspace, toast } = useSettingsAdapters();
|
|
4393
4357
|
const user = auth.user;
|
|
4394
4358
|
const [activeTab, setActiveTab] = useState6("active");
|
|
4395
4359
|
const [activeMembers, setActiveMembers] = useState6([]);
|
|
@@ -4399,9 +4363,6 @@ function TeamsContent({
|
|
|
4399
4363
|
const [highestRole, setHighestRole] = useState6("admin");
|
|
4400
4364
|
const [searchQuery, setSearchQuery] = useState6("");
|
|
4401
4365
|
const [loadingData, setLoadingData] = useState6(false);
|
|
4402
|
-
const [orgMemberRoles, setOrgMemberRoles] = useState6(
|
|
4403
|
-
() => /* @__PURE__ */ new Map()
|
|
4404
|
-
);
|
|
4405
4366
|
const [modal, setModal] = useState6({
|
|
4406
4367
|
open: false,
|
|
4407
4368
|
mode: "invite"
|
|
@@ -4480,37 +4441,6 @@ function TeamsContent({
|
|
|
4480
4441
|
}
|
|
4481
4442
|
}
|
|
4482
4443
|
];
|
|
4483
|
-
const organizationId = organization.current?.id ?? null;
|
|
4484
|
-
useEffect6(() => {
|
|
4485
|
-
if (!organizationId) {
|
|
4486
|
-
setOrgMemberRoles(/* @__PURE__ */ new Map());
|
|
4487
|
-
return;
|
|
4488
|
-
}
|
|
4489
|
-
let cancelled = false;
|
|
4490
|
-
organization.fetchMembers().then((members2) => {
|
|
4491
|
-
if (cancelled) return;
|
|
4492
|
-
const next = /* @__PURE__ */ new Map();
|
|
4493
|
-
for (const m of members2) {
|
|
4494
|
-
const email = m.user?.email?.trim().toLowerCase();
|
|
4495
|
-
if (email) next.set(email, m.role);
|
|
4496
|
-
}
|
|
4497
|
-
setOrgMemberRoles(next);
|
|
4498
|
-
}).catch(() => {
|
|
4499
|
-
if (!cancelled) setOrgMemberRoles(/* @__PURE__ */ new Map());
|
|
4500
|
-
});
|
|
4501
|
-
return () => {
|
|
4502
|
-
cancelled = true;
|
|
4503
|
-
};
|
|
4504
|
-
}, [organizationId, organization]);
|
|
4505
|
-
const orgMembershipFor = useCallback2(
|
|
4506
|
-
(email) => {
|
|
4507
|
-
const key = email?.trim().toLowerCase();
|
|
4508
|
-
if (!key || orgMemberRoles.size === 0) return void 0;
|
|
4509
|
-
const role = orgMemberRoles.get(key);
|
|
4510
|
-
return role ? { isOrgAdmin: role === "admin" } : void 0;
|
|
4511
|
-
},
|
|
4512
|
-
[orgMemberRoles]
|
|
4513
|
-
);
|
|
4514
4444
|
const fetchData = useCallback2(async () => {
|
|
4515
4445
|
setLoadingData(true);
|
|
4516
4446
|
try {
|
|
@@ -4841,8 +4771,6 @@ function TeamsContent({
|
|
|
4841
4771
|
{
|
|
4842
4772
|
member,
|
|
4843
4773
|
variant: activeTab,
|
|
4844
|
-
orgMembership: orgMembershipFor(member.userEmail),
|
|
4845
|
-
organizationName,
|
|
4846
4774
|
onClick: activeTab === "active" ? () => openUpdateModal(member) : void 0,
|
|
4847
4775
|
onCancelInvite: () => void handleCancelPendingInvite(member),
|
|
4848
4776
|
onResendInvite: () => void handleResendPendingInvite(member)
|
|
@@ -12157,7 +12085,6 @@ export {
|
|
|
12157
12085
|
InviteUpdateModal,
|
|
12158
12086
|
MemberListFrame,
|
|
12159
12087
|
MemberListToolbar,
|
|
12160
|
-
OrgMembershipTag,
|
|
12161
12088
|
OrganizationContent,
|
|
12162
12089
|
OrganizationInviteModal,
|
|
12163
12090
|
OrganizationModal,
|