fix: rename hasEngagedEcology → hasEngagedBoard in onboarding status, clean up stale ecology references

This commit is contained in:
Jennie Robinson Faber 2026-04-14 12:25:24 +01:00
parent 74b2287d48
commit a0f60bcdc0
8 changed files with 24 additions and 24 deletions

View file

@ -35,7 +35,7 @@
<div v-if="currentSuggestion.key === 'empty'" class="ow-prompt">&gt; look</div> <div v-if="currentSuggestion.key === 'empty'" class="ow-prompt">&gt; look</div>
<div v-if="currentSuggestion.key === 'empty'" class="ow-message ow-message--dim">{{ currentSuggestion.text }}</div> <div v-if="currentSuggestion.key === 'empty'" class="ow-message ow-message--dim">{{ currentSuggestion.text }}</div>
<!-- Recommendation (event, ecology, or wiki) --> <!-- Recommendation (event, board, or wiki) -->
<template v-if="currentSuggestion.key !== 'empty'"> <template v-if="currentSuggestion.key !== 'empty'">
<div class="ow-prompt">&gt; look</div> <div class="ow-prompt">&gt; look</div>
<div class="ow-message">{{ currentSuggestion.text }}</div> <div class="ow-message">{{ currentSuggestion.text }}</div>

View file

@ -144,9 +144,9 @@
</dd> </dd>
</div> </div>
<div class="meta-row"> <div class="meta-row">
<dt>Ecology Engaged</dt> <dt>Board Engaged</dt>
<dd :class="hasEcologyEngaged ? 'status-ok' : 'status-dim'"> <dd :class="hasBoardEngaged ? 'status-ok' : 'status-dim'">
{{ hasEcologyEngaged ? '✓ Complete' : '— Incomplete' }} {{ hasBoardEngaged ? '✓ Complete' : '— Incomplete' }}
</dd> </dd>
</div> </div>
<div class="meta-row"> <div class="meta-row">
@ -354,7 +354,7 @@ const hasProfileTags = computed(() => {
return m.craftTags?.length > 0 && m.board?.topics?.length > 0 return m.craftTags?.length > 0 && m.board?.topics?.length > 0
}) })
const hasEcologyEngaged = computed(() => { const hasBoardEngaged = computed(() => {
const m = member.value const m = member.value
if (!m) return false if (!m) return false
return m.onboarding?.boardPageVisited && m.board?.topics?.some( return m.onboarding?.boardPageVisited && m.board?.topics?.some(

View file

@ -53,7 +53,7 @@
<div <div
v-for="suggestion in filteredSuggestions" v-for="suggestion in filteredSuggestions"
:key="suggestion.member._id" :key="suggestion.member._id"
class="member-card ecology-card" class="member-card board-card"
> >
<div class="mc-head"> <div class="mc-head">
<div class="mc-avatar"> <div class="mc-avatar">
@ -246,7 +246,7 @@ const loadBoard = async () => {
const data = await getSuggestions() const data = await getSuggestions()
suggestions.value = data.suggestions || [] suggestions.value = data.suggestions || []
// Build ecology tag options from user's own topics // Build board tag options from user's own topics
const allCoopTags = cooperativeTagOptions.value const allCoopTags = cooperativeTagOptions.value
const myTopicSlugs = (memberData.value?.board?.topics || []).map((t) => t.tagSlug) const myTopicSlugs = (memberData.value?.board?.topics || []).map((t) => t.tagSlug)
boardTagOptions.value = myTopicSlugs.length boardTagOptions.value = myTopicSlugs.length

View file

@ -508,7 +508,7 @@ useHead({
} }
/* ==================================================== /* ====================================================
TWO-COLUMN: Craft Tags + Community Ecology TWO-COLUMN: Craft Tags + Board
==================================================== */ ==================================================== */
.profile-two-col { .profile-two-col {

View file

@ -5,10 +5,10 @@ import { requireAuth } from '../../utils/auth.js'
export default defineEventHandler(async (event) => { export default defineEventHandler(async (event) => {
const member = await requireAuth(event) const member = await requireAuth(event)
// Combine craft tags and cooperative ecology tags // Combine craft tags and board topic tags
const craftTags = member.craftTags || [] const craftTags = member.craftTags || []
const ecologyTags = (member.board?.topics || []).map(t => t.tagSlug) const boardTags = (member.board?.topics || []).map(t => t.tagSlug)
const memberTags = [...new Set([...craftTags, ...ecologyTags].filter(Boolean))] const memberTags = [...new Set([...craftTags, ...boardTags].filter(Boolean))]
if (!memberTags.length) { if (!memberTags.length) {
return [] return []

View file

@ -10,7 +10,7 @@ export default defineEventHandler(async (event) => {
const hasVisitedEvent = !!member.onboarding?.eventPageVisited const hasVisitedEvent = !!member.onboarding?.eventPageVisited
const topics = member.board?.topics || [] const topics = member.board?.topics || []
const hasEngagedEcology = const hasEngagedBoard =
!!member.onboarding?.boardPageVisited && !!member.onboarding?.boardPageVisited &&
topics.some((t) => ['help', 'interested', 'seeking'].includes(t.state)) topics.some((t) => ['help', 'interested', 'seeking'].includes(t.state))
@ -20,7 +20,7 @@ export default defineEventHandler(async (event) => {
goals: { goals: {
hasProfileTags, hasProfileTags,
hasVisitedEvent, hasVisitedEvent,
hasEngagedEcology, hasEngagedBoard,
hasClickedWiki, hasClickedWiki,
}, },
completedAt: member.onboarding?.completedAt || null, completedAt: member.onboarding?.completedAt || null,

View file

@ -5,10 +5,10 @@ import { requireAuth } from '../../utils/auth.js'
export default defineEventHandler(async (event) => { export default defineEventHandler(async (event) => {
const member = await requireAuth(event) const member = await requireAuth(event)
// Combine craft tags and cooperative ecology tags // Combine craft tags and board topic tags
const craftTags = member.craftTags || [] const craftTags = member.craftTags || []
const ecologyTags = (member.board?.topics || []).map(t => t.tagSlug) const boardTags = (member.board?.topics || []).map(t => t.tagSlug)
const memberTags = [...new Set([...craftTags, ...ecologyTags].filter(Boolean))] const memberTags = [...new Set([...craftTags, ...boardTags].filter(Boolean))]
if (!memberTags.length) { if (!memberTags.length) {
return [] return []

View file

@ -38,7 +38,7 @@ describe('GET /api/onboarding/status', () => {
goals: { goals: {
hasProfileTags: false, hasProfileTags: false,
hasVisitedEvent: false, hasVisitedEvent: false,
hasEngagedEcology: false, hasEngagedBoard: false,
hasClickedWiki: false, hasClickedWiki: false,
}, },
completedAt: null, completedAt: null,
@ -87,8 +87,8 @@ describe('GET /api/onboarding/status', () => {
expect(result.goals.hasProfileTags).toBe(false) expect(result.goals.hasProfileTags).toBe(false)
}) })
// 1.5: hasEngagedEcology true when visited AND has tag with engagement state // 1.5: hasEngagedBoard true when visited AND has tag with engagement state
it('hasEngagedEcology is true when page visited and has engaged topic', async () => { it('hasEngagedBoard is true when page visited and has engaged topic', async () => {
requireAuth.mockResolvedValue({ requireAuth.mockResolvedValue({
_id: 'member-1', _id: 'member-1',
craftTags: [], craftTags: [],
@ -106,11 +106,11 @@ describe('GET /api/onboarding/status', () => {
const event = createMockEvent({ method: 'GET', path: '/api/onboarding/status' }) const event = createMockEvent({ method: 'GET', path: '/api/onboarding/status' })
const result = await handler(event) const result = await handler(event)
expect(result.goals.hasEngagedEcology).toBe(true) expect(result.goals.hasEngagedBoard).toBe(true)
}) })
// 1.6: hasEngagedEcology false when visited but no engagement state // 1.6: hasEngagedBoard false when visited but no engagement state
it('hasEngagedEcology is false when page visited but no topics have engagement state', async () => { it('hasEngagedBoard is false when page visited but no topics have engagement state', async () => {
requireAuth.mockResolvedValue({ requireAuth.mockResolvedValue({
_id: 'member-1', _id: 'member-1',
craftTags: [], craftTags: [],
@ -126,7 +126,7 @@ describe('GET /api/onboarding/status', () => {
const event = createMockEvent({ method: 'GET', path: '/api/onboarding/status' }) const event = createMockEvent({ method: 'GET', path: '/api/onboarding/status' })
const result = await handler(event) const result = await handler(event)
expect(result.goals.hasEngagedEcology).toBe(false) expect(result.goals.hasEngagedBoard).toBe(false)
}) })
// 1.9: Maps stored booleans directly // 1.9: Maps stored booleans directly
@ -147,7 +147,7 @@ describe('GET /api/onboarding/status', () => {
const result = await handler(event) const result = await handler(event)
expect(result.goals.hasVisitedEvent).toBe(true) expect(result.goals.hasVisitedEvent).toBe(true)
expect(result.goals.hasEngagedEcology).toBe(false) expect(result.goals.hasEngagedBoard).toBe(false)
expect(result.goals.hasClickedWiki).toBe(true) expect(result.goals.hasClickedWiki).toBe(true)
}) })