TSK-1163: fixes eslint issues
This commit is contained in:
parent
9b79968f9b
commit
8f4e261679
|
@ -16,8 +16,8 @@ import { AlertService } from 'app/services/alert/alert.service';
|
|||
import { RequestInProgressService } from '../../services/requestInProgress/request-in-progress.service';
|
||||
import { AccessIdsService } from '../../shared/services/access-ids/access-ids.service';
|
||||
import { AccessIdDefinition } from '../../models/access-id';
|
||||
import { ErrorsService } from "../../services/errors/errors.service";
|
||||
import { ERROR_TYPES } from "../../models/errors";
|
||||
import { ErrorsService } from '../../services/errors/errors.service';
|
||||
import { ERROR_TYPES } from '../../models/errors';
|
||||
|
||||
@Component({
|
||||
selector: 'taskana-access-items-management',
|
||||
|
@ -55,14 +55,14 @@ export class AccessItemsManagementComponent implements OnInit, OnDestroy {
|
|||
custom12Field = this.customFieldsService.getCustomField('Custom 12', 'workbaskets.access-items.custom12');
|
||||
|
||||
constructor(private formBuilder: FormBuilder,
|
||||
private customFieldsService: CustomFieldsService,
|
||||
private accessIdsService: AccessIdsService,
|
||||
private formsValidatorService: FormsValidatorService,
|
||||
private requestInProgressService: RequestInProgressService,
|
||||
private removeConfirmationService: RemoveConfirmationService,
|
||||
private alertService: AlertService,
|
||||
private generalModalService: GeneralModalService,
|
||||
private errorsService: ErrorsService) {
|
||||
private customFieldsService: CustomFieldsService,
|
||||
private accessIdsService: AccessIdsService,
|
||||
private formsValidatorService: FormsValidatorService,
|
||||
private requestInProgressService: RequestInProgressService,
|
||||
private removeConfirmationService: RemoveConfirmationService,
|
||||
private alertService: AlertService,
|
||||
private generalModalService: GeneralModalService,
|
||||
private errorsService: ErrorsService) {
|
||||
}
|
||||
|
||||
get accessItemsGroups(): FormArray {
|
||||
|
@ -110,16 +110,16 @@ export class AccessItemsManagementComponent implements OnInit, OnDestroy {
|
|||
|
||||
AccessItemsManagementComponent.unSubscribe(this.accessItemInformationsubscription);
|
||||
this.accessItemInformationsubscription = this.accessIdsService.getAccessItemsInformation(selected.accessId, true)
|
||||
.subscribe((accessIdsWithGroups: Array<AccessIdDefinition>) => {
|
||||
this.accessIdsWithGroups = accessIdsWithGroups;
|
||||
this.belongingGroups = accessIdsWithGroups.filter(item => item.accessId.includes(this.groupsKey));
|
||||
this.searchForAccessItemsWorkbaskets();
|
||||
},
|
||||
// new Key: ERROR_TYPES.FETCH_ERR
|
||||
error => {
|
||||
this.requestInProgressService.setRequestInProgress(false);
|
||||
this.errorsService.updateError(ERROR_TYPES.FETCH_ERR, error);
|
||||
});
|
||||
.subscribe((accessIdsWithGroups: Array<AccessIdDefinition>) => {
|
||||
this.accessIdsWithGroups = accessIdsWithGroups;
|
||||
this.belongingGroups = accessIdsWithGroups.filter(item => item.accessId.includes(this.groupsKey));
|
||||
this.searchForAccessItemsWorkbaskets();
|
||||
},
|
||||
// new Key: ERROR_TYPES.FETCH_ERR
|
||||
error => {
|
||||
this.requestInProgressService.setRequestInProgress(false);
|
||||
this.errorsService.updateError(ERROR_TYPES.FETCH_ERR, error);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -136,28 +136,28 @@ export class AccessItemsManagementComponent implements OnInit, OnDestroy {
|
|||
this.requestInProgressService.setRequestInProgress(true);
|
||||
AccessItemsManagementComponent.unSubscribe(this.accessItemPermissionsSubscription);
|
||||
this.accessItemPermissionsSubscription = this.accessIdsService.getAccessItemsPermissions(
|
||||
this.accessIdsWithGroups,
|
||||
this.AccessItemsForm ? this.AccessItemsForm.value.accessIdFilter : undefined,
|
||||
this.AccessItemsForm ? this.AccessItemsForm.value.workbasketKeyFilter : undefined,
|
||||
this.sortModel,
|
||||
true
|
||||
this.accessIdsWithGroups,
|
||||
this.AccessItemsForm ? this.AccessItemsForm.value.accessIdFilter : undefined,
|
||||
this.AccessItemsForm ? this.AccessItemsForm.value.workbasketKeyFilter : undefined,
|
||||
this.sortModel,
|
||||
true
|
||||
)
|
||||
.subscribe((accessItemsResource: AccessItemsWorkbasketResource) => {
|
||||
this.setAccessItemsGroups(accessItemsResource ? accessItemsResource.accessItems : []);
|
||||
this.requestInProgressService.setRequestInProgress(false);
|
||||
},
|
||||
error => {
|
||||
this.requestInProgressService.setRequestInProgress(false);
|
||||
this.errorsService.updateError(ERROR_TYPES.FETCH_ERR_2, error);
|
||||
});
|
||||
.subscribe((accessItemsResource: AccessItemsWorkbasketResource) => {
|
||||
this.setAccessItemsGroups(accessItemsResource ? accessItemsResource.accessItems : []);
|
||||
this.requestInProgressService.setRequestInProgress(false);
|
||||
},
|
||||
error => {
|
||||
this.requestInProgressService.setRequestInProgress(false);
|
||||
this.errorsService.updateError(ERROR_TYPES.FETCH_ERR_2, error);
|
||||
});
|
||||
}
|
||||
|
||||
revokeAccess() {
|
||||
this.removeConfirmationService.setRemoveConfirmation(
|
||||
this.onRemoveConfirmed.bind(this),
|
||||
`You are going to delete all access related: ${
|
||||
this.accessIdSelected
|
||||
}. Can you confirm this action?`
|
||||
this.onRemoveConfirmed.bind(this),
|
||||
`You are going to delete all access related: ${
|
||||
this.accessIdSelected
|
||||
}. Can you confirm this action?`
|
||||
);
|
||||
}
|
||||
|
||||
|
@ -169,16 +169,16 @@ export class AccessItemsManagementComponent implements OnInit, OnDestroy {
|
|||
private onRemoveConfirmed() {
|
||||
this.requestInProgressService.setRequestInProgress(true);
|
||||
this.accessIdsService.removeAccessItemsPermissions(this.accessIdSelected)
|
||||
.subscribe(
|
||||
.subscribe(
|
||||
// new Key: ALERT_TYPES.SUCCESS_ALERT
|
||||
response => {
|
||||
this.requestInProgressService.setRequestInProgress(false);
|
||||
this.alertService.triggerAlert(
|
||||
new AlertModel(
|
||||
AlertType.SUCCESS,
|
||||
`${this.accessIdSelected
|
||||
} was removed successfully`
|
||||
)
|
||||
new AlertModel(
|
||||
AlertType.SUCCESS,
|
||||
`${this.accessIdSelected
|
||||
} was removed successfully`
|
||||
)
|
||||
);
|
||||
this.searchForAccessItemsWorkbaskets();
|
||||
},
|
||||
|
@ -186,6 +186,6 @@ export class AccessItemsManagementComponent implements OnInit, OnDestroy {
|
|||
this.requestInProgressService.setRequestInProgress(false);
|
||||
this.errorsService.updateError(ERROR_TYPES.DELETE_ERR, error);
|
||||
}
|
||||
);
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -26,7 +26,7 @@ import { FormsValidatorService } from 'app/shared/services/forms/forms-validator
|
|||
import { ImportExportService } from 'app/administration/services/import-export/import-export.service';
|
||||
import { CustomFieldsService } from '../../../services/custom-fields/custom-fields.service';
|
||||
import { ERROR_TYPES } from '../../../models/errors';
|
||||
import { ErrorsService } from "../../../services/errors/errors.service";
|
||||
import { ErrorsService } from '../../../services/errors/errors.service';
|
||||
|
||||
@Component({
|
||||
selector: 'taskana-classification-details',
|
||||
|
|
|
@ -10,10 +10,10 @@ import { AlertService } from 'app/services/alert/alert.service';
|
|||
import { AlertModel, AlertType } from 'app/models/alert';
|
||||
import { UploadService } from 'app/shared/services/upload/upload.service';
|
||||
import { ImportExportService } from 'app/administration/services/import-export/import-export.service';
|
||||
import { HttpErrorResponse } from '@angular/common/http';
|
||||
import { ERROR_TYPES } from '../../../models/errors';
|
||||
import { ErrorsService } from "../../../services/errors/errors.service";
|
||||
import { ErrorModel } from "../../../models/error-model";
|
||||
import { HttpErrorResponse } from "@angular/common/http";
|
||||
import { ErrorsService } from '../../../services/errors/errors.service';
|
||||
import { ErrorModel } from '../../../models/error-model';
|
||||
|
||||
@Component({
|
||||
selector: 'taskana-import-export-component',
|
||||
|
@ -23,29 +23,29 @@ import { HttpErrorResponse } from "@angular/common/http";
|
|||
export class ImportExportComponent implements OnInit {
|
||||
@Input() currentSelection: TaskanaType;
|
||||
|
||||
@ViewChild('selectedFile', {static: true})
|
||||
@ViewChild('selectedFile', { static: true })
|
||||
selectedFileInput;
|
||||
|
||||
domains: string[] = [];
|
||||
errorWhileUploadingText: string;
|
||||
|
||||
constructor(
|
||||
private domainService: DomainService,
|
||||
private workbasketDefinitionService: WorkbasketDefinitionService,
|
||||
private classificationDefinitionService: ClassificationDefinitionService,
|
||||
private generalModalService: GeneralModalService,
|
||||
private alertService: AlertService,
|
||||
public uploadservice: UploadService,
|
||||
private errorsService: ErrorsService,
|
||||
private importExportService: ImportExportService
|
||||
private domainService: DomainService,
|
||||
private workbasketDefinitionService: WorkbasketDefinitionService,
|
||||
private classificationDefinitionService: ClassificationDefinitionService,
|
||||
private generalModalService: GeneralModalService,
|
||||
private alertService: AlertService,
|
||||
public uploadservice: UploadService,
|
||||
private errorsService: ErrorsService,
|
||||
private importExportService: ImportExportService
|
||||
) {
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
this.domainService.getDomains().subscribe(
|
||||
data => {
|
||||
this.domains = data;
|
||||
}
|
||||
data => {
|
||||
this.domains = data;
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
|
|
|
@ -8,10 +8,8 @@ import { WorkbasketAccessItemsResource } from 'app/models/workbasket-access-item
|
|||
import { ACTION } from 'app/models/action';
|
||||
import { AlertModel, AlertType } from 'app/models/alert';
|
||||
|
||||
import {
|
||||
SavingInformation,
|
||||
SavingWorkbasketService
|
||||
} from 'app/administration/services/saving-workbaskets/saving-workbaskets.service';
|
||||
import { SavingInformation,
|
||||
SavingWorkbasketService } from 'app/administration/services/saving-workbaskets/saving-workbaskets.service';
|
||||
import { GeneralModalService } from 'app/services/general-modal/general-modal.service';
|
||||
import { WorkbasketService } from 'app/shared/services/workbasket/workbasket.service';
|
||||
import { AlertService } from 'app/services/alert/alert.service';
|
||||
|
@ -21,7 +19,7 @@ import { highlight } from 'app/shared/animations/validation.animation';
|
|||
import { FormsValidatorService } from 'app/shared/services/forms/forms-validator.service';
|
||||
import { AccessIdDefinition } from 'app/models/access-id';
|
||||
import { ERROR_TYPES } from '../../../../models/errors';
|
||||
import { ErrorsService } from "../../../../services/errors/errors.service";
|
||||
import { ErrorsService } from '../../../../services/errors/errors.service';
|
||||
|
||||
@Component({
|
||||
selector: 'taskana-workbasket-access-items',
|
||||
|
@ -71,15 +69,15 @@ export class AccessItemsComponent implements OnChanges, OnDestroy {
|
|||
private initialized = false;
|
||||
|
||||
constructor(
|
||||
private workbasketService: WorkbasketService,
|
||||
private alertService: AlertService,
|
||||
private generalModalService: GeneralModalService,
|
||||
private savingWorkbaskets: SavingWorkbasketService,
|
||||
private requestInProgressService: RequestInProgressService,
|
||||
private customFieldsService: CustomFieldsService,
|
||||
private formBuilder: FormBuilder,
|
||||
private formsValidatorService: FormsValidatorService,
|
||||
private errorsService: ErrorsService
|
||||
private workbasketService: WorkbasketService,
|
||||
private alertService: AlertService,
|
||||
private generalModalService: GeneralModalService,
|
||||
private savingWorkbaskets: SavingWorkbasketService,
|
||||
private requestInProgressService: RequestInProgressService,
|
||||
private customFieldsService: CustomFieldsService,
|
||||
private formBuilder: FormBuilder,
|
||||
private formsValidatorService: FormsValidatorService,
|
||||
private errorsService: ErrorsService
|
||||
) {
|
||||
}
|
||||
|
||||
|
@ -173,40 +171,40 @@ export class AccessItemsComponent implements OnChanges, OnDestroy {
|
|||
}
|
||||
this.requestInProgress = true;
|
||||
this.accessItemsubscription = this.workbasketService.getWorkBasketAccessItems(this.workbasket._links.accessItems.href)
|
||||
.subscribe((accessItemsResource: WorkbasketAccessItemsResource) => {
|
||||
this.accessItemsResource = accessItemsResource;
|
||||
this.setAccessItemsGroups(accessItemsResource.accessItems);
|
||||
this.accessItemsClone = this.cloneAccessItems(accessItemsResource.accessItems);
|
||||
this.accessItemsResetClone = this.cloneAccessItems(accessItemsResource.accessItems);
|
||||
this.requestInProgress = false;
|
||||
});
|
||||
.subscribe((accessItemsResource: WorkbasketAccessItemsResource) => {
|
||||
this.accessItemsResource = accessItemsResource;
|
||||
this.setAccessItemsGroups(accessItemsResource.accessItems);
|
||||
this.accessItemsClone = this.cloneAccessItems(accessItemsResource.accessItems);
|
||||
this.accessItemsResetClone = this.cloneAccessItems(accessItemsResource.accessItems);
|
||||
this.requestInProgress = false;
|
||||
});
|
||||
this.savingAccessItemsSubscription = this.savingWorkbaskets.triggeredAccessItemsSaving()
|
||||
.subscribe((savingInformation: SavingInformation) => {
|
||||
if (this.action === ACTION.COPY) {
|
||||
this.accessItemsResource._links.self.href = savingInformation.url;
|
||||
this.setWorkbasketIdForCopy(savingInformation.workbasketId);
|
||||
this.onSave();
|
||||
}
|
||||
});
|
||||
.subscribe((savingInformation: SavingInformation) => {
|
||||
if (this.action === ACTION.COPY) {
|
||||
this.accessItemsResource._links.self.href = savingInformation.url;
|
||||
this.setWorkbasketIdForCopy(savingInformation.workbasketId);
|
||||
this.onSave();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private onSave() {
|
||||
this.requestInProgressService.setRequestInProgress(true);
|
||||
this.workbasketService.updateWorkBasketAccessItem(
|
||||
this.accessItemsResource._links.self.href, this.AccessItemsForm.value.accessItemsGroups
|
||||
this.accessItemsResource._links.self.href, this.AccessItemsForm.value.accessItemsGroups
|
||||
)
|
||||
.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
|
||||
this.alertService.triggerAlert(new AlertModel(
|
||||
.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
|
||||
this.alertService.triggerAlert(new AlertModel(
|
||||
AlertType.SUCCESS, `Workbasket ${this.workbasket.name} Access items were saved successfully`
|
||||
));
|
||||
this.requestInProgressService.setRequestInProgress(false);
|
||||
}, error => {
|
||||
this.errorsService.updateError(ERROR_TYPES.SAVE_ERR_2, error);
|
||||
this.requestInProgressService.setRequestInProgress(false);
|
||||
});
|
||||
));
|
||||
this.requestInProgressService.setRequestInProgress(false);
|
||||
}, error => {
|
||||
this.errorsService.updateError(ERROR_TYPES.SAVE_ERR_2, error);
|
||||
this.requestInProgressService.setRequestInProgress(false);
|
||||
});
|
||||
}
|
||||
|
||||
private setBadge() {
|
||||
|
@ -217,7 +215,7 @@ export class AccessItemsComponent implements OnChanges, OnDestroy {
|
|||
|
||||
private cloneAccessItems(inputaccessItem): Array<WorkbasketAccessItems> {
|
||||
return this.AccessItemsForm.value.accessItemsGroups.map(
|
||||
(accessItems: WorkbasketAccessItems) => ({...accessItems})
|
||||
(accessItems: WorkbasketAccessItems) => ({ ...accessItems })
|
||||
);
|
||||
}
|
||||
|
||||
|
|
|
@ -19,7 +19,7 @@ import { Page } from 'app/models/page';
|
|||
import { OrientationService } from 'app/services/orientation/orientation.service';
|
||||
import { Orientation } from 'app/models/orientation';
|
||||
import { ERROR_TYPES } from '../../../../models/errors';
|
||||
import { ErrorsService } from "../../../../services/errors/errors.service";
|
||||
import { ErrorsService } from '../../../../services/errors/errors.service';
|
||||
|
||||
export enum Side {
|
||||
LEFT,
|
||||
|
|
|
@ -19,7 +19,7 @@ import { CustomFieldsService } from 'app/services/custom-fields/custom-fields.se
|
|||
import { RemoveConfirmationService } from 'app/services/remove-confirmation/remove-confirmation.service';
|
||||
import { FormsValidatorService } from 'app/shared/services/forms/forms-validator.service';
|
||||
import { ERROR_TYPES } from '../../../../models/errors';
|
||||
import { ErrorsService } from "../../../../services/errors/errors.service";
|
||||
import { ErrorsService } from '../../../../services/errors/errors.service';
|
||||
|
||||
@Component({
|
||||
selector: 'taskana-workbasket-information',
|
||||
|
@ -168,9 +168,8 @@ implements OnInit, OnChanges, OnDestroy {
|
|||
},
|
||||
error => {
|
||||
this.errorsService.updateError(ERROR_TYPES.REMOVE_ERR_2,
|
||||
error,
|
||||
new Map<String,String>([["workbasketId", this.workbasket.workbasketId]])
|
||||
);
|
||||
error,
|
||||
new Map<String, String>([['workbasketId', this.workbasket.workbasketId]]));
|
||||
this.requestInProgressService.setRequestInProgress(false);
|
||||
}
|
||||
);
|
||||
|
@ -271,8 +270,8 @@ implements OnInit, OnChanges, OnDestroy {
|
|||
this.workbasketService.triggerWorkBasketSaved();
|
||||
if (response.status === 202) {
|
||||
this.errorsService.updateError(ERROR_TYPES.MARK_ERR,
|
||||
undefined,
|
||||
new Map<String, String>([['workbasketId', this.workbasket.workbasketId]]));
|
||||
undefined,
|
||||
new Map<String, String>([['workbasketId', this.workbasket.workbasketId]]));
|
||||
} else {
|
||||
// new Key ALERT_TYPES.SUCCESS_ALERT_12
|
||||
this.alertService.triggerAlert(
|
||||
|
|
|
@ -12,7 +12,7 @@ import { ImportExportService } from 'app/administration/services/import-export/i
|
|||
import { GeneralModalService } from '../../../services/general-modal/general-modal.service';
|
||||
import { MessageModal } from '../../../models/message-modal';
|
||||
import { ERROR_TYPES } from '../../../models/errors';
|
||||
import { ErrorsService } from "../../../services/errors/errors.service";
|
||||
import { ErrorsService } from '../../../services/errors/errors.service';
|
||||
|
||||
@Component({
|
||||
selector: 'taskana-workbasket-details',
|
||||
|
|
|
@ -1,17 +1,17 @@
|
|||
import {Component, HostListener, OnDestroy, OnInit} from '@angular/core';
|
||||
import {NavigationStart, Router} from '@angular/router';
|
||||
import {Subscription} from 'rxjs';
|
||||
import { Component, HostListener, OnDestroy, OnInit } from '@angular/core';
|
||||
import { NavigationStart, Router } from '@angular/router';
|
||||
import { Subscription } from 'rxjs';
|
||||
|
||||
import {FormsValidatorService} from 'app/shared/services/forms/forms-validator.service';
|
||||
import {MessageModal} from './models/message-modal';
|
||||
import { FormsValidatorService } from 'app/shared/services/forms/forms-validator.service';
|
||||
import { MessageModal } from './models/message-modal';
|
||||
|
||||
import {GeneralModalService} from './services/general-modal/general-modal.service';
|
||||
import {RequestInProgressService} from './services/requestInProgress/request-in-progress.service';
|
||||
import {OrientationService} from './services/orientation/orientation.service';
|
||||
import {SelectedRouteService} from './services/selected-route/selected-route';
|
||||
import {UploadService} from './shared/services/upload/upload.service';
|
||||
import {ErrorModel} from "./models/error-model";
|
||||
import {ErrorsService} from "./services/errors/errors.service";
|
||||
import { GeneralModalService } from './services/general-modal/general-modal.service';
|
||||
import { RequestInProgressService } from './services/requestInProgress/request-in-progress.service';
|
||||
import { OrientationService } from './services/orientation/orientation.service';
|
||||
import { SelectedRouteService } from './services/selected-route/selected-route';
|
||||
import { UploadService } from './shared/services/upload/upload.service';
|
||||
import { ErrorModel } from './models/error-model';
|
||||
import { ErrorsService } from './services/errors/errors.service';
|
||||
|
||||
@Component({
|
||||
selector: 'taskana-root',
|
||||
|
@ -37,14 +37,14 @@ export class AppComponent implements OnInit, OnDestroy {
|
|||
error: ErrorModel;
|
||||
|
||||
constructor(
|
||||
private router: Router,
|
||||
private generalModalService: GeneralModalService,
|
||||
private requestInProgressService: RequestInProgressService,
|
||||
private orientationService: OrientationService,
|
||||
private selectedRouteService: SelectedRouteService,
|
||||
private formsValidatorService: FormsValidatorService,
|
||||
private errorService: ErrorsService,
|
||||
public uploadService: UploadService
|
||||
private router: Router,
|
||||
private generalModalService: GeneralModalService,
|
||||
private requestInProgressService: RequestInProgressService,
|
||||
private orientationService: OrientationService,
|
||||
private selectedRouteService: SelectedRouteService,
|
||||
private formsValidatorService: FormsValidatorService,
|
||||
private errorService: ErrorsService,
|
||||
public uploadService: UploadService
|
||||
) {
|
||||
}
|
||||
|
||||
|
@ -68,8 +68,8 @@ export class AppComponent implements OnInit, OnDestroy {
|
|||
this.modalMessage = messageModal.message.message;
|
||||
} else {
|
||||
this.modalMessage = messageModal.message.error
|
||||
? (`${messageModal.message.error.error} ${messageModal.message.error.message}`)
|
||||
: messageModal.message.message;
|
||||
? (`${messageModal.message.error.error} ${messageModal.message.error.message}`)
|
||||
: messageModal.message.message;
|
||||
}
|
||||
this.modalTitle = messageModal.title;
|
||||
this.modalType = messageModal.type;
|
||||
|
|
|
@ -3,8 +3,8 @@ import { CanActivate } from '@angular/router';
|
|||
import { Injectable } from '@angular/core';
|
||||
import { DomainService } from 'app/services/domain/domain.service';
|
||||
import { catchError, map } from 'rxjs/operators';
|
||||
import { ErrorsService } from "../services/errors/errors.service";
|
||||
import { ERROR_TYPES } from "../models/errors";
|
||||
import { ErrorsService } from '../services/errors/errors.service';
|
||||
import { ERROR_TYPES } from '../models/errors';
|
||||
|
||||
@Injectable()
|
||||
export class DomainGuard implements CanActivate {
|
||||
|
@ -13,11 +13,11 @@ export class DomainGuard implements CanActivate {
|
|||
|
||||
canActivate() {
|
||||
return this.domainService.getDomains().pipe(
|
||||
map(domain => true),
|
||||
catchError(() => {
|
||||
this.errorsService.updateError(ERROR_TYPES.FETCH_ERR_5);
|
||||
return of(false);
|
||||
})
|
||||
map(domain => true),
|
||||
catchError(() => {
|
||||
this.errorsService.updateError(ERROR_TYPES.FETCH_ERR_5);
|
||||
return of(false);
|
||||
})
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -4,34 +4,34 @@ import { Observable, of } from 'rxjs';
|
|||
import { TaskanaEngineService } from 'app/services/taskana-engine/taskana-engine.service';
|
||||
import { catchError, map } from 'rxjs/operators';
|
||||
import { ERROR_TYPES } from '../models/errors';
|
||||
import { ErrorsService } from "../services/errors/errors.service";
|
||||
import { ErrorsService } from '../services/errors/errors.service';
|
||||
|
||||
@Injectable({
|
||||
providedIn: 'root'
|
||||
})
|
||||
export class HistoryGuard implements CanActivate {
|
||||
constructor(
|
||||
private taskanaEngineService: TaskanaEngineService,
|
||||
public router: Router,
|
||||
private errorsService: ErrorsService
|
||||
private taskanaEngineService: TaskanaEngineService,
|
||||
public router: Router,
|
||||
private errorsService: ErrorsService
|
||||
) {
|
||||
}
|
||||
|
||||
canActivate(
|
||||
next: ActivatedRouteSnapshot,
|
||||
state: RouterStateSnapshot
|
||||
next: ActivatedRouteSnapshot,
|
||||
state: RouterStateSnapshot
|
||||
): Observable<boolean> | Promise<boolean> | boolean {
|
||||
return this.taskanaEngineService.isHistoryProviderEnabled().pipe(
|
||||
map(value => {
|
||||
if (value) {
|
||||
return value;
|
||||
}
|
||||
return this.navigateToWorkplace();
|
||||
}),
|
||||
catchError(() => {
|
||||
this.errorsService.updateError(ERROR_TYPES.FETCH_ERR_6)
|
||||
return of(this.navigateToWorkplace());
|
||||
})
|
||||
map(value => {
|
||||
if (value) {
|
||||
return value;
|
||||
}
|
||||
return this.navigateToWorkplace();
|
||||
}),
|
||||
catchError(() => {
|
||||
this.errorsService.updateError(ERROR_TYPES.FETCH_ERR_6);
|
||||
return of(this.navigateToWorkplace());
|
||||
})
|
||||
);
|
||||
}
|
||||
|
||||
|
|
|
@ -11,7 +11,7 @@ import { TaskHistoryEventResourceData } from 'app/models/task-history-event-reso
|
|||
import { RequestInProgressService } from 'app/services/requestInProgress/request-in-progress.service';
|
||||
import { TaskHistoryEventData } from '../../models/task-history-event';
|
||||
import { TaskQueryService } from '../services/task-query/task-query.service';
|
||||
import { ErrorsService } from "../../services/errors/errors.service";
|
||||
import { ErrorsService } from '../../services/errors/errors.service';
|
||||
|
||||
@Component({
|
||||
selector: 'taskana-task-query',
|
||||
|
@ -29,11 +29,11 @@ export class TaskQueryComponent implements OnInit {
|
|||
taskQueryForm = new FormGroup({});
|
||||
|
||||
constructor(
|
||||
private taskQueryService: TaskQueryService,
|
||||
private orientationService: OrientationService,
|
||||
private generalModalService: GeneralModalService,
|
||||
private requestInProgressService: RequestInProgressService,
|
||||
private errorsService: ErrorsService
|
||||
private taskQueryService: TaskQueryService,
|
||||
private orientationService: OrientationService,
|
||||
private generalModalService: GeneralModalService,
|
||||
private requestInProgressService: RequestInProgressService,
|
||||
private errorsService: ErrorsService
|
||||
) {
|
||||
}
|
||||
|
||||
|
@ -148,11 +148,11 @@ export class TaskQueryComponent implements OnInit {
|
|||
// TODO: Global?
|
||||
openDetails(key: string, val: string) {
|
||||
this.generalModalService.triggerMessage(
|
||||
new MessageModal(
|
||||
`These are the details of ${this.getHeaderFieldDescription(key)}`,
|
||||
val,
|
||||
'code'
|
||||
)
|
||||
new MessageModal(
|
||||
`These are the details of ${this.getHeaderFieldDescription(key)}`,
|
||||
val,
|
||||
'code'
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
|
@ -195,10 +195,10 @@ export class TaskQueryComponent implements OnInit {
|
|||
this.requestInProgressService.setRequestInProgress(true);
|
||||
this.calculateQueryPages();
|
||||
this.taskQuerySubscription = this.taskQueryService.queryTask(
|
||||
this.orderBy.sortBy.replace(/([A-Z])|([0-9])/g, g => `-${g[0].toLowerCase()}`),
|
||||
this.orderBy.sortDirection,
|
||||
new TaskHistoryEventData(this.taskQueryForm.value),
|
||||
false
|
||||
this.orderBy.sortBy.replace(/([A-Z])|([0-9])/g, g => `-${g[0].toLowerCase()}`),
|
||||
this.orderBy.sortDirection,
|
||||
new TaskHistoryEventData(this.taskQueryForm.value),
|
||||
false
|
||||
).subscribe(taskQueryResource => {
|
||||
this.requestInProgressService.setRequestInProgress(false);
|
||||
this.taskQueryResource = taskQueryResource.taskHistoryEvents ? taskQueryResource : null;
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import { HttpErrorResponse } from '@angular/common/http';
|
||||
import { ERROR_TYPES, errors } from './errors';
|
||||
import { HttpErrorResponse } from "@angular/common/http";
|
||||
|
||||
export class ErrorModel {
|
||||
public readonly errObj: HttpErrorResponse;
|
||||
|
@ -11,8 +11,8 @@ export class ErrorModel {
|
|||
this.message = errors.get(key).text;
|
||||
this.errObj = passedError;
|
||||
if (addition) {
|
||||
addition.forEach((value: string, key: string) => {
|
||||
this.message.replace(`{${key}}`, value);
|
||||
addition.forEach((value: string, replacementKey: string) => {
|
||||
this.message.replace(`{${replacementKey}}`, value);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
|
@ -32,7 +32,6 @@ export enum ERROR_TYPES {
|
|||
GENERAL_ERR,
|
||||
ACCESS_ERR,
|
||||
MARK_ERR,
|
||||
NONE,
|
||||
|
||||
// ALERTS
|
||||
INFO_ALERT,
|
||||
|
@ -60,251 +59,251 @@ export enum ERROR_TYPES {
|
|||
export const errors = new Map<ERROR_TYPES, Pair>([
|
||||
// access-items-management.component.ts
|
||||
[ERROR_TYPES.FETCH_ERR, new Pair(
|
||||
'There was error while retrieving your access ids with groups.',
|
||||
''
|
||||
'There was error while retrieving your access ids with groups.',
|
||||
''
|
||||
)],
|
||||
// access-items-management.component.ts
|
||||
[ERROR_TYPES.FETCH_ERR_2, new Pair(
|
||||
'There was error while retrieving your access items ',
|
||||
''
|
||||
'There was error while retrieving your access items ',
|
||||
''
|
||||
)],
|
||||
// access-items-management.component.ts
|
||||
[ERROR_TYPES.DELETE_ERR, new Pair(
|
||||
'You can\'t delete a group',
|
||||
'',
|
||||
'You can\'t delete a group',
|
||||
'',
|
||||
)],
|
||||
// classification-details.component
|
||||
[ERROR_TYPES.CREATE_ERR, new Pair(
|
||||
'There was an error creating a classification',
|
||||
'',
|
||||
'There was an error creating a classification',
|
||||
'',
|
||||
)],
|
||||
// classification-details.component
|
||||
[ERROR_TYPES.REMOVE_ERR, new Pair(
|
||||
'There was error while removing your classification',
|
||||
''
|
||||
'There was error while removing your classification',
|
||||
''
|
||||
)],
|
||||
// classification-details.component
|
||||
[ERROR_TYPES.SAVE_ERR, new Pair(
|
||||
'There was error while saving your classification',
|
||||
''
|
||||
'There was error while saving your classification',
|
||||
''
|
||||
)],
|
||||
// classification-details.component
|
||||
[ERROR_TYPES.SELECT_ERR, new Pair(
|
||||
'There is no classification selected',
|
||||
'Please check if you are creating a classification'
|
||||
'There is no classification selected',
|
||||
'Please check if you are creating a classification'
|
||||
)],
|
||||
// import-export.component
|
||||
[ERROR_TYPES.FILE_ERR, new Pair(
|
||||
'Wrong format',
|
||||
'This file format is not allowed! Please use a .json file.'
|
||||
'Wrong format',
|
||||
'This file format is not allowed! Please use a .json file.'
|
||||
)],
|
||||
// import-export.component
|
||||
[ERROR_TYPES.IMPORT_ERR_1, new Pair(
|
||||
'Import was not successful',
|
||||
'Import was not successful, you have no access to apply this operation.'
|
||||
'Import was not successful',
|
||||
'Import was not successful, you have no access to apply this operation.'
|
||||
)],
|
||||
// import-export.component
|
||||
[ERROR_TYPES.IMPORT_ERR_2, new Pair(
|
||||
'Import was not successful',
|
||||
'Import was not successful, operation was not found.'
|
||||
'Import was not successful',
|
||||
'Import was not successful, operation was not found.'
|
||||
)],
|
||||
// import-export.component
|
||||
[ERROR_TYPES.IMPORT_ERR_3, new Pair(
|
||||
'Import was not successful',
|
||||
'Import was not successful, operation has some conflicts.'
|
||||
'Import was not successful',
|
||||
'Import was not successful, operation has some conflicts.'
|
||||
)],
|
||||
// import-export.component
|
||||
[ERROR_TYPES.IMPORT_ERR_4, new Pair(
|
||||
'Import was not successful',
|
||||
'Import was not successful, maximum file size exceeded.'
|
||||
'Import was not successful',
|
||||
'Import was not successful, maximum file size exceeded.'
|
||||
)],
|
||||
// import-export.component
|
||||
[ERROR_TYPES.UPLOAD_ERR, new Pair(
|
||||
'Upload failed',
|
||||
`The upload didn't proceed sucessfully.
|
||||
'Upload failed',
|
||||
`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(
|
||||
'',
|
||||
'An error occurred while fetching the task'
|
||||
'',
|
||||
'An error occurred while fetching the task'
|
||||
)],
|
||||
// workbasket-details.component
|
||||
[ERROR_TYPES.FETCH_ERR_4, new Pair(
|
||||
'An error occurred while fetching the workbasket',
|
||||
''
|
||||
'An error occurred while fetching the workbasket',
|
||||
''
|
||||
)],
|
||||
// access-items.component
|
||||
[ERROR_TYPES.SAVE_ERR_2, new Pair(
|
||||
'There was error while saving your workbasket\'s access items',
|
||||
''
|
||||
'There was error while saving your workbasket\'s access items',
|
||||
''
|
||||
)],
|
||||
// workbaskets-distribution-targets.component
|
||||
[ERROR_TYPES.SAVE_ERR_3, new Pair(
|
||||
'There was error while saving your workbasket\'s distribution targets',
|
||||
'',
|
||||
'There was error while saving your workbasket\'s distribution targets',
|
||||
'',
|
||||
)],
|
||||
// workbasket-information.component
|
||||
[ERROR_TYPES.REMOVE_ERR_2, new Pair(
|
||||
'There was an error removing distribution target for {workbasketId}.',
|
||||
'',
|
||||
'There was an error removing distribution target for {workbasketId}.',
|
||||
'',
|
||||
)],
|
||||
// workbasket-information.component
|
||||
[ERROR_TYPES.SAVE_ERR_4, new Pair(
|
||||
'There was error while saving your workbasket',
|
||||
''
|
||||
'There was error while saving your workbasket',
|
||||
''
|
||||
)],
|
||||
// workbasket-information.component
|
||||
[ERROR_TYPES.CREATE_ERR_2, new Pair(
|
||||
'There was an error creating a workbasket',
|
||||
''
|
||||
'There was an error creating a workbasket',
|
||||
''
|
||||
)],
|
||||
// workbasket-information.component
|
||||
[ERROR_TYPES.MARK_ERR, new Pair(
|
||||
'Workbasket was marked for deletion.',
|
||||
'The Workbasket {workbasketId} still contains completed tasks and could not be deleted.'
|
||||
'Workbasket was marked for deletion.',
|
||||
'The Workbasket {workbasketId} still contains completed tasks and could not be deleted.'
|
||||
+ 'Instead is was marked for deletion and will be deleted automatically '
|
||||
+ 'as soon as the completed tasks are deleted from the database.'
|
||||
)],
|
||||
// domain.guard
|
||||
[ERROR_TYPES.FETCH_ERR_5, new Pair(
|
||||
'There was an error, please contact with your administrator',
|
||||
'There was an error getting Domains'
|
||||
'There was an error, please contact with your administrator',
|
||||
'There was an error getting Domains'
|
||||
)],
|
||||
// history.guard
|
||||
[ERROR_TYPES.FETCH_ERR_6, new Pair(
|
||||
'There was an error, please contact with your administrator',
|
||||
'There was an error getting history provider'
|
||||
'There was an error, please contact with your administrator',
|
||||
'There was an error getting history provider'
|
||||
)],
|
||||
// http-client-interceptor.service
|
||||
[ERROR_TYPES.ACCESS_ERR, new Pair(
|
||||
'You have no access to this resource ',
|
||||
''
|
||||
'You have no access to this resource ',
|
||||
''
|
||||
)],
|
||||
// http-client-interceptor.service
|
||||
[ERROR_TYPES.GENERAL_ERR, new Pair(
|
||||
'There was error, please contact with your administrator',
|
||||
''
|
||||
'There was error, please contact with your administrator',
|
||||
''
|
||||
)],
|
||||
// spinner.component
|
||||
[ERROR_TYPES.TIMEOUT_ERR, new Pair(
|
||||
'There was an error with your request, please make sure you have internet connection',
|
||||
'Request time exceeded'
|
||||
'There was an error with your request, please make sure you have internet connection',
|
||||
'Request time exceeded'
|
||||
)],
|
||||
// taskdetails.component
|
||||
[ERROR_TYPES.FETCH_ERR_7, new Pair(
|
||||
'An error occurred while fetching the task',
|
||||
''
|
||||
'An error occurred while fetching the task',
|
||||
''
|
||||
)],
|
||||
// taskdetails.component
|
||||
[ERROR_TYPES.DELETE_ERR_2, new Pair(
|
||||
'An error occurred while deleting the task',
|
||||
''
|
||||
'An error occurred while deleting the task',
|
||||
''
|
||||
)],
|
||||
|
||||
// ALERTS
|
||||
|
||||
// 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
|
||||
// access-items.component
|
||||
// workbasket.distribution-targets.component
|
||||
// workbasket-information.component
|
||||
[ERROR_TYPES.INFO_ALERT, new Pair(
|
||||
'Reset edited fields',
|
||||
''
|
||||
'Reset edited fields',
|
||||
''
|
||||
)],
|
||||
// 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
|
||||
[ERROR_TYPES.SUCCESS_ALERT_6, new Pair(
|
||||
'Import was successful',
|
||||
''
|
||||
'Import was successful',
|
||||
''
|
||||
)],
|
||||
// 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 {workbasketId} has been deleted.',
|
||||
''
|
||||
'The Workbasket {workbasketId} has been deleted.',
|
||||
''
|
||||
)],
|
||||
// forms-validator.service
|
||||
[ERROR_TYPES.WARNING_ALERT, new Pair(
|
||||
'There are some empty fields which are required.',
|
||||
''
|
||||
'There are some empty fields which are required.',
|
||||
''
|
||||
)],
|
||||
// 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
|
||||
[ERROR_TYPES.DANGER_ALERT, new Pair(
|
||||
'There was an error while updating.',
|
||||
''
|
||||
'There was an error while updating.',
|
||||
''
|
||||
)],
|
||||
// taskdetails.component
|
||||
[ERROR_TYPES.SUCCESS_ALERT_13, new Pair(
|
||||
'Task {this.currentId} was created successfully.',
|
||||
''
|
||||
'Task {this.currentId} was created successfully.',
|
||||
''
|
||||
)],
|
||||
// taskdetails.component
|
||||
[ERROR_TYPES.SUCCESS_ALERT_14, new Pair(
|
||||
'Updating was successful.',
|
||||
''
|
||||
'Updating was successful.',
|
||||
''
|
||||
)],
|
||||
// taskdetails.component
|
||||
[ERROR_TYPES.DANGER_ALERT_2, new Pair(
|
||||
'There was an error while creating a new task.',
|
||||
''
|
||||
'There was an error while creating a new task.',
|
||||
''
|
||||
)],
|
||||
// task-master.component
|
||||
[ERROR_TYPES.INFO_ALERT_2, new Pair(
|
||||
'The selected Workbasket is empty!',
|
||||
''
|
||||
'The selected Workbasket is empty!',
|
||||
''
|
||||
)],
|
||||
]);
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
import { Injectable } from '@angular/core';
|
||||
import { Observable, Subject } from 'rxjs';
|
||||
import { HttpErrorResponse } from '@angular/common/http';
|
||||
import { ErrorModel } from '../../models/error-model';
|
||||
import { ERROR_TYPES } from '../../models/errors';
|
||||
import { HttpErrorResponse } from "@angular/common/http";
|
||||
|
||||
@Injectable({
|
||||
providedIn: 'root'
|
||||
|
|
|
@ -13,7 +13,7 @@ import { expandTop } from '../animations/expand.animation';
|
|||
|
||||
export class AlertComponent implements OnInit {
|
||||
alert: AlertModel;
|
||||
private timeoutId: any; //NodeJS.Timer cannot be imported..
|
||||
private timeoutId: any; // NodeJS.Timer cannot be imported..
|
||||
constructor(private alertService: AlertService) { }
|
||||
|
||||
ngOnInit() {
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import {async, ComponentFixture, TestBed} from '@angular/core/testing';
|
||||
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
|
||||
import {ErrorModalComponent} from './error-modal.component';
|
||||
import { ErrorModalComponent } from './error-modal.component';
|
||||
|
||||
describe('GeneralMessageModalComponent', () => {
|
||||
let component: ErrorModalComponent;
|
||||
|
@ -10,7 +10,7 @@ describe('GeneralMessageModalComponent', () => {
|
|||
TestBed.configureTestingModule({
|
||||
declarations: [ErrorModalComponent]
|
||||
})
|
||||
.compileComponents();
|
||||
.compileComponents();
|
||||
}));
|
||||
|
||||
beforeEach(() => {
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
import {Component, EventEmitter, OnInit, Output, ViewChild} from '@angular/core';
|
||||
import {ErrorModel} from "../../models/error-model";
|
||||
import {Subscription} from "rxjs";
|
||||
import {ErrorsService} from "../../services/errors/errors.service";
|
||||
import { Component, EventEmitter, OnInit, Output, ViewChild } from '@angular/core';
|
||||
import { Subscription } from 'rxjs';
|
||||
import { ErrorModel } from '../../models/error-model';
|
||||
import { ErrorsService } from '../../services/errors/errors.service';
|
||||
|
||||
@Component({
|
||||
selector: 'error-modal',
|
||||
|
|
|
@ -4,22 +4,22 @@ import { Observable } from 'rxjs';
|
|||
import { RequestInProgressService } from 'app/services/requestInProgress/request-in-progress.service';
|
||||
import { environment } from 'environments/environment';
|
||||
import { tap } from 'rxjs/operators';
|
||||
import { ErrorsService } from "../../../services/errors/errors.service";
|
||||
import { ERROR_TYPES } from "../../../models/errors";
|
||||
import { ErrorsService } from '../../../services/errors/errors.service';
|
||||
import { ERROR_TYPES } from '../../../models/errors';
|
||||
|
||||
@Injectable()
|
||||
export class HttpClientInterceptor implements HttpInterceptor {
|
||||
constructor(
|
||||
private requestInProgressService: RequestInProgressService,
|
||||
private errorsService: ErrorsService
|
||||
private requestInProgressService: RequestInProgressService,
|
||||
private errorsService: ErrorsService
|
||||
) {
|
||||
|
||||
}
|
||||
|
||||
intercept(request: HttpRequest<any>, next: HttpHandler): Observable<HttpEvent<any>> {
|
||||
let req = request.clone({headers: request.headers.set('Content-Type', 'application/hal+json')});
|
||||
let req = request.clone({ headers: request.headers.set('Content-Type', 'application/hal+json') });
|
||||
if (!environment.production) {
|
||||
req = req.clone({headers: req.headers.set('Authorization', 'Basic YWRtaW46YWRtaW4=')});
|
||||
req = req.clone({ headers: req.headers.set('Authorization', 'Basic YWRtaW46YWRtaW4=') });
|
||||
}
|
||||
return next.handle(req).pipe(tap(() => {
|
||||
}, error => {
|
||||
|
|
|
@ -15,7 +15,6 @@ import { ClassificationsService } from 'app/shared/services/classifications/clas
|
|||
* Components
|
||||
*/
|
||||
import { GeneralMessageModalComponent } from 'app/shared/general-message-modal/general-message-modal.component';
|
||||
import { ErrorModalComponent } from "./error-message-modal/error-modal.component";
|
||||
import { SpinnerComponent } from 'app/shared/spinner/spinner.component';
|
||||
import { AlertComponent } from 'app/shared/alert/alert.component';
|
||||
import { MasterAndDetailComponent } from 'app/shared/master-and-detail/master-and-detail.component';
|
||||
|
@ -25,6 +24,7 @@ import { RemoveConfirmationComponent } from 'app/shared/remove-confirmation/remo
|
|||
import { FilterComponent } from 'app/shared/filter/filter.component';
|
||||
import { IconTypeComponent } from 'app/administration/components/type-icon/icon-type.component';
|
||||
import { FieldErrorDisplayComponent } from 'app/shared/field-error-display/field-error-display.component';
|
||||
import { ErrorModalComponent } from './error-message-modal/error-modal.component';
|
||||
import { SortComponent } from './sort/sort.component';
|
||||
import { PaginationComponent } from './pagination/pagination.component';
|
||||
import { NumberPickerComponent } from './number-picker/number-picker.component';
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import { Component, EventEmitter, Input, OnDestroy, Output, ViewChild } from '@angular/core';
|
||||
import { ERROR_TYPES } from '../../models/errors';
|
||||
import { ErrorsService } from "../../services/errors/errors.service";
|
||||
import { ErrorsService } from '../../services/errors/errors.service';
|
||||
|
||||
declare let $: any;
|
||||
|
||||
|
@ -14,16 +14,20 @@ export class SpinnerComponent implements OnDestroy {
|
|||
showSpinner: boolean;
|
||||
@Input()
|
||||
delay = 250;
|
||||
|
||||
@Input()
|
||||
isModal = false;
|
||||
|
||||
@Input()
|
||||
positionClass: string;
|
||||
|
||||
@Output()
|
||||
spinnerIsRunning = new EventEmitter<boolean>();
|
||||
|
||||
private currentTimeout: any;
|
||||
private requestTimeout: any;
|
||||
private maxRequestTimeout = 10000;
|
||||
@ViewChild('spinnerModal', {static: true})
|
||||
@ViewChild('spinnerModal', { static: true })
|
||||
private modal;
|
||||
|
||||
constructor(private errorsService: ErrorsService) {
|
||||
|
|
|
@ -16,7 +16,7 @@ import { Workbasket } from 'app/models/workbasket';
|
|||
import { WorkplaceService } from 'app/workplace/services/workplace.service';
|
||||
import { MasterAndDetailService } from 'app/services/masterAndDetail/master-and-detail.service';
|
||||
import { ERROR_TYPES } from '../../models/errors';
|
||||
import { ErrorsService } from "../../services/errors/errors.service";
|
||||
import { ErrorsService } from '../../services/errors/errors.service';
|
||||
|
||||
@Component({
|
||||
selector: 'taskana-task-details',
|
||||
|
@ -38,15 +38,15 @@ export class TaskdetailsComponent implements OnInit, OnDestroy {
|
|||
private deleteTaskSubscription: Subscription;
|
||||
|
||||
constructor(private route: ActivatedRoute,
|
||||
private taskService: TaskService,
|
||||
private workplaceService: WorkplaceService,
|
||||
private router: Router,
|
||||
private removeConfirmationService: RemoveConfirmationService,
|
||||
private requestInProgressService: RequestInProgressService,
|
||||
private alertService: AlertService,
|
||||
private generalModalService: GeneralModalService,
|
||||
private errorsService: ErrorsService,
|
||||
private masterAndDetailService: MasterAndDetailService) {
|
||||
private taskService: TaskService,
|
||||
private workplaceService: WorkplaceService,
|
||||
private router: Router,
|
||||
private removeConfirmationService: RemoveConfirmationService,
|
||||
private requestInProgressService: RequestInProgressService,
|
||||
private alertService: AlertService,
|
||||
private generalModalService: GeneralModalService,
|
||||
private errorsService: ErrorsService,
|
||||
private masterAndDetailService: MasterAndDetailService) {
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
|
@ -68,10 +68,10 @@ export class TaskdetailsComponent implements OnInit, OnDestroy {
|
|||
}
|
||||
|
||||
resetTask(): void {
|
||||
this.task = {...this.taskClone};
|
||||
this.task = { ...this.taskClone };
|
||||
this.task.customAttributes = this.taskClone.customAttributes.slice(0);
|
||||
this.task.callbackInfo = this.taskClone.callbackInfo.slice(0);
|
||||
this.task.primaryObjRef = {...this.taskClone.primaryObjRef};
|
||||
this.task.primaryObjRef = { ...this.taskClone.primaryObjRef };
|
||||
this.alertService.triggerAlert(new AlertModel(AlertType.INFO, 'Reset edited fields'));
|
||||
}
|
||||
|
||||
|
@ -97,7 +97,7 @@ export class TaskdetailsComponent implements OnInit, OnDestroy {
|
|||
}
|
||||
|
||||
openTask() {
|
||||
this.router.navigate([{outlets: {detail: `task/${this.currentId}`}}], {relativeTo: this.route.parent});
|
||||
this.router.navigate([{ outlets: { detail: `task/${this.currentId}` } }], { relativeTo: this.route.parent });
|
||||
}
|
||||
|
||||
workOnTaskDisabled(): boolean {
|
||||
|
@ -106,7 +106,7 @@ export class TaskdetailsComponent implements OnInit, OnDestroy {
|
|||
|
||||
deleteTask(): void {
|
||||
this.removeConfirmationService.setRemoveConfirmation(this.deleteTaskConfirmation.bind(this),
|
||||
`You are going to delete Task: ${this.currentId}. Can you confirm this action?`);
|
||||
`You are going to delete Task: ${this.currentId}. Can you confirm this action?`);
|
||||
}
|
||||
|
||||
deleteTaskConfirmation(): void {
|
||||
|
@ -126,7 +126,7 @@ export class TaskdetailsComponent implements OnInit, OnDestroy {
|
|||
backClicked(): void {
|
||||
delete this.task;
|
||||
this.taskService.selectTask(this.task);
|
||||
this.router.navigate(['./'], {relativeTo: this.route.parent});
|
||||
this.router.navigate(['./'], { relativeTo: this.route.parent });
|
||||
}
|
||||
|
||||
ngOnDestroy(): void {
|
||||
|
@ -174,7 +174,7 @@ export class TaskdetailsComponent implements OnInit, OnDestroy {
|
|||
this.task = task;
|
||||
this.taskService.selectTask(this.task);
|
||||
this.taskService.publishUpdatedTask(task);
|
||||
this.router.navigate([`../${task.taskId}`], {relativeTo: this.route});
|
||||
this.router.navigate([`../${task.taskId}`], { relativeTo: this.route });
|
||||
}, err => {
|
||||
this.requestInProgressService.setRequestInProgress(false);
|
||||
// new Key ALERT_TYPES.DANGER_ALERT_2
|
||||
|
@ -189,9 +189,9 @@ export class TaskdetailsComponent implements OnInit, OnDestroy {
|
|||
}
|
||||
|
||||
private cloneTask() {
|
||||
this.taskClone = {...this.task};
|
||||
this.taskClone = { ...this.task };
|
||||
this.taskClone.customAttributes = this.task.customAttributes.slice(0);
|
||||
this.taskClone.callbackInfo = this.task.callbackInfo.slice(0);
|
||||
this.taskClone.primaryObjRef = {...this.task.primaryObjRef};
|
||||
this.taskClone.primaryObjRef = { ...this.task.primaryObjRef };
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue