From 7303a67c9ff0651a3c59d2cf4e9203808902a226 Mon Sep 17 00:00:00 2001 From: Oliver Braun Date: Wed, 22 Jul 2026 17:49:59 +0200 Subject: [PATCH] feat: open access to any authenticated user, remove ZPA students page MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit glabs-web no longer has a login allowlist — the auth proxy (hm.edu) is the sole access boundary, so the "Kein Zutritt" gate in hooks.server.ts checked a rule that no longer exists. Drop the gate; keep only the auth-context setup that forwards X-Remote-User to the backend. Remove the ZPA-enriched students page (courses/[name]/students) and its link. The backend no longer exposes courseStudents / CourseStudent; schema.graphql and the codegen output are pulled fresh to match. The roster editor (setCourseStudents) is untouched. Co-Authored-By: Claude Opus 4.8 (1M context) --- schema.graphql | 26 ---- src/hooks.server.ts | 137 +----------------- src/lib/gql/gql.ts | 12 -- src/lib/gql/graphql.ts | 14 -- src/routes/courses/[name]/+page.svelte | 7 - .../courses/[name]/students/+page.server.ts | 33 ----- .../courses/[name]/students/+page.svelte | 55 ------- 7 files changed, 7 insertions(+), 277 deletions(-) delete mode 100644 src/routes/courses/[name]/students/+page.server.ts delete mode 100644 src/routes/courses/[name]/students/+page.svelte diff --git a/schema.graphql b/schema.graphql index 693dd94..076df3c 100644 --- a/schema.graphql +++ b/schema.graphql @@ -824,29 +824,3 @@ type Query { "Version and build metadata." serverInfo: ServerInfo! } - -# ----- students.graphqls ----- -""" -One roster entry of a course, enriched with ZPA (Prüfungsamt) student details when -they could be found. `found` is false and the detail fields are null when ZPA is -not configured or has no unambiguous match — the GUI then shows just the email. -""" -type CourseStudent { - "The roster email (the identity glabs keys students on)." - email: String! - "Whether ZPA details were found for this email." - found: Boolean! - firstName: String - lastName: String - "The ZPA gender field (sensitive — shown only when the course owner opts in)." - gender: String - "The ZPA group/study programme." - group: String - "The Matrikelnummer." - mtknr: String -} - -extend type Query { - "The course-level roster of one of the caller's courses, enriched with ZPA details, sorted by last name." - courseStudents(course: String!): [CourseStudent!]! -} diff --git a/src/hooks.server.ts b/src/hooks.server.ts index 7371c70..8dd1518 100644 --- a/src/hooks.server.ts +++ b/src/hooks.server.ts @@ -1,120 +1,5 @@ -import { json } from '@sveltejs/kit'; -import type { Handle, RequestEvent } from '@sveltejs/kit'; -import { graphql } from '$lib/gql'; -import { authContext, backendRequest } from '$lib/server/backend'; - -/** HTML-escape für die Einblendung der E-Mail in die „Kein Zutritt"-Seite. */ -function escapeHtml(s: string) { - return s - .replace(/&/g, '&') - .replace(//g, '>') - .replace(/"/g, '"'); -} - -/** - * Eigenständige „Kein Zutritt"-Antwort ohne Navigation/Layout. Wird ausgeliefert, - * sobald ein am Proxy angemeldeter Benutzer im Backend nicht freigeschaltet ist — - * für /api als 403-JSON, sonst als in sich geschlossene HTML-Seite (kein Nav, - * keine SSR-load()s, die ohnehin alle 401/403→500 laufen würden). - */ -function denyResponse(event: RequestEvent, remoteUser: string) { - if (event.url.pathname.startsWith('/api/')) { - return json( - { error: 'Kein Zutritt — diese Kennung ist nicht freigeschaltet.' }, - { status: 403 } - ); - } - const email = escapeHtml(remoteUser); - const html = ` - - - - -Kein Zutritt · glabs - - - -
-
🚫
-

Kein Zutritt

-

Ihre Kennung ist für glabs nicht freigeschaltet.

-

Wenden Sie sich an die Administration, um freigeschaltet zu werden.

-
- -`; - return new Response(html, { - status: 403, - headers: { 'content-type': 'text/html; charset=utf-8' } - }); -} - -let authCache: { user: string | undefined; authorized: boolean; expires: number } = { - user: undefined, - authorized: false, - expires: 0 -}; - -/** - * Ist die aktuelle (vom Proxy gelieferte) Kennung im Backend freigeschaltet? - * Ergebnis ~30 s pro Kennung gecacht, damit nicht jeder Request ein `me` auslöst. - * - * Unterscheidung wichtig: - * - Erfolgreiche Antwort mit `me.email` → freigeschaltet. - * - Backend antwortet mit Fehler (ClientError, `.response` gesetzt) → bewusst - * abgelehnt (Kennung nicht in der Allowlist) → gesperrt. - * - Netzwerk-/sonstiger Fehler (keine `.response`) → unklar, NICHT sperren - * (ein kurzzeitig nicht erreichbares Backend darf niemanden aussperren). - */ -async function isAuthorized(remoteUser: string) { - const now = Date.now(); - if (authCache.user === remoteUser && now < authCache.expires) return authCache.authorized; - try { - const data = await backendRequest( - graphql(` - query AuthCheck { - me { - email - } - } - `) - ); - authCache = { user: remoteUser, authorized: !!data?.me?.email, expires: now + 30000 }; - } catch (err) { - // ClientError (bewusste Ablehnung) trägt `.response`; ein Netzwerkfehler - // nicht → im Zweifel nicht aussperren. - const hasResponse = !!(err as { response?: unknown })?.response; - authCache = { user: remoteUser, authorized: !hasResponse, expires: now + 30000 }; - } - return authCache.authorized; -} +import type { Handle } from '@sveltejs/kit'; +import { authContext } from '$lib/server/backend'; export const handle: Handle = async ({ event, resolve }) => { // Vom Auth-Proxy (oauth2-proxy hinter Caddy) autoritativ injizierte Identität. @@ -122,22 +7,14 @@ export const handle: Handle = async ({ event, resolve }) => { // GraphQL-Call (SSR-load()s, spätere /api-Proxys) sie als X-Remote-User an // glabs-web weiterreicht — siehe $lib/server/backend. Bei glabs ist die // Kennung zugleich die E-Mail-Adresse. + // + // Es gibt keinen Zugangs-Riegel mehr: glabs-web hat keine Allowlist, jede vom + // Proxy authentifizierte Kennung (auf hm.edu eingeschränkt) ist zugelassen und + // arbeitet strikt als eigener Nutzer. Der Proxy ist die Zugangsgrenze. const remoteUser = event.request.headers.get('x-remote-user') || undefined; const remoteDisplayname = event.request.headers.get('x-remote-displayname') || undefined; event.locals.remoteUser = remoteUser; event.locals.remoteDisplayname = remoteDisplayname; - return authContext.run({ remoteUser, remoteDisplayname }, async () => { - // Zugangs-Riegel: Läuft das GUI hinter dem Auth-Proxy (remoteUser gesetzt), - // autorisiert das Backend anhand einer E-Mail-Allowlist. Ist die Kennung - // nicht freigeschaltet, würde jeder Backend-Call 401/403→500 liefern und die - // Nav trotzdem erscheinen. Stattdessen hier zentral abfangen und eine - // eigenständige „Kein Zutritt"-Seite ausliefern. Ohne remoteUser (lokal/Dev) - // greift der Riegel nicht → Verhalten wie bisher (glabs-web läuft dann mit - // auth.enabled: false als Dev-User). - if (remoteUser && !(await isAuthorized(remoteUser))) { - return denyResponse(event, remoteUser); - } - return resolve(event); - }); + return authContext.run({ remoteUser, remoteDisplayname }, () => resolve(event)); }; diff --git a/src/lib/gql/gql.ts b/src/lib/gql/gql.ts index e68bd8a..ea2e907 100644 --- a/src/lib/gql/gql.ts +++ b/src/lib/gql/gql.ts @@ -14,7 +14,6 @@ import type { TypedDocumentNode as DocumentNode } from '@graphql-typed-document- * Learn more about it here: https://the-guild.dev/graphql/codegen/plugins/presets/preset-client#reducing-bundle-size */ type Documents = { - "\n\t\t\t\tquery AuthCheck {\n\t\t\t\t\tme {\n\t\t\t\t\t\temail\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t": typeof types.AuthCheckDocument, "\n\tsubscription CourseCheckProgress($name: String!) {\n\t\tcourseCheckProgress(name: $name) {\n\t\t\tmessage\n\t\t\tdone\n\t\t\terror\n\t\t\tresult {\n\t\t\t\tcourse\n\t\t\t\terrors\n\t\t\t\tok\n\t\t\t\tstudents {\n\t\t\t\t\tinput\n\t\t\t\t\tstatus\n\t\t\t\t\tmessage\n\t\t\t\t}\n\t\t\t\tgroups {\n\t\t\t\t\tname\n\t\t\t\t\tmembers {\n\t\t\t\t\t\tinput\n\t\t\t\t\t\tstatus\n\t\t\t\t\t\tmessage\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tduplicates {\n\t\t\t\t\tstudent\n\t\t\t\t\tgroups\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n": typeof types.CourseCheckProgressDocument, "\n\tsubscription RunOp($token: String!, $confirmPhrase: String) {\n\t\trunOp(token: $token, confirmPhrase: $confirmPhrase) {\n\t\t\tlevel\n\t\t\ttext\n\t\t}\n\t}\n": typeof types.RunOpDocument, "\n\tsubscription AssignmentReportProgress($course: String!, $name: String!) {\n\t\tassignmentReportProgress(course: $course, name: $name) {\n\t\t\tmessage\n\t\t\tdone\n\t\t\terror\n\t\t\treport {\n\t\t\t\tcourse\n\t\t\t\tassignment\n\t\t\t\turl\n\t\t\t\tdescription\n\t\t\t\tgenerated\n\t\t\t\thasReleaseMergeRequest\n\t\t\t\thasReleaseDockerImages\n\t\t\t\tprojects {\n\t\t\t\t\tname\n\t\t\t\t\tactive\n\t\t\t\t\temptyRepo\n\t\t\t\t\tcommits\n\t\t\t\t\tlastActivity\n\t\t\t\t\twebUrl\n\t\t\t\t\topenIssuesCount\n\t\t\t\t\topenMergeRequestsCount\n\t\t\t\t\tmembers {\n\t\t\t\t\t\tname\n\t\t\t\t\t\tusername\n\t\t\t\t\t\twebUrl\n\t\t\t\t\t}\n\t\t\t\t\tlastCommit {\n\t\t\t\t\t\ttitle\n\t\t\t\t\t\tcommitterName\n\t\t\t\t\t\tcommittedDate\n\t\t\t\t\t\twebUrl\n\t\t\t\t\t}\n\t\t\t\t\trelease {\n\t\t\t\t\t\tmergeRequest {\n\t\t\t\t\t\t\tfound\n\t\t\t\t\t\t\twebUrl\n\t\t\t\t\t\t\tpipelineStatus\n\t\t\t\t\t\t}\n\t\t\t\t\t\tdockerImages {\n\t\t\t\t\t\t\tstatus\n\t\t\t\t\t\t\timages {\n\t\t\t\t\t\t\t\twanted\n\t\t\t\t\t\t\t\timage\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n": typeof types.AssignmentReportProgressDocument, @@ -48,14 +47,12 @@ type Documents = { "\n\t\t\t\tquery CourseActivity($name: String!) {\n\t\t\t\t\tcourseActivity(course: $name) {\n\t\t\t\t\t\tassignment\n\t\t\t\t\t\top\n\t\t\t\t\t\tstatus\n\t\t\t\t\t\tdetail\n\t\t\t\t\t\tat\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t": typeof types.CourseActivityDocument, "\n\t\t\t\tquery AssignmentEditor($course: String!, $name: String!) {\n\t\t\t\t\tcourse(name: $course) {\n\t\t\t\t\t\tassignmentNames\n\t\t\t\t\t}\n\t\t\t\t\tassignmentSchema {\n\t\t\t\t\t\tkey\n\t\t\t\t\t\tlabel\n\t\t\t\t\t\tdescription\n\t\t\t\t\t\tgroup\n\t\t\t\t\t\tkind\n\t\t\t\t\t\trequired\n\t\t\t\t\t\tdeprecated\n\t\t\t\t\t\texample\n\t\t\t\t\t\toptions {\n\t\t\t\t\t\t\tvalue\n\t\t\t\t\t\t\tlabel\n\t\t\t\t\t\t\tdescription\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tbranchRuleSchema {\n\t\t\t\t\t\tkey\n\t\t\t\t\t\tlabel\n\t\t\t\t\t\tdescription\n\t\t\t\t\t\tkind\n\t\t\t\t\t\trequired\n\t\t\t\t\t\texample\n\t\t\t\t\t}\n\t\t\t\t\tapprovalSettingsSchema {\n\t\t\t\t\t\tkey\n\t\t\t\t\t\tlabel\n\t\t\t\t\t\tdescription\n\t\t\t\t\t\tkind\n\t\t\t\t\t\trequired\n\t\t\t\t\t\texample\n\t\t\t\t\t\toptions {\n\t\t\t\t\t\t\tvalue\n\t\t\t\t\t\t\tlabel\n\t\t\t\t\t\t\tdescription\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tapprovalRuleSchema {\n\t\t\t\t\t\tkey\n\t\t\t\t\t\tlabel\n\t\t\t\t\t\tdescription\n\t\t\t\t\t\tkind\n\t\t\t\t\t\trequired\n\t\t\t\t\t\texample\n\t\t\t\t\t}\n\t\t\t\t\tassignment(course: $course, name: $name) {\n\t\t\t\t\t\tcourse\n\t\t\t\t\t\tname\n\t\t\t\t\t\textends\n\t\t\t\t\t\textendsOptions\n\t\t\t\t\t\tabstract\n\t\t\t\t\t\town {\n\t\t\t\t\t\t\tkey\n\t\t\t\t\t\t\tvalue\n\t\t\t\t\t\t}\n\t\t\t\t\t\tresolved\n\t\t\t\t\t\tresolveError\n\t\t\t\t\t}\n\t\t\t\t\tassignmentUrls(course: $course, name: $name) {\n\t\t\t\t\t\tper\n\t\t\t\t\t\tgroupUrl\n\t\t\t\t\t\trepos {\n\t\t\t\t\t\t\tfor\n\t\t\t\t\t\t\turl\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tassignmentActivity(course: $course, name: $name) {\n\t\t\t\t\t\top\n\t\t\t\t\t\tstatus\n\t\t\t\t\t\tdetail\n\t\t\t\t\t\tat\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t": typeof types.AssignmentEditorDocument, "\n\t\t\t\tquery OpsTargets($course: String!, $name: String!) {\n\t\t\t\t\tassignmentUrls(course: $course, name: $name) {\n\t\t\t\t\t\tper\n\t\t\t\t\t\trepos {\n\t\t\t\t\t\t\tfor\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t": typeof types.OpsTargetsDocument, - "\n\t\t\t\tquery CourseStudents($course: String!) {\n\t\t\t\t\tcourseStudents(course: $course) {\n\t\t\t\t\t\temail\n\t\t\t\t\t\tfound\n\t\t\t\t\t\tfirstName\n\t\t\t\t\t\tlastName\n\t\t\t\t\t\tgender\n\t\t\t\t\t\tgroup\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t": typeof types.CourseStudentsDocument, "\n\t\t\t\tquery ActivityLogDump {\n\t\t\t\t\tactivityLog {\n\t\t\t\t\t\tcourse\n\t\t\t\t\t\tassignment\n\t\t\t\t\t\top\n\t\t\t\t\t\tstatus\n\t\t\t\t\t\tdetail\n\t\t\t\t\t\tat\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t": typeof types.ActivityLogDumpDocument, "\n\t\t\t\tquery CourseYAML($name: String!) {\n\t\t\t\t\tcourseYAML(name: $name)\n\t\t\t\t}\n\t\t\t": typeof types.CourseYamlDocument, "\n\t\t\t\tquery ScheduledJobs {\n\t\t\t\t\tscheduledJobs {\n\t\t\t\t\t\tid\n\t\t\t\t\t\top\n\t\t\t\t\t\tcourse\n\t\t\t\t\t\tassignment\n\t\t\t\t\t\trunAt\n\t\t\t\t\t\tgraceMinutes\n\t\t\t\t\t\tstatus\n\t\t\t\t\t\tcreatedAt\n\t\t\t\t\t\tstartedAt\n\t\t\t\t\t\tfinishedAt\n\t\t\t\t\t\terr\n\t\t\t\t\t\tparams {\n\t\t\t\t\t\t\tkey\n\t\t\t\t\t\t\tvalue\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t": typeof types.ScheduledJobsDocument, "\n\t\t\t\tquery GitlabToken {\n\t\t\t\t\tgitlabToken {\n\t\t\t\t\t\tset\n\t\t\t\t\t\tupdatedAt\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t": typeof types.GitlabTokenDocument, }; const documents: Documents = { - "\n\t\t\t\tquery AuthCheck {\n\t\t\t\t\tme {\n\t\t\t\t\t\temail\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t": types.AuthCheckDocument, "\n\tsubscription CourseCheckProgress($name: String!) {\n\t\tcourseCheckProgress(name: $name) {\n\t\t\tmessage\n\t\t\tdone\n\t\t\terror\n\t\t\tresult {\n\t\t\t\tcourse\n\t\t\t\terrors\n\t\t\t\tok\n\t\t\t\tstudents {\n\t\t\t\t\tinput\n\t\t\t\t\tstatus\n\t\t\t\t\tmessage\n\t\t\t\t}\n\t\t\t\tgroups {\n\t\t\t\t\tname\n\t\t\t\t\tmembers {\n\t\t\t\t\t\tinput\n\t\t\t\t\t\tstatus\n\t\t\t\t\t\tmessage\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tduplicates {\n\t\t\t\t\tstudent\n\t\t\t\t\tgroups\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n": types.CourseCheckProgressDocument, "\n\tsubscription RunOp($token: String!, $confirmPhrase: String) {\n\t\trunOp(token: $token, confirmPhrase: $confirmPhrase) {\n\t\t\tlevel\n\t\t\ttext\n\t\t}\n\t}\n": types.RunOpDocument, "\n\tsubscription AssignmentReportProgress($course: String!, $name: String!) {\n\t\tassignmentReportProgress(course: $course, name: $name) {\n\t\t\tmessage\n\t\t\tdone\n\t\t\terror\n\t\t\treport {\n\t\t\t\tcourse\n\t\t\t\tassignment\n\t\t\t\turl\n\t\t\t\tdescription\n\t\t\t\tgenerated\n\t\t\t\thasReleaseMergeRequest\n\t\t\t\thasReleaseDockerImages\n\t\t\t\tprojects {\n\t\t\t\t\tname\n\t\t\t\t\tactive\n\t\t\t\t\temptyRepo\n\t\t\t\t\tcommits\n\t\t\t\t\tlastActivity\n\t\t\t\t\twebUrl\n\t\t\t\t\topenIssuesCount\n\t\t\t\t\topenMergeRequestsCount\n\t\t\t\t\tmembers {\n\t\t\t\t\t\tname\n\t\t\t\t\t\tusername\n\t\t\t\t\t\twebUrl\n\t\t\t\t\t}\n\t\t\t\t\tlastCommit {\n\t\t\t\t\t\ttitle\n\t\t\t\t\t\tcommitterName\n\t\t\t\t\t\tcommittedDate\n\t\t\t\t\t\twebUrl\n\t\t\t\t\t}\n\t\t\t\t\trelease {\n\t\t\t\t\t\tmergeRequest {\n\t\t\t\t\t\t\tfound\n\t\t\t\t\t\t\twebUrl\n\t\t\t\t\t\t\tpipelineStatus\n\t\t\t\t\t\t}\n\t\t\t\t\t\tdockerImages {\n\t\t\t\t\t\t\tstatus\n\t\t\t\t\t\t\timages {\n\t\t\t\t\t\t\t\twanted\n\t\t\t\t\t\t\t\timage\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n": types.AssignmentReportProgressDocument, @@ -89,7 +86,6 @@ const documents: Documents = { "\n\t\t\t\tquery CourseActivity($name: String!) {\n\t\t\t\t\tcourseActivity(course: $name) {\n\t\t\t\t\t\tassignment\n\t\t\t\t\t\top\n\t\t\t\t\t\tstatus\n\t\t\t\t\t\tdetail\n\t\t\t\t\t\tat\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t": types.CourseActivityDocument, "\n\t\t\t\tquery AssignmentEditor($course: String!, $name: String!) {\n\t\t\t\t\tcourse(name: $course) {\n\t\t\t\t\t\tassignmentNames\n\t\t\t\t\t}\n\t\t\t\t\tassignmentSchema {\n\t\t\t\t\t\tkey\n\t\t\t\t\t\tlabel\n\t\t\t\t\t\tdescription\n\t\t\t\t\t\tgroup\n\t\t\t\t\t\tkind\n\t\t\t\t\t\trequired\n\t\t\t\t\t\tdeprecated\n\t\t\t\t\t\texample\n\t\t\t\t\t\toptions {\n\t\t\t\t\t\t\tvalue\n\t\t\t\t\t\t\tlabel\n\t\t\t\t\t\t\tdescription\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tbranchRuleSchema {\n\t\t\t\t\t\tkey\n\t\t\t\t\t\tlabel\n\t\t\t\t\t\tdescription\n\t\t\t\t\t\tkind\n\t\t\t\t\t\trequired\n\t\t\t\t\t\texample\n\t\t\t\t\t}\n\t\t\t\t\tapprovalSettingsSchema {\n\t\t\t\t\t\tkey\n\t\t\t\t\t\tlabel\n\t\t\t\t\t\tdescription\n\t\t\t\t\t\tkind\n\t\t\t\t\t\trequired\n\t\t\t\t\t\texample\n\t\t\t\t\t\toptions {\n\t\t\t\t\t\t\tvalue\n\t\t\t\t\t\t\tlabel\n\t\t\t\t\t\t\tdescription\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tapprovalRuleSchema {\n\t\t\t\t\t\tkey\n\t\t\t\t\t\tlabel\n\t\t\t\t\t\tdescription\n\t\t\t\t\t\tkind\n\t\t\t\t\t\trequired\n\t\t\t\t\t\texample\n\t\t\t\t\t}\n\t\t\t\t\tassignment(course: $course, name: $name) {\n\t\t\t\t\t\tcourse\n\t\t\t\t\t\tname\n\t\t\t\t\t\textends\n\t\t\t\t\t\textendsOptions\n\t\t\t\t\t\tabstract\n\t\t\t\t\t\town {\n\t\t\t\t\t\t\tkey\n\t\t\t\t\t\t\tvalue\n\t\t\t\t\t\t}\n\t\t\t\t\t\tresolved\n\t\t\t\t\t\tresolveError\n\t\t\t\t\t}\n\t\t\t\t\tassignmentUrls(course: $course, name: $name) {\n\t\t\t\t\t\tper\n\t\t\t\t\t\tgroupUrl\n\t\t\t\t\t\trepos {\n\t\t\t\t\t\t\tfor\n\t\t\t\t\t\t\turl\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tassignmentActivity(course: $course, name: $name) {\n\t\t\t\t\t\top\n\t\t\t\t\t\tstatus\n\t\t\t\t\t\tdetail\n\t\t\t\t\t\tat\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t": types.AssignmentEditorDocument, "\n\t\t\t\tquery OpsTargets($course: String!, $name: String!) {\n\t\t\t\t\tassignmentUrls(course: $course, name: $name) {\n\t\t\t\t\t\tper\n\t\t\t\t\t\trepos {\n\t\t\t\t\t\t\tfor\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t": types.OpsTargetsDocument, - "\n\t\t\t\tquery CourseStudents($course: String!) {\n\t\t\t\t\tcourseStudents(course: $course) {\n\t\t\t\t\t\temail\n\t\t\t\t\t\tfound\n\t\t\t\t\t\tfirstName\n\t\t\t\t\t\tlastName\n\t\t\t\t\t\tgender\n\t\t\t\t\t\tgroup\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t": types.CourseStudentsDocument, "\n\t\t\t\tquery ActivityLogDump {\n\t\t\t\t\tactivityLog {\n\t\t\t\t\t\tcourse\n\t\t\t\t\t\tassignment\n\t\t\t\t\t\top\n\t\t\t\t\t\tstatus\n\t\t\t\t\t\tdetail\n\t\t\t\t\t\tat\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t": types.ActivityLogDumpDocument, "\n\t\t\t\tquery CourseYAML($name: String!) {\n\t\t\t\t\tcourseYAML(name: $name)\n\t\t\t\t}\n\t\t\t": types.CourseYamlDocument, "\n\t\t\t\tquery ScheduledJobs {\n\t\t\t\t\tscheduledJobs {\n\t\t\t\t\t\tid\n\t\t\t\t\t\top\n\t\t\t\t\t\tcourse\n\t\t\t\t\t\tassignment\n\t\t\t\t\t\trunAt\n\t\t\t\t\t\tgraceMinutes\n\t\t\t\t\t\tstatus\n\t\t\t\t\t\tcreatedAt\n\t\t\t\t\t\tstartedAt\n\t\t\t\t\t\tfinishedAt\n\t\t\t\t\t\terr\n\t\t\t\t\t\tparams {\n\t\t\t\t\t\t\tkey\n\t\t\t\t\t\t\tvalue\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t": types.ScheduledJobsDocument, @@ -110,10 +106,6 @@ const documents: Documents = { */ export function graphql(source: string): unknown; -/** - * The graphql function is used to parse GraphQL queries into a document that can be used by GraphQL clients. - */ -export function graphql(source: "\n\t\t\t\tquery AuthCheck {\n\t\t\t\t\tme {\n\t\t\t\t\t\temail\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t"): (typeof documents)["\n\t\t\t\tquery AuthCheck {\n\t\t\t\t\tme {\n\t\t\t\t\t\temail\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t"]; /** * The graphql function is used to parse GraphQL queries into a document that can be used by GraphQL clients. */ @@ -246,10 +238,6 @@ export function graphql(source: "\n\t\t\t\tquery AssignmentEditor($course: Strin * The graphql function is used to parse GraphQL queries into a document that can be used by GraphQL clients. */ export function graphql(source: "\n\t\t\t\tquery OpsTargets($course: String!, $name: String!) {\n\t\t\t\t\tassignmentUrls(course: $course, name: $name) {\n\t\t\t\t\t\tper\n\t\t\t\t\t\trepos {\n\t\t\t\t\t\t\tfor\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t"): (typeof documents)["\n\t\t\t\tquery OpsTargets($course: String!, $name: String!) {\n\t\t\t\t\tassignmentUrls(course: $course, name: $name) {\n\t\t\t\t\t\tper\n\t\t\t\t\t\trepos {\n\t\t\t\t\t\t\tfor\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t"]; -/** - * The graphql function is used to parse GraphQL queries into a document that can be used by GraphQL clients. - */ -export function graphql(source: "\n\t\t\t\tquery CourseStudents($course: String!) {\n\t\t\t\t\tcourseStudents(course: $course) {\n\t\t\t\t\t\temail\n\t\t\t\t\t\tfound\n\t\t\t\t\t\tfirstName\n\t\t\t\t\t\tlastName\n\t\t\t\t\t\tgender\n\t\t\t\t\t\tgroup\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t"): (typeof documents)["\n\t\t\t\tquery CourseStudents($course: String!) {\n\t\t\t\t\tcourseStudents(course: $course) {\n\t\t\t\t\t\temail\n\t\t\t\t\t\tfound\n\t\t\t\t\t\tfirstName\n\t\t\t\t\t\tlastName\n\t\t\t\t\t\tgender\n\t\t\t\t\t\tgroup\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t"]; /** * The graphql function is used to parse GraphQL queries into a document that can be used by GraphQL clients. */ diff --git a/src/lib/gql/graphql.ts b/src/lib/gql/graphql.ts index 80e63c0..56699df 100644 --- a/src/lib/gql/graphql.ts +++ b/src/lib/gql/graphql.ts @@ -80,11 +80,6 @@ export type StudentCheckStatus = /** Resolved (pinned by ID, or matched uniquely by email). */ | 'OK'; -export type AuthCheckQueryVariables = Exact<{ [key: string]: never; }>; - - -export type AuthCheckQuery = { me: { email: string } }; - export type CourseCheckProgressSubscriptionVariables = Exact<{ name: string; }>; @@ -334,13 +329,6 @@ export type OpsTargetsQueryVariables = Exact<{ export type OpsTargetsQuery = { assignmentUrls: { per: string, repos: Array<{ for: string }> } | null }; -export type CourseStudentsQueryVariables = Exact<{ - course: string; -}>; - - -export type CourseStudentsQuery = { courseStudents: Array<{ email: string, found: boolean, firstName: string | null, lastName: string | null, gender: string | null, group: string | null }> }; - export type ActivityLogDumpQueryVariables = Exact<{ [key: string]: never; }>; @@ -364,7 +352,6 @@ export type GitlabTokenQueryVariables = Exact<{ [key: string]: never; }>; export type GitlabTokenQuery = { gitlabToken: { set: boolean, updatedAt: string | null } }; -export const AuthCheckDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"AuthCheck"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"me"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"email"}}]}}]}}]} as unknown as DocumentNode; export const CourseCheckProgressDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"subscription","name":{"kind":"Name","value":"CourseCheckProgress"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"name"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"courseCheckProgress"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"name"},"value":{"kind":"Variable","name":{"kind":"Name","value":"name"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"message"}},{"kind":"Field","name":{"kind":"Name","value":"done"}},{"kind":"Field","name":{"kind":"Name","value":"error"}},{"kind":"Field","name":{"kind":"Name","value":"result"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"course"}},{"kind":"Field","name":{"kind":"Name","value":"errors"}},{"kind":"Field","name":{"kind":"Name","value":"ok"}},{"kind":"Field","name":{"kind":"Name","value":"students"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"input"}},{"kind":"Field","name":{"kind":"Name","value":"status"}},{"kind":"Field","name":{"kind":"Name","value":"message"}}]}},{"kind":"Field","name":{"kind":"Name","value":"groups"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"members"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"input"}},{"kind":"Field","name":{"kind":"Name","value":"status"}},{"kind":"Field","name":{"kind":"Name","value":"message"}}]}}]}},{"kind":"Field","name":{"kind":"Name","value":"duplicates"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"student"}},{"kind":"Field","name":{"kind":"Name","value":"groups"}}]}}]}}]}}]}}]} as unknown as DocumentNode; export const RunOpDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"subscription","name":{"kind":"Name","value":"RunOp"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"token"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"confirmPhrase"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"runOp"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"token"},"value":{"kind":"Variable","name":{"kind":"Name","value":"token"}}},{"kind":"Argument","name":{"kind":"Name","value":"confirmPhrase"},"value":{"kind":"Variable","name":{"kind":"Name","value":"confirmPhrase"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"level"}},{"kind":"Field","name":{"kind":"Name","value":"text"}}]}}]}}]} as unknown as DocumentNode; export const AssignmentReportProgressDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"subscription","name":{"kind":"Name","value":"AssignmentReportProgress"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"course"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"name"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"assignmentReportProgress"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"course"},"value":{"kind":"Variable","name":{"kind":"Name","value":"course"}}},{"kind":"Argument","name":{"kind":"Name","value":"name"},"value":{"kind":"Variable","name":{"kind":"Name","value":"name"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"message"}},{"kind":"Field","name":{"kind":"Name","value":"done"}},{"kind":"Field","name":{"kind":"Name","value":"error"}},{"kind":"Field","name":{"kind":"Name","value":"report"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"course"}},{"kind":"Field","name":{"kind":"Name","value":"assignment"}},{"kind":"Field","name":{"kind":"Name","value":"url"}},{"kind":"Field","name":{"kind":"Name","value":"description"}},{"kind":"Field","name":{"kind":"Name","value":"generated"}},{"kind":"Field","name":{"kind":"Name","value":"hasReleaseMergeRequest"}},{"kind":"Field","name":{"kind":"Name","value":"hasReleaseDockerImages"}},{"kind":"Field","name":{"kind":"Name","value":"projects"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"active"}},{"kind":"Field","name":{"kind":"Name","value":"emptyRepo"}},{"kind":"Field","name":{"kind":"Name","value":"commits"}},{"kind":"Field","name":{"kind":"Name","value":"lastActivity"}},{"kind":"Field","name":{"kind":"Name","value":"webUrl"}},{"kind":"Field","name":{"kind":"Name","value":"openIssuesCount"}},{"kind":"Field","name":{"kind":"Name","value":"openMergeRequestsCount"}},{"kind":"Field","name":{"kind":"Name","value":"members"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"username"}},{"kind":"Field","name":{"kind":"Name","value":"webUrl"}}]}},{"kind":"Field","name":{"kind":"Name","value":"lastCommit"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"title"}},{"kind":"Field","name":{"kind":"Name","value":"committerName"}},{"kind":"Field","name":{"kind":"Name","value":"committedDate"}},{"kind":"Field","name":{"kind":"Name","value":"webUrl"}}]}},{"kind":"Field","name":{"kind":"Name","value":"release"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"mergeRequest"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"found"}},{"kind":"Field","name":{"kind":"Name","value":"webUrl"}},{"kind":"Field","name":{"kind":"Name","value":"pipelineStatus"}}]}},{"kind":"Field","name":{"kind":"Name","value":"dockerImages"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"status"}},{"kind":"Field","name":{"kind":"Name","value":"images"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"wanted"}},{"kind":"Field","name":{"kind":"Name","value":"image"}}]}}]}}]}}]}}]}}]}}]}}]} as unknown as DocumentNode; @@ -398,7 +385,6 @@ export const CourseLintDocument = {"kind":"Document","definitions":[{"kind":"Ope export const CourseActivityDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"CourseActivity"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"name"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"courseActivity"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"course"},"value":{"kind":"Variable","name":{"kind":"Name","value":"name"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"assignment"}},{"kind":"Field","name":{"kind":"Name","value":"op"}},{"kind":"Field","name":{"kind":"Name","value":"status"}},{"kind":"Field","name":{"kind":"Name","value":"detail"}},{"kind":"Field","name":{"kind":"Name","value":"at"}}]}}]}}]} as unknown as DocumentNode; export const AssignmentEditorDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"AssignmentEditor"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"course"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"name"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"course"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"name"},"value":{"kind":"Variable","name":{"kind":"Name","value":"course"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"assignmentNames"}}]}},{"kind":"Field","name":{"kind":"Name","value":"assignmentSchema"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"key"}},{"kind":"Field","name":{"kind":"Name","value":"label"}},{"kind":"Field","name":{"kind":"Name","value":"description"}},{"kind":"Field","name":{"kind":"Name","value":"group"}},{"kind":"Field","name":{"kind":"Name","value":"kind"}},{"kind":"Field","name":{"kind":"Name","value":"required"}},{"kind":"Field","name":{"kind":"Name","value":"deprecated"}},{"kind":"Field","name":{"kind":"Name","value":"example"}},{"kind":"Field","name":{"kind":"Name","value":"options"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"value"}},{"kind":"Field","name":{"kind":"Name","value":"label"}},{"kind":"Field","name":{"kind":"Name","value":"description"}}]}}]}},{"kind":"Field","name":{"kind":"Name","value":"branchRuleSchema"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"key"}},{"kind":"Field","name":{"kind":"Name","value":"label"}},{"kind":"Field","name":{"kind":"Name","value":"description"}},{"kind":"Field","name":{"kind":"Name","value":"kind"}},{"kind":"Field","name":{"kind":"Name","value":"required"}},{"kind":"Field","name":{"kind":"Name","value":"example"}}]}},{"kind":"Field","name":{"kind":"Name","value":"approvalSettingsSchema"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"key"}},{"kind":"Field","name":{"kind":"Name","value":"label"}},{"kind":"Field","name":{"kind":"Name","value":"description"}},{"kind":"Field","name":{"kind":"Name","value":"kind"}},{"kind":"Field","name":{"kind":"Name","value":"required"}},{"kind":"Field","name":{"kind":"Name","value":"example"}},{"kind":"Field","name":{"kind":"Name","value":"options"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"value"}},{"kind":"Field","name":{"kind":"Name","value":"label"}},{"kind":"Field","name":{"kind":"Name","value":"description"}}]}}]}},{"kind":"Field","name":{"kind":"Name","value":"approvalRuleSchema"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"key"}},{"kind":"Field","name":{"kind":"Name","value":"label"}},{"kind":"Field","name":{"kind":"Name","value":"description"}},{"kind":"Field","name":{"kind":"Name","value":"kind"}},{"kind":"Field","name":{"kind":"Name","value":"required"}},{"kind":"Field","name":{"kind":"Name","value":"example"}}]}},{"kind":"Field","name":{"kind":"Name","value":"assignment"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"course"},"value":{"kind":"Variable","name":{"kind":"Name","value":"course"}}},{"kind":"Argument","name":{"kind":"Name","value":"name"},"value":{"kind":"Variable","name":{"kind":"Name","value":"name"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"course"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"extends"}},{"kind":"Field","name":{"kind":"Name","value":"extendsOptions"}},{"kind":"Field","name":{"kind":"Name","value":"abstract"}},{"kind":"Field","name":{"kind":"Name","value":"own"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"key"}},{"kind":"Field","name":{"kind":"Name","value":"value"}}]}},{"kind":"Field","name":{"kind":"Name","value":"resolved"}},{"kind":"Field","name":{"kind":"Name","value":"resolveError"}}]}},{"kind":"Field","name":{"kind":"Name","value":"assignmentUrls"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"course"},"value":{"kind":"Variable","name":{"kind":"Name","value":"course"}}},{"kind":"Argument","name":{"kind":"Name","value":"name"},"value":{"kind":"Variable","name":{"kind":"Name","value":"name"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"per"}},{"kind":"Field","name":{"kind":"Name","value":"groupUrl"}},{"kind":"Field","name":{"kind":"Name","value":"repos"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"for"}},{"kind":"Field","name":{"kind":"Name","value":"url"}}]}}]}},{"kind":"Field","name":{"kind":"Name","value":"assignmentActivity"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"course"},"value":{"kind":"Variable","name":{"kind":"Name","value":"course"}}},{"kind":"Argument","name":{"kind":"Name","value":"name"},"value":{"kind":"Variable","name":{"kind":"Name","value":"name"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"op"}},{"kind":"Field","name":{"kind":"Name","value":"status"}},{"kind":"Field","name":{"kind":"Name","value":"detail"}},{"kind":"Field","name":{"kind":"Name","value":"at"}}]}}]}}]} as unknown as DocumentNode; export const OpsTargetsDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"OpsTargets"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"course"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"name"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"assignmentUrls"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"course"},"value":{"kind":"Variable","name":{"kind":"Name","value":"course"}}},{"kind":"Argument","name":{"kind":"Name","value":"name"},"value":{"kind":"Variable","name":{"kind":"Name","value":"name"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"per"}},{"kind":"Field","name":{"kind":"Name","value":"repos"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"for"}}]}}]}}]}}]} as unknown as DocumentNode; -export const CourseStudentsDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"CourseStudents"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"course"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"courseStudents"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"course"},"value":{"kind":"Variable","name":{"kind":"Name","value":"course"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"email"}},{"kind":"Field","name":{"kind":"Name","value":"found"}},{"kind":"Field","name":{"kind":"Name","value":"firstName"}},{"kind":"Field","name":{"kind":"Name","value":"lastName"}},{"kind":"Field","name":{"kind":"Name","value":"gender"}},{"kind":"Field","name":{"kind":"Name","value":"group"}}]}}]}}]} as unknown as DocumentNode; export const ActivityLogDumpDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"ActivityLogDump"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"activityLog"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"course"}},{"kind":"Field","name":{"kind":"Name","value":"assignment"}},{"kind":"Field","name":{"kind":"Name","value":"op"}},{"kind":"Field","name":{"kind":"Name","value":"status"}},{"kind":"Field","name":{"kind":"Name","value":"detail"}},{"kind":"Field","name":{"kind":"Name","value":"at"}}]}}]}}]} as unknown as DocumentNode; export const CourseYamlDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"CourseYAML"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"name"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"courseYAML"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"name"},"value":{"kind":"Variable","name":{"kind":"Name","value":"name"}}}]}]}}]} as unknown as DocumentNode; export const ScheduledJobsDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"ScheduledJobs"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"scheduledJobs"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"op"}},{"kind":"Field","name":{"kind":"Name","value":"course"}},{"kind":"Field","name":{"kind":"Name","value":"assignment"}},{"kind":"Field","name":{"kind":"Name","value":"runAt"}},{"kind":"Field","name":{"kind":"Name","value":"graceMinutes"}},{"kind":"Field","name":{"kind":"Name","value":"status"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"startedAt"}},{"kind":"Field","name":{"kind":"Name","value":"finishedAt"}},{"kind":"Field","name":{"kind":"Name","value":"err"}},{"kind":"Field","name":{"kind":"Name","value":"params"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"key"}},{"kind":"Field","name":{"kind":"Name","value":"value"}}]}}]}}]}}]} as unknown as DocumentNode; diff --git a/src/routes/courses/[name]/+page.svelte b/src/routes/courses/[name]/+page.svelte index dc74af7..c1b8947 100644 --- a/src/routes/courses/[name]/+page.svelte +++ b/src/routes/courses/[name]/+page.svelte @@ -207,13 +207,6 @@ ⬇️ YAML herunterladen - - 👥 Studierende - { - const course = params.name; - try { - const d = await backendRequest( - graphql(` - query CourseStudents($course: String!) { - courseStudents(course: $course) { - email - found - firstName - lastName - gender - group - } - } - `), - { course } - ); - return { course, students: d?.courseStudents ?? [] }; - } catch (e) { - throw error(502, gqlErrorMessage(e)); - } -}; diff --git a/src/routes/courses/[name]/students/+page.svelte b/src/routes/courses/[name]/students/+page.svelte deleted file mode 100644 index 078d8e0..0000000 --- a/src/routes/courses/[name]/students/+page.svelte +++ /dev/null @@ -1,55 +0,0 @@ - - -Studierende · {data.course} · glabs - -
- ← {data.course} -

Studierende: {data.course}

-

- Kurs-Roster, angereichert über ZPA ({foundCount}/{students.length} in ZPA gefunden). „—" heißt, ZPA - hatte keinen eindeutigen Treffer für die E-Mail. -

- - {#if students.length === 0} -

- Noch keine Studierenden im Kurs. Lege sie im Kurs unter „Studierende & Gruppen" an. -

- {:else} -
- - - - - - - - - - - {#each students as s (s.email)} - - - - - - - {/each} - -
NameGeschl.GruppeE-Mail
{fullName(s) || '—'}{s.gender || '—'}{s.group || '—'}{s.email}
-
- {/if} -