camcelcase client
This commit is contained in:
parent
d0d3f503b8
commit
e5772ae2ce
11 changed files with 47 additions and 47 deletions
|
@ -1,9 +1,9 @@
|
|||
export interface CallRecord {
|
||||
id: string;
|
||||
call_date: Date;
|
||||
callDate: Date;
|
||||
audioURL: string | null;
|
||||
duration: number;
|
||||
system_id: number;
|
||||
systemId: number;
|
||||
tgid: number;
|
||||
incidents: number; // in incident
|
||||
}
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
<div class="cardHdr">
|
||||
<h1>
|
||||
{{ call | talkgroup: "alpha" | async }} @
|
||||
{{ call.call_date | grabDate }} {{ call.call_date | time: true }}
|
||||
{{ call.callDate | grabDate }} {{ call.callDate | time: true }}
|
||||
</h1>
|
||||
</div>
|
||||
<div class="call-heading">
|
||||
|
|
|
@ -135,13 +135,13 @@
|
|||
<ng-container matColumnDef="date">
|
||||
<th mat-header-cell *matHeaderCellDef>Date</th>
|
||||
<td mat-cell *matCellDef="let call">
|
||||
{{ call.call_date | grabDate }}
|
||||
{{ call.callDate | grabDate }}
|
||||
</td>
|
||||
</ng-container>
|
||||
<ng-container matColumnDef="time">
|
||||
<th mat-header-cell *matHeaderCellDef>Time</th>
|
||||
<td [title]="call.call_date" mat-cell *matCellDef="let call">
|
||||
{{ call.call_date | time }}
|
||||
<td [title]="call.callDate" mat-cell *matCellDef="let call">
|
||||
{{ call.callDate | time }}
|
||||
</td>
|
||||
</ng-container>
|
||||
<ng-container matColumnDef="system">
|
||||
|
|
|
@ -57,19 +57,19 @@ export class TalkgroupPipe implements PipeTransform {
|
|||
field: string,
|
||||
share: Share | null = null,
|
||||
): Observable<string> {
|
||||
return this.tgService.getTalkgroup(call.system_id, call.tgid).pipe(
|
||||
return this.tgService.getTalkgroup(call.systemId, call.tgid).pipe(
|
||||
map((tg: Talkgroup) => {
|
||||
switch (field) {
|
||||
case 'alpha': {
|
||||
return tg.alpha_tag ?? call.tgid;
|
||||
return tg.alphaTag ?? call.tgid;
|
||||
break;
|
||||
}
|
||||
case 'group': {
|
||||
return tg.tg_group ?? '\u2014';
|
||||
return tg.tgGroup ?? '\u2014';
|
||||
break;
|
||||
}
|
||||
case 'system': {
|
||||
return tg.system?.name ?? tg.system_id.toString();
|
||||
return tg.system?.name ?? tg.systemId.toString();
|
||||
}
|
||||
default: {
|
||||
return tg.name ?? '\u2014';
|
||||
|
|
|
@ -75,13 +75,13 @@
|
|||
<ng-container matColumnDef="date">
|
||||
<th mat-header-cell *matHeaderCellDef>Date</th>
|
||||
<td mat-cell *matCellDef="let call">
|
||||
{{ call.call_date | grabDate }}
|
||||
{{ call.callDate | grabDate }}
|
||||
</td>
|
||||
</ng-container>
|
||||
<ng-container matColumnDef="time">
|
||||
<th mat-header-cell *matHeaderCellDef>Time</th>
|
||||
<td [title]="call.call_date" mat-cell *matCellDef="let call">
|
||||
{{ call.call_date | time }}
|
||||
<td [title]="call.callDate" mat-cell *matCellDef="let call">
|
||||
{{ call.callDate | time }}
|
||||
</td>
|
||||
</ng-container>
|
||||
<ng-container matColumnDef="system">
|
||||
|
|
|
@ -58,33 +58,33 @@ export const iconMapping: IconMap = {
|
|||
|
||||
export class Talkgroup {
|
||||
id!: number;
|
||||
system_id!: number;
|
||||
systemId!: number;
|
||||
tgid!: number;
|
||||
name!: string;
|
||||
alpha_tag!: string;
|
||||
tg_group!: string;
|
||||
alphaTag!: string;
|
||||
tgGroup!: string;
|
||||
frequency!: number;
|
||||
metadata!: Metadata | null;
|
||||
tags!: string[];
|
||||
alert!: boolean;
|
||||
system?: System;
|
||||
alert_rules!: AlertRule[];
|
||||
alertRules!: AlertRule[];
|
||||
weight!: number;
|
||||
learned?: boolean;
|
||||
icon?: string;
|
||||
iconSvg?: string;
|
||||
constructor(
|
||||
id: number,
|
||||
system_id: number,
|
||||
systemId: number,
|
||||
tgid: number,
|
||||
name: string,
|
||||
alpha_tag: string,
|
||||
tg_group: string,
|
||||
alphaTag: string,
|
||||
tgGroup: string,
|
||||
frequency: number,
|
||||
metadata: Metadata | null,
|
||||
tags: string[],
|
||||
alert: boolean,
|
||||
alert_rules: AlertRule[],
|
||||
alertRules: AlertRule[],
|
||||
weight: number,
|
||||
system?: System,
|
||||
learned?: boolean,
|
||||
|
@ -99,7 +99,7 @@ export class Talkgroup {
|
|||
|
||||
tgTuple(): TGID {
|
||||
return <TGID>{
|
||||
sys: this.system_id,
|
||||
sys: this.systemId,
|
||||
tg: this.tgid,
|
||||
};
|
||||
}
|
||||
|
@ -111,15 +111,15 @@ export interface TalkgroupUI extends Talkgroup {
|
|||
|
||||
export interface TalkgroupUpdate {
|
||||
id: number;
|
||||
system_id: number;
|
||||
systemId: number;
|
||||
tgid: number;
|
||||
name: string | null;
|
||||
alpha_tag: string | null;
|
||||
tg_group: string | null;
|
||||
alphaTag: string | null;
|
||||
tgGroup: string | null;
|
||||
frequency: number | null;
|
||||
metadata: Object | null;
|
||||
tags: string[] | null;
|
||||
alert: boolean | null;
|
||||
alert_rules: AlertRule[] | null;
|
||||
alertRules: AlertRule[] | null;
|
||||
weight: number | null;
|
||||
}
|
||||
|
|
|
@ -55,8 +55,8 @@
|
|||
</td>
|
||||
<td>{{ tg.system?.name }}</td>
|
||||
<td>{{ tg.system?.id }}</td>
|
||||
<td>{{ tg.tg_group }}</td>
|
||||
<td>{{ tg.alpha_tag }}</td>
|
||||
<td>{{ tg.tgGroup }}</td>
|
||||
<td>{{ tg.alphaTag }}</td>
|
||||
<td>{{ tg.name }}</td>
|
||||
<td>{{ tg.tgid }}</td>
|
||||
<td>{{ tg?.metadata?.encrypted ? "E" : "" }}</td>
|
||||
|
|
|
@ -15,9 +15,9 @@
|
|||
<mat-label>Alpha Tag</mat-label
|
||||
><input
|
||||
matInput
|
||||
name="alpha_tag"
|
||||
name="alphaTag"
|
||||
type="text"
|
||||
formControlName="alpha_tag"
|
||||
formControlName="alphaTag"
|
||||
/>
|
||||
</mat-form-field>
|
||||
</div>
|
||||
|
@ -26,9 +26,9 @@
|
|||
<mat-label>Group</mat-label
|
||||
><input
|
||||
matInput
|
||||
name="tg_group"
|
||||
name="tgTroup"
|
||||
type="text"
|
||||
formControlName="tg_group"
|
||||
formControlName="tgGroup"
|
||||
/>
|
||||
</mat-form-field>
|
||||
</div>
|
||||
|
@ -108,7 +108,7 @@
|
|||
>
|
||||
</div>
|
||||
<div class="alert">
|
||||
<alert-rule-builder [rules]="tg.alert_rules" />
|
||||
<alert-rule-builder [rules]="tg.alertRules" />
|
||||
</div>
|
||||
</form>
|
||||
} @else {
|
||||
|
|
|
@ -84,8 +84,8 @@ export class TalkgroupRecordComponent {
|
|||
readonly _allTags: Observable<string[]>;
|
||||
form = new FormGroup({
|
||||
name: new FormControl(''),
|
||||
alpha_tag: new FormControl(''),
|
||||
tg_group: new FormControl(''),
|
||||
alphaTag: new FormControl(''),
|
||||
tgGroup: new FormControl(''),
|
||||
frequency: new FormControl(0),
|
||||
alert: new FormControl(false),
|
||||
weight: new FormControl(0.0),
|
||||
|
@ -158,8 +158,8 @@ export class TalkgroupRecordComponent {
|
|||
.getTalkgroup(Number(this.tgid.sys), Number(this.tgid.tg))
|
||||
.pipe(
|
||||
tap((tg) => {
|
||||
tg.alert_rules = tg.alert_rules
|
||||
? tg.alert_rules.map((x) => Object.assign(new AlertRule(), x))
|
||||
tg.alertRules = tg.alertRules
|
||||
? tg.alertRules.map((x) => Object.assign(new AlertRule(), x))
|
||||
: [];
|
||||
this.form.patchValue(tg);
|
||||
this.form.controls['tagInput'].setValue('');
|
||||
|
@ -180,17 +180,17 @@ export class TalkgroupRecordComponent {
|
|||
|
||||
save() {
|
||||
let tgu: TalkgroupUpdate = <TalkgroupUpdate>{
|
||||
system_id: this.tgid.sys,
|
||||
systemId: this.tgid.sys,
|
||||
tgid: this.tgid.tg,
|
||||
};
|
||||
if (this.form.controls['name'].dirty) {
|
||||
tgu.name = this.form.controls['name'].value;
|
||||
}
|
||||
if (this.form.controls['alpha_tag'].dirty) {
|
||||
tgu.alpha_tag = this.form.controls['alpha_tag'].value;
|
||||
if (this.form.controls['alphaTag'].dirty) {
|
||||
tgu.alphaTag = this.form.controls['alphaTag'].value;
|
||||
}
|
||||
if (this.form.controls['tg_group'].dirty) {
|
||||
tgu.tg_group = this.form.controls['tg_group'].value;
|
||||
if (this.form.controls['tgGroup'].dirty) {
|
||||
tgu.tgGroup = this.form.controls['tgGroup'].value;
|
||||
}
|
||||
if (this.form.controls['frequency'].dirty) {
|
||||
tgu.frequency = this.form.controls['frequency'].value;
|
||||
|
|
|
@ -34,7 +34,7 @@
|
|||
</ng-container>
|
||||
<ng-container matColumnDef="group">
|
||||
<th mat-header-cell *matHeaderCellDef>Group</th>
|
||||
<td mat-cell *matCellDef="let tg">{{ tg.tg_group }}</td>
|
||||
<td mat-cell *matCellDef="let tg">{{ tg.tgGroup }}</td>
|
||||
</ng-container>
|
||||
<ng-container matColumnDef="name">
|
||||
<th mat-header-cell *matHeaderCellDef>Name</th>
|
||||
|
@ -42,7 +42,7 @@
|
|||
</ng-container>
|
||||
<ng-container matColumnDef="alphaTag">
|
||||
<th mat-header-cell *matHeaderCellDef>Alpha Tag</th>
|
||||
<td mat-cell *matCellDef="let tg">{{ tg.alpha_tag }}</td>
|
||||
<td mat-cell *matCellDef="let tg">{{ tg.alphaTag }}</td>
|
||||
</ng-container>
|
||||
<ng-container matColumnDef="tgid">
|
||||
<th mat-header-cell *matHeaderCellDef>TG ID</th>
|
||||
|
|
|
@ -90,10 +90,10 @@ export class TalkgroupService {
|
|||
}
|
||||
|
||||
putTalkgroup(tu: TalkgroupUpdate): Observable<Talkgroup> {
|
||||
let tgid = this.tgKey(tu.system_id, tu.tgid);
|
||||
let tgid = this.tgKey(tu.systemId, tu.tgid);
|
||||
|
||||
return this.http
|
||||
.put<Talkgroup>(`/api/talkgroup/${tu.system_id}/${tu.tgid}`, tu)
|
||||
.put<Talkgroup>(`/api/talkgroup/${tu.systemId}/${tu.tgid}`, tu)
|
||||
.pipe(
|
||||
switchMap((tg) => {
|
||||
let tObs = this._getTalkgroup.get(tgid);
|
||||
|
@ -128,7 +128,7 @@ export class TalkgroupService {
|
|||
this.subscriptions.add(
|
||||
this.tgs$.subscribe((tgs) => {
|
||||
tgs.forEach((tg) => {
|
||||
let tgid = this.tgKey(tg.system_id, tg.tgid);
|
||||
let tgid = this.tgKey(tg.systemId, tg.tgid);
|
||||
const rs = this._getTalkgroup.get(tgid);
|
||||
if (rs) {
|
||||
(rs as ReplaySubject<Talkgroup>).next(tg);
|
||||
|
|
Loading…
Add table
Reference in a new issue