feat(#36): Notification rework with single and all comments mark as read
This commit is contained in:
@@ -22,9 +22,8 @@
|
||||
|
||||
<UTooltip :text="$t('notifications.tooltip')" :shortcuts="['N']">
|
||||
<UButton color="neutral" variant="ghost" square @click="isNotificationsSlideoverOpen = true">
|
||||
<UChip :show="unreadCount > 0" color="error" inset>
|
||||
<UChip :show="hasUnread" color="error" inset>
|
||||
<UIcon name="i-lucide-bell" class="size-5 shrink-0" />
|
||||
<span v-if="unreadCount > 0" class="ml-1 text-xs">{{ unreadCount }}</span>
|
||||
</UChip>
|
||||
</UButton>
|
||||
</UTooltip>
|
||||
@@ -144,9 +143,9 @@ const { organizations, selectedOrganization } = storeToRefs(userStore)
|
||||
const { t: $t } = useI18n()
|
||||
|
||||
// Inject notification state from layout
|
||||
const { isNotificationsSlideoverOpen, unreadCount } = inject('notificationState', {
|
||||
const { isNotificationsSlideoverOpen, hasUnread } = inject('notificationState', {
|
||||
isNotificationsSlideoverOpen: ref(false),
|
||||
unreadCount: ref(0)
|
||||
hasUnread: ref(false)
|
||||
})
|
||||
|
||||
const { data } = await useAsyncData<PagedApplicationFormDto>(
|
||||
|
||||
@@ -94,6 +94,8 @@
|
||||
<div class="space-y-3">
|
||||
<UCheckbox v-model="emailOnFormCreated" :label="$t('settings.email.onFormCreated')" />
|
||||
<UCheckbox v-model="emailOnFormSubmitted" :label="$t('settings.email.onFormSubmitted')" />
|
||||
<UCheckbox v-model="emailOnFormUpdated" :label="$t('settings.email.onFormUpdated')" />
|
||||
<UCheckbox v-model="emailOnCommentAdded" :label="$t('settings.email.onCommentAdded')" />
|
||||
</div>
|
||||
|
||||
<UButton :label="$t('common.save')" color="primary" :loading="isSaving" @click="saveEmailPreferences" />
|
||||
@@ -143,6 +145,8 @@ const colors = [
|
||||
const emailAddress = ref('')
|
||||
const emailOnFormCreated = ref(true)
|
||||
const emailOnFormSubmitted = ref(true)
|
||||
const emailOnFormUpdated = ref(true)
|
||||
const emailOnCommentAdded = ref(true)
|
||||
const isSaving = ref(false)
|
||||
|
||||
onMounted(async () => {
|
||||
@@ -152,6 +156,8 @@ onMounted(async () => {
|
||||
emailAddress.value = userData.email || ''
|
||||
emailOnFormCreated.value = userData.emailOnFormCreated ?? true
|
||||
emailOnFormSubmitted.value = userData.emailOnFormSubmitted ?? true
|
||||
emailOnFormUpdated.value = userData.emailOnFormUpdated ?? true
|
||||
emailOnCommentAdded.value = userData.emailOnCommentAdded ?? true
|
||||
} catch (error) {
|
||||
logger.error('Failed to load user email preferences:', error)
|
||||
}
|
||||
@@ -167,7 +173,9 @@ async function saveEmailPreferences() {
|
||||
userStore.user.keycloakId,
|
||||
emailAddress.value || null,
|
||||
emailOnFormCreated.value,
|
||||
emailOnFormSubmitted.value
|
||||
emailOnFormSubmitted.value,
|
||||
emailOnFormUpdated.value,
|
||||
emailOnCommentAdded.value
|
||||
)
|
||||
|
||||
toast.add({
|
||||
|
||||
Reference in New Issue
Block a user