From e7f39ba02f3db7c065e1856ebb2943d33f7adc0d Mon Sep 17 00:00:00 2001 From: enadhilal Date: Tue, 16 Nov 2021 10:09:31 +0300 Subject: [PATCH] added page to turn on or off worklist notification and add indecator in my profile --- Mohem/src/app/hmg-common/hmg-common.module.ts | 6 +- .../services/connector/connector.service.ts | 4 +- .../generic-header.component.html | 6 ++ .../generic-header.component.ts | 15 ++++- .../app/notification/home/home.component.html | 1 + .../worklist-setting.component.html | 32 ++++++++++ .../worklist-setting.component.scss | 7 +++ .../worklist-setting.component.spec.ts | 27 +++++++++ .../worklist-setting.component.ts | 60 +++++++++++++++++++ .../src/app/profile/home/home.component.html | 57 ++++++++++++++++-- .../src/app/profile/home/home.component.scss | 16 +++++ Mohem/src/app/profile/home/home.component.ts | 1 + Mohem/src/assets/localization/i18n.json | 28 +++++++++ 13 files changed, 250 insertions(+), 10 deletions(-) create mode 100644 Mohem/src/app/notification/worklist-setting/worklist-setting.component.html create mode 100644 Mohem/src/app/notification/worklist-setting/worklist-setting.component.scss create mode 100644 Mohem/src/app/notification/worklist-setting/worklist-setting.component.spec.ts create mode 100644 Mohem/src/app/notification/worklist-setting/worklist-setting.component.ts diff --git a/Mohem/src/app/hmg-common/hmg-common.module.ts b/Mohem/src/app/hmg-common/hmg-common.module.ts index c0d8c8f9..447e5d00 100644 --- a/Mohem/src/app/hmg-common/hmg-common.module.ts +++ b/Mohem/src/app/hmg-common/hmg-common.module.ts @@ -111,6 +111,7 @@ import { GenericHeaderComponent } from './ui/generic-header/generic-header.compo import { BackgroundGeolocation } from '@ionic-native/background-geolocation/ngx'; import { AttendanceOptionsComponent } from '../home/attendance-options/attendance-options.component'; import { CardCalendarComponent } from './ui/card-calendar/card-calendar.component'; +import { WorklistSettingComponent } from '../notification/worklist-setting/worklist-setting.component'; @NgModule({ imports: [ @@ -194,7 +195,8 @@ import { CardCalendarComponent } from './ui/card-calendar/card-calendar.componen Modal, GenericHeaderComponent, AttendanceOptionsComponent, - CardCalendarComponent + CardCalendarComponent, + WorklistSettingComponent ], exports: [ FabButtonComponent, @@ -306,7 +308,7 @@ import { CardCalendarComponent } from './ui/card-calendar/card-calendar.componen BarcodeScanner, BackgroundGeolocation ], - entryComponents: [DateInfoModalComponent], + entryComponents: [DateInfoModalComponent, WorklistSettingComponent], }) export class HmgCommonModule { } diff --git a/Mohem/src/app/hmg-common/services/connector/connector.service.ts b/Mohem/src/app/hmg-common/services/connector/connector.service.ts index dc119ce4..c869c5ef 100644 --- a/Mohem/src/app/hmg-common/services/connector/connector.service.ts +++ b/Mohem/src/app/hmg-common/services/connector/connector.service.ts @@ -27,8 +27,8 @@ export class ConnectorService { public static retryTimes = 0; public static timeOut = 120 * 1000; - // public static host = 'https://uat.hmgwebservices.com/'; - public static host = 'https://hmgwebservices.com/'; + public static host = 'https://uat.hmgwebservices.com/'; + // public static host = 'https://hmgwebservices.com/'; constructor(public httpClient: HttpClient, public cs: CommonService, diff --git a/Mohem/src/app/hmg-common/ui/generic-header/generic-header.component.html b/Mohem/src/app/hmg-common/ui/generic-header/generic-header.component.html index 7d62b3c5..ddc592b6 100644 --- a/Mohem/src/app/hmg-common/ui/generic-header/generic-header.component.html +++ b/Mohem/src/app/hmg-common/ui/generic-header/generic-header.component.html @@ -30,6 +30,12 @@ --> + +
+ +
+
+ \ No newline at end of file diff --git a/Mohem/src/app/hmg-common/ui/generic-header/generic-header.component.ts b/Mohem/src/app/hmg-common/ui/generic-header/generic-header.component.ts index 75dc2703..6589c50d 100644 --- a/Mohem/src/app/hmg-common/ui/generic-header/generic-header.component.ts +++ b/Mohem/src/app/hmg-common/ui/generic-header/generic-header.component.ts @@ -1,4 +1,6 @@ import { Component, OnInit, Input, Output, EventEmitter } from '@angular/core'; +import { ModalController } from '@ionic/angular'; +import { WorklistSettingComponent } from 'src/app/notification/worklist-setting/worklist-setting.component'; import { CommonService } from '../../services/common/common.service'; @Component({ @@ -16,10 +18,13 @@ export class GenericHeaderComponent implements OnInit { @Input() updateDirection = false; @Input() headerText = ''; @Input() backLink: string; + @Input() worklistSetting = false; @Output() trigger = new EventEmitter(); public close = 'assets/imgs/cancel.png'; - constructor(public common: CommonService) { } + constructor( + public common: CommonService, + public modalController: ModalController) { } ngOnInit() { if (this.updateDirection) { @@ -35,4 +40,12 @@ export class GenericHeaderComponent implements OnInit { this.trigger.emit(); } + async openNotifictionSetting() { + const modal = await this.modalController.create({ + component: WorklistSettingComponent, + cssClass: 'app-update-modal-css', + }); + return await modal.present(); + } + } diff --git a/Mohem/src/app/notification/home/home.component.html b/Mohem/src/app/notification/home/home.component.html index fe0b6141..95668d4d 100644 --- a/Mohem/src/app/notification/home/home.component.html +++ b/Mohem/src/app/notification/home/home.component.html @@ -1,6 +1,7 @@ diff --git a/Mohem/src/app/notification/worklist-setting/worklist-setting.component.html b/Mohem/src/app/notification/worklist-setting/worklist-setting.component.html new file mode 100644 index 00000000..b4c26a10 --- /dev/null +++ b/Mohem/src/app/notification/worklist-setting/worklist-setting.component.html @@ -0,0 +1,32 @@ + + + {{ 'worklist, worklist-setting' | translate}} + + + + + + + + + +
+

{{ 'worklist, turn-on-notification' | translate}}

+
+
+ + + + +

{{data.nameEn}}

+

{{data.nameAr}}

+
+ +
+
+
+
+ + + {{ 'worklist, save-changes' | translate}} + \ No newline at end of file diff --git a/Mohem/src/app/notification/worklist-setting/worklist-setting.component.scss b/Mohem/src/app/notification/worklist-setting/worklist-setting.component.scss new file mode 100644 index 00000000..927b8dc3 --- /dev/null +++ b/Mohem/src/app/notification/worklist-setting/worklist-setting.component.scss @@ -0,0 +1,7 @@ +.header-toolbar{ + --background: #269DB8; +} + +ion-toggle{ + --background-checked: #269DB8; +} \ No newline at end of file diff --git a/Mohem/src/app/notification/worklist-setting/worklist-setting.component.spec.ts b/Mohem/src/app/notification/worklist-setting/worklist-setting.component.spec.ts new file mode 100644 index 00000000..627b60c6 --- /dev/null +++ b/Mohem/src/app/notification/worklist-setting/worklist-setting.component.spec.ts @@ -0,0 +1,27 @@ +import { CUSTOM_ELEMENTS_SCHEMA } from '@angular/core'; +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; + +import { WorklistSettingComponent } from './worklist-setting.component'; + +describe('WorklistSettingComponent', () => { + let component: WorklistSettingComponent; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [ WorklistSettingComponent ], + schemas: [CUSTOM_ELEMENTS_SCHEMA], + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(WorklistSettingComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/Mohem/src/app/notification/worklist-setting/worklist-setting.component.ts b/Mohem/src/app/notification/worklist-setting/worklist-setting.component.ts new file mode 100644 index 00000000..3280ecfd --- /dev/null +++ b/Mohem/src/app/notification/worklist-setting/worklist-setting.component.ts @@ -0,0 +1,60 @@ +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-setting', + templateUrl: './worklist-setting.component.html', + styleUrls: ['./worklist-setting.component.scss'], +}) +export class WorklistSettingComponent implements OnInit { + + notificationList = [ + { + id: 0, + nameEn: "Human Resource (HR)", + nameAr: "الموارد البشرية (HR)", + isChecked: false + }, + { + id: 1, + nameEn: "Purchase Order (PO)", + nameAr: "امر شراء (PO)", + isChecked: false + }, + { + id: 2, + nameEn: "Purchase Requesr (PR)", + nameAr: "طلب شراء (PR)", + isChecked: false + }, + { + id: 3, + nameEn: "Move Request (MR)", + nameAr: "طلب نقل (MR)", + isChecked: false + }, + { + id: 4, + nameEn: "Item Creation (IC)", + nameAr: "انشاء عنصر (IC)", + isChecked: false + } + ]; + + public direction: string; + + constructor(public modalController: ModalController, public ts: TranslatorService) { } + + ngOnInit() { + this.direction = TranslatorService.getCurrentDirection(); + } + + + dismiss() { + this.modalController.dismiss({ + 'dismissed': true + }); + } + +} diff --git a/Mohem/src/app/profile/home/home.component.html b/Mohem/src/app/profile/home/home.component.html index 96b8ea1b..63fd3145 100644 --- a/Mohem/src/app/profile/home/home.component.html +++ b/Mohem/src/app/profile/home/home.component.html @@ -37,25 +37,32 @@ -
+

+
+
+
+
+
+
+
{{ts.trPK('userProfile','profile-compitation')}} {{profileProgress}}%
@@ -184,6 +198,39 @@ + + + + + + +

{{ts.trPK('userProfile','phone-no')}}

+
+
+ + + + + + + +
+
+
+ +

{{ts.trPK('general','mobile')}}

+
+

0567845661

+
+
+ +

{{ts.trPK('userProfile','work')}}

+
+

4922

+
+
+
+ diff --git a/Mohem/src/app/profile/home/home.component.scss b/Mohem/src/app/profile/home/home.component.scss index 97bbfbb6..625ec624 100644 --- a/Mohem/src/app/profile/home/home.component.scss +++ b/Mohem/src/app/profile/home/home.component.scss @@ -1352,4 +1352,20 @@ $actionBtnSize: 36px; letter-spacing: -0.64px; color: #2B353E; opacity: 1; +} + +.profile-green{ + background: #20A16A; + margin-right: 5px; + width: 80px; + height: 8px; + border-radius: 5px; +} + +.profile-gray{ + background: #D9D9D9; + margin-right: 5px; + width: 80px; + height: 8px; + border-radius: 5px; } \ No newline at end of file diff --git a/Mohem/src/app/profile/home/home.component.ts b/Mohem/src/app/profile/home/home.component.ts index 6c05dd04..8a0cbfe8 100644 --- a/Mohem/src/app/profile/home/home.component.ts +++ b/Mohem/src/app/profile/home/home.component.ts @@ -51,6 +51,7 @@ export class HomeComponent implements OnInit { public country: any; public employeeAdress: any = []; public jobName: any; + public profileProgress = 84; constructor( public ts: TranslatorService, diff --git a/Mohem/src/assets/localization/i18n.json b/Mohem/src/assets/localization/i18n.json index fed4e386..c0a4b48f 100644 --- a/Mohem/src/assets/localization/i18n.json +++ b/Mohem/src/assets/localization/i18n.json @@ -1434,6 +1434,22 @@ "postal-code": { "en": "Postal Code", "ar": "الرمز البريدي" + }, + "contact-details":{ + "en":"Contact Details", + "ar":"بيانات المتصل" + }, + "family-members":{ + "en":"Family Members", + "ar":"أفراد الأسرة" + }, + "profile-compitation":{ + "en":"Profile Completions", + "ar":"استكمال الملف الشخصي" + }, + "work":{ + "en":"Work", + "ar":"العمل" } }, "changePassword": { @@ -2487,6 +2503,18 @@ "urgent": { "en": "Urgent", "ar": "عاجل" + }, + "worklist-setting":{ + "en":"WORKLIST SETTINGS", + "ar":"اعدادات اشعارات" + }, + "turn-on-notification":{ + "en":"Turn on notification for", + "ar":"تفعيل الاشعارات " + }, + "save-changes":{ + "en":"Save Changes", + "ar":"حفظ التغيرات" } }, "worklistMain": {