Add winner archive, host image upload and live demo data
Deliver the demo-ready feature set and seed data so the live site can be presented end to end: - Winner archive: ArchivedWinner domain, admin CRUD endpoints/view/manager and public archive surface, backed by AddArchivedWinners migration. - Host presentation: host image upload and artist name on SiteSettings with public image endpoint and supporting migrations. - Clip submissions: idempotent table-ensure migration plus current-season demo clips for review workflows. - Demo seed data: sponsors, share links and 2025 archived winners, with a guarded RemoveDemoSeasons cleanup; all seeds guard against real data. - EnsureRuntimeSchemaParity migration to align runtime schema defensively. - Admin/home UI refinements; remove unused team role permissions modal and dead share-quick-links code. All seed and schema migrations are idempotent (IF NOT EXISTS / ON CONFLICT) and skip when real season data is present. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -20,6 +20,7 @@ import {
|
||||
import type {
|
||||
ApproveNominationPayload,
|
||||
AddNominationLinkBlacklistEntryPayload,
|
||||
UpsertArchivedWinnerPayload,
|
||||
CreateSeasonPayload,
|
||||
CreateClipPayload,
|
||||
CreateNominationPayload,
|
||||
@@ -150,6 +151,7 @@ export const useAwardsStore = defineStore('awards', {
|
||||
this.adminOptionalFeatureSettings = createEmptyAdminOptionalFeatureSettings()
|
||||
this.adminWorkflowRules = createEmptyAdminWorkflowRulesResponse()
|
||||
this.adminTrackingRules = createEmptyAdminTrackingRulesResponse()
|
||||
this.adminArchivedWinners = []
|
||||
this.adminRiskHistory = []
|
||||
this.adminRiskFlagsPage = createEmptyAdminRiskFlagsResponse()
|
||||
this.adminRiskHistoryPage = createEmptyAdminRiskFlagsResponse()
|
||||
@@ -215,6 +217,7 @@ export const useAwardsStore = defineStore('awards', {
|
||||
this.adminSponsors = []
|
||||
this.adminShowactApplications = []
|
||||
this.adminWorkflowRules = createEmptyAdminWorkflowRulesResponse()
|
||||
this.adminArchivedWinners = []
|
||||
}
|
||||
},
|
||||
async initializeAdminWorkspace() {
|
||||
@@ -316,6 +319,25 @@ export const useAwardsStore = defineStore('awards', {
|
||||
await Promise.all([this.loadAdminExtras(seasonId), this.loadPublicSponsors(this.overview.year)])
|
||||
return result
|
||||
},
|
||||
async loadAdminArchivedWinners() {
|
||||
this.adminArchivedWinners = await api.getAdminArchivedWinners()
|
||||
return this.adminArchivedWinners
|
||||
},
|
||||
async createAdminArchivedWinner(payload: UpsertArchivedWinnerPayload) {
|
||||
const result = await api.createAdminArchivedWinner(payload)
|
||||
await Promise.all([this.loadAdminArchivedWinners(), this.loadHomeData()])
|
||||
return result
|
||||
},
|
||||
async updateAdminArchivedWinner(archivedWinnerId: number, payload: UpsertArchivedWinnerPayload) {
|
||||
const result = await api.updateAdminArchivedWinner(archivedWinnerId, payload)
|
||||
await Promise.all([this.loadAdminArchivedWinners(), this.loadHomeData()])
|
||||
return result
|
||||
},
|
||||
async deleteAdminArchivedWinner(archivedWinnerId: number) {
|
||||
const result = await api.deleteAdminArchivedWinner(archivedWinnerId)
|
||||
await Promise.all([this.loadAdminArchivedWinners(), this.loadHomeData()])
|
||||
return result
|
||||
},
|
||||
async updateAdminSponsor(sponsorId: number, seasonId: number, payload: UpsertSponsorPayload) {
|
||||
const result = await api.updateAdminSponsor(sponsorId, payload)
|
||||
await Promise.all([this.loadAdminExtras(seasonId), this.loadPublicSponsors(this.overview.year)])
|
||||
@@ -561,6 +583,11 @@ export const useAwardsStore = defineStore('awards', {
|
||||
await this.loadHomeData()
|
||||
return result
|
||||
},
|
||||
async uploadAdminHostImage(file: File) {
|
||||
this.adminSiteSettings = await api.uploadAdminHostImage(file)
|
||||
await this.loadHomeData()
|
||||
return this.adminSiteSettings
|
||||
},
|
||||
},
|
||||
})
|
||||
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import { ApiRequestError } from '../../lib/http'
|
||||
import type {
|
||||
AdminDashboardResponse,
|
||||
AdminArchivedWinnerItem,
|
||||
AdminOptionalFeatureSettingsResponse,
|
||||
AdminOperationalSettingsResponse,
|
||||
AdminRiskFlag,
|
||||
@@ -39,6 +40,8 @@ export function createEmptyOverview(): OverviewResponse {
|
||||
siteContent: {
|
||||
hostDisplayName: '',
|
||||
hostTagline: '',
|
||||
hostArtistName: '',
|
||||
hostImageUrl: '/assets/amaterasu2sei_2.png',
|
||||
newsletterUrl: '',
|
||||
shareXUrl: '',
|
||||
shareDiscordUrl: '',
|
||||
@@ -220,6 +223,8 @@ export function createEmptyAdminSiteSettings(): AdminSiteSettingsResponse {
|
||||
return {
|
||||
hostDisplayName: '',
|
||||
hostTagline: '',
|
||||
hostArtistName: '',
|
||||
hostImageUrl: '/assets/amaterasu2sei_2.png',
|
||||
newsletterUrl: '',
|
||||
shareXUrl: '',
|
||||
shareDiscordUrl: '',
|
||||
@@ -297,6 +302,7 @@ export function createAwardsState() {
|
||||
adminOptionalFeatureSettings: createEmptyAdminOptionalFeatureSettings(),
|
||||
adminWorkflowRules: createEmptyAdminWorkflowRulesResponse(),
|
||||
adminTrackingRules: createEmptyAdminTrackingRulesResponse(),
|
||||
adminArchivedWinners: [] as AdminArchivedWinnerItem[],
|
||||
adminSponsors: [] as AdminSponsorItem[],
|
||||
adminShowactApplications: [] as AdminShowactApplicationItem[],
|
||||
adminRiskHistory: [] as AdminRiskFlag[],
|
||||
@@ -331,6 +337,8 @@ export function normalizeSeasonDetail(detail: AdminSeasonDetailResponse): AdminS
|
||||
clipCompilationPlatform: candidate.clipCompilationPlatform ?? null,
|
||||
clipEmbedStatus: candidate.clipEmbedStatus ?? 'unchecked',
|
||||
streamerIdentityId: candidate.streamerIdentityId ?? null,
|
||||
avgViewers: candidate.avgViewers ?? null,
|
||||
votes: candidate.votes ?? 0,
|
||||
nominationTally: candidate.nominationTally ?? 0,
|
||||
})),
|
||||
pendingNominations: detail.pendingNominations ?? [],
|
||||
|
||||
Reference in New Issue
Block a user