From eb4adb6f5a7acaacd9b55f0b1e5e480407d60d8f Mon Sep 17 00:00:00 2001 From: Shawn Jackson Date: Tue, 8 Oct 2024 22:09:03 -0700 Subject: [PATCH] CU-868a3neq0 fixed signalr issue fixed ui bug on call list --- .../call-card/call-card.component.html | 10 ++-- .../call-info/call-info.component.html | 28 ++++++++++ .../call-info/call-info.component.scss | 55 +++++++++++++++++++ .../call-info/call-info.component.ts | 44 +++++++++++++++ src/app/components/components.module.ts | 7 ++- .../home/pages/settings/settings.page.html | 8 +-- src/app/features/home/providers/home.ts | 26 +++++++-- 7 files changed, 162 insertions(+), 16 deletions(-) create mode 100644 src/app/components/call-info/call-info.component.html create mode 100644 src/app/components/call-info/call-info.component.scss create mode 100644 src/app/components/call-info/call-info.component.ts diff --git a/src/app/components/call-card/call-card.component.html b/src/app/components/call-card/call-card.component.html index 2813be8..5d726de 100644 --- a/src/app/components/call-card/call-card.component.html +++ b/src/app/components/call-card/call-card.component.html @@ -1,7 +1,7 @@ -

{{ call?.Name }}

+

{{ call?.Name }}

{{ call?.LoggedOnUtc | rgTimeAgoUtc }} @@ -11,19 +11,17 @@ -
-
    -
  • +
      +
    • {{ call?.Address }}
    • -
    • +
    • {{ call?.Number }}
    -
\ No newline at end of file diff --git a/src/app/components/call-info/call-info.component.html b/src/app/components/call-info/call-info.component.html new file mode 100644 index 0000000..f921b09 --- /dev/null +++ b/src/app/components/call-info/call-info.component.html @@ -0,0 +1,28 @@ +
+ + + + {{ call?.Number }} + + + + {{ call?.Name }} + + + + + + + + + + + {{getPriorityName()}} + {{ getDate(call?.LoggedOn) }} + {{ call?.LoggedOnUtc | rgTimeAgoUtc }} + + + {{ call?.Address }} + + +
\ No newline at end of file diff --git a/src/app/components/call-info/call-info.component.scss b/src/app/components/call-info/call-info.component.scss new file mode 100644 index 0000000..2a2fbad --- /dev/null +++ b/src/app/components/call-info/call-info.component.scss @@ -0,0 +1,55 @@ +.bookings { + width: 94%; + margin-top: 20px; + margin-left: 10px; + margin-right: 10px; + box-shadow: 0px 0px 10px 0px grey; + border-radius: 5px; + overflow: hidden; + + .call-name { + display: block; + font-size: 16px; + text-align: right; + overflow: hidden; + } + + .call-nature { + display: block; + font-size: 12px; + color: gray; + text-align: left; + } + + .call-number { + font-size: 12px; + white-space: nowrap; + color: gray; + text-align: left; + } + + .call-address { + font-size: 12px; + text-align: left; + } + + .call-priority { + display: block; + font-size: 16px; + text-align: left; + overflow: hidden; + } + + .person-group { + display: block; + font-size: 14px; + text-align: left; + } + + .call-date-time { + font-size: 12px; + display: block; + text-align: left; + color: var(--ion-color-primary); + } +} diff --git a/src/app/components/call-info/call-info.component.ts b/src/app/components/call-info/call-info.component.ts new file mode 100644 index 0000000..256d1c7 --- /dev/null +++ b/src/app/components/call-info/call-info.component.ts @@ -0,0 +1,44 @@ +import { Component, OnInit, Input, ChangeDetectionStrategy } from '@angular/core'; +import { CallPriorityResultData, CallResultData, UtilsService } from '@resgrid/ngx-resgridlib'; + +@Component({ + changeDetection: ChangeDetectionStrategy.OnPush, + selector: 'app-call-card-info', + templateUrl: './call-info.component.html', + styleUrls: ['./call-info.component.scss'], +}) +export class CallInfoComponent implements OnInit { + @Input() call: CallResultData; + @Input() priority: CallPriorityResultData; + @Input() color: string; + + constructor(private utilsProvider: UtilsService) {} + + ngOnInit() {} + + getColor() { + if (!this.call) { + return 'gray'; + } else if (this.call.CallId === '0') { + return 'gray'; + } else if (this.priority) { + return this.priority.Color; + } + } + + getPriorityName() { + if (!this.call) { + return 'Normal'; + } else if (this.call.CallId === '0') { + return 'Normal'; + } else if (this.priority) { + return this.priority.Name; + } + + return 'Normal'; + } + + public getDate(date) { + return this.utilsProvider.getDate(date); + } +} diff --git a/src/app/components/components.module.ts b/src/app/components/components.module.ts index e03eea3..d31d1e3 100644 --- a/src/app/components/components.module.ts +++ b/src/app/components/components.module.ts @@ -7,6 +7,7 @@ import { NgxResgridLibModule } from '@resgrid/ngx-resgridlib'; import { CTAPanelComponent } from './cta-panel/cta-panel'; import { NoteCardComponent } from './note-card/note-card.component'; import { ProtocolCardComponent } from './protocol-card/protocol-card.component'; +import { CallInfoComponent } from './call-info/call-info.component'; @NgModule({ imports: [ @@ -20,13 +21,15 @@ import { ProtocolCardComponent } from './protocol-card/protocol-card.component'; CallCardComponent, CTAPanelComponent, NoteCardComponent, - ProtocolCardComponent + ProtocolCardComponent, + CallInfoComponent ], exports: [ CallCardComponent, CTAPanelComponent, NoteCardComponent, - ProtocolCardComponent + ProtocolCardComponent, + CallInfoComponent ] }) export class ComponentsModule {} diff --git a/src/app/features/home/pages/settings/settings.page.html b/src/app/features/home/pages/settings/settings.page.html index 0e701fd..8384f14 100644 --- a/src/app/features/home/pages/settings/settings.page.html +++ b/src/app/features/home/pages/settings/settings.page.html @@ -75,19 +75,19 @@

{{'settingsPage.keepActiveLabel' | translate}}

- + - +

{{'settingsPage.backgroundGeolocationLabel' | translate}}

diff --git a/src/app/features/home/providers/home.ts b/src/app/features/home/providers/home.ts index 93b018c..bccc122 100644 --- a/src/app/features/home/providers/home.ts +++ b/src/app/features/home/providers/home.ts @@ -145,19 +145,37 @@ export class HomeProvider { } ); this.events.subscribe( - this.consts.SIGNALR_EVENTS.PERSONNEL_STAFFING_UPDATED, + this.consts.SIGNALR_EVENTS.UNIT_STATUS_UPDATED, (data: any) => { - //this.homeStore.dispatch(new HomeActions.RefreshMapData()); + this.homeStore.dispatch(new HomeActions.RefreshMapData()); } ); this.events.subscribe( - this.consts.SIGNALR_EVENTS.UNIT_STATUS_UPDATED, + this.consts.SIGNALR_EVENTS.CALLS_UPDATED, (data: any) => { this.homeStore.dispatch(new HomeActions.RefreshMapData()); } ); this.events.subscribe( - this.consts.SIGNALR_EVENTS.CALLS_UPDATED, + this.consts.SIGNALR_EVENTS.CALL_ADDED, + (data: any) => { + this.homeStore.dispatch(new HomeActions.RefreshMapData()); + } + ); + this.events.subscribe( + this.consts.SIGNALR_EVENTS.CALL_CLOSED, + (data: any) => { + this.homeStore.dispatch(new HomeActions.RefreshMapData()); + } + ); + this.events.subscribe( + this.consts.SIGNALR_EVENTS.PERSONNEL_LOCATION_UPDATED, + (data: any) => { + this.homeStore.dispatch(new HomeActions.RefreshMapData()); + } + ); + this.events.subscribe( + this.consts.SIGNALR_EVENTS.UNIT_LOCATION_UPDATED, (data: any) => { this.homeStore.dispatch(new HomeActions.RefreshMapData()); }