|
1 | 1 | 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' |
3 | 3 | import { useRouteContext } from 'components/providers/RouteContext' |
4 | 4 | import keyBy from 'lodash/keyBy' |
5 | 5 |
|
@@ -62,6 +62,7 @@ import UsersIcon from 'components/svg/UsersIcon' |
62 | 62 | import IdentityTraits from 'components/IdentityTraits' |
63 | 63 | import { useGetIdentitySegmentsQuery } from 'common/services/useIdentitySegment' |
64 | 64 | import useDebouncedSearch from 'common/useDebouncedSearch' |
| 65 | +import SettingTitle from 'components/SettingTitle' |
65 | 66 |
|
66 | 67 | const width = [200, 48, 78] |
67 | 68 |
|
@@ -318,59 +319,40 @@ const UserPage: FC = () => { |
318 | 319 | <> |
319 | 320 | <PageTitle |
320 | 321 | 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'> |
323 | 325 | <IdentifierString |
324 | 326 | value={ |
325 | 327 | (identity && identity.identity.identifier) || id |
326 | 328 | } |
327 | 329 | /> |
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. |
348 | 352 | </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> |
368 | 353 | </div> |
369 | 354 | } |
370 | | - > |
371 | | - View and manage feature states and traits for this user. |
372 | | - <br /> |
373 | | - </PageTitle> |
| 355 | + ></PageTitle> |
374 | 356 | <div className='row'> |
375 | 357 | <div className='col-md-12'> |
376 | 358 | <FormGroup> |
@@ -1034,6 +1016,43 @@ const UserPage: FC = () => { |
1034 | 1016 | userId={identity?.identity?.identifier || id} |
1035 | 1017 | /> |
1036 | 1018 | </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> |
1037 | 1056 | </div> |
1038 | 1057 | </div> |
1039 | 1058 | </> |
|
0 commit comments