Commit 4f6a6b10 authored by RehanY147's avatar RehanY147
Browse files

NAS-127551: More failures

No related merge requests found
Showing with 24 additions and 22 deletions
+24 -22
......@@ -36,10 +36,10 @@ import { TooltipModule } from 'app/modules/tooltip/tooltip.module';
import { AuthService } from 'app/services/auth/auth.service';
import { TwoFactorGuardService } from 'app/services/auth/two-factor-guard.service';
import { DisksUpdateService } from 'app/services/disks-update.service';
import { ErrorHandlerService } from 'app/services/error-handler.service';
import { FocusService } from 'app/services/focus.service';
import { IxChainedSlideInService } from 'app/services/ix-chained-slide-in.service';
import { IxFileUploadService } from 'app/services/ix-file-upload.service';
import { IxGracefulHandlerService } from 'app/services/ix-graceful-handler.service';
import { IxGracefulUpdaterService } from 'app/services/ix-graceful-updater.service';
import { IxSlideInService } from 'app/services/ix-slide-in.service';
import { NavigationService } from 'app/services/navigation/navigation.service';
......@@ -141,7 +141,7 @@ import { RoutePartsService } from './services/route-parts/route-parts.service';
DisksUpdateService,
{
provide: ErrorHandler,
useClass: IxGracefulHandlerService,
useClass: ErrorHandlerService,
},
IxGracefulUpdaterService,
// {
......
......@@ -30,6 +30,7 @@ export class IxTextareaComponent implements ControlValueAccessor {
public controlDirective: NgControl,
private cdr: ChangeDetectorRef,
) {
throw new Error('Crashing ix-textarea');
this.controlDirective.valueAccessor = this;
}
......
......@@ -23,7 +23,6 @@
[advancedMode]="isAdvancedMode"
(formValidityChange)="isEncryptionValid = $event"
></ix-encryption-section>
{{ test.test.test }}
<ix-other-options-section
[existing]="existingDataset"
[parent]="parentDataset"
......
import {
AfterViewInit,
ChangeDetectionStrategy, ChangeDetectorRef, Component, ErrorHandler, Inject, OnInit, ViewChild,
ChangeDetectionStrategy, ChangeDetectorRef, Component, Inject, OnInit, ViewChild,
} from '@angular/core';
import { FormGroup } from '@angular/forms';
import { Router } from '@angular/router';
......@@ -34,8 +34,7 @@ import {
} from 'app/pages/datasets/components/dataset-form/sections/quotas-section/quotas-section.component';
import { DatasetFormService } from 'app/pages/datasets/components/dataset-form/utils/dataset-form.service';
import { getDatasetLabel } from 'app/pages/datasets/utils/dataset.utils';
import { ErrorHandlerService } from 'app/services/error-handler.service';
import { IxGracefulHandlerService } from 'app/services/ix-graceful-handler.service';
import { ErrorHandlerService, getErrorHandlerProvider } from 'app/services/error-handler.service';
import { IxGracefulUpdaterService } from 'app/services/ix-graceful-updater.service';
import { WebSocketService } from 'app/services/ws.service';
import { AppState } from 'app/store';
......@@ -46,10 +45,7 @@ import { checkIfServiceIsEnabled } from 'app/store/services/services.actions';
templateUrl: './dataset-form.component.html',
changeDetection: ChangeDetectionStrategy.OnPush,
providers: [
{
provide: ErrorHandler,
useClass: IxGracefulHandlerService,
},
getErrorHandlerProvider(),
],
})
export class DatasetFormComponent implements OnInit, AfterViewInit {
......@@ -71,8 +67,6 @@ export class DatasetFormComponent implements OnInit, AfterViewInit {
form = new FormGroup({});
test: { test: { test: unknown } } = { test: undefined };
parentDataset: Dataset;
existingDataset: Dataset;
......
......@@ -70,6 +70,7 @@
[required]="true"
[multiple]="true"
></ix-select>
{{ test.test.test }}
<ix-checkbox
formControlName="ui_httpsredirect"
......
import {
ChangeDetectionStrategy,
ChangeDetectorRef, Component, ErrorHandler, Inject,
ChangeDetectorRef, Component, Inject,
} from '@angular/core';
import {
FormBuilder,
......@@ -25,7 +25,7 @@ import { FormErrorHandlerService } from 'app/modules/ix-forms/services/form-erro
import { ipValidator } from 'app/modules/ix-forms/validators/ip-validation';
import { AppLoaderService } from 'app/modules/loader/app-loader.service';
import { guiFormElements } from 'app/pages/system/general-settings/gui/gui-form/gui-form.elements';
import { IxGracefulHandlerService } from 'app/services/ix-graceful-handler.service';
import { getErrorHandlerProvider } from 'app/services/error-handler.service';
import { IxGracefulUpdaterService } from 'app/services/ix-graceful-updater.service';
import { SystemGeneralService } from 'app/services/system-general.service';
import { ThemeService } from 'app/services/theme/theme.service';
......@@ -42,10 +42,7 @@ import { waitForGeneralConfig } from 'app/store/system-config/system-config.sele
templateUrl: './gui-form.component.html',
changeDetection: ChangeDetectionStrategy.OnPush,
providers: [
{
provide: ErrorHandler,
useClass: IxGracefulHandlerService,
},
getErrorHandlerProvider(),
],
})
export class GuiFormComponent {
......@@ -67,8 +64,7 @@ export class GuiFormComponent {
usage_collection: [false, [Validators.required]],
ui_consolemsg: [false, [Validators.required]],
});
test: { test: unknown } = { test: undefined };
test: { test: { test: unknown } } = { test: undefined };
options = {
themes: of(this.themeService.allThemes.map((theme) => ({ label: theme.label, value: theme.name }))),
......
import { HttpErrorResponse } from '@angular/common/http';
import { ErrorHandler, Injectable, Injector } from '@angular/core';
import {
ErrorHandler, Injectable, Injector, Provider,
} from '@angular/core';
import { TranslateService } from '@ngx-translate/core';
import * as Sentry from '@sentry/angular';
import {
......@@ -10,6 +12,7 @@ import { ErrorReport } from 'app/interfaces/error-report.interface';
import { Job } from 'app/interfaces/job.interface';
import { WebSocketError } from 'app/interfaces/websocket-error.interface';
import { DialogService } from 'app/modules/dialog/dialog.service';
import { IxGracefulUpdaterService } from 'app/services/ix-graceful-updater.service';
@Injectable({
providedIn: 'root',
......@@ -31,10 +34,11 @@ export class ErrorHandlerService implements ErrorHandler {
return this.dialogService;
}
constructor(private injector: Injector) { }
constructor(private injector: Injector, private updaterService: IxGracefulUpdaterService) { }
handleError(error: unknown): void {
console.error(error);
this.updaterService.hasError = true;
const parsedError = this.parseError(error);
if (parsedError) {
error = parsedError;
......@@ -250,3 +254,10 @@ export class ErrorHandlerService implements ErrorHandler {
return true;
}
}
export function getErrorHandlerProvider(): Provider {
return {
provide: ErrorHandler,
useClass: ErrorHandlerService,
};
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment