feat(fe): Add generic settings confirm dialog
feat(fe): Add generic settings confirm dialog
This commit is contained in:
+16
-16
@@ -1,21 +1,21 @@
|
||||
<template>
|
||||
<LayoutDialog
|
||||
v-model:open="isOpen"
|
||||
title="Confirm change"
|
||||
:title="title"
|
||||
max-width="xs"
|
||||
:buttons="dialogButtons"
|
||||
>
|
||||
<p class="text-body-xs text-foreground mb-2">
|
||||
This will allow users with verified domain emails to join automatically without
|
||||
admin approval.
|
||||
</p>
|
||||
<p class="text-body-xs text-foreground">Are you sure you want to enable this?</p>
|
||||
<slot />
|
||||
</LayoutDialog>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import type { LayoutDialogButton } from '@speckle/ui-components'
|
||||
|
||||
defineProps<{
|
||||
title: string
|
||||
}>()
|
||||
|
||||
const emit = defineEmits<{
|
||||
(e: 'confirm'): void
|
||||
(e: 'cancel'): void
|
||||
@@ -23,16 +23,6 @@ const emit = defineEmits<{
|
||||
|
||||
const isOpen = defineModel<boolean>('open', { required: true })
|
||||
|
||||
const handleConfirm = () => {
|
||||
emit('confirm')
|
||||
isOpen.value = false
|
||||
}
|
||||
|
||||
const handleCancel = () => {
|
||||
emit('cancel')
|
||||
isOpen.value = false
|
||||
}
|
||||
|
||||
const dialogButtons = computed((): LayoutDialogButton[] => [
|
||||
{
|
||||
text: 'Cancel',
|
||||
@@ -47,4 +37,14 @@ const dialogButtons = computed((): LayoutDialogButton[] => [
|
||||
onClick: handleConfirm
|
||||
}
|
||||
])
|
||||
|
||||
const handleConfirm = () => {
|
||||
emit('confirm')
|
||||
isOpen.value = false
|
||||
}
|
||||
|
||||
const handleCancel = () => {
|
||||
emit('cancel')
|
||||
isOpen.value = false
|
||||
}
|
||||
</script>
|
||||
@@ -148,12 +148,19 @@
|
||||
:workspace-id="workspace?.id"
|
||||
:domain="removeDialogDomain"
|
||||
/>
|
||||
<SettingsWorkspacesSecurityConfirmJoinPolicyDialog
|
||||
<SettingsConfirmDialog
|
||||
v-if="showConfirmJoinPolicyDialog"
|
||||
v-model:open="showConfirmJoinPolicyDialog"
|
||||
title="Confirm change"
|
||||
@confirm="handleJoinPolicyConfirm"
|
||||
@cancel="pendingJoinPolicy = undefined"
|
||||
/>
|
||||
>
|
||||
<p class="text-body-xs text-foreground mb-2">
|
||||
This will allow users with verified domain emails to join automatically without
|
||||
admin approval.
|
||||
</p>
|
||||
<p class="text-body-xs text-foreground">Are you sure you want to enable this?</p>
|
||||
</SettingsConfirmDialog>
|
||||
</section>
|
||||
</template>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user