fix missing trash x off icon (#12699)
## Context Icon does not exist in tabler-icon it seems, had to create a new one manually. Also added a reload current user when roles are updated to update the state accordingly <img width="419" alt="Screenshot 2025-06-18 at 13 06 23" src="https://github.com/user-attachments/assets/2667883e-c392-4f68-bc04-7471b9bdd6fd" />
This commit is contained in:
@ -7,6 +7,7 @@ import {
|
||||
IconTrash,
|
||||
IconTrashOff,
|
||||
IconTrashX,
|
||||
IconTrashXOff,
|
||||
} from 'twenty-ui/display';
|
||||
|
||||
type SettingsRoleObjectPermissionIconConfig = {
|
||||
@ -38,6 +39,6 @@ export const SETTINGS_ROLE_OBJECT_PERMISSION_ICON_CONFIG: Record<
|
||||
},
|
||||
canDestroyObjectRecords: {
|
||||
Icon: IconTrashX,
|
||||
IconForbidden: IconTrashX,
|
||||
IconForbidden: IconTrashXOff,
|
||||
},
|
||||
};
|
||||
|
||||
@ -1,3 +1,4 @@
|
||||
import { useAuth } from '@/auth/hooks/useAuth';
|
||||
import { SaveAndCancelButtons } from '@/settings/components/SaveAndCancelButtons/SaveAndCancelButtons';
|
||||
import { SettingsPageContainer } from '@/settings/components/SettingsPageContainer';
|
||||
import { GET_ROLES } from '@/settings/roles/graphql/queries/getRolesQuery';
|
||||
@ -82,6 +83,8 @@ export const SettingsRole = ({ roleId, isCreateMode }: SettingsRoleProps) => {
|
||||
settingsPersistedRoleFamilyState(roleId),
|
||||
);
|
||||
|
||||
const { loadCurrentUser } = useAuth();
|
||||
|
||||
const { enqueueSnackBar } = useSnackBar();
|
||||
|
||||
if (!isDefined(settingsRolesIsLoading)) {
|
||||
@ -268,6 +271,8 @@ export const SettingsRole = ({ roleId, isCreateMode }: SettingsRoleProps) => {
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
await loadCurrentUser();
|
||||
};
|
||||
|
||||
return (
|
||||
|
||||
@ -32,7 +32,7 @@ export const SettingsRoleCreateEffect = ({
|
||||
|
||||
const newRole = {
|
||||
id: roleId,
|
||||
label: t`Role name`,
|
||||
label: t`Untitled role`,
|
||||
description: '',
|
||||
icon: 'IconUser',
|
||||
canUpdateAllSettings: true,
|
||||
|
||||
@ -3,6 +3,7 @@ import { useRecoilState } from 'recoil';
|
||||
import { settingsDraftRoleFamilyState } from '@/settings/roles/states/settingsDraftRoleFamilyState';
|
||||
import { TitleInput } from '@/ui/input/components/TitleInput';
|
||||
import styled from '@emotion/styled';
|
||||
import { t } from '@lingui/core/macro';
|
||||
|
||||
const ROLE_LABEL_EDIT_HOTKEY_SCOPE = 'role-label-edit';
|
||||
|
||||
@ -42,7 +43,7 @@ export const SettingsRoleLabelContainer = ({
|
||||
sizeVariant="md"
|
||||
value={settingsDraftRole.label}
|
||||
onChange={handleChange}
|
||||
placeholder="Role name"
|
||||
placeholder={t`Role name`}
|
||||
hotkeyScope={ROLE_LABEL_EDIT_HOTKEY_SCOPE}
|
||||
/>
|
||||
</StyledHeaderTitle>
|
||||
|
||||
Reference in New Issue
Block a user