Skip to content

Commit e8656e9

Browse files
committed
fix(tasks): refresh waves on login
1 parent da40897 commit e8656e9

File tree

4 files changed

+26
-7
lines changed

4 files changed

+26
-7
lines changed

src/api/backend/api/default.service.ts

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4840,6 +4840,14 @@ export class DefaultService {
48404840
headers = headers.set('year', String(year));
48414841
}
48424842

4843+
// authentication (ksi) required
4844+
if (this.configuration.accessToken) {
4845+
const accessToken = typeof this.configuration.accessToken === 'function'
4846+
? this.configuration.accessToken()
4847+
: this.configuration.accessToken;
4848+
headers = headers.set('Authorization', 'Bearer ' + accessToken);
4849+
}
4850+
48434851
// to determine the Accept header
48444852
let httpHeaderAccepts: string[] = [
48454853
'application/json'
@@ -4881,6 +4889,14 @@ export class DefaultService {
48814889

48824890
let headers = this.defaultHeaders;
48834891

4892+
// authentication (ksi) required
4893+
if (this.configuration.accessToken) {
4894+
const accessToken = typeof this.configuration.accessToken === 'function'
4895+
? this.configuration.accessToken()
4896+
: this.configuration.accessToken;
4897+
headers = headers.set('Authorization', 'Bearer ' + accessToken);
4898+
}
4899+
48844900
// to determine the Accept header
48854901
let httpHeaderAccepts: string[] = [
48864902
'application/json'

src/api/edulint.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -45,14 +45,14 @@ paths:
4545
summary: List of currently supported Edulint versions.
4646
responses:
4747
"200":
48-
description: The versions are sorted -- the newest version is listed first.
48+
description: Different EduLint versions are currently not supported. Endpoint returns only "latest".
4949
content:
5050
application/json:
5151
schema:
5252
type: array
5353
items:
5454
type: string
55-
example: ["2.10.2", "2.9.2"]
55+
example: ["latest"]
5656

5757
/api/code:
5858
post:
@@ -128,7 +128,7 @@ paths:
128128
parameters:
129129
- name: version
130130
in: path
131-
description: The version of EduLint to use. You can use either a specific version (e.g. 2.0.0) or "latest".
131+
description: The version of EduLint to use. Currently, you can only use "latest".
132132
required: true
133133
schema:
134134
type: string
@@ -171,7 +171,7 @@ paths:
171171
parameters:
172172
- name: version
173173
in: path
174-
description: The version of EduLint to use. You can use either a specific version (e.g. 2.0.0) or "latest".
174+
description: The version of EduLint to use. Currently, you can only use "latest".
175175
required: true
176176
schema:
177177
type: string

src/api/edulint/api/aPI.service.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ export class APIService {
6464
/**
6565
* Analyzes the code with the given hash with the given version of EduLint
6666
*
67-
* @param version The version of EduLint to use. You can use either a specific version (e.g. 2.0.0) or \"latest\".
67+
* @param version The version of EduLint to use. Currently, you can only use \"latest\".
6868
* @param hash the hash of the code to analyze
6969
* @param config extra configuration to use (equivalent to command line configuration described in [EduLint's documentation](https://edulint.rtfd.io#configuration)).
7070
* @param use_cached_result enables/disables using cached linting results
@@ -212,7 +212,7 @@ export class APIService {
212212
* Uploads some code and returns its analysis
213213
* This endpoint combines the /code and /api/{version}/analyze/{hash} endpoints.
214214
* @param body the code to upload and analyze
215-
* @param version The version of EduLint to use. You can use either a specific version (e.g. 2.0.0) or \"latest\".
215+
* @param version The version of EduLint to use. Currently, you can only use \"latest\".
216216
* @param config extra configuration to use (equivalent to command line configuration described in [EduLint's documentation](https://edulint.rtfd.io#configuration)).
217217
* @param use_cached_result enables/disables using cached linting results
218218
* @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body.

src/app/services/tasks/tasks.service.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,10 @@ export class TasksService {
5151
shareReplay(1)
5252
);
5353

54-
this.waves$ = year.selected$.pipe(
54+
this.waves$ = merge(
55+
backend.user$.pipe(map(() => this.year.selected)),
56+
year.selected$
57+
).pipe(
5558
mergeMap((year) => this.backend.http.wavesGetAll(year?.id)),
5659
map((response) => {
5760
const {waves} = response;

0 commit comments

Comments
 (0)