Files
speckle-server/packages/frontend-2/components/settings/user/email/DeleteDialog.vue
T
andrewwallacespeckle 91cb011ded feat(fe2): New user onboarding flow (#3932)
* CodeInput. verify-email page

* middleware

* Loading toast

* Countdown only for registration

* Improve middleware

* Fix middleware breaking auth flow

* Remove old notifications

* Remove old onboarding. New segmentation

* Remove skip button

* Block verify email when verified

* useUserEmails composable. Cancel addition

* Move user emails queries

* Fix fragments etc

* redirect updates

* HeaderWithEmptyPage

* Check env before enforcing

* Join workspace

* Updates

* Fix console warnings on login

* Fix register console warnings

* Working cache updates

* Verify secondary email

* Force onboarding off

* EMAIL WIP

* useIsJustRegistered state

* Improve isRequired

* Uneeded change

* Improved slots

* Updates from CR

* CR comments

* Only show message if forced

* Update onboarding middleware

* Update loading bar

* ref > computed to fix onboarding

* Resend tooltip. Better errors

* Add other to form.

* Email changes

* Updates to emails

* Remove force email FF

* Remove FF's

* Hide header on embed

* Update graphql.ts

* Re-add FF

* Update graphql.ts

* GQL Fragments

* Fix build
2025-02-14 10:20:14 +00:00

57 lines
1.3 KiB
Vue

<template>
<LayoutDialog
v-model:open="isOpen"
:title="cancel ? 'Cancel adding email' : 'Delete email address'"
max-width="xs"
:buttons="dialogButtons"
>
<p class="text-body-xs text-foreground mb-2">
{{
cancel
? `Are you sure you want to cancel adding ${email?.email} to your account?`
: `Are you sure you want to delete ${email?.email} from your account?`
}}
</p>
</LayoutDialog>
</template>
<script setup lang="ts">
import type { LayoutDialogButton } from '@speckle/ui-components'
import type { UserEmail } from '~/lib/common/generated/gql/graphql'
import { useUserEmails } from '~/lib/user/composables/emails'
const props = defineProps<{
email?: UserEmail
cancel?: boolean
}>()
const isOpen = defineModel<boolean>('open', { required: true })
const { deleteUserEmail } = useUserEmails()
const dialogButtons = computed((): LayoutDialogButton[] => [
{
text: 'Cancel',
props: { color: 'outline' },
onClick: () => {
isOpen.value = false
}
},
{
text: props.cancel ? 'Confirm' : 'Delete',
props: { color: 'primary' },
onClick: () => {
onDeleteEmail()
}
}
])
const onDeleteEmail = async () => {
if (!props.email) return
const success = await deleteUserEmail(props.email)
if (success) {
isOpen.value = false
}
}
</script>