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

View file

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

View file

@ -53,7 +53,7 @@
<div
v-for="suggestion in filteredSuggestions"
:key="suggestion.member._id"
class="member-card ecology-card"
class="member-card board-card"
>
<div class="mc-head">
<div class="mc-avatar">
@ -246,7 +246,7 @@ const loadBoard = async () => {
const data = await getSuggestions()
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 myTopicSlugs = (memberData.value?.board?.topics || []).map((t) => t.tagSlug)
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 {

View file

@ -5,10 +5,10 @@ import { requireAuth } from '../../utils/auth.js'
export default defineEventHandler(async (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 ecologyTags = (member.board?.topics || []).map(t => t.tagSlug)
const memberTags = [...new Set([...craftTags, ...ecologyTags].filter(Boolean))]
const boardTags = (member.board?.topics || []).map(t => t.tagSlug)
const memberTags = [...new Set([...craftTags, ...boardTags].filter(Boolean))]
if (!memberTags.length) {
return []

View file

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

View file

@ -5,10 +5,10 @@ import { requireAuth } from '../../utils/auth.js'
export default defineEventHandler(async (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 ecologyTags = (member.board?.topics || []).map(t => t.tagSlug)
const memberTags = [...new Set([...craftTags, ...ecologyTags].filter(Boolean))]
const boardTags = (member.board?.topics || []).map(t => t.tagSlug)
const memberTags = [...new Set([...craftTags, ...boardTags].filter(Boolean))]
if (!memberTags.length) {
return []

View file

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