Skip to content

Commit

Permalink
add dauer to notenmappe
Browse files Browse the repository at this point in the history
  • Loading branch information
Sams, Roland authored and Sams, Roland committed Mar 26, 2024
1 parent 968c2d6 commit 35862e0
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 31 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ export class NotenmappeEditComponent extends AbstractFormComponent<Notenmappe> {

protected initToolbar(): void {
this.toolbarService.backButton = true;
this.toolbarService.header = 'Bearbeiten';
this.toolbarService.header = 'Mappe';
this.toolbarService.buttons = [
{
label: 'PDF Export',
Expand All @@ -54,12 +54,12 @@ export class NotenmappeEditComponent extends AbstractFormComponent<Notenmappe> {
click: () => this.exportPdf(),
},
{
label: 'Mappe bearbeiten',
label: 'Bearbeiten',
icon: 'pi pi-pencil',
hidden: this.getId() === 'new',
click: () => {
this.editMode = !this.editMode;
this.toolbarService.buttons[0].highlighted = this.editMode;
this.toolbarService.buttons.find((b) => b.label === 'Bearbeiten').highlighted = this.editMode;
},
permissions: [PermissionKey.NOTENMAPPE_SAVE, PermissionKey.NOTENMAPPE_ASSIGN],
},
Expand Down
3 changes: 2 additions & 1 deletion src/app/models/Noten.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ export interface Noten {
arrangeur?: string;
verlag?: string;
gattung?: string;
dauer?: any;
dauer?: string;
schwierigkeit?: number;
bewertung?: number;
ausgeliehenAb?: string;
Expand All @@ -25,6 +25,7 @@ export interface Noten {
export interface Notenmappe {
id?: string;
name?: string;
dauer?: string;
hatVerzeichnis?: boolean;
noten?: Noten[];
color?: string;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,34 +1,32 @@
import { Notenmappe } from "src/app/models/Noten";
import { AbstractListDatasource } from "./_abstract-list-datasource.class";
import { Injectable } from "@angular/core";
import { GetListInput, GetListOutput } from "src/app/interfaces/api-middleware";
import { Observable } from "rxjs";
import { NotenmappenApiService } from "src/app/services/api/notenmappen-api.service";
import { TileValue } from "../mkj-tile-view/mkj-tile-view.component";
import { Notenmappe } from 'src/app/models/Noten';
import { AbstractListDatasource } from './_abstract-list-datasource.class';
import { Injectable } from '@angular/core';
import { GetListInput, GetListOutput } from 'src/app/interfaces/api-middleware';
import { Observable } from 'rxjs';
import { NotenmappenApiService } from 'src/app/services/api/notenmappen-api.service';
import { TileValue } from '../mkj-tile-view/mkj-tile-view.component';

@Injectable()
export class NotenmappeListDatasource extends AbstractListDatasource<Notenmappe> {
constructor(private apiService: NotenmappenApiService) {
super();
}
constructor(private apiService: NotenmappenApiService) {
super();
}

public getList(
input?: GetListInput<Notenmappe>
): Observable<GetListOutput<Notenmappe>> {
return this.apiService.getList(input);
}
public getList(input?: GetListInput<Notenmappe>): Observable<GetListOutput<Notenmappe>> {
return this.apiService.getList(input);
}

public getById(id: string): Observable<Notenmappe> {
return this.apiService.getById(id);
}
public getById(id: string): Observable<Notenmappe> {
return this.apiService.getById(id);
}

public mapToTileValue(item: Notenmappe): TileValue<Notenmappe> {
return {
label: item.name,
value: item,
color: item.color,
labelBottomLeft: item.noten?.length.toString() ?? "0",
labelBottomRight: item.hatVerzeichnis ? "Verzeichnis" : "",
};
}
public mapToTileValue(item: Notenmappe): TileValue<Notenmappe> {
return {
label: item.name,
value: item,
color: item.color,
labelBottomLeft: item.noten?.length.toString() ?? '0',
labelBottomRight: item.dauer ?? '',
};
}
}

0 comments on commit 35862e0

Please sign in to comment.