Skip to content

Commit 1f2a5e2

Browse files
committed
feat: show consents in project card
1 parent 83d3607 commit 1f2a5e2

File tree

4 files changed

+16
-3
lines changed

4 files changed

+16
-3
lines changed

frontend/app/api/generated.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2499,7 +2499,7 @@ export type ChallengesPageQuery = { __typename?: 'Query', myCurrentProject: { __
24992499
export type ProfilePageQueryVariables = Exact<{ [key: string]: never; }>;
25002500

25012501

2502-
export type ProfilePageQuery = { __typename?: 'Query', me: { __typename?: 'User', id: string, name: string, consentStatus: { __typename?: 'ConsentStatus', pendingConsents: Array<{ __typename: 'Consent', id: string, key: string, version: number, title: string, managementType: ConsentManagementType, body: { __typename?: 'MarkdownText', html: string } }> } }, myCurrentProject: { __typename?: 'Project', id: string, name: string, achievements: Array<
2502+
export type ProfilePageQuery = { __typename?: 'Query', me: { __typename?: 'User', id: string, name: string, consentStatus: { __typename?: 'ConsentStatus', pendingConsents: Array<{ __typename: 'Consent', id: string, key: string, version: number, title: string, managementType: ConsentManagementType, managedBy?: string | null, body: { __typename?: 'MarkdownText', html: string } }> } }, myCurrentProject: { __typename?: 'Project', id: string, name: string, achievements: Array<
25032503
| { __typename?: 'ListeningAchievement', id: string, name: string, description: string, image?: string | null, hidden: boolean, achievedAt?: any | null, points: number }
25042504
| { __typename?: 'QuizAchievement', id: string, name: string, description: string, image?: string | null, hidden: boolean, achievedAt?: any | null, points: number }
25052505
| { __typename?: 'ReadingAchievement', id: string, name: string, description: string, image?: string | null, hidden: boolean, achievedAt?: any | null, points: number }
@@ -3218,6 +3218,7 @@ export const ProfilePageDocument = gql`
32183218
html
32193219
}
32203220
managementType
3221+
managedBy
32213222
}
32223223
}
32233224
}

frontend/app/components/profile/ProfileProjectCard.vue

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ defineProps<{
3434
</ProfileGetPoints>
3535
</div>
3636
</div>
37+
<slot />
3738
<div class="p-medium gap-medium grid grid-cols-4">
3839
<AchievementBadge
3940
v-for="achievement in achievements"

frontend/app/graphql/queries/pages/profile.gql

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ query ProfilePage {
1313
html
1414
}
1515
managementType
16+
managedBy
1617
}
1718
}
1819
}

frontend/app/pages/index.vue

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,14 +29,24 @@ watch(
2929
<LoadingState v-if="fetching" />
3030
<ErrorState v-else-if="error" :error />
3131
<div v-else-if="data" class="space-y-list-section-gap">
32-
<ConsentBanner v-if="showBanner" />
3332
<ProfileProjectCard
3433
v-if="data.myCurrentProject"
3534
:project-name="data.myCurrentProject.name"
3635
:score="data.myCurrentProject.leaderboard.me?.score"
3736
:rank="data.myCurrentProject.leaderboard.me?.rank"
3837
:achievements="data.myCurrentProject.achievements"
39-
/>
38+
>
39+
<div v-if="showBanner" class="p-small">
40+
<ConsentCard
41+
v-for="consent in data.me.consentStatus.pendingConsents.filter(
42+
(c) => c.managementType === ConsentManagementType.Remote,
43+
)"
44+
:key="consent.id"
45+
:consent
46+
class="bg-background-indent!"
47+
/>
48+
</div>
49+
</ProfileProjectCard>
4050
</div>
4151
</PageLayout>
4252
</template>

0 commit comments

Comments
 (0)