Skip to content

Commit 6767522

Browse files
fix(jobs): use updated SDK (#1881)
## Description [Release v4.17.1](https://github.com/SciCatProject/scicat-backend-next/releases/tag/v4.17.1) updated the SDK to fix issue SciCatProject/scicat-backend-next#1937 We now need to call the correct methods in the frontend. ## Motivation #1858 ## Fixes: Use `jobsControllerCreateV3()` instead of `jobsControllerCreateV3V3()` ## Changes: - `src/app/state-management/effects/jobs.effects.ts` - `src/app/state-management/effects/jobs.effects.spec.ts` ## Tests included - [ ] Included for each change/fix? - [ ] Passing? (Merge will not be approved unless this is checked) ## Documentation - [ ] swagger documentation updated \[required\] - [ ] official documentation updated \[nice-to-have\] ### official documentation info If you have updated the official documentation, please provide PR # and URL of the pages where the updates are included ## Backend version - [ ] Does it require a specific version of the backend - which version of the backend is required: ## Summary by Sourcery Align job effects with updated SciCat SDK by replacing deprecated V3V3 methods with V3 variants and bumping the SDK dependency. Bug Fixes: - Replace calls to jobsControllerFindAllV3V3, jobsControllerFindOneV3V3, and jobsControllerCreateV3V3 with jobsControllerFindAllV3, jobsControllerFindOneV3, and jobsControllerCreateV3 to match the updated SDK. Build: - Bump @scicatproject/scicat-sdk-ts-angular dependency from v4.17.0 to v4.17.1. Tests: - Update jobs.effects.spec.ts to mock and expect the new V3 SDK method names. Co-authored-by: Martin <[email protected]>
1 parent 13f16d5 commit 6767522

File tree

4 files changed

+23
-22
lines changed

4 files changed

+23
-22
lines changed

package-lock.json

Lines changed: 5 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
"@ngrx/store": "^19.1.0",
3838
"@ngx-translate/core": "^16.0.4",
3939
"@ngxmc/datetime-picker": "^19.3.1",
40-
"@scicatproject/scicat-sdk-ts-angular": "^4.17.0",
40+
"@scicatproject/scicat-sdk-ts-angular": "^4.17.1",
4141
"autolinker": "^4.0.0",
4242
"deep-equal": "^2.0.5",
4343
"exceljs": "^4.3.0",

src/app/state-management/effects/jobs.effects.spec.ts

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -59,9 +59,9 @@ describe("JobEffects", () => {
5959
{
6060
provide: JobsService,
6161
useValue: jasmine.createSpyObj("jobApi", [
62-
"jobsControllerFindAllV3V3",
63-
"jobsControllerFindOneV3V3",
64-
"jobsControllerCreateV3V3",
62+
"jobsControllerFindAllV3",
63+
"jobsControllerFindOneV3",
64+
"jobsControllerCreateV3",
6565
]),
6666
},
6767
],
@@ -84,7 +84,7 @@ describe("JobEffects", () => {
8484

8585
actions = hot("-a", { a: action });
8686
const response = cold("-a|", { a: jobs });
87-
jobApi.jobsControllerFindAllV3V3.and.returnValue(response);
87+
jobApi.jobsControllerFindAllV3.and.returnValue(response);
8888

8989
const expected = cold("--(bc)", { b: outcome1, c: outcome2 });
9090
expect(effects.fetchJobs$).toBeObservable(expected);
@@ -96,7 +96,7 @@ describe("JobEffects", () => {
9696

9797
actions = hot("-a", { a: action });
9898
const response = cold("-#", {});
99-
jobApi.jobsControllerFindAllV3V3.and.returnValue(response);
99+
jobApi.jobsControllerFindAllV3.and.returnValue(response);
100100

101101
const expected = cold("--b", { b: outcome });
102102
expect(effects.fetchJobs$).toBeObservable(expected);
@@ -115,7 +115,7 @@ describe("JobEffects", () => {
115115

116116
actions = hot("-a", { a: action });
117117
const response = cold("-a|", { a: jobs });
118-
jobApi.jobsControllerFindAllV3V3.and.returnValue(response);
118+
jobApi.jobsControllerFindAllV3.and.returnValue(response);
119119

120120
const expected = cold("--(bc)", { b: outcome1, c: outcome2 });
121121
expect(effects.fetchJobs$).toBeObservable(expected);
@@ -127,7 +127,7 @@ describe("JobEffects", () => {
127127

128128
actions = hot("-a", { a: action });
129129
const response = cold("-#", {});
130-
jobApi.jobsControllerFindAllV3V3.and.returnValue(response);
130+
jobApi.jobsControllerFindAllV3.and.returnValue(response);
131131

132132
const expected = cold("--b", { b: outcome });
133133
expect(effects.fetchJobs$).toBeObservable(expected);
@@ -146,7 +146,7 @@ describe("JobEffects", () => {
146146

147147
actions = hot("-a", { a: action });
148148
const response = cold("-a|", { a: jobs });
149-
jobApi.jobsControllerFindAllV3V3.and.returnValue(response);
149+
jobApi.jobsControllerFindAllV3.and.returnValue(response);
150150

151151
const expected = cold("--(bc)", { b: outcome1, c: outcome2 });
152152
expect(effects.fetchJobs$).toBeObservable(expected);
@@ -158,7 +158,7 @@ describe("JobEffects", () => {
158158

159159
actions = hot("-a", { a: action });
160160
const response = cold("-#", {});
161-
jobApi.jobsControllerFindAllV3V3.and.returnValue(response);
161+
jobApi.jobsControllerFindAllV3.and.returnValue(response);
162162

163163
const expected = cold("--b", { b: outcome });
164164
expect(effects.fetchJobs$).toBeObservable(expected);
@@ -176,7 +176,7 @@ describe("JobEffects", () => {
176176

177177
actions = hot("-a", { a: action });
178178
const response = cold("-a|", { a: jobs });
179-
jobApi.jobsControllerFindAllV3V3.and.returnValue(response);
179+
jobApi.jobsControllerFindAllV3.and.returnValue(response);
180180

181181
const expected = cold("--(bc)", { b: outcome1, c: outcome2 });
182182
expect(effects.fetchJobs$).toBeObservable(expected);
@@ -188,7 +188,7 @@ describe("JobEffects", () => {
188188

189189
actions = hot("-a", { a: action });
190190
const response = cold("-#", {});
191-
jobApi.jobsControllerFindAllV3V3.and.returnValue(response);
191+
jobApi.jobsControllerFindAllV3.and.returnValue(response);
192192

193193
const expected = cold("--b", { b: outcome });
194194
expect(effects.fetchJobs$).toBeObservable(expected);
@@ -220,7 +220,7 @@ describe("JobEffects", () => {
220220

221221
actions = hot("-a", { a: action });
222222
const response = cold("-a|", { a: outputJob });
223-
jobApi.jobsControllerFindOneV3V3.and.returnValue(response);
223+
jobApi.jobsControllerFindOneV3.and.returnValue(response);
224224

225225
const expected = cold("--b", { b: outcome });
226226
expect(effects.fetchJob$).toBeObservable(expected);
@@ -232,7 +232,7 @@ describe("JobEffects", () => {
232232

233233
actions = hot("-a", { a: action });
234234
const response = cold("-#", {});
235-
jobApi.jobsControllerFindOneV3V3.and.returnValue(response);
235+
jobApi.jobsControllerFindOneV3.and.returnValue(response);
236236

237237
const expected = cold("--b", { b: outcome });
238238
expect(effects.fetchJob$).toBeObservable(expected);
@@ -246,7 +246,7 @@ describe("JobEffects", () => {
246246

247247
actions = hot("-a", { a: action });
248248
const response = cold("-a|", { a: outputJob });
249-
jobApi.jobsControllerCreateV3V3.and.returnValue(response);
249+
jobApi.jobsControllerCreateV3.and.returnValue(response);
250250

251251
const expected = cold("--b", { b: outcome });
252252
expect(effects.submitJob$).toBeObservable(expected);

src/app/state-management/effects/jobs.effects.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ export class JobEffects {
3030
concatLatestFrom(() => this.queryParams$),
3131
map(([action, params]) => params),
3232
switchMap((params) =>
33-
this.jobsService.jobsControllerFindAllV3V3(JSON.stringify(params)).pipe(
33+
this.jobsService.jobsControllerFindAllV3(JSON.stringify(params)).pipe(
3434
switchMap((jobs) => [
3535
fromActions.fetchJobsCompleteAction({ jobs }),
3636
fromActions.fetchCountAction(),
@@ -54,7 +54,7 @@ export class JobEffects {
5454
return this.actions$.pipe(
5555
ofType(fromActions.fetchJobAction),
5656
switchMap(({ jobId }) =>
57-
this.jobsService.jobsControllerFindOneV3V3(jobId).pipe(
57+
this.jobsService.jobsControllerFindOneV3(jobId).pipe(
5858
map((job) => fromActions.fetchJobCompleteAction({ job })),
5959
catchError(() => of(fromActions.fetchJobFailedAction())),
6060
),
@@ -66,7 +66,7 @@ export class JobEffects {
6666
return this.actions$.pipe(
6767
ofType(fromActions.submitJobAction),
6868
switchMap(({ job }) =>
69-
this.jobsService.jobsControllerCreateV3V3(job).pipe(
69+
this.jobsService.jobsControllerCreateV3(job).pipe(
7070
map((res) => fromActions.submitJobCompleteAction({ job: res })),
7171
catchError((err) => of(fromActions.submitJobFailedAction({ err }))),
7272
),

0 commit comments

Comments
 (0)