From 57313ca6802321688b7c735d8284f540188c4d9f Mon Sep 17 00:00:00 2001 From: Novak Zaballa <41410593+novakzaballa@users.noreply.github.com> Date: Tue, 30 Apr 2024 13:51:10 -0400 Subject: [PATCH] fix: Change some texts in the cloning Identities flow (#3862) --- frontend/common/types/requests.ts | 3 ++- frontend/web/components/CompareIdentities.tsx | 21 ++++++++++++------- 2 files changed, 16 insertions(+), 8 deletions(-) diff --git a/frontend/common/types/requests.ts b/frontend/common/types/requests.ts index 03371963ce8d..242f0c8bfbfc 100644 --- a/frontend/common/types/requests.ts +++ b/frontend/common/types/requests.ts @@ -384,7 +384,8 @@ export type Req = { environment_id: string identity_id: string body: { - source_identity_id: string + source_identity_id?: string + source_identity_uuid?: string } } updateGroup: Req['createGroup'] & { diff --git a/frontend/web/components/CompareIdentities.tsx b/frontend/web/components/CompareIdentities.tsx index ffbc68a5e55a..a8d9f389d6e6 100644 --- a/frontend/web/components/CompareIdentities.tsx +++ b/frontend/web/components/CompareIdentities.tsx @@ -134,24 +134,31 @@ const CompareIdentities: FC = ({ rightIdentityId: string, environmentId: string, ) => { + const body = + Utils.getFeatureStatesEndpoint() === 'featurestates' + ? { source_identity_id: leftIdentityId } + : { source_identity_uuid: leftIdentityId } + return openConfirm({ body: (
- {'Cloning '} {leftIdentityName}{' '} - {'will copy any Identity Overrides in '} - {`${rightIdentityName}.`} {'Are you sure?'} + {'This will copy any Identity overrides from '}{' '} + {leftIdentityName} {'to '} + {`${rightIdentityName}.`}{' '} + {'Any existing Identity overrides on '} + {`${rightIdentityName}`} {'will be lost.'} +
+ {'The Multivariate values will not be cloned.'}
), destructive: true, onYes: () => { createCloneIdentityFeatureStates({ - body: { - source_identity_id: leftIdentityId, - }, + body: body, environment_id: environmentId, identity_id: rightIdentityId, }).then(() => { - toast('Clonation Completed!') + toast('Identity overrides successfully cloned!') }) }, title: 'Clone Identity',