feat(announcements): Add support for archived announcements and add past announcement section in UI (#1382)

* feat(announcements): Add support for archived announcements and add past announcement section in UI

* Add missing field
This commit is contained in:
TwiN
2025-11-07 19:35:39 -05:00
committed by GitHub
parent 9e97efaba1
commit 607f3c5549
9 changed files with 501 additions and 22 deletions

View File

@@ -22,8 +22,8 @@
</Button>
</div>
</div>
<!-- Announcement Banner -->
<AnnouncementBanner :announcements="props.announcements" />
<!-- Announcement Banner (Active Announcements) -->
<AnnouncementBanner :announcements="activeAnnouncements" />
<!-- Search bar -->
<SearchBar
@search="handleSearch"
@@ -170,6 +170,11 @@
</Button>
</div>
</div>
<!-- Past Announcements Section -->
<div v-if="archivedAnnouncements.length > 0" class="mt-12 pb-8">
<PastAnnouncements :announcements="archivedAnnouncements" />
</div>
</div>
<Settings @refreshData="fetchData" />
@@ -187,6 +192,7 @@ import SearchBar from '@/components/SearchBar.vue'
import Settings from '@/components/Settings.vue'
import Loading from '@/components/Loading.vue'
import AnnouncementBanner from '@/components/AnnouncementBanner.vue'
import PastAnnouncements from '@/components/PastAnnouncements.vue'
import { SERVER_URL } from '@/main.js'
const props = defineProps({
@@ -196,6 +202,15 @@ const props = defineProps({
}
})
// Computed properties for active and archived announcements
const activeAnnouncements = computed(() => {
return props.announcements ? props.announcements.filter(a => !a.archived) : []
})
const archivedAnnouncements = computed(() => {
return props.announcements ? props.announcements.filter(a => a.archived) : []
})
const emit = defineEmits(['showTooltip'])
const endpointStatuses = ref([])