Skip to content

Commit

Permalink
Merge pull request #48 from Resgrid/develop
Browse files Browse the repository at this point in the history
CU-868a3neq0 Fixing call note page.
  • Loading branch information
ucswift authored Oct 12, 2024
2 parents 0d34379 + 4c8ba7c commit fb2f663
Show file tree
Hide file tree
Showing 9 changed files with 350 additions and 198 deletions.
12 changes: 6 additions & 6 deletions ios/App/Podfile
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,9 @@ end
post_install do |installer|
assertDeploymentTarget(installer)

#installer.pods_project.targets.each do |target|
# target.build_configurations.each do |config|
# config.build_settings['ENABLE_BITCODE'] = 'NO'
# end
#end
end
installer.pods_project.targets.each do |target|
target.build_configurations.each do |config|
config.build_settings['ENABLE_BITCODE'] = 'NO'
end
end
end
190 changes: 0 additions & 190 deletions ios/App/Podfile.lock

This file was deleted.

6 changes: 6 additions & 0 deletions src/app/features/calls/actions/calls.actions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ export enum CallsActionTypes {
SAVE_CALLNOTE = '[CALLS] SAVE_CALLNOTE',
SAVE_CALLNOTE_SUCCESS = '[CALLS] SAVE_CALLNOTE_SUCCESS',
SAVE_CALLNOTE_FAIL = '[CALLS] SAVE_CALLNOTE_FAIL',
CLOSE_CALLNOTES = '[CALLS] CLOSE_CALLNOTES',
SET_VIEW_CALL_MODAL = '[CALLS] SET_VIEW_CALL_MODAL',
DONE = '[CALLS] DONE',
SHOW_CALLIMAGES = '[CALLS] SHOW_CALLIMAGES',
Expand Down Expand Up @@ -132,6 +133,11 @@ export class OpenCallNotesModal implements Action {
constructor(public payload: CallNoteResultData[]) {}
}

export class CloseCallNotesModal implements Action {
readonly type = CallsActionTypes.CLOSE_CALLNOTES;
constructor() {}
}

export class SaveCallNote implements Action {
readonly type = CallsActionTypes.SAVE_CALLNOTE;
constructor(public callId: string, public callNote: string, public userId: string) {}
Expand Down
4 changes: 3 additions & 1 deletion src/app/features/calls/calls.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ import { ScrollingModule } from '@angular/cdk/scrolling';
import { CloseCallPage } from './pages/close-call/close-call.page';
import { EditCallPage } from './pages/edit-call/edit-call.page';
import { SelectDispatchesEditPage } from './pages/select-dispatches-edit/select-dispatches-edit.page';
import { ModalCallNotesPage } from './modals/notes-modal/modal-notes.page';

@NgModule({
imports: [
Expand All @@ -46,7 +47,8 @@ import { SelectDispatchesEditPage } from './pages/select-dispatches-edit/select-
SelectDispatchesPage,
CloseCallPage,
EditCallPage,
SelectDispatchesEditPage
SelectDispatchesEditPage,
ModalCallNotesPage
]
})
export class CallsModule {}
28 changes: 28 additions & 0 deletions src/app/features/calls/effects/calls.effect.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ import { AlertProvider } from 'src/app/providers/alert';
import { EditCallPage } from '../pages/edit-call/edit-call.page';
import { SelectDispatchesEditPage } from '../pages/select-dispatches-edit/select-dispatches-edit.page';
import { GeolocationProvider } from 'src/app/providers/geolocation';
import { ModalCallNotesPage } from '../modals/notes-modal/modal-notes.page';

@Injectable()
export class CallsEffects {
Expand Down Expand Up @@ -143,6 +144,33 @@ export class CallsEffects {
)
);

showCallNotesModal$ = createEffect(() =>
this.actions$.pipe(
ofType(callActions.CallsActionTypes.OPEN_CALLNOTES),
switchMap(() =>
this.runModal(
ModalCallNotesPage,
'modal-container-full',
null,
'CallsFeatureCallNotesModal'
)
),
switchMap(() => this.loadingProvider.hide()),
map((data) => ({
type: callActions.CallsActionTypes.DONE,
}))
)
);

dismissCallNotesModal$ = createEffect(
() =>
this.actions$.pipe(
ofType(callActions.CallsActionTypes.CLOSE_CALLNOTES),
exhaustMap((data) => this.closeModal('CallsFeatureCallNotesModal'))
),
{ dispatch: false }
);

saveCallNote$ = createEffect(() =>
this.actions$.pipe(
ofType<callActions.SaveCallNote>(
Expand Down
48 changes: 48 additions & 0 deletions src/app/features/calls/modals/notes-modal/modal-notes.page.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
<ion-content [fullscreen]="true">
<ion-fab vertical="top" horizontal="end" slot="fixed">
<ion-fab-button size="small" color="light" (click)="dismissModal()">
<ion-icon name="close-outline"></ion-icon>
</ion-fab-button>
</ion-fab>
<div class="container safe-area">
<span>
<h3 style="padding-left: 10px;">Call Notes</h3>
</span>
<div class="ion-padding" style="height: 94%;">
<div *ngIf="!(callsState$ | async).callNotes || (callsState$ | async).callNotes.length <= 0">
<cta-panel [topIcon]="'information-circle'" [title]="'callNotesPage.ctaPanel.title' | translate" [details]="'callNotesPage.ctaPanel.details' | translate"
[extraDetails]="'callNotesPage.ctaPanel.extraDetails' | translate" [btnLabel]="'callNotesPage.ctaPanel.buttonLabel' | translate" [hideButton]="true"></cta-panel>
</div>

<div class="list_div" *ngFor="let note of (callsState$ | async).callNotes;">
<!--<img class="user_image bg_image" [src]="getAvatarUrl(note.UserId)" onerror="this.onerror=null;this.src='assets/images/defaultProfile.png';">-->
<div class="detail">
<ion-label class="username">{{note.FullName}}</ion-label>
<span>
<ion-label class="light">{{note.Note}}</ion-label>
<ion-label class="time">{{note.TimestampFormatted}}</ion-label>
</span>
</div>
</div>
</div>
</div>
</ion-content>
<ion-footer class="footer">
<div style="display: inherit;" class="footer_div">
<form (ngSubmit)="saveNote()" [formGroup]="callNotesFormData">
<ion-grid>
<ion-row>
<ion-col size="10" size-lg>
<ion-input type="text" placeholder="Enter Note..." formControlName="message" [ngClass]="{'is-invalid': isSavingNote && callNotesFormData.errors}">
</ion-input>
</ion-col>
<ion-col size="2" size-sm style="text-align: right;">
<ion-button type="submit" style="text-align: right;">
<ion-icon name="save-outline"></ion-icon>
</ion-button>
</ion-col>
</ion-row>
</ion-grid>
</form>
</div>
</ion-footer>
Loading

0 comments on commit fb2f663

Please sign in to comment.