temp commit before rebase
This commit is contained in:
parent
20c07f2cfe
commit
092b3a3cc9
|
@ -16,6 +16,7 @@ import { AlertService } from 'app/services/alert/alert.service';
|
||||||
import { RequestInProgressService } from '../../services/requestInProgress/request-in-progress.service';
|
import { RequestInProgressService } from '../../services/requestInProgress/request-in-progress.service';
|
||||||
import { AccessIdsService } from '../../shared/services/access-ids/access-ids.service';
|
import { AccessIdsService } from '../../shared/services/access-ids/access-ids.service';
|
||||||
import { AccessIdDefinition } from '../../models/access-id';
|
import { AccessIdDefinition } from '../../models/access-id';
|
||||||
|
import { ERROR_TYPES } from '../../services/general-modal/errors';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'taskana-access-items-management',
|
selector: 'taskana-access-items-management',
|
||||||
|
@ -98,6 +99,7 @@ export class AccessItemsManagementComponent implements OnInit, OnDestroy {
|
||||||
this.belongingGroups = accessIdsWithGroups.filter(item => item.accessId.includes(this.groupsKey));
|
this.belongingGroups = accessIdsWithGroups.filter(item => item.accessId.includes(this.groupsKey));
|
||||||
this.searchForAccessItemsWorkbaskets();
|
this.searchForAccessItemsWorkbaskets();
|
||||||
},
|
},
|
||||||
|
// new Key: ERROR_TYPES.FETCH_ERR
|
||||||
error => {
|
error => {
|
||||||
this.requestInProgressService.setRequestInProgress(false);
|
this.requestInProgressService.setRequestInProgress(false);
|
||||||
this.generalModalService.triggerMessage(
|
this.generalModalService.triggerMessage(
|
||||||
|
@ -133,6 +135,7 @@ export class AccessItemsManagementComponent implements OnInit, OnDestroy {
|
||||||
this.setAccessItemsGroups(accessItemsResource ? accessItemsResource.accessItems : []);
|
this.setAccessItemsGroups(accessItemsResource ? accessItemsResource.accessItems : []);
|
||||||
this.requestInProgressService.setRequestInProgress(false);
|
this.requestInProgressService.setRequestInProgress(false);
|
||||||
},
|
},
|
||||||
|
// new Key: ERROR_TYPES.FETCH_ERR_2
|
||||||
error => {
|
error => {
|
||||||
this.requestInProgressService.setRequestInProgress(false);
|
this.requestInProgressService.setRequestInProgress(false);
|
||||||
this.generalModalService.triggerMessage(
|
this.generalModalService.triggerMessage(
|
||||||
|
@ -157,6 +160,7 @@ export class AccessItemsManagementComponent implements OnInit, OnDestroy {
|
||||||
this.requestInProgressService.setRequestInProgress(true);
|
this.requestInProgressService.setRequestInProgress(true);
|
||||||
this.accessIdsService.removeAccessItemsPermissions(this.accessIdSelected)
|
this.accessIdsService.removeAccessItemsPermissions(this.accessIdSelected)
|
||||||
.subscribe(
|
.subscribe(
|
||||||
|
// new Key: ALERT_TYPES.SUCCESS_ALERT
|
||||||
response => {
|
response => {
|
||||||
this.requestInProgressService.setRequestInProgress(false);
|
this.requestInProgressService.setRequestInProgress(false);
|
||||||
this.alertService.triggerAlert(
|
this.alertService.triggerAlert(
|
||||||
|
@ -168,6 +172,7 @@ export class AccessItemsManagementComponent implements OnInit, OnDestroy {
|
||||||
);
|
);
|
||||||
this.searchForAccessItemsWorkbaskets();
|
this.searchForAccessItemsWorkbaskets();
|
||||||
},
|
},
|
||||||
|
// new Key: ERROR_TYPES.DELETE_ERR
|
||||||
error => {
|
error => {
|
||||||
this.requestInProgressService.setRequestInProgress(false);
|
this.requestInProgressService.setRequestInProgress(false);
|
||||||
this.generalModalService.triggerMessage(
|
this.generalModalService.triggerMessage(
|
||||||
|
|
|
@ -25,6 +25,7 @@ import { NgForm } from '@angular/forms';
|
||||||
import { FormsValidatorService } from 'app/shared/services/forms/forms-validator.service';
|
import { FormsValidatorService } from 'app/shared/services/forms/forms-validator.service';
|
||||||
import { ImportExportService } from 'app/administration/services/import-export/import-export.service';
|
import { ImportExportService } from 'app/administration/services/import-export/import-export.service';
|
||||||
import { CustomFieldsService } from '../../../services/custom-fields/custom-fields.service';
|
import { CustomFieldsService } from '../../../services/custom-fields/custom-fields.service';
|
||||||
|
import { ERROR_TYPES } from '../../../services/general-modal/errors';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'taskana-classification-details',
|
selector: 'taskana-classification-details',
|
||||||
|
@ -175,9 +176,11 @@ export class ClassificationDetailsComponent implements OnInit, OnDestroy {
|
||||||
.subscribe((classification: ClassificationDefinition) => {
|
.subscribe((classification: ClassificationDefinition) => {
|
||||||
this.classification = classification;
|
this.classification = classification;
|
||||||
this.classificationsService.selectClassification(classification);
|
this.classificationsService.selectClassification(classification);
|
||||||
|
// new Key ALERT_TYPES.SUCCESS_ALERT_2
|
||||||
this.alertService.triggerAlert(new AlertModel(AlertType.SUCCESS, `Classification ${classification.key} was saved successfully`));
|
this.alertService.triggerAlert(new AlertModel(AlertType.SUCCESS, `Classification ${classification.key} was saved successfully`));
|
||||||
this.afterRequest();
|
this.afterRequest();
|
||||||
},
|
},
|
||||||
|
// new Key: ERROR_TYPES.CREATE_ERR
|
||||||
error => {
|
error => {
|
||||||
this.generalModalService.triggerMessage(new MessageModal('There was an error creating a classification', error));
|
this.generalModalService.triggerMessage(new MessageModal('There was an error creating a classification', error));
|
||||||
this.afterRequest();
|
this.afterRequest();
|
||||||
|
@ -188,11 +191,13 @@ export class ClassificationDetailsComponent implements OnInit, OnDestroy {
|
||||||
this.classification._links.self.href, this.classification
|
this.classification._links.self.href, this.classification
|
||||||
));
|
));
|
||||||
this.afterRequest();
|
this.afterRequest();
|
||||||
|
// new Key: ALERT_TYPES.SUCCESS_ALERT_3
|
||||||
this.alertService.triggerAlert(
|
this.alertService.triggerAlert(
|
||||||
new AlertModel(AlertType.SUCCESS, `Classification ${this.classification.key} was saved successfully`)
|
new AlertModel(AlertType.SUCCESS, `Classification ${this.classification.key} was saved successfully`)
|
||||||
);
|
);
|
||||||
this.cloneClassification(this.classification);
|
this.cloneClassification(this.classification);
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
|
// new Key: ERROR_TYPES.SAVE_ERR
|
||||||
this.generalModalService.triggerMessage(new MessageModal('There was error while saving your classification', error));
|
this.generalModalService.triggerMessage(new MessageModal('There was error while saving your classification', error));
|
||||||
this.afterRequest();
|
this.afterRequest();
|
||||||
}
|
}
|
||||||
|
@ -201,6 +206,7 @@ export class ClassificationDetailsComponent implements OnInit, OnDestroy {
|
||||||
|
|
||||||
onClear() {
|
onClear() {
|
||||||
this.formsValidatorService.formSubmitAttempt = false;
|
this.formsValidatorService.formSubmitAttempt = false;
|
||||||
|
// 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'));
|
||||||
this.classification = { ...this.classificationClone };
|
this.classification = { ...this.classificationClone };
|
||||||
}
|
}
|
||||||
|
@ -275,6 +281,7 @@ export class ClassificationDetailsComponent implements OnInit, OnDestroy {
|
||||||
private removeClassificationConfirmation() {
|
private removeClassificationConfirmation() {
|
||||||
if (!this.classification || !this.classification.classificationId) {
|
if (!this.classification || !this.classification.classificationId) {
|
||||||
this.generalModalService.triggerMessage(
|
this.generalModalService.triggerMessage(
|
||||||
|
// new Key ERROR_TYPES.SELECT_ERR
|
||||||
new MessageModal('There is no classification selected', 'Please check if you are creating a classification')
|
new MessageModal('There is no classification selected', 'Please check if you are creating a classification')
|
||||||
);
|
);
|
||||||
return;
|
return;
|
||||||
|
@ -290,8 +297,10 @@ export class ClassificationDetailsComponent implements OnInit, OnDestroy {
|
||||||
this.afterRequest();
|
this.afterRequest();
|
||||||
this.classificationsService.selectClassification();
|
this.classificationsService.selectClassification();
|
||||||
this.router.navigate(['taskana/administration/classifications']);
|
this.router.navigate(['taskana/administration/classifications']);
|
||||||
|
// new Key: ALERT_TYPES.SUCCESS_ALERT_4
|
||||||
this.alertService.triggerAlert(new AlertModel(AlertType.SUCCESS, `Classification ${key} was removed successfully`));
|
this.alertService.triggerAlert(new AlertModel(AlertType.SUCCESS, `Classification ${key} was removed successfully`));
|
||||||
}, error => {
|
}, error => {
|
||||||
|
// new Key: ERROR_TYPES.REMOVE_ERR
|
||||||
this.generalModalService.triggerMessage(new MessageModal('There was error while removing your classification', error));
|
this.generalModalService.triggerMessage(new MessageModal('There was error while removing your classification', error));
|
||||||
this.afterRequest();
|
this.afterRequest();
|
||||||
});
|
});
|
||||||
|
|
|
@ -13,6 +13,7 @@ import { ImportExportService } from 'app/administration/services/import-export/i
|
||||||
import { ClassificationDefinition } from '../../../../models/classification-definition';
|
import { ClassificationDefinition } from '../../../../models/classification-definition';
|
||||||
import { AlertModel, AlertType } from '../../../../models/alert';
|
import { AlertModel, AlertType } from '../../../../models/alert';
|
||||||
import { AlertService } from '../../../../services/alert/alert.service';
|
import { AlertService } from '../../../../services/alert/alert.service';
|
||||||
|
import { ERROR_TYPES } from '../../../../services/general-modal/errors';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'taskana-classification-list',
|
selector: 'taskana-classification-list',
|
||||||
|
@ -130,6 +131,7 @@ export class ClassificationListComponent implements OnInit, OnDestroy {
|
||||||
this.requestInProgress = false;
|
this.requestInProgress = false;
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// new Error-Key: ALERT_TYPES.SUCCESS_ALERT_5
|
||||||
if (key) {
|
if (key) {
|
||||||
this.alertService.triggerAlert(new AlertModel(AlertType.SUCCESS, `Classification ${key} was saved successfully`));
|
this.alertService.triggerAlert(new AlertModel(AlertType.SUCCESS, `Classification ${key} was saved successfully`));
|
||||||
}
|
}
|
||||||
|
|
|
@ -10,6 +10,7 @@ import { AlertService } from 'app/services/alert/alert.service';
|
||||||
import { AlertModel, AlertType } from 'app/models/alert';
|
import { AlertModel, AlertType } from 'app/models/alert';
|
||||||
import { UploadService } from 'app/shared/services/upload/upload.service';
|
import { UploadService } from 'app/shared/services/upload/upload.service';
|
||||||
import { ImportExportService } from 'app/administration/services/import-export/import-export.service';
|
import { ImportExportService } from 'app/administration/services/import-export/import-export.service';
|
||||||
|
import { ERROR_TYPES } from '../../../services/general-modal/errors';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'taskana-import-export-component',
|
selector: 'taskana-import-export-component',
|
||||||
|
@ -88,6 +89,7 @@ export class ImportExportComponent implements OnInit {
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
file.value = '';
|
file.value = '';
|
||||||
|
// new Key: ERROR_TYPES.FILE_ERR
|
||||||
this.generalModalService.triggerMessage(new MessageModal('Wrong format',
|
this.generalModalService.triggerMessage(new MessageModal('Wrong format',
|
||||||
'This file format is not allowed! Please use a .json file.'));
|
'This file format is not allowed! Please use a .json file.'));
|
||||||
}
|
}
|
||||||
|
@ -104,16 +106,21 @@ export class ImportExportComponent implements OnInit {
|
||||||
if (event.readyState === 4 && event.status >= 400) {
|
if (event.readyState === 4 && event.status >= 400) {
|
||||||
let title;
|
let title;
|
||||||
if (event.status === 401) {
|
if (event.status === 401) {
|
||||||
|
// new Key ERROR_TYPES.IMPORT_ERR_1
|
||||||
title = 'Import was not successful, you have no access to apply this operation.';
|
title = 'Import was not successful, you have no access to apply this operation.';
|
||||||
} else if (event.status === 404) {
|
} else if (event.status === 404) {
|
||||||
|
// new Key ERROR_TYPES.IMPORT_ERR_2
|
||||||
title = 'Import was not successful, operation was not found.';
|
title = 'Import was not successful, operation was not found.';
|
||||||
} else if (event.status === 409) {
|
} else if (event.status === 409) {
|
||||||
|
// new Key ERROR_TYPES.IMPORT_ERR_3
|
||||||
title = 'Import was not successful, operation has some conflicts.';
|
title = 'Import was not successful, operation has some conflicts.';
|
||||||
} else if (event.status === 413) {
|
} else if (event.status === 413) {
|
||||||
|
// new Key ERROR_TYPES.IMPORT_ERR_4
|
||||||
title = 'Import was not successful, maximum file size exceeded.';
|
title = 'Import was not successful, maximum file size exceeded.';
|
||||||
}
|
}
|
||||||
this.errorHandler(title, JSON.parse(event.responseText).message);
|
this.errorHandler(title, JSON.parse(event.responseText).message);
|
||||||
} else if (event.readyState === 4 && event.status === 200) {
|
} else if (event.readyState === 4 && event.status === 200) {
|
||||||
|
// new Key: ALERT_TYPES.SUCCESS_ALERT_6
|
||||||
this.alertService.triggerAlert(new AlertModel(AlertType.SUCCESS, 'Import was successful'));
|
this.alertService.triggerAlert(new AlertModel(AlertType.SUCCESS, 'Import was successful'));
|
||||||
this.importExportService.setImportingFinished(true);
|
this.importExportService.setImportingFinished(true);
|
||||||
this.resetProgress();
|
this.resetProgress();
|
||||||
|
@ -121,6 +128,7 @@ export class ImportExportComponent implements OnInit {
|
||||||
}
|
}
|
||||||
|
|
||||||
private onFailedResponse(event) {
|
private onFailedResponse(event) {
|
||||||
|
// new Key ERROR_TYPES.UPLOAD_ERR
|
||||||
this.errorHandler('Upload failed', 'The upload didn\'t proceed sucessfully. \n'
|
this.errorHandler('Upload failed', 'The upload didn\'t proceed sucessfully. \n'
|
||||||
+ 'Probably the uploaded file exceeded the maximum file size of 10 MB');
|
+ 'Probably the uploaded file exceeded the maximum file size of 10 MB');
|
||||||
}
|
}
|
||||||
|
|
|
@ -18,6 +18,7 @@ import { CustomFieldsService } from 'app/services/custom-fields/custom-fields.se
|
||||||
import { highlight } from 'app/shared/animations/validation.animation';
|
import { highlight } from 'app/shared/animations/validation.animation';
|
||||||
import { FormsValidatorService } from 'app/shared/services/forms/forms-validator.service';
|
import { FormsValidatorService } from 'app/shared/services/forms/forms-validator.service';
|
||||||
import { AccessIdDefinition } from 'app/models/access-id';
|
import { AccessIdDefinition } from 'app/models/access-id';
|
||||||
|
import { ERROR_TYPES } from '../../../../services/general-modal/errors';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'taskana-workbasket-access-items',
|
selector: 'taskana-workbasket-access-items',
|
||||||
|
@ -140,7 +141,8 @@ export class AccessItemsComponent implements OnChanges, OnDestroy {
|
||||||
this.AccessItemsForm.reset();
|
this.AccessItemsForm.reset();
|
||||||
this.setAccessItemsGroups(this.accessItemsResetClone);
|
this.setAccessItemsGroups(this.accessItemsResetClone);
|
||||||
this.accessItemsClone = this.cloneAccessItems(this.accessItemsResetClone);
|
this.accessItemsClone = this.cloneAccessItems(this.accessItemsResetClone);
|
||||||
this.alertService.triggerAlert(new AlertModel(AlertType.INFO, 'Reset edited fields'));
|
// new Key ALERT_TYPES.INFO_ALERT
|
||||||
|
this.alertService.triggerAlert(new AlertModel(AlertType.INFO, 'Reset edited fields'));
|
||||||
}
|
}
|
||||||
|
|
||||||
remove(index: number) {
|
remove(index: number) {
|
||||||
|
@ -184,11 +186,13 @@ export class AccessItemsComponent implements OnChanges, OnDestroy {
|
||||||
.subscribe(response => {
|
.subscribe(response => {
|
||||||
this.accessItemsClone = this.cloneAccessItems(this.AccessItemsForm.value.accessItemsGroups);
|
this.accessItemsClone = this.cloneAccessItems(this.AccessItemsForm.value.accessItemsGroups);
|
||||||
this.accessItemsResetClone = 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(
|
this.alertService.triggerAlert(new AlertModel(
|
||||||
AlertType.SUCCESS, `Workbasket ${this.workbasket.name} Access items were saved successfully`
|
AlertType.SUCCESS, `Workbasket ${this.workbasket.name} Access items were saved successfully`
|
||||||
));
|
));
|
||||||
this.requestInProgressService.setRequestInProgress(false);
|
this.requestInProgressService.setRequestInProgress(false);
|
||||||
}, error => {
|
}, error => {
|
||||||
|
// new Key ERROR_TYPES.SAVE_ERR_2
|
||||||
this.generalModalService.triggerMessage(new MessageModal('There was error while saving your workbasket\'s access items', error));
|
this.generalModalService.triggerMessage(new MessageModal('There was error while saving your workbasket\'s access items', error));
|
||||||
this.requestInProgressService.setRequestInProgress(false);
|
this.requestInProgressService.setRequestInProgress(false);
|
||||||
});
|
});
|
||||||
|
|
|
@ -18,6 +18,7 @@ import { TaskanaQueryParameters } from 'app/shared/util/query-parameters';
|
||||||
import { Page } from 'app/models/page';
|
import { Page } from 'app/models/page';
|
||||||
import { OrientationService } from 'app/services/orientation/orientation.service';
|
import { OrientationService } from 'app/services/orientation/orientation.service';
|
||||||
import { Orientation } from 'app/models/orientation';
|
import { Orientation } from 'app/models/orientation';
|
||||||
|
import { ALERT_TYPES, ERROR_TYPES } from '../../../../services/general-modal/errors';
|
||||||
|
|
||||||
export enum Side {
|
export enum Side {
|
||||||
LEFT,
|
LEFT,
|
||||||
|
@ -121,11 +122,13 @@ export class DistributionTargetsComponent implements OnChanges, OnDestroy {
|
||||||
this.distributionTargetsSelected = response.distributionTargets;
|
this.distributionTargetsSelected = response.distributionTargets;
|
||||||
this.distributionTargetsSelectedClone = Object.assign([], this.distributionTargetsSelected);
|
this.distributionTargetsSelectedClone = Object.assign([], this.distributionTargetsSelected);
|
||||||
this.distributionTargetsClone = Object.assign([], this.distributionTargetsLeft);
|
this.distributionTargetsClone = Object.assign([], this.distributionTargetsLeft);
|
||||||
|
// new Key ALERT_TYPES.SUCCESS_ALERT_8
|
||||||
this.alertService.triggerAlert(new AlertModel(AlertType.SUCCESS,
|
this.alertService.triggerAlert(new AlertModel(AlertType.SUCCESS,
|
||||||
`Workbasket ${this.workbasket.name} : Distribution targets were saved successfully`));
|
`Workbasket ${this.workbasket.name} : Distribution targets were saved successfully`));
|
||||||
return true;
|
return true;
|
||||||
},
|
},
|
||||||
error => {
|
error => {
|
||||||
|
// new Key ERROR_TYPES.SAVE_ERR_3
|
||||||
this.generalModalService.triggerMessage(
|
this.generalModalService.triggerMessage(
|
||||||
new MessageModal('There was error while saving your workbasket\'s distribution targets', error)
|
new MessageModal('There was error while saving your workbasket\'s distribution targets', error)
|
||||||
);
|
);
|
||||||
|
@ -136,6 +139,7 @@ export class DistributionTargetsComponent implements OnChanges, OnDestroy {
|
||||||
}
|
}
|
||||||
|
|
||||||
onClear() {
|
onClear() {
|
||||||
|
// 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'));
|
||||||
this.distributionTargetsLeft = Object.assign([], this.distributionTargetsClone);
|
this.distributionTargetsLeft = Object.assign([], this.distributionTargetsClone);
|
||||||
this.distributionTargetsRight = Object.assign([], this.distributionTargetsSelectedClone);
|
this.distributionTargetsRight = Object.assign([], this.distributionTargetsSelectedClone);
|
||||||
|
|
|
@ -18,6 +18,7 @@ import { RequestInProgressService } from 'app/services/requestInProgress/request
|
||||||
import { CustomFieldsService } from 'app/services/custom-fields/custom-fields.service';
|
import { CustomFieldsService } from 'app/services/custom-fields/custom-fields.service';
|
||||||
import { RemoveConfirmationService } from 'app/services/remove-confirmation/remove-confirmation.service';
|
import { RemoveConfirmationService } from 'app/services/remove-confirmation/remove-confirmation.service';
|
||||||
import { FormsValidatorService } from 'app/shared/services/forms/forms-validator.service';
|
import { FormsValidatorService } from 'app/shared/services/forms/forms-validator.service';
|
||||||
|
import {ALERT_TYPES, ERROR_TYPES} from '../../../../services/general-modal/errors';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'taskana-workbasket-information',
|
selector: 'taskana-workbasket-information',
|
||||||
|
@ -123,6 +124,7 @@ implements OnInit, OnChanges, OnDestroy {
|
||||||
onClear() {
|
onClear() {
|
||||||
this.formsValidatorService.formSubmitAttempt = false;
|
this.formsValidatorService.formSubmitAttempt = false;
|
||||||
this.alertService.triggerAlert(
|
this.alertService.triggerAlert(
|
||||||
|
// new Key ALERT_TYPES.INFO_ALERT
|
||||||
new AlertModel(AlertType.INFO, 'Reset edited fields')
|
new AlertModel(AlertType.INFO, 'Reset edited fields')
|
||||||
);
|
);
|
||||||
this.workbasket = { ...this.workbasketClone };
|
this.workbasket = { ...this.workbasketClone };
|
||||||
|
@ -152,6 +154,7 @@ implements OnInit, OnChanges, OnDestroy {
|
||||||
.subscribe(
|
.subscribe(
|
||||||
reponse => {
|
reponse => {
|
||||||
this.requestInProgressService.setRequestInProgress(false);
|
this.requestInProgressService.setRequestInProgress(false);
|
||||||
|
// new Key ALERT_TYPES.SUCCESS_ALERT_9
|
||||||
this.alertService.triggerAlert(
|
this.alertService.triggerAlert(
|
||||||
new AlertModel(
|
new AlertModel(
|
||||||
AlertType.SUCCESS,
|
AlertType.SUCCESS,
|
||||||
|
@ -162,6 +165,7 @@ implements OnInit, OnChanges, OnDestroy {
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
error => {
|
error => {
|
||||||
|
// new Key ERROR_TYPES.REMOVE_ERR_2
|
||||||
this.generalModalService.triggerMessage(
|
this.generalModalService.triggerMessage(
|
||||||
new MessageModal(
|
new MessageModal(
|
||||||
`There was an error removing distribution target for ${
|
`There was an error removing distribution target for ${
|
||||||
|
@ -189,6 +193,7 @@ implements OnInit, OnChanges, OnDestroy {
|
||||||
this.afterRequest();
|
this.afterRequest();
|
||||||
this.workbasket = workbasketUpdated;
|
this.workbasket = workbasketUpdated;
|
||||||
this.workbasketClone = { ...this.workbasket };
|
this.workbasketClone = { ...this.workbasket };
|
||||||
|
// new Key ALERT_TYPES.SUCCESS_ALERT_10
|
||||||
this.alertService.triggerAlert(
|
this.alertService.triggerAlert(
|
||||||
new AlertModel(
|
new AlertModel(
|
||||||
AlertType.SUCCESS,
|
AlertType.SUCCESS,
|
||||||
|
@ -198,6 +203,7 @@ implements OnInit, OnChanges, OnDestroy {
|
||||||
},
|
},
|
||||||
error => {
|
error => {
|
||||||
this.afterRequest();
|
this.afterRequest();
|
||||||
|
// new Key ERROR_TYPES.SAVE_ERR_4
|
||||||
this.generalModalService.triggerMessage(
|
this.generalModalService.triggerMessage(
|
||||||
new MessageModal(
|
new MessageModal(
|
||||||
'There was error while saving your workbasket',
|
'There was error while saving your workbasket',
|
||||||
|
@ -221,6 +227,7 @@ implements OnInit, OnChanges, OnDestroy {
|
||||||
this.addDateToWorkbasket();
|
this.addDateToWorkbasket();
|
||||||
this.workbasketService.createWorkbasket(this.workbasket).subscribe(
|
this.workbasketService.createWorkbasket(this.workbasket).subscribe(
|
||||||
(workbasketUpdated: Workbasket) => {
|
(workbasketUpdated: Workbasket) => {
|
||||||
|
// new Key ALERT_TYPES.SUCCESS_ALERT_11
|
||||||
this.alertService.triggerAlert(
|
this.alertService.triggerAlert(
|
||||||
new AlertModel(
|
new AlertModel(
|
||||||
AlertType.SUCCESS,
|
AlertType.SUCCESS,
|
||||||
|
@ -250,6 +257,7 @@ implements OnInit, OnChanges, OnDestroy {
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
error => {
|
error => {
|
||||||
|
// new Key ERROR_TYPES.CREATE_ERR_2
|
||||||
this.generalModalService.triggerMessage(
|
this.generalModalService.triggerMessage(
|
||||||
new MessageModal('There was an error creating a workbasket', error)
|
new MessageModal('There was an error creating a workbasket', error)
|
||||||
);
|
);
|
||||||
|
@ -273,11 +281,13 @@ implements OnInit, OnChanges, OnDestroy {
|
||||||
this.requestInProgressService.setRequestInProgress(false);
|
this.requestInProgressService.setRequestInProgress(false);
|
||||||
this.workbasketService.triggerWorkBasketSaved();
|
this.workbasketService.triggerWorkBasketSaved();
|
||||||
if (response) {
|
if (response) {
|
||||||
|
// new Key ERROR_TYPES.MARK_ERR
|
||||||
this.generalModalService.triggerMessage(
|
this.generalModalService.triggerMessage(
|
||||||
new MessageModal('There was an error marking workbasket for deletion',
|
new MessageModal('There was an error marking workbasket for deletion',
|
||||||
'It not possible to mark the workbasket for deletion, It has been deleted.')
|
'It not possible to mark the workbasket for deletion, It has been deleted.')
|
||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
|
// new Key ALERT_TYPES.SUCCESS_ALERT_12
|
||||||
this.alertService.triggerAlert(
|
this.alertService.triggerAlert(
|
||||||
new AlertModel(AlertType.SUCCESS, `The Workbasket ${this.workbasket.workbasketId} has been marked for deletion`)
|
new AlertModel(AlertType.SUCCESS, `The Workbasket ${this.workbasket.workbasketId} has been marked for deletion`)
|
||||||
);
|
);
|
||||||
|
|
|
@ -11,6 +11,7 @@ import { DomainService } from 'app/services/domain/domain.service';
|
||||||
import { ImportExportService } from 'app/administration/services/import-export/import-export.service';
|
import { ImportExportService } from 'app/administration/services/import-export/import-export.service';
|
||||||
import { GeneralModalService } from '../../../services/general-modal/general-modal.service';
|
import { GeneralModalService } from '../../../services/general-modal/general-modal.service';
|
||||||
import { MessageModal } from '../../../models/message-modal';
|
import { MessageModal } from '../../../models/message-modal';
|
||||||
|
import { ERROR_TYPES } from '../../../services/general-modal/errors';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'taskana-workbasket-details',
|
selector: 'taskana-workbasket-details',
|
||||||
|
@ -114,6 +115,7 @@ export class WorkbasketDetailsComponent implements OnInit, OnDestroy {
|
||||||
this.requestInProgress = false;
|
this.requestInProgress = false;
|
||||||
this.checkDomainAndRedirect();
|
this.checkDomainAndRedirect();
|
||||||
}, err => {
|
}, err => {
|
||||||
|
// new Key ERROR_TYPES.FETCH_ERR_4
|
||||||
this.generalModalService.triggerMessage(
|
this.generalModalService.triggerMessage(
|
||||||
new MessageModal('An error occurred while fetching the workbasket', err)
|
new MessageModal('An error occurred while fetching the workbasket', err)
|
||||||
);
|
);
|
||||||
|
|
|
@ -9,6 +9,8 @@ import { WorkbasketSummary } from 'app/models/workbasket-summary';
|
||||||
import { WorkbasketService } from 'app/shared/services/workbasket/workbasket.service';
|
import { WorkbasketService } from 'app/shared/services/workbasket/workbasket.service';
|
||||||
import { TaskanaType } from 'app/models/taskana-type';
|
import { TaskanaType } from 'app/models/taskana-type';
|
||||||
import { expandDown } from 'app/shared/animations/expand.animation';
|
import { expandDown } from 'app/shared/animations/expand.animation';
|
||||||
|
import { ErrorsService } from '../../../../shared/services/errors/errors.service';
|
||||||
|
import { ERROR_TYPES } from '../../../../services/general-modal/errors';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'taskana-workbasket-list-toolbar',
|
selector: 'taskana-workbasket-list-toolbar',
|
||||||
|
@ -33,7 +35,8 @@ export class WorkbasketListToolbarComponent implements OnInit {
|
||||||
constructor(
|
constructor(
|
||||||
private workbasketService: WorkbasketService,
|
private workbasketService: WorkbasketService,
|
||||||
private route: ActivatedRoute,
|
private route: ActivatedRoute,
|
||||||
private router: Router
|
private router: Router,
|
||||||
|
private errors: ErrorsService
|
||||||
) {
|
) {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -5,6 +5,7 @@ import { DomainService } from 'app/services/domain/domain.service';
|
||||||
import { GeneralModalService } from 'app/services/general-modal/general-modal.service';
|
import { GeneralModalService } from 'app/services/general-modal/general-modal.service';
|
||||||
import { MessageModal } from 'app/models/message-modal';
|
import { MessageModal } from 'app/models/message-modal';
|
||||||
import { map, catchError } from 'rxjs/operators';
|
import { map, catchError } from 'rxjs/operators';
|
||||||
|
import { ERROR_TYPES } from '../services/general-modal/errors';
|
||||||
|
|
||||||
@Injectable()
|
@Injectable()
|
||||||
export class DomainGuard implements CanActivate {
|
export class DomainGuard implements CanActivate {
|
||||||
|
@ -14,6 +15,7 @@ export class DomainGuard implements CanActivate {
|
||||||
return this.domainService.getDomains().pipe(
|
return this.domainService.getDomains().pipe(
|
||||||
map(domain => true),
|
map(domain => true),
|
||||||
catchError(() => {
|
catchError(() => {
|
||||||
|
// new Key ERROR_TYPES.FETCH_ERR_5
|
||||||
this.generalModalService.triggerMessage(new MessageModal(
|
this.generalModalService.triggerMessage(new MessageModal(
|
||||||
'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'
|
||||||
));
|
));
|
||||||
|
|
|
@ -5,6 +5,7 @@ import { TaskanaEngineService } from 'app/services/taskana-engine/taskana-engine
|
||||||
import { map, catchError } from 'rxjs/operators';
|
import { map, catchError } from 'rxjs/operators';
|
||||||
import { GeneralModalService } from 'app/services/general-modal/general-modal.service';
|
import { GeneralModalService } from 'app/services/general-modal/general-modal.service';
|
||||||
import { MessageModal } from 'app/models/message-modal';
|
import { MessageModal } from 'app/models/message-modal';
|
||||||
|
import {ERROR_TYPES} from '../services/general-modal/errors';
|
||||||
|
|
||||||
@Injectable({
|
@Injectable({
|
||||||
providedIn: 'root'
|
providedIn: 'root'
|
||||||
|
@ -28,6 +29,7 @@ export class HistoryGuard implements CanActivate {
|
||||||
return this.navigateToWorkplace();
|
return this.navigateToWorkplace();
|
||||||
}),
|
}),
|
||||||
catchError(() => {
|
catchError(() => {
|
||||||
|
// new Key ERROR_TYPES.FETCH_ERR_6
|
||||||
this.generalModalService.triggerMessage(new MessageModal(
|
this.generalModalService.triggerMessage(new MessageModal(
|
||||||
'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'
|
||||||
));
|
));
|
||||||
|
|
|
@ -6,9 +6,12 @@ export class ErrorModel {
|
||||||
body: string;
|
body: string;
|
||||||
errObj?: ErrorHandler;
|
errObj?: ErrorHandler;
|
||||||
|
|
||||||
constructor(key: ERROR_TYPES, passedError?: ErrorHandler) {
|
constructor(key: ERROR_TYPES, passedError?: ErrorHandler, addition?: string) {
|
||||||
this.head = errors.get(key).name;
|
this.head = errors.get(key).name;
|
||||||
this.body = errors.get(key).text;
|
this.body = errors.get(key).text
|
||||||
|
if (addition) {
|
||||||
|
this.body.replace('{rep}', addition);
|
||||||
|
}
|
||||||
this.errObj = passedError;
|
this.errObj = passedError;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,23 +1,27 @@
|
||||||
import { ErrorModel } from '../../models/error-model';
|
import { ErrorModel } from '../../models/error-model';
|
||||||
import {Pair} from '../../models/pair';
|
import { Pair } from '../../models/pair';
|
||||||
|
|
||||||
|
|
||||||
export enum ERROR_TYPES {
|
export enum ERROR_TYPES {
|
||||||
DELETE_ERR_2,
|
|
||||||
FETCH_ERR_7,
|
|
||||||
NONE,
|
|
||||||
|
|
||||||
// Mock Errors
|
// ERRORS
|
||||||
NO_AUTH,
|
|
||||||
EXP_AUTH,
|
|
||||||
NO_ACCESS,
|
|
||||||
// Real Errors
|
|
||||||
FETCH_ERR,
|
FETCH_ERR,
|
||||||
FETCH_ERR_2,
|
FETCH_ERR_2,
|
||||||
|
FETCH_ERR_3,
|
||||||
|
FETCH_ERR_4,
|
||||||
|
FETCH_ERR_5,
|
||||||
|
FETCH_ERR_6,
|
||||||
|
FETCH_ERR_7,
|
||||||
DELETE_ERR,
|
DELETE_ERR,
|
||||||
|
DELETE_ERR_2,
|
||||||
CREATE_ERR,
|
CREATE_ERR,
|
||||||
|
CREATE_ERR_2,
|
||||||
REMOVE_ERR,
|
REMOVE_ERR,
|
||||||
|
REMOVE_ERR_2,
|
||||||
SAVE_ERR,
|
SAVE_ERR,
|
||||||
|
SAVE_ERR_2,
|
||||||
|
SAVE_ERR_3,
|
||||||
|
SAVE_ERR_4,
|
||||||
SELECT_ERR,
|
SELECT_ERR,
|
||||||
FILE_ERR,
|
FILE_ERR,
|
||||||
IMPORT_ERR_1,
|
IMPORT_ERR_1,
|
||||||
|
@ -25,62 +29,36 @@ export enum ERROR_TYPES {
|
||||||
IMPORT_ERR_3,
|
IMPORT_ERR_3,
|
||||||
IMPORT_ERR_4,
|
IMPORT_ERR_4,
|
||||||
UPLOAD_ERR,
|
UPLOAD_ERR,
|
||||||
FETCH_ERR_3,
|
|
||||||
CREATE_ERR_2,
|
|
||||||
SAVE_ERR_4,
|
|
||||||
REMOVE_ERR_2,
|
|
||||||
SAVE_ERR_3,
|
|
||||||
SAVE_ERR_2,
|
|
||||||
FETCH_ERR_4,
|
|
||||||
TIMEOUT_ERR,
|
TIMEOUT_ERR,
|
||||||
GENERAL_ERR,
|
GENERAL_ERR,
|
||||||
HANDLE_ERR,
|
ACCESS_ERR,
|
||||||
FETCH_ERR_6,
|
|
||||||
FETCH_ERR_5,
|
|
||||||
MARK_ERR,
|
MARK_ERR,
|
||||||
|
NONE,
|
||||||
|
|
||||||
}
|
// ALERTS
|
||||||
|
|
||||||
export enum ALERT_TYPES {
|
|
||||||
INFO_ALERT_2,
|
|
||||||
DANGER_ALERT_2,
|
|
||||||
SUCCESS_ALERT_14,
|
|
||||||
SUCCESS_ALERT_13,
|
|
||||||
WARNING_ALERT_2,
|
|
||||||
SUCCESS_ALERT_12,
|
|
||||||
SUCCESS_ALERT_11,
|
|
||||||
SUCCESS_ALERT_10,
|
|
||||||
SUCCESS_ALERT_9,
|
|
||||||
|
|
||||||
// TODO: check all alert models
|
|
||||||
SUCCESS_ALERT,
|
|
||||||
INFO_ALERT,
|
INFO_ALERT,
|
||||||
WARNING_ALERT,
|
INFO_ALERT_2,
|
||||||
DANGER_ALERT,
|
DANGER_ALERT,
|
||||||
SUCCESS_ALERT_8,
|
DANGER_ALERT_2,
|
||||||
SUCCESS_ALERT_7,
|
SUCCESS_ALERT,
|
||||||
SUCCESS_ALERT_6,
|
|
||||||
SUCCESS_ALERT_5,
|
|
||||||
SUCCESS_ALERT_4,
|
|
||||||
SUCCESS_ALERT_3,
|
|
||||||
SUCCESS_ALERT_2,
|
SUCCESS_ALERT_2,
|
||||||
|
SUCCESS_ALERT_3,
|
||||||
|
SUCCESS_ALERT_4,
|
||||||
|
SUCCESS_ALERT_5,
|
||||||
|
SUCCESS_ALERT_6,
|
||||||
|
SUCCESS_ALERT_7,
|
||||||
|
SUCCESS_ALERT_8,
|
||||||
|
SUCCESS_ALERT_9,
|
||||||
|
SUCCESS_ALERT_10,
|
||||||
|
SUCCESS_ALERT_11,
|
||||||
|
SUCCESS_ALERT_12,
|
||||||
|
SUCCESS_ALERT_13,
|
||||||
|
SUCCESS_ALERT_14,
|
||||||
|
WARNING_ALERT,
|
||||||
|
WARNING_ALERT_2,
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO: funktioniert unser Pair hierfür? -> Konstruktor checken!
|
export const errors = new Map<ERROR_TYPES, Pair> ([
|
||||||
export const errors = new Map<ERROR_TYPES|ALERT_TYPES, Pair> ([
|
|
||||||
[ERROR_TYPES.NO_AUTH, new Pair(
|
|
||||||
'Authentication required',
|
|
||||||
'You need to be logged in to perform this action.'
|
|
||||||
)],
|
|
||||||
[ERROR_TYPES.EXP_AUTH, new Pair(
|
|
||||||
'Authentication expired',
|
|
||||||
'Your session has expired, log in to perform this action.'
|
|
||||||
)],
|
|
||||||
[ERROR_TYPES.NO_ACCESS, new Pair(
|
|
||||||
'Access denied',
|
|
||||||
'You have no permission to perform this action.'
|
|
||||||
)],
|
|
||||||
// access-items-management.component.ts
|
// access-items-management.component.ts
|
||||||
[ERROR_TYPES.FETCH_ERR, new Pair(
|
[ERROR_TYPES.FETCH_ERR, new Pair(
|
||||||
'',
|
'',
|
||||||
|
@ -123,22 +101,22 @@ export const errors = new Map<ERROR_TYPES|ALERT_TYPES, Pair> ([
|
||||||
)],
|
)],
|
||||||
// import-export.component
|
// import-export.component
|
||||||
[ERROR_TYPES.IMPORT_ERR_1, new Pair(
|
[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, you have no access to apply this operation.'
|
||||||
)],
|
)],
|
||||||
// import-export.component
|
// import-export.component
|
||||||
[ERROR_TYPES.IMPORT_ERR_2, new Pair(
|
[ERROR_TYPES.IMPORT_ERR_2, new Pair(
|
||||||
'',
|
'Import was not successful',
|
||||||
'Import was not successful, operation was not found.'
|
'Import was not successful, operation was not found.'
|
||||||
)],
|
)],
|
||||||
// import-export.component
|
// import-export.component
|
||||||
[ERROR_TYPES.IMPORT_ERR_3, new Pair(
|
[ERROR_TYPES.IMPORT_ERR_3, new Pair(
|
||||||
'',
|
'Import was not successful',
|
||||||
'Import was not successful, operation has some conflicts.'
|
'Import was not successful, operation has some conflicts.'
|
||||||
)],
|
)],
|
||||||
// import-export.component
|
// import-export.component
|
||||||
[ERROR_TYPES.IMPORT_ERR_4, new Pair(
|
[ERROR_TYPES.IMPORT_ERR_4, new Pair(
|
||||||
'',
|
'Import was not successful',
|
||||||
'Import was not successful, maximum file size exceeded.'
|
'Import was not successful, maximum file size exceeded.'
|
||||||
)],
|
)],
|
||||||
// import-export.component
|
// import-export.component
|
||||||
|
@ -197,139 +175,139 @@ export const errors = new Map<ERROR_TYPES|ALERT_TYPES, Pair> ([
|
||||||
'There was an error, please contact with your administrator',
|
'There was an error, please contact with your administrator',
|
||||||
'There was an error getting history provider'
|
'There was an error getting history provider'
|
||||||
)],
|
)],
|
||||||
// http-client-interceptor.component
|
// http-client-interceptor.service
|
||||||
[ERROR_TYPES.HANDLE_ERR, new Pair(
|
[ERROR_TYPES.ACCESS_ERR, new Pair(
|
||||||
'You have no access to this resource ',
|
'You have no access to this resource ',
|
||||||
''
|
''
|
||||||
)],
|
)],
|
||||||
// http-client-interceptor.component
|
// http-client-interceptor.service
|
||||||
[ERROR_TYPES.GENERAL_ERR, new Pair(
|
[ERROR_TYPES.GENERAL_ERR, new Pair(
|
||||||
'There was error, please contact with your administrator',
|
'There was error, please contact with your administrator',
|
||||||
''
|
''
|
||||||
)],
|
)],
|
||||||
// http-client-interceptor.component
|
// http-client-interceptor.service
|
||||||
[ERROR_TYPES.NONE, new Pair(
|
[ERROR_TYPES.NONE, new Pair(
|
||||||
'Error wird ignoriert, keine Message geworfen',
|
'',
|
||||||
''
|
'Error wird ignoriert, keine Message geworfen'
|
||||||
)],
|
)],
|
||||||
// spinner.component
|
// spinner.component
|
||||||
[ERROR_TYPES.TIMEOUT_ERR, new Pair(
|
[ERROR_TYPES.TIMEOUT_ERR, new Pair(
|
||||||
'There was an error with your request, please make sure you have internet connection',
|
'Request time exceeded',
|
||||||
'Request time execeed'
|
'There was an error with your request, please make sure you have internet connection'
|
||||||
)],
|
)],
|
||||||
// taskdetails.component
|
// taskdetails.component
|
||||||
[ERROR_TYPES.FETCH_ERR_7, new Pair(
|
[ERROR_TYPES.FETCH_ERR_7, new Pair(
|
||||||
'An error occurred while fetching the task',
|
'',
|
||||||
''
|
'An error occurred while fetching the task'
|
||||||
)],
|
)],
|
||||||
// taskdetails.component
|
// taskdetails.component
|
||||||
[ERROR_TYPES.DELETE_ERR_2, new Pair(
|
[ERROR_TYPES.DELETE_ERR_2, new Pair(
|
||||||
'An error occurred while deleting the task',
|
'',
|
||||||
''
|
'An error occurred while deleting the task'
|
||||||
)],
|
)],
|
||||||
|
|
||||||
// ALERTS
|
// ALERTS
|
||||||
|
|
||||||
// access-items-management.component
|
// access-items-management.component
|
||||||
[ALERT_TYPES.SUCCESS_ALERT, new Pair(
|
[ERROR_TYPES.SUCCESS_ALERT, new Pair(
|
||||||
'${this.accessIdSelected} was removed successfully',
|
'',
|
||||||
''
|
'${this.accessIdSelected} was removed successfully'
|
||||||
)],
|
)],
|
||||||
// classification-details.component
|
// classification-details.component
|
||||||
[ALERT_TYPES.SUCCESS_ALERT_2, new Pair(
|
[ERROR_TYPES.SUCCESS_ALERT_2, new Pair(
|
||||||
'Classification ${classification.key} was saved successfully',
|
'',
|
||||||
''
|
'Classification ${classification.key} was saved successfully'
|
||||||
)],
|
)],
|
||||||
// classification-details.component
|
// classification-details.component
|
||||||
[ALERT_TYPES.SUCCESS_ALERT_3, new Pair(
|
[ERROR_TYPES.SUCCESS_ALERT_3, new Pair(
|
||||||
'Classification ${this.classification.key} was saved successfully',
|
'Classification ${this.classification.key} was saved successfully',
|
||||||
''
|
''
|
||||||
)],
|
)],
|
||||||
// classification-details.component
|
// classification-details.component
|
||||||
// access-items.component
|
// access-items.component
|
||||||
// distribution-targets.component
|
// workbasket.distribution-targets.component
|
||||||
// workbasket-information.component
|
// workbasket-information.component
|
||||||
[ALERT_TYPES.INFO_ALERT, new Pair(
|
[ERROR_TYPES.INFO_ALERT, new Pair(
|
||||||
'Reset edited fields',
|
'Reset edited fields',
|
||||||
''
|
''
|
||||||
)],
|
)],
|
||||||
// classification-details.component
|
// classification-details.component
|
||||||
[ALERT_TYPES.SUCCESS_ALERT_4, new Pair(
|
[ERROR_TYPES.SUCCESS_ALERT_4, new Pair(
|
||||||
'Classification ${key} was removed successfully',
|
'Classification ${key} was removed successfully',
|
||||||
''
|
''
|
||||||
)],
|
)],
|
||||||
// classification-list.component
|
// classification-list.component
|
||||||
[ALERT_TYPES.SUCCESS_ALERT_5, new Pair(
|
[ERROR_TYPES.SUCCESS_ALERT_5, new Pair(
|
||||||
'Classification ${key} was saved successfully',
|
'Classification ${key} was saved successfully',
|
||||||
''
|
''
|
||||||
)],
|
)],
|
||||||
// import-export.component
|
// import-export.component
|
||||||
[ALERT_TYPES.SUCCESS_ALERT_6, new Pair(
|
[ERROR_TYPES.SUCCESS_ALERT_6, new Pair(
|
||||||
'Import was successful',
|
'Import was successful',
|
||||||
''
|
''
|
||||||
)],
|
)],
|
||||||
// access-items.component
|
// access-items.component
|
||||||
[ALERT_TYPES.SUCCESS_ALERT_7, new Pair(
|
[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',
|
||||||
''
|
''
|
||||||
)],
|
)],
|
||||||
// distribution-targets.component
|
// workbasket.distribution-targets.component
|
||||||
[ALERT_TYPES.SUCCESS_ALERT_8, new Pair(
|
[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
|
// workbasket-information.component
|
||||||
[ALERT_TYPES.SUCCESS_ALERT_9, new Pair(
|
[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
|
// workbasket-information.component
|
||||||
[ALERT_TYPES.SUCCESS_ALERT_10, new Pair(
|
[ERROR_TYPES.SUCCESS_ALERT_10, new Pair(
|
||||||
'Workbasket ${workbasketUpdated.key} was saved successfully',
|
'Workbasket ${workbasketUpdated.key} was saved successfully',
|
||||||
''
|
''
|
||||||
)],
|
)],
|
||||||
// workbasket-information.component
|
// workbasket-information.component
|
||||||
[ALERT_TYPES.SUCCESS_ALERT_11, new Pair(
|
[ERROR_TYPES.SUCCESS_ALERT_11, new Pair(
|
||||||
'Workbasket ${workbasketUpdated.key} was created successfully',
|
'Workbasket ${workbasketUpdated.key} was created successfully',
|
||||||
''
|
''
|
||||||
)],
|
)],
|
||||||
// workbasket-information.component
|
// workbasket-information.component
|
||||||
[ALERT_TYPES.SUCCESS_ALERT_12, new Pair(
|
[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
|
// forms-validator.service
|
||||||
[ALERT_TYPES.WARNING_ALERT, new Pair(
|
[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
|
// forms-validator.service x2
|
||||||
[ALERT_TYPES.WARNING_ALERT_2, new Pair(
|
[ERROR_TYPES.WARNING_ALERT_2, new Pair(
|
||||||
'The ${responseOwner.field} introduced is not valid.',
|
'The ${responseOwner.field} introduced is not valid.',
|
||||||
''
|
''
|
||||||
)],
|
)],
|
||||||
// taskdetails.component TODO: is dis error
|
// taskdetails.component
|
||||||
[ALERT_TYPES.DANGER_ALERT, new Pair(
|
[ERROR_TYPES.DANGER_ALERT, new Pair(
|
||||||
'There was an error while updating.',
|
'There was an error while updating.',
|
||||||
''
|
''
|
||||||
)],
|
)],
|
||||||
// taskdetails.component
|
// taskdetails.component
|
||||||
[ALERT_TYPES.SUCCESS_ALERT_13, new Pair(
|
[ERROR_TYPES.SUCCESS_ALERT_13, new Pair(
|
||||||
'Task ${this.currentId} was created successfully.',
|
'Task ${this.currentId} was created successfully.',
|
||||||
''
|
''
|
||||||
)],
|
)],
|
||||||
// taskdetails.component
|
// taskdetails.component
|
||||||
[ALERT_TYPES.SUCCESS_ALERT_14, new Pair(
|
[ERROR_TYPES.SUCCESS_ALERT_14, new Pair(
|
||||||
'Updating was successful.',
|
'Updating was successful.',
|
||||||
''
|
''
|
||||||
)],
|
)],
|
||||||
// taskdetails.component
|
// taskdetails.component
|
||||||
[ALERT_TYPES.DANGER_ALERT_2, new Pair(
|
[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
|
// task-master.component
|
||||||
[ALERT_TYPES.INFO_ALERT_2, new Pair(
|
[ERROR_TYPES.INFO_ALERT_2, new Pair(
|
||||||
'The selected Workbasket is empty!',
|
'The selected Workbasket is empty!',
|
||||||
''
|
''
|
||||||
)],
|
)],
|
||||||
|
|
|
@ -2,13 +2,14 @@ import { Injectable } from '@angular/core';
|
||||||
import { Subject, Observable } from 'rxjs';
|
import { Subject, Observable } from 'rxjs';
|
||||||
import { MessageModal } from 'app/models/message-modal';
|
import { MessageModal } from 'app/models/message-modal';
|
||||||
|
|
||||||
import { errors as ERRORS } from './errors';
|
import { ERROR_TYPES, errors as ERRORS } from './errors';
|
||||||
|
|
||||||
@Injectable()
|
@Injectable()
|
||||||
export class GeneralModalService {
|
export class GeneralModalService {
|
||||||
private messageTriggered = new Subject<MessageModal>();
|
private messageTriggered = new Subject<MessageModal>();
|
||||||
|
|
||||||
triggerMessage(message: MessageModal) {
|
triggerMessage(message: MessageModal) {
|
||||||
|
console.log(ERRORS.get(ERROR_TYPES.DELETE_ERR));
|
||||||
this.messageTriggered.next(message);
|
this.messageTriggered.next(message);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -7,7 +7,6 @@ import { ERROR_TYPES } from '../../../services/general-modal/errors';
|
||||||
providedIn: 'root'
|
providedIn: 'root'
|
||||||
})
|
})
|
||||||
export class ErrorsService {
|
export class ErrorsService {
|
||||||
// Wie initialisieren? Default ERROR_TYPE für leeres initialisieren einfügen?
|
|
||||||
errorSubject$: Subject<ErrorModel>;
|
errorSubject$: Subject<ErrorModel>;
|
||||||
constructor() {}
|
constructor() {}
|
||||||
|
|
||||||
|
@ -15,8 +14,8 @@ export class ErrorsService {
|
||||||
this.errorSubject$.next(errorToShow);
|
this.errorSubject$.next(errorToShow);
|
||||||
}
|
}
|
||||||
|
|
||||||
public updateError(key: ERROR_TYPES, passedError: ErrorHandler): void {
|
public updateError(key: ERROR_TYPES, passedError?: ErrorHandler): void {
|
||||||
// wahrscheinlich wollen wir nicht jedes mal ein neues ErrorModel erzeugen... oder wollen wir?
|
const errorModel = new ErrorModel(key, passedError);
|
||||||
this.updateErrorSubject(new ErrorModel(key, passedError));
|
this.updateErrorSubject(errorModel);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -3,6 +3,7 @@ import { Injectable } from '@angular/core';
|
||||||
import { AlertService } from 'app/services/alert/alert.service';
|
import { AlertService } from 'app/services/alert/alert.service';
|
||||||
import { AlertModel, AlertType } from 'app/models/alert';
|
import { AlertModel, AlertType } from 'app/models/alert';
|
||||||
import { AccessIdsService } from 'app/shared/services/access-ids/access-ids.service';
|
import { AccessIdsService } from 'app/shared/services/access-ids/access-ids.service';
|
||||||
|
import { ALERT_TYPES } from '../../../services/general-modal/errors';
|
||||||
|
|
||||||
@Injectable()
|
@Injectable()
|
||||||
export class FormsValidatorService {
|
export class FormsValidatorService {
|
||||||
|
@ -51,8 +52,10 @@ export class FormsValidatorService {
|
||||||
const responseOwner = new ResponseOwner(values[1]);
|
const responseOwner = new ResponseOwner(values[1]);
|
||||||
if (!(values[0] && responseOwner.valid)) {
|
if (!(values[0] && responseOwner.valid)) {
|
||||||
if (!responseOwner.valid) {
|
if (!responseOwner.valid) {
|
||||||
|
// new Key ALERT_TYPES.WARNING_ALERT_2
|
||||||
this.alertService.triggerAlert(new AlertModel(AlertType.WARNING, `The ${responseOwner.field} introduced is not valid.`));
|
this.alertService.triggerAlert(new AlertModel(AlertType.WARNING, `The ${responseOwner.field} introduced is not valid.`));
|
||||||
} else {
|
} else {
|
||||||
|
// new Key ALERT_TYPES.WARNING_ALERT
|
||||||
this.alertService.triggerAlert(new AlertModel(AlertType.WARNING, 'There are some empty fields which are required.'));
|
this.alertService.triggerAlert(new AlertModel(AlertType.WARNING, 'There are some empty fields which are required.'));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -80,6 +83,7 @@ export class FormsValidatorService {
|
||||||
result = result && responseOwner.valid;
|
result = result && responseOwner.valid;
|
||||||
});
|
});
|
||||||
if (!result) {
|
if (!result) {
|
||||||
|
// new key ALERT_TYPES.WARNING_ALERT_2
|
||||||
this.alertService.triggerAlert(new AlertModel(AlertType.WARNING, `The ${responseOwner.field} introduced is not valid.`));
|
this.alertService.triggerAlert(new AlertModel(AlertType.WARNING, `The ${responseOwner.field} introduced is not valid.`));
|
||||||
}
|
}
|
||||||
return result;
|
return result;
|
||||||
|
|
|
@ -8,6 +8,7 @@ import { GeneralModalService } from 'app/services/general-modal/general-modal.se
|
||||||
import { RequestInProgressService } from 'app/services/requestInProgress/request-in-progress.service';
|
import { RequestInProgressService } from 'app/services/requestInProgress/request-in-progress.service';
|
||||||
import { environment } from 'environments/environment';
|
import { environment } from 'environments/environment';
|
||||||
import { tap } from 'rxjs/operators';
|
import { tap } from 'rxjs/operators';
|
||||||
|
import { ERROR_TYPES } from '../../../services/general-modal/errors';
|
||||||
|
|
||||||
@Injectable()
|
@Injectable()
|
||||||
export class HttpClientInterceptor implements HttpInterceptor {
|
export class HttpClientInterceptor implements HttpInterceptor {
|
||||||
|
@ -26,12 +27,14 @@ export class HttpClientInterceptor implements HttpInterceptor {
|
||||||
return next.handle(req).pipe(tap(() => { }, error => {
|
return next.handle(req).pipe(tap(() => { }, error => {
|
||||||
this.requestInProgressService.setRequestInProgress(false);
|
this.requestInProgressService.setRequestInProgress(false);
|
||||||
if (error instanceof HttpErrorResponse && (error.status === 401 || error.status === 403)) {
|
if (error instanceof HttpErrorResponse && (error.status === 401 || error.status === 403)) {
|
||||||
this.generalModalService.triggerMessage(
|
// new Key ERROR_TYPES.ACCESS_ERR
|
||||||
|
this.generalModalService.triggerMessage(
|
||||||
new MessageModal('You have no access to this resource ', error)
|
new MessageModal('You have no access to this resource ', error)
|
||||||
);
|
);
|
||||||
} else if (error instanceof HttpErrorResponse && (error.status === 404) && error.url.indexOf('environment-information.json')) {
|
} else if (error instanceof HttpErrorResponse && (error.status === 404) && error.url.indexOf('environment-information.json')) {
|
||||||
// ignore this error message
|
// ignore this error message Key ERROR_TYPES.NONE
|
||||||
} else {
|
} else {
|
||||||
|
// new Key ERROR_TYPES.GENERAL_ERR
|
||||||
this.generalModalService.triggerMessage(
|
this.generalModalService.triggerMessage(
|
||||||
new MessageModal('There was error, please contact with your administrator ', error)
|
new MessageModal('There was error, please contact with your administrator ', error)
|
||||||
);
|
);
|
||||||
|
|
|
@ -4,9 +4,12 @@ import { Component, Input, Output, EventEmitter, OnDestroy, ViewChild } from '@a
|
||||||
import { MessageModal } from 'app/models/message-modal';
|
import { MessageModal } from 'app/models/message-modal';
|
||||||
|
|
||||||
import { GeneralModalService } from 'app/services/general-modal/general-modal.service';
|
import { GeneralModalService } from 'app/services/general-modal/general-modal.service';
|
||||||
|
import {ERROR_TYPES} from '../../services/general-modal/errors';
|
||||||
|
|
||||||
declare let $: any;
|
declare let $: any;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'taskana-spinner',
|
selector: 'taskana-spinner',
|
||||||
templateUrl: './spinner.component.html',
|
templateUrl: './spinner.component.html',
|
||||||
|
@ -64,6 +67,7 @@ export class SpinnerComponent implements OnDestroy {
|
||||||
this.isDelayedRunning = value;
|
this.isDelayedRunning = value;
|
||||||
this.cancelTimeout();
|
this.cancelTimeout();
|
||||||
this.requestTimeout = setTimeout(() => {
|
this.requestTimeout = setTimeout(() => {
|
||||||
|
// new Key ERROR_TYPES.TIMEOUT_ERR
|
||||||
this.generalModalService.triggerMessage(
|
this.generalModalService.triggerMessage(
|
||||||
new MessageModal('There was an error with your request, please make sure you have internet connection',
|
new MessageModal('There was an error with your request, please make sure you have internet connection',
|
||||||
'Request time execeed')
|
'Request time execeed')
|
||||||
|
|
|
@ -16,6 +16,7 @@ import { ObjectReference } from 'app/workplace/models/object-reference';
|
||||||
import { Workbasket } from 'app/models/workbasket';
|
import { Workbasket } from 'app/models/workbasket';
|
||||||
import { WorkplaceService } from 'app/workplace/services/workplace.service';
|
import { WorkplaceService } from 'app/workplace/services/workplace.service';
|
||||||
import { MasterAndDetailService } from 'app/services/masterAndDetail/master-and-detail.service';
|
import { MasterAndDetailService } from 'app/services/masterAndDetail/master-and-detail.service';
|
||||||
|
import { ERROR_TYPES } from '../../services/general-modal/errors';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'taskana-task-details',
|
selector: 'taskana-task-details',
|
||||||
|
@ -85,6 +86,7 @@ export class TaskdetailsComponent implements OnInit, OnDestroy {
|
||||||
this.cloneTask();
|
this.cloneTask();
|
||||||
this.taskService.selectTask(task);
|
this.taskService.selectTask(task);
|
||||||
}, err => {
|
}, err => {
|
||||||
|
// new Key ERROR_TYPES.FETCH_ERR_7
|
||||||
this.generalModalService.triggerMessage(
|
this.generalModalService.triggerMessage(
|
||||||
new MessageModal('An error occurred while fetching the task', err)
|
new MessageModal('An error occurred while fetching the task', err)
|
||||||
);
|
);
|
||||||
|
@ -115,6 +117,7 @@ export class TaskdetailsComponent implements OnInit, OnDestroy {
|
||||||
this.task = null;
|
this.task = null;
|
||||||
this.router.navigate(['taskana/workplace/tasks']);
|
this.router.navigate(['taskana/workplace/tasks']);
|
||||||
}, err => {
|
}, err => {
|
||||||
|
// new Key ERROR_TYPES.DELETE_ERR_2
|
||||||
this.generalModalService.triggerMessage(
|
this.generalModalService.triggerMessage(
|
||||||
new MessageModal('An error occurred while deleting the task ', err)
|
new MessageModal('An error occurred while deleting the task ', err)
|
||||||
);
|
);
|
||||||
|
@ -142,9 +145,11 @@ export class TaskdetailsComponent implements OnInit, OnDestroy {
|
||||||
this.task = task;
|
this.task = task;
|
||||||
this.cloneTask();
|
this.cloneTask();
|
||||||
this.taskService.publishUpdatedTask(task);
|
this.taskService.publishUpdatedTask(task);
|
||||||
|
// new Key ALERT_TYPES.SUCCESS_ALERT_14
|
||||||
this.alertService.triggerAlert(new AlertModel(AlertType.SUCCESS, 'Updating was successful.'));
|
this.alertService.triggerAlert(new AlertModel(AlertType.SUCCESS, 'Updating was successful.'));
|
||||||
}, err => {
|
}, err => {
|
||||||
this.requestInProgressService.setRequestInProgress(false);
|
this.requestInProgressService.setRequestInProgress(false);
|
||||||
|
// new Key ALERT_TYPES.DANGER_ALERT
|
||||||
this.alertService.triggerAlert(new AlertModel(AlertType.DANGER, 'There was an error while updating.'));
|
this.alertService.triggerAlert(new AlertModel(AlertType.DANGER, 'There was an error while updating.'));
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -154,6 +159,7 @@ export class TaskdetailsComponent implements OnInit, OnDestroy {
|
||||||
this.addDateToTask();
|
this.addDateToTask();
|
||||||
this.taskService.createTask(this.task).subscribe(task => {
|
this.taskService.createTask(this.task).subscribe(task => {
|
||||||
this.requestInProgressService.setRequestInProgress(false);
|
this.requestInProgressService.setRequestInProgress(false);
|
||||||
|
// new Key ALERT_TYPES.SUCCESS_ALERT_13
|
||||||
this.alertService.triggerAlert(new AlertModel(AlertType.SUCCESS, `Task ${this.currentId} was created successfully.`));
|
this.alertService.triggerAlert(new AlertModel(AlertType.SUCCESS, `Task ${this.currentId} was created successfully.`));
|
||||||
this.task = task;
|
this.task = task;
|
||||||
this.taskService.selectTask(this.task);
|
this.taskService.selectTask(this.task);
|
||||||
|
@ -161,6 +167,7 @@ export class TaskdetailsComponent implements OnInit, OnDestroy {
|
||||||
this.router.navigate([`../${task.taskId}`], { relativeTo: this.route });
|
this.router.navigate([`../${task.taskId}`], { relativeTo: this.route });
|
||||||
}, err => {
|
}, err => {
|
||||||
this.requestInProgressService.setRequestInProgress(false);
|
this.requestInProgressService.setRequestInProgress(false);
|
||||||
|
// new Key ALERT_TYPES.DANGER_ALERT_2
|
||||||
this.alertService.triggerAlert(new AlertModel(AlertType.DANGER, 'There was an error while creating a new task.'));
|
this.alertService.triggerAlert(new AlertModel(AlertType.DANGER, 'There was an error while creating a new task.'));
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue