BP 583: added sticky headline to function form
diff --git a/src/app/masterdata-management/components/function/function.component.html b/src/app/masterdata-management/components/function/function.component.html
index e16f2bb..66f5cc6 100644
--- a/src/app/masterdata-management/components/function/function.component.html
+++ b/src/app/masterdata-management/components/function/function.component.html
@@ -11,6 +11,14 @@
-->
<div class="container-fluid">
<form class="mt-3" [formGroup]="form" novalidate>
+ <div class="d-flex justify-content-between flex-wrap flex-md-nowrap align-items-center pt-3 pb-2 mb-3 border-bottom stick-headlines">
+ <h1 class="h2">Funktion</h1>
+ <div class="btn-toolbar mb-2 mb-md-0">
+ <button *ngIf="authService.userHasRoles(['BP_Sachbearbeiter','BP_Admin'])" class="btn btn-success mr-1" (click)="saveFunction()"
+ id="functionSave">Speichern</button>
+ <button class="btn btn-danger float-right" routerLink="/stammdatenverwaltung/funktion" id="functionCancel">Abbrechen</button>
+ </div>
+ </div>
<ngb-accordion #acc="ngbAccordion" activeIds="functionData">
<!-- DATEN -->
<ngb-panel title="Funktionen" id="functionData">
@@ -30,12 +38,5 @@
</ng-template>
</ngb-panel>
</ngb-accordion>
- <div class="row mt-3 mb-3">
- <div class="col-md-12">
- <button *ngIf="authService.userHasRoles(['BP_Sachbearbeiter','BP_Admin'])" class="btn btn-success"
- (click)="saveRegion()" id="functionSave">Speichern</button>
- <button class="btn btn-danger float-right" routerLink="/stammdatenverwaltung/funktion" id="functionCancel">Abbrechen</button>
- </div>
- </div>
</form>
</div>
\ No newline at end of file
diff --git a/src/app/masterdata-management/components/function/function.component.ts b/src/app/masterdata-management/components/function/function.component.ts
index 3ce18c2..dab45e5 100644
--- a/src/app/masterdata-management/components/function/function.component.ts
+++ b/src/app/masterdata-management/components/function/function.component.ts
@@ -29,7 +29,7 @@
decision = new Subject<boolean>();
param$: Subscription;
- user$: Subscription;
+ function$: Subscription;
constructor(
public authService: AuthenticationService,
private masterDataService: MasterdataService,
@@ -43,7 +43,7 @@
this.param$ = this.route.params.subscribe((params: Params) => {
const id = params['id'];
if (id && id !== 'new') {
- this.user$ = this.masterDataService.getFunction(id).subscribe(
+ this.function$ = this.masterDataService.getFunction(id).subscribe(
data => {
this.form.patchValue(data);
}
@@ -65,7 +65,7 @@
/**
* Saves the current Form
*/
- saveRegion() {
+ saveFunction() {
if (FormUtil.validate(this.form)) {
const functionToSave = this.form.getRawValue();
this.masterDataService.saveFunction(functionToSave).subscribe((res: FunctionObject) => {
@@ -83,8 +83,8 @@
if (this.param$) {
this.param$.unsubscribe();
}
- if (this.user$) {
- this.user$.unsubscribe();
+ if (this.function$) {
+ this.function$.unsubscribe();
}
}
}