From e5772ae2cee75a281577977d7b8dbcf38133a472 Mon Sep 17 00:00:00 2001 From: Daniel Ponte Date: Fri, 7 Feb 2025 09:45:03 -0500 Subject: [PATCH] camcelcase client --- client/stillbox/src/app/calls.ts | 4 +-- .../calls/call-info/call-info.component.html | 2 +- .../src/app/calls/calls.component.html | 6 ++--- .../stillbox/src/app/calls/calls.service.ts | 8 +++--- .../incident/incident.component.html | 6 ++--- client/stillbox/src/app/talkgroup.ts | 26 +++++++++---------- .../talkgroups/import/import.component.html | 4 +-- .../talkgroup-record.component.html | 10 +++---- .../talkgroup-record.component.ts | 18 ++++++------- .../talkgroup-table.component.html | 4 +-- .../src/app/talkgroups/talkgroups.service.ts | 6 ++--- 11 files changed, 47 insertions(+), 47 deletions(-) diff --git a/client/stillbox/src/app/calls.ts b/client/stillbox/src/app/calls.ts index dddf93f..ed581f5 100644 --- a/client/stillbox/src/app/calls.ts +++ b/client/stillbox/src/app/calls.ts @@ -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 } diff --git a/client/stillbox/src/app/calls/call-info/call-info.component.html b/client/stillbox/src/app/calls/call-info/call-info.component.html index f15bf1a..aa51826 100644 --- a/client/stillbox/src/app/calls/call-info/call-info.component.html +++ b/client/stillbox/src/app/calls/call-info/call-info.component.html @@ -2,7 +2,7 @@

{{ call | talkgroup: "alpha" | async }} @ - {{ call.call_date | grabDate }} {{ call.call_date | time: true }} + {{ call.callDate | grabDate }} {{ call.callDate | time: true }}

diff --git a/client/stillbox/src/app/calls/calls.component.html b/client/stillbox/src/app/calls/calls.component.html index 7c2891d..3a3972f 100644 --- a/client/stillbox/src/app/calls/calls.component.html +++ b/client/stillbox/src/app/calls/calls.component.html @@ -135,13 +135,13 @@ Date - {{ call.call_date | grabDate }} + {{ call.callDate | grabDate }} Time - - {{ call.call_date | time }} + + {{ call.callDate | time }} diff --git a/client/stillbox/src/app/calls/calls.service.ts b/client/stillbox/src/app/calls/calls.service.ts index 1b433e8..31816ff 100644 --- a/client/stillbox/src/app/calls/calls.service.ts +++ b/client/stillbox/src/app/calls/calls.service.ts @@ -57,19 +57,19 @@ export class TalkgroupPipe implements PipeTransform { field: string, share: Share | null = null, ): Observable { - 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'; diff --git a/client/stillbox/src/app/incidents/incident/incident.component.html b/client/stillbox/src/app/incidents/incident/incident.component.html index 8a8b159..3e18495 100644 --- a/client/stillbox/src/app/incidents/incident/incident.component.html +++ b/client/stillbox/src/app/incidents/incident/incident.component.html @@ -75,13 +75,13 @@ Date - {{ call.call_date | grabDate }} + {{ call.callDate | grabDate }} Time - - {{ call.call_date | time }} + + {{ call.callDate | time }} diff --git a/client/stillbox/src/app/talkgroup.ts b/client/stillbox/src/app/talkgroup.ts index 02ba326..d1e6a79 100644 --- a/client/stillbox/src/app/talkgroup.ts +++ b/client/stillbox/src/app/talkgroup.ts @@ -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 { - 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; } diff --git a/client/stillbox/src/app/talkgroups/import/import.component.html b/client/stillbox/src/app/talkgroups/import/import.component.html index bc3c8d1..4aec0f5 100644 --- a/client/stillbox/src/app/talkgroups/import/import.component.html +++ b/client/stillbox/src/app/talkgroups/import/import.component.html @@ -55,8 +55,8 @@ {{ tg.system?.name }} {{ tg.system?.id }} - {{ tg.tg_group }} - {{ tg.alpha_tag }} + {{ tg.tgGroup }} + {{ tg.alphaTag }} {{ tg.name }} {{ tg.tgid }} {{ tg?.metadata?.encrypted ? "E" : "" }} diff --git a/client/stillbox/src/app/talkgroups/talkgroup-record/talkgroup-record.component.html b/client/stillbox/src/app/talkgroups/talkgroup-record/talkgroup-record.component.html index 9e8a867..25ead7a 100644 --- a/client/stillbox/src/app/talkgroups/talkgroup-record/talkgroup-record.component.html +++ b/client/stillbox/src/app/talkgroups/talkgroup-record/talkgroup-record.component.html @@ -15,9 +15,9 @@ Alpha Tag
@@ -26,9 +26,9 @@ Group @@ -108,7 +108,7 @@ >
- +
} @else { diff --git a/client/stillbox/src/app/talkgroups/talkgroup-record/talkgroup-record.component.ts b/client/stillbox/src/app/talkgroups/talkgroup-record/talkgroup-record.component.ts index 75efd33..967fc50 100644 --- a/client/stillbox/src/app/talkgroups/talkgroup-record/talkgroup-record.component.ts +++ b/client/stillbox/src/app/talkgroups/talkgroup-record/talkgroup-record.component.ts @@ -84,8 +84,8 @@ export class TalkgroupRecordComponent { readonly _allTags: Observable; 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 = { - 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; diff --git a/client/stillbox/src/app/talkgroups/talkgroup-table/talkgroup-table.component.html b/client/stillbox/src/app/talkgroups/talkgroup-table/talkgroup-table.component.html index 780f1b3..31a8635 100644 --- a/client/stillbox/src/app/talkgroups/talkgroup-table/talkgroup-table.component.html +++ b/client/stillbox/src/app/talkgroups/talkgroup-table/talkgroup-table.component.html @@ -34,7 +34,7 @@ Group - {{ tg.tg_group }} + {{ tg.tgGroup }} Name @@ -42,7 +42,7 @@ Alpha Tag - {{ tg.alpha_tag }} + {{ tg.alphaTag }} TG ID diff --git a/client/stillbox/src/app/talkgroups/talkgroups.service.ts b/client/stillbox/src/app/talkgroups/talkgroups.service.ts index 7fc6026..1184952 100644 --- a/client/stillbox/src/app/talkgroups/talkgroups.service.ts +++ b/client/stillbox/src/app/talkgroups/talkgroups.service.ts @@ -90,10 +90,10 @@ export class TalkgroupService { } putTalkgroup(tu: TalkgroupUpdate): Observable { - let tgid = this.tgKey(tu.system_id, tu.tgid); + let tgid = this.tgKey(tu.systemId, tu.tgid); return this.http - .put(`/api/talkgroup/${tu.system_id}/${tu.tgid}`, tu) + .put(`/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).next(tg);