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