Skip to content

Commit 679f256

Browse files
Mutugiiidogi
andauthored
manager: smoother surveys error handling (fixes #9194) (#9197)
Co-authored-by: dogi <[email protected]>
1 parent 0956a07 commit 679f256

File tree

4 files changed

+8
-6
lines changed

4 files changed

+8
-6
lines changed

package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
{
22
"name": "planet",
33
"license": "AGPL-3.0",
4-
"version": "0.20.47",
4+
"version": "0.20.48",
55
"myplanet": {
6-
"latest": "v0.34.30",
7-
"min": "v0.33.30"
6+
"latest": "v0.34.32",
7+
"min": "v0.33.32"
88
},
99
"scripts": {
1010
"ng": "ng",

src/app/submissions/submissions.component.html

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,8 @@
7171
<ng-container matColumnDef="teamInfo">
7272
<mat-header-cell *matHeaderCellDef mat-sort-header="teamInfo" i18n>Team/Enterprise</mat-header-cell>
7373
<mat-cell *matCellDef="let element" style="cursor: pointer">
74-
<ng-container *ngIf="element.teamInfo">{{element.teamInfo?.name}} ({{getTeamTypeLabel(element.teamInfo?.type)}})</ng-container>
74+
<ng-container *ngIf="element.teamInfo && !element.teamInfo.missing">{{element.teamInfo?.name}} ({{getTeamTypeLabel(element.teamInfo?.type)}})</ng-container>
75+
<ng-container *ngIf="element.teamInfo?.missing"><i i18n>(missing)</i></ng-container>
7576
</mat-cell>
7677
</ng-container>
7778
<ng-container matColumnDef="status">

src/app/submissions/submissions.service.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -330,7 +330,7 @@ export class SubmissionsService {
330330
}
331331

332332
getAnswerText(answers: any[], index, answerIndexes: number[]) {
333-
const answer = answerIndexes[index] > -1 ? answers[index].value : undefined;
333+
const answer = answerIndexes[index] > -1 && answers[index] ? answers[index].value : undefined;
334334
return answer && (
335335
Array.isArray(answer) ? answer.reduce((ans, v) => ans + v.text + ',', '').slice(0, -1) : answer.text || answer
336336
);

src/app/teams/teams.service.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { Injectable } from '@angular/core';
22
import { of, empty, forkJoin, Observable } from 'rxjs';
3-
import { switchMap, map, take } from 'rxjs/operators';
3+
import { switchMap, map, take, catchError } from 'rxjs/operators';
44
import { CouchService } from '../shared/couchdb.service';
55
import { UserService } from '../shared/user.service';
66
import { DialogsFormService } from '../shared/dialogs/dialogs-form.service';
@@ -388,6 +388,7 @@ export class TeamsService {
388388
}
389389
return { id: teamId };
390390
}),
391+
catchError(() => of({ id: teamId, missing: true }))
391392
);
392393
}
393394

0 commit comments

Comments
 (0)