Skip to content

Commit 587e27f

Browse files
committed
refactor: move some page queries into separate files
1 parent 9c37ea3 commit 587e27f

File tree

15 files changed

+602
-526
lines changed

15 files changed

+602
-526
lines changed

frontend/app/api/generated.ts

Lines changed: 372 additions & 322 deletions
Large diffs are not rendered by default.

frontend/app/components/standings/StandingsGlobal.vue

Lines changed: 0 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,4 @@
11
<script setup lang="ts">
2-
gql(`
3-
query StandingsGlobalPage($entityType: LeaderboardEntityType!, $filter: LeaderboardFilter, $first: Int) {
4-
myCurrentProject {
5-
id
6-
leaderboard(entityType: $entityType, filter: $filter, first: $first) {
7-
edges {
8-
node {
9-
id
10-
name
11-
description
12-
score
13-
rank
14-
tags
15-
}
16-
}
17-
me {
18-
id
19-
name
20-
description
21-
score
22-
rank
23-
tags
24-
}
25-
}
26-
}
27-
}
28-
`)
29-
302
const { isAuthReady } = useAuthReady()
313
const { data, error, fetching } = useStandingsGlobalPageQuery({
324
variables: computed(() => ({

frontend/app/components/standings/StandingsLocal.vue

Lines changed: 0 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,4 @@
11
<script setup lang="ts">
2-
gql(`
3-
query StandingsLocalPage($entityType: LeaderboardEntityType!, $filter: LeaderboardFilter) {
4-
me {
5-
church {
6-
id
7-
name
8-
}
9-
}
10-
myCurrentProject {
11-
id
12-
leaderboard(entityType: $entityType, filter: $filter) {
13-
edges {
14-
node {
15-
id
16-
name
17-
score
18-
rank
19-
tags
20-
}
21-
}
22-
me {
23-
id
24-
name
25-
score
26-
rank
27-
tags
28-
}
29-
}
30-
}
31-
}
32-
`)
33-
342
const entityType = ref(LeaderboardEntityType.Persons)
353
364
const { me } = useAuth()

frontend/app/components/standings/StandingsUnit.vue

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,4 @@
11
<script setup lang="ts">
2-
gql(`
3-
query StandingsUnitPage {
4-
myCurrentProject {
5-
id
6-
myTeam {
7-
id
8-
name
9-
memberLeaderboard {
10-
id
11-
name
12-
tags
13-
rank
14-
score
15-
}
16-
}
17-
}
18-
}
19-
`)
20-
212
const { isTeamLead } = useAuth()
223
const { isAuthReady } = useAuthReady()
234
const { data, error, fetching } = useStandingsUnitPageQuery({
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
query ChallengePage($challengeId: ID!) {
2+
challenge(id: $challengeId) {
3+
__typename
4+
id
5+
name
6+
description
7+
... on SimpleChallenge {
8+
allowSelfCompletion
9+
}
10+
... on ExternalChallenge {
11+
url
12+
}
13+
... on QuizChallenge {
14+
quiz {
15+
id
16+
name
17+
description
18+
timeoutSeconds
19+
randomizeQuestions
20+
revealCorrectAnswers
21+
allowRetakes
22+
completionPoints
23+
publishedAt
24+
endTime
25+
userCanStart
26+
userSubmissions {
27+
id
28+
startedAt
29+
completedAt
30+
expiresAt
31+
isExpired
32+
score
33+
maxScore
34+
scorePercentage
35+
scorePercentage
36+
orderedQuestions {
37+
id
38+
questionText
39+
questionOrder
40+
timeoutSeconds
41+
}
42+
responses {
43+
id
44+
answeredAt
45+
timeSpentSeconds
46+
}
47+
}
48+
}
49+
}
50+
}
51+
}
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
query ChallengesPage {
2+
myCurrentProject {
3+
challenges {
4+
id
5+
name
6+
description
7+
image
8+
buttonText
9+
publishedAt
10+
endTime
11+
visibleAt
12+
}
13+
}
14+
}
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
query ProfilePage {
2+
me {
3+
id
4+
name
5+
consentStatus {
6+
pendingConsents {
7+
__typename
8+
id
9+
key
10+
version
11+
title
12+
body {
13+
html
14+
}
15+
managementType
16+
}
17+
}
18+
}
19+
myCurrentProject {
20+
id
21+
name
22+
achievements {
23+
id
24+
name
25+
description
26+
image
27+
hidden
28+
achievedAt
29+
points
30+
}
31+
leaderboard(entityType: PERSONS) {
32+
me {
33+
score
34+
rank
35+
}
36+
}
37+
}
38+
}
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
query ConsentsPage {
2+
me {
3+
consentStatus {
4+
pendingConsents {
5+
__typename
6+
id
7+
key
8+
version
9+
title
10+
body {
11+
html
12+
}
13+
publishedAt
14+
managedBy
15+
managementType
16+
url
17+
}
18+
acceptedConsents {
19+
__typename
20+
id
21+
consent {
22+
title
23+
body {
24+
html
25+
}
26+
managedBy
27+
managementType
28+
url
29+
}
30+
action
31+
actionDate
32+
}
33+
rejectedConsents {
34+
__typename
35+
id
36+
consent {
37+
title
38+
body {
39+
html
40+
}
41+
managedBy
42+
managementType
43+
url
44+
}
45+
action
46+
actionDate
47+
}
48+
}
49+
}
50+
}
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
query StandingsGlobalPage(
2+
$entityType: LeaderboardEntityType!
3+
$filter: LeaderboardFilter
4+
$first: Int
5+
) {
6+
myCurrentProject {
7+
id
8+
leaderboard(entityType: $entityType, filter: $filter, first: $first) {
9+
edges {
10+
node {
11+
id
12+
name
13+
description
14+
score
15+
rank
16+
tags
17+
}
18+
}
19+
me {
20+
id
21+
name
22+
description
23+
score
24+
rank
25+
tags
26+
}
27+
}
28+
}
29+
}
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
query StandingsLocalPage(
2+
$entityType: LeaderboardEntityType!
3+
$filter: LeaderboardFilter
4+
) {
5+
me {
6+
church {
7+
id
8+
name
9+
}
10+
}
11+
myCurrentProject {
12+
id
13+
leaderboard(entityType: $entityType, filter: $filter) {
14+
edges {
15+
node {
16+
id
17+
name
18+
score
19+
rank
20+
tags
21+
}
22+
}
23+
me {
24+
id
25+
name
26+
score
27+
rank
28+
tags
29+
}
30+
}
31+
}
32+
}

0 commit comments

Comments
 (0)