worklist-main added
parent
8b5436ced6
commit
16e26719f0
@ -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() {}
|
||||
|
||||
}
|
||||
Loading…
Reference in New Issue