From 2e6dd950049e65a44f9717ad73ae73b3c5f55ef7 Mon Sep 17 00:00:00 2001 From: umasoodch Date: Thu, 30 Jan 2020 16:53:13 +0300 Subject: [PATCH 1/7] completed work list ui part --- Mohem/angular.json | 2 +- Mohem/src/app/app.module.ts | 8 +- Mohem/src/app/hmg-common/hmg-common.module.ts | 49 +- .../services/common/common.service.ts | 430 +++++++++--------- .../ui/card-filter/card-filter.component.html | 5 + .../ui/card-filter/card-filter.component.scss | 32 ++ .../card-filter/card-filter.component.spec.ts | 27 ++ .../ui/card-filter/card-filter.component.ts | 18 + .../app/notification/home/home.component.html | 262 +++-------- .../app/notification/home/home.component.scss | 118 +++++ .../app/notification/home/home.component.ts | 249 ++++++---- .../app/notification/notification.module.ts | 30 +- Mohem/src/global.scss | 3 + Mohem/src/theme/styles.scss | 7 + 14 files changed, 688 insertions(+), 552 deletions(-) create mode 100644 Mohem/src/app/hmg-common/ui/card-filter/card-filter.component.html create mode 100644 Mohem/src/app/hmg-common/ui/card-filter/card-filter.component.scss create mode 100644 Mohem/src/app/hmg-common/ui/card-filter/card-filter.component.spec.ts create mode 100644 Mohem/src/app/hmg-common/ui/card-filter/card-filter.component.ts diff --git a/Mohem/angular.json b/Mohem/angular.json index 42b54182..eb6b8116 100644 --- a/Mohem/angular.json +++ b/Mohem/angular.json @@ -42,7 +42,7 @@ "input": "src/app/app.scss" } ], - "scripts": [], + "scripts": ["node_modules/chart.js/dist/Chart.js"], "es5BrowserSupport": true }, "configurations": { diff --git a/Mohem/src/app/app.module.ts b/Mohem/src/app/app.module.ts index 40ac3f80..96004572 100644 --- a/Mohem/src/app/app.module.ts +++ b/Mohem/src/app/app.module.ts @@ -11,10 +11,10 @@ import { AppRoutingModule } from './app-routing.module'; import { BrowserAnimationsModule } from '@angular/platform-browser/animations'; import { ZBar } from '@ionic-native/zbar/ngx'; import { Geolocation } from '@ionic-native/geolocation/ngx'; -import {Camera,CameraOptions,PictureSourceType} from'@ionic-native/Camera/ngx'; -import { FilePath } from "@ionic-native/file-path/ngx"; -import { File } from "@ionic-native/file/ngx"; -import { Base64 } from "@ionic-native/base64/ngx"; +import {Camera, CameraOptions, PictureSourceType} from '@ionic-native/Camera/ngx'; +import { FilePath } from '@ionic-native/file-path/ngx'; +import { File } from '@ionic-native/file/ngx'; +import { Base64 } from '@ionic-native/base64/ngx'; import { FirebaseX } from '@ionic-native/firebase-x/ngx'; @NgModule({ diff --git a/Mohem/src/app/hmg-common/hmg-common.module.ts b/Mohem/src/app/hmg-common/hmg-common.module.ts index 59242c26..1c8a4ffd 100644 --- a/Mohem/src/app/hmg-common/hmg-common.module.ts +++ b/Mohem/src/app/hmg-common/hmg-common.module.ts @@ -42,8 +42,8 @@ import { NativeStorage } from '@ionic-native/native-storage/ngx'; import { ProgressLoadingService } from './ui/progressLoading/progress-loading.service'; import { BarChartComponent } from './ui/bar-chart/bar-chart.component'; import { DonutChartComponent } from './ui/donut-chart/donut-chart.component'; -//import { UserLocalNotificationService } from './services/user-local-notification/user-local-notification.service'; -//import { LocalNotifications } from '@ionic-native/local-notifications/ngx'; +// import { UserLocalNotificationService } from './services/user-local-notification/user-local-notification.service'; +// import { LocalNotifications } from '@ionic-native/local-notifications/ngx'; import { EmailComponent } from './ui/email/email.component'; import { Badge } from '@ionic-native/badge/ngx'; // import { Push } from '@ionic-native/push/ngx'; @@ -53,7 +53,7 @@ import { HmgBrowserService } from './services/hmg-browser/hmg-browser.service'; import { GuidService } from './services/guid/guid.service'; import { TabsBarComponent } from './ui/tabs-bar/tabs-bar.component'; import { PageTrailerComponent } from './ui/spacer/page-trailer/page-trailer.component'; -//import { GeofencingService } from './services/geofencing/geofencing.service'; +// import { GeofencingService } from './services/geofencing/geofencing.service'; // import { BackgroundGeolocation } from '@ionic-native/background-geolocation/ngx'; import { ButtonComponent } from './ui/button/button.component'; import { ToolbarButtonComponent } from './ui/toolbar-button/toolbar-button.component'; @@ -82,27 +82,30 @@ import { Diagnostic } from '@ionic-native/diagnostic/ngx'; import { DetailButtonComponent } from './ui/detail-button/detail-button.component'; import { RouterModule } from '@angular/router'; import { HeaderButtonComponent } from './ui/header-button/header-button.component'; -//import { CallNumber } from '@ionic-native/call-number/ngx'; +// import { CallNumber } from '@ionic-native/call-number/ngx'; import { AppRate } from '@ionic-native/app-rate/ngx'; import { RatingService } from './services/rating/rating.service'; import { InAppBrowser } from '@ionic-native/in-app-browser/ngx'; import { RateService } from './services/rate/rate.service'; -//import { PaymentComponent } from './ui/payment/payment.component'; -//import { PaymentService } from './ui/payment/service/payment.service'; +// import { PaymentComponent } from './ui/payment/payment.component'; +// import { PaymentService } from './ui/payment/service/payment.service'; import { MenuService } from './services/menu/menuservice.service'; import { ReplacementListComponent } from '../vacation-rule/replacement-list/replacement-list.component'; import { FileSelectDirective } from 'ng2-file-upload'; - import { PdfViewerModule } from 'ng2-pdf-viewer'; +import { PdfViewerModule } from 'ng2-pdf-viewer'; import { WorkListAttachViewComponent } from '../notification/work-list-attach-view/work-list-attach-view.component'; -import {Camera,CameraOptions, PictureSourceType} from '@ionic-native/Camera/ngx'; +import {Camera, CameraOptions, PictureSourceType} from '@ionic-native/Camera/ngx'; import {File} from '@ionic-native/file/ngx'; -import {FileUploderProfileComponent} from './ui/file-uploder-profile/file-uploder-profile.component' +import {FileUploderProfileComponent} from './ui/file-uploder-profile/file-uploder-profile.component'; import { OpenNativeSettings } from '@ionic-native/open-native-settings/ngx'; import { AccordinCustomComponent } from './ui/accordin-custom/accordin-custom.component'; import { AccordinTabCustomComponent} from './ui/accordin-custom/accordin-tab-custom/accordin-tab-custom.component'; -import{ConfirmLoginComponent} from '../authentication/confirm-login/confirm-login.component' -import{WelcomeComponent} from './ui/welcome-login/welcome.component' -import {DashboredService} from './services/dashbored/dashbored.service' +import {ConfirmLoginComponent} from '../authentication/confirm-login/confirm-login.component'; +import {WelcomeComponent} from './ui/welcome-login/welcome.component'; +import {DashboredService} from './services/dashbored/dashbored.service'; +import {ChartModule} from 'primeng/chart'; +import { CardFilterComponent} from './ui/card-filter/card-filter.component'; + @NgModule({ imports: [ CommonModule, @@ -112,7 +115,8 @@ import {DashboredService} from './services/dashbored/dashbored.service' HttpClientModule, NgxChartsModule, ListboxModule, - PdfViewerModule + PdfViewerModule, + ChartModule ], declarations: [ WelcomeComponent, @@ -163,15 +167,14 @@ import {DashboredService} from './services/dashbored/dashbored.service' EmptyDataComponent, DetailButtonComponent, HeaderButtonComponent, - //PaymentComponent, ReplacementListComponent, FileSelectDirective, WorkListAttachViewComponent, FileUploderProfileComponent, AccordinTabCustomComponent, AccordinCustomComponent, - ConfirmLoginComponent - + ConfirmLoginComponent, + CardFilterComponent ], exports: [ WelcomeComponent, @@ -219,15 +222,15 @@ import {DashboredService} from './services/dashbored/dashbored.service' EmptyDataComponent, DetailButtonComponent, HeaderButtonComponent, - //PaymentComponent, ReplacementListComponent, FileSelectDirective, WorkListAttachViewComponent, FileUploderProfileComponent, AccordinTabCustomComponent, AccordinCustomComponent, - ConfirmLoginComponent - + ConfirmLoginComponent, + ChartModule, + CardFilterComponent ], providers: [ DashboredService, @@ -244,14 +247,14 @@ import {DashboredService} from './services/dashbored/dashbored.service' NativeStorage, ProgressLoadingService, PushService, - //UserLocalNotificationService, - //LocalNotifications, + // UserLocalNotificationService, + // LocalNotifications, Badge, LifeCycleService, HmgBrowserService, GuidService, // BackgroundGeolocation, - //GeofencingService, + // GeofencingService, Keyboard, KeyboardService, Diagnostic, @@ -267,7 +270,7 @@ import {DashboredService} from './services/dashbored/dashbored.service' RateService, Camera, File, - //PaymentService, + // PaymentService, MenuService, OpenNativeSettings ] diff --git a/Mohem/src/app/hmg-common/services/common/common.service.ts b/Mohem/src/app/hmg-common/services/common/common.service.ts index 532e6bd4..d23fecb4 100644 --- a/Mohem/src/app/hmg-common/services/common/common.service.ts +++ b/Mohem/src/app/hmg-common/services/common/common.service.ts @@ -1,4 +1,4 @@ -import { Injectable } from "@angular/core"; +import { Injectable } from '@angular/core'; import { NavController, ToastController, @@ -6,74 +6,74 @@ import { AlertController, Platform, MenuController -} from "@ionic/angular"; -import { Router } from "@angular/router"; -import { TranslatorService } from "../translator/translator.service"; -import { AlertControllerService } from "../../ui/alert/alert-controller.service"; +} from '@ionic/angular'; +import { Router } from '@angular/router'; +import { TranslatorService } from '../translator/translator.service'; +import { AlertControllerService } from '../../ui/alert/alert-controller.service'; //import { Response } from "../models/response"; import { Response } from 'src/app/hmg-common/services/models/response'; -import { Location, DatePipe } from "@angular/common"; -import { ThemeableBrowser } from "@ionic-native/themeable-browser/ngx"; -import { BrowserConfig } from "./models/browser-config"; +import { Location, DatePipe } from '@angular/common'; +import { ThemeableBrowser } from '@ionic-native/themeable-browser/ngx'; +import { BrowserConfig } from './models/browser-config'; import { LaunchNavigator, LaunchNavigatorOptions -} from "@ionic-native/launch-navigator/ngx"; -import { Device } from "@ionic-native/device/ngx"; -import { ProgressLoadingService } from "../../ui/progressLoading/progress-loading.service"; -import { Observable, throwError } from "rxjs"; -import { SharedDataService } from "../shared-data-service/shared-data.service"; -import { Badge } from "@ionic-native/badge/ngx"; -import { LifeCycleService } from "../life-cycle/life-cycle.service"; -import { Diagnostic } from "@ionic-native/diagnostic/ngx"; +} from '@ionic-native/launch-navigator/ngx'; +import { Device } from '@ionic-native/device/ngx'; +import { ProgressLoadingService } from '../../ui/progressLoading/progress-loading.service'; +import { Observable, throwError } from 'rxjs'; +import { SharedDataService } from '../shared-data-service/shared-data.service'; +import { Badge } from '@ionic-native/badge/ngx'; +import { LifeCycleService } from '../life-cycle/life-cycle.service'; +import { Diagnostic } from '@ionic-native/diagnostic/ngx'; //import { CallNumber } from "@ionic-native/call-number/ngx"; -import { InAppBrowser } from "@ionic-native/in-app-browser/ngx"; +import { InAppBrowser } from '@ionic-native/in-app-browser/ngx'; @Injectable({ - providedIn: "root" + providedIn: 'root' }) export class CommonService { public static months_en_long = [ - "January", - "February", - "March", - "April", - "May", - "June", - "July", - "August", - "September", - "October", - "November", - "December" + 'January', + 'February', + 'March', + 'April', + 'May', + 'June', + 'July', + 'August', + 'September', + 'October', + 'November', + 'December' ]; public static months_en = [ - "Jan", - "Feb", - "Mar", - "Apr", - "May", - "Jun", - "Jul", - "Aug", - "Sep", - "Oct", - "Nov", - "Dec" + 'Jan', + 'Feb', + 'Mar', + 'Apr', + 'May', + 'Jun', + 'Jul', + 'Aug', + 'Sep', + 'Oct', + 'Nov', + 'Dec' ]; public static months_ar = [ - "يناير", - "فبراير", - "مارس", - "أبريل", - "مايو", - "يونيو", - "يوليو", - "أغسطس", - "سبتمبر", - "أكتوبر", - "نوفمبر", - "ديسمبر" + 'يناير', + 'فبراير', + 'مارس', + 'أبريل', + 'مايو', + 'يونيو', + 'يوليو', + 'أغسطس', + 'سبتمبر', + 'أكتوبر', + 'نوفمبر', + 'ديسمبر' ]; private progressLoaders: any[] = []; @@ -114,7 +114,7 @@ export class CommonService { public round(value: number, decimal: number): string { const valueStr = value.toString(); - const dotIndex = valueStr.indexOf("."); + const dotIndex = valueStr.indexOf('.'); if (dotIndex >= 0) { return valueStr.toString().substr(0, dotIndex + decimal); @@ -128,13 +128,13 @@ export class CommonService { var hours = Math.floor(sec_num / 3600); var minutes = Math.floor((sec_num - hours * 3600) / 60); var seconds = sec_num - hours * 3600 - minutes * 60; - var hoursString = ""; - var minutesString = ""; - var secondsString = ""; - hoursString = hours < 10 ? "0" + hours : hours.toString(); - minutesString = minutes < 10 ? "0" + minutes : minutes.toString(); - secondsString = seconds < 10 ? "0" + seconds : seconds.toString(); - return minutesString + ":" + secondsString; + var hoursString = ''; + var minutesString = ''; + var secondsString = ''; + hoursString = hours < 10 ? '0' + hours : hours.toString(); + minutesString = minutes < 10 ? '0' + minutes : minutes.toString(); + secondsString = seconds < 10 ? '0' + seconds : seconds.toString(); + return minutesString + ':' + secondsString; } public toastPK(page: string, key: string) { @@ -144,9 +144,9 @@ export class CommonService { const toast = await this.toastController.create({ message: message, showCloseButton: true, - position: "middle", + position: 'middle', duration: 2000, - closeButtonText: this.ts.trPK("general", "close") + closeButtonText: this.ts.trPK('general', 'close') }); toast.present(); } @@ -155,9 +155,9 @@ export class CommonService { async startLoadingOld() { this.stopLoading(); const loader = await this.loadingController.create({ - spinner: "bubbles", + spinner: 'bubbles', duration: 30000, - message: this.ts.trPK("error", "wait"), + message: this.ts.trPK('error', 'wait'), translucent: true }); this.progressLoaders.push(loader); @@ -170,7 +170,7 @@ export class CommonService { */ this.stopLoading(); this.progressLoadingService.presentLoading( - this.ts.trPK("general", "loading") + this.ts.trPK('general', 'loading') ); } @@ -190,8 +190,8 @@ export class CommonService { onAccept(); } }, - this.ts.trPK("general", "ok"), - this.ts.trPK("general", "alert"), + this.ts.trPK('general', 'ok'), + this.ts.trPK('general', 'alert'), message ); } @@ -199,10 +199,10 @@ export class CommonService { public presentConfirmDialog(message: string, onAccept: any, onCancel?: any) { this.confirmAlertDialog( onAccept, - this.ts.trPK("general", "ok"), + this.ts.trPK('general', 'ok'), onCancel, - this.ts.trPK("general", "cancel"), - this.ts.trPK("general", "confirm"), + this.ts.trPK('general', 'cancel'), + this.ts.trPK('general', 'confirm'), message ); } @@ -210,8 +210,8 @@ export class CommonService { public presentAcceptDialog(message: string, onAccept: any) { this.alertDialog( onAccept, - this.ts.trPK("general", "ok"), - this.ts.trPK("general", "confirm"), + this.ts.trPK('general', 'ok'), + this.ts.trPK('general', 'confirm'), message ); } @@ -221,8 +221,8 @@ export class CommonService { () => { this.back(); }, - this.ts.trPK("general", "ok"), - this.ts.trPK("general", "info"), + this.ts.trPK('general', 'ok'), + this.ts.trPK('general', 'info'), message ); } @@ -230,9 +230,9 @@ export class CommonService { this.openHome(); this.alertDialog( () => {}, - this.ts.trPK("general", "ok"), - this.ts.trPK("general", "info"), - this.ts.trPK("general", "not-allowed") + this.ts.trPK('general', 'ok'), + this.ts.trPK('general', 'info'), + this.ts.trPK('general', 'not-allowed') ); } @@ -243,14 +243,14 @@ export class CommonService { ) { this.alertDialog( onClick, - this.ts.trPK("general", "ok"), - this.ts.trPK("general", "alert"), + this.ts.trPK('general', 'ok'), + this.ts.trPK('general', 'alert'), message ); } public userNeedToReLogin() { - this.presentAcceptDialog(this.ts.trPK("general", "relogin"), () => { + this.presentAcceptDialog(this.ts.trPK('general', 'relogin'), () => { this.sharedService.clearAll(); this.openLogin(); }); @@ -259,9 +259,9 @@ export class CommonService { public showConnectionErrorDialog(onClick: any, okLabel: string) { this.alertDialog( onClick, - this.ts.trPK("general", "ok"), - this.ts.trPK("general", "alert"), - this.ts.trPK("general", "connError") + this.ts.trPK('general', 'ok'), + this.ts.trPK('general', 'alert'), + this.ts.trPK('general', 'connError') ); } @@ -269,15 +269,15 @@ export class CommonService { this.alertDialog( onClick, okLabel, - this.ts.trPK("general", "alert"), - this.ts.trPK("general", "timeout") + this.ts.trPK('general', 'alert'), + this.ts.trPK('general', 'timeout') ); } async JustAlertDialog(acceptLabel: string, message: string) { this.clearAllAlerts(); const alert = await this.alertControllerIonic.create({ - header: this.ts.trPK("general", "info"), + header: this.ts.trPK('general', 'info'), message: message, buttons: [ { @@ -302,13 +302,13 @@ export class CommonService { ) { this.clearAllAlerts(); const alert = await this.alertControllerIonic.create({ - header: this.ts.trPK("general", "confirm"), + header: this.ts.trPK('general', 'confirm'), message: message, buttons: [ { text: cancelLabel, - role: "cancel", - cssClass: "cancel-button", + role: 'cancel', + cssClass: 'cancel-button', handler: () => { if (onCancel) { onCancel(); @@ -341,7 +341,7 @@ export class CommonService { ) { this.clearAllAlerts(); const alert = await this.alertControllerIonic.create({ - header: this.ts.trPK("general", "confirm"), + header: this.ts.trPK('general', 'confirm'), message: message, buttons: [ { @@ -375,7 +375,7 @@ export class CommonService { message: message, buttons: [ { - text:this.ts.trPK("general", "ok"), + text:this.ts.trPK('general', 'ok'), handler: () => { if (onAccept) { onAccept(); @@ -418,13 +418,13 @@ export class CommonService { ) { this.clearAllAlerts(); const alert = await this.alertControllerIonic.create({ - header: this.ts.trPK("general", "confirm"), + header: this.ts.trPK('general', 'confirm'), message: message, buttons: [ { text: cancelLabel, - role: "cancel", - cssClass: "cancelBtn", + role: 'cancel', + cssClass: 'cancelBtn', handler: () => { if (onCancel) { onCancel(); @@ -434,9 +434,9 @@ export class CommonService { }, { text: acceptLabel, - role: "Confirm", + role: 'Confirm', - cssClass: "confirmBtn", + cssClass: 'confirmBtn', handler: () => { @@ -455,7 +455,7 @@ export class CommonService { public clearAllAlerts() { // custom solutions because of async issue - const alerts = document.getElementsByTagName("ion-alert"); + const alerts = document.getElementsByTagName('ion-alert'); for (let i = 0; i < alerts.length; i++) { const alert = alerts[i]; alert.parentNode.removeChild(alert); @@ -463,15 +463,15 @@ export class CommonService { } public getDeviceInfo(): string { - if (this.platform.is("mobile")) { - const os = this.platform.is("ios") ? "Iphone" : "android"; + if (this.platform.is('mobile')) { + const os = this.platform.is('ios') ? 'Iphone' : 'android'; return ( os + - " - " + + ' - ' + this.device.platform + - " - " + + ' - ' + this.device.version + - " , " + + ' , ' + this.device.manufacturer ); } else { @@ -480,19 +480,19 @@ export class CommonService { } public getDeviceType(): string { - if (this.platform.is("mobile")) { + if (this.platform.is('mobile')) { // return "Mobile " + (this.platform.is("ios") ? "Iphone" : "android"); - return (this.platform.is("ios") ? "Iphone" : "android"); + return (this.platform.is('ios') ? 'Iphone' : 'android'); } else { - return "Desktop"; + return 'Desktop'; } } public validResponse(result: Response): boolean { if (result.MessageStatus === 1) { return true; } else if (result.MessageStatus === 2) { - return this.hasData(result["SameClinicApptList"]); + return this.hasData(result['SameClinicApptList']); } return false; } @@ -513,15 +513,15 @@ export class CommonService { } private openBrowserHtml(url, onExit?, onFaild?, onSuccess?) { - const browser = window.open(url, "_blank", "location=no"); - browser.addEventListener("loadstart", () => {}); + const browser = window.open(url, '_blank', 'location=no'); + browser.addEventListener('loadstart', () => {}); - browser.addEventListener("loaderror", () => { + browser.addEventListener('loaderror', () => { if (onFaild) { onFaild(); } }); - browser.addEventListener("loadstop", () => { + browser.addEventListener('loadstop', () => { if (onSuccess) { onSuccess(); } @@ -538,14 +538,14 @@ export class CommonService { this.platform.ready().then(() => { const browser = this.iab.create( url, - "_blank", - "closebuttoncolor=#60686b,hidenavigationbuttons=yes,hideurlbar=yes,zoom=no" + '_blank', + 'closebuttoncolor=#60686b,hidenavigationbuttons=yes,hideurlbar=yes,zoom=no' ); // browser.executeScript(...); // browser.insertCSS(...); - browser.on("loaderror").subscribe(event => { + browser.on('loaderror').subscribe(event => { if (onFaild) { onFaild(); } @@ -561,13 +561,13 @@ export class CommonService { }); */ - browser.on("exit").subscribe(event => { + browser.on('exit').subscribe(event => { if (onExit) { onExit(); } }); - browser.on("loadstart").subscribe(event => { + browser.on('loadstart').subscribe(event => { if (successURLS) { successURLS.forEach((successURL, index) => { if (event.url && event.url.indexOf(successURL) >= 0) { @@ -584,7 +584,7 @@ export class CommonService { } public imageFromBase64(base64: string) { - return "data:image/jpeg;base64," + base64; + return 'data:image/jpeg;base64,' + base64; } public openLocation(lat: number, lng: number) { @@ -593,24 +593,24 @@ export class CommonService { () => {}, err => { // this.failedToOpenMap(); - window.open("https://maps.google.com/?q=" + lat + "," + lng); + window.open('https://maps.google.com/?q=' + lat + ',' + lng); } ); }); } private failedToOpenMap() { - this.presentAlert(this.ts.trPK("error", "map")); + this.presentAlert(this.ts.trPK('error', 'map')); } public localizeTime(date: Date) { if (!(date.getHours() == 0 && date.getMinutes() == 0)) { let h = date.getHours() % 12 || 12; - let hStr = h < 10 ? "0" + h : h; // leading 0 at the left for 1 digit hours + let hStr = h < 10 ? '0' + h : h; // leading 0 at the left for 1 digit hours const m = date.getMinutes(); - let mStr = m < 10 ? "0" + m : m; - return hStr + ":" + mStr + (date.getHours() < 12 ? " AM" : " PM"); + let mStr = m < 10 ? '0' + m : m; + return hStr + ':' + mStr + (date.getHours() < 12 ? ' AM' : ' PM'); } - return ""; + return ''; } public localizeDate(date: Date, time = false) { @@ -619,20 +619,20 @@ export class CommonService { if (lng === TranslatorService.AR) { dateStr = CommonService.months_ar[date.getMonth()] + - " " + + ' ' + date.getDate() + - " " + + ' ' + date.getFullYear(); } else { dateStr = CommonService.months_en[date.getMonth()] + - " " + + ' ' + date.getDate() + - "," + + ',' + date.getFullYear(); } - return time ? dateStr + " " + this.localizeTime(date) : dateStr; + return time ? dateStr + ' ' + this.localizeTime(date) : dateStr; } public localizeMonth(monthIndex) { @@ -664,21 +664,21 @@ export class CommonService { return ( date.getMonth() + 1 + - "/" + + '/' + date .getFullYear() .toString() .substr(2) ); } else { - return "--"; + return '--'; } } public convertISODateToJsonDate(isoDate: string): string { - return "/Date(" + Date.parse(isoDate) + ")/"; + return '/Date(' + Date.parse(isoDate) + ')/'; } public convertDateToJsonDate(date: Date): string { - return "/Date(" + date.getTime() + ")/"; + return '/Date(' + date.getTime() + ')/'; } /* @@ -687,13 +687,13 @@ export class CommonService { */ public convertIsoDateToObject(isoDate: string, isoTime: string): Date { const date = new Date(isoDate); - const parts = isoTime.split(":"); + const parts = isoTime.split(':'); if (this.hasData(parts)) { // remove if numbers start with 0 let hrsStr = parts[0]; let msStr = parts[1]; - hrsStr = hrsStr[0] == "0" ? hrsStr.substr(1) : hrsStr; - msStr = msStr[0] == "0" ? msStr.substr(1) : msStr; + hrsStr = hrsStr[0] == '0' ? hrsStr.substr(1) : hrsStr; + msStr = msStr[0] == '0' ? msStr.substr(1) : msStr; date.setHours(Number(hrsStr)); date.setMinutes(Number(msStr)); } @@ -721,9 +721,9 @@ export class CommonService { public getDateISO(date: Date): string { return ( date.getFullYear().toString() + - "-" + + '-' + this.trailerZero(date.getMonth() + 1) + - "-" + + '-' + this.trailerZero(date.getDate()) ); } @@ -735,19 +735,19 @@ export class CommonService { public getTimeISO(date: Date): string { return ( this.trailerZero(date.getHours()) + - ":" + + ':' + this.trailerZero(date.getMinutes()) + - ":00" + ':00' ); } public getDateTimeISO(date: Date): string { - return this.getDateISO(date) + " " + this.getTimeISO(date); + return this.getDateISO(date) + ' ' + this.getTimeISO(date); } public getDateTimeISOFromString(dateStr: string): string { const date = this.evaluteDateAsObject(dateStr); - return this.getDateTimeISO(date) + " " + this.getTimeISO(date); + return this.getDateTimeISO(date) + ' ' + this.getTimeISO(date); } public getCurrentTimeISO(): string { @@ -756,7 +756,7 @@ export class CommonService { private trailerZero(value: number): string { const str = value.toString(); - return str.length > 1 ? str : "0" + str; + return str.length > 1 ? str : '0' + str; } public hasData(array: any[]): boolean { @@ -780,13 +780,13 @@ export class CommonService { } } } - return startIndex ? message.substring(startIndex, endIndex) : ""; + return startIndex ? message.substring(startIndex, endIndex) : ''; } return null; } public inNumberRange(targetCode: number): boolean { - const minDigit = "0".charCodeAt(0); - const maxDigit = "9".charCodeAt(0); + const minDigit = '0'.charCodeAt(0); + const maxDigit = '9'.charCodeAt(0); return targetCode >= minDigit && targetCode <= maxDigit; } @@ -808,24 +808,24 @@ export class CommonService { title?: string ) { this.smsAlertDialog = await this.alertControllerIonic.create({ - header: title || this.ts.trPK("general", "enter-sms-code"), + header: title || this.ts.trPK('general', 'enter-sms-code'), inputs: [ { - name: "sms", - type: "number", + name: 'sms', + type: 'number', value: smsCode, - placeholder: this.ts.trPK("general", "enter-sms") + placeholder: this.ts.trPK('general', 'enter-sms') } ], buttons: [ { - text: this.ts.trPK("general", "cancel"), - role: "cancel", - cssClass: "cancel-button", + text: this.ts.trPK('general', 'cancel'), + role: 'cancel', + cssClass: 'cancel-button', handler: () => {} }, { - text: this.ts.trPK("general", "ok"), + text: this.ts.trPK('general', 'ok'), handler: data => { onAccept(data.sms); } @@ -928,8 +928,8 @@ export class CommonService { } const dataSets = [ - this.getGraphDataSet(this.ts.trInline(title1), series1, "#d12026"), - this.getGraphDataSet(this.ts.trInline(title2), series2, "#60686b") + this.getGraphDataSet(this.ts.trInline(title1), series1, '#d12026'), + this.getGraphDataSet(this.ts.trInline(title2), series2, '#60686b') ]; return this.getGraphMultiSeries(labels, dataSets); } @@ -945,7 +945,7 @@ export class CommonService { } public isHtml5VideoSupported(): boolean { - const v = document.createElement("video"); + const v = document.createElement('video'); if (v.canPlayType('video/mp4; codecs="avc1.42E01E, mp4a.40.2"')) { return true; } @@ -959,7 +959,7 @@ export class CommonService { } public isCordova(): boolean { - return this.platform.is("cordova"); + return this.platform.is('cordova'); } public pageRevisited(pageName: string): Observable { @@ -970,119 +970,119 @@ export class CommonService { open calls */ public openEitListPage() { - this.nav.navigateForward(["/eit/eit-list"]); + this.nav.navigateForward(['/eit/eit-list']); } public openAddEitPage() { - this.nav.navigateForward(["/eit/add-eit"]); + this.nav.navigateForward(['/eit/add-eit']); } public openConfirmEitPage() { - this.nav.navigateForward(["/eit/confirm-add-eit"]); + this.nav.navigateForward(['/eit/confirm-add-eit']); } public openHome() { - this.nav.navigateRoot(["/home"]); + this.nav.navigateRoot(['/home']); } public openForgotPassword() { - this.nav.navigateForward(["/authentication/forgot"]); + this.nav.navigateForward(['/authentication/forgot']); } public openChangePassword() { - this.nav.navigateForward(["/authentication/changepassowrd"]); + this.nav.navigateForward(['/authentication/changepassowrd']); } public openProfile() { - this.nav.navigateForward(["/profile/home"]); + this.nav.navigateForward(['/profile/home']); } public openAccuralPage() { - this.nav.navigateForward(["/accrual-balances/home"]); + this.nav.navigateForward(['/accrual-balances/home']); } public openEITPage() { - this.nav.navigateForward(["/eit/homepage"]); + this.nav.navigateForward(['/eit/homepage']); } public openMyTeamPage() { - this.nav.navigateForward(["/my-team/home"]); + this.nav.navigateForward(['/my-team/home']); } - public static myTeamDetailUrl =["/my-team/details","/my-team/details-2"] + public static myTeamDetailUrl =['/my-team/details','/my-team/details-2'] public openMyTeamDetails() { - this.alternateNavigate(CommonService.myTeamDetailUrl,"teamDetail-open",true); + this.alternateNavigate(CommonService.myTeamDetailUrl,'teamDetail-open',true); // this.nav.navigateForward(["/my-team/details"]); } public openAbsencePage() { - this.nav.navigateForward(["/absence/home"]); + this.nav.navigateForward(['/absence/home']); } public openSubmitAbsencePage() { - this.nav.navigateForward(["/absence/submit-absence"]); + this.nav.navigateForward(['/absence/submit-absence']); } public openConfirmAbsece() { - this.nav.navigateForward(["/absence/confirm-absence"]); + this.nav.navigateForward(['/absence/confirm-absence']); } public openWorkListAttachViewPage() { - this.nav.navigateForward(["/notification/work-list-attach-view"]); + this.nav.navigateForward(['/notification/work-list-attach-view']); } public openviewAbsenceAttachment() { - this.nav.navigateForward(["/absence/view-attachements"]); + this.nav.navigateForward(['/absence/view-attachements']); } public openNotificationPage() { - this.nav.navigateForward(["/notification/homepage"]); + this.nav.navigateForward(['/notification/homepage']); } public openWorklistMainPage() { - this.nav.navigateForward(["/notification/worklist-main"]); + this.nav.navigateForward(['/notification/worklist-main']); } public openWorklistMainPRPage() { - this.nav.navigateForward(["/notification/worklist-main-PR"]); + this.nav.navigateForward(['/notification/worklist-main-PR']); } public openWorklistMainPOPage() { - this.nav.navigateForward(["/notification/worklist-main-PO"]); + this.nav.navigateForward(['/notification/worklist-main-PO']); } public openWorklistReplacementRollPage() { - this.nav.navigateForward(["/notification/work-list-replacement-roll"]); + this.nav.navigateForward(['/notification/work-list-replacement-roll']); } public openNotificationDetailsPage() { - this.nav.navigateForward(["/notification/work-list-details"]); + this.nav.navigateForward(['/notification/work-list-details']); } public openWorklistHistoryPage() { - this.nav.navigateForward(["/notification/work-list-action-history"]); + this.nav.navigateForward(['/notification/work-list-action-history']); } public openWorklistAttachPage() { - this.nav.navigateForward(["/notification/work-list-attach"]); + this.nav.navigateForward(['/notification/work-list-attach']); } public openWorklistRFCPage() { - this.nav.navigateForward(["/notification/work-list-rfc"]); + this.nav.navigateForward(['/notification/work-list-rfc']); } public openWorklistRollReplacement() { - this.nav.navigateForward(["/notification/work-list-replacement-roll"]); + this.nav.navigateForward(['/notification/work-list-replacement-roll']); } public openItemHistoryPage() { - this.nav.navigateForward(["/notification/item-history-PO"]); + this.nav.navigateForward(['/notification/item-history-PO']); } public openQutationAnalysisPage() { - this.nav.navigateForward(["/notification/qutation-analysis-PO"]); + this.nav.navigateForward(['/notification/qutation-analysis-PO']); } public openWorklistMainMRPage() { - this.nav.navigateForward(["/notification/worklist-main-MR"]); + this.nav.navigateForward(['/notification/worklist-main-MR']); } public openMySpecialistPage() { - this.nav.navigateForward(["/my-specialist/home"]); + this.nav.navigateForward(['/my-specialist/home']); } public openMySubordinatePage() { - this.nav.navigateForward(["/my-subordinate/home"]); + this.nav.navigateForward(['/my-subordinate/home']); } public openChangeImagePage() { - this.nav.navigateForward(["/profile/profileImg"]); + this.nav.navigateForward(['/profile/profileImg']); } public openPayslipPage() { - this.nav.navigateForward(["/payslip/home"]); + this.nav.navigateForward(['/payslip/home']); } public openEarningsPage() { - this.nav.navigateForward(["/payslip/Earnings"]); + this.nav.navigateForward(['/payslip/Earnings']); } public openDeductionsPage() { - this.nav.navigateForward(["/payslip/Deductions"]); + this.nav.navigateForward(['/payslip/Deductions']); } public openConfirmLoginPage() { - this.nav.navigateForward(["/authentication/confirmLogin"]); + this.nav.navigateForward(['/authentication/confirmLogin']); } public reload(url: string, from: string) { - console.log("force reload called from:" + from); + console.log('force reload called from:' + from); // window.location.reload(); location.href = url; } @@ -1106,11 +1106,11 @@ export class CommonService { private alternateNavigate(paths: string[], key: string, root = false) { let url: string; - if (localStorage.getItem(key) === "yes") { - localStorage.setItem(key, "no"); + if (localStorage.getItem(key) === 'yes') { + localStorage.setItem(key, 'no'); url = paths[0]; } else { - localStorage.setItem(key, "yes"); + localStorage.setItem(key, 'yes'); url = paths[1]; } if (root) { @@ -1121,14 +1121,14 @@ export class CommonService { } public openLogin() { - this.nav.navigateRoot(["/authentication/login"]); + this.nav.navigateRoot(['/authentication/login']); } public openUserForgot() { - this.nav.navigateForward(["/authentication/checkuser"]); + this.nav.navigateForward(['/authentication/checkuser']); } public openSMSPage() { - this.nav.navigateForward(["/authentication/smspage"]); + this.nav.navigateForward(['/authentication/smspage']); } public navigateTo(url: string) { @@ -1164,11 +1164,11 @@ export class CommonService { if (state == this.diagnostic.bluetoothState.POWERED_ON) { feedback(); } else { - this.presentAlert(this.ts.trPK("bluetooth", "start")); + this.presentAlert(this.ts.trPK('bluetooth', 'start')); } }) .catch(e => { - this.presentAlert(this.ts.trPK("bluetooth", "start")); + this.presentAlert(this.ts.trPK('bluetooth', 'start')); }); }); } @@ -1198,7 +1198,7 @@ export class CommonService { } for (i = 0; i < list.length; i += 1) { node = list[i]; - if (node.PARENT_MENU_NAME !== "") { + if (node.PARENT_MENU_NAME !== '') { // if you have dangling branches check that map[node.parentId] exists list[map[node.PARENT_MENU_NAME]].children.push(node); } else { @@ -1210,8 +1210,8 @@ export class CommonService { public reverseFormatDate(date) { let FormatedDate; if (date) { - FormatedDate = date.replace(/\//g, "-"); - FormatedDate = FormatedDate.replace(/ 00:00:00/g, ""); + FormatedDate = date.replace(/\//g, '-'); + FormatedDate = FormatedDate.replace(/ 00:00:00/g, ''); } else { FormatedDate = date; } @@ -1220,7 +1220,7 @@ export class CommonService { public formatStandardDate(date) { let FormatedDate; if (date) { - FormatedDate = date.replace(/-/g, "/"); + FormatedDate = date.replace(/-/g, '/'); } else { FormatedDate = date; } @@ -1229,7 +1229,7 @@ export class CommonService { public reverseFormatStandardDate(date) { let FormatedDate; if (date) { - FormatedDate = date.replace(/\//g, "-"); + FormatedDate = date.replace(/\//g, '-'); } else { FormatedDate = date; } @@ -1241,8 +1241,8 @@ export class CommonService { if (date) { date = date.slice(0, 10); - FormatedDate = date.replace(/-/g, "/"); - FormatedDate = FormatedDate + " 00:00:00"; + FormatedDate = date.replace(/-/g, '/'); + FormatedDate = FormatedDate + ' 00:00:00'; } else { FormatedDate = date; } @@ -1254,8 +1254,8 @@ export class CommonService { console.log(date); if (date) { // FormatedDate = date.replace(/-/g, "/"); - FormatedDate = date.split("T")[0]; - FormatedDate = FormatedDate + " 00:00:00"; + FormatedDate = date.split('T')[0]; + FormatedDate = FormatedDate + ' 00:00:00'; console.log(FormatedDate); } else { FormatedDate = date; @@ -1264,12 +1264,12 @@ export class CommonService { } public setUpdateImage (image){ - console.log("setUpdateImage"); + console.log('setUpdateImage'); this.setUpdateImg=image; this.updateImage=true; } public getUpdateImage(){ - console.log("getUpdateImage"); + console.log('getUpdateImage'); const objImg={ img: this.setUpdateImg, status: this.updateImage diff --git a/Mohem/src/app/hmg-common/ui/card-filter/card-filter.component.html b/Mohem/src/app/hmg-common/ui/card-filter/card-filter.component.html new file mode 100644 index 00000000..fb3f1a49 --- /dev/null +++ b/Mohem/src/app/hmg-common/ui/card-filter/card-filter.component.html @@ -0,0 +1,5 @@ +
+
+ {{value}} + {{text}} +
diff --git a/Mohem/src/app/hmg-common/ui/card-filter/card-filter.component.scss b/Mohem/src/app/hmg-common/ui/card-filter/card-filter.component.scss new file mode 100644 index 00000000..0078e779 --- /dev/null +++ b/Mohem/src/app/hmg-common/ui/card-filter/card-filter.component.scss @@ -0,0 +1,32 @@ +.main-container{ + width: 72px; + background-color: white; + padding: 10px; + border-radius: 20px; + height: 70px; + text-align: right; + font-family: WorkSans-Regular; + padding-top: 25px; + box-shadow: 0 0 6px rgba(0,0,0,0.16); + position: relative; +} +.main-container-radius{ + // content: ""; + position: absolute; + width: 30px; + height: 6px; + border-radius: 10px; + background-color: red; + left: 10px; + top: 10px; +} +.number-span{ + font-size: 19px; + display: block; + line-height: 18px; +} + +.text-span{ + font-size: 14px; + color: #888; +} diff --git a/Mohem/src/app/hmg-common/ui/card-filter/card-filter.component.spec.ts b/Mohem/src/app/hmg-common/ui/card-filter/card-filter.component.spec.ts new file mode 100644 index 00000000..37e7805b --- /dev/null +++ b/Mohem/src/app/hmg-common/ui/card-filter/card-filter.component.spec.ts @@ -0,0 +1,27 @@ +import { CUSTOM_ELEMENTS_SCHEMA } from '@angular/core'; +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; + +import { CardFilterComponent } from './card-filter.component'; + +describe('CardFilterComponent', () => { + let component: CardFilterComponent; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [ CardFilterComponent ], + schemas: [CUSTOM_ELEMENTS_SCHEMA], + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(CardFilterComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/Mohem/src/app/hmg-common/ui/card-filter/card-filter.component.ts b/Mohem/src/app/hmg-common/ui/card-filter/card-filter.component.ts new file mode 100644 index 00000000..c414bc98 --- /dev/null +++ b/Mohem/src/app/hmg-common/ui/card-filter/card-filter.component.ts @@ -0,0 +1,18 @@ +import { Component, OnInit, Input } from '@angular/core'; + +@Component({ + selector: 'app-card-filter', + templateUrl: './card-filter.component.html', + styleUrls: ['./card-filter.component.scss'], +}) +export class CardFilterComponent implements OnInit { + @Input() value: number; + @Input() text: string; + @Input() active: boolean; + @Input() color: string; + + constructor() { } + + ngOnInit() {} + +} diff --git a/Mohem/src/app/notification/home/home.component.html b/Mohem/src/app/notification/home/home.component.html index 06bc2bfd..6d53dd47 100644 --- a/Mohem/src/app/notification/home/home.component.html +++ b/Mohem/src/app/notification/home/home.component.html @@ -6,222 +6,68 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - -
{{notificationList.BEGIN_DATE | dateString }}
-
- - -
-
-
- - {{notificationList.SUBJECT}} - - -
+ +
+
+ Open Request Analysis +
+
+

287

+ TOTAL
OPEN REQUEST
+
+ +
+ + + + + + + + + + + + Advanced Search + +
+
+ December 02, 2019 +
+

Missing swipes request for James Bond, Approved by David

- - - - There is no Notification - - - - - - - - - - - - - - - - - - - - - {{ts.trPK('worklist','search')}} - - - - - - - - -
- - {{ts.trPK('worklist','view')}} - - {{ts.trPK('worklist','openNot')}} - {{ts.trPK('worklist','fyi')}} - {{ts.trPK('worklist','toDo')}} - {{ts.trPK('worklist','all')}} - {{ts.trPK('worklist','meNot')}} - - - -
-
- - {{ts.trPK('worklist','searchby')}} - - {{ts.trPK('worklist','from')}} - {{ts.trPK('worklist','subject')}} - {{ts.trPK('worklist','sent')}} - {{ts.trPK('worklist','itemType')}} - {{ts.trPK('worklist','none')}} - - - -
-
- - {{ts.trPK('worklist','sent')}} - - -
-
- - - - -
+
+

Missing swipes request for James Bond, Approved by David

-
- - {{ts.trPK('worklist','search')}} - - {{ts.trPK('general','close')}} +
+

Missing swipes request for James Bond, Approved by David

- - Call details ITG - Call count ITG -
- - - - \ No newline at end of file +
+ \ No newline at end of file diff --git a/Mohem/src/app/notification/home/home.component.scss b/Mohem/src/app/notification/home/home.component.scss index bd5af293..539a65a7 100644 --- a/Mohem/src/app/notification/home/home.component.scss +++ b/Mohem/src/app/notification/home/home.component.scss @@ -216,4 +216,122 @@ ion-input ,ion-datetime{ .emptyItem{ white-space: normal; padding-left: 10%; +} + +///////////////////////////////////////////NEW DESIGN///////////////////////////////////// + +ion-content { + --ion-background-color: whitesmoke; +} +.request-heading { + span { + text-align: center; + display: block; + padding-top: 8px; + font-family: workSans-Regular; + } +} + +.result-graph { + position: relative; + background: white; + margin-right: 20px; + margin-left: 20px; + margin-top: 20px; + padding-bottom: 20px; + border-radius: 20px; + } + .result-text-container { + padding: 0; + margin: 0; + position: absolute; + left: 50%; + top: 50%; + display: block; + text-align: center; + transform: translate(-50%, -50%); + h2 { + font-size: 38px; + font-family: WorkSans-Bold; + margin: 0 auto; + line-height: 36px; + } + span { + width: 125px; + display: block; + margin: 0 auto; + font-size: 12px; + font-family: workSans-Regular; + } + } + .today-graph { + width: 100%; + max-height: 4cm; + } + +// .swiper-container { +// margin: 0 !important; +// width: 100% !important; +// } +.filters-row { + margin-top: 10px; + margin-left: 20px; +} +.work-list-container { + position: relative; + padding-left: 60px; + clear: both; + min-height: 200px; +} +.work-list-container:before{ + content: ""; + position: absolute; + height: 100%; + width: 4px; + left: 30px; + top: 0; + background-color: #dddddd; +} +.search-container{ + float: right; + margin-top: 15px; + background-color: white; + margin-right: 20px; + border-radius: 10px; + padding: 8px; + font-family: WorkSans-Regular; + margin-bottom: 15px; + ion-icon { + margin-right: 3px; + } + span{ + font-size: 12px; + } +} +.date-span { + position: relative; + display: block; + margin-bottom: 10px; +} +.date-span:before{ + content: ""; + position: absolute; + left: -35px; + border-radius: 50%; + width: 15px; + height: 15px; + background-color: #38c9b3; + top: 1px; +} +.date-data{ + background-color: white; + padding: 1px; + border-radius: 20px; + font-family: WorkSans-Regular; + padding-left: 15px; + margin-right: 20px; + margin-bottom: 15px; + p{ + font-size: 14px; + } } \ No newline at end of file diff --git a/Mohem/src/app/notification/home/home.component.ts b/Mohem/src/app/notification/home/home.component.ts index 2a1eb375..e1a727a9 100644 --- a/Mohem/src/app/notification/home/home.component.ts +++ b/Mohem/src/app/notification/home/home.component.ts @@ -1,16 +1,16 @@ -import { Component, OnInit, ViewChild } from "@angular/core"; -import { CommonService } from "src/app/hmg-common/services/common/common.service"; -import { TranslatorService } from "src/app/hmg-common/services/translator/translator.service"; -import { WorkListRequest } from "../models/workListRequest"; -import * as moment from "moment"; -import { WorKListResponse } from "../models/workListResponse"; -import { WorklistService } from "../service/worklist.service"; +import { Component, OnInit, ViewChild } from '@angular/core'; +import { CommonService } from 'src/app/hmg-common/services/common/common.service'; +import { TranslatorService } from 'src/app/hmg-common/services/translator/translator.service'; +import { WorkListRequest } from '../models/workListRequest'; +import * as moment from 'moment'; +import { WorKListResponse } from '../models/workListResponse'; +import { WorklistService } from '../service/worklist.service'; import { IonInfiniteScroll } from '@ionic/angular'; import { WorklistMainService } from '../service/work-list.main.service'; @Component({ - selector: "app-home", - templateUrl: "./home.component.html", - styleUrls: ["./home.component.scss"] + selector: 'app-home', + templateUrl: './home.component.html', + styleUrls: ['./home.component.scss'] }) export class HomeComponent implements OnInit { // @ViewChild(Navbar) navBar: Navbar; @@ -19,16 +19,16 @@ export class HomeComponent implements OnInit { @ViewChild(IonInfiniteScroll) infiniteScroll: IonInfiniteScroll; private WorkListObj: WorkListRequest; WorkListResObj: any; //WorKListResponse; - notificationType: string = "1"; + notificationType: string = '1'; pageNum: number = 1; rowsNo: number; noOfrows: number; - selectedValue: string = ""; - FromUserName: string = ""; - ItemKeyDisplayName: string = ""; - SentDate: string = ""; - Subject: string = ""; - inputSearch: string = ""; + selectedValue: string = ''; + FromUserName: string = ''; + ItemKeyDisplayName: string = ''; + SentDate: string = ''; + Subject: string = ''; + inputSearch: string = ''; HideDateInput: boolean = false; HideTextInput: boolean = false; InputDate: string; @@ -43,26 +43,103 @@ export class HomeComponent implements OnInit { public isITG: boolean = false; public isSearch: boolean = false; public direction = 'ltr'; - constructor( + + + + + public options = { + cutoutPercentage: 80, + tooltips: { enabled: false }, + legend: { display: false } + }; + + public data = { + datasets: [ + { + data: [120, 30, 30, 30, 50], + backgroundColor: [ + '#1fa269', + '#cb3232', + '#124375', + '#3dcab3', + '#3cb9d5' + ], + borderWidth: 5 + }] + }; + + public filters = [ + { + value: 287, + text: 'All', + active: true, + color: '#124375' + }, + { + value: 200, + text: 'HR', + active: false, + color: '#18a169' + }, + { + value: 10, + text: 'PO', + active: false, + color: '#38c9b3' + }, + { + value: 15, + text: 'PR', + active: false, + color: '#114475' + }, + { + value: 50, + text: 'MR', + active: false, + color: '#3cb9d5' + }, + { + value: 12, + text: 'ITG', + active: false, + color: '#cc3232' + } + ]; + + public slideOptsOne = { + slidesPerView: 4.3, + spaceBetween: 10 + }; + + + +constructor( public common: CommonService, public ts: TranslatorService, public WorklistService: WorklistService, public workListService: WorklistMainService, ) { this.WorkListObj = new WorkListRequest(); - this.WorkListObj.P_NOTIFICATION_TYPE = "1"; - this.WorkListObj.P_SEARCH_FROM_USER = ""; - this.WorkListObj.P_SEARCH_SUBJECT = ""; - this.WorkListObj.P_SEARCH_SENT_DATE = ""; - this.WorkListObj.P_SEARCH_ITEM_TYPE_DSP_NAME = ""; + this.WorkListObj.P_NOTIFICATION_TYPE = '1'; + this.WorkListObj.P_SEARCH_FROM_USER = ''; + this.WorkListObj.P_SEARCH_SUBJECT = ''; + this.WorkListObj.P_SEARCH_SENT_DATE = ''; + this.WorkListObj.P_SEARCH_ITEM_TYPE_DSP_NAME = ''; this.WorkListObj.P_PAGE_NUM = 0; this.WorkListObj.P_PAGE_LIMIT = 50; //number } - ngOnInit() { - this.direction = TranslatorService.getCurrentDirection(); + activeFilter(index: number) { + for (const filter of this.filters) { + filter.active = false; + } + this.filters[index].active = true; + } +ngOnInit() { + // this.direction = TranslatorService.getCurrentDirection(); } - ionViewDidLoad() { +ionViewDidLoad() { // this.navBar.backButtonClick = () => { // // you can set a full custom history here if you want // let pages = [ @@ -74,62 +151,62 @@ export class HomeComponent implements OnInit { // }; } - ionViewWillEnter() { - this.getAllPushNotificationFun(); +ionViewWillEnter() { + // this.getAllPushNotificationFun(); } - getValueSelected(Value) { +getValueSelected(Value) { this.selectedValue = Value.detail.value; - if (this.selectedValue == "1") { + if (this.selectedValue == '1') { this.HideDateInput = false; this.HideTextInput = true; - } else if (this.selectedValue == "2") { + } else if (this.selectedValue == '2') { this.HideDateInput = false; this.HideTextInput = true; - } else if (this.selectedValue == "3") { + } else if (this.selectedValue == '3') { this.HideDateInput = true; this.HideTextInput = false; - } else if (this.selectedValue == "4") { + } else if (this.selectedValue == '4') { this.HideDateInput = false; this.HideTextInput = true; - } else if (this.selectedValue == "5") { + } else if (this.selectedValue == '5') { this.HideDateInput = false; this.HideTextInput = false; } } - getAllPushNotificationFun() { +getAllPushNotificationFun() { this.WorkListObj.P_PAGE_NUM = 1; this.IsReachEnd = false; - if (this.selectedValue == "1") { + if (this.selectedValue == '1') { this.WorkListObj.P_SEARCH_FROM_USER = this.inputSearch; - this.WorkListObj.P_SEARCH_ITEM_TYPE_DSP_NAME = ""; - this.WorkListObj.P_SEARCH_SENT_DATE = ""; - this.WorkListObj.P_SEARCH_SUBJECT = ""; - } else if (this.selectedValue == "2") { - this.WorkListObj.P_SEARCH_FROM_USER = ""; - this.WorkListObj.P_SEARCH_ITEM_TYPE_DSP_NAME = ""; - this.WorkListObj.P_SEARCH_SENT_DATE = ""; + this.WorkListObj.P_SEARCH_ITEM_TYPE_DSP_NAME = ''; + this.WorkListObj.P_SEARCH_SENT_DATE = ''; + this.WorkListObj.P_SEARCH_SUBJECT = ''; + } else if (this.selectedValue == '2') { + this.WorkListObj.P_SEARCH_FROM_USER = ''; + this.WorkListObj.P_SEARCH_ITEM_TYPE_DSP_NAME = ''; + this.WorkListObj.P_SEARCH_SENT_DATE = ''; this.WorkListObj.P_SEARCH_SUBJECT = this.inputSearch; - } else if (this.selectedValue == "3") { - this.WorkListObj.P_SEARCH_FROM_USER = ""; - this.WorkListObj.P_SEARCH_ITEM_TYPE_DSP_NAME = ""; + } else if (this.selectedValue == '3') { + this.WorkListObj.P_SEARCH_FROM_USER = ''; + this.WorkListObj.P_SEARCH_ITEM_TYPE_DSP_NAME = ''; if (this.InputDate) this.WorkListObj.P_SEARCH_SENT_DATE = moment(this.InputDate).format( - "DD-MMM-YYYY" + 'DD-MMM-YYYY' ); - else this.WorkListObj.P_SEARCH_SENT_DATE = ""; - this.WorkListObj.P_SEARCH_SUBJECT = ""; - } else if (this.selectedValue == "4") { - this.WorkListObj.P_SEARCH_FROM_USER = ""; + else this.WorkListObj.P_SEARCH_SENT_DATE = ''; + this.WorkListObj.P_SEARCH_SUBJECT = ''; + } else if (this.selectedValue == '4') { + this.WorkListObj.P_SEARCH_FROM_USER = ''; this.WorkListObj.P_SEARCH_ITEM_TYPE_DSP_NAME = this.inputSearch; - this.WorkListObj.P_SEARCH_SENT_DATE = ""; - this.WorkListObj.P_SEARCH_SUBJECT = ""; - } else if (this.selectedValue == "5") { - this.WorkListObj.P_SEARCH_FROM_USER = ""; - this.WorkListObj.P_SEARCH_ITEM_TYPE_DSP_NAME = ""; - this.WorkListObj.P_SEARCH_SENT_DATE = ""; - this.WorkListObj.P_SEARCH_SUBJECT = ""; + this.WorkListObj.P_SEARCH_SENT_DATE = ''; + this.WorkListObj.P_SEARCH_SUBJECT = ''; + } else if (this.selectedValue == '5') { + this.WorkListObj.P_SEARCH_FROM_USER = ''; + this.WorkListObj.P_SEARCH_ITEM_TYPE_DSP_NAME = ''; + this.WorkListObj.P_SEARCH_SENT_DATE = ''; + this.WorkListObj.P_SEARCH_SUBJECT = ''; } this.WorklistService.getWorkList(this.WorkListObj).subscribe( @@ -163,17 +240,17 @@ export class HomeComponent implements OnInit { } } - openNotificationDetail(obj) { +openNotificationDetail(obj) { console.log(obj); this.common.sharedService.setSharedData(obj, HomeComponent.NOTIFICATION_DATA); //this.common.openWorklistMainPage(); - if(obj.REQUEST_TYPE == "PR"){ + if(obj.REQUEST_TYPE == 'PR'){ this.common.openWorklistMainPRPage(); } - else if(obj.REQUEST_TYPE == "PO"){ + else if(obj.REQUEST_TYPE == 'PO'){ this.common.openWorklistMainPOPage(); } - else if(obj.REQUEST_TYPE == "MO"){ + else if(obj.REQUEST_TYPE == 'MO'){ this.common.openWorklistMainMRPage(); } @@ -184,11 +261,11 @@ export class HomeComponent implements OnInit { //this.navCtrl.push("WorkListMainPage", { passNotificationList: obj }); } - onChangeView(selectedValue: any) { +onChangeView(selectedValue: any) { this.WorkListObj.P_NOTIFICATION_TYPE = selectedValue.detail.value; } - doInfinite(infiniteScroll) { +doInfinite(infiniteScroll) { //this.pageNum= this.pageNum + 1; if (!this.IsReachEnd) { @@ -219,19 +296,19 @@ export class HomeComponent implements OnInit { } } //end infiniteScroll - Count() { +Count() { this.workListService.getITGCount() .subscribe((result: any) => { - console.log("ENAD ITG COUNT:") + console.log('ENAD ITG COUNT:') console.log(result); }); } - filterNotificationByRequestType(reqType) { +filterNotificationByRequestType(reqType) { let filterdType = []; - if (reqType == "All") { + if (reqType == 'All') { this.filteredNotificationList = this.WorkListResObj; - if (this.filteredNotificationList == [] || this.filteredNotificationList == null || this.filteredNotificationList == "") { + if (this.filteredNotificationList == [] || this.filteredNotificationList == null || this.filteredNotificationList == '') { this.noData = true; return false; } else { @@ -240,8 +317,8 @@ export class HomeComponent implements OnInit { } } for (let i = 0; i < this.WorkListResObj.length; i++) { - if(reqType=="HR"){ - if ("EIT" == this.WorkListResObj[i].REQUEST_TYPE || "ABSENCE" == this.WorkListResObj[i].REQUEST_TYPE) { + if(reqType=='HR'){ + if ('EIT' == this.WorkListResObj[i].REQUEST_TYPE || 'ABSENCE' == this.WorkListResObj[i].REQUEST_TYPE) { filterdType.push(this.WorkListResObj[i]); } }else{ @@ -253,7 +330,7 @@ export class HomeComponent implements OnInit { } this.filteredNotificationList = filterdType; - if (this.filteredNotificationList == [] || this.filteredNotificationList == null || this.filteredNotificationList == "") { + if (this.filteredNotificationList == [] || this.filteredNotificationList == null || this.filteredNotificationList == '') { this.noData = true; return false; } else { @@ -262,17 +339,17 @@ export class HomeComponent implements OnInit { } } - Details() { +Details() { this.workListService.getITGDetails() .subscribe((result: any) => { - console.log("ENAD ITG Details:") + console.log('ENAD ITG Details:') console.log(result); }); } - AllNotification() { - this.filterNotificationByRequestType("All"); +AllNotification() { + this.filterNotificationByRequestType('All'); this.isAll = true; this.isPR = false; this.isPO = false; @@ -280,8 +357,8 @@ export class HomeComponent implements OnInit { this.isHR = false; this.isITG = false; } - PRNotification() { - this.filterNotificationByRequestType("PR"); +PRNotification() { + this.filterNotificationByRequestType('PR'); this.isAll = false; this.isPR = true; this.isPO = false; @@ -289,8 +366,8 @@ export class HomeComponent implements OnInit { this.isHR = false; this.isITG = false; } - PONotification() { - this.filterNotificationByRequestType("PO"); +PONotification() { + this.filterNotificationByRequestType('PO'); this.isAll = false; this.isPR = false; this.isPO = true; @@ -299,8 +376,8 @@ export class HomeComponent implements OnInit { this.isITG = false; } - MRNotification() { - this.filterNotificationByRequestType("MO"); +MRNotification() { + this.filterNotificationByRequestType('MO'); this.isAll = false; this.isPR = false; this.isPO = false; @@ -308,8 +385,8 @@ export class HomeComponent implements OnInit { this.isHR = false; this.isITG = false; } - HRNotification() { - this.filterNotificationByRequestType("HR"); +HRNotification() { + this.filterNotificationByRequestType('HR'); this.isAll = false; this.isPR = false; this.isPO = false; @@ -317,7 +394,7 @@ export class HomeComponent implements OnInit { this.isHR = true; this.isITG = false; } - ITGNotification() { +ITGNotification() { // this.Details(); this.isAll = false; this.isPR = false; @@ -327,7 +404,7 @@ export class HomeComponent implements OnInit { this.isITG = true; } - searchBtn() { +searchBtn() { this.isSearch = !this.isSearch; } diff --git a/Mohem/src/app/notification/notification.module.ts b/Mohem/src/app/notification/notification.module.ts index df9194f2..b6c8b46f 100644 --- a/Mohem/src/app/notification/notification.module.ts +++ b/Mohem/src/app/notification/notification.module.ts @@ -43,8 +43,8 @@ const routes: Routes = [ component: WorkListAttachViewComponent }, { - path:'worklist-main', - component:WorklistMainComponent + path: 'worklist-main', + component: WorklistMainComponent }, { path: 'work-list-replacement-roll', @@ -76,28 +76,28 @@ const routes: Routes = [ }, { - path:'worklist-main-PR', - component:WorklistMainPRComponent + path: 'worklist-main-PR', + component: WorklistMainPRComponent }, { - path:'apply-action-modal', - component:ApplyActionModalComponent + path: 'apply-action-modal', + component: ApplyActionModalComponent }, { - path:'worklist-main-PO', - component:WorklistMainPoComponent + path: 'worklist-main-PO', + component: WorklistMainPoComponent }, { - path:'item-history-PO', - component:ItemHistoryComponent + path: 'item-history-PO', + component: ItemHistoryComponent }, { - path:'qutation-analysis-PO', - component:QutationAnalysisComponent + path: 'qutation-analysis-PO', + component: QutationAnalysisComponent }, { - path:'worklist-main-MR', - component:WorklistMainMRComponent + path: 'worklist-main-MR', + component: WorklistMainMRComponent } ] } @@ -131,6 +131,6 @@ const routes: Routes = [ WorklistMainMRComponent // WorklistMainComponent ], - providers:[WorklistService,WorklistMainService, WorklistAttachService] + providers: [WorklistService, WorklistMainService, WorklistAttachService] }) export class NotificationPageModule {} diff --git a/Mohem/src/global.scss b/Mohem/src/global.scss index 4421a600..853e8ce7 100644 --- a/Mohem/src/global.scss +++ b/Mohem/src/global.scss @@ -9,5 +9,8 @@ @import '~@ionic/angular/css/text-alignment.css'; @import '~@ionic/angular/css/text-transformation.css'; @import '~@ionic/angular/css/flex-utils.css'; +@import "../node_modules/primeng/resources/themes/nova-light/theme.css"; +@import "../node_modules/primeng/resources/primeng.min.css"; +@import "../node_modules/primeicons/primeicons.css"; @import "theme/styles.scss"; @import "theme/worklist.scss"; diff --git a/Mohem/src/theme/styles.scss b/Mohem/src/theme/styles.scss index c0368be8..fb248299 100644 --- a/Mohem/src/theme/styles.scss +++ b/Mohem/src/theme/styles.scss @@ -925,3 +925,10 @@ border:0px // left: 0; // width: 100%; // +// .filters-row { +// margin-left:-15px; +// margin-right:-15px; +// } +// .filters-row .swiper-container .swiper-wrapper .swiper-slide:first-child { +// margin-left:32px; +// } \ No newline at end of file From 86e96c11d09ac21722b71b4105b8634903932a73 Mon Sep 17 00:00:00 2001 From: umasoodch Date: Sun, 2 Feb 2020 14:59:15 +0300 Subject: [PATCH 2/7] added search modal and its CSS --- .../app/notification/home/home.component.html | 4 +- .../app/notification/home/home.component.ts | 37 ++++++++++++++ .../app/notification/notification.module.ts | 8 +++- .../worklist-advanced-search.component.html | 48 +++++++++++++++++++ .../worklist-advanced-search.component.scss | 40 ++++++++++++++++ ...worklist-advanced-search.component.spec.ts | 27 +++++++++++ .../worklist-advanced-search.component.ts | 30 ++++++++++++ Mohem/src/theme/styles.scss | 8 +++- 8 files changed, 198 insertions(+), 4 deletions(-) create mode 100644 Mohem/src/app/notification/worklist-advanced-search/worklist-advanced-search.component.html create mode 100644 Mohem/src/app/notification/worklist-advanced-search/worklist-advanced-search.component.scss create mode 100644 Mohem/src/app/notification/worklist-advanced-search/worklist-advanced-search.component.spec.ts create mode 100644 Mohem/src/app/notification/worklist-advanced-search/worklist-advanced-search.component.ts diff --git a/Mohem/src/app/notification/home/home.component.html b/Mohem/src/app/notification/home/home.component.html index 6d53dd47..4ef7e9fe 100644 --- a/Mohem/src/app/notification/home/home.component.html +++ b/Mohem/src/app/notification/home/home.component.html @@ -32,7 +32,7 @@ - + Advanced Search @@ -70,4 +70,4 @@
-
\ No newline at end of file + diff --git a/Mohem/src/app/notification/home/home.component.ts b/Mohem/src/app/notification/home/home.component.ts index e1a727a9..43931002 100644 --- a/Mohem/src/app/notification/home/home.component.ts +++ b/Mohem/src/app/notification/home/home.component.ts @@ -1,4 +1,5 @@ import { Component, OnInit, ViewChild } from '@angular/core'; +import { ModalController } from '@ionic/angular'; import { CommonService } from 'src/app/hmg-common/services/common/common.service'; import { TranslatorService } from 'src/app/hmg-common/services/translator/translator.service'; import { WorkListRequest } from '../models/workListRequest'; @@ -7,6 +8,7 @@ import { WorKListResponse } from '../models/workListResponse'; import { WorklistService } from '../service/worklist.service'; import { IonInfiniteScroll } from '@ionic/angular'; import { WorklistMainService } from '../service/work-list.main.service'; +import { WorklistAdvancedSearchComponent } from '../worklist-advanced-search/worklist-advanced-search.component'; @Component({ selector: 'app-home', templateUrl: './home.component.html', @@ -119,6 +121,7 @@ constructor( public ts: TranslatorService, public WorklistService: WorklistService, public workListService: WorklistMainService, + public modalController: ModalController ) { this.WorkListObj = new WorkListRequest(); this.WorkListObj.P_NOTIFICATION_TYPE = '1'; @@ -136,6 +139,40 @@ constructor( } this.filters[index].active = true; } + + + async openSearchModal() { + console.log('umar786'); + const modal = await this.modalController.create({ + component: WorklistAdvancedSearchComponent, + cssClass: 'advanced-search-modal', + componentProps: { + // dateFrom : this.dateFrom, + // dateTo : this.dateTo + } + }); + modal.onDidDismiss().then(result => { + // console.log(result.data); + // this.loadMore = false; + // this.rightIconActive = false; + // this.leftIconActive = false; + // this.dayHoursData = []; + // this.timeCardSummaryData = []; + // this.dayAndHoursPageNumber = 1; + // this.loadMoreDateHoursData = false; + // this.dateFrom = result.data.dateFrom; + // this.dateTo = result.data.dateTo; + // this.selectedFilters = result.data.keySelectedFilters; + // this.selectedShiftFilter = result.data.selectedShiftType; + // if (this.dateFrom && this.dateTo) { + // this.getDayHoursTypeDetails(); + // this.getTimeCardSummaryDetails(); + // } + }); + return await modal.present(); + } + + ngOnInit() { // this.direction = TranslatorService.getCurrentDirection(); } diff --git a/Mohem/src/app/notification/notification.module.ts b/Mohem/src/app/notification/notification.module.ts index b6c8b46f..1897987e 100644 --- a/Mohem/src/app/notification/notification.module.ts +++ b/Mohem/src/app/notification/notification.module.ts @@ -25,6 +25,8 @@ import { WorklistMainPoComponent } from './worklist-main-po/worklist-main-po.com import { ItemHistoryComponent } from './item-history/item-history.component'; import { QutationAnalysisComponent } from './qutation-analysis/qutation-analysis.component'; import { WorklistMainMRComponent } from './worklist-main-mr/worklist-main-mr.component'; +import { WorklistAdvancedSearchComponent } from './worklist-advanced-search/worklist-advanced-search.component'; + // import { WorklistMainComponent } from './worklist-main/worklist-main.component'; @@ -128,9 +130,13 @@ const routes: Routes = [ WorklistMainPoComponent, ItemHistoryComponent, QutationAnalysisComponent, - WorklistMainMRComponent + WorklistMainMRComponent, + WorklistAdvancedSearchComponent // WorklistMainComponent ], + entryComponents: [ + WorklistAdvancedSearchComponent + ], providers: [WorklistService, WorklistMainService, WorklistAttachService] }) export class NotificationPageModule {} diff --git a/Mohem/src/app/notification/worklist-advanced-search/worklist-advanced-search.component.html b/Mohem/src/app/notification/worklist-advanced-search/worklist-advanced-search.component.html new file mode 100644 index 00000000..326b1e2f --- /dev/null +++ b/Mohem/src/app/notification/worklist-advanced-search/worklist-advanced-search.component.html @@ -0,0 +1,48 @@ +
+

Advanced Search

+ +
+ + +
+ + {{ts.trPK('worklist','view')}} + + {{ts.trPK('worklist','openNot')}} + {{ts.trPK('worklist','fyi')}} + {{ts.trPK('worklist','toDo')}} + {{ts.trPK('worklist','all')}} + {{ts.trPK('worklist','meNot')}} + + + + + {{ts.trPK('worklist','searchby')}} + + {{ts.trPK('worklist','from')}} + {{ts.trPK('worklist','subject')}} + {{ts.trPK('worklist','sent')}} + {{ts.trPK('worklist','itemType')}} + {{ts.trPK('worklist','none')}} + + + + + Request Type + + {{ts.trPK('worklist','from')}} + {{ts.trPK('worklist','subject')}} + {{ts.trPK('worklist','sent')}} + {{ts.trPK('worklist','itemType')}} + {{ts.trPK('worklist','none')}} + + + +
+ SEARCH +
+
+ \ No newline at end of file diff --git a/Mohem/src/app/notification/worklist-advanced-search/worklist-advanced-search.component.scss b/Mohem/src/app/notification/worklist-advanced-search/worklist-advanced-search.component.scss new file mode 100644 index 00000000..36f26405 --- /dev/null +++ b/Mohem/src/app/notification/worklist-advanced-search/worklist-advanced-search.component.scss @@ -0,0 +1,40 @@ +.search-header{ + display: inline-block; + h2 { + display: inline-block; + margin-left: 20px; + font-family: WorkSans-Regular; + font-size: 18px; + margin-top: 12px; + } + ion-icon { + display: inline-block; + font-size: 23px; + position: absolute; + right: 15px; + top: 8px; + } +} +.search-container { + margin-right: 15px; + margin-left: 15px; + padding-bottom: 100px; + margin-top: 5px; + ion-item{ + border: 2px solid #eaeaea; + border-radius: 25px; + margin-bottom: 20px; + } +} +.search-button{ + background: #3dcab3; + height: 50px; + text-align: center; + font-family: WorkSans-Regular; + border-radius: 22px; + margin-top: 20px; + line-height: 50px; + span{ + color: white; + } +} \ No newline at end of file diff --git a/Mohem/src/app/notification/worklist-advanced-search/worklist-advanced-search.component.spec.ts b/Mohem/src/app/notification/worklist-advanced-search/worklist-advanced-search.component.spec.ts new file mode 100644 index 00000000..5ea13f34 --- /dev/null +++ b/Mohem/src/app/notification/worklist-advanced-search/worklist-advanced-search.component.spec.ts @@ -0,0 +1,27 @@ +import { CUSTOM_ELEMENTS_SCHEMA } from '@angular/core'; +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; + +import { WorklistAdvancedSearchComponent } from './worklist-advanced-search.component'; + +describe('WorklistAdvancedSearchComponent', () => { + let component: WorklistAdvancedSearchComponent; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [ WorklistAdvancedSearchComponent ], + schemas: [CUSTOM_ELEMENTS_SCHEMA], + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(WorklistAdvancedSearchComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/Mohem/src/app/notification/worklist-advanced-search/worklist-advanced-search.component.ts b/Mohem/src/app/notification/worklist-advanced-search/worklist-advanced-search.component.ts new file mode 100644 index 00000000..7e60f280 --- /dev/null +++ b/Mohem/src/app/notification/worklist-advanced-search/worklist-advanced-search.component.ts @@ -0,0 +1,30 @@ +import { Component, OnInit } from '@angular/core'; +import { ModalController } from '@ionic/angular'; +import { TranslatorService } from 'src/app/hmg-common/services/translator/translator.service'; + +@Component({ + selector: 'app-worklist-advanced-search', + templateUrl: './worklist-advanced-search.component.html', + styleUrls: ['./worklist-advanced-search.component.scss'], +}) +export class WorklistAdvancedSearchComponent implements OnInit { + + constructor( + public modalController: ModalController, + public ts: TranslatorService + ) { } + + ngOnInit() {} + + public dismissModal() { + console.log('umar 545'); + this.modalController.dismiss({ + // dismissed: true, + // keySelectedFilters: selectedFilters, + // selectedShiftType: this.selectedShiftType, + // dateFrom: this.dateFrom, + // dateTo: this.dateTo + }); + } + +} diff --git a/Mohem/src/theme/styles.scss b/Mohem/src/theme/styles.scss index fb248299..0c58e3cc 100644 --- a/Mohem/src/theme/styles.scss +++ b/Mohem/src/theme/styles.scss @@ -931,4 +931,10 @@ border:0px // } // .filters-row .swiper-container .swiper-wrapper .swiper-slide:first-child { // margin-left:32px; -// } \ No newline at end of file +// } + +.advanced-search-modal { + --height: 9cm !important; + --width: 88% !important; + --border-radius: 0.6cm; +} \ No newline at end of file From d2fac5c4d5237882b05093ae4ba3504be94746c6 Mon Sep 17 00:00:00 2001 From: umasoodch Date: Sun, 2 Feb 2020 17:34:28 +0300 Subject: [PATCH 3/7] added header for worklist --- .../services/common/common.service.ts | 4 ++ Mohem/src/app/home/home.page.html | 3 +- Mohem/src/app/home/home.page.scss | 4 -- Mohem/src/app/home/home.page.ts | 20 ++++++-- .../app/notification/home/home.component.html | 18 ++++++- .../app/notification/home/home.component.scss | 47 +++++++++++++++++-- .../app/notification/home/home.component.ts | 14 ++++-- Mohem/src/theme/styles.scss | 6 ++- 8 files changed, 97 insertions(+), 19 deletions(-) diff --git a/Mohem/src/app/hmg-common/services/common/common.service.ts b/Mohem/src/app/hmg-common/services/common/common.service.ts index aa478363..c3a631e3 100644 --- a/Mohem/src/app/hmg-common/services/common/common.service.ts +++ b/Mohem/src/app/hmg-common/services/common/common.service.ts @@ -1106,6 +1106,10 @@ public getMonthNameAr(value: number): string { public openMyTeamPage() { this.nav.navigateForward(['/my-team/home']); } + + public openPage(link: string) { + this.nav.navigateForward([link]); + } public static myTeamDetailUrl =['/my-team/details','/my-team/details-2'] public openMyTeamDetails() { this.alternateNavigate(CommonService.myTeamDetailUrl,'teamDetail-open',true); diff --git a/Mohem/src/app/home/home.page.html b/Mohem/src/app/home/home.page.html index ab687c35..17f22142 100644 --- a/Mohem/src/app/home/home.page.html +++ b/Mohem/src/app/home/home.page.html @@ -16,7 +16,8 @@ + [icon]="button.icon" + (click)="openStatsButton(button.link)"> diff --git a/Mohem/src/app/home/home.page.scss b/Mohem/src/app/home/home.page.scss index 8143cf6e..c803673d 100644 --- a/Mohem/src/app/home/home.page.scss +++ b/Mohem/src/app/home/home.page.scss @@ -39,10 +39,6 @@ ion-label{ position: relative; width: 100%; } -.header-md:after { - height: 0px !important; - display: none !important; -} .contentBg:before { position: absolute; content: ""; diff --git a/Mohem/src/app/home/home.page.ts b/Mohem/src/app/home/home.page.ts index 95e58003..6640f864 100644 --- a/Mohem/src/app/home/home.page.ts +++ b/Mohem/src/app/home/home.page.ts @@ -57,27 +57,32 @@ export class HomePage implements OnInit { { title: 'Work List', statsValue: 0, - icon: 'assets/icon/new-design/work_list.png' + icon: 'assets/icon/new-design/work_list.png', + link: '/notification/homepage' }, { title: 'Pending Request', statsValue: 13, - icon: 'assets/icon/new-design/pending_request.png' + icon: 'assets/icon/new-design/pending_request.png', + link: '' }, { title: 'Missing Swipes', statsValue: 0, - icon: 'assets/icon/new-design/missing_swipe.png' + icon: 'assets/icon/new-design/missing_swipe.png', + link: '' }, { title: 'Leave Balance', statsValue: 0, - icon: 'assets/icon/new-design/leave_balance.png' + icon: 'assets/icon/new-design/leave_balance.png', + link: '' }, { title: 'Ticket Balance', statsValue: 0, - icon: 'assets/icon/new-design/ticket_balance.png' + icon: 'assets/icon/new-design/ticket_balance.png', + link: '' } ]; @@ -596,6 +601,11 @@ export class HomePage implements OnInit { this.common.openProfile(); } + openStatsButton(link: string) { + console.log(link); + this.common.openPage(link); + } + } diff --git a/Mohem/src/app/notification/home/home.component.html b/Mohem/src/app/notification/home/home.component.html index 4ef7e9fe..90fe6d91 100644 --- a/Mohem/src/app/notification/home/home.component.html +++ b/Mohem/src/app/notification/home/home.component.html @@ -1,12 +1,27 @@ - + + + + + + + + WORK LIST +
+ +
+
+ + +
Open Request Analysis @@ -70,4 +85,5 @@
+
diff --git a/Mohem/src/app/notification/home/home.component.scss b/Mohem/src/app/notification/home/home.component.scss index 539a65a7..bf3c4f8d 100644 --- a/Mohem/src/app/notification/home/home.component.scss +++ b/Mohem/src/app/notification/home/home.component.scss @@ -220,6 +220,43 @@ ion-input ,ion-datetime{ ///////////////////////////////////////////NEW DESIGN///////////////////////////////////// + +.header-toolbar-new{ + --background: #22c6b3; +} +.profile-image-container{ + position: relative; + z-index: 999; + img { + width: 32px; + float: right; + border-radius: 20px; + height: 32px; + margin-right: 10px; + } +} +ion-title{ + color: white; + position: absolute; + top: 0; + text-align: center; + left: 15%; + right: 15%; + font-size: 0.42cm; + font-weight: bold; + height: 100%; +} + +.contentBg:before { + position: absolute; + content: ""; + background: #22c6b3; + height: 140px; + width: 100%; + left: 0; + top: 0px; + z-index: 1; +} ion-content { --ion-background-color: whitesmoke; } @@ -240,6 +277,7 @@ ion-content { margin-top: 20px; padding-bottom: 20px; border-radius: 20px; + z-index: 1; } .result-text-container { padding: 0; @@ -269,10 +307,10 @@ ion-content { max-height: 4cm; } -// .swiper-container { -// margin: 0 !important; -// width: 100% !important; -// } + .swiper-container { + margin: 0 !important; + width: 100% !important; + } .filters-row { margin-top: 10px; margin-left: 20px; @@ -282,6 +320,7 @@ ion-content { padding-left: 60px; clear: both; min-height: 200px; + margin-bottom: 80px; } .work-list-container:before{ content: ""; diff --git a/Mohem/src/app/notification/home/home.component.ts b/Mohem/src/app/notification/home/home.component.ts index 43931002..046c5062 100644 --- a/Mohem/src/app/notification/home/home.component.ts +++ b/Mohem/src/app/notification/home/home.component.ts @@ -9,6 +9,8 @@ import { WorklistService } from '../service/worklist.service'; import { IonInfiniteScroll } from '@ionic/angular'; import { WorklistMainService } from '../service/work-list.main.service'; import { WorklistAdvancedSearchComponent } from '../worklist-advanced-search/worklist-advanced-search.component'; +import { AuthenticatedUser } from 'src/app/hmg-common/services/authentication/models/authenticated-user'; + @Component({ selector: 'app-home', templateUrl: './home.component.html', @@ -46,9 +48,6 @@ export class HomeComponent implements OnInit { public isSearch: boolean = false; public direction = 'ltr'; - - - public options = { cutoutPercentage: 80, tooltips: { enabled: false }, @@ -133,6 +132,10 @@ constructor( this.WorkListObj.P_PAGE_LIMIT = 50; //number } + public userData: any; + public userImage: any = '../assets/imgs/profile.png'; + + activeFilter(index: number) { for (const filter of this.filters) { filter.active = false; @@ -140,6 +143,9 @@ constructor( this.filters[index].active = true; } + openProfilePage() { + this.common.openProfile(); + } async openSearchModal() { console.log('umar786'); @@ -175,6 +181,8 @@ constructor( ngOnInit() { // this.direction = TranslatorService.getCurrentDirection(); + this.userData = this.common.sharedService.getSharedData(AuthenticatedUser.SHARED_DATA, false); + this.userImage = this.userData.EMPLOYEE_IMAGE ? 'data:image/png;base64,' + this.userData.EMPLOYEE_IMAGE : this.userImage; } ionViewDidLoad() { // this.navBar.backButtonClick = () => { diff --git a/Mohem/src/theme/styles.scss b/Mohem/src/theme/styles.scss index 755291de..efa3a30c 100644 --- a/Mohem/src/theme/styles.scss +++ b/Mohem/src/theme/styles.scss @@ -994,6 +994,10 @@ border:0px } .alert-button-inner.sc-ion-alert-md { - justify-content: center !important; } + +.header-md:after { + height: 0px !important; + display: none !important; +} From 9177721b593183028ae4aeb8adfdf5724444e4ea Mon Sep 17 00:00:00 2001 From: umasoodch Date: Sun, 9 Feb 2020 10:47:50 +0300 Subject: [PATCH 4/7] completed worklist task --- Mohem/package.json | 2 +- Mohem/src/app/home/home.page.ts | 1 + .../app/notification/home/home.component.html | 74 +- .../app/notification/home/home.component.scss | 41 +- .../app/notification/home/home.component.ts | 758 ++++++++++-------- .../worklist-advanced-search.component.html | 53 +- .../worklist-advanced-search.component.ts | 46 +- 7 files changed, 545 insertions(+), 430 deletions(-) diff --git a/Mohem/package.json b/Mohem/package.json index e6035f45..8c9be676 100755 --- a/Mohem/package.json +++ b/Mohem/package.json @@ -200,4 +200,4 @@ "android" ] } -} +} \ No newline at end of file diff --git a/Mohem/src/app/home/home.page.ts b/Mohem/src/app/home/home.page.ts index 6640f864..aa52e5a3 100644 --- a/Mohem/src/app/home/home.page.ts +++ b/Mohem/src/app/home/home.page.ts @@ -521,6 +521,7 @@ export class HomePage implements OnInit { if (this.common.validResponse(result)) { const key = 'P_OPEN_NTF_NUMBER'; this.statsButtons[0].statsValue = result[key]; + this.common.sharedService.setSharedData(result, 'worklistNotifications'); } }); } diff --git a/Mohem/src/app/notification/home/home.component.html b/Mohem/src/app/notification/home/home.component.html index 90fe6d91..09f904d0 100644 --- a/Mohem/src/app/notification/home/home.component.html +++ b/Mohem/src/app/notification/home/home.component.html @@ -1,21 +1,12 @@ - - WORK LIST -
+ @@ -27,7 +18,7 @@ Open Request Analysis
-

287

+

{{totalRequestCount}}

TOTAL
OPEN REQUEST
@@ -38,7 +29,7 @@ - - - Advanced Search + + + Clear Search + + + + + Advanced Search + + -
-
- December 02, 2019 -
-

Missing swipes request for James Bond, Approved by David

-
-
-

Missing swipes request for James Bond, Approved by David

-
-
-

Missing swipes request for James Bond, Approved by David

-
-
-

Missing swipes request for James Bond, Approved by David

-
-
- -
- December 02, 2019 -
-

Missing swipes request for James Bond, Approved by David

-
-
-

Missing swipes request for James Bond, Approved by David

-
-
-

Missing swipes request for James Bond, Approved by David

-
-
-

Missing swipes request for James Bond, Approved by David

+
+
+ {{data.key}} +
+

{{workList.SUBJECT}}

+
+ No Data Available +
+ + + + + + diff --git a/Mohem/src/app/notification/home/home.component.scss b/Mohem/src/app/notification/home/home.component.scss index bf3c4f8d..0686c9fa 100644 --- a/Mohem/src/app/notification/home/home.component.scss +++ b/Mohem/src/app/notification/home/home.component.scss @@ -321,6 +321,7 @@ ion-content { clear: both; min-height: 200px; margin-bottom: 80px; + padding-top: 15px; } .work-list-container:before{ content: ""; @@ -328,23 +329,28 @@ ion-content { height: 100%; width: 4px; left: 30px; - top: 0; + top: 15px; background-color: #dddddd; } .search-container{ - float: right; margin-top: 15px; - background-color: white; - margin-right: 20px; - border-radius: 10px; - padding: 8px; - font-family: WorkSans-Regular; - margin-bottom: 15px; - ion-icon { - margin-right: 3px; - } - span{ - font-size: 12px; + display: block; + padding: 0 20px; + ion-col{ + background: white; + border-radius: 12px; + padding-right: 10px; + flex: none; + ion-icon{ + margin-right: 3px; + font-size: 14px; + margin-left: 3px; + vertical-align: middle; + } + span{ + font-size: 12px; + vertical-align: middle; + } } } .date-span { @@ -373,4 +379,13 @@ ion-content { p{ font-size: 14px; } +} +.no-data-available { + background: white; + font-family: WorkSans-Regular; + padding: 30px; + position: absolute; + left: 50%; + margin-left: -100px; + margin-top: 100px; } \ No newline at end of file diff --git a/Mohem/src/app/notification/home/home.component.ts b/Mohem/src/app/notification/home/home.component.ts index 046c5062..a8fa91a7 100644 --- a/Mohem/src/app/notification/home/home.component.ts +++ b/Mohem/src/app/notification/home/home.component.ts @@ -10,6 +10,7 @@ import { IonInfiniteScroll } from '@ionic/angular'; import { WorklistMainService } from '../service/work-list.main.service'; import { WorklistAdvancedSearchComponent } from '../worklist-advanced-search/worklist-advanced-search.component'; import { AuthenticatedUser } from 'src/app/hmg-common/services/authentication/models/authenticated-user'; +import { DatePipe } from '@angular/common'; @Component({ selector: 'app-home', @@ -17,130 +18,178 @@ import { AuthenticatedUser } from 'src/app/hmg-common/services/authentication/mo styleUrls: ['./home.component.scss'] }) export class HomeComponent implements OnInit { - // @ViewChild(Navbar) navBar: Navbar; public static NOTIFICATION_DATA = 'notification_data'; public static NOTIFICATION_ARR = 'notification_arr'; @ViewChild(IonInfiniteScroll) infiniteScroll: IonInfiniteScroll; private WorkListObj: WorkListRequest; - WorkListResObj: any; //WorKListResponse; - notificationType: string = '1'; - pageNum: number = 1; + WorkListResObj: any; + notificationType = '1'; + pageNum = 1; rowsNo: number; noOfrows: number; - selectedValue: string = ''; - FromUserName: string = ''; - ItemKeyDisplayName: string = ''; - SentDate: string = ''; - Subject: string = ''; - inputSearch: string = ''; - HideDateInput: boolean = false; - HideTextInput: boolean = false; - InputDate: string; + selectedValue = ''; + FromUserName = ''; + ItemKeyDisplayName = ''; + SentDate = ''; + Subject = ''; + inputSearch = ''; + // HideDateInput = false; + // HideTextInput = false; + inputDate: string; filteredNotificationList: any; - IsReachEnd: boolean = false; - public noData: boolean = false; - public isAll: boolean = true; - public isPR: boolean = false; - public isPO: boolean = false; - public isMR: boolean = false; - public isHR: boolean = false; - public isITG: boolean = false; - public isSearch: boolean = false; + IsReachEnd = false; + public noData = false; + public isAll = true; + public isPR = false; + public isPO = false; + public isMR = false; + public isHR = false; + public isITG = false; + public isSearch = false; public direction = 'ltr'; - + ///// New ///////////// + public currentActiveIndex = 0; + public previousActiveIndex = 0; + public worklistNotifications: any; + public totalRequestCount = 0; + public newWorkListResponse = []; + public allFormattedData = {}; + public showFormattedData = {}; + public selectedFilter = 'ALL'; + public showSearchButton = false; public options = { cutoutPercentage: 80, tooltips: { enabled: false }, legend: { display: false } }; - public data = { datasets: [ { - data: [120, 30, 30, 30, 50], + data: [0, 0, 0, 0, 0], backgroundColor: [ - '#1fa269', - '#cb3232', - '#124375', - '#3dcab3', - '#3cb9d5' + '#18a169', + '#38c9b3', + '#114475', + '#3cb9d5', + '#cc3232' ], borderWidth: 5 }] - }; - - public filters = [ - { - value: 287, - text: 'All', - active: true, - color: '#124375' - }, - { - value: 200, - text: 'HR', - active: false, - color: '#18a169' - }, - { - value: 10, - text: 'PO', - active: false, - color: '#38c9b3' - }, - { - value: 15, - text: 'PR', - active: false, - color: '#114475' - }, - { - value: 50, - text: 'MR', - active: false, - color: '#3cb9d5' - }, - { - value: 12, - text: 'ITG', - active: false, - color: '#cc3232' - } - ]; - + }; + public filters = [ + { + value: 0, + name: 'All', + active: true, + color: '#124375', + key: 'ALL' + }, + { + value: 0, + name: 'HR', + active: false, + color: '#18a169', + key: 'HRSSA' + }, + { + value: 0, + name: 'PO', + active: false, + color: '#38c9b3', + key: 'POAPPRV' + }, + { + value: 0, + name: 'PR', + active: false, + color: '#114475', + key: 'REQAPPRV' + }, + { + value: 0, + name: 'MR', + active: false, + color: '#3cb9d5', + key: 'INVMOA' + }, + { + value: 0, + name: 'ITG', + active: false, + color: '#cc3232', + key: 'ITG' + } + ]; public slideOptsOne = { slidesPerView: 4.3, spaceBetween: 10 }; - - - -constructor( - public common: CommonService, - public ts: TranslatorService, - public WorklistService: WorklistService, - public workListService: WorklistMainService, - public modalController: ModalController - ) { - this.WorkListObj = new WorkListRequest(); - this.WorkListObj.P_NOTIFICATION_TYPE = '1'; - this.WorkListObj.P_SEARCH_FROM_USER = ''; - this.WorkListObj.P_SEARCH_SUBJECT = ''; - this.WorkListObj.P_SEARCH_SENT_DATE = ''; - this.WorkListObj.P_SEARCH_ITEM_TYPE_DSP_NAME = ''; - this.WorkListObj.P_PAGE_NUM = 0; - this.WorkListObj.P_PAGE_LIMIT = 50; //number + constructor( + public common: CommonService, + public ts: TranslatorService, + public WorklistService: WorklistService, + public workListService: WorklistMainService, + public modalController: ModalController + ) { + this.WorkListObj = new WorkListRequest(); + this.WorkListObj.P_NOTIFICATION_TYPE = '1'; + this.WorkListObj.P_SEARCH_FROM_USER = ''; + this.WorkListObj.P_SEARCH_SUBJECT = ''; + this.WorkListObj.P_SEARCH_SENT_DATE = ''; + this.WorkListObj.P_SEARCH_ITEM_TYPE_DSP_NAME = ''; + this.WorkListObj.P_PAGE_NUM = 0; + this.WorkListObj.P_PAGE_LIMIT = 50; } - public userData: any; - public userImage: any = '../assets/imgs/profile.png'; + ngOnInit() { + // this.direction = TranslatorService.getCurrentDirection(); + this.worklistNotifications = this.common.sharedService.getSharedData('worklistNotifications', false); + this.totalRequestCount = this.worklistNotifications.P_OPEN_NTF_NUMBER; + this.assignDataToFilters(); + this.getAllPushNotificationFun(); + } + assignDataToFilters() { + this.filters[0].value = this.worklistNotifications.P_OPEN_NTF_NUMBER; + const openNotificationsArray = this.worklistNotifications.GetOpenNotificationsList; + for (const notification of openNotificationsArray) { + if (notification.ITEM_TYPE === 'HRSSA') { + this.filters[1].value = notification.OPEN_NTF_NUMBER; + this.data.datasets[0].data[0] = notification.OPEN_NTF_NUMBER; + } else if (notification.ITEM_TYPE === 'POAPPRV') { + this.filters[2].value = notification.OPEN_NTF_NUMBER; + this.data.datasets[0].data[1] = notification.OPEN_NTF_NUMBER; + } else if (notification.ITEM_TYPE === 'REQAPPRV') { + this.filters[3].value = notification.OPEN_NTF_NUMBER; + this.data.datasets[0].data[2] = notification.OPEN_NTF_NUMBER; + } else if (notification.ITEM_TYPE === 'INVMOA') { + this.filters[4].value = notification.OPEN_NTF_NUMBER; + this.data.datasets[0].data[3] = notification.OPEN_NTF_NUMBER; + } + } + } + + getFilteredData(filter: string) { + if(filter === 'ALL') { + this.showFormattedData = this.allFormattedData; + } else { + let arrayToFilter; + arrayToFilter = this.newWorkListResponse.filter((workList) => { + return workList.ITEM_TYPE === filter; + }); + this.showFormattedData = this.categorizeData(arrayToFilter); + } + } activeFilter(index: number) { - for (const filter of this.filters) { - filter.active = false; - } - this.filters[index].active = true; + this.showFormattedData = {}; + this.previousActiveIndex = this.currentActiveIndex; + this.currentActiveIndex = index; + this.filters[this.previousActiveIndex].active = false; + this.filters[this.currentActiveIndex].active = true; + + this.selectedFilter = this.filters[this.currentActiveIndex].key; + this.getFilteredData(this.selectedFilter); } openProfilePage() { @@ -148,211 +197,247 @@ constructor( } async openSearchModal() { - console.log('umar786'); const modal = await this.modalController.create({ component: WorklistAdvancedSearchComponent, cssClass: 'advanced-search-modal', - componentProps: { - // dateFrom : this.dateFrom, - // dateTo : this.dateTo - } + backdropDismiss: false, + componentProps: {} }); modal.onDidDismiss().then(result => { - // console.log(result.data); - // this.loadMore = false; - // this.rightIconActive = false; - // this.leftIconActive = false; - // this.dayHoursData = []; - // this.timeCardSummaryData = []; - // this.dayAndHoursPageNumber = 1; - // this.loadMoreDateHoursData = false; - // this.dateFrom = result.data.dateFrom; - // this.dateTo = result.data.dateTo; - // this.selectedFilters = result.data.keySelectedFilters; - // this.selectedShiftFilter = result.data.selectedShiftType; - // if (this.dateFrom && this.dateTo) { - // this.getDayHoursTypeDetails(); - // this.getTimeCardSummaryDetails(); - // } + console.log(result.data); + if(result.data){ + if(result.data.notificationType !== '' || result.data.selectedValue){ + this.showSearchButton = true; + this.notificationType = result.data.notificationType; + this.selectedValue = result.data.selectedValue; + this.inputDate = result.data.inputDate; + this.inputSearch = result.data.inputSearch; + this.WorkListObj.P_PAGE_NUM = 1; + this.newWorkListResponse = []; + this.allFormattedData = {}; + this.showFormattedData = {}; + this.selectedFilter = 'ALL'; + this.filters[this.currentActiveIndex].active = false; + this.currentActiveIndex = 0; + this.previousActiveIndex = 0; + this.filters[this.currentActiveIndex].active = true; + this.getAllPushNotificationFun(); + } + } + }); return await modal.present(); } - -ngOnInit() { - // this.direction = TranslatorService.getCurrentDirection(); - this.userData = this.common.sharedService.getSharedData(AuthenticatedUser.SHARED_DATA, false); - this.userImage = this.userData.EMPLOYEE_IMAGE ? 'data:image/png;base64,' + this.userData.EMPLOYEE_IMAGE : this.userImage; - } -ionViewDidLoad() { - // this.navBar.backButtonClick = () => { - // // you can set a full custom history here if you want - // let pages = [ - // { - // page: "HomePage" - // } - // ]; - // this.navCtrl.setPages(pages); - // }; + ionViewDidLoad() { + // this.navBar.backButtonClick = () => { + // // you can set a full custom history here if you want + // let pages = [ + // { + // page: "HomePage" + // } + // ]; + // this.navCtrl.setPages(pages); + // }; } -ionViewWillEnter() { - // this.getAllPushNotificationFun(); - } -getValueSelected(Value) { - this.selectedValue = Value.detail.value; - if (this.selectedValue == '1') { - this.HideDateInput = false; - this.HideTextInput = true; - } else if (this.selectedValue == '2') { - this.HideDateInput = false; - this.HideTextInput = true; - } else if (this.selectedValue == '3') { - this.HideDateInput = true; - this.HideTextInput = false; - } else if (this.selectedValue == '4') { - this.HideDateInput = false; - this.HideTextInput = true; - } else if (this.selectedValue == '5') { - this.HideDateInput = false; - this.HideTextInput = false; - } + ionViewWillEnter() { + // this.getAllPushNotificationFun(); //filter with item type } -getAllPushNotificationFun() { - this.WorkListObj.P_PAGE_NUM = 1; - this.IsReachEnd = false; + getAllPushNotificationFun() { + this.WorkListObj.P_PAGE_NUM = 1; + this.IsReachEnd = false; + + if (this.selectedValue === '1') { + this.WorkListObj.P_SEARCH_FROM_USER = this.inputSearch; + this.WorkListObj.P_SEARCH_ITEM_TYPE_DSP_NAME = ''; + this.WorkListObj.P_SEARCH_SENT_DATE = ''; + this.WorkListObj.P_SEARCH_SUBJECT = ''; + } else if (this.selectedValue === '2') { + this.WorkListObj.P_SEARCH_FROM_USER = ''; + this.WorkListObj.P_SEARCH_ITEM_TYPE_DSP_NAME = ''; + this.WorkListObj.P_SEARCH_SENT_DATE = ''; + this.WorkListObj.P_SEARCH_SUBJECT = this.inputSearch; + } else if (this.selectedValue === '3') { + this.WorkListObj.P_SEARCH_FROM_USER = ''; + this.WorkListObj.P_SEARCH_ITEM_TYPE_DSP_NAME = ''; + if (this.inputDate) { + this.WorkListObj.P_SEARCH_SENT_DATE = moment(this.inputDate).format( + 'DD-MMM-YYYY' + ); + } else { this.WorkListObj.P_SEARCH_SENT_DATE = ''; } + this.WorkListObj.P_SEARCH_SUBJECT = ''; + } else if (this.selectedValue === '4') { + this.WorkListObj.P_SEARCH_FROM_USER = ''; + this.WorkListObj.P_SEARCH_ITEM_TYPE_DSP_NAME = this.inputSearch; + this.WorkListObj.P_SEARCH_SENT_DATE = ''; + this.WorkListObj.P_SEARCH_SUBJECT = ''; + } else if (this.selectedValue === '5') { + this.WorkListObj.P_SEARCH_FROM_USER = ''; + this.WorkListObj.P_SEARCH_ITEM_TYPE_DSP_NAME = ''; + this.WorkListObj.P_SEARCH_SENT_DATE = ''; + this.WorkListObj.P_SEARCH_SUBJECT = ''; + } - if (this.selectedValue == '1') { - this.WorkListObj.P_SEARCH_FROM_USER = this.inputSearch; - this.WorkListObj.P_SEARCH_ITEM_TYPE_DSP_NAME = ''; - this.WorkListObj.P_SEARCH_SENT_DATE = ''; - this.WorkListObj.P_SEARCH_SUBJECT = ''; - } else if (this.selectedValue == '2') { - this.WorkListObj.P_SEARCH_FROM_USER = ''; - this.WorkListObj.P_SEARCH_ITEM_TYPE_DSP_NAME = ''; - this.WorkListObj.P_SEARCH_SENT_DATE = ''; - this.WorkListObj.P_SEARCH_SUBJECT = this.inputSearch; - } else if (this.selectedValue == '3') { - this.WorkListObj.P_SEARCH_FROM_USER = ''; - this.WorkListObj.P_SEARCH_ITEM_TYPE_DSP_NAME = ''; - if (this.InputDate) - this.WorkListObj.P_SEARCH_SENT_DATE = moment(this.InputDate).format( - 'DD-MMM-YYYY' - ); - else this.WorkListObj.P_SEARCH_SENT_DATE = ''; - this.WorkListObj.P_SEARCH_SUBJECT = ''; - } else if (this.selectedValue == '4') { - this.WorkListObj.P_SEARCH_FROM_USER = ''; - this.WorkListObj.P_SEARCH_ITEM_TYPE_DSP_NAME = this.inputSearch; - this.WorkListObj.P_SEARCH_SENT_DATE = ''; - this.WorkListObj.P_SEARCH_SUBJECT = ''; - } else if (this.selectedValue == '5') { - this.WorkListObj.P_SEARCH_FROM_USER = ''; - this.WorkListObj.P_SEARCH_ITEM_TYPE_DSP_NAME = ''; - this.WorkListObj.P_SEARCH_SENT_DATE = ''; - this.WorkListObj.P_SEARCH_SUBJECT = ''; - } + this.WorklistService.getWorkList(this.WorkListObj).subscribe((result) => { + if (this.common.validResponse(result)) { + this.handleWorkListResult(result.GetWorkList); + } + } + ); + } - this.WorklistService.getWorkList(this.WorkListObj).subscribe( - (result: WorKListResponse) => { - this.handleWorkListResult(result); + categorizeData(arrayToCategorize: any) { + const datePipe = new DatePipe('en-US'); + let formattedData = {}; + for (const workList of arrayToCategorize) { + workList.FORMATTED_DATE = datePipe.transform(new Date(workList.BEGIN_DATE), 'MMMM dd, y'); + if (!(workList.FORMATTED_DATE in formattedData)) { + formattedData[workList.FORMATTED_DATE] = new Array(); + formattedData[workList.FORMATTED_DATE].push(workList); + } else { + formattedData[workList.FORMATTED_DATE].push(workList); + } } + return formattedData; + } + + sortArray(arrayToSort: any) { + return arrayToSort.sort((a: any, b: any) => + new Date(b.BEGIN_DATE).getTime() - new Date(a.BEGIN_DATE).getTime() ); - } //End getNotifications - - private handleWorkListResult(result) { - if (this.common.validResponse(result)) { - // this.sharedData.setSharedData(result, WorKListResponse.SHARED_DATA); - if (this.common.hasData(result.GetWorkList)) { - this.WorkListObj.P_PAGE_NUM++; - this.WorkListResObj = result.GetWorkList; - this.filteredNotificationList = this.WorkListResObj; - this.common.sharedService.setSharedData(this.WorkListResObj, HomeComponent.NOTIFICATION_ARR); - let lastItemIndex = this.WorkListResObj.length - 1; - if (result.GetWorkList[lastItemIndex]) { - let lastitem = result.GetWorkList[lastItemIndex]; - if (lastitem.NO_OF_ROWS == lastitem.ROW_NUM) { - this.IsReachEnd = true; - } else { - this.IsReachEnd = false; - } - // this.navCtrl.push('SmsAuthenticatePage'); - } + } + + private handleWorkListResult(result: any) { + const lastItemIndex = result.length - 1; + const lastitem = result[lastItemIndex]; + if (lastitem) { + if (lastitem.NO_OF_ROWS === lastitem.ROW_NUM) { + this.IsReachEnd = true; + this.infiniteScroll.complete(); } else { - this.WorkListResObj = []; + this.IsReachEnd = false; + this.infiniteScroll.complete(); } } + if (this.common.hasData(result)) { + this.WorkListObj.P_PAGE_NUM++; + if(this.newWorkListResponse.length === 0) { + this.newWorkListResponse = result; + } else { + this.newWorkListResponse = this.newWorkListResponse.concat(result); + } + this.newWorkListResponse = this.sortArray(this.newWorkListResponse); + console.log(this.newWorkListResponse); + this.allFormattedData = this.categorizeData(this.newWorkListResponse); + this.showFormattedData = this.allFormattedData; + this.common.sharedService.setSharedData(this.newWorkListResponse, HomeComponent.NOTIFICATION_ARR); + } else { + this.newWorkListResponse = []; + } } -openNotificationDetail(obj) { - console.log(obj); - this.common.sharedService.setSharedData(obj, HomeComponent.NOTIFICATION_DATA); - //this.common.openWorklistMainPage(); - if(obj.REQUEST_TYPE == 'PR'){ - this.common.openWorklistMainPRPage(); - } - else if(obj.REQUEST_TYPE == 'PO'){ - this.common.openWorklistMainPOPage(); + openNotificationDetail(obj) { + console.log(obj); + this.common.sharedService.setSharedData(obj, HomeComponent.NOTIFICATION_DATA); + // this.common.openWorklistMainPage(); + if(obj.REQUEST_TYPE == 'PR'){ + this.common.openWorklistMainPRPage(); } - else if(obj.REQUEST_TYPE == 'MO'){ - this.common.openWorklistMainMRPage(); + else if(obj.REQUEST_TYPE == 'PO'){ + this.common.openWorklistMainPOPage(); + } + else if(obj.REQUEST_TYPE == 'MO'){ + this.common.openWorklistMainMRPage(); + } + + else{ + this.common.openWorklistMainPage(); + } - - else{ - this.common.openWorklistMainPage(); - } + // this.navCtrl.push("WorkListMainPage", { passNotificationList: obj }); + } - //this.navCtrl.push("WorkListMainPage", { passNotificationList: obj }); + isEmptyObject() { + return (this.showFormattedData && (Object.keys(this.showFormattedData).length > 0)); } -onChangeView(selectedValue: any) { - this.WorkListObj.P_NOTIFICATION_TYPE = selectedValue.detail.value; + + clearSearch() { + this.showSearchButton = false; + this.notificationType = ''; + this.selectedValue = ''; + this.inputDate = ''; + this.inputSearch = ''; + this.WorkListObj.P_PAGE_NUM = 1; + this.newWorkListResponse = []; + this.allFormattedData = {}; + this.showFormattedData = {}; + this.selectedFilter = 'ALL'; + this.filters[this.currentActiveIndex].active = false; + this.currentActiveIndex = 0; + this.previousActiveIndex = 0; + this.filters[this.currentActiveIndex].active = true; + this.WorkListObj.P_SEARCH_FROM_USER = ''; + this.WorkListObj.P_SEARCH_ITEM_TYPE_DSP_NAME = ''; + this.WorkListObj.P_SEARCH_SENT_DATE = ''; + this.WorkListObj.P_SEARCH_SUBJECT = ''; + this.getAllPushNotificationFun(); } -doInfinite(infiniteScroll) { - //this.pageNum= this.pageNum + 1; + onChangeView(selectedValue: any) { + this.WorkListObj.P_NOTIFICATION_TYPE = selectedValue.detail.value; + } - if (!this.IsReachEnd) { - this.WorklistService.getWorkList(this.WorkListObj).subscribe( - (result: any) => { + doInfinite(infiniteScroll) { + if (!this.IsReachEnd && this.selectedFilter === 'ALL') { + this.WorklistService.getWorkList(this.WorkListObj).subscribe((result) => { if (this.common.validResponse(result)) { - this.WorkListObj.P_PAGE_NUM++; - if (this.common.hasData(result.GetWorkList)) { - result.GetWorkList.forEach(element => { - if (element.ROW_NUM == element.NO_OF_ROWS) { - this.IsReachEnd = true; - } else { - this.IsReachEnd = false; - } - this.WorkListResObj.push(element); - }); - } // if list length >0 - else { - this.IsReachEnd = true; - } - } // if response == 1 - //this.pageNum++; + this.handleWorkListResult(result.GetWorkList); + } + }); + } else { + if (this.infiniteScroll && this.selectedFilter === 'ALL') { this.infiniteScroll.complete(); } - ); - } else { - if (this.infiniteScroll) this.infiniteScroll.complete(); - } - } //end infiniteScroll - -Count() { - this.workListService.getITGCount() - .subscribe((result: any) => { - console.log('ENAD ITG COUNT:') - console.log(result); - }); + } + } + + Count() { + this.workListService.getITGCount() + .subscribe((result: any) => { + console.log('ENAD ITG COUNT:') + console.log(result); + }); } -filterNotificationByRequestType(reqType) { - let filterdType = []; - if (reqType == 'All') { - this.filteredNotificationList = this.WorkListResObj; + filterNotificationByRequestType(reqType) { + let filterdType = []; + if (reqType == 'All') { + this.filteredNotificationList = this.WorkListResObj; + if (this.filteredNotificationList == [] || this.filteredNotificationList == null || this.filteredNotificationList == '') { + this.noData = true; + return false; + } else { + this.noData = false; + return false; + } + } + for (let i = 0; i < this.WorkListResObj.length; i++) { + if(reqType=='HR'){ + if ('EIT' == this.WorkListResObj[i].REQUEST_TYPE || 'ABSENCE' == this.WorkListResObj[i].REQUEST_TYPE) { + filterdType.push(this.WorkListResObj[i]); + } + }else{ + if (reqType == this.WorkListResObj[i].REQUEST_TYPE) { + filterdType.push(this.WorkListResObj[i]); + } + } + + } + + this.filteredNotificationList = filterdType; if (this.filteredNotificationList == [] || this.filteredNotificationList == null || this.filteredNotificationList == '') { this.noData = true; return false; @@ -360,99 +445,78 @@ filterNotificationByRequestType(reqType) { this.noData = false; return false; } - } - for (let i = 0; i < this.WorkListResObj.length; i++) { - if(reqType=='HR'){ - if ('EIT' == this.WorkListResObj[i].REQUEST_TYPE || 'ABSENCE' == this.WorkListResObj[i].REQUEST_TYPE) { - filterdType.push(this.WorkListResObj[i]); - } - }else{ - if (reqType == this.WorkListResObj[i].REQUEST_TYPE) { - filterdType.push(this.WorkListResObj[i]); - } - } - - } - - this.filteredNotificationList = filterdType; - if (this.filteredNotificationList == [] || this.filteredNotificationList == null || this.filteredNotificationList == '') { - this.noData = true; - return false; - } else { - this.noData = false; - return false; - } } -Details() { - this.workListService.getITGDetails() - .subscribe((result: any) => { - console.log('ENAD ITG Details:') - console.log(result); - }); + Details() { + this.workListService.getITGDetails() + .subscribe((result: any) => { + console.log('ENAD ITG Details:') + console.log(result); + }); } - -AllNotification() { - this.filterNotificationByRequestType('All'); - this.isAll = true; - this.isPR = false; - this.isPO = false; - this.isMR = false; - this.isHR = false; - this.isITG = false; - } -PRNotification() { - this.filterNotificationByRequestType('PR'); - this.isAll = false; - this.isPR = true; - this.isPO = false; - this.isMR = false; - this.isHR = false; - this.isITG = false; + AllNotification() { + this.filterNotificationByRequestType('All'); + this.isAll = true; + this.isPR = false; + this.isPO = false; + this.isMR = false; + this.isHR = false; + this.isITG = false; } -PONotification() { - this.filterNotificationByRequestType('PO'); - this.isAll = false; - this.isPR = false; - this.isPO = true; - this.isMR = false; - this.isHR = false; - this.isITG = false; + PRNotification() { + this.filterNotificationByRequestType('PR'); + this.isAll = false; + this.isPR = true; + this.isPO = false; + this.isMR = false; + this.isHR = false; + this.isITG = false; } -MRNotification() { - this.filterNotificationByRequestType('MO'); - this.isAll = false; - this.isPR = false; - this.isPO = false; - this.isMR = true; - this.isHR = false; - this.isITG = false; - } -HRNotification() { - this.filterNotificationByRequestType('HR'); - this.isAll = false; - this.isPR = false; - this.isPO = false; - this.isMR = false; - this.isHR = true; - this.isITG = false; + + PONotification() { + this.filterNotificationByRequestType('PO'); + this.isAll = false; + this.isPR = false; + this.isPO = true; + this.isMR = false; + this.isHR = false; + this.isITG = false; + } -ITGNotification() { - // this.Details(); - this.isAll = false; - this.isPR = false; - this.isPO = false; - this.isMR = false; - this.isHR = false; - this.isITG = true; + + MRNotification() { + this.filterNotificationByRequestType('MO'); + this.isAll = false; + this.isPR = false; + this.isPO = false; + this.isMR = true; + this.isHR = false; + this.isITG = false; } -searchBtn() { - this.isSearch = !this.isSearch; + HRNotification() { + this.filterNotificationByRequestType('HR'); + this.isAll = false; + this.isPR = false; + this.isPO = false; + this.isMR = false; + this.isHR = true; + this.isITG = false; } - + ITGNotification() { + // this.Details(); + this.isAll = false; + this.isPR = false; + this.isPO = false; + this.isMR = false; + this.isHR = false; + this.isITG = true; + } + searchBtn() { + this.isSearch = !this.isSearch; + } } diff --git a/Mohem/src/app/notification/worklist-advanced-search/worklist-advanced-search.component.html b/Mohem/src/app/notification/worklist-advanced-search/worklist-advanced-search.component.html index 326b1e2f..b02442bf 100644 --- a/Mohem/src/app/notification/worklist-advanced-search/worklist-advanced-search.component.html +++ b/Mohem/src/app/notification/worklist-advanced-search/worklist-advanced-search.component.html @@ -1,4 +1,5 @@ -
+ +

Advanced Search

@@ -8,8 +9,8 @@ {{ts.trPK('worklist','view')}} - {{ts.trPK('worklist','openNot')}} + (ionChange)=onChangeView($event)> + {{ts.trPK('worklist','openNot')}} {{ts.trPK('worklist','fyi')}} {{ts.trPK('worklist','toDo')}} {{ts.trPK('worklist','all')}} @@ -17,10 +18,10 @@ - + {{ts.trPK('worklist','searchby')}} + (ionChange)="getValueSelected($event)"> {{ts.trPK('worklist','from')}} {{ts.trPK('worklist','subject')}} {{ts.trPK('worklist','sent')}} @@ -28,21 +29,39 @@ {{ts.trPK('worklist','none')}} +
+
+ + {{ts.trPK('worklist','sent')}} + + +
+
+ + + + +
+
- - Request Type - - {{ts.trPK('worklist','from')}} - {{ts.trPK('worklist','subject')}} - {{ts.trPK('worklist','sent')}} - {{ts.trPK('worklist','itemType')}} - {{ts.trPK('worklist','none')}} - - + + Request Type + + {{ts.trPK('worklist','from')}} + {{ts.trPK('worklist','subject')}} + {{ts.trPK('worklist','sent')}} + {{ts.trPK('worklist','itemType')}} + {{ts.trPK('worklist','none')}} + + -
+
SEARCH
+
+ + \ No newline at end of file diff --git a/Mohem/src/app/notification/worklist-advanced-search/worklist-advanced-search.component.ts b/Mohem/src/app/notification/worklist-advanced-search/worklist-advanced-search.component.ts index 7e60f280..1f8c1d95 100644 --- a/Mohem/src/app/notification/worklist-advanced-search/worklist-advanced-search.component.ts +++ b/Mohem/src/app/notification/worklist-advanced-search/worklist-advanced-search.component.ts @@ -9,6 +9,13 @@ import { TranslatorService } from 'src/app/hmg-common/services/translator/transl }) export class WorklistAdvancedSearchComponent implements OnInit { + public hideDateInput: boolean = false; + public hideTextInput: boolean = false; + public inputDate: string = ''; + public inputSearch: string = ''; + public selectedValue: string = ''; + public notificationType: string = ''; + constructor( public modalController: ModalController, public ts: TranslatorService @@ -17,14 +24,41 @@ export class WorklistAdvancedSearchComponent implements OnInit { ngOnInit() {} public dismissModal() { - console.log('umar 545'); + this.modalController.dismiss(); + } + + public search() { this.modalController.dismiss({ - // dismissed: true, - // keySelectedFilters: selectedFilters, - // selectedShiftType: this.selectedShiftType, - // dateFrom: this.dateFrom, - // dateTo: this.dateTo + notificationType: this.notificationType, + selectedValue: this.selectedValue, + inputDate: this.inputDate, + inputSearch: this.inputSearch, }); } + onChangeView(selectedValue: any) { + this.notificationType = selectedValue.detail.value; + } + + getValueSelected(value) { + this.selectedValue = value.detail.value; + if (this.selectedValue == '1') { + this.hideDateInput = false; + this.hideTextInput = true; + } else if (this.selectedValue == '2') { + this.hideDateInput = false; + this.hideTextInput = true; + } else if (this.selectedValue == '3') { + this.hideDateInput = true; + this.hideTextInput = false; + } else if (this.selectedValue == '4') { + this.hideDateInput = false; + this.hideTextInput = true; + } else if (this.selectedValue == '5') { + this.hideDateInput = false; + this.hideTextInput = false; + } + } + + } From 7bd0701d758d2141f81dd82b0a4288b26f4076a7 Mon Sep 17 00:00:00 2001 From: umasoodch Date: Mon, 10 Feb 2020 17:17:50 +0300 Subject: [PATCH 5/7] fixed design issues for attendance tracking --- .../home/home.component.html | 40 ++++++++++------ .../home/home.component.scss | 47 ++++++++++++------- .../home/home.component.ts | 5 -- Mohem/src/app/home/home.page.ts | 14 ++++-- Mohem/src/assets/localization/i18n.json | 20 ++++---- Mohem/src/theme/styles.scss | 3 ++ 6 files changed, 76 insertions(+), 53 deletions(-) diff --git a/Mohem/src/app/attendance-tracking/home/home.component.html b/Mohem/src/app/attendance-tracking/home/home.component.html index 1a28a602..48d2c99c 100644 --- a/Mohem/src/app/attendance-tracking/home/home.component.html +++ b/Mohem/src/app/attendance-tracking/home/home.component.html @@ -1,16 +1,29 @@ - + + + + +
+ +
- {{curentDate}}
+ {{curentDate}}
{{ts.trPK('attendance-tracking','today-time-left')}}
@@ -46,32 +59,29 @@
- {{ts.trPK('attendance-tracking','shift-time')}} -

- {{attendanceTrackingList.P_SHT_NAME}} + + {{ts.trPK('attendance-tracking','shift-time')}} + {{attendanceTrackingList.P_SHT_NAME}} +
- + {{ts.trPK('attendance-tracking','check-in')}} -

08:00
- + {{ts.trPK('attendance-tracking','check-out')}} -

08:00
- + {{ts.trPK('attendance-tracking','late-in')}} -

08:00
- + {{ts.trPK('attendance-tracking','regular')}} -

- {{attendanceTrackingList.P_SCHEDULED_HOURS}} + {{attendanceTrackingList.P_SCHEDULED_HOURS | slice:0:-3}}
diff --git a/Mohem/src/app/attendance-tracking/home/home.component.scss b/Mohem/src/app/attendance-tracking/home/home.component.scss index f09a8a87..f92e8d05 100644 --- a/Mohem/src/app/attendance-tracking/home/home.component.scss +++ b/Mohem/src/app/attendance-tracking/home/home.component.scss @@ -1,26 +1,29 @@ +ion-content { + font-family: WorkSans-Regular; +} +ion-grid { + padding:30px 15px; +} .timer-chart{ -padding-top:18px; -background: #094773; -// height: 50%; -text-align: center; + background: #094773; + text-align: center; + line-height: .7cm; } .tracking-content{ -background: #053c63; -height: 50%; + background: #053c63; + min-height: 50%; } + .rowBorder{ text-align: center; border-bottom: var(--lightblue) solid 1px; } .shift-text{ - // text-align: center; - // width: 100%; - // color: white !important; - margin-bottom: 12px; - margin-top: -9px; - font-size: 30px; + font-size: 36px; + line-height: 36px; + display: block; } .shift-title{ width: 100%; @@ -34,24 +37,32 @@ height: 50%; } .divstopBtn{ -text-align: center; + text-align: center; } .stopBtn{ - height: 70px; - width: 70px; + height: 89px; + width: 89px; background-color: var(--lightblue) !important; border-radius: 50%; display: inline-block; - margin-top: -24px; - border: solid 3px #053c63; + margin-top: -40px; + border: solid 5px #053c63; } .colBorder{ + padding: 20px 0px; + text-align: center; +} + +.colBorder:nth-child(1){ border-right: var(--lightblue) solid 1px; } .fixed-shift-timer{ margin-top: -50px; - margin-bottom: -30px; + margin-bottom: -10px; +} +.back-button-container{ + background: #094773; } diff --git a/Mohem/src/app/attendance-tracking/home/home.component.ts b/Mohem/src/app/attendance-tracking/home/home.component.ts index a872b22a..d2070095 100644 --- a/Mohem/src/app/attendance-tracking/home/home.component.ts +++ b/Mohem/src/app/attendance-tracking/home/home.component.ts @@ -22,7 +22,6 @@ export class HomeComponent implements OnInit { public isCheckedIn = undefined; public displayTime: any; public percent: any; - constructor( public cs: CommonService, public db: DashboredService, @@ -90,14 +89,10 @@ export class HomeComponent implements OnInit { } convertAndAssignTime(data) { - console.log(data); this.remainingTime = this.convertInSeconds(data.P_REMAINING_HOURS.split(':')); this.scheduledTime = this.convertInSeconds(data.P_SCHEDULED_HOURS.split(':')); this.isCheckedIn = this.remainingTime === this.scheduledTime ? false : true; this.initTimer(); - console.log('remainingTime: ' + this.remainingTime); - console.log('scheduledTime: ' + this.scheduledTime); - console.log('isCheckedIn: ' + this.isCheckedIn); } showAttendanceTracking() { diff --git a/Mohem/src/app/home/home.page.ts b/Mohem/src/app/home/home.page.ts index aa52e5a3..90f243d4 100644 --- a/Mohem/src/app/home/home.page.ts +++ b/Mohem/src/app/home/home.page.ts @@ -152,7 +152,7 @@ export class HomePage implements OnInit { } ngOnInit() { - this.getUserDetails(); + // this.getUserDetails(); // this.getCount(); // this.events.subscribe('getNotCount', badge => { @@ -160,6 +160,13 @@ export class HomePage implements OnInit { // }); } + ionViewWillEnter() { + this.remainingTime = 0; + this.displayTime = '00:00:00'; + this.runTimer = false; + this.getUserDetails(); + } + initTimer() { this.runTimer = false; this.hasStarted = false; @@ -255,7 +262,7 @@ export class HomePage implements OnInit { // }); // } - ionViewDidLoad() { + ionViewDidEnter() { this.geolocation .getCurrentPosition() .then(resp => { @@ -494,9 +501,6 @@ export class HomePage implements OnInit { this.scheduledTime = this.convertInSeconds(data.P_SCHEDULED_HOURS.split(':')); this.isCheckedIn = this.remainingTime === this.scheduledTime ? false : true; this.initTimer(); - console.log('remainingTime: ' + this.remainingTime); - console.log('scheduledTime: ' + this.scheduledTime); - console.log('isCheckedIn: ' + this.isCheckedIn); } showAttendanceTracking() { diff --git a/Mohem/src/assets/localization/i18n.json b/Mohem/src/assets/localization/i18n.json index 9d52c4fd..09780300 100644 --- a/Mohem/src/assets/localization/i18n.json +++ b/Mohem/src/assets/localization/i18n.json @@ -2137,24 +2137,24 @@ "ar":"Mark Attendance " }, "check-in":{ - "en": "Check In", - "ar":"Check In" + "en": "CHECK IN", + "ar":"CHECK IN" }, "check-out":{ - "en": "Check Out", - "ar":"Check Out" + "en": "CHECK OUT", + "ar":"CHECK OUT" }, "regular":{ - "en": "Regular", - "ar":"Regular" + "en": "REGULAR", + "ar":"REGULAR" }, "late-in":{ - "en": "Late In", - "ar":"Late In" + "en": "LATE IN", + "ar":"LATE IN" }, "today-time-left":{ - "en": "TODAY TIME LEFT", - "ar":"TODAY TIME LEFT" + "en": "TODAY'S TIME LEFT", + "ar":"TODAY'S TIME LEFT" }, diff --git a/Mohem/src/theme/styles.scss b/Mohem/src/theme/styles.scss index efa3a30c..bc7eb10a 100644 --- a/Mohem/src/theme/styles.scss +++ b/Mohem/src/theme/styles.scss @@ -1001,3 +1001,6 @@ border:0px height: 0px !important; display: none !important; } +.header-toolbar-new{ + --background: #22c6b3; +} From 09afc19dbb6cba1219d87670c1404879fc535a27 Mon Sep 17 00:00:00 2001 From: umasoodch Date: Tue, 11 Feb 2020 10:39:46 +0300 Subject: [PATCH 6/7] fixed multiple swipe alert issue --- Mohem/src/app/home/home.page.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Mohem/src/app/home/home.page.ts b/Mohem/src/app/home/home.page.ts index 90f243d4..703e3fea 100644 --- a/Mohem/src/app/home/home.page.ts +++ b/Mohem/src/app/home/home.page.ts @@ -455,9 +455,10 @@ export class HomePage implements OnInit { if (this.common.validResponse(result)) { this.common.presentAlert(this.ts.trPK('home', 'swipeAlertSuccess')); this.showAttendanceTracking(); - } else { - this.common.presentAlert(this.ts.trPK('home', 'swipeAlertFailed')); } + // else { + // this.common.presentAlert(this.ts.trPK('home', 'swipeAlertFailed')); + // } }); } From 52085849999743b338c6bc8f5e40247bfa477057 Mon Sep 17 00:00:00 2001 From: umasoodch Date: Wed, 12 Feb 2020 11:44:43 +0300 Subject: [PATCH 7/7] added worklist filters logic --- .../app/notification/home/home.component.html | 4 +- .../app/notification/home/home.component.scss | 9 +- .../app/notification/home/home.component.ts | 250 +++++++----------- .../notification/models/workListRequest.ts | 20 +- .../worklist-advanced-search.component.html | 13 +- .../worklist-advanced-search.component.ts | 27 +- 6 files changed, 127 insertions(+), 196 deletions(-) diff --git a/Mohem/src/app/notification/home/home.component.html b/Mohem/src/app/notification/home/home.component.html index 09f904d0..1ab21604 100644 --- a/Mohem/src/app/notification/home/home.component.html +++ b/Mohem/src/app/notification/home/home.component.html @@ -26,7 +26,7 @@ - + - + Clear Search diff --git a/Mohem/src/app/notification/home/home.component.scss b/Mohem/src/app/notification/home/home.component.scss index 0686c9fa..da327bdb 100644 --- a/Mohem/src/app/notification/home/home.component.scss +++ b/Mohem/src/app/notification/home/home.component.scss @@ -221,9 +221,6 @@ ion-input ,ion-datetime{ ///////////////////////////////////////////NEW DESIGN///////////////////////////////////// -.header-toolbar-new{ - --background: #22c6b3; -} .profile-image-container{ position: relative; z-index: 999; @@ -388,4 +385,8 @@ ion-content { left: 50%; margin-left: -100px; margin-top: 100px; -} \ No newline at end of file +} +.disable-filter { + pointer-events: none; + opacity: .3; +} diff --git a/Mohem/src/app/notification/home/home.component.ts b/Mohem/src/app/notification/home/home.component.ts index a8fa91a7..1021547f 100644 --- a/Mohem/src/app/notification/home/home.component.ts +++ b/Mohem/src/app/notification/home/home.component.ts @@ -33,8 +33,6 @@ export class HomeComponent implements OnInit { SentDate = ''; Subject = ''; inputSearch = ''; - // HideDateInput = false; - // HideTextInput = false; inputDate: string; filteredNotificationList: any; IsReachEnd = false; @@ -47,7 +45,7 @@ export class HomeComponent implements OnInit { public isITG = false; public isSearch = false; public direction = 'ltr'; - ///// New ///////////// + public currentActiveIndex = 0; public previousActiveIndex = 0; public worklistNotifications: any; @@ -57,6 +55,7 @@ export class HomeComponent implements OnInit { public showFormattedData = {}; public selectedFilter = 'ALL'; public showSearchButton = false; + public itemType = ''; public options = { cutoutPercentage: 80, tooltips: { enabled: false }, @@ -82,42 +81,48 @@ export class HomeComponent implements OnInit { name: 'All', active: true, color: '#124375', - key: 'ALL' + key: 'ALL', + disable: false }, { value: 0, name: 'HR', active: false, color: '#18a169', - key: 'HRSSA' + key: 'HRSSA', + disable: false }, { value: 0, name: 'PO', active: false, color: '#38c9b3', - key: 'POAPPRV' + key: 'POAPPRV', + disable: false }, { value: 0, name: 'PR', active: false, color: '#114475', - key: 'REQAPPRV' + key: 'REQAPPRV', + disable: false }, { value: 0, name: 'MR', active: false, color: '#3cb9d5', - key: 'INVMOA' + key: 'INVMOA', + disable: false }, { value: 0, name: 'ITG', active: false, color: '#cc3232', - key: 'ITG' + key: 'ITG', + disable: false } ]; public slideOptsOne = { @@ -168,9 +173,9 @@ export class HomeComponent implements OnInit { } } } - + getFilteredData(filter: string) { - if(filter === 'ALL') { + if (filter === 'ALL') { this.showFormattedData = this.allFormattedData; } else { let arrayToFilter; @@ -196,6 +201,25 @@ export class HomeComponent implements OnInit { this.common.openProfile(); } + disableFilters() { + for (const filter of this.filters) { + if (filter.key === this.itemType) { + filter.disable = false; + filter.active = true; + this.selectedFilter = filter.name; + } else if (this.itemType === 'none') { + filter.disable = false; + filter.active = false; + } else { + filter.disable = true; + filter.active = false; + } + } + if (this.itemType === 'none') { + this.filters[0].active = true; + } + } + async openSearchModal() { const modal = await this.modalController.create({ component: WorklistAdvancedSearchComponent, @@ -205,9 +229,10 @@ export class HomeComponent implements OnInit { }); modal.onDidDismiss().then(result => { console.log(result.data); - if(result.data){ - if(result.data.notificationType !== '' || result.data.selectedValue){ + if (result.data) { + if (result.data.notificationType !== '' || result.data.selectedValue !== '' || result.data.itemType !== '') { this.showSearchButton = true; + this.itemType = result.data.itemType; this.notificationType = result.data.notificationType; this.selectedValue = result.data.selectedValue; this.inputDate = result.data.inputDate; @@ -222,58 +247,24 @@ export class HomeComponent implements OnInit { this.previousActiveIndex = 0; this.filters[this.currentActiveIndex].active = true; this.getAllPushNotificationFun(); + if (this.itemType !== '') { + this.disableFilters(); + } } } - }); return await modal.present(); } - ionViewDidLoad() { - // this.navBar.backButtonClick = () => { - // // you can set a full custom history here if you want - // let pages = [ - // { - // page: "HomePage" - // } - // ]; - // this.navCtrl.setPages(pages); - // }; - } - - ionViewWillEnter() { - // this.getAllPushNotificationFun(); //filter with item type - } - getAllPushNotificationFun() { this.WorkListObj.P_PAGE_NUM = 1; this.IsReachEnd = false; - - if (this.selectedValue === '1') { - this.WorkListObj.P_SEARCH_FROM_USER = this.inputSearch; - this.WorkListObj.P_SEARCH_ITEM_TYPE_DSP_NAME = ''; - this.WorkListObj.P_SEARCH_SENT_DATE = ''; - this.WorkListObj.P_SEARCH_SUBJECT = ''; - } else if (this.selectedValue === '2') { - this.WorkListObj.P_SEARCH_FROM_USER = ''; - this.WorkListObj.P_SEARCH_ITEM_TYPE_DSP_NAME = ''; - this.WorkListObj.P_SEARCH_SENT_DATE = ''; - this.WorkListObj.P_SEARCH_SUBJECT = this.inputSearch; - } else if (this.selectedValue === '3') { - this.WorkListObj.P_SEARCH_FROM_USER = ''; - this.WorkListObj.P_SEARCH_ITEM_TYPE_DSP_NAME = ''; - if (this.inputDate) { - this.WorkListObj.P_SEARCH_SENT_DATE = moment(this.inputDate).format( - 'DD-MMM-YYYY' - ); - } else { this.WorkListObj.P_SEARCH_SENT_DATE = ''; } - this.WorkListObj.P_SEARCH_SUBJECT = ''; - } else if (this.selectedValue === '4') { - this.WorkListObj.P_SEARCH_FROM_USER = ''; - this.WorkListObj.P_SEARCH_ITEM_TYPE_DSP_NAME = this.inputSearch; - this.WorkListObj.P_SEARCH_SENT_DATE = ''; - this.WorkListObj.P_SEARCH_SUBJECT = ''; - } else if (this.selectedValue === '5') { + this.WorkListObj.P_SEARCH_FROM_USER = this.selectedValue === '1' ? this.inputSearch : ''; + this.WorkListObj.P_SEARCH_SUBJECT = this.selectedValue === '2' ? this.inputSearch : ''; + this.WorkListObj.P_SEARCH_SENT_DATE = (this.inputDate && this.selectedValue === '3') + ? moment(this.inputDate).format('DD-MMM-YYYY') : ''; + this.WorkListObj.P_SEARCH_ITEM_TYPE_DSP_NAME = this.selectedValue === '4' ? this.inputSearch : '';; + if (this.selectedValue === '5') { this.WorkListObj.P_SEARCH_FROM_USER = ''; this.WorkListObj.P_SEARCH_ITEM_TYPE_DSP_NAME = ''; this.WorkListObj.P_SEARCH_SENT_DATE = ''; @@ -290,10 +281,10 @@ export class HomeComponent implements OnInit { categorizeData(arrayToCategorize: any) { const datePipe = new DatePipe('en-US'); - let formattedData = {}; + const formattedData = {}; for (const workList of arrayToCategorize) { workList.FORMATTED_DATE = datePipe.transform(new Date(workList.BEGIN_DATE), 'MMMM dd, y'); - if (!(workList.FORMATTED_DATE in formattedData)) { + if (!(workList.FORMATTED_DATE in formattedData)) { formattedData[workList.FORMATTED_DATE] = new Array(); formattedData[workList.FORMATTED_DATE].push(workList); } else { @@ -323,7 +314,7 @@ export class HomeComponent implements OnInit { } if (this.common.hasData(result)) { this.WorkListObj.P_PAGE_NUM++; - if(this.newWorkListResponse.length === 0) { + if (this.newWorkListResponse.length === 0) { this.newWorkListResponse = result; } else { this.newWorkListResponse = this.newWorkListResponse.concat(result); @@ -342,22 +333,16 @@ export class HomeComponent implements OnInit { console.log(obj); this.common.sharedService.setSharedData(obj, HomeComponent.NOTIFICATION_DATA); // this.common.openWorklistMainPage(); - if(obj.REQUEST_TYPE == 'PR'){ + if (obj.REQUEST_TYPE === 'PR') { this.common.openWorklistMainPRPage(); - } - else if(obj.REQUEST_TYPE == 'PO'){ + } else if (obj.REQUEST_TYPE === 'PO') { this.common.openWorklistMainPOPage(); - } - else if(obj.REQUEST_TYPE == 'MO'){ + } else if (obj.REQUEST_TYPE === 'MO') { this.common.openWorklistMainMRPage(); - } - - else{ + } else { this.common.openWorklistMainPage(); } - - // this.navCtrl.push("WorkListMainPage", { passNotificationList: obj }); } isEmptyObject() { @@ -365,6 +350,8 @@ export class HomeComponent implements OnInit { } clearSearch() { + this.itemType = 'none'; + this.disableFilters(); this.showSearchButton = false; this.notificationType = ''; this.selectedValue = ''; @@ -398,7 +385,7 @@ export class HomeComponent implements OnInit { } }); } else { - if (this.infiniteScroll && this.selectedFilter === 'ALL') { + if (this.infiniteScroll && this.selectedFilter === 'ALL') { this.infiniteScroll.complete(); } } @@ -407,105 +394,54 @@ export class HomeComponent implements OnInit { Count() { this.workListService.getITGCount() .subscribe((result: any) => { - console.log('ENAD ITG COUNT:') + console.log('ENAD ITG COUNT:'); console.log(result); }); } - filterNotificationByRequestType(reqType) { - let filterdType = []; - if (reqType == 'All') { - this.filteredNotificationList = this.WorkListResObj; - if (this.filteredNotificationList == [] || this.filteredNotificationList == null || this.filteredNotificationList == '') { - this.noData = true; - return false; - } else { - this.noData = false; - return false; - } - } - for (let i = 0; i < this.WorkListResObj.length; i++) { - if(reqType=='HR'){ - if ('EIT' == this.WorkListResObj[i].REQUEST_TYPE || 'ABSENCE' == this.WorkListResObj[i].REQUEST_TYPE) { - filterdType.push(this.WorkListResObj[i]); - } - }else{ - if (reqType == this.WorkListResObj[i].REQUEST_TYPE) { - filterdType.push(this.WorkListResObj[i]); - } - } - - } - - this.filteredNotificationList = filterdType; - if (this.filteredNotificationList == [] || this.filteredNotificationList == null || this.filteredNotificationList == '') { - this.noData = true; - return false; - } else { - this.noData = false; - return false; - } - } + // filterNotificationByRequestType(reqType) { + // const filterdType = []; + // if (reqType === 'All') { + // this.filteredNotificationList = this.WorkListResObj; + // if (this.filteredNotificationList === [] || this.filteredNotificationList == null || this.filteredNotificationList === '') { + // this.noData = true; + // return false; + // } else { + // this.noData = false; + // return false; + // } + // } + // for (let i = 0; i < this.WorkListResObj.length; i++) { + // if (reqType === 'HR') { + // if ('EIT' === this.WorkListResObj[i].REQUEST_TYPE || 'ABSENCE' === this.WorkListResObj[i].REQUEST_TYPE) { + // filterdType.push(this.WorkListResObj[i]); + // } + // } else { + // if (reqType === this.WorkListResObj[i].REQUEST_TYPE) { + // filterdType.push(this.WorkListResObj[i]); + // } + // } + + // } + + // this.filteredNotificationList = filterdType; + // if (this.filteredNotificationList === [] || this.filteredNotificationList == null || this.filteredNotificationList === '') { + // this.noData = true; + // return false; + // } else { + // this.noData = false; + // return false; + // } + // } Details() { this.workListService.getITGDetails() .subscribe((result: any) => { - console.log('ENAD ITG Details:') + console.log('ENAD ITG Details:'); console.log(result); }); } - AllNotification() { - this.filterNotificationByRequestType('All'); - this.isAll = true; - this.isPR = false; - this.isPO = false; - this.isMR = false; - this.isHR = false; - this.isITG = false; - } - - PRNotification() { - this.filterNotificationByRequestType('PR'); - this.isAll = false; - this.isPR = true; - this.isPO = false; - this.isMR = false; - this.isHR = false; - this.isITG = false; - } - - PONotification() { - this.filterNotificationByRequestType('PO'); - this.isAll = false; - this.isPR = false; - this.isPO = true; - this.isMR = false; - this.isHR = false; - this.isITG = false; - - } - - MRNotification() { - this.filterNotificationByRequestType('MO'); - this.isAll = false; - this.isPR = false; - this.isPO = false; - this.isMR = true; - this.isHR = false; - this.isITG = false; - } - - HRNotification() { - this.filterNotificationByRequestType('HR'); - this.isAll = false; - this.isPR = false; - this.isPO = false; - this.isMR = false; - this.isHR = true; - this.isITG = false; - } - ITGNotification() { // this.Details(); this.isAll = false; diff --git a/Mohem/src/app/notification/models/workListRequest.ts b/Mohem/src/app/notification/models/workListRequest.ts index 018942ab..5f0efad2 100644 --- a/Mohem/src/app/notification/models/workListRequest.ts +++ b/Mohem/src/app/notification/models/workListRequest.ts @@ -1,18 +1,12 @@ -// import { Request } from './request'; import { Request } from 'src/app/hmg-common/services/models/request'; export class WorkListRequest extends Request{ public static SHARED_DATA = 'login-request'; - // Channel: Channel, //channel - // LanguageID: LanguageID,//langlist - // P_USER_NAME:userName,//string - // P_SESSION_ID:sessionID,//number - public P_NOTIFICATION_TYPE: string;//string - public P_SEARCH_FROM_USER:string;//string - public P_SEARCH_SUBJECT:string;//string - public P_SEARCH_SENT_DATE:string;//string - public P_SEARCH_ITEM_TYPE_DSP_NAME:string;//string - public P_PAGE_NUM:number;//number - public P_PAGE_LIMIT:number;//number - + public P_NOTIFICATION_TYPE: string; + public P_SEARCH_FROM_USER: string; + public P_SEARCH_SUBJECT: string; + public P_SEARCH_SENT_DATE: string; + public P_SEARCH_ITEM_TYPE_DSP_NAME: string; + public P_PAGE_NUM: number; + public P_PAGE_LIMIT: number; } \ No newline at end of file diff --git a/Mohem/src/app/notification/worklist-advanced-search/worklist-advanced-search.component.html b/Mohem/src/app/notification/worklist-advanced-search/worklist-advanced-search.component.html index b02442bf..e0b313d3 100644 --- a/Mohem/src/app/notification/worklist-advanced-search/worklist-advanced-search.component.html +++ b/Mohem/src/app/notification/worklist-advanced-search/worklist-advanced-search.component.html @@ -46,14 +46,13 @@
- Request Type + Item Type - {{ts.trPK('worklist','from')}} - {{ts.trPK('worklist','subject')}} - {{ts.trPK('worklist','sent')}} - {{ts.trPK('worklist','itemType')}} - {{ts.trPK('worklist','none')}} + [(ngModel)]="itemType"> + HR + PO + PR + MR diff --git a/Mohem/src/app/notification/worklist-advanced-search/worklist-advanced-search.component.ts b/Mohem/src/app/notification/worklist-advanced-search/worklist-advanced-search.component.ts index 1f8c1d95..5f393e89 100644 --- a/Mohem/src/app/notification/worklist-advanced-search/worklist-advanced-search.component.ts +++ b/Mohem/src/app/notification/worklist-advanced-search/worklist-advanced-search.component.ts @@ -9,12 +9,13 @@ import { TranslatorService } from 'src/app/hmg-common/services/translator/transl }) export class WorklistAdvancedSearchComponent implements OnInit { - public hideDateInput: boolean = false; - public hideTextInput: boolean = false; - public inputDate: string = ''; - public inputSearch: string = ''; - public selectedValue: string = ''; - public notificationType: string = ''; + public hideDateInput = false; + public hideTextInput = false; + public inputDate = ''; + public inputSearch = ''; + public selectedValue = ''; + public notificationType = ''; + public itemType = ''; constructor( public modalController: ModalController, @@ -28,11 +29,13 @@ export class WorklistAdvancedSearchComponent implements OnInit { } public search() { + console.log(this.itemType); this.modalController.dismiss({ notificationType: this.notificationType, selectedValue: this.selectedValue, inputDate: this.inputDate, inputSearch: this.inputSearch, + itemType: this.itemType }); } @@ -42,23 +45,21 @@ export class WorklistAdvancedSearchComponent implements OnInit { getValueSelected(value) { this.selectedValue = value.detail.value; - if (this.selectedValue == '1') { + if (this.selectedValue === '1') { this.hideDateInput = false; this.hideTextInput = true; - } else if (this.selectedValue == '2') { + } else if (this.selectedValue === '2') { this.hideDateInput = false; this.hideTextInput = true; - } else if (this.selectedValue == '3') { + } else if (this.selectedValue === '3') { this.hideDateInput = true; this.hideTextInput = false; - } else if (this.selectedValue == '4') { + } else if (this.selectedValue === '4') { this.hideDateInput = false; this.hideTextInput = true; - } else if (this.selectedValue == '5') { + } else if (this.selectedValue === '5') { this.hideDateInput = false; this.hideTextInput = false; } } - - }