-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/web/src/app/administration/classification/details/classification-details.component.spec.ts b/web/src/app/administration/classification/details/classification-details.component.spec.ts
index d11b1f42f..e9fad98d2 100644
--- a/web/src/app/administration/classification/details/classification-details.component.spec.ts
+++ b/web/src/app/administration/classification/details/classification-details.component.spec.ts
@@ -21,7 +21,7 @@ import { MasterAndDetailService } from 'app/services/masterAndDetail/master-and-
import { RequestInProgressService } from 'app/services/requestInProgress/request-in-progress.service';
import { ClassificationsService } from 'app/services/classifications/classifications.service';
import { TreeNodeModel } from 'app/models/tree-node';
-import { ErrorModalService } from 'app/services/errorModal/error-modal.service';
+import { GeneralModalService } from 'app/services/general-modal/general-modal.service';
import { AlertService } from 'app/services/alert/alert.service';
import { TreeService } from 'app/services/tree/tree.service';
import { CustomFieldsService } from 'app/services/custom-fields/custom-fields.service';
@@ -52,7 +52,7 @@ describe('ClassificationDetailsComponent', () => {
testBed.configureTestingModule({
imports: [FormsModule, HttpClientModule, RouterTestingModule.withRoutes(routes), AngularSvgIconModule],
declarations: [ClassificationDetailsComponent, DummyDetailComponent],
- providers: [MasterAndDetailService, RequestInProgressService, ClassificationsService, HttpClient, ErrorModalService, AlertService,
+ providers: [MasterAndDetailService, RequestInProgressService, ClassificationsService, HttpClient, GeneralModalService, AlertService,
TreeService, ClassificationCategoriesService, CustomFieldsService, ImportExportService]
})
};
diff --git a/web/src/app/administration/classification/details/classification-details.component.ts b/web/src/app/administration/classification/details/classification-details.component.ts
index 397f530e3..6ea05d8f1 100644
--- a/web/src/app/administration/classification/details/classification-details.component.ts
+++ b/web/src/app/administration/classification/details/classification-details.component.ts
@@ -4,7 +4,7 @@ import { Subscription } from 'rxjs';
import { ClassificationDefinition } from 'app/models/classification-definition';
import { ACTION } from 'app/models/action';
-import { ErrorModel } from 'app/models/modal-error';
+import { MessageModal } from 'app/models/message-modal';
import { AlertModel, AlertType } from 'app/models/alert';
import { highlight } from 'app/shared/animations/validation.animation';
@@ -12,7 +12,7 @@ import { TaskanaDate } from 'app/shared/util/taskana.date';
import { ClassificationsService } from 'app/services/classifications/classifications.service';
import { MasterAndDetailService } from 'app/services/masterAndDetail/master-and-detail.service';
-import { ErrorModalService } from 'app/services/errorModal/error-modal.service';
+import { GeneralModalService } from 'app/services/general-modal/general-modal.service';
import { RequestInProgressService } from 'app/services/requestInProgress/request-in-progress.service';
import { AlertService } from 'app/services/alert/alert.service';
import { TreeService } from 'app/services/tree/tree.service';
@@ -74,7 +74,7 @@ export class ClassificationDetailsComponent implements OnInit, OnDestroy {
private route: ActivatedRoute,
private router: Router,
private masterAndDetailService: MasterAndDetailService,
- private errorModalService: ErrorModalService,
+ private generalModalService: GeneralModalService,
private requestInProgressService: RequestInProgressService,
private alertService: AlertService,
private treeService: TreeService,
@@ -176,7 +176,7 @@ export class ClassificationDetailsComponent implements OnInit, OnDestroy {
this.afterRequest();
},
error => {
- this.errorModalService.triggerError(new ErrorModel('There was an error creating a classification', error))
+ this.generalModalService.triggerMessage(new MessageModal('There was an error creating a classification', error))
this.afterRequest();
});
} else {
@@ -188,7 +188,7 @@ export class ClassificationDetailsComponent implements OnInit, OnDestroy {
this.alertService.triggerAlert(new AlertModel(AlertType.SUCCESS, `Classification ${classification.key} was saved successfully`));
this.cloneClassification(classification);
}, error => {
- this.errorModalService.triggerError(new ErrorModel('There was error while saving your classification', error))
+ this.generalModalService.triggerMessage(new MessageModal('There was error while saving your classification', error))
this.afterRequest();
})
}
@@ -263,7 +263,7 @@ export class ClassificationDetailsComponent implements OnInit, OnDestroy {
private checkDomainAndRedirect() {
this.domainSubscription = this.domainService.getSelectedDomain().subscribe(domain => {
- if (this.classification && this.classification.domain !== domain) {
+ if (domain !== '' && this.classification && this.classification.domain !== domain) {
this.backClicked();
}
});
@@ -271,8 +271,8 @@ export class ClassificationDetailsComponent implements OnInit, OnDestroy {
private removeClassificationConfirmation() {
if (!this.classification || !this.classification.classificationId) {
- this.errorModalService.triggerError(
- new ErrorModel('There is no classification selected', 'Please check if you are creating a classification'));
+ this.generalModalService.triggerMessage(
+ new MessageModal('There is no classification selected', 'Please check if you are creating a classification'));
return false;
}
this.requestInProgressService.setRequestInProgress(true);
@@ -288,7 +288,7 @@ export class ClassificationDetailsComponent implements OnInit, OnDestroy {
this.router.navigate(['administration/classifications']);
this.alertService.triggerAlert(new AlertModel(AlertType.SUCCESS, `Classification ${key} was removed successfully`))
}, error => {
- this.errorModalService.triggerError(new ErrorModel('There was error while removing your classification', error))
+ this.generalModalService.triggerMessage(new MessageModal('There was error while removing your classification', error))
this.afterRequest();
})
}
diff --git a/web/src/app/administration/classification/master/list/classification-list.component.spec.ts b/web/src/app/administration/classification/master/list/classification-list.component.spec.ts
index d51e73a42..1bf581a6c 100644
--- a/web/src/app/administration/classification/master/list/classification-list.component.spec.ts
+++ b/web/src/app/administration/classification/master/list/classification-list.component.spec.ts
@@ -18,7 +18,7 @@ import { AlertService } from 'app/services/alert/alert.service';
import { ClassificationsService } from 'app/services/classifications/classifications.service';
import { ClassificationDefinitionService } from 'app/administration/services/classification-definition/classification-definition.service';
import { DomainService } from 'app/services/domain/domain.service';
-import { ErrorModalService } from 'app/services/errorModal/error-modal.service';
+import { GeneralModalService } from 'app/services/general-modal/general-modal.service';
import { RequestInProgressService } from 'app/services/requestInProgress/request-in-progress.service';
import { configureTests } from 'app/app.test.configuration';
import {
@@ -55,7 +55,7 @@ describe('ClassificationListComponent', () => {
imports: [HttpClientModule, RouterTestingModule.withRoutes(routes), FormsModule, AngularSvgIconModule],
providers: [
HttpClient, WorkbasketDefinitionService, AlertService, ClassificationsService, DomainService, ClassificationDefinitionService,
- ErrorModalService, RequestInProgressService, ClassificationCategoriesService, TreeService, ImportExportService
+ GeneralModalService, RequestInProgressService, ClassificationCategoriesService, TreeService, ImportExportService
]
})
};
diff --git a/web/src/app/administration/components/import-export/import-export.component.spec.ts b/web/src/app/administration/components/import-export/import-export.component.spec.ts
index 1847f9920..237e3394f 100644
--- a/web/src/app/administration/components/import-export/import-export.component.spec.ts
+++ b/web/src/app/administration/components/import-export/import-export.component.spec.ts
@@ -6,7 +6,7 @@ import { ClassificationDefinitionService } from 'app/administration/services/cla
import { WorkbasketDefinitionService } from '../../services/workbasket-definition/workbasket-definition.service';
import { AlertService } from 'app/services/alert/alert.service';
import { HttpClientModule } from '@angular/common/http';
-import { ErrorModalService } from 'app/services/errorModal/error-modal.service';
+import { GeneralModalService } from 'app/services/general-modal/general-modal.service';
import { AngularSvgIconModule } from 'angular-svg-icon';
import { configureTests } from 'app/app.test.configuration';
import { ImportExportService } from 'app/administration/services/import-export/import-export.service';
@@ -22,7 +22,7 @@ describe('ImportExportComponent', () => {
declarations: [ImportExportComponent],
imports: [HttpClientModule, AngularSvgIconModule],
providers: [WorkbasketService, ClassificationDefinitionService, WorkbasketDefinitionService, AlertService,
- ErrorModalService, ImportExportService]
+ GeneralModalService, ImportExportService]
})
};
configureTests(configure).then(testBed => {
diff --git a/web/src/app/administration/components/import-export/import-export.component.ts b/web/src/app/administration/components/import-export/import-export.component.ts
index 0d80a8f12..42235b1e7 100644
--- a/web/src/app/administration/components/import-export/import-export.component.ts
+++ b/web/src/app/administration/components/import-export/import-export.component.ts
@@ -3,8 +3,8 @@ import { ClassificationDefinitionService } from 'app/administration/services/cla
import { WorkbasketDefinitionService } from 'app/administration/services/workbasket-definition/workbasket-definition.service';
import { DomainService } from 'app/services/domain/domain.service';
import { TaskanaType } from 'app/models/taskana-type';
-import { ErrorModel } from 'app/models/modal-error';
-import { ErrorModalService } from 'app/services/errorModal/error-modal.service';
+import { MessageModal } from 'app/models/message-modal';
+import { GeneralModalService } from 'app/services/general-modal/general-modal.service';
import { environment } from 'environments/environment';
import { AlertService } from 'app/services/alert/alert.service';
import { AlertModel, AlertType } from 'app/models/alert';
@@ -30,7 +30,7 @@ export class ImportExportComponent implements OnInit {
private domainService: DomainService,
private workbasketDefinitionService: WorkbasketDefinitionService,
private classificationDefinitionService: ClassificationDefinitionService,
- private errorModalService: ErrorModalService,
+ private generalModalService: GeneralModalService,
private alertService: AlertService,
public uploadservice: UploadService,
private importExportService: ImportExportService) {
@@ -84,7 +84,7 @@ export class ImportExportComponent implements OnInit {
break;
default:
file.value = '';
- this.errorModalService.triggerError(new ErrorModel(undefined,
+ this.generalModalService.triggerMessage(new MessageModal(undefined,
`This file format is not allowed! Please use a .json file.`));
}
return check;
@@ -117,8 +117,8 @@ export class ImportExportComponent implements OnInit {
}
private errorHandler(title = 'Import was not successful', message) {
- this.errorModalService.triggerError(
- new ErrorModel(
+ this.generalModalService.triggerMessage(
+ new MessageModal(
title,
message
)
diff --git a/web/src/app/administration/workbasket/details/access-items/access-items.component.spec.ts b/web/src/app/administration/workbasket/details/access-items/access-items.component.spec.ts
index 851bd1ab7..0e369338d 100644
--- a/web/src/app/administration/workbasket/details/access-items/access-items.component.spec.ts
+++ b/web/src/app/administration/workbasket/details/access-items/access-items.component.spec.ts
@@ -15,7 +15,7 @@ import { ICONTYPES } from 'app/models/type';
import { AccessItemsComponent } from './access-items.component';
-import { ErrorModalService } from 'app/services/errorModal/error-modal.service';
+import { GeneralModalService } from 'app/services/general-modal/general-modal.service';
import { SavingWorkbasketService } from 'app/administration/services/saving-workbaskets/saving-workbaskets.service';
import { WorkbasketService } from 'app/services/workbasket/workbasket.service';
import { AlertService } from 'app/services/alert/alert.service';
@@ -35,7 +35,7 @@ describe('AccessItemsComponent', () => {
testBed.configureTestingModule({
declarations: [AccessItemsComponent],
imports: [FormsModule, AngularSvgIconModule, HttpClientModule, ReactiveFormsModule],
- providers: [WorkbasketService, AlertService, ErrorModalService, SavingWorkbasketService, RequestInProgressService,
+ providers: [WorkbasketService, AlertService, GeneralModalService, SavingWorkbasketService, RequestInProgressService,
CustomFieldsService, AccessIdsService, FormsValidatorService]
})
};
diff --git a/web/src/app/administration/workbasket/details/access-items/access-items.component.ts b/web/src/app/administration/workbasket/details/access-items/access-items.component.ts
index a073b6641..5b1057251 100644
--- a/web/src/app/administration/workbasket/details/access-items/access-items.component.ts
+++ b/web/src/app/administration/workbasket/details/access-items/access-items.component.ts
@@ -5,12 +5,12 @@ import { FormBuilder, Validators, FormArray } from '@angular/forms';
import { Workbasket } from 'app/models/workbasket';
import { WorkbasketAccessItems } from 'app/models/workbasket-access-items';
import { WorkbasketAccessItemsResource } from 'app/models/workbasket-access-items-resource';
-import { ErrorModel } from 'app/models/modal-error';
+import { MessageModal } from 'app/models/message-modal';
import { ACTION } from 'app/models/action';
import { AlertModel, AlertType } from 'app/models/alert';
import { SavingWorkbasketService, SavingInformation } from 'app/administration/services/saving-workbaskets/saving-workbaskets.service';
-import { ErrorModalService } from 'app/services/errorModal/error-modal.service';
+import { GeneralModalService } from 'app/services/general-modal/general-modal.service';
import { WorkbasketService } from 'app/services/workbasket/workbasket.service';
import { AlertService } from 'app/services/alert/alert.service';
import { RequestInProgressService } from 'app/services/requestInProgress/request-in-progress.service';
@@ -80,7 +80,7 @@ export class AccessItemsComponent implements OnChanges, OnDestroy {
constructor(
private workbasketService: WorkbasketService,
private alertService: AlertService,
- private errorModalService: ErrorModalService,
+ private generalModalService: GeneralModalService,
private savingWorkbaskets: SavingWorkbasketService,
private requestInProgressService: RequestInProgressService,
private customFieldsService: CustomFieldsService,
@@ -181,7 +181,7 @@ export class AccessItemsComponent implements OnChanges, OnDestroy {
AlertType.SUCCESS, `Workbasket ${this.workbasket.name} Access items were saved successfully`));
this.requestInProgressService.setRequestInProgress(false);
}, error => {
- this.errorModalService.triggerError(new ErrorModel(`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);
})
}
diff --git a/web/src/app/administration/workbasket/details/distribution-targets/distribution-targets.component.spec.ts b/web/src/app/administration/workbasket/details/distribution-targets/distribution-targets.component.spec.ts
index 1775936d6..7221d5890 100644
--- a/web/src/app/administration/workbasket/details/distribution-targets/distribution-targets.component.spec.ts
+++ b/web/src/app/administration/workbasket/details/distribution-targets/distribution-targets.component.spec.ts
@@ -14,7 +14,7 @@ import { WorkbasketDistributionTargetsResource } from 'app/models/workbasket-dis
import { WorkbasketService } from 'app/services/workbasket/workbasket.service';
import { AlertService } from 'app/services/alert/alert.service';
-import { ErrorModalService } from 'app/services/errorModal/error-modal.service';
+import { GeneralModalService } from 'app/services/general-modal/general-modal.service';
import { SavingWorkbasketService, SavingInformation } from 'app/administration/services/saving-workbaskets/saving-workbaskets.service';
import { RequestInProgressService } from 'app/services/requestInProgress/request-in-progress.service';
@@ -36,7 +36,7 @@ describe('DistributionTargetsComponent', () => {
testBed.configureTestingModule({
imports: [AngularSvgIconModule, HttpClientModule, InfiniteScrollModule],
declarations: [DistributionTargetsComponent, DualListComponent],
- providers: [WorkbasketService, AlertService, SavingWorkbasketService, ErrorModalService, RequestInProgressService,
+ providers: [WorkbasketService, AlertService, SavingWorkbasketService, GeneralModalService, RequestInProgressService,
]
})
};
diff --git a/web/src/app/administration/workbasket/details/distribution-targets/distribution-targets.component.ts b/web/src/app/administration/workbasket/details/distribution-targets/distribution-targets.component.ts
index e56a63e00..fa6a4ac6b 100644
--- a/web/src/app/administration/workbasket/details/distribution-targets/distribution-targets.component.ts
+++ b/web/src/app/administration/workbasket/details/distribution-targets/distribution-targets.component.ts
@@ -5,14 +5,14 @@ import { Workbasket } from 'app/models/workbasket';
import { WorkbasketSummary } from 'app/models/workbasket-summary';
import { WorkbasketSummaryResource } from 'app/models/workbasket-summary-resource';
import { WorkbasketDistributionTargetsResource } from 'app/models/workbasket-distribution-targets-resource';
-import { ErrorModel } from 'app/models/modal-error';
+import { MessageModal } from 'app/models/message-modal';
import { ACTION } from 'app/models/action';
import { AlertModel, AlertType } from 'app/models/alert';
import { WorkbasketService } from 'app/services/workbasket/workbasket.service';
import { AlertService } from 'app/services/alert/alert.service';
import { SavingWorkbasketService, SavingInformation } from 'app/administration/services/saving-workbaskets/saving-workbaskets.service';
-import { ErrorModalService } from 'app/services/errorModal/error-modal.service';
+import { GeneralModalService } from 'app/services/general-modal/general-modal.service';
import { RequestInProgressService } from 'app/services/requestInProgress/request-in-progress.service';
import { TaskanaQueryParameters } from 'app/shared/util/query-parameters';
import { Page } from 'app/models/page';
@@ -69,9 +69,9 @@ export class DistributionTargetsComponent implements OnChanges, OnDestroy {
private workbasketService: WorkbasketService,
private alertService: AlertService,
private savingWorkbaskets: SavingWorkbasketService,
- private errorModalService: ErrorModalService,
- private requestInProgressService: RequestInProgressService,
- private orientationService: OrientationService) { }
+ private generalModalService: GeneralModalService,
+ private requestInProgressService: RequestInProgressService,
+ private orientationService: OrientationService) { }
ngOnChanges(changes: SimpleChanges): void {
if (!this.initialized && changes.active && changes.active.currentValue === 'distributionTargets') {
@@ -121,7 +121,7 @@ export class DistributionTargetsComponent implements OnChanges, OnDestroy {
return true;
},
error => {
- this.errorModalService.triggerError(new ErrorModel(`There was error while saving your workbasket's distribution targets`, error))
+ this.generalModalService.triggerMessage(new MessageModal(`There was error while saving your workbasket's distribution targets`, error))
this.requestInProgressService.setRequestInProgress(false);
return false;
}
diff --git a/web/src/app/administration/workbasket/details/information/workbasket-information.component.spec.ts b/web/src/app/administration/workbasket/details/information/workbasket-information.component.spec.ts
index b4c763873..ff0217e75 100644
--- a/web/src/app/administration/workbasket/details/information/workbasket-information.component.spec.ts
+++ b/web/src/app/administration/workbasket/details/information/workbasket-information.component.spec.ts
@@ -14,7 +14,7 @@ import { ICONTYPES } from 'app/models/type';
import { ACTION } from 'app/models/action';
import { Links } from 'app/models/links';
-import { ErrorModalService } from 'app/services/errorModal/error-modal.service';
+import { GeneralModalService } from 'app/services/general-modal/general-modal.service';
import { SavingWorkbasketService } from 'app/administration/services/saving-workbaskets/saving-workbaskets.service';
import { AlertService } from 'app/services/alert/alert.service';
import { RequestInProgressService } from 'app/services/requestInProgress/request-in-progress.service';
@@ -47,7 +47,7 @@ describe('WorkbasketInformationComponent', () => {
AngularSvgIconModule,
HttpClientModule,
RouterTestingModule.withRoutes(routes)],
- providers: [WorkbasketService, AlertService, SavingWorkbasketService, ErrorModalService, RequestInProgressService,
+ providers: [WorkbasketService, AlertService, SavingWorkbasketService, GeneralModalService, RequestInProgressService,
CustomFieldsService, FormsValidatorService]
})
diff --git a/web/src/app/administration/workbasket/details/information/workbasket-information.component.ts b/web/src/app/administration/workbasket/details/information/workbasket-information.component.ts
index 37d4e9418..7f71cec97 100644
--- a/web/src/app/administration/workbasket/details/information/workbasket-information.component.ts
+++ b/web/src/app/administration/workbasket/details/information/workbasket-information.component.ts
@@ -12,14 +12,14 @@ import { Subscription } from 'rxjs';
import { NgForm } from '@angular/forms';
import { ICONTYPES } from 'app/models/type';
-import { ErrorModel } from 'app/models/modal-error';
+import { MessageModal } from 'app/models/message-modal';
import { ACTION } from 'app/models/action';
import { Workbasket } from 'app/models/workbasket';
import { AlertModel, AlertType } from 'app/models/alert';
import { TaskanaDate } from 'app/shared/util/taskana.date';
import { AlertService } from 'app/services/alert/alert.service';
-import { ErrorModalService } from 'app/services/errorModal/error-modal.service';
+import { GeneralModalService } from 'app/services/general-modal/general-modal.service';
import {
SavingWorkbasketService,
SavingInformation
@@ -81,7 +81,7 @@ export class WorkbasketInformationComponent
private alertService: AlertService,
private route: ActivatedRoute,
private router: Router,
- private errorModalService: ErrorModalService,
+ private generalModalService: GeneralModalService,
private savingWorkbasket: SavingWorkbasketService,
private requestInProgressService: RequestInProgressService,
private customFieldsService: CustomFieldsService,
@@ -168,8 +168,8 @@ export class WorkbasketInformationComponent
);
},
error => {
- this.errorModalService.triggerError(
- new ErrorModel(
+ this.generalModalService.triggerMessage(
+ new MessageModal(
`There was an error removing distribution target for ${
this.workbasket.workbasketId
}.`,
@@ -204,8 +204,8 @@ export class WorkbasketInformationComponent
},
error => {
this.afterRequest();
- this.errorModalService.triggerError(
- new ErrorModel(
+ this.generalModalService.triggerMessage(
+ new MessageModal(
'There was error while saving your workbasket',
error
)
@@ -256,8 +256,8 @@ export class WorkbasketInformationComponent
}
},
error => {
- this.errorModalService.triggerError(
- new ErrorModel('There was an error creating a workbasket', error)
+ this.generalModalService.triggerMessage(
+ new MessageModal('There was an error creating a workbasket', error)
);
this.requestInProgressService.setRequestInProgress(false);
}
@@ -279,8 +279,8 @@ export class WorkbasketInformationComponent
this.requestInProgressService.setRequestInProgress(false);
this.workbasketService.triggerWorkBasketSaved();
if (response) {
- this.errorModalService.triggerError(
- new ErrorModel('There was an error marking workbasket for deletion',
+ this.generalModalService.triggerMessage(
+ new MessageModal('There was an error marking workbasket for deletion',
'It not possible to mark the workbasket for deletion, It has been deleted.')
);
} else {
diff --git a/web/src/app/administration/workbasket/details/workbasket-details.component.spec.ts b/web/src/app/administration/workbasket/details/workbasket-details.component.spec.ts
index ab56b86c4..1d4007137 100644
--- a/web/src/app/administration/workbasket/details/workbasket-details.component.spec.ts
+++ b/web/src/app/administration/workbasket/details/workbasket-details.component.spec.ts
@@ -20,7 +20,7 @@ import { WorkbasketService } from 'app/services/workbasket/workbasket.service';
import { MasterAndDetailService } from 'app/services/masterAndDetail/master-and-detail.service';
import { AlertService } from 'app/services/alert/alert.service';
import { SavingWorkbasketService } from 'app/administration/services/saving-workbaskets/saving-workbaskets.service';
-import { ErrorModalService } from 'app/services/errorModal/error-modal.service';
+import { GeneralModalService } from 'app/services/general-modal/general-modal.service';
import { RequestInProgressService } from 'app/services/requestInProgress/request-in-progress.service';
import { CustomFieldsService } from 'app/services/custom-fields/custom-fields.service';
import { configureTests } from 'app/app.test.configuration';
@@ -62,7 +62,7 @@ describe('WorkbasketDetailsComponent', () => {
declarations: [WorkbasketDetailsComponent, WorkbasketInformationComponent,
AccessItemsComponent,
DistributionTargetsComponent, DualListComponent, DummyDetailComponent],
- providers: [WorkbasketService, MasterAndDetailService, ErrorModalService, RequestInProgressService,
+ providers: [WorkbasketService, MasterAndDetailService, GeneralModalService, RequestInProgressService,
AlertService, SavingWorkbasketService, CustomFieldsService, ImportExportService]
})
};
diff --git a/web/src/app/administration/workbasket/details/workbasket-details.component.ts b/web/src/app/administration/workbasket/details/workbasket-details.component.ts
index b2a0759b8..cd355c8fe 100644
--- a/web/src/app/administration/workbasket/details/workbasket-details.component.ts
+++ b/web/src/app/administration/workbasket/details/workbasket-details.component.ts
@@ -4,12 +4,12 @@ import { Subscription } from 'rxjs';
import { Workbasket } from 'app/models/workbasket';
import { ACTION } from 'app/models/action';
-import { ErrorModel } from '../../../models/modal-error';
+import { MessageModal } from '../../../models/message-modal';
import { WorkbasketService } from 'app/services/workbasket/workbasket.service'
import { MasterAndDetailService } from 'app/services/masterAndDetail/master-and-detail.service'
import { DomainService } from 'app/services/domain/domain.service';
-import { ErrorModalService } from '../../../services/errorModal/error-modal.service';
+import { GeneralModalService } from '../../../services/general-modal/general-modal.service';
import { ImportExportService } from 'app/administration/services/import-export/import-export.service';
@Component({
@@ -39,7 +39,7 @@ export class WorkbasketDetailsComponent implements OnInit, OnDestroy {
private router: Router,
private masterAndDetailService: MasterAndDetailService,
private domainService: DomainService,
- private errorModalService: ErrorModalService,
+ private generalModalService: GeneralModalService,
private importExportService: ImportExportService) { }
@@ -118,15 +118,15 @@ export class WorkbasketDetailsComponent implements OnInit, OnDestroy {
this.requestInProgress = false;
this.checkDomainAndRedirect();
}, err => {
- this.errorModalService.triggerError(
- new ErrorModel('An error occurred while fetching the workbasket', err));
+ this.generalModalService.triggerMessage(
+ new MessageModal('An error occurred while fetching the workbasket', err));
});
}
}
private checkDomainAndRedirect() {
this.domainSubscription = this.domainService.getSelectedDomain().subscribe(domain => {
- if (this.workbasket && this.workbasket.domain !== domain) {
+ if (domain !== '' && this.workbasket && this.workbasket.domain !== domain) {
this.backClicked();
}
});
diff --git a/web/src/app/app-routing.module.ts b/web/src/app/app-routing.module.ts
index 583bf03d6..c3f7013ef 100644
--- a/web/src/app/app-routing.module.ts
+++ b/web/src/app/app-routing.module.ts
@@ -1,11 +1,10 @@
import { NgModule } from '@angular/core';
import { RouterModule, Routes } from '@angular/router';
-import { AppComponent } from './app.component';
-
-import { BusinessAdminGuard } from './guards/business-admin-guard';
-import { MonitorGuard } from './guards/monitor-guard';
-import { UserGuard } from './guards/user-guard';
+import { BusinessAdminGuard } from './guards/business-admin.guard';
+import { MonitorGuard } from './guards/monitor.guard';
+import { UserGuard } from './guards/user.guard';
+import { HistoryGuard } from './guards/history.guard';
import { NoAccessComponent } from './components/no-access/no-access.component';
const appRoutes: Routes = [
@@ -24,6 +23,11 @@ const appRoutes: Routes = [
path: 'workplace',
loadChildren: './workplace/workplace.module#WorkplaceModule'
},
+ {
+ canActivate: [HistoryGuard],
+ path: 'history',
+ loadChildren: './history/history.module#HistoryModule'
+ },
{
path: 'no-role',
component: NoAccessComponent
diff --git a/web/src/app/app.component.html b/web/src/app/app.component.html
index 3fa562d18..ef9bc2748 100644
--- a/web/src/app/app.component.html
+++ b/web/src/app/app.component.html
@@ -2,7 +2,8 @@
-
+
diff --git a/web/src/app/app.component.ts b/web/src/app/app.component.ts
index 484bffc20..b41fb43fb 100644
--- a/web/src/app/app.component.ts
+++ b/web/src/app/app.component.ts
@@ -2,9 +2,9 @@ import { Component, OnInit, HostListener, OnDestroy } from '@angular/core';
import { Router, NavigationStart } from '@angular/router';
import { Subscription } from 'rxjs';
-import { ErrorModel } from './models/modal-error';
+import { MessageModal } from './models/message-modal';
-import { ErrorModalService } from './services/errorModal/error-modal.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';
@@ -20,14 +20,15 @@ export class AppComponent implements OnInit, OnDestroy {
workbasketsRoute = true;
- modalErrorMessage = '';
+ modalMessage = '';
modalTitle = '';
+ modalType;
selectedRoute = '';
requestInProgress = false;
currentProgressValue = 0;
- errorModalSubscription: Subscription;
+ modalSubscription: Subscription;
requestInProgressSubscription: Subscription;
selectedRouteSubscription: Subscription;
routerSubscription: Subscription;
@@ -40,7 +41,7 @@ export class AppComponent implements OnInit, OnDestroy {
constructor(
private router: Router,
- private errorModalService: ErrorModalService,
+ private generalModalService: GeneralModalService,
private requestInProgressService: RequestInProgressService,
private orientationService: OrientationService,
private selectedRouteService: SelectedRouteService,
@@ -56,15 +57,18 @@ export class AppComponent implements OnInit, OnDestroy {
}
})
- this.errorModalSubscription = this.errorModalService.getError().subscribe((error: ErrorModel) => {
- if (typeof error.message === 'string') {
- this.modalErrorMessage = error.message
- } else if (error.message.error instanceof ProgressEvent) {
- this.modalErrorMessage = error.message.message;
+ this.modalSubscription = this.generalModalService.getMessage().subscribe((messageModal: MessageModal) => {
+ if (typeof messageModal.message === 'string') {
+ this.modalMessage = messageModal.message
+ } else if (messageModal.message.error instanceof ProgressEvent) {
+ this.modalMessage = messageModal.message.message;
} else {
- this.modalErrorMessage = error.message.error ? (error.message.error.error + ' ' + error.message.error.message) : error.message.message;
+ this.modalMessage = messageModal.message.error ?
+ (messageModal.message.error.error + ' ' + messageModal.message.error.message)
+ : messageModal.message.message;
}
- this.modalTitle = error.title;
+ this.modalTitle = messageModal.title;
+ this.modalType = messageModal.type;
})
this.requestInProgressSubscription = this.requestInProgressService.getRequestInProgress().subscribe((value: boolean) => {
@@ -84,7 +88,7 @@ export class AppComponent implements OnInit, OnDestroy {
ngOnDestroy() {
if (this.routerSubscription) { this.routerSubscription.unsubscribe(); }
- if (this.errorModalSubscription) { this.errorModalSubscription.unsubscribe(); }
+ if (this.modalSubscription) { this.modalSubscription.unsubscribe(); }
if (this.requestInProgressSubscription) { this.requestInProgressSubscription.unsubscribe(); }
if (this.selectedRouteSubscription) { this.selectedRouteSubscription.unsubscribe(); }
if (this.uploadingFileSubscription) { this.uploadingFileSubscription.unsubscribe(); }
diff --git a/web/src/app/app.module.ts b/web/src/app/app.module.ts
index 5e6e30187..e9694171a 100644
--- a/web/src/app/app.module.ts
+++ b/web/src/app/app.module.ts
@@ -18,7 +18,7 @@ import { SharedModule } from 'app/shared/shared.module';
* Services
*/
-import { ErrorModalService } from 'app/services/errorModal/error-modal.service';
+import { GeneralModalService } from 'app/services/general-modal/general-modal.service';
import { RequestInProgressService } from 'app/services/requestInProgress/request-in-progress.service';
import { OrientationService } from 'app/services/orientation/orientation.service';
import { SelectedRouteService } from 'app/services/selected-route/selected-route';
@@ -46,10 +46,10 @@ import { NoAccessComponent } from 'app/components/no-access/no-access.component'
/**
* Guards
*/
-import { DomainGuard } from './guards/domain-guard';
-import { BusinessAdminGuard } from './guards/business-admin-guard';
-import { MonitorGuard } from './guards/monitor-guard';
-import { UserGuard } from './guards/user-guard';
+import { DomainGuard } from './guards/domain.guard';
+import { BusinessAdminGuard } from './guards/business-admin.guard';
+import { MonitorGuard } from './guards/monitor.guard';
+import { UserGuard } from './guards/user.guard';
import { APP_BASE_HREF } from '@angular/common';
@@ -88,7 +88,7 @@ export function startupServiceFactory(startupService: StartupService): () => Pro
WindowRefService,
{ provide: APP_BASE_HREF, useValue: '/' },
DomainService,
- ErrorModalService,
+ GeneralModalService,
RequestInProgressService,
OrientationService,
SelectedRouteService,
diff --git a/web/src/app/app.test.configuration.ts b/web/src/app/app.test.configuration.ts
index c85810387..a2b982e05 100644
--- a/web/src/app/app.test.configuration.ts
+++ b/web/src/app/app.test.configuration.ts
@@ -16,7 +16,7 @@ import { DomainServiceMock } from './services/domain/domain.service.mock';
import { CustomFieldsService } from 'app/services/custom-fields/custom-fields.service';
import { RemoveConfirmationService } from 'app/services/remove-confirmation/remove-confirmation.service';
import { AlertService } from './services/alert/alert.service';
-import { ErrorModalService } from './services/errorModal/error-modal.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';
@@ -41,7 +41,7 @@ export const configureTests = (configure: (testBed: TestBed) => void) => {
imports: [BrowserAnimationsModule, SharedModule, FormsModule, ReactiveFormsModule, HttpClientModule, AngularSvgIconModule],
providers: [{ provide: TaskanaEngineService, useClass: TaskanaEngineServiceMock },
{ provide: DomainService, useClass: DomainServiceMock }, CustomFieldsService, RemoveConfirmationService,
- AlertService, ErrorModalService, RequestInProgressService, OrientationService, SelectedRouteService, FormsValidatorService]
+ AlertService, GeneralModalService, RequestInProgressService, OrientationService, SelectedRouteService, FormsValidatorService]
});
return testBed.compileComponents().then(() => testBed);
diff --git a/web/src/app/components/nav-bar/nav-bar.component.html b/web/src/app/components/nav-bar/nav-bar.component.html
index cc3e9dfa2..0805e3f3b 100644
--- a/web/src/app/components/nav-bar/nav-bar.component.html
+++ b/web/src/app/components/nav-bar/nav-bar.component.html
@@ -66,6 +66,9 @@
+
Taskana version: {{version}}
diff --git a/web/src/app/components/nav-bar/nav-bar.component.spec.ts b/web/src/app/components/nav-bar/nav-bar.component.spec.ts
index 4b0b28784..20aed0def 100644
--- a/web/src/app/components/nav-bar/nav-bar.component.spec.ts
+++ b/web/src/app/components/nav-bar/nav-bar.component.spec.ts
@@ -9,10 +9,10 @@ import { NavBarComponent } from './nav-bar.component';
import { UserInformationComponent } from 'app/components/user-information/user-information.component';
import { SelectedRouteService } from 'app/services/selected-route/selected-route';
-import { BusinessAdminGuard } from 'app/guards/business-admin-guard';
-import { MonitorGuard } from 'app/guards/monitor-guard';
+import { BusinessAdminGuard } from 'app/guards/business-admin.guard';
+import { MonitorGuard } from 'app/guards/monitor.guard';
import { WindowRefService } from 'app/services/window/window.service';
-import { ErrorModalService } from 'app/services/errorModal/error-modal.service';
+import { GeneralModalService } from 'app/services/general-modal/general-modal.service';
import { RequestInProgressService } from 'app/services/requestInProgress/request-in-progress.service';
import { configureTests } from 'app/app.test.configuration';
@@ -41,7 +41,7 @@ describe('NavBarComponent', () => {
BusinessAdminGuard,
MonitorGuard,
WindowRefService,
- ErrorModalService,
+ GeneralModalService,
RequestInProgressService]
})
};
diff --git a/web/src/app/components/nav-bar/nav-bar.component.ts b/web/src/app/components/nav-bar/nav-bar.component.ts
index ae785d40f..899f492c1 100644
--- a/web/src/app/components/nav-bar/nav-bar.component.ts
+++ b/web/src/app/components/nav-bar/nav-bar.component.ts
@@ -3,10 +3,10 @@ import { environment } from 'environments/environment';
import { SelectedRouteService } from 'app/services/selected-route/selected-route';
import { Subscription } from 'rxjs';
import { DomainService } from 'app/services/domain/domain.service';
-import { BusinessAdminGuard } from 'app/guards/business-admin-guard';
-import { MonitorGuard } from 'app/guards/monitor-guard';
+import { BusinessAdminGuard } from 'app/guards/business-admin.guard';
+import { MonitorGuard } from 'app/guards/monitor.guard';
import { WindowRefService } from 'app/services/window/window.service';
-import { UserGuard } from 'app/guards/user-guard';
+import { UserGuard } from 'app/guards/user.guard';
import { TaskanaEngineService } from '../../services/taskana-engine/taskana-engine.service';
import { expandRight } from 'app/shared/animations/expand.animation';
@Component({
@@ -27,6 +27,7 @@ export class NavBarComponent implements OnInit, OnDestroy {
titleAccessItems = 'Access items';
titleMonitor = 'Monitor';
titleWorkplace = 'Workplace';
+ titleHistory = 'History';
showNavbar = false;
domains: Array
= [];
selectedDomain: string;
@@ -35,10 +36,12 @@ export class NavBarComponent implements OnInit, OnDestroy {
adminUrl = './administration';
monitorUrl = './monitor';
workplaceUrl = './workplace';
+ historyUrl = './history';
administrationAccess = false;
monitorAccess = false;
workplaceAccess = false;
+ historyAccess = false;
selectedRouteSubscription: Subscription;
getDomainsSubscription: Subscription;
@@ -69,6 +72,11 @@ export class NavBarComponent implements OnInit, OnDestroy {
this.administrationAccess = this.taskanaEngineService.hasRole(BusinessAdminGuard.roles);
this.monitorAccess = this.taskanaEngineService.hasRole(MonitorGuard.roles);
this.workplaceAccess = this.taskanaEngineService.hasRole(UserGuard.roles);
+
+ this.taskanaEngineService.isHistoryProviderEnabled().subscribe(value => {
+ this.historyAccess = value;
+ })
+
}
switchDomain(domain) {
@@ -103,6 +111,8 @@ export class NavBarComponent implements OnInit, OnDestroy {
this.title = this.titleWorkplace;
} else if (value.indexOf('access-items') === 0) {
this.title = this.titleAccessItems;
+ } else if (value.indexOf('history') === 0) {
+ this.title = this.titleHistory;
}
}
diff --git a/web/src/app/components/no-access/no-access.component.ts b/web/src/app/components/no-access/no-access.component.ts
index 02ff9ed5a..75f38d491 100644
--- a/web/src/app/components/no-access/no-access.component.ts
+++ b/web/src/app/components/no-access/no-access.component.ts
@@ -1,8 +1,8 @@
import { Component, OnInit } from '@angular/core';
import { TaskanaEngineService } from '../../services/taskana-engine/taskana-engine.service';
-import { BusinessAdminGuard } from 'app/guards/business-admin-guard';
-import { MonitorGuard } from 'app/guards/monitor-guard';
-import { UserGuard } from 'app/guards/user-guard';
+import { BusinessAdminGuard } from 'app/guards/business-admin.guard';
+import { MonitorGuard } from 'app/guards/monitor.guard';
+import { UserGuard } from 'app/guards/user.guard';
import { Router } from '@angular/router';
@Component({
diff --git a/web/src/app/guards/business-admin-guard.ts b/web/src/app/guards/business-admin.guard.ts
similarity index 70%
rename from web/src/app/guards/business-admin-guard.ts
rename to web/src/app/guards/business-admin.guard.ts
index ac97bbfaa..9ed32f7b8 100644
--- a/web/src/app/guards/business-admin-guard.ts
+++ b/web/src/app/guards/business-admin.guard.ts
@@ -1,10 +1,5 @@
-import { Observable } from 'rxjs';
-import { HttpClient } from '@angular/common/http';
import { CanActivate, Router } from '@angular/router';
import { Injectable } from '@angular/core';
-import { DomainService } from 'app/services/domain/domain.service';
-import { ErrorModalService } from 'app/services/errorModal/error-modal.service';
-import { ErrorModel } from 'app/models/modal-error';
import { TaskanaEngineService } from 'app/services/taskana-engine/taskana-engine.service';
@Injectable()
diff --git a/web/src/app/guards/domain-guard.ts b/web/src/app/guards/domain.guard.ts
similarity index 67%
rename from web/src/app/guards/domain-guard.ts
rename to web/src/app/guards/domain.guard.ts
index 7a7cacf11..dbcbfdcb5 100644
--- a/web/src/app/guards/domain-guard.ts
+++ b/web/src/app/guards/domain.guard.ts
@@ -2,13 +2,13 @@ import { of } from 'rxjs';
import { CanActivate } from '@angular/router';
import { Injectable } from '@angular/core';
import { DomainService } from 'app/services/domain/domain.service';
-import { ErrorModalService } from 'app/services/errorModal/error-modal.service';
-import { ErrorModel } from 'app/models/modal-error';
+import { GeneralModalService } from 'app/services/general-modal/general-modal.service';
+import { MessageModal } from 'app/models/message-modal';
import { map, catchError } from 'rxjs/operators';
@Injectable()
export class DomainGuard implements CanActivate {
- constructor(private domainService: DomainService, private errorModalService: ErrorModalService) { }
+ constructor(private domainService: DomainService, private generalModalService: GeneralModalService) { }
canActivate() {
return this.domainService.getDomains().pipe(
@@ -16,7 +16,7 @@ export class DomainGuard implements CanActivate {
return true;
}),
catchError(() => {
- this.errorModalService.triggerError(new ErrorModel(
+ this.generalModalService.triggerMessage(new MessageModal(
'There was an error, please contact with your administrator', 'There was an error getting Domains'));
return of(false)
})
diff --git a/web/src/app/guards/history.guard.ts b/web/src/app/guards/history.guard.ts
new file mode 100644
index 000000000..20a429171
--- /dev/null
+++ b/web/src/app/guards/history.guard.ts
@@ -0,0 +1,40 @@
+import { Injectable } from '@angular/core';
+import { CanActivate, ActivatedRouteSnapshot, RouterStateSnapshot, Router } from '@angular/router';
+import { Observable, of } from 'rxjs';
+import { TaskanaEngineService } from 'app/services/taskana-engine/taskana-engine.service';
+import { map, catchError } from 'rxjs/operators';
+import { GeneralModalService } from 'app/services/general-modal/general-modal.service';
+import { MessageModal } from 'app/models/message-modal';
+
+@Injectable({
+ providedIn: 'root'
+})
+export class HistoryGuard implements CanActivate {
+ constructor(
+ private taskanaEngineService: TaskanaEngineService,
+ public router: Router,
+ public generalModalService: GeneralModalService) { }
+
+ canActivate(
+ next: ActivatedRouteSnapshot,
+ state: RouterStateSnapshot): Observable | Promise | boolean {
+ return this.taskanaEngineService.isHistoryProviderEnabled().pipe(
+ map(value => {
+ if (value) {
+ return value;
+ }
+ return this.navigateToWorkplace();
+ }),
+ catchError(() => {
+ this.generalModalService.triggerMessage(new MessageModal(
+ 'There was an error, please contact with your administrator', 'There was an error getting history provider'));
+ return of(this.navigateToWorkplace());
+ })
+ );
+ }
+
+ navigateToWorkplace(): boolean {
+ this.router.navigate(['workplace']);
+ return false;
+ }
+}
diff --git a/web/src/app/guards/monitor-guard.ts b/web/src/app/guards/monitor.guard.ts
similarity index 65%
rename from web/src/app/guards/monitor-guard.ts
rename to web/src/app/guards/monitor.guard.ts
index 3930097b6..a9fa77fd0 100644
--- a/web/src/app/guards/monitor-guard.ts
+++ b/web/src/app/guards/monitor.guard.ts
@@ -1,12 +1,6 @@
-import { Observable } from 'rxjs';
-import { HttpClient } from '@angular/common/http';
import { CanActivate, Router } from '@angular/router';
import { Injectable } from '@angular/core';
-import { DomainService } from 'app/services/domain/domain.service';
-import { ErrorModalService } from 'app/services/errorModal/error-modal.service';
-import { ErrorModel } from 'app/models/modal-error';
import { TaskanaEngineService } from 'app/services/taskana-engine/taskana-engine.service';
-import { WindowRefService } from 'app/services/window/window.service';
@Injectable()
export class MonitorGuard implements CanActivate {
diff --git a/web/src/app/guards/user-guard.ts b/web/src/app/guards/user.guard.ts
similarity index 100%
rename from web/src/app/guards/user-guard.ts
rename to web/src/app/guards/user.guard.ts
diff --git a/web/src/app/history/history-routing.module.ts b/web/src/app/history/history-routing.module.ts
new file mode 100644
index 000000000..1660d8080
--- /dev/null
+++ b/web/src/app/history/history-routing.module.ts
@@ -0,0 +1,19 @@
+import { NgModule } from '@angular/core';
+import { Routes, RouterModule } from '@angular/router';
+import { TaskQueryComponent } from './task-query/task-query.component';
+
+const routes: Routes = [
+ {
+ path: '',
+ component: TaskQueryComponent
+ },
+ {
+ path: '**',
+ redirectTo: ''
+ }];
+
+@NgModule({
+ imports: [RouterModule.forChild(routes)],
+ exports: [RouterModule]
+})
+export class HistoryRoutingModule { }
diff --git a/web/src/app/history/history.module.spec.ts b/web/src/app/history/history.module.spec.ts
new file mode 100644
index 000000000..074ecfada
--- /dev/null
+++ b/web/src/app/history/history.module.spec.ts
@@ -0,0 +1,13 @@
+import { HistoryModule } from './history.module';
+
+describe('HistoryModule', () => {
+ let historyModule: HistoryModule;
+
+ beforeEach(() => {
+ historyModule = new HistoryModule();
+ });
+
+ it('should create an instance', () => {
+ expect(historyModule).toBeTruthy();
+ });
+});
diff --git a/web/src/app/history/history.module.ts b/web/src/app/history/history.module.ts
new file mode 100644
index 000000000..11bcc9f84
--- /dev/null
+++ b/web/src/app/history/history.module.ts
@@ -0,0 +1,19 @@
+import { NgModule } from '@angular/core';
+import { CommonModule } from '@angular/common';
+import { FormsModule, ReactiveFormsModule } from '@angular/forms';
+
+import { HistoryRoutingModule } from './history-routing.module';
+import { TaskQueryComponent } from './task-query/task-query.component';
+import { SharedModule } from 'app/shared/shared.module';
+
+@NgModule({
+ imports: [
+ CommonModule,
+ HistoryRoutingModule,
+ SharedModule,
+ FormsModule,
+ ReactiveFormsModule
+ ],
+ declarations: [TaskQueryComponent]
+})
+export class HistoryModule { }
diff --git a/web/src/app/history/services/task-query/task-query.service.spec.ts b/web/src/app/history/services/task-query/task-query.service.spec.ts
new file mode 100644
index 000000000..b100a7328
--- /dev/null
+++ b/web/src/app/history/services/task-query/task-query.service.spec.ts
@@ -0,0 +1,15 @@
+import { TestBed, inject } from '@angular/core/testing';
+
+import { TaskQueryService } from './task-query.service';
+
+describe('TaskQueryService', () => {
+ beforeEach(() => {
+ TestBed.configureTestingModule({
+ providers: [TaskQueryService]
+ });
+ });
+
+ it('should be created', inject([TaskQueryService], (service: TaskQueryService) => {
+ expect(service).toBeTruthy();
+ }));
+});
diff --git a/web/src/app/history/services/task-query/task-query.service.ts b/web/src/app/history/services/task-query/task-query.service.ts
new file mode 100644
index 000000000..33ae89c94
--- /dev/null
+++ b/web/src/app/history/services/task-query/task-query.service.ts
@@ -0,0 +1,124 @@
+import { Injectable } from '@angular/core';
+import { TaskHistoryEventData } from 'app/models/task-history-event';
+import { TaskHistoryEventResourceData } from 'app/models/task-history-event-resource';
+import { QueryParametersModel } from 'app/models/query-parameters';
+import { TaskanaQueryParameters } from 'app/shared/util/query-parameters';
+import { Direction } from 'app/models/sorting';
+import { Observable, of } from 'rxjs';
+import { HttpClient } from '@angular/common/http';
+import { environment } from 'environments/environment';
+
+@Injectable({
+ providedIn: 'root'
+})
+export class TaskQueryService {
+ private url = environment.taskanaRestUrl;
+
+ constructor(private httpClient: HttpClient) { }
+
+ queryTask(
+ orderBy: string = 'task-id',
+ sortDirection: string = Direction.ASC,
+ taskId: string,
+ parentBPI: string,
+ BPI: string,
+ eventType: string,
+ userId: string,
+ domain: string,
+ workbasketKey: string,
+ porCompany: string,
+ porSystem: string,
+ porInstance: string,
+ porType: string,
+ porValue: string,
+ taskClassificationKey: string,
+ taskClassificationCategory: string,
+ attachmentClassificationKey: string,
+ custom1: string,
+ custom2: string,
+ custom3: string,
+ custom4: string,
+ allPages: boolean = false
+ ): Observable {
+
+ return this.httpClient.get(`${this.url}/v1/task-history-event${this.getQueryParameters(
+ orderBy,
+ sortDirection,
+ taskId,
+ parentBPI,
+ BPI,
+ eventType,
+ userId,
+ domain,
+ workbasketKey,
+ porCompany,
+ porSystem,
+ porInstance,
+ porType,
+ porValue,
+ taskClassificationKey,
+ taskClassificationCategory,
+ attachmentClassificationKey,
+ custom1,
+ custom2,
+ custom3,
+ custom4,
+ allPages
+ )}`);
+
+ }
+
+ private getQueryParameters(
+ orderBy: string,
+ sortDirection: string,
+ taskId: string,
+ parentBPI: string,
+ BPI: string,
+ eventType: string,
+ userId: string,
+ domain: string,
+ workbasketKey: string,
+ porCompany: string,
+ porSystem: string,
+ porInstance: string,
+ porType: string,
+ porValue: string,
+ taskClassificationKey: string,
+ taskClassificationCategory: string,
+ attachmentClassificationKey: string,
+ custom1: string,
+ custom2: string,
+ custom3: string,
+ custom4: string,
+ allPages: boolean = false): string {
+
+ const parameters = new QueryParametersModel();
+ parameters.SORTBY = orderBy
+ parameters.SORTDIRECTION = sortDirection;
+ parameters.TASK_ID_LIKE = taskId;
+ parameters.PARENT_BUSINESS_PROCESS_ID_LIKE = parentBPI;
+ parameters.BUSINESS_PROCESS_ID_LIKE = BPI;
+ parameters.EVENT_TYPE_LIKE = eventType;
+ parameters.USER_ID_LIKE = userId;
+ parameters.DOMAIN = domain;
+ parameters.WORKBASKETKEYLIKE = workbasketKey;
+ parameters.POR_COMPANY_LIKE = porCompany;
+ parameters.POR_SYSTEM_LIKE = porSystem;
+ parameters.POR_INSTANCE_LIKE = porInstance;
+ parameters.POR_TYPE_LIKE = porType;
+ parameters.POR_VALUE_LIKE = porValue;
+ parameters.TASK_CLASSIFICATION_KEY_LIKE = taskClassificationKey;
+ parameters.TASK_CLASSIFICATION_CATEGORY_LIKE = taskClassificationCategory;
+ parameters.ATTACHMENT_CLASSIFICATION_KEY_LIKE = attachmentClassificationKey;
+ parameters.CUSTOM_1_LIKE = custom1;
+ parameters.CUSTOM_2_LIKE = custom2;
+ parameters.CUSTOM_3_LIKE = custom3;
+ parameters.CUSTOM_4_LIKE = custom4;
+
+ if (allPages) { TaskanaQueryParameters.page = undefined; TaskanaQueryParameters.pageSize = undefined; }
+
+ return TaskanaQueryParameters.getQueryParameters(parameters);
+ }
+}
+
+
diff --git a/web/src/app/history/task-query/task-query.component.html b/web/src/app/history/task-query/task-query.component.html
new file mode 100644
index 000000000..f7bcb26e0
--- /dev/null
+++ b/web/src/app/history/task-query/task-query.component.html
@@ -0,0 +1,83 @@
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/web/src/app/history/task-query/task-query.component.scss b/web/src/app/history/task-query/task-query.component.scss
new file mode 100644
index 000000000..e4d47a15b
--- /dev/null
+++ b/web/src/app/history/task-query/task-query.component.scss
@@ -0,0 +1,28 @@
+.divTable{
+ max-height: calc(100vh - 152px);
+ padding-right: 15px;
+}
+
+.divTableFoot {
+ display: block;
+}
+
+.divTableCell {
+ height: 34px;
+ max-height: 34px;
+}
+
+.btn-xs{
+ padding: 0px;
+}
+.divTable .btn {
+ border: none;
+}
+
+.icon-space{
+ margin-right: 20px;
+}
+
+.divTablePagination {
+ margin: 0 auto;
+}
diff --git a/web/src/app/history/task-query/task-query.component.spec.ts b/web/src/app/history/task-query/task-query.component.spec.ts
new file mode 100644
index 000000000..e198512f5
--- /dev/null
+++ b/web/src/app/history/task-query/task-query.component.spec.ts
@@ -0,0 +1,25 @@
+import { async, ComponentFixture, TestBed } from '@angular/core/testing';
+
+import { TaskQueryComponent } from './task-query.component';
+
+describe('TaskQueryComponent', () => {
+ let component: TaskQueryComponent;
+ let fixture: ComponentFixture;
+
+ beforeEach(async(() => {
+ TestBed.configureTestingModule({
+ declarations: [ TaskQueryComponent ]
+ })
+ .compileComponents();
+ }));
+
+ beforeEach(() => {
+ fixture = TestBed.createComponent(TaskQueryComponent);
+ component = fixture.componentInstance;
+ fixture.detectChanges();
+ });
+
+ it('should create', () => {
+ expect(component).toBeTruthy();
+ });
+});
diff --git a/web/src/app/history/task-query/task-query.component.ts b/web/src/app/history/task-query/task-query.component.ts
new file mode 100644
index 000000000..6d6170e6f
--- /dev/null
+++ b/web/src/app/history/task-query/task-query.component.ts
@@ -0,0 +1,231 @@
+import { Component, OnInit } from '@angular/core';
+import { TaskQueryService } from '../services/task-query/task-query.service';
+import { TaskHistoryEventData } from '../../models/task-history-event';
+import { SortingModel, Direction } from 'app/models/sorting';
+import { OrientationService } from 'app/services/orientation/orientation.service';
+import { Subscription } from 'rxjs';
+import { Orientation } from 'app/models/orientation';
+import { TaskanaQueryParameters } from 'app/shared/util/query-parameters';
+import { GeneralModalService } from 'app/services/general-modal/general-modal.service';
+import { MessageModal } from 'app/models/message-modal';
+import { FormGroup, FormControl } from '@angular/forms';
+import { TaskHistoryEventResourceData } from 'app/models/task-history-event-resource';
+import { RequestInProgressService } from 'app/services/requestInProgress/request-in-progress.service';
+
+@Component({
+ selector: 'taskana-task-query',
+ templateUrl: './task-query.component.html',
+ styleUrls: ['./task-query.component.scss']
+})
+export class TaskQueryComponent implements OnInit {
+
+ taskQueryResource: TaskHistoryEventResourceData;
+ taskQuery: Array
+ taskQueryHeader = new TaskHistoryEventData();
+ orderBy = new SortingModel(TaskanaQueryParameters.parameters.WORKBASKET_KEY);
+ orientationSubscription: Subscription;
+ taskQuerySubscription: Subscription;
+
+ taskQueryForm = new FormGroup({
+ });
+
+ constructor(
+ private taskQueryService: TaskQueryService,
+ private orientationService: OrientationService,
+ private generalModalService: GeneralModalService,
+ private requestInProgressService: RequestInProgressService, ) { }
+
+ ngOnInit() {
+ this.orientationSubscription = this.orientationService.getOrientation().subscribe((orientation: Orientation) => {
+ this.performRequest();
+ });
+ this.initTaskQueryForm();
+ }
+
+
+ getHeaderFieldDescription(property: string): string {
+ switch (property) {
+ case 'parentBusinessProcessId':
+ return 'Parent BPI';
+ case 'businessProcessId':
+ return 'BPI';
+ case 'taskId':
+ return 'Task id';
+ case 'eventType':
+ return 'Event type';
+ case 'created':
+ return 'Created';
+ case 'userId':
+ return 'User id';
+ case 'domain':
+ return 'Domain';
+ case 'workbasketKey':
+ return 'Workbasket key';
+ case 'porCompany':
+ return 'Obj company';
+ case 'porSystem':
+ return 'Obj system';
+ case 'porInstance':
+ return 'Obj instance';
+ case 'porType':
+ return 'Obj type';
+ case 'porValue':
+ return 'Obj value';
+ case 'taskClassificationKey':
+ return 'Classification key';
+ case 'taskClassificationCategory':
+ return 'Classification category';
+ case 'attachmentClassificationKey':
+ return 'Attachment Classification';
+ case 'custom1':
+ return 'Custom 1';
+ case 'custom2':
+ return 'Custom 2';
+ case 'custom3':
+ return 'Custom 3';
+ case 'custom4':
+ return 'Custom 4';
+ case 'oldData':
+ return 'Old data';
+ case 'newData':
+ return 'New data';
+ case 'comment':
+ return 'Comment';
+ case 'oldValue':
+ return 'Old value';
+ case 'newValue':
+ return 'New value';
+ default:
+ return property;
+ }
+ }
+ filterFieldsToAllowQuerying(fieldName: string): boolean {
+ if (!fieldName || fieldName === 'oldData' || fieldName === 'newData' || fieldName === 'comment'
+ || fieldName === 'oldValue' || fieldName === 'newValue') {
+ return false;
+ }
+
+ return true;
+ }
+
+ filterFieldsToShow(fieldName: string): boolean {
+ if (fieldName === 'taskHistoryId' || fieldName === 'page' || fieldName === 'created' || fieldName === '_links') {
+ return false;
+ }
+ return true;
+ }
+
+ filterExpandGroup(fieldName: string): boolean {
+ if (fieldName === 'custom1' || fieldName === 'custom2' || fieldName === 'custom3' || fieldName === 'custom4'
+ || fieldName === 'oldData' || fieldName === 'newData' || fieldName === 'comment'
+ || fieldName === 'oldValue' || fieldName === 'newValue') {
+ return true;
+ }
+ return false;
+ }
+
+ search() {
+ this.performRequest();
+ }
+
+ changeOrderBy(key: string) {
+ if (!this.filterFieldsToAllowQuerying(key)) {
+ return null;
+ }
+ if (this.orderBy.sortBy === key) {
+ this.orderBy.sortDirection = this.toggleSortDirection(this.orderBy.sortDirection);
+ }
+ this.orderBy.sortBy = key;
+ }
+
+ openDetails(key: string, val: string) {
+ this.generalModalService.triggerMessage(
+ new MessageModal(
+ `These are the details of ${this.getHeaderFieldDescription(key)}`,
+ val,
+ 'code'
+ )
+ )
+ }
+
+ getTaskValue(key: string, task: TaskHistoryEventData): string {
+ return task[key];
+ }
+
+ clear() {
+ this.taskQueryForm.reset();
+ this.performRequest();
+ }
+
+ changePage(page) {
+ TaskanaQueryParameters.page = page;
+ this.performRequest();
+ }
+
+ private toggleSortDirection(sortDirection: string): Direction {
+ if (sortDirection === Direction.ASC) {
+ return Direction.DESC;
+ }
+ return Direction.ASC
+ }
+
+ private performRequest() {
+ setTimeout(() => this.requestInProgressService.setRequestInProgress(true), 1)
+ this.calculateQueryPages();
+ this.taskQuerySubscription = this.taskQueryService.queryTask(
+ this.orderBy.sortBy.replace(/([A-Z])|([0-9])/g, (g) => `-${g[0].toLowerCase()}`),
+ this.orderBy.sortDirection,
+ this.taskQueryForm.get('taskId') ? this.taskQueryForm.get('taskId').value : undefined,
+ this.taskQueryForm.get('parentBusinessProcessId') ? this.taskQueryForm.get('parentBusinessProcessId').value : undefined,
+ this.taskQueryForm.get('businessProcessId') ? this.taskQueryForm.get('businessProcessId').value : undefined,
+ this.taskQueryForm.get('eventType') ? this.taskQueryForm.get('eventType').value : undefined,
+ this.taskQueryForm.get('userId') ? this.taskQueryForm.get('userId').value : undefined,
+ this.taskQueryForm.get('domain') ? this.taskQueryForm.get('domain').value : undefined,
+ this.taskQueryForm.get('workbasketKey') ? this.taskQueryForm.get('workbasketKey').value : undefined,
+ this.taskQueryForm.get('porCompany') ? this.taskQueryForm.get('porCompany').value : undefined,
+ this.taskQueryForm.get('porSystem') ? this.taskQueryForm.get('porSystem').value : undefined,
+ this.taskQueryForm.get('porInstance') ? this.taskQueryForm.get('porInstance').value : undefined,
+ this.taskQueryForm.get('porType') ? this.taskQueryForm.get('porType').value : undefined,
+ this.taskQueryForm.get('porValue') ? this.taskQueryForm.get('porValue').value : undefined,
+ this.taskQueryForm.get('taskClassificationKey') ? this.taskQueryForm.get('taskClassificationKey').value : undefined,
+ this.taskQueryForm.get('taskClassificationCategory') ? this.taskQueryForm.get('taskClassificationCategory').value : undefined,
+ this.taskQueryForm.get('attachmentClassificationKey') ? this.taskQueryForm.get('attachmentClassificationKey').value : undefined,
+ this.taskQueryForm.get('custom1') ? this.taskQueryForm.get('custom1').value : undefined,
+ this.taskQueryForm.get('custom2') ? this.taskQueryForm.get('custom2').value : undefined,
+ this.taskQueryForm.get('custom3') ? this.taskQueryForm.get('custom3').value : undefined,
+ this.taskQueryForm.get('custom4') ? this.taskQueryForm.get('custom4').value : undefined,
+ false).subscribe(taskQueryResource => {
+ this.requestInProgressService.setRequestInProgress(false)
+ if (!taskQueryResource._embedded) {
+ this.taskQuery = null;
+ this.taskQueryResource = null;
+ return null;
+ }
+ this.taskQueryResource = taskQueryResource;
+ this.taskQuery = taskQueryResource._embedded.taskHistoryEventResourceList;
+ })
+ }
+
+ private initTaskQueryForm() {
+ const me = this;
+ Object.keys(new TaskHistoryEventData()).forEach(function (key) {
+ me.taskQueryForm.addControl(key, new FormControl());
+ });
+ }
+
+ private calculateQueryPages() {
+
+ const rowHeight = 34;
+ const unusedHeight = 300;
+ const totalHeight = window.innerHeight;
+ const cards = Math.round((totalHeight - (unusedHeight)) / rowHeight);
+ TaskanaQueryParameters.page ? TaskanaQueryParameters.page = TaskanaQueryParameters.page : TaskanaQueryParameters.page = 1;
+ cards > 0 ? TaskanaQueryParameters.pageSize = cards : TaskanaQueryParameters.pageSize = 1;
+ }
+
+ onDestroy() {
+ if (this.orientationSubscription) { this.orientationSubscription.unsubscribe(); }
+ if (this.taskQuerySubscription) { this.taskQuerySubscription.unsubscribe(); }
+ }
+
+}
diff --git a/web/src/app/models/message-modal.ts b/web/src/app/models/message-modal.ts
new file mode 100644
index 000000000..f52ecabbf
--- /dev/null
+++ b/web/src/app/models/message-modal.ts
@@ -0,0 +1,7 @@
+export class MessageModal {
+ constructor(
+ public title: string = undefined,
+ public message: any = undefined,
+ public type = 'error'
+ ) { }
+}
diff --git a/web/src/app/models/modal-error.ts b/web/src/app/models/modal-error.ts
deleted file mode 100644
index 7b0f0606c..000000000
--- a/web/src/app/models/modal-error.ts
+++ /dev/null
@@ -1,6 +0,0 @@
-export class ErrorModel {
- constructor(
- public title: string = undefined,
- public message: any = undefined
- ) { }
-}
diff --git a/web/src/app/models/query-parameters.ts b/web/src/app/models/query-parameters.ts
new file mode 100644
index 000000000..821c94075
--- /dev/null
+++ b/web/src/app/models/query-parameters.ts
@@ -0,0 +1,50 @@
+
+export class QueryParametersModel {
+ SORTBY: string;
+ SORTDIRECTION: string;
+ // Filtering
+ NAME: string;
+ NAMELIKE: string;
+ DESCLIKE: string;
+ OWNER: string;
+ OWNERLIKE: string;
+ TYPE: string;
+ KEY: string;
+ WORKBASKET_KEY: string;
+ KEYLIKE: string;
+ PRIORITY: string;
+ STATE: string;
+ WORKBASKET_ID: string;
+ TASK_PRIMARY_OBJ_REF_TYPE_LIKE: string;
+ TASK_PRIMARY_OBJ_REF_VALUE_LIKE: string;
+ // Access
+ REQUIREDPERMISSION: string;
+ ACCESSIDS: string;
+ ACCESSIDLIKE: string;
+ WORKBASKETKEYLIKE: string;
+ // Pagination
+ PAGE: string;
+ PAGESIZE: string;
+ // Domain
+ DOMAIN: string;
+ // Task history events
+ TASK_ID_LIKE: string;
+ PARENT_BUSINESS_PROCESS_ID_LIKE: string;
+ BUSINESS_PROCESS_ID_LIKE: string;
+ EVENT_TYPE_LIKE: string;
+ CREATED_LIKE: string;
+ USER_ID_LIKE: string;
+ POR_COMPANY_LIKE: string;
+ POR_SYSTEM_LIKE: string;
+ POR_INSTANCE_LIKE: string;
+ POR_TYPE_LIKE: string;
+ POR_VALUE_LIKE: string;
+ TASK_CLASSIFICATION_KEY_LIKE: string;
+ TASK_CLASSIFICATION_CATEGORY_LIKE: string;
+ ATTACHMENT_CLASSIFICATION_KEY_LIKE: string;
+ CUSTOM_1_LIKE: string;
+ CUSTOM_2_LIKE: string;
+ CUSTOM_3_LIKE: string;
+ CUSTOM_4_LIKE: string;
+ COMMENT_LIKE: string;
+}
diff --git a/web/src/app/models/task-history-event-resource.ts b/web/src/app/models/task-history-event-resource.ts
new file mode 100644
index 000000000..a2632345f
--- /dev/null
+++ b/web/src/app/models/task-history-event-resource.ts
@@ -0,0 +1,7 @@
+import { Links } from './links';
+import { TaskHistoryEventData } from './task-history-event';
+
+export class TaskHistoryEventResourceData {
+ public _embedded: { 'taskHistoryEventResourceList': Array }
+ public _links: Links = undefined
+}
diff --git a/web/src/app/models/task-history-event.ts b/web/src/app/models/task-history-event.ts
new file mode 100644
index 000000000..bebf30c73
--- /dev/null
+++ b/web/src/app/models/task-history-event.ts
@@ -0,0 +1,31 @@
+import { Page } from './page';
+
+export class TaskHistoryEventData {
+ taskHistoryId = 0;
+ taskId = '';
+ parentBusinessProcessId = '';
+ businessProcessId = '';
+ eventType = '';
+ created = '';
+ userId = '';
+ domain = '';
+ workbasketKey = '';
+ porCompany = '';
+ porSystem = '';
+ porInstance = '';
+ porType = '';
+ porValue = '';
+ taskClassificationKey = '';
+ taskClassificationCategory = '';
+ attachmentClassificationKey = '';
+ custom1 = '';
+ custom2 = '';
+ custom3 = '';
+ custom4 = '';
+ comment = '';
+ oldValue = '';
+ newValue = '';
+ oldData = '';
+ newData = '';
+ page = new Page();
+}
diff --git a/web/src/app/monitor/monitor.component.html b/web/src/app/monitor/monitor.component.html
index 8a01e092c..20b60a627 100644
--- a/web/src/app/monitor/monitor.component.html
+++ b/web/src/app/monitor/monitor.component.html
@@ -1,16 +1,17 @@
-
+
\ No newline at end of file
diff --git a/web/src/app/monitor/monitor.component.ts b/web/src/app/monitor/monitor.component.ts
index dcff733c5..94afd05f6 100644
--- a/web/src/app/monitor/monitor.component.ts
+++ b/web/src/app/monitor/monitor.component.ts
@@ -8,8 +8,14 @@ import { Component, OnInit, HostListener, OnDestroy } from '@angular/core';
})
export class MonitorComponent implements OnInit, OnDestroy {
+ tabSelected = 'tasks';
+
ngOnInit(): void {
}
ngOnDestroy(): void {
}
+
+ selectTab(tab) {
+ this.tabSelected = tab;
+ }
}
diff --git a/web/src/app/monitor/tasks/tasks.component.html b/web/src/app/monitor/tasks/tasks.component.html
index 2bee785eb..9b11270f2 100644
--- a/web/src/app/monitor/tasks/tasks.component.html
+++ b/web/src/app/monitor/tasks/tasks.component.html
@@ -2,8 +2,8 @@
{{reportData.meta.name}} ({{reportData.meta.date | date : 'dd.MM.yyyy HH:mm:ss'}})
-
-
+
+
diff --git a/web/src/app/services/classifications/classifications.service.ts b/web/src/app/services/classifications/classifications.service.ts
index c3269c6f9..9d75ec03b 100644
--- a/web/src/app/services/classifications/classifications.service.ts
+++ b/web/src/app/services/classifications/classifications.service.ts
@@ -12,6 +12,7 @@ import { ClassificationCategoriesService } from './classification-categories.ser
import { DomainService } from 'app/services/domain/domain.service';
import { TaskanaQueryParameters } from 'app/shared/util/query-parameters';
import { Direction } from 'app/models/sorting';
+import { QueryParametersModel } from 'app/models/query-parameters';
@Injectable()
export class ClassificationsService {
@@ -27,35 +28,20 @@ export class ClassificationsService {
}
// GET
- getClassifications(sortBy: string = TaskanaQueryParameters.KEY,
- order: string = Direction.ASC,
- name: string = undefined,
- nameLike: string = undefined,
- descLike: string = undefined,
- owner: string = undefined,
- ownerLike: string = undefined,
- type: string = undefined,
- key: string = undefined,
- keyLike: string = undefined,
- requiredPermission: string = undefined,
- allPages: boolean = true): Observable
> {
+ getClassifications(): Observable> {
return this.domainService.getSelectedDomain().pipe(
mergeMap(domain => {
return this.getClassificationObservable(this.httpClient.get(
- `${environment.taskanaRestUrl}/v1/classifications/${TaskanaQueryParameters.getQueryParameters(
- sortBy, order, name,
- nameLike, descLike, owner, ownerLike, type, key, keyLike, requiredPermission,
- !allPages ? TaskanaQueryParameters.page : undefined, !allPages ? TaskanaQueryParameters.pageSize : undefined, domain)}`));
+ `${this.url}${TaskanaQueryParameters.getQueryParameters(this.classificationParameters(domain))}`));
}),
tap(() => { this.domainService.domainChangedComplete(); })
)
}
-
// GET
getClassification(id: string): Observable {
- return this.httpClient.get(`${environment.taskanaRestUrl}/v1/classifications/${id}`)
+ return this.httpClient.get(`${this.url}${id}`)
.pipe(tap((classification: ClassificationDefinition) => {
if (classification) {
this.classificationCategoriesService.selectClassificationType(classification.type);
@@ -99,6 +85,18 @@ export class ClassificationsService {
// #endregion
+ private classificationParameters(domain: string): QueryParametersModel {
+
+ const parameters = new QueryParametersModel();
+ parameters.SORTBY = TaskanaQueryParameters.parameters.KEY;
+ parameters.SORTDIRECTION = Direction.ASC;
+ parameters.DOMAIN = domain;
+ TaskanaQueryParameters.page = undefined;
+ TaskanaQueryParameters.pageSize = undefined;
+
+ return parameters;
+ }
+
private getClassificationObservable(classificationRef: Observable): Observable {
const classificationTypes = this.classificationCategoriesService.getSelectedClassificationType();
return combineLatest(
diff --git a/web/src/app/services/errorModal/error-modal.service.ts b/web/src/app/services/errorModal/error-modal.service.ts
deleted file mode 100644
index 0a949203c..000000000
--- a/web/src/app/services/errorModal/error-modal.service.ts
+++ /dev/null
@@ -1,19 +0,0 @@
-import { Injectable } from '@angular/core';
-import { Subject , Observable } from 'rxjs';
-import { ErrorModel } from 'app/models/modal-error';
-
-@Injectable()
-export class ErrorModalService {
-
- private errorTriggered = new Subject();
-
- constructor() { }
-
- triggerError(error: ErrorModel) {
- this.errorTriggered.next(error);
- }
-
- getError(): Observable {
- return this.errorTriggered.asObservable();
- }
-}
diff --git a/web/src/app/services/general-modal/general-modal.service.ts b/web/src/app/services/general-modal/general-modal.service.ts
new file mode 100644
index 000000000..2e3b9cf41
--- /dev/null
+++ b/web/src/app/services/general-modal/general-modal.service.ts
@@ -0,0 +1,19 @@
+import { Injectable } from '@angular/core';
+import { Subject , Observable } from 'rxjs';
+import { MessageModal } from 'app/models/message-modal';
+
+@Injectable()
+export class GeneralModalService {
+
+ private messageTriggered = new Subject();
+
+ constructor() { }
+
+ triggerMessage(message: MessageModal) {
+ this.messageTriggered.next(message);
+ }
+
+ getMessage(): Observable {
+ return this.messageTriggered.asObservable();
+ }
+}
diff --git a/web/src/app/services/selected-route/selected-route.ts b/web/src/app/services/selected-route/selected-route.ts
index fe2d4ccb9..7e78acd81 100644
--- a/web/src/app/services/selected-route/selected-route.ts
+++ b/web/src/app/services/selected-route/selected-route.ts
@@ -7,7 +7,7 @@ export class SelectedRouteService {
public selectedRouteTriggered = new Subject();
- private detailRoutes: Array = ['workbaskets', 'classifications', 'monitor', 'workplace', 'access-items-management'];
+ private detailRoutes: Array = ['workbaskets', 'classifications', 'monitor', 'workplace', 'access-items-management', 'history'];
constructor(private router: Router) { }
diff --git a/web/src/app/services/taskana-engine/taskana-engine.mock.service.ts b/web/src/app/services/taskana-engine/taskana-engine.mock.service.ts
index 494e8b07c..bad730664 100644
--- a/web/src/app/services/taskana-engine/taskana-engine.mock.service.ts
+++ b/web/src/app/services/taskana-engine/taskana-engine.mock.service.ts
@@ -34,6 +34,10 @@ export class TaskanaEngineServiceMock {
return of(version);
}
+ isHistoryProviderEnabled(): Observable {
+ return of(true);
+ }
+
private findRole(roles2Find: Array) {
return this.currentUserInfo.roles.find(role => {
return roles2Find.some(roleLookingFor => {
diff --git a/web/src/app/services/taskana-engine/taskana-engine.service.ts b/web/src/app/services/taskana-engine/taskana-engine.service.ts
index 49d8c9d34..5ae70f66f 100644
--- a/web/src/app/services/taskana-engine/taskana-engine.service.ts
+++ b/web/src/app/services/taskana-engine/taskana-engine.service.ts
@@ -44,6 +44,10 @@ export class TaskanaEngineService {
}
+ isHistoryProviderEnabled(): Observable {
+ return this.httpClient.get(`${environment.taskanaRestUrl}/v1/history-provider-enabled`);
+ }
+
private findRole(roles2Find: Array) {
return this.currentUserInfo.roles.find(role => {
return roles2Find.some(roleLookingFor => {
diff --git a/web/src/app/services/workbasket/workbasket.service.ts b/web/src/app/services/workbasket/workbasket.service.ts
index 3059ebbfb..3a1fba2c8 100644
--- a/web/src/app/services/workbasket/workbasket.service.ts
+++ b/web/src/app/services/workbasket/workbasket.service.ts
@@ -13,6 +13,7 @@ import { DomainService } from 'app/services/domain/domain.service';
import { WorkbasketResource } from '../../models/workbasket-resource';
import { TaskanaQueryParameters } from 'app/shared/util/query-parameters';
import { mergeMap, tap, catchError } from 'rxjs/operators';
+import { QueryParametersModel } from 'app/models/query-parameters';
@Injectable()
export class WorkbasketService {
@@ -29,7 +30,7 @@ export class WorkbasketService {
// #region "REST calls"
// GET
getWorkBasketsSummary(forceRequest: boolean = false,
- sortBy: string = TaskanaQueryParameters.KEY,
+ sortBy: string = TaskanaQueryParameters.parameters.KEY,
order: string = Direction.ASC,
name: string = undefined,
nameLike: string = undefined,
@@ -46,12 +47,11 @@ export class WorkbasketService {
return this.workbasketSummaryRef;
}
+
return this.domainService.getSelectedDomain().pipe(mergeMap(domain => {
return this.workbasketSummaryRef = this.httpClient.get(
- `${environment.taskanaRestUrl}/v1/workbaskets/${TaskanaQueryParameters.getQueryParameters(
- sortBy, order, name,
- nameLike, descLike, owner, ownerLike, type, key, keyLike, requiredPermission,
- !allPages ? TaskanaQueryParameters.page : undefined, !allPages ? TaskanaQueryParameters.pageSize : undefined, domain)}`)
+ `${environment.taskanaRestUrl}/v1/workbaskets/${TaskanaQueryParameters.getQueryParameters(this.workbasketParameters(sortBy, order, name,
+ nameLike, descLike, owner, ownerLike, type, key, keyLike, requiredPermission, allPages, domain))}`)
.pipe(tap((workbaskets => {
return workbaskets;
})))
@@ -82,8 +82,8 @@ export class WorkbasketService {
.put(url, workbasket).pipe(
catchError(this.handleError)
);
- }
- // delete
+ }
+ // delete
markWorkbasketForDeletion(url: string): Observable {
return this.httpClient
.delete(url);
@@ -152,5 +152,41 @@ export class WorkbasketService {
return observableThrowError(errMsg);
}
+
+ private workbasketParameters(
+ sortBy: string = TaskanaQueryParameters.parameters.KEY,
+ order: string = Direction.ASC,
+ name: string = undefined,
+ nameLike: string = undefined,
+ descLike: string = undefined,
+ owner: string = undefined,
+ ownerLike: string = undefined,
+ type: string = undefined,
+ key: string = undefined,
+ keyLike: string = undefined,
+ requiredPermission: string = undefined,
+ allPages: boolean = false,
+ domain: string = ''): QueryParametersModel {
+
+ const parameters = new QueryParametersModel();
+ parameters.SORTBY = sortBy;
+ parameters.SORTDIRECTION = order;
+ parameters.NAME = name;
+ parameters.NAMELIKE = nameLike;
+ parameters.DESCLIKE = descLike;
+ parameters.OWNER = owner;
+ parameters.OWNERLIKE = ownerLike;
+ parameters.TYPE = type;
+ parameters.KEY = key;
+ parameters.KEYLIKE = keyLike;
+ parameters.REQUIREDPERMISSION = requiredPermission;
+ parameters.DOMAIN = domain;
+ if (allPages) {
+ TaskanaQueryParameters.page = undefined;
+ TaskanaQueryParameters.pageSize = undefined;
+ }
+ return parameters;
+ }
+
// #endregion
}
diff --git a/web/src/app/shared/filter/filter.component.html b/web/src/app/shared/filter/filter.component.html
index 461bbb62c..480cd371d 100644
--- a/web/src/app/shared/filter/filter.component.html
+++ b/web/src/app/shared/filter/filter.component.html
@@ -16,12 +16,12 @@
-
+
-
+
-
+