refactor(events): expand eventType taxonomy with central config

Replaces the four-value enum (community/workshop/social/showcase) with
seven values: talk, workshop, community-meetup, coworking, peer-session,
skills-share, info-session. Default is now community-meetup.

Adds app/config/eventTypes.js as the single source of truth for value→label
mapping. Updates the model enum, seed scripts, and admin event list/filter
+ admin dashboard to read from it via EVENT_TYPES and eventTypeLabel().
This commit is contained in:
Jennie Robinson Faber 2026-05-21 17:50:40 +01:00
parent 31144617d7
commit 2ffaf0ef09
6 changed files with 54 additions and 24 deletions

View file

@ -16,15 +16,12 @@
<!-- Filters -->
<div class="filter-bar">
<div class="field" style="margin-bottom: 0; flex: 1;">
<input v-model="searchQuery" placeholder="Search events..." />
<input v-model="searchQuery" placeholder="Search events..." >
</div>
<div class="field" style="margin-bottom: 0;">
<select v-model="typeFilter">
<option value="all">All Types</option>
<option value="community">Community</option>
<option value="workshop">Workshop</option>
<option value="social">Social</option>
<option value="showcase">Showcase</option>
<option v-for="t in EVENT_TYPES" :key="t.value" :value="t.value">{{ t.label }}</option>
</select>
</div>
<div class="field" style="margin-bottom: 0;">
@ -71,7 +68,7 @@
<td class="col-title">
<div class="event-title-cell">
<div v-if="event.featureImage?.url && !event.featureImage?.publicId" class="event-thumb">
<img :src="event.featureImage.url" :alt="event.title" @error="handleImageError($event)" />
<img :src="event.featureImage.url" :alt="event.title" @error="handleImageError($event)" >
</div>
<div>
<span class="event-name">{{ event.title }}</span>
@ -89,7 +86,7 @@
</div>
</td>
<td>
<span class="badge" :class="event.eventType">{{ event.eventType }}</span>
<span class="badge" :class="event.eventType">{{ eventTypeLabel(event.eventType) }}</span>
</td>
<td class="col-date">
<span class="date-main">{{ formatDate(event) }}</span>
@ -128,9 +125,9 @@
</td>
<td class="col-actions">
<NuxtLink :to="`/events/${event.slug || String(event._id)}`" class="link-btn" title="View">View</NuxtLink>
<button @click="editEvent(event)" class="link-btn" title="Edit">Edit</button>
<button @click="duplicateEvent(event)" class="link-btn" title="Duplicate">Dup</button>
<button @click="deleteEvent(event)" class="link-btn link-btn-danger" title="Delete">Del</button>
<button class="link-btn" title="Edit" @click="editEvent(event)">Edit</button>
<button class="link-btn" title="Duplicate" @click="duplicateEvent(event)">Dup</button>
<button class="link-btn link-btn-danger" title="Delete" @click="deleteEvent(event)">Del</button>
</td>
</tr>
</tbody>
@ -169,7 +166,7 @@
<td class="col-title">
<div class="event-title-cell">
<div v-if="event.featureImage?.url && !event.featureImage?.publicId" class="event-thumb">
<img :src="event.featureImage.url" :alt="event.title" @error="handleImageError($event)" />
<img :src="event.featureImage.url" :alt="event.title" @error="handleImageError($event)" >
</div>
<div>
<span class="event-name">{{ event.title }}</span>
@ -187,7 +184,7 @@
</div>
</td>
<td>
<span class="badge" :class="event.eventType">{{ event.eventType }}</span>
<span class="badge" :class="event.eventType">{{ eventTypeLabel(event.eventType) }}</span>
</td>
<td class="col-date">
<span class="date-main">{{ formatDate(event) }}</span>
@ -226,9 +223,9 @@
</td>
<td class="col-actions">
<NuxtLink :to="`/events/${event.slug || String(event._id)}`" class="link-btn" title="View">View</NuxtLink>
<button @click="editEvent(event)" class="link-btn" title="Edit">Edit</button>
<button @click="duplicateEvent(event)" class="link-btn" title="Duplicate">Dup</button>
<button @click="deleteEvent(event)" class="link-btn link-btn-danger" title="Delete">Del</button>
<button class="link-btn" title="Edit" @click="editEvent(event)">Edit</button>
<button class="link-btn" title="Duplicate" @click="duplicateEvent(event)">Dup</button>
<button class="link-btn link-btn-danger" title="Delete" @click="deleteEvent(event)">Del</button>
</td>
</tr>
</tbody>
@ -267,6 +264,8 @@
</template>
<script setup>
import { EVENT_TYPES, eventTypeLabel } from '~/config/eventTypes'
definePageMeta({
layout: 'admin',
middleware: 'admin',