Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Change some texts in the cloning Identities flow #3862

Merged
Merged
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
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