Skip to content

Commit

Permalink
teams: smoother surveys routing (fixes #8108) (#8109)
Browse files Browse the repository at this point in the history
Co-authored-by: dogi <dogi@users.noreply.github.com>
  • Loading branch information
Mutugiii and dogi authored Jan 20, 2025
1 parent 83b0779 commit 3523900
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 7 deletions.
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
{
"name": "planet",
"license": "AGPL-3.0",
"version": "0.16.67",
"version": "0.16.68",
"myplanet": {
"latest": "v0.22.20",
"min": "v0.21.20"
"latest": "v0.22.23",
"min": "v0.21.23"
},
"scripts": {
"ng": "ng",
Expand Down
7 changes: 5 additions & 2 deletions src/app/exams/exams-view.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import { UserService } from '../shared/user.service';
import { SubmissionsService } from '../submissions/submissions.service';
import { CouchService } from '../shared/couchdb.service';
import { FormControl, AbstractControl } from '@angular/forms';
import { CustomValidators } from '../validators/custom-validators';
import { Exam, ExamQuestion } from './exams.model';
import { PlanetMessageService } from '../shared/planet-message.service';
import { DialogsAnnouncementComponent, includedCodes, challengeCourseId, challengePeriod } from '../shared/dialogs/dialogs-announcement.component';
Expand Down Expand Up @@ -51,6 +50,7 @@ export class ExamsViewComponent implements OnInit, OnDestroy {
initialLoad = true;
isLoading = true;
courseId: string;
teamId = this.route.snapshot.params.teamId || null;

constructor(
private router: Router,
Expand Down Expand Up @@ -192,7 +192,10 @@ export class ExamsViewComponent implements OnInit, OnDestroy {

examComplete() {
if (this.route.snapshot.data.newUser === true) {
this.router.navigate([ '/users/submission', { id: this.submissionId } ]);
this.router.navigate(
[ '/users/submission', { id: this.submissionId } ],
{ queryParams: { teamId: this.teamId } }
);
} else {
this.goBack();
}
Expand Down
5 changes: 3 additions & 2 deletions src/app/users/users-update/users-update.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -82,9 +82,10 @@ export class UsersUpdateComponent implements OnInit, CanComponentDeactivate {
}

ngOnInit() {
if (this.route.snapshot.data.submission === true) {
const routeSnapshot = this.route.snapshot;
if (routeSnapshot.data.submission === true) {
this.submissionMode = true;
this.redirectUrl = '/manager/surveys';
this.redirectUrl = routeSnapshot.queryParams.teamId ? `/teams/view/${routeSnapshot.queryParams.teamId}` : '/manager/surveys';
return;
}
this.urlName = this.route.snapshot.paramMap.get('name');
Expand Down

0 comments on commit 3523900

Please sign in to comment.