fix(onboarding): fix widget links, isComplete logic, and event slugs
Some checks failed
Test / vitest (push) Successful in 10m44s
Test / playwright (push) Failing after 9m15s
Test / visual (push) Failing after 9m7s
Test / Notify on failure (push) Successful in 2s

Use dynamic href for external links, check completedAt for graduation,
link events by slug instead of _id, and remove stale click handler.
This commit is contained in:
Jennie Robinson Faber 2026-04-09 23:52:04 +01:00
parent 50a358b294
commit e791a0d480
3 changed files with 8 additions and 8 deletions

View file

@ -19,7 +19,7 @@
</NuxtLink> </NuxtLink>
<a <a
v-else-if="currentSuggestion.isExternal" v-else-if="currentSuggestion.isExternal"
href="https://wiki.ghostguild.org" :href="currentSuggestion.action"
target="_blank" target="_blank"
rel="noopener" rel="noopener"
class="btn btn-primary ow-action" class="btn btn-primary ow-action"
@ -83,7 +83,6 @@
target="_blank" target="_blank"
rel="noopener" rel="noopener"
class="ow-rec-link" class="ow-rec-link"
@click="trackGoal('wikiClicked')"
> >
{{ currentSuggestion.actionText }} &rarr; {{ currentSuggestion.actionText }} &rarr;
</a> </a>

View file

@ -22,10 +22,11 @@ export function useOnboarding(options = {}) {
const _fetched = useState('onboarding._fetched', () => false) const _fetched = useState('onboarding._fetched', () => false)
const isComplete = computed(() => const isComplete = computed(() =>
goals.value.hasProfileTags && !!completedAt.value ||
(goals.value.hasProfileTags &&
goals.value.hasVisitedEvent && goals.value.hasVisitedEvent &&
goals.value.hasEngagedEcology && goals.value.hasEngagedEcology &&
goals.value.hasClickedWiki goals.value.hasClickedWiki)
) )
const pickCategory = options.pickCategory || ((categories) => { const pickCategory = options.pickCategory || ((categories) => {
@ -63,7 +64,7 @@ export function useOnboarding(options = {}) {
return { return {
key: 'wiki', key: 'wiki',
text: 'Browse the wiki for resources and guides', text: 'Browse the wiki for resources and guides',
action: null, action: 'https://wiki.ghostguild.org',
actionText: 'Browse wiki', actionText: 'Browse wiki',
isExternal: true, isExternal: true,
} }
@ -101,7 +102,7 @@ export function useOnboarding(options = {}) {
return { return {
key: 'event', key: 'event',
text: `Upcoming event: ${item.title}`, text: `Upcoming event: ${item.title}`,
action: `/events/${item._id}`, action: `/events/${item.slug}`,
actionText: 'View event', actionText: 'View event',
} }
} }
@ -139,7 +140,7 @@ export function useOnboarding(options = {}) {
_fetched.value = true _fetched.value = true
// If graduated, fetch recommendations // If graduated, fetch recommendations
if (isComplete.value) { if (completedAt.value) {
await fetchRecommendations() await fetchRecommendations()
} }
} catch { } catch {

View file

@ -233,7 +233,7 @@ describe('useOnboarding', () => {
}) })
expect(currentSuggestion.value.key).toBe('wiki') expect(currentSuggestion.value.key).toBe('wiki')
expect(currentSuggestion.value.action).toBeNull() expect(currentSuggestion.value.action).toBe('https://wiki.ghostguild.org')
expect(currentSuggestion.value.isExternal).toBe(true) expect(currentSuggestion.value.isExternal).toBe(true)
}) })