Agenda google, avisos globais, feriados + avisos globais, templates de email, configuracoes empresa, preview empresa.

This commit is contained in:
Leonardo
2026-03-18 15:47:37 -03:00
parent d6d2fe29d1
commit 29ed349cf2
21 changed files with 5366 additions and 41 deletions
+78 -2
View File
@@ -1,6 +1,6 @@
<!-- src/layout/AppTopbar.vue -->
<script setup>
import { computed, ref, onMounted, provide, nextTick } from 'vue'
import { computed, ref, onMounted, provide, nextTick, watch } from 'vue'
import { useRouter, useRoute } from 'vue-router'
import { useLayout } from '@/layout/composables/layout'
@@ -31,6 +31,7 @@ import { useUserSettingsPersistence } from '@/composables/useUserSettingsPersist
import { applyThemeEngine } from '@/theme/theme.options'
import { useTenantFeaturesStore } from '@/stores/tenantFeaturesStore'
import { fetchAllNotices } from '@/features/notices/noticeService'
const toast = useToast()
const entitlementsStore = useEntitlementsStore()
@@ -472,6 +473,21 @@ async function changePlanTo (newPlanId, newPlanKey, target) {
}
}
/* ----------------------------
SaaS — indicador de avisos ativos
----------------------------- */
const isSaasArea = computed(() => String(route.path || '').startsWith('/saas'))
const saasActiveCount = ref(0)
async function loadSaasNoticeCount () {
try {
const all = await fetchAllNotices()
saasActiveCount.value = all.filter(n => n.is_active).length
} catch { /* silencioso */ }
}
watch(isSaasArea, (is) => { if (is) loadSaasNoticeCount() }, { immediate: true })
/* ----------------------------
Logout
----------------------------- */
@@ -536,6 +552,20 @@ onMounted(async () => {
<span>Agência PSI</span>
</router-link>
<!-- Indicador de avisos globais ativos SaaS only -->
<router-link
v-if="isSaasArea && saasActiveCount > 0"
to="/saas/global-notices"
class="topbar-notice-chip ml-3"
:title="`${saasActiveCount} aviso(s) global(is) ativo(s)`"
>
<span class="topbar-notice-chip__dot" />
<i class="pi pi-megaphone topbar-notice-chip__icon" />
<span class="topbar-notice-chip__label">
{{ saasActiveCount }} aviso{{ saasActiveCount !== 1 ? 's' : '' }} ativo{{ saasActiveCount !== 1 ? 's' : '' }}
</span>
</router-link>
<!-- Pills: visíveis apenas em > 1200px -->
<div class="topbar-ctx-row ml-2">
<span
@@ -661,7 +691,7 @@ onMounted(async () => {
<style scoped>
.rail-topbar {
position: fixed;
top: 0;
top: var(--notice-banner-height, 0px);
left: 0;
right: 0;
height: 56px;
@@ -726,6 +756,52 @@ onMounted(async () => {
z-index: 200;
}
/* ── Chip de avisos ativos (SaaS) ────────────────────────── */
.topbar-notice-chip {
display: inline-flex;
align-items: center;
gap: 0.4rem;
padding: 0.28rem 0.75rem 0.28rem 0.55rem;
border-radius: 999px;
background: #f59e0b;
color: #fff;
font-size: 0.78rem;
font-weight: 700;
text-decoration: none;
white-space: nowrap;
flex-shrink: 0;
box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.55);
animation: topbar-notice-pulse 2s ease-in-out infinite;
transition: filter 0.15s;
}
.topbar-notice-chip:hover {
filter: brightness(1.1);
}
.topbar-notice-chip__dot {
width: 7px;
height: 7px;
border-radius: 50%;
background: #fff;
flex-shrink: 0;
animation: topbar-dot-blink 1.4s ease-in-out infinite;
}
.topbar-notice-chip__icon {
font-size: 0.8rem;
}
@keyframes topbar-notice-pulse {
0%, 100% { box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.55); }
50% { box-shadow: 0 0 0 6px rgba(245, 158, 11, 0); }
}
@keyframes topbar-dot-blink {
0%, 100% { opacity: 1; }
50% { opacity: 0.35; }
}
/* Mobile: oculta o texto, mantém ícone + dot */
@media (max-width: 600px) {
.topbar-notice-chip__label { display: none; }
.topbar-notice-chip { padding: 0.28rem 0.5rem; }
}
/* Badge de notificações */
.rail-topbar__notification-badge {
position: absolute;