-
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
22 changed files
with
313 additions
and
105 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
25 changes: 11 additions & 14 deletions
25
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 |
---|---|---|
@@ -1,14 +1,11 @@ | ||
<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> | ||
<mkj-list | ||
[datasource]="datasource" | ||
[configuration]="listConfig" | ||
[templateMap]="{ | ||
rowexpansion: null, | ||
}" | ||
(onDoubleClick)="navigateToEdit($event)" | ||
> | ||
</mkj-list> | ||
|
||
<ng-template #rowexpansion let-anschrift> </ng-template> |
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
40 changes: 11 additions & 29 deletions
40
...pp/components/archiv/instrumente/instrumente-overview/instrumente-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 |
---|---|---|
@@ -1,29 +1,11 @@ | ||
<p-table [value]="values" [loading]="!values" responsiveLayout="scroll"> | ||
<ng-template pTemplate="header"> | ||
<tr> | ||
<th>Bezeichnung</th> | ||
<th>Marke</th> | ||
<th pSortableColumn="gruppe.name"> | ||
Register <p-sortIcon field="vonDatum"></p-sortIcon> | ||
</th> | ||
<th | ||
*visibleFor="[PermissionMap.INSTRUMENTE_SAVE]" | ||
style="width: 5rem" | ||
></th> | ||
</tr> | ||
</ng-template> | ||
<ng-template pTemplate="body" let-item> | ||
<tr> | ||
<td>{{ item.bezeichnung }}</td> | ||
<td>{{ item.marke }}</td> | ||
<td>{{ item.gruppe?.name }}</td> | ||
<td *visibleFor="[PermissionMap.INSTRUMENTE_SAVE]"> | ||
<button | ||
pButton | ||
icon="pi pi-pencil" | ||
class="p-button-rounded p-button-outlined p-button-info" | ||
(click)="navigateEditor(item)" | ||
></button> | ||
</td> | ||
</tr> </ng-template | ||
></p-table> | ||
<mkj-list | ||
[datasource]="datasource" | ||
[configuration]="listConfig" | ||
[templateMap]="{ | ||
rowexpansion: null, | ||
}" | ||
(onDoubleClick)="navigateEditor($event)" | ||
> | ||
</mkj-list> | ||
|
||
<ng-template #rowexpansion let-anschrift> </ng-template> |
41 changes: 19 additions & 22 deletions
41
src/app/components/archiv/instrumente/instrumente-overview/instrumente-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 |
---|---|---|
@@ -1,48 +1,45 @@ | ||
import { Component, OnInit } from "@angular/core"; | ||
import { Component } from "@angular/core"; | ||
import { ActivatedRoute, Router } from "@angular/router"; | ||
import { Instrument } from "src/app/models/Instrument"; | ||
import { PermissionMap } from "src/app/models/User"; | ||
import { MkjToolbarService } from "src/app/utilities/mkj-toolbar/mkj-toolbar.service"; | ||
import { AppConfigService } from "src/app/services/app-config.service"; | ||
import { InstrumenteApiService } from "src/app/services/api/instrumente-api.service"; | ||
import { UserService } from "src/app/services/authentication/user.service"; | ||
import { InstrumenteListConfig } from "src/app/utilities/_list-configurations/instrumente-list-config.class"; | ||
import { InstrumenteListDatasource } from "src/app/utilities/_list-datasources/instrumente-list-datasource.class"; | ||
import { MkjToolbarService } from "src/app/utilities/mkj-toolbar/mkj-toolbar.service"; | ||
|
||
@Component({ | ||
selector: "app-instrumente-overview", | ||
templateUrl: "./instrumente-overview.component.html", | ||
styleUrls: ["./instrumente-overview.component.scss"], | ||
providers: [InstrumenteListDatasource, InstrumenteListConfig], | ||
}) | ||
export class InstrumenteOverviewComponent implements OnInit { | ||
public values: Instrument[]; | ||
public readonly PermissionMap = PermissionMap; | ||
|
||
export class InstrumenteOverviewComponent { | ||
constructor( | ||
private toolbarService: MkjToolbarService, | ||
private apiService: InstrumenteApiService, | ||
public datasource: InstrumenteListDatasource, | ||
public listConfig: InstrumenteListConfig, | ||
private router: Router, | ||
private route: ActivatedRoute, | ||
private userService: UserService, | ||
toolbarService: MkjToolbarService, | ||
configService: AppConfigService | ||
) { | ||
this.toolbarService.header = configService.appNaming.Instrumente; | ||
this.toolbarService.backButton = null; | ||
this.toolbarService.buttons = [ | ||
toolbarService.header = configService.appNaming.Instrumente; | ||
toolbarService.buttons = [ | ||
{ | ||
icon: "pi pi-plus", | ||
label: "Neu", | ||
permissions: [PermissionMap.INSTRUMENTE_SAVE], | ||
click: () => { | ||
this.router.navigate(["new"], { relativeTo: this.route }); | ||
}, | ||
click: () => this.navigateEditor(), | ||
}, | ||
]; | ||
} | ||
|
||
public ngOnInit(): void { | ||
this.apiService.getList(null).subscribe((data) => { | ||
this.values = data.values; | ||
public navigateEditor(instrument?: Instrument): void { | ||
if (!this.userService.hasPermission(PermissionMap.INSTRUMENTE_SAVE)) | ||
return; | ||
this.router.navigate([instrument?.id ?? "new"], { | ||
relativeTo: this.route, | ||
}); | ||
} | ||
|
||
public navigateEditor(instrument: Instrument): void { | ||
this.router.navigate([instrument.id], { relativeTo: this.route }); | ||
} | ||
} |
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
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
43 changes: 43 additions & 0 deletions
43
src/app/utilities/_list-configurations/anschriften-list-config.class.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,43 @@ | ||
import { Noten, NotenGattungMap } from "src/app/models/Noten"; | ||
import { | ||
ListConfiguration, | ||
MkjListColumn, | ||
MkjListGlobalFilterConfiguration, | ||
MkjListSortConfiguration, | ||
} from "./_list-configuration.class"; | ||
import { Injectable } from "@angular/core"; | ||
import { Anschrift } from "src/app/models/Anschrift"; | ||
|
||
@Injectable() | ||
export class AnschriftenListConfig implements ListConfiguration<Anschrift> { | ||
listName: string = "Anschriften"; | ||
showTotalCount = true; | ||
sort: MkjListSortConfiguration<Anschrift> = { | ||
field: "zuname", | ||
order: 1, | ||
}; | ||
globalFilter: MkjListGlobalFilterConfiguration<Anschrift> = { | ||
fields: ["vorname", "zuname", "firma"], | ||
matchMode: "contains", | ||
}; | ||
columns: MkjListColumn<Anschrift>[] = [ | ||
{ | ||
header: "Vorname", | ||
field: "vorname", | ||
type: "string", | ||
sortable: true, | ||
}, | ||
{ | ||
header: "Nachname", | ||
field: "zuname", | ||
type: "string", | ||
sortable: true, | ||
}, | ||
{ | ||
header: "Firma", | ||
field: "firma", | ||
type: "string", | ||
sortable: true, | ||
}, | ||
]; | ||
} |
48 changes: 48 additions & 0 deletions
48
src/app/utilities/_list-configurations/instrumente-list-config.class.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,48 @@ | ||
import { Noten, NotenGattungMap } from "src/app/models/Noten"; | ||
import { | ||
ListConfiguration, | ||
MkjListColumn, | ||
MkjListGlobalFilterConfiguration, | ||
MkjListSortConfiguration, | ||
} from "./_list-configuration.class"; | ||
import { Injectable } from "@angular/core"; | ||
import { Anschrift } from "src/app/models/Anschrift"; | ||
import { Instrument } from "src/app/models/Instrument"; | ||
import { AppConfigService } from "src/app/services/app-config.service"; | ||
|
||
@Injectable() | ||
export class InstrumenteListConfig implements ListConfiguration<Instrument> { | ||
constructor(private appNaming: AppConfigService) {} | ||
|
||
listName: string = "Instrumente"; | ||
showTotalCount = true; | ||
sort: MkjListSortConfiguration<Instrument> = { | ||
field: "marke", | ||
order: 1, | ||
}; | ||
globalFilter: MkjListGlobalFilterConfiguration<Instrument> = { | ||
fields: ["bezeichnung", "marke"], | ||
matchMode: "contains", | ||
}; | ||
columns: MkjListColumn<Instrument>[] = [ | ||
{ | ||
header: "Bezeichung", | ||
field: "bezeichnung", | ||
type: "string", | ||
sortable: true, | ||
}, | ||
{ | ||
header: "Marke", | ||
field: "marke", | ||
type: "string", | ||
sortable: true, | ||
}, | ||
{ | ||
header: this.appNaming.appNaming.Gruppen, | ||
field: null, | ||
templateName: "gruppen", | ||
type: "value", | ||
getValue: (item: Instrument) => item.gruppe?.name, | ||
}, | ||
]; | ||
} |
Oops, something went wrong.