worklist-main added

production
Sultan Khan 7 years ago
parent 8b5436ced6
commit 16e26719f0

@ -1,10 +1,15 @@
<ion-header>
<ion-toolbar class="header-toolbar">
<nav-buttons></nav-buttons>
<ion-title color="light">{{headerTitle}}</ion-title>
<ion-buttons slot="start">
<nav-buttons></nav-buttons>
</ion-buttons>
</ion-toolbar>
</ion-header>
<ion-content padding>
<ion-list>

@ -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);

@ -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
}

@ -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]
})

@ -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<EITNotificatonBodyResponse> {
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<AbsenceNotificatonBodyResponse> {
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<NotificatonButtonResponse> {
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<WorklistsubmitterInfoResponse> {
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<any> {
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<any> {
const request = notifiResAttRequest;
this.authService.authenticateRequest(request);
return this.api.post(
WorklistMainService.getNotificationRespondAtt,
request,
onError,
errorLabel
);
}
}

@ -0,0 +1,128 @@
<ion-header >
<ion-toolbar class="header-toolbar">
<ion-title color="light"> {{ts.trPK('worklistMain','title')}}</ion-title>
<ion-buttons slot="start">
<nav-buttons></nav-buttons>
</ion-buttons>
</ion-toolbar>
</ion-header>
<ion-content>
<div *ngIf="pInformation && pInformation != '' " class="tipsPadding">{{pInformation}}</div>
<ion-card>
<ion-card-header class="boxHdr">
<div class="hrTitle"> {{ts.trPK('worklistMain','info')}} </div>
</ion-card-header>
<ion-card-content>
<div>
<ion-grid>
<ion-row>
<ion-col class="colBold">
<label for=""> {{ts.trPK('worklistMain','from')}}
</label>
</ion-col>
<ion-col>
<label for="">{{getPassNotificationDetails.FROM_USER}}</label>
</ion-col>
</ion-row>
<ion-row>
<ion-col class="colBold">
<label for="">{{ts.trPK('worklistMain','to')}}
</label>
</ion-col>
<ion-col>
<label for=""> {{getPassNotificationDetails.TO_USER}}</label>
</ion-col>
</ion-row>
<ion-row>
<ion-col class="colBold">
<label for="">{{ts.trPK('worklistMain','sent')}}
</label>
</ion-col>
<ion-col>
<label for="">{{getPassNotificationDetails.BEGIN_DATE}}</label>
</ion-col>
</ion-row>
<ion-row>
<ion-col class="colBold">
<label for="">{{ts.trPK('worklistMain','closed')}}
</label>
</ion-col>
<ion-col>
<label for="">{{getPassNotificationDetails.END_DATE}}</label>
</ion-col>
</ion-row>
<ion-row>
<ion-col class="colBold">
<label for="">{{ts.trPK('worklistMain','id')}}
</label>
</ion-col>
<ion-col>
<label for="">{{getPassNotificationDetails.NOTIFICATION_ID}}</label>
</ion-col>
</ion-row>
<ion-row *ngIf=" getPassNotificationDetails.RESPONDER != '' ">
<ion-col class="colBold">
<label for="">{{ts.trPK('worklistMain','responder')}}
</label>
</ion-col>
<ion-col>
<label for="">{{getPassNotificationDetails.RESPONDER}} </label>
</ion-col>
</ion-row>
<ion-row>
<ion-col class="colBold">
<label for="">{{ts.trPK('worklistMain','subject')}} </label>
</ion-col>
<ion-col>
<label for="">{{getPassNotificationDetails.SUBJECT}} </label>
</ion-col>
</ion-row>
<ion-row>
<ion-col class="greenTxt" col-4>
<button ion-button block class="notColBtn" (click)="openNotificationBody()">
<p>{{ts.trPK('worklistMain','notfDetails')}} </p>
<ion-img class="serviceItemImg" src="../assets/imgs/details.png"></ion-img>
</button>
</ion-col>
<ion-col class="greenTxt" col-4>
<button ion-button block class="notColBtn" (click)="openActionHistory()">
<p>{{ts.trPK('worklistMain','actionHis')}}</p>
<ion-img class="serviceItemImg" src="../assets/imgs/actionHistory.png"></ion-img>
</button>
</ion-col>
<ion-col class="greenTxt" col-4>
<button ion-button block class="notColBtn" (click)="openSupportDocuments()">
<p>{{ts.trPK('worklistMain','suppDoc')}}</p>
<ion-img class="serviceItemImg" src="../assets/imgs/documents.png"></ion-img>
</button>
</ion-col>
</ion-row>
</ion-grid>
</div>
</ion-card-content>
</ion-card>
<div>
<json-schema-form *ngIf="schemaNotific" [form]="schemaNotific" [(ngModel)]="notExampleJsonObject">
</json-schema-form>
</div>
<ion-item *ngIf="notificationButtonRes?.length >0" class="requiredItem">
<ion-label class="boldTxtNav">{{'worklistMain.action' | translate}} </ion-label>
<ion-select okText="{{ts.trPK('general','ok')}}" cancelText="{{ts.trPK('general','cancel')}}" [(ngModel)]="actionType" required >
<ion-option value= "{{notificationButtons.BUTTON_ACTION}}" *ngFor="let notificationButtons of notificationButtonRes; let i=index;">{{notificationButtons.BUTTON_LABEL}}</ion-option>
</ion-select>
</ion-item>
</ion-content>
<ion-footer>
<div class="centerDiv" >
<button ion-button class="gridBtn" (click)="actionButton()"> {{ts.trPK('general','submit')}}</button>
</div>
</ion-footer>

@ -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;
}

@ -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<WorklistMainComponent>;
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();
});
});

@ -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() {}
}

@ -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": {

Loading…
Cancel
Save