talkgroup pipe share wip

This commit is contained in:
Daniel Ponte 2025-02-03 09:03:26 -05:00
parent 4d5dfb94cd
commit ccd1830da9
2 changed files with 4 additions and 3 deletions

View file

@ -5,6 +5,7 @@ import { CallRecord } from '../calls';
import { environment } from '.././../environments/environment'; import { environment } from '.././../environments/environment';
import { TalkgroupService } from '../talkgroups/talkgroups.service'; import { TalkgroupService } from '../talkgroups/talkgroups.service';
import { Talkgroup } from '../talkgroup'; import { Talkgroup } from '../talkgroup';
import { Share } from '../shares';
@Pipe({ @Pipe({
name: 'grabDate', name: 'grabDate',
@ -42,7 +43,7 @@ export class TimePipe implements PipeTransform {
export class TalkgroupPipe implements PipeTransform { export class TalkgroupPipe implements PipeTransform {
constructor(private tgService: TalkgroupService) {} constructor(private tgService: TalkgroupService) {}
transform(call: CallRecord, field: string): Observable<string> { transform(call: CallRecord, field: string, share: Share|null = null): Observable<string> {
return this.tgService.getTalkgroup(call.system_id, call.tgid).pipe( return this.tgService.getTalkgroup(call.system_id, call.tgid).pipe(
map((tg: Talkgroup) => { map((tg: Talkgroup) => {
switch (field) { switch (field) {

View file

@ -76,13 +76,13 @@
<ng-container matColumnDef="system"> <ng-container matColumnDef="system">
<th mat-header-cell *matHeaderCellDef>System</th> <th mat-header-cell *matHeaderCellDef>System</th>
<td mat-cell *matCellDef="let call"> <td mat-cell *matCellDef="let call">
{{ call | talkgroup: "system" | async }} {{ call | talkgroup: "system":incident | async }}
</td> </td>
</ng-container> </ng-container>
<ng-container matColumnDef="group"> <ng-container matColumnDef="group">
<th mat-header-cell *matHeaderCellDef>Group</th> <th mat-header-cell *matHeaderCellDef>Group</th>
<td mat-cell *matCellDef="let call"> <td mat-cell *matCellDef="let call">
{{ call | talkgroup: "group" | async }} {{ call | talkgroup: "group":incident | async }}
</td> </td>
</ng-container> </ng-container>
<ng-container matColumnDef="talkgroup"> <ng-container matColumnDef="talkgroup">