diff --git a/web/src/app/administration/access-items-management/access-items-management.component.ts b/web/src/app/administration/access-items-management/access-items-management.component.ts index 2c6f1a4ae..09f9684ac 100644 --- a/web/src/app/administration/access-items-management/access-items-management.component.ts +++ b/web/src/app/administration/access-items-management/access-items-management.component.ts @@ -172,7 +172,7 @@ export class AccessItemsManagementComponent implements OnInit, OnDestroy { ); this.searchForAccessItemsWorkbaskets(); }, - // new Key: ERROR_TYPES.DELETE_ERR + // new Key: ERROR_TYPES.DELETE_ERR error => { this.requestInProgressService.setRequestInProgress(false); this.generalModalService.triggerMessage( diff --git a/web/src/app/administration/classification/details/classification-details.component.ts b/web/src/app/administration/classification/details/classification-details.component.ts index 22bde3d77..3a6492b7a 100644 --- a/web/src/app/administration/classification/details/classification-details.component.ts +++ b/web/src/app/administration/classification/details/classification-details.component.ts @@ -281,7 +281,7 @@ export class ClassificationDetailsComponent implements OnInit, OnDestroy { private removeClassificationConfirmation() { if (!this.classification || !this.classification.classificationId) { this.generalModalService.triggerMessage( - // new Key ERROR_TYPES.SELECT_ERR + // new Key ERROR_TYPES.SELECT_ERR new MessageModal('There is no classification selected', 'Please check if you are creating a classification') ); return; @@ -297,7 +297,7 @@ export class ClassificationDetailsComponent implements OnInit, OnDestroy { this.afterRequest(); this.classificationsService.selectClassification(); this.router.navigate(['taskana/administration/classifications']); - // new Key: ALERT_TYPES.SUCCESS_ALERT_4 + // new Key: ALERT_TYPES.SUCCESS_ALERT_4 this.alertService.triggerAlert(new AlertModel(AlertType.SUCCESS, `Classification ${key} was removed successfully`)); }, error => { // new Key: ERROR_TYPES.REMOVE_ERR diff --git a/web/src/app/administration/components/import-export/import-export.component.ts b/web/src/app/administration/components/import-export/import-export.component.ts index 13d0a9351..06d715fd7 100644 --- a/web/src/app/administration/components/import-export/import-export.component.ts +++ b/web/src/app/administration/components/import-export/import-export.component.ts @@ -128,7 +128,7 @@ export class ImportExportComponent implements OnInit { } private onFailedResponse(event) { - // new Key ERROR_TYPES.UPLOAD_ERR + // new Key ERROR_TYPES.UPLOAD_ERR this.errorHandler('Upload failed', 'The upload didn\'t proceed sucessfully. \n' + 'Probably the uploaded file exceeded the maximum file size of 10 MB'); } diff --git a/web/src/app/administration/workbasket/details/access-items/access-items.component.ts b/web/src/app/administration/workbasket/details/access-items/access-items.component.ts index 382f826fe..9c6797410 100644 --- a/web/src/app/administration/workbasket/details/access-items/access-items.component.ts +++ b/web/src/app/administration/workbasket/details/access-items/access-items.component.ts @@ -142,7 +142,7 @@ export class AccessItemsComponent implements OnChanges, OnDestroy { this.setAccessItemsGroups(this.accessItemsResetClone); this.accessItemsClone = this.cloneAccessItems(this.accessItemsResetClone); // new Key ALERT_TYPES.INFO_ALERT - this.alertService.triggerAlert(new AlertModel(AlertType.INFO, 'Reset edited fields')); + this.alertService.triggerAlert(new AlertModel(AlertType.INFO, 'Reset edited fields')); } remove(index: number) { @@ -186,13 +186,13 @@ export class AccessItemsComponent implements OnChanges, OnDestroy { .subscribe(response => { this.accessItemsClone = this.cloneAccessItems(this.AccessItemsForm.value.accessItemsGroups); this.accessItemsResetClone = this.cloneAccessItems(this.AccessItemsForm.value.accessItemsGroups); - // new Key ALERT_TYPES.SUCCESS_ALERT_7 + // new Key ALERT_TYPES.SUCCESS_ALERT_7 this.alertService.triggerAlert(new AlertModel( AlertType.SUCCESS, `Workbasket ${this.workbasket.name} Access items were saved successfully` )); this.requestInProgressService.setRequestInProgress(false); }, error => { - // new Key ERROR_TYPES.SAVE_ERR_2 + // new Key ERROR_TYPES.SAVE_ERR_2 this.generalModalService.triggerMessage(new MessageModal('There was error while saving your workbasket\'s access items', error)); this.requestInProgressService.setRequestInProgress(false); }); diff --git a/web/src/app/administration/workbasket/details/distribution-targets/distribution-targets.component.ts b/web/src/app/administration/workbasket/details/distribution-targets/distribution-targets.component.ts index 5ac353410..b1c82da89 100644 --- a/web/src/app/administration/workbasket/details/distribution-targets/distribution-targets.component.ts +++ b/web/src/app/administration/workbasket/details/distribution-targets/distribution-targets.component.ts @@ -139,7 +139,7 @@ export class DistributionTargetsComponent implements OnChanges, OnDestroy { } onClear() { - // new key ALERT_TYPES.INFO_ALERT + // new key ALERT_TYPES.INFO_ALERT this.alertService.triggerAlert(new AlertModel(AlertType.INFO, 'Reset edited fields')); this.distributionTargetsLeft = Object.assign([], this.distributionTargetsClone); this.distributionTargetsRight = Object.assign([], this.distributionTargetsSelectedClone); diff --git a/web/src/app/administration/workbasket/details/information/workbasket-information.component.ts b/web/src/app/administration/workbasket/details/information/workbasket-information.component.ts index 3f4952a4d..b3cca2397 100644 --- a/web/src/app/administration/workbasket/details/information/workbasket-information.component.ts +++ b/web/src/app/administration/workbasket/details/information/workbasket-information.component.ts @@ -18,7 +18,7 @@ import { RequestInProgressService } from 'app/services/requestInProgress/request import { CustomFieldsService } from 'app/services/custom-fields/custom-fields.service'; import { RemoveConfirmationService } from 'app/services/remove-confirmation/remove-confirmation.service'; import { FormsValidatorService } from 'app/shared/services/forms/forms-validator.service'; -import {ALERT_TYPES, ERROR_TYPES} from '../../../../services/general-modal/errors'; +import { ERROR_TYPES } from '../../../../services/general-modal/errors'; @Component({ selector: 'taskana-workbasket-information', diff --git a/web/src/app/administration/workbasket/details/workbasket-details.component.ts b/web/src/app/administration/workbasket/details/workbasket-details.component.ts index d673f148a..c0da55a81 100644 --- a/web/src/app/administration/workbasket/details/workbasket-details.component.ts +++ b/web/src/app/administration/workbasket/details/workbasket-details.component.ts @@ -115,7 +115,7 @@ export class WorkbasketDetailsComponent implements OnInit, OnDestroy { this.requestInProgress = false; this.checkDomainAndRedirect(); }, err => { - // new Key ERROR_TYPES.FETCH_ERR_4 + // new Key ERROR_TYPES.FETCH_ERR_4 this.generalModalService.triggerMessage( new MessageModal('An error occurred while fetching the workbasket', err) ); diff --git a/web/src/app/guards/domain.guard.ts b/web/src/app/guards/domain.guard.ts index 16ab68592..e9b8e594e 100644 --- a/web/src/app/guards/domain.guard.ts +++ b/web/src/app/guards/domain.guard.ts @@ -15,7 +15,7 @@ export class DomainGuard implements CanActivate { return this.domainService.getDomains().pipe( map(domain => true), catchError(() => { - // new Key ERROR_TYPES.FETCH_ERR_5 + // new Key ERROR_TYPES.FETCH_ERR_5 this.generalModalService.triggerMessage(new MessageModal( 'There was an error, please contact with your administrator', 'There was an error getting Domains' )); diff --git a/web/src/app/guards/history.guard.ts b/web/src/app/guards/history.guard.ts index 609fbb2a4..3411ebc66 100644 --- a/web/src/app/guards/history.guard.ts +++ b/web/src/app/guards/history.guard.ts @@ -5,7 +5,7 @@ import { TaskanaEngineService } from 'app/services/taskana-engine/taskana-engine import { map, catchError } from 'rxjs/operators'; import { GeneralModalService } from 'app/services/general-modal/general-modal.service'; import { MessageModal } from 'app/models/message-modal'; -import {ERROR_TYPES} from '../services/general-modal/errors'; +import { ERROR_TYPES } from '../services/general-modal/errors'; @Injectable({ providedIn: 'root' diff --git a/web/src/app/services/general-modal/errors.ts b/web/src/app/services/general-modal/errors.ts index 19eadef70..7eec34bb8 100644 --- a/web/src/app/services/general-modal/errors.ts +++ b/web/src/app/services/general-modal/errors.ts @@ -1,4 +1,3 @@ -import { ErrorModel } from '../../models/error-model'; import { Pair } from '../../models/pair'; @@ -58,7 +57,7 @@ export enum ERROR_TYPES { WARNING_ALERT_2, } -export const errors = new Map ([ +export const errors = new Map([ // access-items-management.component.ts [ERROR_TYPES.FETCH_ERR, new Pair( '', @@ -122,8 +121,8 @@ export const errors = new Map ([ // import-export.component [ERROR_TYPES.UPLOAD_ERR, new Pair( 'Upload failed', - 'The upload didn\'t proceed sucessfully. \ - \n Probably the uploaded file exceeded the maximum file size of 10 MB' + `The upload didn't proceed sucessfully. + \n Probably the uploaded file exceeded the maximum file size of 10 MB.` )], // taskdetails.component [ERROR_TYPES.FETCH_ERR_3, new Pair( @@ -148,7 +147,7 @@ export const errors = new Map ([ // workbasket-information.component [ERROR_TYPES.REMOVE_ERR_2, new Pair( '', - 'There was an error removing distribution target for ${this.workbasket.workbasketId}.' + 'There was an error removing distribution target for {this.workbasket.workbasketId}.' )], // workbasket-information.component [ERROR_TYPES.SAVE_ERR_4, new Pair( @@ -211,16 +210,16 @@ export const errors = new Map ([ // access-items-management.component [ERROR_TYPES.SUCCESS_ALERT, new Pair( '', - '${this.accessIdSelected} was removed successfully' + '{this.accessIdSelected} was removed successfully' )], // classification-details.component [ERROR_TYPES.SUCCESS_ALERT_2, new Pair( '', - 'Classification ${classification.key} was saved successfully' + 'Classification {classification.key} was saved successfully' )], // classification-details.component [ERROR_TYPES.SUCCESS_ALERT_3, new Pair( - 'Classification ${this.classification.key} was saved successfully', + 'Classification {this.classification.key} was saved successfully', '' )], // classification-details.component @@ -233,12 +232,12 @@ export const errors = new Map ([ )], // classification-details.component [ERROR_TYPES.SUCCESS_ALERT_4, new Pair( - 'Classification ${key} was removed successfully', + 'Classification {key} was removed successfully', '' )], // classification-list.component [ERROR_TYPES.SUCCESS_ALERT_5, new Pair( - 'Classification ${key} was saved successfully', + 'Classification {key} was saved successfully', '' )], // import-export.component @@ -248,32 +247,32 @@ export const errors = new Map ([ )], // access-items.component [ERROR_TYPES.SUCCESS_ALERT_7, new Pair( - 'Workbasket ${component.workbasket.key} Access items were saved successfully', + 'Workbasket {component.workbasket.key} Access items were saved successfully', '' )], // workbasket.distribution-targets.component [ERROR_TYPES.SUCCESS_ALERT_8, new Pair( - 'Workbasket ${this.workbasket.name} : Distribution targets were saved successfully', + 'Workbasket {this.workbasket.name} Distribution targets were saved successfully', '' )], // workbasket-information.component [ERROR_TYPES.SUCCESS_ALERT_9, new Pair( - 'DistributionTarget for workbasketID: ${this.workbasket.workbasketId} was removed successfully', + 'DistributionTarget for workbasketID {this.workbasket.workbasketId} was removed successfully', '' )], // workbasket-information.component [ERROR_TYPES.SUCCESS_ALERT_10, new Pair( - 'Workbasket ${workbasketUpdated.key} was saved successfully', + 'Workbasket {workbasketUpdated.key} was saved successfully', '' )], // workbasket-information.component [ERROR_TYPES.SUCCESS_ALERT_11, new Pair( - 'Workbasket ${workbasketUpdated.key} was created successfully', + 'Workbasket {workbasketUpdated.key} was created successfully', '' )], // workbasket-information.component [ERROR_TYPES.SUCCESS_ALERT_12, new Pair( - 'The Workbasket ${this.workbasket.workbasketId} has been marked for deletion', + 'The Workbasket {this.workbasket.workbasketId} has been marked for deletion', '' )], // forms-validator.service @@ -283,7 +282,7 @@ export const errors = new Map ([ )], // forms-validator.service x2 [ERROR_TYPES.WARNING_ALERT_2, new Pair( - 'The ${responseOwner.field} introduced is not valid.', + 'The {responseOwner.field} introduced is not valid.', '' )], // taskdetails.component @@ -293,7 +292,7 @@ export const errors = new Map ([ )], // taskdetails.component [ERROR_TYPES.SUCCESS_ALERT_13, new Pair( - 'Task ${this.currentId} was created successfully.', + 'Task {this.currentId} was created successfully.', '' )], // taskdetails.component diff --git a/web/src/app/services/general-modal/general-modal.service.ts b/web/src/app/services/general-modal/general-modal.service.ts index 0ea9fd1be..3c33786c8 100644 --- a/web/src/app/services/general-modal/general-modal.service.ts +++ b/web/src/app/services/general-modal/general-modal.service.ts @@ -9,7 +9,6 @@ export class GeneralModalService { private messageTriggered = new Subject(); triggerMessage(message: MessageModal) { - console.log(ERRORS.get(ERROR_TYPES.DELETE_ERR)); this.messageTriggered.next(message); } diff --git a/web/src/app/shared/services/errors/errors.service.ts b/web/src/app/shared/services/errors/errors.service.ts index 64f970b76..fa2e3b8f8 100644 --- a/web/src/app/shared/services/errors/errors.service.ts +++ b/web/src/app/shared/services/errors/errors.service.ts @@ -8,7 +8,6 @@ import { ERROR_TYPES } from '../../../services/general-modal/errors'; }) export class ErrorsService { errorSubject$: Subject; - constructor() {} private updateErrorSubject(errorToShow: ErrorModel) { this.errorSubject$.next(errorToShow); diff --git a/web/src/app/shared/services/forms/forms-validator.service.ts b/web/src/app/shared/services/forms/forms-validator.service.ts index 602c854bc..8e64dd18c 100644 --- a/web/src/app/shared/services/forms/forms-validator.service.ts +++ b/web/src/app/shared/services/forms/forms-validator.service.ts @@ -83,7 +83,7 @@ export class FormsValidatorService { result = result && responseOwner.valid; }); if (!result) { - // new key ALERT_TYPES.WARNING_ALERT_2 + // new key ALERT_TYPES.WARNING_ALERT_2 this.alertService.triggerAlert(new AlertModel(AlertType.WARNING, `The ${responseOwner.field} introduced is not valid.`)); } return result; diff --git a/web/src/app/shared/services/httpClientInterceptor/http-client-interceptor.service.ts b/web/src/app/shared/services/httpClientInterceptor/http-client-interceptor.service.ts index ee2c04f19..f84ac7aa8 100644 --- a/web/src/app/shared/services/httpClientInterceptor/http-client-interceptor.service.ts +++ b/web/src/app/shared/services/httpClientInterceptor/http-client-interceptor.service.ts @@ -27,14 +27,14 @@ export class HttpClientInterceptor implements HttpInterceptor { return next.handle(req).pipe(tap(() => { }, error => { this.requestInProgressService.setRequestInProgress(false); if (error instanceof HttpErrorResponse && (error.status === 401 || error.status === 403)) { - // new Key ERROR_TYPES.ACCESS_ERR - this.generalModalService.triggerMessage( + // new Key ERROR_TYPES.ACCESS_ERR + this.generalModalService.triggerMessage( new MessageModal('You have no access to this resource ', error) ); } else if (error instanceof HttpErrorResponse && (error.status === 404) && error.url.indexOf('environment-information.json')) { - // ignore this error message Key ERROR_TYPES.NONE + // ignore this error message Key ERROR_TYPES.NONE } else { - // new Key ERROR_TYPES.GENERAL_ERR + // new Key ERROR_TYPES.GENERAL_ERR this.generalModalService.triggerMessage( new MessageModal('There was error, please contact with your administrator ', error) ); diff --git a/web/src/app/shared/spinner/spinner.component.ts b/web/src/app/shared/spinner/spinner.component.ts index 43b3b9164..9740ea27c 100644 --- a/web/src/app/shared/spinner/spinner.component.ts +++ b/web/src/app/shared/spinner/spinner.component.ts @@ -4,12 +4,11 @@ import { Component, Input, Output, EventEmitter, OnDestroy, ViewChild } from '@a import { MessageModal } from 'app/models/message-modal'; import { GeneralModalService } from 'app/services/general-modal/general-modal.service'; -import {ERROR_TYPES} from '../../services/general-modal/errors'; +import { ERROR_TYPES } from '../../services/general-modal/errors'; declare let $: any; - @Component({ selector: 'taskana-spinner', templateUrl: './spinner.component.html', @@ -67,7 +66,7 @@ export class SpinnerComponent implements OnDestroy { this.isDelayedRunning = value; this.cancelTimeout(); this.requestTimeout = setTimeout(() => { - // new Key ERROR_TYPES.TIMEOUT_ERR + // new Key ERROR_TYPES.TIMEOUT_ERR this.generalModalService.triggerMessage( new MessageModal('There was an error with your request, please make sure you have internet connection', 'Request time execeed')