fix spinner on TGs with no rules
This commit is contained in:
parent
185237cd01
commit
5c07b8c15a
3 changed files with 14 additions and 5 deletions
|
@ -1,7 +1,12 @@
|
||||||
@let inc = inc$ | async;
|
@let inc = inc$ | async;
|
||||||
<mat-card class="incident" appearance="outlined">
|
<mat-card class="incident" appearance="outlined">
|
||||||
<div class="cardHdr">
|
<div class="cardHdr">
|
||||||
<h1>{{ inc?.name }} <a [href]="'/api/incident/'+incID+'.m3u'"><mat-icon>playlist_play</mat-icon></a></h1>
|
<h1>
|
||||||
|
{{ inc?.name }}
|
||||||
|
<a [href]="'/api/incident/' + incID + '.m3u'"
|
||||||
|
><mat-icon>playlist_play</mat-icon></a
|
||||||
|
>
|
||||||
|
</h1>
|
||||||
<button mat-icon-button (click)="editIncident(incID)">
|
<button mat-icon-button (click)="editIncident(incID)">
|
||||||
<mat-icon>edit</mat-icon>
|
<mat-icon>edit</mat-icon>
|
||||||
</button>
|
</button>
|
||||||
|
|
|
@ -158,9 +158,10 @@ export class TalkgroupRecordComponent {
|
||||||
.getTalkgroup(Number(this.tgid.sys), Number(this.tgid.tg))
|
.getTalkgroup(Number(this.tgid.sys), Number(this.tgid.tg))
|
||||||
.pipe(
|
.pipe(
|
||||||
tap((tg) => {
|
tap((tg) => {
|
||||||
tg.alert_rules = tg.alert_rules.map((x) =>
|
console.log('tap run');
|
||||||
Object.assign(new AlertRule(), x),
|
tg.alert_rules = tg.alert_rules
|
||||||
);
|
? tg.alert_rules.map((x) => Object.assign(new AlertRule(), x))
|
||||||
|
: [];
|
||||||
this.form.patchValue(tg);
|
this.form.patchValue(tg);
|
||||||
this.form.controls['tagInput'].setValue('');
|
this.form.controls['tagInput'].setValue('');
|
||||||
this.form.controls['tagsControl'].setValue(this.tg?.tags ?? []);
|
this.form.controls['tagsControl'].setValue(this.tg?.tags ?? []);
|
||||||
|
|
|
@ -33,7 +33,10 @@ export class TalkgroupService {
|
||||||
private subscriptions = new Subscription();
|
private subscriptions = new Subscription();
|
||||||
constructor(private http: HttpClient) {
|
constructor(private http: HttpClient) {
|
||||||
this.tgs$ = this.fetchAll.pipe(switchMap(() => this.getTalkgroups()));
|
this.tgs$ = this.fetchAll.pipe(switchMap(() => this.getTalkgroups()));
|
||||||
this.tags$ = this.fetchAll.pipe(switchMap(() => this.getAllTags()), shareReplay());
|
this.tags$ = this.fetchAll.pipe(
|
||||||
|
switchMap(() => this.getAllTags()),
|
||||||
|
shareReplay(),
|
||||||
|
);
|
||||||
this.fillTgMap();
|
this.fillTgMap();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue