Skip to content

Commit

Permalink
mkj-list wip
Browse files Browse the repository at this point in the history
  • Loading branch information
dysTOS committed Dec 17, 2023
1 parent 5ddc863 commit 93f2aa6
Show file tree
Hide file tree
Showing 27 changed files with 384 additions and 274 deletions.
4 changes: 2 additions & 2 deletions src/app/app-routing.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import { AppHelpComponent } from "./pages/app.help.component";
import { AusrueckungSingleComponent } from "./components/ausrueckungen/ausrueckung-single/ausrueckung-single.component";
import { RouteGuard } from "./guards/route.guard";
import { MitgliederDetailsComponent } from "./components/mitglieder/mitglieder-single/mitglieder-details.component";
import { NotenarchivComponent } from "./components/archiv/noten/notenarchiv/notenarchiv.component";
import { NotenOverviewComponent } from "./components/archiv/noten/noten-overview/noten-overview.component";
import { NotenmappenComponent } from "./components/archiv/noten/notenmappen/notenmappen.component";
import { NotenmappeDetailsComponent } from "./components/archiv/noten/notenmappen/notenmappe-details/notenmappe-details.component";
import { KassabuecherComponent } from "./components/finanzen/kassabuecher-overview/kassabuecher-overview.component";
Expand Down Expand Up @@ -155,7 +155,7 @@ import { AnschriftEditComponent as AnschriftEditComponent } from "./components/a
children: [
{
path: "noten",
component: NotenarchivComponent,
component: NotenOverviewComponent,
canActivate: [RouteGuard],
},
{
Expand Down
6 changes: 4 additions & 2 deletions src/app/app.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ import { InstrumenteEditorComponent } from "./components/archiv/instrumente/inst
import { InstrumenteOverviewComponent } from "./components/archiv/instrumente/instrumente-overview/instrumente-overview.component";
import { NotenCardComponent } from "./components/archiv/noten/noten-card/noten-card.component";
import { NotenEditorComponent } from "./components/archiv/noten/noten-editor/noten-editor.component";
import { NotenarchivComponent } from "./components/archiv/noten/notenarchiv/notenarchiv.component";
import { NotenOverviewComponent } from "./components/archiv/noten/noten-overview/noten-overview.component";
import { NotenmappeDetailsComponent } from "./components/archiv/noten/notenmappen/notenmappe-details/notenmappe-details.component";
import { NotenmappenComponent } from "./components/archiv/noten/notenmappen/notenmappen.component";
import { AusrueckungEditorComponent } from "./components/ausrueckungen/ausrueckung-editor/ausrueckung-editor.component";
Expand Down Expand Up @@ -193,6 +193,7 @@ import { MkjTagComponent } from "./utilities/mkj-tag/mkj-tag.component";
import { PermissionSelectedPipe } from "./components/einstellungen/rollen-edit/permission-included.pipe";
import { AnschriftenOverviewComponent as AnschriftOverviewComponent } from "./components/anschriften/anschriften-overview/anschriften-overview.component";
import { AnschriftEditComponent } from "./components/anschriften/anschriften-edit/anschriften-edit.component";
import { MkjListCellComponent } from "./utilities/mkj-list/mkj-list-cell/mkj-list-cell.component";

// FullCalendarModule.registerPlugins([
// dayGridPlugin,
Expand Down Expand Up @@ -315,6 +316,7 @@ registerLocaleData(localeDe);
AppNotfoundComponent,
AppErrorComponent,
AppAccessdeniedComponent,
MkjListCellComponent,
AusrueckungSingleComponent,
EinstellungenWrapperComponent,
MkjDatePipe,
Expand All @@ -323,7 +325,7 @@ registerLocaleData(localeDe);
LoginComponent,
MitgliederListComponent,
MitgliederDetailsComponent,
NotenarchivComponent,
NotenOverviewComponent,
VisibleForPermissionDirective,
NotenEditorComponent,
MkjToolbarComponent,
Expand Down
2 changes: 0 additions & 2 deletions src/app/components/archiv/archiv-wrapper.component.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
import { Component } from "@angular/core";
import { InstrumenteUiService } from "./instrumente/instrumente-ui.service";

@Component({
template: `<router-outlet></router-outlet>`,
providers: [InstrumenteUiService],
})
export class ArchivWrapperComponent {}
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
<p-table
[value]="values"
[loading]="uiService.loading | async"
responsiveLayout="scroll"
>
<p-table [value]="values" [loading]="!values" responsiveLayout="scroll">
<ng-template pTemplate="header">
<tr>
<th>Bezeichnung</th>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ 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 { InstrumenteUiService } from "../instrumente-ui.service";
import { AppConfigService } from "src/app/services/app-config.service";
import { InstrumenteApiService } from "src/app/services/api/instrumente-api.service";

@Component({
selector: "app-instrumente-overview",
Expand All @@ -16,8 +16,8 @@ export class InstrumenteOverviewComponent implements OnInit {
public readonly PermissionMap = PermissionMap;

constructor(
public uiService: InstrumenteUiService,
private toolbarService: MkjToolbarService,
private apiService: InstrumenteApiService,
private router: Router,
private route: ActivatedRoute,
configService: AppConfigService
Expand All @@ -37,8 +37,8 @@ export class InstrumenteOverviewComponent implements OnInit {
}

public ngOnInit(): void {
this.uiService.getAllInstrumente().subscribe((data) => {
this.values = data;
this.apiService.getList(null).subscribe((data) => {
this.values = data.values;
});
}

Expand Down
32 changes: 0 additions & 32 deletions src/app/components/archiv/instrumente/instrumente-ui.service.ts

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,4 @@ import { Noten } from "src/app/models/Noten";
export class NotenCardComponent {
@Input()
public noten: Noten;

constructor() {}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<mkj-list
[datasource]="datasource"
[configuration]="listConfig"
[templateMap]="{
rowexpansion: rowexpansion,
}"
>
</mkj-list>

<ng-template #rowexpansion let-noten>
<noten-card [noten]="noten"></noten-card>
<div class="col-12 flex justify-content-center">
<button
*visibleFor="[PermissionMap.NOTEN_SAVE]"
pButton
pRipple
label="Bearbeiten"
icon="pi pi-pencil"
class="p-button-outlined p-button-sm p-button-info mr-1"
(click)="navigateToEditView(noten)"
></button>
</div>
</ng-template>
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
import { Component } from "@angular/core";
import { ActivatedRoute, Router } from "@angular/router";
import { Noten } from "src/app/models/Noten";
import { PermissionMap } from "src/app/models/User";
import { AppConfigService } from "src/app/services/app-config.service";
import { NotenListConfig } from "src/app/utilities/_list-configurations/noten-list-config.class";
import { NotenListDatasource } from "src/app/utilities/_list-datasources/noten-list-datasource.class";
import { MkjToolbarService } from "src/app/utilities/mkj-toolbar/mkj-toolbar.service";

@Component({
selector: "app-noten-overview",
templateUrl: "./noten-overview.component.html",
styleUrls: ["./noten-overview.component.scss"],
providers: [NotenListDatasource, NotenListConfig],
})
export class NotenOverviewComponent {
public readonly PermissionMap = PermissionMap;

constructor(
public datasource: NotenListDatasource,
public listConfig: NotenListConfig,
private toolbarService: MkjToolbarService,
private router: Router,
private route: ActivatedRoute,
private namingService: AppConfigService
) {
this.toolbarService.header = this.namingService.appNaming.Noten;
this.toolbarService.buttons = [
{
icon: "pi pi-plus",
label: "Neu",
permissions: [PermissionMap.NOTEN_SAVE],
click: () => this.navigateToEditView(),
},
];
}

public navigateToEditView(noten?: Noten) {
this.router.navigate([noten?.id ?? "new"], { relativeTo: this.route });
}
}
129 changes: 0 additions & 129 deletions src/app/components/archiv/noten/notenarchiv/notenarchiv.component.html

This file was deleted.

Loading

0 comments on commit 93f2aa6

Please sign in to comment.