Skip to content

Commit cbde255

Browse files
committed
fix: short text
1 parent 3f3cdc4 commit cbde255

File tree

4 files changed

+46
-3
lines changed

4 files changed

+46
-3
lines changed

frontend/app/api/generated.ts

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ export type Achievement = {
3434
imageCompleted: Scalars['String']['output'];
3535
imagePending: Scalars['String']['output'];
3636
name: Scalars['String']['output'];
37+
notificationText: Scalars['String']['output'];
3738
points: Scalars['Int']['output'];
3839
project: Project;
3940
};
@@ -261,6 +262,7 @@ export type ContentAchievement = Achievement & {
261262
items: Array<ContentItem>;
262263
name: Scalars['String']['output'];
263264
nextItem?: Maybe<ContentItem>;
265+
notificationText: Scalars['String']['output'];
264266
points: Scalars['Int']['output'];
265267
project: Project;
266268
totalItems: Scalars['Int']['output'];
@@ -322,6 +324,7 @@ export type CreateContentAchievementInput = {
322324
imagePending: Scalars['String']['input'];
323325
items: Array<ContentItemInput>;
324326
name: Scalars['String']['input'];
327+
notificationText: Scalars['String']['input'];
325328
points: Scalars['Int']['input'];
326329
projectId: Scalars['ID']['input'];
327330
};
@@ -357,6 +360,7 @@ export type CreateQuizAchievementInput = {
357360
imagePending: Scalars['String']['input'];
358361
minScorePercentage?: InputMaybe<Scalars['Int']['input']>;
359362
name: Scalars['String']['input'];
363+
notificationText: Scalars['String']['input'];
360364
points: Scalars['Int']['input'];
361365
projectId: Scalars['ID']['input'];
362366
quizId: Scalars['ID']['input'];
@@ -408,6 +412,7 @@ export type CreateSimpleAchievementInput = {
408412
imageCompleted: Scalars['String']['input'];
409413
imagePending: Scalars['String']['input'];
410414
name: Scalars['String']['input'];
415+
notificationText: Scalars['String']['input'];
411416
points: Scalars['Int']['input'];
412417
projectId: Scalars['ID']['input'];
413418
};
@@ -422,6 +427,7 @@ export type CreateStreakAchievementInput = {
422427
imagePending: Scalars['String']['input'];
423428
name: Scalars['String']['input'];
424429
neededStreak: Scalars['Int']['input'];
430+
notificationText: Scalars['String']['input'];
425431
points: Scalars['Int']['input'];
426432
projectId: Scalars['ID']['input'];
427433
streakId: Scalars['ID']['input'];
@@ -1689,6 +1695,7 @@ export type QuizAchievement = Achievement & {
16891695
imagePending: Scalars['String']['output'];
16901696
minScorePercentage?: Maybe<Scalars['Int']['output']>;
16911697
name: Scalars['String']['output'];
1698+
notificationText: Scalars['String']['output'];
16921699
points: Scalars['Int']['output'];
16931700
project: Project;
16941701
quiz: Quiz;
@@ -1887,6 +1894,7 @@ export type SimpleAchievement = Achievement & {
18871894
imageCompleted: Scalars['String']['output'];
18881895
imagePending: Scalars['String']['output'];
18891896
name: Scalars['String']['output'];
1897+
notificationText: Scalars['String']['output'];
18901898
points: Scalars['Int']['output'];
18911899
project: Project;
18921900
};
@@ -1940,6 +1948,7 @@ export type StreakAchievement = Achievement & {
19401948
imagePending: Scalars['String']['output'];
19411949
name: Scalars['String']['output'];
19421950
neededStreak: Scalars['Int']['output'];
1951+
notificationText: Scalars['String']['output'];
19431952
points: Scalars['Int']['output'];
19441953
project: Project;
19451954
streak: Streak;
@@ -2071,6 +2080,7 @@ export type UpdateAchievementInput = {
20712080
imageCompleted?: InputMaybe<Scalars['String']['input']>;
20722081
imagePending?: InputMaybe<Scalars['String']['input']>;
20732082
name?: InputMaybe<Scalars['String']['input']>;
2083+
notificationText?: InputMaybe<Scalars['String']['input']>;
20742084
points?: InputMaybe<Scalars['Int']['input']>;
20752085
};
20762086

@@ -2105,6 +2115,7 @@ export type UpdateContentAchievementInput = {
21052115
imagePending?: InputMaybe<Scalars['String']['input']>;
21062116
items?: InputMaybe<Array<ContentItemInput>>;
21072117
name?: InputMaybe<Scalars['String']['input']>;
2118+
notificationText?: InputMaybe<Scalars['String']['input']>;
21082119
points?: InputMaybe<Scalars['Int']['input']>;
21092120
};
21102121

@@ -2158,6 +2169,7 @@ export type UpdateStreakAchievementInput = {
21582169
imagePending?: InputMaybe<Scalars['String']['input']>;
21592170
name?: InputMaybe<Scalars['String']['input']>;
21602171
neededStreak?: InputMaybe<Scalars['Int']['input']>;
2172+
notificationText?: InputMaybe<Scalars['String']['input']>;
21612173
points?: InputMaybe<Scalars['Int']['input']>;
21622174
streakId?: InputMaybe<Scalars['ID']['input']>;
21632175
};
@@ -2610,7 +2622,7 @@ export type ChallengesPageQuery = { __typename?: 'Query', myCurrentProject: { __
26102622
export type ProfilePageQueryVariables = Exact<{ [key: string]: never; }>;
26112623

26122624

2613-
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, url?: string | null, managementType: ConsentManagementType, managedBy?: string | null, body: { __typename?: 'MarkdownText', html: string } }> } }, myCurrentProject: { __typename?: 'Project', id: string, name: string, achievements: Array<
2625+
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, shortText: string, url?: string | null, managementType: ConsentManagementType, managedBy?: string | null, body: { __typename?: 'MarkdownText', html: string } }> } }, myCurrentProject: { __typename?: 'Project', id: string, name: string, achievements: Array<
26142626
| { __typename?: 'ContentAchievement', id: string, name: string, descriptionPending: string, descriptionCompleted: string, imagePending: string, imageCompleted: string, hidden: boolean, achievedAt?: any | null, points: number }
26152627
| { __typename?: 'QuizAchievement', id: string, name: string, descriptionPending: string, descriptionCompleted: string, imagePending: string, imageCompleted: string, hidden: boolean, achievedAt?: any | null, points: number }
26162628
| { __typename?: 'SimpleAchievement', id: string, name: string, descriptionPending: string, descriptionCompleted: string, imagePending: string, imageCompleted: string, hidden: boolean, achievedAt?: any | null, points: number }
@@ -2620,7 +2632,7 @@ export type ProfilePageQuery = { __typename?: 'Query', me: { __typename?: 'User'
26202632
export type ConsentsPageQueryVariables = Exact<{ [key: string]: never; }>;
26212633

26222634

2623-
export type ConsentsPageQuery = { __typename?: 'Query', me: { __typename?: 'User', consentStatus: { __typename?: 'ConsentStatus', pendingConsents: Array<{ __typename: 'Consent', id: string, key: string, version: number, title: string, publishedAt?: any | null, managedBy?: string | null, managementType: ConsentManagementType, url?: string | null, body: { __typename?: 'MarkdownText', html: string } }>, acceptedConsents: Array<{ __typename: 'UserConsent', id: string, action: ConsentAction, actionDate: any, consent: { __typename?: 'Consent', id: string, title: string, managedBy?: string | null, managementType: ConsentManagementType, url?: string | null, body: { __typename?: 'MarkdownText', html: string } } }>, rejectedConsents: Array<{ __typename: 'UserConsent', id: string, action: ConsentAction, actionDate: any, consent: { __typename?: 'Consent', id: string, title: string, managedBy?: string | null, managementType: ConsentManagementType, url?: string | null, body: { __typename?: 'MarkdownText', html: string } } }> } } };
2635+
export type ConsentsPageQuery = { __typename?: 'Query', me: { __typename?: 'User', consentStatus: { __typename?: 'ConsentStatus', pendingConsents: Array<{ __typename: 'Consent', id: string, key: string, version: number, title: string, shortText: string, publishedAt?: any | null, managedBy?: string | null, managementType: ConsentManagementType, url?: string | null, body: { __typename?: 'MarkdownText', html: string } }>, acceptedConsents: Array<{ __typename: 'UserConsent', id: string, action: ConsentAction, actionDate: any, consent: { __typename?: 'Consent', id: string, title: string, shortText: string, managedBy?: string | null, managementType: ConsentManagementType, url?: string | null, body: { __typename?: 'MarkdownText', html: string } } }>, rejectedConsents: Array<{ __typename: 'UserConsent', id: string, action: ConsentAction, actionDate: any, consent: { __typename?: 'Consent', id: string, title: string, shortText: string, managedBy?: string | null, managementType: ConsentManagementType, url?: string | null, body: { __typename?: 'MarkdownText', html: string } } }> } } };
26242636

26252637
export type StandingsGlobalPageQueryVariables = Exact<{
26262638
entityType: LeaderboardEntityType;
@@ -3423,6 +3435,7 @@ export const ProfilePageDocument = gql`
34233435
body {
34243436
html
34253437
}
3438+
shortText
34263439
url
34273440
managementType
34283441
managedBy
@@ -3469,6 +3482,7 @@ export const ConsentsPageDocument = gql`
34693482
body {
34703483
html
34713484
}
3485+
shortText
34723486
publishedAt
34733487
managedBy
34743488
managementType
@@ -3483,6 +3497,7 @@ export const ConsentsPageDocument = gql`
34833497
body {
34843498
html
34853499
}
3500+
shortText
34863501
managedBy
34873502
managementType
34883503
url
@@ -3499,6 +3514,7 @@ export const ConsentsPageDocument = gql`
34993514
body {
35003515
html
35013516
}
3517+
shortText
35023518
managedBy
35033519
managementType
35043520
url

frontend/app/components/consent/ConsentCard.vue

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,13 @@ const body = computed(() => {
7373
return props.consent.body.html
7474
})
7575
76+
const shortText = computed(() => {
77+
if (props.consent.__typename == 'UserConsent') {
78+
return props.consent.consent.shortText
79+
}
80+
return props.consent.shortText
81+
})
82+
7683
const managedBy = computed(() => {
7784
if (props.consent.__typename == 'UserConsent') {
7885
return props.consent.consent.managedBy
@@ -105,7 +112,7 @@ const changing = ref(false)
105112
</p>
106113
<h3 class="text-title text-text-default pr-2">{{ title }}</h3>
107114
</div>
108-
<div class="text-label text-text-muted" v-html="body" />
115+
<div class="text-label text-text-muted" v-html="shortText" />
109116

110117
<template v-if="isRemote">
111118
<template v-if="localStatus === ConsentAction.Accepted">
@@ -158,6 +165,14 @@ const changing = ref(false)
158165
</DesignButton>
159166
</template>
160167
<template v-else-if="localStatus === ConsentAction.Accepted">
168+
<ConsentDetails :consent>
169+
<button
170+
class="text-label text-accent-contrast py-2 flex items-center gap-1"
171+
>
172+
{{ $t('consent.readButton') }}
173+
<Icon name="lucide:arrow-right" />
174+
</button>
175+
</ConsentDetails>
161176
<div class="flex justify-between items-center">
162177
<span class="text-label text-accent-positive flex items-center gap-1">
163178
<Icon name="lucide:check" class="size-6" />
@@ -180,6 +195,14 @@ const changing = ref(false)
180195
</div>
181196
</template>
182197
<template v-else-if="localStatus === ConsentAction.Rejected">
198+
<ConsentDetails :consent>
199+
<button
200+
class="text-label text-accent-contrast py-2 flex items-center gap-1"
201+
>
202+
{{ $t('consent.readButton') }}
203+
<Icon name="lucide:arrow-right" />
204+
</button>
205+
</ConsentDetails>
183206
<div class="flex justify-between items-center">
184207
<span class="text-label text-accent-negative flex items-center gap-1">
185208
<Icon name="lucide:x" class="size-6" />

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ query ProfilePage {
1212
body {
1313
html
1414
}
15+
shortText
1516
url
1617
managementType
1718
managedBy

frontend/app/graphql/queries/pages/settings/consent.gql

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ query ConsentsPage {
1010
body {
1111
html
1212
}
13+
shortText
1314
publishedAt
1415
managedBy
1516
managementType
@@ -24,6 +25,7 @@ query ConsentsPage {
2425
body {
2526
html
2627
}
28+
shortText
2729
managedBy
2830
managementType
2931
url
@@ -40,6 +42,7 @@ query ConsentsPage {
4042
body {
4143
html
4244
}
45+
shortText
4346
managedBy
4447
managementType
4548
url

0 commit comments

Comments
 (0)