diff --git a/Mohem/src/app/eit/home/home.component.html b/Mohem/src/app/eit/home/home.component.html index a375dba6..1ebb45d0 100644 --- a/Mohem/src/app/eit/home/home.component.html +++ b/Mohem/src/app/eit/home/home.component.html @@ -1,10 +1,15 @@ - {{headerTitle}} + + + + + + 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 9b18df76..fce8959a 100644 --- a/Mohem/src/app/hmg-common/services/common/common.service.ts +++ b/Mohem/src/app/hmg-common/services/common/common.service.ts @@ -966,6 +966,9 @@ export class CommonService { } public openNotificationPage() { this.nav.navigateForward(["/notification/homepage"]); + } + public openWorklistMainPage() { + this.nav.navigateForward(["/notification/worklist-main"]); } public reload(url: string, from: string) { console.log("force reload called from:" + from); diff --git a/Mohem/src/app/notification/home/home.component.ts b/Mohem/src/app/notification/home/home.component.ts index eba72364..aa38f068 100644 --- a/Mohem/src/app/notification/home/home.component.ts +++ b/Mohem/src/app/notification/home/home.component.ts @@ -5,6 +5,7 @@ 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'; @Component({ selector: "app-home", @@ -13,6 +14,8 @@ import { WorklistService } from "../service/worklist.service"; }) export class HomeComponent implements OnInit { // @ViewChild(Navbar) navBar: Navbar; + public static NOTIFICATION_DATA='notification_data'; + @ViewChild(IonInfiniteScroll) infiniteScroll: IonInfiniteScroll; private WorkListObj: WorkListRequest; WorkListResObj: any; //WorKListResponse; notificationType: string = "1"; @@ -64,7 +67,7 @@ export class HomeComponent implements OnInit { this.getAllPushNotificationFun(); } getValueSelected(Value) { - this.selectedValue = Value; + this.selectedValue = Value.detail.value; if (this.selectedValue == "1") { this.HideDateInput = false; this.HideTextInput = true; @@ -148,10 +151,12 @@ export class HomeComponent implements OnInit { } openNotificationDetail(obj) { + this.common.sharedService.setSharedData(obj, HomeComponent.NOTIFICATION_DATA); + this.common.openWorklistMainPage(); //this.navCtrl.push("WorkListMainPage", { passNotificationList: obj }); } onChangeView(selectedValue: any) { - this.WorkListObj.P_NOTIFICATION_TYPE = selectedValue; + this.WorkListObj.P_NOTIFICATION_TYPE = selectedValue.detail.value; } doInfinite(infiniteScroll) { @@ -177,11 +182,11 @@ export class HomeComponent implements OnInit { } } // if response == 1 //this.pageNum++; - infiniteScroll.complete(); + this.infiniteScroll.complete(); } ); } else { - if (infiniteScroll) infiniteScroll.complete(); + if (this.infiniteScroll) this.infiniteScroll.complete(); } } //end infiniteScroll } diff --git a/Mohem/src/app/notification/notification.module.ts b/Mohem/src/app/notification/notification.module.ts index 19b619d3..9437a78f 100644 --- a/Mohem/src/app/notification/notification.module.ts +++ b/Mohem/src/app/notification/notification.module.ts @@ -9,6 +9,7 @@ import { IonicModule } from '@ionic/angular'; import { NotificationPage } from './notification.page'; import { PipesModule } from '../pipes/pipes.module'; import { WorklistService } from './service/worklist.service'; +import { WorklistMainComponent } from './worklist-main/worklist-main.component'; const routes: Routes = [ @@ -23,6 +24,10 @@ const routes: Routes = [ { path: 'work-list-attach-view', component: WorkListAttachViewComponent + }, + { + path:'worklist-main', + component:WorklistMainComponent } ] } @@ -39,7 +44,8 @@ const routes: Routes = [ ], declarations: [ NotificationPage, - HomeComponent + HomeComponent, + WorklistMainComponent ], providers:[WorklistService] }) diff --git a/Mohem/src/app/notification/service/work-list.main.service.ts b/Mohem/src/app/notification/service/work-list.main.service.ts new file mode 100644 index 00000000..4a81e751 --- /dev/null +++ b/Mohem/src/app/notification/service/work-list.main.service.ts @@ -0,0 +1,121 @@ +import { Injectable } from "@angular/core"; +import { AuthenticationService } from "src/app/hmg-common/services/authentication/authentication.service"; +import { ConnectorService } from "src/app/hmg-common/services/connector/connector.service"; +import { Observable } from "rxjs"; +import { WorkListBodyRequest } from "../models/NotificationBodyReq"; +import { EITNotificatonBodyResponse } from "../models/EITNotificationBodyRes"; +import { AbsenceNotificatonBodyResponse } from "../models/AbsenceNotificationBodyRes"; +import { WorkListButtonRequest } from "../models/NotificationButtonReq"; +import { NotificatonButtonResponse } from "../models/NotificationButtonRes"; +import { WorklistsubmitterInfoResponse } from "../models/WorklistsubmitterInfoRes"; +import { WorkListSubmitterInfoRequest } from "../models/WorklistsubmitterInfoReq"; +import { WorkListActionRequest } from "../models/NotificationActionReq"; + +@Injectable() +export class WorklistMainService { + public static getEITNotificationBody = + "Services/ERP.svc/REST/GET_EIT_NOTIFICATION_BODY"; + public static getAbsenceNotificationBody = + "Services/ERP.svc/REST/GET_ABSENCE_NOTIFICATION_BODY"; + public static getNotificationButtons = + "Services/ERP.svc/REST/GET_NOTIFICATION_BUTTONS"; + public static getUserInfo = "Services/ERP.svc/REST/Get_UserInformation"; + public static getNotificationAction = + "Services/ERP.svc/REST/NOTIFICATION_ACTIONS"; + public static getNotificationRespondAtt = + "Services/ERP.svc/REST/NOTIFICATION_GET_RESPOND_ATTRIBUTES"; + constructor( + public api: ConnectorService, + public authService: AuthenticationService + ) {} + + public getEITNotificationBody( + WorkListBodyRequest: any, + onError?: any, + errorLabel?: string + ): Observable { + const request = WorkListBodyRequest; + this.authService.authenticateRequest(request); + return this.api.post( + WorklistMainService.getEITNotificationBody, + request, + onError, + errorLabel + ); + } + + public getAbsencesNotificationBody( + WorkListBodyRequest: any, + onError?: any, + errorLabel?: string + ): Observable { + const request = WorkListBodyRequest; + this.authService.authenticateRequest(request); + return this.api.post( + WorklistMainService.getAbsenceNotificationBody, + request, + onError, + errorLabel + ); + } + + public getNotificationButtons( + WorkListButtonRequest: any, + onError?: any, + errorLabel?: string + ): Observable { + const request = WorkListButtonRequest; + this.authService.authenticateRequest(request); + return this.api.post( + WorklistMainService.getNotificationButtons, + request, + onError, + errorLabel + ); + } + + public getSubmitterInfo( + worklistsubmitterInfoObj: any, + onError?: any, + errorLabel?: string + ): Observable { + const request = worklistsubmitterInfoObj; + this.authService.authenticateRequest(request); + return this.api.post( + WorklistMainService.getUserInfo, + request, + onError, + errorLabel + ); + } + + public actionButton( + WorkListActionRequest: any, + onError?: any, + errorLabel?: string + ): Observable { + const request = WorkListActionRequest; + this.authService.authenticateRequest(request); + return this.api.post( + WorklistMainService.getNotificationAction, + request, + onError, + errorLabel + ); + } + + public notificationResponseAttr( + notifiResAttRequest: any, + onError?: any, + errorLabel?: string + ): Observable { + const request = notifiResAttRequest; + this.authService.authenticateRequest(request); + return this.api.post( + WorklistMainService.getNotificationRespondAtt, + request, + onError, + errorLabel + ); + } +} diff --git a/Mohem/src/app/notification/worklist-main/worklist-main.component.html b/Mohem/src/app/notification/worklist-main/worklist-main.component.html new file mode 100644 index 00000000..a4bda127 --- /dev/null +++ b/Mohem/src/app/notification/worklist-main/worklist-main.component.html @@ -0,0 +1,128 @@ + + + {{ts.trPK('worklistMain','title')}} + + + + + + + {{pInformation}} + + + + {{ts.trPK('worklistMain','info')}} + + + + + + + {{ts.trPK('worklistMain','from')}} + + + + + {{getPassNotificationDetails.FROM_USER}} + + + + + + {{ts.trPK('worklistMain','to')}} + + + + {{getPassNotificationDetails.TO_USER}} + + + + + + {{ts.trPK('worklistMain','sent')}} + + + + {{getPassNotificationDetails.BEGIN_DATE}} + + + + + {{ts.trPK('worklistMain','closed')}} + + + + {{getPassNotificationDetails.END_DATE}} + + + + + {{ts.trPK('worklistMain','id')}} + + + + {{getPassNotificationDetails.NOTIFICATION_ID}} + + + + + {{ts.trPK('worklistMain','responder')}} + + + + {{getPassNotificationDetails.RESPONDER}} + + + + + + {{ts.trPK('worklistMain','subject')}} + + + {{getPassNotificationDetails.SUBJECT}} + + + + + + {{ts.trPK('worklistMain','notfDetails')}} + + + + + + {{ts.trPK('worklistMain','actionHis')}} + + + + + + {{ts.trPK('worklistMain','suppDoc')}} + + + + + + + + + + + + + + + + 0" class="requiredItem"> + {{'worklistMain.action' | translate}} + + {{notificationButtons.BUTTON_LABEL}} + + + + + + + {{ts.trPK('general','submit')}} + + \ No newline at end of file diff --git a/Mohem/src/app/notification/worklist-main/worklist-main.component.scss b/Mohem/src/app/notification/worklist-main/worklist-main.component.scss new file mode 100644 index 00000000..a7559014 --- /dev/null +++ b/Mohem/src/app/notification/worklist-main/worklist-main.component.scss @@ -0,0 +1,70 @@ +.tipsPadding{ + padding: 10px 10px; + border-radius: 10px; + margin: 10px; + border: 2px solid #e4e5e7; + color: var(--customnavy); + + } + + .actionBtn{ + + height: auto; + min-height: 35px !important; + padding: 10px; + font-size: 12px; + white-space: normal; + + } + button.actionBtn.button.button-md, + button.actionBtn.button.button-ios, + button.actionBtn.button.button + { + width: 90%; + } + .actionBtnCol{ + text-align: center; + } + .actionBtnGrid{ + + padding:0px; + } + .notColBtn { + + min-height: 150px !important; + padding: 0px; + p{ + color: var(--secondary); + margin-top: 0px; margin-bottom:0px; + font-weight: normal; + font-size: 14px; + white-space: normal; + padding: 3px 0px; + min-height: 50px; + } + span { + display: block; + + } + + .serviceItemImg { + min-width: 60px !important; + min-height: 70px !important; + width: 70px; + height: 70px; + margin: 10px auto; + background: transparent !important; + } + + } + .notColBtn.button,.notColBtn.button-md, .notColBtn.button-ios{ + background: transparent !important; + color: var(--dark); + box-shadow: none; + -webkit-box-shadow:none; + -moz-box-shadow: none; + padding: 0px; + color: var(--secondary); + border: 2px solid var(--gray); + min-width: auto; + } \ No newline at end of file diff --git a/Mohem/src/app/notification/worklist-main/worklist-main.component.spec.ts b/Mohem/src/app/notification/worklist-main/worklist-main.component.spec.ts new file mode 100644 index 00000000..8ffd4ce0 --- /dev/null +++ b/Mohem/src/app/notification/worklist-main/worklist-main.component.spec.ts @@ -0,0 +1,27 @@ +import { CUSTOM_ELEMENTS_SCHEMA } from '@angular/core'; +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; + +import { WorklistMainComponent } from './worklist-main.component'; + +describe('WorklistMainComponent', () => { + let component: WorklistMainComponent; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [ WorklistMainComponent ], + schemas: [CUSTOM_ELEMENTS_SCHEMA], + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(WorklistMainComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/Mohem/src/app/notification/worklist-main/worklist-main.component.ts b/Mohem/src/app/notification/worklist-main/worklist-main.component.ts new file mode 100644 index 00000000..4d329f4b --- /dev/null +++ b/Mohem/src/app/notification/worklist-main/worklist-main.component.ts @@ -0,0 +1,28 @@ +import { Component, OnInit } 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 {WorkListBodyRequest} from '../models/NotificationBodyReq'; +import {EITNotificatonBodyResponse} from '../models/EITNotificationBodyRes'; +import {AbsenceNotificatonBodyResponse} from '../models/AbsenceNotificationBodyRes'; +import {NotificatonButtonResponse} from '../models/NotificationButtonRes'; +import {WorkListActionRequest} from '../models/NotificationActionReq'; +import { WorkListButtonRequest } from '../models/NotificationButtonReq'; +// import { isDate } from 'angular6-json-schema-form'; +import { MenuResponse } from 'src/app/hmg-common/services/menu/models/menu-response'; +import { LoginRequest } from 'src/app/hmg-common/services/authentication/models/login.request'; +import { WorklistMainService } from '../service/work-list.main.service'; +@Component({ + selector: 'app-worklist-main', + templateUrl: './worklist-main.component.html', + styleUrls: ['./worklist-main.component.scss'], +}) +export class WorklistMainComponent implements OnInit { + + constructor( + public common: CommonService, + public ts: TranslatorService, + ) { } + + ngOnInit() {} + +} diff --git a/Mohem/src/assets/localization/i18n.json b/Mohem/src/assets/localization/i18n.json index 528a6fe1..d8e232d7 100644 --- a/Mohem/src/assets/localization/i18n.json +++ b/Mohem/src/assets/localization/i18n.json @@ -700,6 +700,94 @@ "addAttach": { "en": "Add Attachment", "ar": "إضافة مرفق" + }, + "alert": { + "en":"Alert", + "ar":"تنبيه" + }, + "delete": { + "en":"Delete", + "ar":"حذف" + }, + "ok": { + "en":"Ok", + "ar":"موافق" + }, + "cancel":{ + "en": "Cancel", + "ar": "إلغاء" + }, + "next":{ + "en": "Next", + "ar":"التالي" + }, + "save":{ + "en":"Save", + "ar":"حفظ" + }, + "connError": { + "en":"Failed to connect to server.", + "ar":"فشل بالإتصال بالخادم" + }, + "notAttch": { + "en":"There is no attachment", + "ar":"لاتوجد مرفقات" + }, + "enter":{ + "en":"Enter", + "ar":"أدخل" + }, + "search":{ + "en":"Search", + "ar":"بحث" + }, + "submit":{ + "en":"Submit", + "ar":"ارسال" + }, + "success":{ + "en":"Success", + "ar":"تم بنجاح" + }, + "noResult":{ + "en":"No results found", + "ar":"لاتوجد نتائج" + }, + "clear":{ + "en":"Clear", + "ar":"مسح" + }, + "choose":{ + "en":"", + "ar":"" + }, + "noData":{ + "en":"There are no requests", + "ar":"لاتوجد طلبات" + }, + "confirmation":{ + "en":"Confirmation", + "ar":"تأكيد" + }, + "attemptDel":{ + "en":"You are attempting to delete a row that has already been deleted.", + "ar":"أنت تحاول حذف صف تم حذفه بالفعل." + }, + "required":{ + "en":"Please fill the required fields", + "ar":"الرجاء ملء جميع الحقول المطلوبة" + }, + "messageSuccess":{ + "en":"Your request has been submitted for approvals.", + "ar":"تم إرسال طلبك للحصول على الموافقات" + }, + "noOfTriesLogin" :{ + "en": "You reached the maximum number of tries. Please re-try", + "ar":"لقد وصلت إلى الحد الأقصى لعدد المحاولات. يرجى إعادةالمحاولة مرة أخرى" + }, + "deletePerm":{ + "en":"Are you sure from deleting this file permanently?", + "ar":"هل أنت متأكد من حذف هذا الملف نهائيًا؟" } }, "home": {
{{ts.trPK('worklistMain','notfDetails')}}
{{ts.trPK('worklistMain','actionHis')}}
{{ts.trPK('worklistMain','suppDoc')}}