2026-01-17 17:44:37 +00:00
|
|
|
<script setup lang="ts">
|
|
|
|
|
import { useForm } from '@inertiajs/vue3';
|
2026-01-21 22:35:49 +00:00
|
|
|
import { trans } from 'laravel-vue-i18n';
|
2026-01-17 17:44:37 +00:00
|
|
|
|
2026-05-06 17:26:18 +00:00
|
|
|
import HexColorInput from '@/components/HexColorInput.vue';
|
2026-01-17 17:44:37 +00:00
|
|
|
import { Button } from '@/components/ui/button';
|
|
|
|
|
import {
|
|
|
|
|
Dialog,
|
|
|
|
|
DialogContent,
|
|
|
|
|
DialogDescription,
|
|
|
|
|
DialogFooter,
|
|
|
|
|
DialogHeader,
|
|
|
|
|
DialogTitle,
|
|
|
|
|
} from '@/components/ui/dialog';
|
|
|
|
|
import { Input } from '@/components/ui/input';
|
|
|
|
|
import { Label } from '@/components/ui/label';
|
2026-03-29 22:43:15 +00:00
|
|
|
import { store as labelsStore } from '@/routes/app/labels';
|
2026-01-17 17:44:37 +00:00
|
|
|
|
|
|
|
|
const open = defineModel<boolean>('open', { default: false });
|
|
|
|
|
|
2026-05-06 17:26:18 +00:00
|
|
|
const DEFAULT_COLOR = '#7c3aed';
|
2026-01-17 17:44:37 +00:00
|
|
|
|
|
|
|
|
const form = useForm({
|
|
|
|
|
name: '',
|
2026-05-06 17:26:18 +00:00
|
|
|
color: DEFAULT_COLOR,
|
2026-01-17 17:44:37 +00:00
|
|
|
});
|
|
|
|
|
|
|
|
|
|
const submit = () => {
|
|
|
|
|
form.post(labelsStore.url(), {
|
|
|
|
|
onSuccess: () => {
|
|
|
|
|
open.value = false;
|
|
|
|
|
form.reset();
|
|
|
|
|
},
|
|
|
|
|
});
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
const handleOpenChange = (value: boolean) => {
|
|
|
|
|
if (value) {
|
|
|
|
|
form.reset();
|
2026-05-06 17:26:18 +00:00
|
|
|
form.color = DEFAULT_COLOR;
|
2026-01-17 17:44:37 +00:00
|
|
|
form.clearErrors();
|
|
|
|
|
}
|
|
|
|
|
open.value = value;
|
|
|
|
|
};
|
|
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
<template>
|
|
|
|
|
<Dialog :open="open" @update:open="handleOpenChange">
|
2026-03-31 00:18:07 +00:00
|
|
|
<DialogContent class="sm:max-w-lg">
|
2026-01-17 17:44:37 +00:00
|
|
|
<DialogHeader>
|
2026-01-21 22:35:49 +00:00
|
|
|
<DialogTitle>{{ $t('labels.create.title') }}</DialogTitle>
|
2026-01-17 17:44:37 +00:00
|
|
|
<DialogDescription>
|
2026-01-21 22:35:49 +00:00
|
|
|
{{ $t('labels.create.description') }}
|
2026-01-17 17:44:37 +00:00
|
|
|
</DialogDescription>
|
|
|
|
|
</DialogHeader>
|
2026-03-31 00:18:07 +00:00
|
|
|
<form @submit.prevent="submit" class="space-y-6">
|
2026-01-17 17:44:37 +00:00
|
|
|
<div class="space-y-2">
|
2026-01-21 22:35:49 +00:00
|
|
|
<Label for="create-name">{{ $t('labels.create.name') }}</Label>
|
2026-01-17 17:44:37 +00:00
|
|
|
<Input
|
|
|
|
|
id="create-name"
|
|
|
|
|
v-model="form.name"
|
2026-01-21 22:35:49 +00:00
|
|
|
:placeholder="trans('labels.create.name_placeholder')"
|
2026-01-17 17:44:37 +00:00
|
|
|
:class="{ 'border-destructive': form.errors.name }"
|
|
|
|
|
/>
|
|
|
|
|
<p v-if="form.errors.name" class="text-sm text-destructive">
|
|
|
|
|
{{ form.errors.name }}
|
|
|
|
|
</p>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div class="space-y-2">
|
2026-05-06 17:26:18 +00:00
|
|
|
<Label for="create-color">{{ $t('labels.create.color') }}</Label>
|
|
|
|
|
<HexColorInput v-model="form.color" name="color" />
|
2026-01-17 17:44:37 +00:00
|
|
|
<p v-if="form.errors.color" class="text-sm text-destructive">
|
|
|
|
|
{{ form.errors.color }}
|
|
|
|
|
</p>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<DialogFooter>
|
|
|
|
|
<Button type="submit" :disabled="form.processing">
|
2026-01-21 22:35:49 +00:00
|
|
|
{{ form.processing ? $t('labels.create.submitting') : $t('labels.create.submit') }}
|
2026-01-17 17:44:37 +00:00
|
|
|
</Button>
|
refactor: notification preferences, header slots, calendar layout, UI polish
Notification preferences:
- Create notification_preferences table (post_published, post_failed,
account_disconnected booleans per user)
- NotificationPreferenceController with firstOrCreate on first visit
- SendNotification job respects email preferences before sending
- Settings page with toggle switches, i18n in 3 languages
- 8 new tests for preferences (controller + wantsEmailFor + job integration)
Post published notification:
- PostPublished mail + maizzle template
- Notify owner on successful publish via SendNotification job
- PostPublished type added to notification enum
Header & Layout:
- Rename AppSidebarHeader to AppHeader with left/center/right slots
- showSidebarTrigger prop to hide sidebar toggle
- Calendar: controls in header (left: nav, center: date, right: tabs + new post)
- Fixed header with scrollable content (flex h-screen pattern)
- fullWidth pages use overflow-y-auto (fixes month view scroll)
UI improvements:
- Action buttons moved to header-right: posts, hashtags, labels
- Settings breadcrumbs: "Settings > Profile" pattern
- Calendar: remove duplicate New Post button from day view
- Remove size="sm" from Schedule/Publish buttons
- Remove bg-background from header (inherits from SidebarInset)
- Add Cancel button to labels and hashtags create/edit dialogs
- Add common.cancel i18n key
- Clean up orphaned Calendar breadcrumbs
- Fix SocialAccountsGrid buttons to use shadcn Button ghost
All 753 tests passing.
2026-03-30 21:18:17 +00:00
|
|
|
<Button type="button" variant="secondary" @click="open = false">
|
|
|
|
|
{{ $t('common.cancel') }}
|
|
|
|
|
</Button>
|
2026-01-17 17:44:37 +00:00
|
|
|
</DialogFooter>
|
|
|
|
|
</form>
|
|
|
|
|
</DialogContent>
|
|
|
|
|
</Dialog>
|
|
|
|
|
</template>
|