fix(onboarding): fix widget links, isComplete logic, and event slugs
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:
parent
50a358b294
commit
e791a0d480
3 changed files with 8 additions and 8 deletions
|
|
@ -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 }} →
|
{{ currentSuggestion.actionText }} →
|
||||||
</a>
|
</a>
|
||||||
|
|
|
||||||
|
|
@ -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 {
|
||||||
|
|
|
||||||
|
|
@ -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)
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue