From be76a495e6a6197d0b9cc9d24cfa3db9ea315452 Mon Sep 17 00:00:00 2001 From: Henry Date: Thu, 5 Jun 2025 13:37:28 -0400 Subject: [PATCH 1/6] feat(opencollective): added open collective option for auth --- src/components.d.ts | 1 + src/components/auth/VoAuthCard.vue | 6 ++-- src/components/auth/VoAuthListItem.vue | 4 ++- src/components/auth/VoAuthOpenCollective.vue | 38 ++++++++++++++++++++ src/stores/auth.ts | 2 +- 5 files changed, 47 insertions(+), 4 deletions(-) create mode 100644 src/components/auth/VoAuthOpenCollective.vue diff --git a/src/components.d.ts b/src/components.d.ts index 7448e43..002735a 100644 --- a/src/components.d.ts +++ b/src/components.d.ts @@ -18,6 +18,7 @@ declare module 'vue' { VoAuthGithub: typeof import('./components/auth/VoAuthGithub.vue')['default'] VoAuthListItem: typeof import('./components/auth/VoAuthListItem.vue')['default'] VoAuthLogoutNavItem: typeof import('./components/auth/VoAuthLogoutNavItem.vue')['default'] + VoAuthOpenCollective: typeof import('./components/auth/VoAuthOpenCollective.vue')['default'] VoAuthShopify: typeof import('./components/auth/VoAuthShopify.vue')['default'] VoBtn: typeof import('./components/app/VoBtn.vue')['default'] VoCard: typeof import('./components/app/VoCard.vue')['default'] diff --git a/src/components/auth/VoAuthCard.vue b/src/components/auth/VoAuthCard.vue index 7108cde..eb60a4f 100644 --- a/src/components/auth/VoAuthCard.vue +++ b/src/components/auth/VoAuthCard.vue @@ -33,11 +33,13 @@ - + + + - diff --git a/src/components/auth/VoAuthListItem.vue b/src/components/auth/VoAuthListItem.vue index b77a548..cf1d092 100644 --- a/src/components/auth/VoAuthListItem.vue +++ b/src/components/auth/VoAuthListItem.vue @@ -46,6 +46,8 @@ + + @@ -54,7 +56,7 @@ diff --git a/src/stores/auth.ts b/src/stores/auth.ts index 50adfb0..da6dc1a 100644 --- a/src/stores/auth.ts +++ b/src/stores/auth.ts @@ -139,7 +139,7 @@ export const useAuthStore = defineStore('auth', (): AuthState => { verify.promise = null as Promise | null - async function login (provider: 'github' | 'discord' | 'shopify' = 'github') { + async function login (provider: 'github' | 'discord' | 'shopify' | 'opencollective' = 'github') { isLoading.value = true const redirectUrl = `${http.url}/auth/${provider}/redirect` From 14ad2328948f5e2f521f8fdacd73a2787995086b Mon Sep 17 00:00:00 2001 From: Henry Date: Mon, 9 Jun 2025 08:38:03 -0400 Subject: [PATCH 2/6] feat(opencollective): added open collective option on sponsorships dropdown --- src/components.d.ts | 1 + .../sponsorships/VoSponsorshipsTimeline.vue | 4 +++- .../sponsorships/VoSponsorshipsTimelineItem.vue | 7 ++++--- .../VoSponsorshipsTimelineItemOpencollective.vue | 13 +++++++++++++ src/stores/one.ts | 6 ++++++ 5 files changed, 27 insertions(+), 4 deletions(-) create mode 100644 src/components/sponsorships/VoSponsorshipsTimelineItemOpencollective.vue diff --git a/src/components.d.ts b/src/components.d.ts index 002735a..613bce7 100644 --- a/src/components.d.ts +++ b/src/components.d.ts @@ -61,6 +61,7 @@ declare module 'vue' { VoSponsorshipsTimelineItemDiscord: typeof import('./components/sponsorships/VoSponsorshipsTimelineItemDiscord.vue')['default'] VoSponsorshipsTimelineItemGithub: typeof import('./components/sponsorships/VoSponsorshipsTimelineItemGithub.vue')['default'] VoSponsorshipsTimelineItemOne: typeof import('./components/sponsorships/VoSponsorshipsTimelineItemOne.vue')['default'] + VoSponsorshipsTimelineItemOpencollective: typeof import('./components/sponsorships/VoSponsorshipsTimelineItemOpencollective.vue')['default'] VoSpot: typeof import('./components/spots/VoSpot.vue')['default'] VoStudioDialog: typeof import('./components/studio/VoStudioDialog.vue')['default'] VoStudioNavItem: typeof import('./components/studio/VoStudioNavItem.vue')['default'] diff --git a/src/components/sponsorships/VoSponsorshipsTimeline.vue b/src/components/sponsorships/VoSponsorshipsTimeline.vue index 7223ea5..2908012 100644 --- a/src/components/sponsorships/VoSponsorshipsTimeline.vue +++ b/src/components/sponsorships/VoSponsorshipsTimeline.vue @@ -11,9 +11,11 @@ + + diff --git a/src/components/sponsorships/VoSponsorshipsTimelineItem.vue b/src/components/sponsorships/VoSponsorshipsTimelineItem.vue index c73a506..a7e7013 100644 --- a/src/components/sponsorships/VoSponsorshipsTimelineItem.vue +++ b/src/components/sponsorships/VoSponsorshipsTimelineItem.vue @@ -52,7 +52,7 @@ diff --git a/src/components/sponsorships/VoSponsorshipsTimelineItemOpencollective.vue b/src/components/sponsorships/VoSponsorshipsTimelineItemOpencollective.vue new file mode 100644 index 0000000..121fa10 --- /dev/null +++ b/src/components/sponsorships/VoSponsorshipsTimelineItemOpencollective.vue @@ -0,0 +1,13 @@ + + + diff --git a/src/stores/one.ts b/src/stores/one.ts index 325106d..c9ee3ce 100644 --- a/src/stores/one.ts +++ b/src/stores/one.ts @@ -52,6 +52,7 @@ interface OneState { github: ComputedRef discord: ComputedRef shopify: ComputedRef + opencollective: ComputedRef one: ComputedRef activate: () => Promise @@ -107,6 +108,9 @@ export const useOneStore = defineStore('one', (): OneState => { const discord = computed(() => { return auth.user?.sponsorships.find(s => s.platform === 'discord' && s.isActive) }) + const opencollective = computed(() => { + return auth.user?.sponsorships.find(s => s.platform === 'opencollective' && s.isActive) + }) const shopify = computed(() => { return auth.user?.identities.find(i => i.provider === 'shopify') }) @@ -117,6 +121,7 @@ export const useOneStore = defineStore('one', (): OneState => { || subscription.value?.isActive || github.value?.isActive || discord.value?.isActive + || opencollective.value?.isActive || monthlyTotal.value >= 2.99 )) @@ -299,6 +304,7 @@ export const useOneStore = defineStore('one', (): OneState => { isOpen, isSubscriber, + opencollective, github, discord, shopify, From 0fce1775c362ca7a7217f0309742dd69399c3357 Mon Sep 17 00:00:00 2001 From: Henry Date: Mon, 9 Jun 2025 08:49:44 -0400 Subject: [PATCH 3/6] fix(auth): typing --- src/stores/auth.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/stores/auth.ts b/src/stores/auth.ts index da6dc1a..03d7eb9 100644 --- a/src/stores/auth.ts +++ b/src/stores/auth.ts @@ -41,7 +41,7 @@ export interface AuthState { isLoading: ShallowRef verify: (force?: boolean) => Promise findIdentity: (provider: string) => VOneIdentity | undefined - login: (provider?: 'github' | 'discord' | 'shopify') => Promise + login: (provider?: 'github' | 'discord' | 'shopify' | 'opencollective') => Promise logout: (identity?: string) => Promise lastLoginProvider: () => string | null sync: () => Promise From 481e551b05905b6299a705e5c138ae046b4f1ff2 Mon Sep 17 00:00:00 2001 From: Henry Date: Mon, 9 Jun 2025 09:06:14 -0400 Subject: [PATCH 4/6] fix(authopencollective): color --- src/components/auth/VoAuthOpenCollective.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/auth/VoAuthOpenCollective.vue b/src/components/auth/VoAuthOpenCollective.vue index 0943ac6..2288dda 100644 --- a/src/components/auth/VoAuthOpenCollective.vue +++ b/src/components/auth/VoAuthOpenCollective.vue @@ -1,6 +1,6 @@