Skip to content

OpenProject is the leading open source project management software for product, project and portfolio management. A powerful Jira alternative with agile planning, issue tracking, roadmaps, Gantt charts, time tracking, collaboration features, and more. Available on premises or in the cloud. ⭐ Star us on GitHub

Wrap errors in change detection

Oliver Günther8b3243acc786
diff --git a/frontend/src/app/features/job-status/job-status-modal/job-status.modal.ts b/frontend/src/app/features/job-status/job-status-modal/job-status.modal.ts
index 64fa8a96a98..718e259355a 100644
--- a/frontend/src/app/features/job-status/job-status-modal/job-status.modal.ts
+++ b/frontend/src/app/features/job-status/job-status-modal/job-status.modal.ts
@@ -1,19 +1,38 @@
import {
- ChangeDetectorRef, Component, ElementRef, Inject, OnInit, ViewChild,
+ ChangeDetectionStrategy,
+ ChangeDetectorRef,
+ Component,
+ ElementRef,
+ Inject,
+ OnInit,
+ ViewChild,
} from '@angular/core';
import { OpModalLocalsMap } from 'core-app/shared/components/modal/modal.types';
import { OpModalComponent } from 'core-app/shared/components/modal/modal.component';
import { OpModalLocalsToken } from 'core-app/shared/components/modal/modal.service';
import { I18nService } from 'core-app/core/i18n/i18n.service';
-import { HttpClient, HttpErrorResponse, HttpResponse } from '@angular/common/http';
-import { Observable, timer } from 'rxjs';
-import { switchMap, takeWhile } from 'rxjs/operators';
+import {
+ HttpClient,
+ HttpErrorResponse,
+ HttpResponse,
+} from '@angular/common/http';
+import {
+ Observable,
+ timer,
+} from 'rxjs';
+import {
+ switchMap,
+ takeWhile,
+} from 'rxjs/operators';
import {
LoadingIndicatorService,
withDelayedLoadingIndicator,
} from 'core-app/core/loading-indicator/loading-indicator.service';
import { PathHelperService } from 'core-app/core/path-helper/path-helper.service';
-import { JobStatusEnum, JobStatusInterface } from 'core-app/features/job-status/job-status.interface';
+import {
+ JobStatusEnum,
+ JobStatusInterface,
+} from 'core-app/features/job-status/job-status.interface';
import { ToastService } from 'core-app/shared/components/toaster/toast.service';
import { ApiV3Service } from 'core-app/core/apiv3/api-v3.service';
import { EXTERNAL_REQUEST_HEADER } from 'core-app/features/hal/http/openproject-header-interceptor';
@@ -21,6 +40,7 @@ import { EXTERNAL_REQUEST_HEADER } from 'core-app/features/hal/http/openproject-
@Component({
templateUrl: './job-status.modal.html',
styleUrls: ['./job-status.modal.sass'],
+ changeDetection: ChangeDetectionStrategy.OnPush,
})
export class JobStatusModalComponent extends OpModalComponent implements OnInit {
public text = {
@@ -195,6 +215,7 @@ export class JobStatusModalComponent extends OpModalComponent implements OnInit
this.statusIcon = 'icon-error';
this.message = error?.message || this.I18n.t('js.error.internal');
this.toastService.addError(this.message);
+ this.cdRef.detectChanges();
}
private get jobUrl():string {