diff --git a/package-lock.json b/package-lock.json index 8560708..07f1069 100644 --- a/package-lock.json +++ b/package-lock.json @@ -38,7 +38,7 @@ "@ngrx/store-devtools": "12.4.0", "@ngx-translate/core": "13.0.0", "@ngx-translate/http-loader": "6.0.0", - "@resgrid/ngx-resgridlib": "^1.1.15", + "@resgrid/ngx-resgridlib": "^1.1.20", "@sentry/angular": "6.16.1", "@sentry/tracing": "6.16.1", "@types/jquery": "3.5.6", @@ -3613,9 +3613,9 @@ "integrity": "sha1-p3c2C1s5oaLlEG+OhY8v0tBgxXA=" }, "node_modules/@resgrid/ngx-resgridlib": { - "version": "1.1.15", - "resolved": "https://registry.npmjs.org/@resgrid/ngx-resgridlib/-/ngx-resgridlib-1.1.15.tgz", - "integrity": "sha512-oG+pFPvawZ4CSfWXr8wWiCb4mwLV6cFW8QBnqhseFebNcgutLxaCP7Tpwky4MM5ukdDBb8+xhmoSGJ1fkHT5iQ==", + "version": "1.1.20", + "resolved": "https://registry.npmjs.org/@resgrid/ngx-resgridlib/-/ngx-resgridlib-1.1.20.tgz", + "integrity": "sha512-i/6UUlvbjeBKKZ2u0VPLdxiR61BZ2ftG2E1ogFru3shE54gLPUXPopBBupdAHm7aPLxjT/Ddm6wz/R9jBY5IQg==", "dependencies": { "@microsoft/signalr": "^5.0.9", "jwt-decode": "^3.1.2", @@ -21895,9 +21895,9 @@ "integrity": "sha1-p3c2C1s5oaLlEG+OhY8v0tBgxXA=" }, "@resgrid/ngx-resgridlib": { - "version": "1.1.15", - "resolved": "https://registry.npmjs.org/@resgrid/ngx-resgridlib/-/ngx-resgridlib-1.1.15.tgz", - "integrity": "sha512-oG+pFPvawZ4CSfWXr8wWiCb4mwLV6cFW8QBnqhseFebNcgutLxaCP7Tpwky4MM5ukdDBb8+xhmoSGJ1fkHT5iQ==", + "version": "1.1.20", + "resolved": "https://registry.npmjs.org/@resgrid/ngx-resgridlib/-/ngx-resgridlib-1.1.20.tgz", + "integrity": "sha512-i/6UUlvbjeBKKZ2u0VPLdxiR61BZ2ftG2E1ogFru3shE54gLPUXPopBBupdAHm7aPLxjT/Ddm6wz/R9jBY5IQg==", "requires": { "@microsoft/signalr": "^5.0.9", "jwt-decode": "^3.1.2", diff --git a/package.json b/package.json index ccee64b..42e2cff 100644 --- a/package.json +++ b/package.json @@ -44,7 +44,7 @@ "@ngrx/store-devtools": "12.4.0", "@ngx-translate/core": "13.0.0", "@ngx-translate/http-loader": "6.0.0", - "@resgrid/ngx-resgridlib": "^1.1.15", + "@resgrid/ngx-resgridlib": "^1.1.20", "@sentry/angular": "6.16.1", "@sentry/tracing": "6.16.1", "@types/jquery": "3.5.6", diff --git a/src/app/features/calls/pages/edit-call/edit-call.page.ts b/src/app/features/calls/pages/edit-call/edit-call.page.ts index a221fbe..2707139 100644 --- a/src/app/features/calls/pages/edit-call/edit-call.page.ts +++ b/src/app/features/calls/pages/edit-call/edit-call.page.ts @@ -131,7 +131,9 @@ export class EditCallPage implements AfterViewInit { .value(); if (units) { - this.selectedGroupName = units[0].groupName; + if (units[0] && units[0].groupName) { + this.selectedGroupName = units[0].groupName; + } if (!this.selectedGroupName || this.selectedGroupName == "") { this.selectedGroupName = "No Group"; @@ -159,7 +161,7 @@ export class EditCallPage implements AfterViewInit { this.cdr.detectChanges(); }); - this.callsState$.subscribe((callsState) => { + this.callsState$.pipe(take(1)).subscribe((callsState) => { if (callsState && callsState.callToEdit) { const editCallData = callsState.callToEdit; @@ -172,8 +174,8 @@ export class EditCallPage implements AfterViewInit { this.form["priority"].setValue(editCallData.Priority); this.form["priority"].patchValue(editCallData.Priority); - this.form["type"].setValue(editCallData.Type); - this.form["type"].patchValue(editCallData.Type); + //this.form["type"].setValue(editCallData.Type); + //this.form["type"].patchValue(editCallData.Type); this.form["reportingPartyName"].setValue(editCallData.ContactName); this.form["reportingPartyName"].patchValue(editCallData.ContactName); @@ -205,8 +207,20 @@ export class EditCallPage implements AfterViewInit { this.form["w3w"].setValue(editCallData.What3Words); this.form["w3w"].patchValue(editCallData.What3Words); - this.form["dispatchOn"].setValue(editCallData.DispatchedOnUtc); - this.form["dispatchOn"].patchValue(editCallData.DispatchedOnUtc); + this.form["dispatchOn"].setValue(editCallData.DispatchedOn); + this.form["dispatchOn"].patchValue(editCallData.DispatchedOn); + + this.store + .select(selectHomeState) + .pipe(take(1)) + .subscribe((state) => { + const selectedCallType = _.find(state.callTypes, ["Name", editCallData.Type]); + + if (selectedCallType) { + this.form["type"].setValue(selectedCallType.Id); + this.form["type"].patchValue(selectedCallType.Id); + } + }); if (editCallData.Latitude && editCallData.Longitude) { this.setupNewCallMap(parseInt(editCallData.Latitude), parseInt(editCallData.Longitude), 13); diff --git a/src/app/features/home/actions/home.actions.ts b/src/app/features/home/actions/home.actions.ts index adeb795..e4ecdb9 100644 --- a/src/app/features/home/actions/home.actions.ts +++ b/src/app/features/home/actions/home.actions.ts @@ -1,5 +1,5 @@ import { Action } from '@ngrx/store'; -import { CallFileResultData, CallNoteResultData, CallResultData, DepartmentVoiceResultData, GetCallTemplatesResultData, GpsLocation, MapDataAndMarkersData, UnitStatusResultData } from '@resgrid/ngx-resgridlib'; +import { CallExtraDataResultData, CallFileResultData, CallNoteResultData, CallResultData, DepartmentVoiceResultData, GetCallTemplatesResultData, GpsLocation, MapDataAndMarkersData, UnitStatusResultData } from '@resgrid/ngx-resgridlib'; import { Call } from 'src/app/core/models/call'; import { PersonnelForCallResult } from 'src/app/core/models/personnelForCallResult'; import { UnitStatusResult } from 'src/app/core/models/unitStatusResult'; @@ -86,6 +86,8 @@ export enum HomeActionTypes { SAVE_PERSONSTAFFING_SUCCESS = '[HOME] SAVE_PERSONSTAFFING_SUCCESS', SAVE_PERSONSTAFFING_FAIL = '[HOME] SAVE_PERSONSTAFFING_FAIL', UPDATE_PERSONSTAFFING = '[HOME] UPDATE_PERSONSTAFFING', + SHOW_VIEW_CALL_FORM = '[HOME] SHOW_VIEW_CALL_FORM', + OPEN_VIEW_CALL_FORM = '[HOME] OPEN_VIEW_CALL_FORM', } // Home @@ -457,6 +459,16 @@ export class UpdatePersonStaffings implements Action { constructor(public payload: PersonnelForCallResult[]) {} } +export class ShowViewCallForm implements Action { + readonly type = HomeActionTypes.SHOW_VIEW_CALL_FORM; + constructor(public callId: string) {} +} + +export class OpenViewCallForm implements Action { + readonly type = HomeActionTypes.OPEN_VIEW_CALL_FORM; + constructor(public payload: CallExtraDataResultData) {} +} + export class Done implements Action { readonly type = HomeActionTypes.DONE; constructor() {} @@ -476,5 +488,5 @@ export type HomeActionsUnion = Loading | LoadingSuccess | LoadingFail | LoadingM OpenCallFormModal | SetNewCallFormData | IsSavingCall | Done | UpdateSelectPerson | OpenSetPersonStatusModal | OpenSetPersonStaffingModal | SavingPersonStatuses | UpdatePersonStatuses | SavingPersonStaffing | SavingPersonStaffing | SavingPersonStaffingSuccess | SavingPersonStaffingFail | UpdatePersonStaffings | GetAddressForCoordinates | - GetAddressForCoordinatesSuccess | GetAddressForCoordinatesFail + GetAddressForCoordinatesSuccess | GetAddressForCoordinatesFail | ShowViewCallForm | OpenViewCallForm ; diff --git a/src/app/features/home/effects/home.effect.ts b/src/app/features/home/effects/home.effect.ts index 8b43bba..5e49588 100644 --- a/src/app/features/home/effects/home.effect.ts +++ b/src/app/features/home/effects/home.effect.ts @@ -35,6 +35,7 @@ import * as _ from "lodash"; import { SetPersonStatusModalComponent } from "../modals/setPersonStatus/setPersonStatus.modal"; import { SetPersonStaffingModalComponent } from "../modals/setPersonStaffing/setPersonStaffing.modal"; import { GeocodingProvider } from "src/app/providers/geocoding"; +import { ViewCallFormModalComponent } from "../modals/viewCallForm/view-callForm.modal"; @Injectable() export class HomeEffects { @@ -300,7 +301,7 @@ export class HomeEffects { ofType(homeAction.HomeActionTypes.GET_COORDINATESFORADDRESS), mergeMap((action) => //this.locationProvider.getCoordinatesForAddressFromGoogle(action.address).pipe( - this.geocodingProvider.getLocationFromAddress(action.address).pipe( + this.geocodingProvider.getLocationFromAddress(action.address).pipe( // If successful, dispatch success action with result map((data) => ({ type: homeAction.HomeActionTypes.GET_COORDINATESFORADDRESS_SUCCESS, @@ -321,7 +322,7 @@ export class HomeEffects { ofType(homeAction.HomeActionTypes.GET_ADDRESSFORCOORDINATES), mergeMap((action) => //this.locationProvider.getCoordinatesForAddressFromGoogle(action.address).pipe( - this.geocodingProvider.getAddressFromLocation(new GpsLocation(parseInt(action.latitude), parseInt(action.longitude))).pipe( + this.geocodingProvider.getAddressFromLocation(new GpsLocation(parseInt(action.latitude), parseInt(action.longitude))).pipe( // If successful, dispatch success action with result map((data) => ({ type: homeAction.HomeActionTypes.GET_ADDRESSFORCOORDINATES_SUCCESS, @@ -382,25 +383,24 @@ export class HomeEffects { ); saveCallSuccess$ = createEffect(() => - this.actions$.pipe( - ofType(homeAction.HomeActionTypes.SAVE_CALL_SUCCESS), - mergeMap((action) => - this.callsProvider.getActiveCalls().pipe( - // If successful, dispatch success action with result - map((data) => ({ - type: homeAction.HomeActionTypes.UPDATE_CALLS, - payload: data.Data, - })), - tap((data) => { - this.alertProvider.showAutoCloseSuccessAlert("Call has been saved and dispatched."); - }), - // If request fails, dispatch failed action - catchError(() => of({ type: homeAction.HomeActionTypes.SAVE_CALL_FAIL })) + this.actions$.pipe( + ofType(homeAction.HomeActionTypes.SAVE_CALL_SUCCESS), + mergeMap((action) => + this.callsProvider.getActiveCalls().pipe( + // If successful, dispatch success action with result + map((data) => ({ + type: homeAction.HomeActionTypes.UPDATE_CALLS, + payload: data.Data, + })), + tap((data) => { + this.alertProvider.showAutoCloseSuccessAlert("Call has been saved and dispatched."); + }), + // If request fails, dispatch failed action + catchError(() => of({ type: homeAction.HomeActionTypes.SAVE_CALL_FAIL })) + ) ) ) - ) -); - + ); @Effect() getLatestPersonnelData$: Observable = this.actions$.pipe( @@ -617,11 +617,12 @@ export class HomeEffects { tap((data) => this.closeModal()) ); - showSetPersonStatusModal$ = createEffect(() => - this.actions$.pipe( - ofType(homeAction.HomeActionTypes.OPEN_SETPERSONSTATUSMODAL), - exhaustMap((data) => this.runModal(SetPersonStatusModalComponent, "md")) - ), + showSetPersonStatusModal$ = createEffect( + () => + this.actions$.pipe( + ofType(homeAction.HomeActionTypes.OPEN_SETPERSONSTATUSMODAL), + exhaustMap((data) => this.runModal(SetPersonStatusModalComponent, "md")) + ), { dispatch: false } ); @@ -629,7 +630,8 @@ export class HomeEffects { this.actions$.pipe( ofType(homeAction.HomeActionTypes.SAVE_PERSONSTATUSES), mergeMap((action) => - this.personnelStatusesProvider.savePersonsStatuses({ + this.personnelStatusesProvider + .savePersonsStatuses({ UserIds: action.payload.userIds, Type: action.payload.stateType, RespondingTo: action.payload.destination, @@ -644,7 +646,8 @@ export class HomeEffects { Speed: "", Heading: "", EventId: "", - }).pipe( + }) + .pipe( // If successful, dispatch success action with result map((data) => ({ type: homeAction.HomeActionTypes.SAVE_PERSONSTATUSES_SUCCESS, @@ -665,7 +668,11 @@ export class HomeEffects { ofType(homeAction.HomeActionTypes.SAVE_PERSONSTATUSES_FAIL), tap(async (action) => { this.closeModal(); - this.alertProvider.showErrorAlert("Personnel Status Error", "", "There was an issue trying to set the personnel statuses, please try again."); + this.alertProvider.showErrorAlert( + "Personnel Status Error", + "", + "There was an issue trying to set the personnel statuses, please try again." + ); }) ), { dispatch: false } @@ -691,27 +698,29 @@ export class HomeEffects { ) ); - showSetPersonStaffingModal$ = createEffect(() => - this.actions$.pipe( - ofType(homeAction.HomeActionTypes.OPEN_SETPERSONSTAFFINGMODAL), - exhaustMap((data) => this.runModal(SetPersonStaffingModalComponent, "md")) - ), + showSetPersonStaffingModal$ = createEffect( + () => + this.actions$.pipe( + ofType(homeAction.HomeActionTypes.OPEN_SETPERSONSTAFFINGMODAL), + exhaustMap((data) => this.runModal(SetPersonStaffingModalComponent, "md")) + ), { dispatch: false } ); - savePersonnelStaffing$ = createEffect(() => this.actions$.pipe( ofType(homeAction.HomeActionTypes.SAVE_PERSONSTAFFING), mergeMap((action) => - this.personnelStaffingProvider.savePersonsStaffings({ + this.personnelStaffingProvider + .savePersonsStaffings({ UserIds: action.payload.userIds, Type: action.payload.staffingType, TimestampUtc: action.payload.date.toUTCString().replace("UTC", "GMT"), Timestamp: action.payload.date.toISOString(), Note: action.payload.note, EventId: "", - }).pipe( + }) + .pipe( // If successful, dispatch success action with result map((data) => ({ type: homeAction.HomeActionTypes.SAVE_PERSONSTAFFING_SUCCESS, @@ -746,6 +755,30 @@ export class HomeEffects { ) ); + showViewCallFormModal$ = createEffect(() => + this.actions$.pipe( + ofType(homeAction.HomeActionTypes.SHOW_VIEW_CALL_FORM), + mergeMap((action) => + this.callsProvider.getCallExtraData(action.callId).pipe( + map((data) => ({ + type: homeAction.HomeActionTypes.OPEN_VIEW_CALL_FORM, + payload: data.Data, + })) + ) + ) + ) + ); + + openViewCallFormModal$ = createEffect(() => + this.actions$.pipe( + ofType(homeAction.HomeActionTypes.OPEN_VIEW_CALL_FORM), + exhaustMap((data) => this.runModal(ViewCallFormModalComponent, "md")), + map((data) => ({ + type: homeAction.HomeActionTypes.DONE + })) + ) + ); + done$ = createEffect( () => this.actions$.pipe( diff --git a/src/app/features/home/home.module.ts b/src/app/features/home/home.module.ts index 4dea19d..5fdf68a 100644 --- a/src/app/features/home/home.module.ts +++ b/src/app/features/home/home.module.ts @@ -23,6 +23,7 @@ import { CallFormModalComponent } from './modals/callForm/callForm.modal'; import { NgxResgridLibModule } from '@resgrid/ngx-resgridlib'; import { SetPersonStatusModalComponent } from './modals/setPersonStatus/setPersonStatus.modal'; import { SetPersonStaffingModalComponent } from './modals/setPersonStaffing/setPersonStaffing.modal'; +import { ViewCallFormModalComponent } from './modals/viewCallForm/view-callForm.modal'; @NgModule({ declarations: [ @@ -34,7 +35,8 @@ import { SetPersonStaffingModalComponent } from './modals/setPersonStaffing/setP CallFilesModalComponent, CallFormModalComponent, SetPersonStatusModalComponent, - SetPersonStaffingModalComponent + SetPersonStaffingModalComponent, + ViewCallFormModalComponent ], imports: [ CommonModule, @@ -66,7 +68,8 @@ import { SetPersonStaffingModalComponent } from './modals/setPersonStaffing/setP CallFilesModalComponent, CallFormModalComponent, SetPersonStatusModalComponent, - SetPersonStaffingModalComponent + SetPersonStaffingModalComponent, + ViewCallFormModalComponent ] }) export class HomeModule { } diff --git a/src/app/features/home/modals/viewCallForm/view-callForm.modal.html b/src/app/features/home/modals/viewCallForm/view-callForm.modal.html new file mode 100644 index 0000000..c0dc8ec --- /dev/null +++ b/src/app/features/home/modals/viewCallForm/view-callForm.modal.html @@ -0,0 +1,22 @@ +
+ +
+ +
+ +
\ No newline at end of file diff --git a/src/app/features/home/modals/viewCallForm/view-callForm.modal.scss b/src/app/features/home/modals/viewCallForm/view-callForm.modal.scss new file mode 100644 index 0000000..e69de29 diff --git a/src/app/features/home/modals/viewCallForm/view-callForm.modal.ts b/src/app/features/home/modals/viewCallForm/view-callForm.modal.ts new file mode 100644 index 0000000..a4da8f5 --- /dev/null +++ b/src/app/features/home/modals/viewCallForm/view-callForm.modal.ts @@ -0,0 +1,93 @@ +import { Component, Input, OnInit } from "@angular/core"; +import { NgbModal, NgbActiveModal } from "@ng-bootstrap/ng-bootstrap"; +import { Store } from "@ngrx/store"; +import { Observable, Subscription } from "rxjs"; +import { + selectAuthState, + selectHomeState, + selectIsSavingUnitState, +} from "src/app/store"; +import { HomeState } from "../../store/home.store"; +import * as HomeActions from "../../actions/home.actions"; +import { take } from "rxjs/operators"; +import { Actions, ofType } from "@ngrx/effects"; +import * as _ from "lodash"; +import { FormBuilder, FormGroup, Validators } from "@angular/forms"; +import { environment } from "../../../../../environments/environment"; +import { AuthState } from "src/app/features/auth/store/auth.store"; +import { CallResultData, FormResult, FormResultData } from '@resgrid/ngx-resgridlib'; +declare var $: any; + +@Component({ + selector: "app-resgrid-modal-view-callForm", + templateUrl: "view-callForm.modal.html", + styleUrls: ["view-callForm.modal.scss"], +}) +export class ViewCallFormModalComponent implements OnInit { + public homeState$: Observable; + public selectedCallStatus: string = "1"; + public selectedCall: CallResultData; + public note: string; + public isSaving: boolean = false; + @Input() auth: AuthState; + public formData: FormGroup; + public searchTerm: string; + public fileName = ""; + public uploadProgress: number; + public uploadSub: Subscription; + public newCallForm: FormResultData = null; + private formRender: any; + + constructor( + public activeModal: NgbActiveModal, + private store: Store, + private actions$: Actions, + public formBuilder: FormBuilder, + private authStore: Store + ) { + this.homeState$ = this.store.select(selectHomeState); + + this.formData = this.formBuilder.group({ + message: ["", [Validators.required]], + }); + } + + ngOnInit() { + this.authStore + .select(selectAuthState) + .pipe(take(1)) + .subscribe((s) => (this.auth = s)); + + this.store + .select(selectHomeState) + .pipe(take(1)) + .subscribe((state) => { + if (state && state.viewCallExtraData && state.viewCallExtraData.CallFormData) { + this.formRender = $(document.getElementById("fb-reader")).formRender({ dataType: 'json', formData: state.viewCallExtraData.CallFormData, + notify: { + error: function (message) { + + }, + success: function (message) { + //$('input, textarea, select', '.rendered-form').attr('readonly', true).attr('disabled', true); + + var container = document.querySelector('.rendered-form'); + var inputs = container.querySelectorAll('input, textarea, select'); + + for (var i = 0; i < inputs.length; i++) { + let element = inputs[i] as HTMLInputElement; + element.disabled = true; + } + }, + warning: function (message) { + + } + } }); + } + }); + } + + public dismiss() { + this.activeModal.close(); + } +} diff --git a/src/app/features/home/pages/dashboard/dashboard.page.ts b/src/app/features/home/pages/dashboard/dashboard.page.ts index a4d72da..1629686 100644 --- a/src/app/features/home/pages/dashboard/dashboard.page.ts +++ b/src/app/features/home/pages/dashboard/dashboard.page.ts @@ -124,14 +124,23 @@ export class DashboardPage implements AfterViewInit { this.form["name"].setValue(activeCallTemplate.CallName); this.form["name"].patchValue(activeCallTemplate.CallName); - this.form["type"].setValue(activeCallTemplate.CallType); - this.form["type"].patchValue(activeCallTemplate.CallType); - this.form["nature"].setValue(activeCallTemplate.CallNature); this.form["nature"].patchValue(activeCallTemplate.CallNature); this.form["priority"].setValue(activeCallTemplate.CallPriority); this.form["priority"].patchValue(activeCallTemplate.CallPriority); + + this.store + .select(selectHomeState) + .pipe(take(1)) + .subscribe((state) => { + const selectedCallType = _.find(state.callTypes, ["Name", activeCallTemplate.CallType]); + + if (selectedCallType) { + this.form["type"].setValue(selectedCallType.Id); + this.form["type"].patchValue(selectedCallType.Id); + } + }); } }); @@ -150,7 +159,7 @@ export class DashboardPage implements AfterViewInit { this.newCallLocation$.subscribe((address) => { if (address) { const currentAddress = this.newCallForm.get("address").value; - if (!currentAddress || currentAddress === '') { + if (!currentAddress || currentAddress === "") { this.form["address"].setValue(address); this.form["address"].patchValue(address); } @@ -212,7 +221,9 @@ export class DashboardPage implements AfterViewInit { .value(); if (units && Array.isArray(units) && units.length > 0) { - this.selectedGroupName = units[0].groupName; + if (units[0] && units[0].groupName) { + this.selectedGroupName = units[0].groupName; + } if (!this.selectedGroupName || this.selectedGroupName == "") { this.selectedGroupName = "No Group"; @@ -379,7 +390,9 @@ export class DashboardPage implements AfterViewInit { const address = this.newCallForm.get("address").value; if (!address || address == "") { - this.store.dispatch(new HomeActions.GetAddressForCoordinates(this.newCallForm.get("latitude").value, this.newCallForm.get("longitude").value)); + this.store.dispatch( + new HomeActions.GetAddressForCoordinates(this.newCallForm.get("latitude").value, this.newCallForm.get("longitude").value) + ); } } @@ -395,7 +408,16 @@ export class DashboardPage implements AfterViewInit { public updateAssignments() {} - public viewCallForm() {} + public viewCallForm() { + this.store + .select(selectHomeState) + .pipe(take(1)) + .subscribe((state) => { + const selectedCall = _.find(state.calls, ["Selected", true]); + + this.store.dispatch(new HomeActions.ShowViewCallForm(selectedCall.CallId)); + }); + } public saveCall() { this.store.dispatch(new HomeActions.IsSavingCall()); diff --git a/src/app/features/home/reducers/home.reducer.ts b/src/app/features/home/reducers/home.reducer.ts index 08a1f8f..b1459a4 100644 --- a/src/app/features/home/reducers/home.reducer.ts +++ b/src/app/features/home/reducers/home.reducer.ts @@ -36,7 +36,7 @@ export function reducer(state: HomeState = initialState, action: HomeActionsUnio personnelStatuses: action.payload.PersonnelStatuses, personnelStaffing: action.payload.PersonnelStaffingLevels, dispatchNote: action.payload.DispatchNote, - callNoteTemplates: action.payload.CallNotes + callNoteTemplates: action.payload.CallNotes, }; case HomeActionTypes.LOADING_FAIL: @@ -284,6 +284,11 @@ export function reducer(state: HomeState = initialState, action: HomeActionsUnio ...state, personnelForGrid: personnelForStaffingUpdate, }; + case HomeActionTypes.OPEN_VIEW_CALL_FORM: + return { + ...state, + viewCallExtraData: action.payload, + }; default: return state; } diff --git a/src/app/features/home/store/home.store.ts b/src/app/features/home/store/home.store.ts index 0ef1f9e..22bd5f2 100644 --- a/src/app/features/home/store/home.store.ts +++ b/src/app/features/home/store/home.store.ts @@ -1,4 +1,4 @@ -import { CallFileResultData, CallNoteResultData, CallNoteTemplateResultData, CallPriorityResultData, CallResultData, CallTypeResultData, CustomStatusResultData, FormResultData, GetCallTemplatesResultData, GpsLocation, MapDataAndMarkersData, NoteResultData } from '@resgrid/ngx-resgridlib'; +import { CallExtraDataResultData, CallFileResultData, CallNoteResultData, CallNoteTemplateResultData, CallPriorityResultData, CallResultData, CallTypeResultData, CustomStatusResultData, FormResultData, GetCallTemplatesResultData, GpsLocation, MapDataAndMarkersData, NoteResultData } from '@resgrid/ngx-resgridlib'; import { CallLocalResult } from 'src/app/core/models/callLocalResult'; import { GroupsForCallResult } from 'src/app/core/models/groupsForCallResult'; import { PersonnelForCallResult } from 'src/app/core/models/personnelForCallResult'; @@ -58,6 +58,9 @@ export interface HomeState { // Call Note Templates callNoteTemplates: CallNoteTemplateResultData[]; + + // View Call + viewCallExtraData: CallExtraDataResultData; } export const initialState: HomeState = { @@ -89,5 +92,6 @@ export const initialState: HomeState = { personnelStatuses: null, personnelStaffing: null, dispatchNote: null, - callNoteTemplates: null + callNoteTemplates: null, + viewCallExtraData: null }; \ No newline at end of file