Skip to content

Commit

Permalink
fix: Change some texts in the cloning Identities flow (#3862)
Browse files Browse the repository at this point in the history
  • Loading branch information
novakzaballa authored Apr 30, 2024
1 parent 29ae2e9 commit 57313ca
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 8 deletions.
3 changes: 2 additions & 1 deletion frontend/common/types/requests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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'] & {
Expand Down
21 changes: 14 additions & 7 deletions frontend/web/components/CompareIdentities.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -134,24 +134,31 @@ const CompareIdentities: FC<CompareIdentitiesType> = ({
rightIdentityId: string,
environmentId: string,
) => {
const body =
Utils.getFeatureStatesEndpoint() === 'featurestates'
? { source_identity_id: leftIdentityId }
: { source_identity_uuid: leftIdentityId }

return openConfirm({
body: (
<div>
{'Cloning '} <strong>{leftIdentityName}</strong>{' '}
{'will copy any Identity Overrides in '}
<strong>{`${rightIdentityName}.`}</strong> {'Are you sure?'}
{'This will copy any Identity overrides from '}{' '}
<strong>{leftIdentityName}</strong> {'to '}
<strong>{`${rightIdentityName}.`}</strong>{' '}
{'Any existing Identity overrides on '}
<strong>{`${rightIdentityName}`}</strong> {'will be lost.'}
<br />
{'The Multivariate values will not be cloned.'}
</div>
),
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',
Expand Down

0 comments on commit 57313ca

Please sign in to comment.