[SI-723] total commit + bugfixes SI-1378, 1544, 1543
Signed-off-by: Peter Buschmann <peter.buschmann@pta.de>
diff --git a/i18n/general.de.json b/i18n/general.de.json
index 2977d28..2d2947a 100644
--- a/i18n/general.de.json
+++ b/i18n/general.de.json
@@ -19,6 +19,7 @@
"PublishBtn": "Veröffentlichen",
"StornoBtn": "Stornieren",
"CreatedBtn": "Anlegen",
+ "CompleteBtn": "Beenden",
"GridEmptyLabel": "Keine Daten vorhanden!",
"Filtering": "Filterung",
"Sorting": "Sortierung",
diff --git a/projects/grid-failure-information-app/src/app/pages/grid-failure/grid-failure-details/grid-failure-details.component.html b/projects/grid-failure-information-app/src/app/pages/grid-failure/grid-failure-details/grid-failure-details.component.html
index a8b513e..185818b 100644
--- a/projects/grid-failure-information-app/src/app/pages/grid-failure/grid-failure-details/grid-failure-details.component.html
+++ b/projects/grid-failure-information-app/src/app/pages/grid-failure/grid-failure-details/grid-failure-details.component.html
@@ -29,6 +29,16 @@
{{ 'StornoBtn' | translate }}
</button>
</ng-container>
+ <ng-container *ngIf="gridFailureDetailsSandbox.showCompleteButton && gridFailureDetailsSandbox.currentFormState?.isEnabled">
+ <button
+ *visibleByRight="RolesEnum.QUALIFIER"
+ type="button"
+ class="btn btn-primary right-button"
+ (click)="gridFailureDetailsSandbox.setState(StateEnum.COMPLETED)"
+ >
+ {{ 'CompleteBtn' | translate }}
+ </button>
+ </ng-container>
</div>
<div *ngIf="gridFailureDetailsSandbox.currentFormState?.isEnabled">
<ng-container *ngIf="gridFailureDetailsSandbox.showPublishButton && gridFailureDetailsSandbox.currentFormState.isEnabled">
@@ -217,12 +227,7 @@
</div>
<!-- pressureLevel -->
- <div
- class="form-group row"
- [visibleByDependentField]="
- gridFailureDetailsSandbox.currentFormState.isEnabled && formState.value.branch !== Globals.BUSINESS_RULE_FIELDS.branch.power
- "
- >
+ <div class="form-group row" [visibleByDependentField]="formState.value.branch !== Globals.BUSINESS_RULE_FIELDS.branch.power">
<label for="pressureLevel" class="col-sm-2 col-form-label">{{ 'GridFailure.PressureLevel' | translate }}</label>
<div class="col-sm-4">
<select type="text" class="form-control" id="pressureLevel" [ngrxFormControlState]="formState.controls['pressureLevel']">
diff --git a/projects/grid-failure-information-app/src/app/pages/grid-failure/grid-failure-details/grid-failure-details.sandbox.ts b/projects/grid-failure-information-app/src/app/pages/grid-failure/grid-failure-details/grid-failure-details.sandbox.ts
index 23b8eed..783728c 100644
--- a/projects/grid-failure-information-app/src/app/pages/grid-failure/grid-failure-details/grid-failure-details.sandbox.ts
+++ b/projects/grid-failure-information-app/src/app/pages/grid-failure/grid-failure-details/grid-failure-details.sandbox.ts
@@ -44,7 +44,6 @@
SetUserDefinedPropertyAction,
SetValueAction,
box,
- MarkAsTouchedAction,
MarkAsDirtyAction,
unbox,
} from 'ngrx-forms';
@@ -114,7 +113,9 @@
public showCreatedButton: boolean = false;
public showUpdateButton: boolean = false;
public showPublishButton: boolean = false;
+ public showCompleteButton: boolean = false;
public gridFailureAddress: models.FailureAddress;
+ public gridFailureStations: FailureStation[] = [];
private _stations: Array<models.FailureStation> = new Array<models.FailureStation>();
public gridFailureDistributionGroups$: Observable<models.DistributionGroup[]> = this.appState$.select(store.getGridFailureDistributionGroupsData);
@@ -124,10 +125,8 @@
public disablePublishButton: boolean;
public disableStationAttributes = false;
- private _gridFailureStations: Array<models.FailureStation> = new Array<models.FailureStation>();
private _gridFailureId: string;
private _selectedStation: models.FailureStation;
- public gridFailureStations: FailureStation[] = [];
private _assignedDistributionGroups: Array<models.DistributionGroup>;
constructor(
@@ -278,7 +277,6 @@
});
this.appState$.dispatch(new SetValueAction(INITIAL_STATE.controls.distributionGroupUuids.id, box(distributionGroupUuids)));
}
- const gridFailure = unboxProperties(this.currentFormState.value) as models.GridFailure;
this.appState$.dispatch(
gridFailureActions.saveGridFailure({
@@ -777,6 +775,7 @@
this.showCreatedButton = false;
this.showUpdateButton = false;
this.showPublishButton = false;
+ this.showCompleteButton = false;
switch (state) {
case enums.StateEnum.NEW:
@@ -791,6 +790,7 @@
case enums.StateEnum.QUALIFIED:
this.showUpdateButton = true;
this.showPublishButton = true;
+ this.showCompleteButton = true;
break;
default:
break;
diff --git a/projects/grid-failure-information-app/src/app/pages/grid-failure/grid-failure-list/grid-failure-list-column-definition.ts b/projects/grid-failure-information-app/src/app/pages/grid-failure/grid-failure-list/grid-failure-list-column-definition.ts
index 648f076..c5a8a59 100644
--- a/projects/grid-failure-information-app/src/app/pages/grid-failure/grid-failure-list/grid-failure-list-column-definition.ts
+++ b/projects/grid-failure-information-app/src/app/pages/grid-failure/grid-failure-list/grid-failure-list-column-definition.ts
@@ -13,7 +13,7 @@
import { DateTimeCellRendererComponent } from '@grid-failure-information-app/shared/components/cell-renderer/date-time-cell-renderer/date-time-cell-renderer.component';
import { IconCellRendererComponent } from '@grid-failure-information-app/shared/components/cell-renderer/icon-cell-renderer/icon-cell-renderer.component';
import { dateTimeComparator } from '@grid-failure-information-app/shared/utility';
-import { GridFailureSandbox } from "@grid-failure-information-app/pages/grid-failure/grid-failure-list/grid-failure.sandbox";
+import { GridFailureSandbox } from '@grid-failure-information-app/pages/grid-failure/grid-failure-list/grid-failure.sandbox';
export const GRID_FAILURE_COLDEF = [
{
@@ -53,6 +53,13 @@
filter: 'setFilterComponent',
},
{
+ field: 'publicationStatus',
+ colId: 'publicationStatus',
+ headerName: 'GridFailure.PublicationStatus',
+ sortable: true,
+ filter: 'setFilterComponent',
+ },
+ {
field: 'branch',
colId: 'branch',
headerName: 'GridFailure.Branch',
@@ -159,6 +166,13 @@
filter: 'setFilterComponent',
},
{
+ field: 'radius',
+ colId: 'radius',
+ headerName: 'GridFailure.RadiusInM',
+ sortable: true,
+ filter: 'setFilterComponent',
+ },
+ {
field: 'stationDescription',
colId: 'stationDescription',
headerName: 'GridFailure.StationDescription',
@@ -167,13 +181,6 @@
valueGetter: params => params.context.sandbox.stationsValueGetter(params.data.stationIds.value),
},
{
- field: 'radius',
- colId: 'radius',
- headerName: 'GridFailure.RadiusInM',
- sortable: true,
- filter: 'setFilterComponent',
- },
- {
field: 'tools',
headerName: ' ',
pinned: 'right',
diff --git a/projects/grid-failure-information-app/src/app/shared/models/grid-failure.model.ts b/projects/grid-failure-information-app/src/app/shared/models/grid-failure.model.ts
index 109f517..efb5962 100644
--- a/projects/grid-failure-information-app/src/app/shared/models/grid-failure.model.ts
+++ b/projects/grid-failure-information-app/src/app/shared/models/grid-failure.model.ts
@@ -71,7 +71,7 @@
public failureInformationCondensedId: string = null;
public addressPolygonPoints: Array<[Number, Number]> | Boxed<Array<[Number, Number]>> = null;
public description: string = null;
- public publicationChannels: string[] = null;
+ public publicationChannels: Array<string> = null;
public constructor(data: any = null) {
super(data);