Fix workspace logo, cookie security, and improve workspace impersonation (#14838)
3 small fixes: - Fix workspace logo - Improve cookie security - Improve workspace impersonation
This commit is contained in:
+17
-1
@@ -26,6 +26,7 @@ import {
|
||||
IconEyeShare,
|
||||
IconHome,
|
||||
IconId,
|
||||
IconLink,
|
||||
IconUser,
|
||||
} from 'twenty-ui/display';
|
||||
import { Button, Toggle } from 'twenty-ui/input';
|
||||
@@ -133,6 +134,10 @@ export const SettingsAdminWorkspaceContent = ({
|
||||
});
|
||||
};
|
||||
|
||||
const getWorkspaceUrl = (workspaceUrls: WorkspaceInfo['workspaceUrls']) => {
|
||||
return workspaceUrls.customUrl ?? workspaceUrls.subdomainUrl;
|
||||
};
|
||||
|
||||
const workspaceInfoItems = [
|
||||
{
|
||||
Icon: IconHome,
|
||||
@@ -160,6 +165,13 @@ export const SettingsAdminWorkspaceContent = ({
|
||||
label: t`ID`,
|
||||
value: activeWorkspace?.id,
|
||||
},
|
||||
{
|
||||
Icon: IconLink,
|
||||
label: t`URL`,
|
||||
value: activeWorkspace?.workspaceUrls
|
||||
? getWorkspaceUrl(activeWorkspace.workspaceUrls)
|
||||
: '',
|
||||
},
|
||||
{
|
||||
Icon: IconUser,
|
||||
label: t`Members`,
|
||||
@@ -186,7 +198,11 @@ export const SettingsAdminWorkspaceContent = ({
|
||||
Icon={IconEyeShare}
|
||||
variant="primary"
|
||||
accent="default"
|
||||
title={t`Impersonate`}
|
||||
title={
|
||||
activeWorkspace.allowImpersonation === false
|
||||
? t`Impersonation is disabled for this workspace`
|
||||
: t`Impersonate`
|
||||
}
|
||||
onClick={() => handleImpersonate(activeWorkspace.id)}
|
||||
disabled={
|
||||
isImpersonateLoading ||
|
||||
|
||||
+4
@@ -15,6 +15,10 @@ export const USER_LOOKUP_ADMIN_PANEL = gql`
|
||||
logo
|
||||
totalUsers
|
||||
allowImpersonation
|
||||
workspaceUrls {
|
||||
customUrl
|
||||
subdomainUrl
|
||||
}
|
||||
users {
|
||||
id
|
||||
email
|
||||
|
||||
@@ -1,10 +1,12 @@
|
||||
import { type FeatureFlag } from '@/settings/admin-panel/types/FeatureFlag';
|
||||
import { type WorkspaceUrls } from '~/generated-metadata/graphql';
|
||||
|
||||
export type WorkspaceInfo = {
|
||||
id: string;
|
||||
name: string;
|
||||
logo?: string | null;
|
||||
totalUsers: number;
|
||||
workspaceUrls: WorkspaceUrls;
|
||||
users: {
|
||||
id: string;
|
||||
email: string;
|
||||
|
||||
Reference in New Issue
Block a user