-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
13 changed files
with
163 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3 changes: 3 additions & 0 deletions
3
src/app/components/anschriften/anschriften-edit/anschriften-edit.component.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
<mkj-form-wrapper [formGroup]="formGroup" [component]="this"> | ||
<mkj-anschrift-form [formControl]="formGroup"></mkj-anschrift-form> | ||
</mkj-form-wrapper> |
Empty file.
52 changes: 52 additions & 0 deletions
52
src/app/components/anschriften/anschriften-edit/anschriften-edit.component.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
import { Component } from "@angular/core"; | ||
import { FormControl, FormGroup } from "@angular/forms"; | ||
import { ActivatedRoute, Router } from "@angular/router"; | ||
import { Anschrift } from "src/app/models/Anschrift"; | ||
import { PermissionMap } from "src/app/models/User"; | ||
import { AnschriftenApiService } from "src/app/services/api/anschriften-api.service"; | ||
import { InfoService } from "src/app/services/info.service"; | ||
import { AbstractFormComponent } from "src/app/utilities/form-components/_abstract-form-component.class"; | ||
import { MkjToolbarService } from "src/app/utilities/mkj-toolbar/mkj-toolbar.service"; | ||
|
||
@Component({ | ||
selector: "app-anschriften-edit", | ||
templateUrl: "./anschriften-edit.component.html", | ||
styleUrl: "./anschriften-edit.component.scss", | ||
}) | ||
export class AnschriftEditComponent extends AbstractFormComponent<Anschrift> { | ||
protected navigateBackOnSave = true; | ||
|
||
constructor( | ||
toolbarService: MkjToolbarService, | ||
apiService: AnschriftenApiService, | ||
infoService: InfoService, | ||
route: ActivatedRoute, | ||
router: Router | ||
) { | ||
super(toolbarService, apiService, infoService, route, router); | ||
} | ||
|
||
protected initToolbar(): void { | ||
this.toolbarService.backButton = true; | ||
|
||
if (this.getId() !== "new") { | ||
this.toolbarService.header = "Adresse bearbeiten"; | ||
this.toolbarService.buttons = [ | ||
{ | ||
label: "Adresse Löschen", | ||
icon: "pi pi-trash", | ||
click: () => this.delete(), | ||
permissions: [PermissionMap.ANSCHRIFTEN_DELETE], | ||
}, | ||
]; | ||
} else { | ||
this.toolbarService.header = "Neue Adresse"; | ||
} | ||
} | ||
protected initFormGroup(): FormGroup<any> { | ||
return new FormControl(null) as unknown as FormGroup<any>; | ||
} | ||
protected getId(): string { | ||
return this.route.snapshot.params.id; | ||
} | ||
} |
14 changes: 14 additions & 0 deletions
14
src/app/components/anschriften/anschriften-overview/anschriften-overview.component.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
<mkj-content-loader [loading]="!adressen"> | ||
<div | ||
*ngFor="let add of adressen" | ||
class="col-12 flex justify-content-between border-1" | ||
> | ||
<span>{{ add.vorname }} {{ add.zuname }}{{ add.firma }}</span> | ||
<button | ||
pButton | ||
icon="pi pi-pencil" | ||
class="p-button-text p-button-small" | ||
[routerLink]="add.id" | ||
></button> | ||
</div> | ||
</mkj-content-loader> |
Empty file.
38 changes: 38 additions & 0 deletions
38
src/app/components/anschriften/anschriften-overview/anschriften-overview.component.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
import { Component } from "@angular/core"; | ||
import { ActivatedRoute, Router } from "@angular/router"; | ||
import { Anschrift } from "src/app/models/Anschrift"; | ||
import { PermissionMap } from "src/app/models/User"; | ||
import { AnschriftenApiService } from "src/app/services/api/anschriften-api.service"; | ||
import { MkjToolbarService } from "src/app/utilities/mkj-toolbar/mkj-toolbar.service"; | ||
|
||
@Component({ | ||
selector: "app-anschriften-overview", | ||
templateUrl: "./anschriften-overview.component.html", | ||
styleUrl: "./anschriften-overview.component.scss", | ||
}) | ||
export class AnschriftenOverviewComponent { | ||
public adressen: Anschrift[]; | ||
|
||
constructor( | ||
private apiService: AnschriftenApiService, | ||
private toolbarService: MkjToolbarService, | ||
private router: Router, | ||
private route: ActivatedRoute | ||
) { | ||
apiService.getList().subscribe((list) => { | ||
this.adressen = list.values; | ||
}); | ||
toolbarService.header = "Adressen"; | ||
toolbarService.buttons = [ | ||
{ | ||
icon: "pi pi-plus", | ||
routerLink: "/new", | ||
click: () => | ||
this.router.navigate(["new"], { | ||
relativeTo: this.route, | ||
}), | ||
permissions: [PermissionMap.ANSCHRIFTEN_SAVE], | ||
}, | ||
]; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters