Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions frontend/web/components/EditIdentity.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -62,10 +62,10 @@ const EditIdentity: FC<EditIdentityType> = ({ data, environmentId }) => {
/>
<Button
disabled={!data}
iconSize={18}
iconSize={16}
theme='text'
style={{ lineHeight: 'inherit' }}
className='text-primary'
className='text-primary d-flex align-items-center'
iconRightColour='primary'
iconRight={'edit'}
onClick={handleFocus}
Expand Down
102 changes: 57 additions & 45 deletions frontend/web/components/pages/UserPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ import UsersIcon from 'components/svg/UsersIcon'
import IdentityTraits from 'components/IdentityTraits'
import { useGetIdentitySegmentsQuery } from 'common/services/useIdentitySegment'
import useDebouncedSearch from 'common/useDebouncedSearch'
import SettingTitle from 'components/SettingTitle'

const width = [200, 48, 78]

Expand Down Expand Up @@ -318,59 +319,40 @@ const UserPage: FC = () => {
<>
<PageTitle
title={
<div className='d-flex align-items-center justify-content-between'>
<div>
<div className='h5'>
Identifier:{' '}
<span className='fw-normal'>
<IdentifierString
value={
(identity && identity.identity.identifier) || id
}
/>
{showAliases && (
<h6 className='d-flex align-items-center gap-1'>
<Tooltip
title={
<span className='user-select-none'>
Alias:{' '}
</span>
}
>
Aliases allow you to add searchable names to an
identity
</Tooltip>
{!!identity && (
<EditIdentity
data={identity?.identity}
environmentId={environmentId}
/>
)}
</h6>
)}
</span>
{showAliases && (
<h6 className='d-flex mb-0 align-items-end gap-1'>
<Tooltip
title={
<span className='user-select-none'>Alias: </span>
}
>
Aliases allow you to add searchable names to an
identity
</Tooltip>
{!!identity && (
<EditIdentity
data={identity?.identity}
environmentId={environmentId}
/>
)}
</h6>
)}
<div className='text-nowrap fs-regular fw-normal mt-2'>
View and manage feature states and traits for this
identity.
</div>
<Button
id='remove-feature'
className='btn btn-with-icon'
type='button'
onClick={() => {
removeIdentity(
id,
(identity && identity.identity.identifier) || id,
environmentId,
() => {
history.replace(
`/project/${projectId}/environment/${environmentId}/users`,
)
},
)
}}
>
<Icon name='trash-2' width={20} fill='#656D7B' />
</Button>
</div>
}
>
View and manage feature states and traits for this user.
<br />
</PageTitle>
></PageTitle>
<div className='row'>
<div className='col-md-12'>
<FormGroup>
Expand Down Expand Up @@ -1034,6 +1016,36 @@ const UserPage: FC = () => {
userId={identity?.identity?.identifier || id}
/>
</FormGroup>
<FormGroup className='mt-5'>
<SettingTitle danger>Delete Identity</SettingTitle>
<FormGroup className='mt-4'>
<Row space>
<p className='fs-small lh-sm mb-0'>
Identities can be re-added here or via one of our
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think this is particularly clear - I'm not sure what 'here' means.

I'd say let's be more explicit and go with something like:

"Deleting this identity will delete all of their stored traits, and any identity overrides that you have configured. The identity will be recreated if it is identified via your Flagsmith integration again. You can also recreate it in the dashboard here."

This feels a bit wordy now, so perhaps we can remove some of the details here, but I think we should err towards this, rather than the unclear statement we currently have here.

SDKs
</p>
<Button
id='delete-identity-btn'
onClick={() => {
removeIdentity(
id,
(identity && identity.identity.identifier) ||
id,
environmentId,
() => {
history.replace(
`/project/${projectId}/environment/${environmentId}/users`,
)
},
)
}}
theme='danger'
>
Delete Identity
</Button>
</Row>
</FormGroup>
</FormGroup>
</div>
</div>
</>
Expand Down
10 changes: 9 additions & 1 deletion frontend/web/components/pages/UsersPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ export const removeIdentity = (
}
})
},
title: 'Delete User',
title: 'Delete Identity',
yesText: 'Confirm',
})
}
Expand Down Expand Up @@ -170,6 +170,14 @@ const UsersPage: FC<{ props: any }> = (props) => {
<FormGroup>
<PanelSearch
renderSearchWithNoResults
header={
permission && (
<Row className='table-header'>
<Flex className='table-column px-3'>Identifier</Flex>
<div className='table-column'></div>
</Row>
)
}
filterRowContent={
showAliases && (
<div className='ms-2' style={{ width: 100 }}>
Expand Down
Loading