Skip to content

Commit

Permalink
refactor display-model
Browse files Browse the repository at this point in the history
  • Loading branch information
Roland Sams committed Jan 24, 2024
1 parent f5a38ba commit 4c81823
Show file tree
Hide file tree
Showing 23 changed files with 325 additions and 175 deletions.
2 changes: 0 additions & 2 deletions src/app/app.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,6 @@ import { TerminDetailsComponent } from "./components/termine/termin-details/term
import { TeilnahmenOverviewComponent } from "./components/termine/teilnahmen-overview/teilnahmen-overview.component";
import { TermineOverviewComponent } from "./components/termine/termine-overview/termine-overview.component";
import { KalenderaboComponent } from "./components/termine/kalenderabo/kalenderabo.component";
import { TerminCardComponent } from "./components/termine/termin-card/termin-card.component";
import { LokaleEinstellungenComponent } from "./components/einstellungen/lokale-einstellungen/lokale-einstellungen.component";
import { MitgliedPersonalEditComponent } from "./components/einstellungen/mitglied-personal-edit/mitglied-personal-edit.component";
import { RollenEditComponent } from "./components/einstellungen/rollen-edit/rollen-edit.component";
Expand Down Expand Up @@ -348,7 +347,6 @@ registerLocaleData(localeDe);
MkjColorPickerComponent,
NotenmappeEditComponent,
NextTerminComponent,
TerminCardComponent,
StatistikTermineComponent,
StatistikNotenComponent,
StatistikOverviewComponent,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,25 @@
[datasource]="datasource"
[configuration]="listConfig"
[templateMap]="{
rowexpansion: null,
rowexpansion: rowexpansion,
}"
(onDoubleClick)="navigateToEdit($event)"
>
</mkj-list>

<ng-template #rowexpansion let-anschrift> </ng-template>
<ng-template #rowexpansion let-anschrift>
<mkj-display-model [model]="anschrift"></mkj-display-model>
<div
*visibleFor="[PermissionMap.ANSCHRIFTEN_SAVE]"
class="col-12 flex justify-content-center"
>
<button
pButton
pRipple
label="Bearbeiten"
icon="pi pi-pencil"
class="p-button-secondary p-button-rounded p-button-raised"
(click)="navigateEditor(anschrift)"
></button>
</div>
</ng-template>
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@ import { Component } from "@angular/core";
import { ActivatedRoute, Router } from "@angular/router";
import { Anschrift } from "src/app/models/Anschrift";
import { PermissionKey } from "src/app/models/User";
import { displayModel } from "src/app/providers/display-model";
import { UserService } from "src/app/services/authentication/user.service";
import { AnschriftDisplayModel } from "src/app/utilities/_display-model-configurations/anschrift-display-model.class";
import { AnschriftenListConfig } from "src/app/utilities/_list-configurations/anschriften-list-config.class";
import { AnschriftenListDatasource } from "src/app/utilities/_list-datasources/anschriften-list-datasource.class";
import { MkjToolbarService } from "src/app/utilities/mkj-toolbar/mkj-toolbar.service";
Expand All @@ -11,9 +13,15 @@ import { MkjToolbarService } from "src/app/utilities/mkj-toolbar/mkj-toolbar.ser
selector: "app-anschriften-overview",
templateUrl: "./anschriften-overview.component.html",
styleUrl: "./anschriften-overview.component.scss",
providers: [AnschriftenListConfig, AnschriftenListDatasource],
providers: [
AnschriftenListConfig,
AnschriftenListDatasource,
displayModel(AnschriftDisplayModel),
],
})
export class AnschriftenOverviewComponent {
public readonly PermissionMap = PermissionKey;

constructor(
public datasource: AnschriftenListDatasource,
public listConfig: AnschriftenListConfig,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,25 @@
[datasource]="datasource"
[configuration]="listConfig"
[templateMap]="{
rowexpansion: null,
rowexpansion: rowexpansion,
}"
(onDoubleClick)="navigateEditor($event)"
>
</mkj-list>

<ng-template #rowexpansion let-anschrift> </ng-template>
<ng-template #rowexpansion let-instrument>
<mkj-display-model [model]="instrument"></mkj-display-model>
<div
*visibleFor="[PermissionMap.INSTRUMENTE_SAVE]"
class="col-12 flex justify-content-center"
>
<button
pButton
pRipple
label="Bearbeiten"
icon="pi pi-pencil"
class="p-button-secondary p-button-rounded p-button-raised"
(click)="navigateEditor(instrument)"
></button>
</div>
</ng-template>
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,22 @@ 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";
import { displayModel } from "src/app/providers/display-model";
import { InstrumentDisplayModel } from "src/app/utilities/_display-model-configurations/instrument-display-model.class";

@Component({
selector: "app-instrumente-overview",
templateUrl: "./instrumente-overview.component.html",
styleUrls: ["./instrumente-overview.component.scss"],
providers: [InstrumenteListDatasource, InstrumenteListConfig],
providers: [
InstrumenteListDatasource,
InstrumenteListConfig,
displayModel(InstrumentDisplayModel),
],
})
export class InstrumenteOverviewComponent {
public readonly PermissionMap = PermissionKey;

constructor(
public datasource: InstrumenteListDatasource,
public listConfig: InstrumenteListConfig,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
pRipple
label="Bearbeiten"
icon="pi pi-pencil"
class="p-button-outlined p-button-sm p-button-info mr-1"
class="p-button-secondary p-button-rounded p-button-raised"
(click)="navigateToEditView(noten)"
></button>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,19 @@
</ng-template>

<ng-template #rowexpansion let-mitglied>
<div class="col-12 flex justify-content-center">
@if(mitglied){
<mkj-display-model [model]="mitglied"></mkj-display-model>
}
<div
*visibleFor="[PermissionMap.MITGLIEDER_SAVE]"
class="col-12 flex justify-content-center"
>
<button
*visibleFor="[PermissionMap.MITGLIEDER_SAVE]"
pButton
pRipple
label="Bearbeiten"
icon="pi pi-pencil"
class="p-button-outlined p-button-sm p-button-info mr-1"
class="p-button-secondary p-button-rounded p-button-raised"
(click)="navigateSingleMitglied(mitglied)"
></button>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,18 @@ import { UserService } from "src/app/services/authentication/user.service";
import { MitgliederListConfig } from "src/app/utilities/_list-configurations/mitglieder-list-config.class";
import { MitgliederListDatasource } from "src/app/utilities/_list-datasources/mitglieder-list-datasource.class";
import { MkjToolbarService } from "src/app/utilities/mkj-toolbar/mkj-toolbar.service";
import { displayModel } from "src/app/providers/display-model";
import { MitgliedDisplayModel } from "src/app/utilities/_display-model-configurations/mitglied-display-model.class";

@Component({
selector: "app-mitglieder-overview",
templateUrl: "./mitglieder-overview.component.html",
styleUrls: ["./mitglieder-overview.component.scss"],
providers: [MitgliederListDatasource, MitgliederListConfig],
providers: [
MitgliederListDatasource,
MitgliederListConfig,
displayModel(MitgliedDisplayModel),
],
})
export class MitgliederOverviewComponent {
public readonly PermissionMap = PermissionKey;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ <h4 pRipple>
<div class="col-12">
<button
pButton
pRipple
label="Alle Termine"
icon="pi pi-calendar"
routerLink="../termine"
Expand Down
69 changes: 0 additions & 69 deletions src/app/components/termine/termin-card/termin-card.component.html

This file was deleted.

This file was deleted.

12 changes: 0 additions & 12 deletions src/app/components/termine/termin-card/termin-card.component.ts

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<p-tabView [(activeIndex)]="activeTabIndex">
<p-tabPanel [selected]="true" header="Infos">
<div *ngIf="termin">
<termin-card [termin]="termin"></termin-card>
<mkj-display-model [model]="termin"></mkj-display-model>

<div class="col-12 flex justify-content-center mb-5">
<mkj-termin-teilnahme-selector
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,13 @@ import { NotenListDatasource } from "src/app/utilities/_list-datasources/noten-l
import { NotenAutoCompleteConfigiguration } from "src/app/utilities/_autocomplete-configurations/noten-autocomplete-config.class";
import { ConfigurationService } from "src/app/services/configuration.service";
import { PermissionKey } from "src/app/models/User";
import { displayModel } from "src/app/providers/display-model";
import { TerminDisplayModel } from "src/app/utilities/_display-model-configurations/termin-display-model.class";

@Component({
selector: "app-termin-details",
templateUrl: "./termin-details.component.html",
providers: [NotenListDatasource],
providers: [NotenListDatasource, displayModel(TerminDisplayModel)],
})
export class TerminDetailsComponent implements OnInit {
termin: Termin;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,28 +49,40 @@
[termin]="termin"
></mkj-termin-teilnahme-selector>
</div>
<termin-card [termin]="termin"></termin-card>
<div class="flex justify-content-around">
<button
pButton
pRipple
icon="pi pi-list"
label="Details"
class="p-button-raised p-button-rounded p-button-secondary"
(click)="navigateSingleAusrueckung(termin)"
></button>

<button
*ngIf="hasAktionenPermissions"
pButton
pRipple
icon="pi pi-pencil"
label="Aktionen"
class="p-button-outlined p-button-rounded p-button-info"
(click)="rowMenu.toggle($event)"
></button>
<mkj-display-model [model]="termin"></mkj-display-model>
<div class="flex justify-content-center">
<div class="p-buttonset">
<button
pButton
pRipple
label="Details"
icon="pi pi-list"
class="p-button-secondary p-button-rounded p-button-raised"
(click)="navigateSingleAusrueckung(termin)"
></button>
<button
*visibleFor="[Permissions.TERMIN_SAVE]"
pButton
pRipple
icon="pi pi-copy"
label="Duplizieren"
class="p-button-secondary p-button-rounded p-button-raised"
(click)="this.duplicateAusrueckung(termin)"
></button>
<button
*visibleFor="[
Permissions.TERMIN_SAVE,
Permissions.TERMIN_GRUPPENLEITER_SAVE
]"
pButton
pRipple
icon="pi pi-pencil"
label="Bearbeiten"
class="p-button-secondary p-button-rounded p-button-raised"
(click)="this.navigateEditor(termin)"
></button>
</div>
</div>
</ng-template>

<p-menu #rowMenu [popup]="true" [model]="rowMenuItems"></p-menu>
<p-menu #exportMenu [popup]="true" [model]="exportMenuItems"></p-menu>
Loading

0 comments on commit 4c81823

Please sign in to comment.