From 2e6dd950049e65a44f9717ad73ae73b3c5f55ef7 Mon Sep 17 00:00:00 2001 From: umasoodch Date: Thu, 30 Jan 2020 16:53:13 +0300 Subject: [PATCH] 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