TSK-931: fixed linting issues
This commit is contained in:
parent
bbfdd53e2e
commit
897aaf1c47
|
@ -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(
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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');
|
||||
}
|
||||
|
|
|
@ -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);
|
||||
});
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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',
|
||||
|
|
|
@ -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)
|
||||
);
|
||||
|
|
|
@ -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'
|
||||
));
|
||||
|
|
|
@ -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'
|
||||
|
|
|
@ -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<ERROR_TYPES, Pair> ([
|
||||
export const errors = new Map<ERROR_TYPES, Pair>([
|
||||
// access-items-management.component.ts
|
||||
[ERROR_TYPES.FETCH_ERR, new Pair(
|
||||
'',
|
||||
|
@ -122,8 +121,8 @@ export const errors = new Map<ERROR_TYPES, Pair> ([
|
|||
// 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<ERROR_TYPES, Pair> ([
|
|||
// 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<ERROR_TYPES, Pair> ([
|
|||
// 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<ERROR_TYPES, Pair> ([
|
|||
)],
|
||||
// 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<ERROR_TYPES, Pair> ([
|
|||
)],
|
||||
// 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<ERROR_TYPES, Pair> ([
|
|||
)],
|
||||
// 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<ERROR_TYPES, Pair> ([
|
|||
)],
|
||||
// taskdetails.component
|
||||
[ERROR_TYPES.SUCCESS_ALERT_13, new Pair(
|
||||
'Task ${this.currentId} was created successfully.',
|
||||
'Task {this.currentId} was created successfully.',
|
||||
''
|
||||
)],
|
||||
// taskdetails.component
|
||||
|
|
|
@ -9,7 +9,6 @@ export class GeneralModalService {
|
|||
private messageTriggered = new Subject<MessageModal>();
|
||||
|
||||
triggerMessage(message: MessageModal) {
|
||||
console.log(ERRORS.get(ERROR_TYPES.DELETE_ERR));
|
||||
this.messageTriggered.next(message);
|
||||
}
|
||||
|
||||
|
|
|
@ -8,7 +8,6 @@ import { ERROR_TYPES } from '../../../services/general-modal/errors';
|
|||
})
|
||||
export class ErrorsService {
|
||||
errorSubject$: Subject<ErrorModel>;
|
||||
constructor() {}
|
||||
|
||||
private updateErrorSubject(errorToShow: ErrorModel) {
|
||||
this.errorSubject$.next(errorToShow);
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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)
|
||||
);
|
||||
|
|
|
@ -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')
|
||||
|
|
Loading…
Reference in New Issue