Skip to content

Commit

Permalink
CU-86881rz5m Trying to fix call notes issue.
Browse files Browse the repository at this point in the history
  • Loading branch information
ucswift committed Jun 12, 2024
1 parent e696b38 commit 8ccfe00
Show file tree
Hide file tree
Showing 8 changed files with 348 additions and 42 deletions.
7 changes: 7 additions & 0 deletions src/app/features/calls/actions/calls.actions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,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 @@ -83,6 +84,7 @@ export enum CallsActionTypes {
EDIT_GET_COORDINATES_FOR_PLUS = '[CALLS] EDIT_GET_COORDINATES_FOR_PLUS',
EDIT_GET_COORDINATES_FOR_PLUS_SUCCESS = '[CALLS] EDIT_GET_COORDINATES_FOR_PLUS_SUCCESS',
SET_EDIT_CALL_LOCATION = '[CALLS] SET_EDIT_CALL_LOCATION',
HIDE_CALL_NOTES_MODAL = '[CALLS] HIDE_CALL_NOTES_MODAL',
}

export class GetCalls implements Action {
Expand Down Expand Up @@ -131,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 @@ -23,6 +23,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 @@ -48,7 +49,8 @@ import { SelectDispatchesEditPage } from './pages/select-dispatches-edit/select-
SelectDispatchesPage,
CloseCallPage,
EditCallPage,
SelectDispatchesEditPage
SelectDispatchesEditPage,
ModalCallNotesPage
]
})
export class CallsModule {}
29 changes: 29 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 @@ -134,6 +135,7 @@ export class CallsEffects {
ofType<callActions.ShowCallNotesModal>(
callActions.CallsActionTypes.SHOW_CALLNOTES
),
tap(() => this.loadingProvider.show()),
mergeMap((action) =>
this.callNotesProvider.getCallNotes(action.callId).pipe(
map((data) => ({
Expand All @@ -145,6 +147,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
50 changes: 50 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,50 @@
<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%;">
<perfect-scrollbar>
<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>
</perfect-scrollbar>
</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>
182 changes: 182 additions & 0 deletions src/app/features/calls/modals/notes-modal/modal-notes.page.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,182 @@

.mainLogo {
margin-bottom: 5px;
display: block;
width: 90%;
max-width: 500px;
margin-left: auto;
margin-right: auto;
}


.more-button {
--border-radius: 0%;
--border-width: 0px;
--padding-start: 0px;
--padding-end: 0px;
}

.button-group {
.col {
&:first-child:not(:last-child) {
padding-right: 0;
.button {
border-top-right-radius: 0;
border-bottom-right-radius: 0;
}
}
&:not(:first-child):not(:last-child) {
padding-right: 0;
padding-left: 0;
.button {
border-radius: 0;
}
}
&:last-child:not(:first-child) {
padding-left: 0;
.button {
border-top-left-radius: 0;
border-bottom-left-radius: 0;
}
}
}
}

.notifications-badge {
position: absolute;
top: -3px;
right: -18px;
border-radius: 100%;
}

.call-details {
padding-top: 5px;
}
.call-details .row {
padding: 15px 0;
border-top: solid 1px #eee;
}
.call-details .col {
padding: 0;
}
.call-details .col-100 {
width: 100%;
}
.call-details-breakline {
padding: 15px 0;
border-top: solid 1px #eee;
}
.call-details-breakline .call-details-label {
margin-bottom: 10px;
}
.call-details-label {
color: #777;
font-size: 13px;
}
.call-details-content {
font-size: 14px;
color: #000;
font-weight: 400;
}
.find-location {
padding: 10px 10px 0;
}
.find-location .button {
margin-bottom: 0;
}
.notopmargin {
margin-top: 0 !important;
}
.save-footer {
height: 64px;
background-color: rgba(255, 255, 255, 0.7);
}
.save-footer .button {
margin: 0 !important;
}
.l-map .scroll,
.l-map .map-content {
height: 100%;
}

.list_div {
display: flex;
align-items: center;
.user_image {
height: 50px;
width: 50px;
border-radius: 100%;
background-position: top;
min-width: 50px;
min-height: 50px;
}

.detail {
padding-left: 15px;
width: 100%;
padding: 12px;
border-bottom: 1px solid lightgray;
margin-bottom: 5px;
position: relative;
.username {
font-weight: 600;
// font-size: 15px;
margin-bottom: 5px;
}

span {
display: flex;

ion-icon {
font-size: 18px;
margin-right: 10px;
color: gray;
}

.active {
color: #33b7f1;
}
.light {
color: gray;
font-size: 14px;
}

.time {
color: gray;
font-size: 13px;
position: absolute;
top: 16px;
right: 0;
}
}
}
}

.footer_div {
display: flex;
position: sticky;
bottom: 0;
justify-content: space-between;
align-items: center;
background-color: dimgrey;

ion-input {
border: 1px solid lightgray;
--padding-start: 8px;
position: relative;
}
}

.chat_div{
position: relative;
margin-left: 5px;
}

.user_image{
height: 50px;
width: 50px;
border-radius: 100%;
background-position: top;
min-width: 50px;
min-height: 50px;
}
Loading

0 comments on commit 8ccfe00

Please sign in to comment.