-
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
Sams, Roland
authored and
Sams, Roland
committed
Mar 26, 2024
1 parent
968c2d6
commit 35862e0
Showing
3 changed files
with
30 additions
and
31 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
52 changes: 25 additions & 27 deletions
52
src/app/utilities/_list-datasources/notenmappe-list-datasource.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 |
---|---|---|
@@ -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 ?? '', | ||
}; | ||
} | ||
} |