feat(activities): pending-aware toast + unified pending gate
Rename willGoToPending → willLandInPending, drop the (now-redundant)
isEditMode predicate from the gate so create can reuse it. Toast
copy now confirms the destination explicitly:
create + pending : "Submitted! Awaiting admin approval — your
draft is visible on your feed with a Pending
badge."
edit + pending : "Updated — awaiting re-approval. Hidden from
the public feed until reviewed."
Closes the surprise where a non-admin user under auto_approve=off
got a generic "Event submitted!" and then couldn't tell whether
their post had been accepted or was just waiting.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
556b9e5cfe
commit
63fc7b3ab8
1 changed files with 14 additions and 6 deletions
|
|
@ -67,8 +67,12 @@ const emit = defineEmits<{
|
|||
}>()
|
||||
|
||||
const isEditMode = computed(() => Boolean(props.event?.id))
|
||||
const willGoToPending = computed(
|
||||
() => isEditMode.value && !props.isAdmin && !props.autoApprove
|
||||
// True when the submission will land in `proposed` status: a non-admin
|
||||
// owner with the extension's auto_approve toggle off. Same gate for
|
||||
// create and edit; the edit path also keys the in-form warning banner
|
||||
// on this so the user sees the consequence before submitting.
|
||||
const willLandInPending = computed(
|
||||
() => !props.isAdmin && !props.autoApprove
|
||||
)
|
||||
|
||||
const { t } = useI18n()
|
||||
|
|
@ -302,8 +306,8 @@ const onSubmit = form.handleSubmit(async (formValues) => {
|
|||
}
|
||||
await props.onUpdateEvent(props.event.id, eventData)
|
||||
toastService.success(
|
||||
willGoToPending.value
|
||||
? 'Event updated — pending re-approval'
|
||||
willLandInPending.value
|
||||
? 'Updated — awaiting re-approval. Hidden from the public feed until reviewed.'
|
||||
: 'Event updated!'
|
||||
)
|
||||
emit('event-updated')
|
||||
|
|
@ -313,7 +317,11 @@ const onSubmit = form.handleSubmit(async (formValues) => {
|
|||
return
|
||||
}
|
||||
await props.onCreateEvent(eventData)
|
||||
toastService.success('Event submitted!')
|
||||
toastService.success(
|
||||
willLandInPending.value
|
||||
? 'Submitted! Awaiting admin approval — your draft is visible on your feed with a Pending badge.'
|
||||
: 'Event submitted!'
|
||||
)
|
||||
emit('event-created')
|
||||
}
|
||||
|
||||
|
|
@ -363,7 +371,7 @@ const handleOpenChange = (open: boolean) => {
|
|||
|
||||
<ScrollArea class="max-h-[70vh] px-6 pb-6">
|
||||
<form @submit="onSubmit" class="space-y-4">
|
||||
<Alert v-if="willGoToPending" variant="default" class="border-orange-500/40 bg-orange-500/5">
|
||||
<Alert v-if="isEditMode && willLandInPending" variant="default" class="border-orange-500/40 bg-orange-500/5">
|
||||
<AlertCircle class="h-4 w-4 text-orange-500" />
|
||||
<AlertDescription>
|
||||
Saving will resubmit for approval. The event will be removed
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue