Skip to content

Commit 81e4058

Browse files
authored
chore: Add identifier terminology (#6220)
1 parent c29dec8 commit 81e4058

File tree

3 files changed

+82
-52
lines changed

3 files changed

+82
-52
lines changed

frontend/web/components/EditIdentity.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,10 +62,10 @@ const EditIdentity: FC<EditIdentityType> = ({ data, environmentId }) => {
6262
/>
6363
<Button
6464
disabled={!data}
65-
iconSize={18}
65+
iconSize={16}
6666
theme='text'
6767
style={{ lineHeight: 'inherit' }}
68-
className='text-primary'
68+
className='text-primary d-flex align-items-center'
6969
iconRightColour='primary'
7070
iconRight={'edit'}
7171
onClick={handleFocus}

frontend/web/components/pages/UserPage.tsx

Lines changed: 65 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import React, { FC, useCallback, useEffect, useState } from 'react'
2-
import { useHistory, useRouteMatch } from 'react-router-dom'
2+
import { Link, useHistory, useRouteMatch } from 'react-router-dom'
33
import { useRouteContext } from 'components/providers/RouteContext'
44
import keyBy from 'lodash/keyBy'
55

@@ -62,6 +62,7 @@ import UsersIcon from 'components/svg/UsersIcon'
6262
import IdentityTraits from 'components/IdentityTraits'
6363
import { useGetIdentitySegmentsQuery } from 'common/services/useIdentitySegment'
6464
import useDebouncedSearch from 'common/useDebouncedSearch'
65+
import SettingTitle from 'components/SettingTitle'
6566

6667
const width = [200, 48, 78]
6768

@@ -318,59 +319,40 @@ const UserPage: FC = () => {
318319
<>
319320
<PageTitle
320321
title={
321-
<div className='d-flex align-items-center justify-content-between'>
322-
<div>
322+
<div className='h5'>
323+
Identifier:{' '}
324+
<span className='fw-normal'>
323325
<IdentifierString
324326
value={
325327
(identity && identity.identity.identifier) || id
326328
}
327329
/>
328-
{showAliases && (
329-
<h6 className='d-flex align-items-center gap-1'>
330-
<Tooltip
331-
title={
332-
<span className='user-select-none'>
333-
Alias:{' '}
334-
</span>
335-
}
336-
>
337-
Aliases allow you to add searchable names to an
338-
identity
339-
</Tooltip>
340-
{!!identity && (
341-
<EditIdentity
342-
data={identity?.identity}
343-
environmentId={environmentId}
344-
/>
345-
)}
346-
</h6>
347-
)}
330+
</span>
331+
{showAliases && (
332+
<h6 className='d-flex mb-0 align-items-end gap-1'>
333+
<Tooltip
334+
title={
335+
<span className='user-select-none'>Alias: </span>
336+
}
337+
>
338+
Aliases allow you to add searchable names to an
339+
identity
340+
</Tooltip>
341+
{!!identity && (
342+
<EditIdentity
343+
data={identity?.identity}
344+
environmentId={environmentId}
345+
/>
346+
)}
347+
</h6>
348+
)}
349+
<div className='text-nowrap fs-regular fw-normal mt-2'>
350+
View and manage feature states and traits for this
351+
identity.
348352
</div>
349-
<Button
350-
id='remove-feature'
351-
className='btn btn-with-icon'
352-
type='button'
353-
onClick={() => {
354-
removeIdentity(
355-
id,
356-
(identity && identity.identity.identifier) || id,
357-
environmentId,
358-
() => {
359-
history.replace(
360-
`/project/${projectId}/environment/${environmentId}/users`,
361-
)
362-
},
363-
)
364-
}}
365-
>
366-
<Icon name='trash-2' width={20} fill='#656D7B' />
367-
</Button>
368353
</div>
369354
}
370-
>
371-
View and manage feature states and traits for this user.
372-
<br />
373-
</PageTitle>
355+
></PageTitle>
374356
<div className='row'>
375357
<div className='col-md-12'>
376358
<FormGroup>
@@ -1034,6 +1016,43 @@ const UserPage: FC = () => {
10341016
userId={identity?.identity?.identifier || id}
10351017
/>
10361018
</FormGroup>
1019+
<FormGroup className='mt-5'>
1020+
<SettingTitle danger>Delete Identity</SettingTitle>
1021+
<FormGroup className='mt-4'>
1022+
<p className='fs-small col-lg-8 lh-sm'>
1023+
Deleting this identity will delete all of their stored
1024+
traits, and any identity overrides that you have
1025+
configured. The identity will be recreated if it is
1026+
identified when identified via your Flagsmith
1027+
integration again. You can also recreate it in the
1028+
dashboard from the{' '}
1029+
<Link
1030+
to={`/project/${projectId}/environment/${environmentId}/users`}
1031+
>
1032+
Identities Page
1033+
</Link>
1034+
.
1035+
</p>
1036+
<Button
1037+
id='delete-identity-btn'
1038+
onClick={() => {
1039+
removeIdentity(
1040+
id,
1041+
(identity && identity.identity.identifier) || id,
1042+
environmentId,
1043+
() => {
1044+
history.replace(
1045+
`/project/${projectId}/environment/${environmentId}/users`,
1046+
)
1047+
},
1048+
)
1049+
}}
1050+
theme='danger'
1051+
>
1052+
Delete Identity
1053+
</Button>
1054+
</FormGroup>
1055+
</FormGroup>
10371056
</div>
10381057
</div>
10391058
</>

frontend/web/components/pages/UsersPage.tsx

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,12 @@ export const removeIdentity = (
4141
openConfirm({
4242
body: (
4343
<div>
44-
{'Are you sure you want to delete '}
45-
<strong>{identifier}</strong>
46-
{'? Identities can be re-added here or via one of our SDKs.'}
44+
<div className='mb-2'>
45+
{'Are you sure you want to delete '}
46+
<strong>{identifier}</strong>?
47+
</div>
48+
Deleting this identity will delete all of their stored traits, and any
49+
identity overrides that you have configured.
4750
</div>
4851
),
4952
destructive: true,
@@ -62,7 +65,7 @@ export const removeIdentity = (
6265
}
6366
})
6467
},
65-
title: 'Delete User',
68+
title: 'Delete Identity',
6669
yesText: 'Confirm',
6770
})
6871
}
@@ -170,6 +173,14 @@ const UsersPage: FC<{ props: any }> = (props) => {
170173
<FormGroup>
171174
<PanelSearch
172175
renderSearchWithNoResults
176+
header={
177+
permission && (
178+
<Row className='table-header'>
179+
<Flex className='table-column px-3'>Identifier</Flex>
180+
<div className='table-column'></div>
181+
</Row>
182+
)
183+
}
173184
filterRowContent={
174185
showAliases && (
175186
<div className='ms-2' style={{ width: 100 }}>

0 commit comments

Comments
 (0)