absence list added
commit
a3d58d4b1c
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,35 @@
|
||||
import { NgModule } from '@angular/core';
|
||||
import { CommonModule } from '@angular/common';
|
||||
import { FormsModule } from '@angular/forms';
|
||||
import { Routes, RouterModule } from '@angular/router';
|
||||
import { AbsenceListService } from "./service/service.service";
|
||||
import { IonicModule } from '@ionic/angular';
|
||||
|
||||
import { AbsencePage } from './absence.page';
|
||||
|
||||
import { HomeComponent } from './home/home.component';
|
||||
|
||||
const routes: Routes = [
|
||||
{
|
||||
path: '',
|
||||
component: AbsencePage,
|
||||
children: [
|
||||
{
|
||||
path: 'home',
|
||||
component: HomeComponent
|
||||
}
|
||||
]
|
||||
}
|
||||
];
|
||||
|
||||
@NgModule({
|
||||
imports: [
|
||||
CommonModule,
|
||||
FormsModule,
|
||||
IonicModule,
|
||||
RouterModule.forChild(routes)
|
||||
],
|
||||
providers:[AbsenceListService],
|
||||
declarations: [AbsencePage, HomeComponent]
|
||||
})
|
||||
export class AbsencePageModule {}
|
||||
@ -0,0 +1,6 @@
|
||||
|
||||
|
||||
|
||||
<ion-content>
|
||||
<ion-router-outlet></ion-router-outlet>
|
||||
</ion-content>
|
||||
@ -0,0 +1,27 @@
|
||||
import { CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
|
||||
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
|
||||
import { AbsencePage } from './absence.page';
|
||||
|
||||
describe('AbsencePage', () => {
|
||||
let component: AbsencePage;
|
||||
let fixture: ComponentFixture<AbsencePage>;
|
||||
|
||||
beforeEach(async(() => {
|
||||
TestBed.configureTestingModule({
|
||||
declarations: [ AbsencePage ],
|
||||
schemas: [CUSTOM_ELEMENTS_SCHEMA],
|
||||
})
|
||||
.compileComponents();
|
||||
}));
|
||||
|
||||
beforeEach(() => {
|
||||
fixture = TestBed.createComponent(AbsencePage);
|
||||
component = fixture.componentInstance;
|
||||
fixture.detectChanges();
|
||||
});
|
||||
|
||||
it('should create', () => {
|
||||
expect(component).toBeTruthy();
|
||||
});
|
||||
});
|
||||
@ -0,0 +1,15 @@
|
||||
import { Component, OnInit } from '@angular/core';
|
||||
|
||||
@Component({
|
||||
selector: 'app-absence',
|
||||
templateUrl: './absence.page.html',
|
||||
styleUrls: ['./absence.page.scss'],
|
||||
})
|
||||
export class AbsencePage implements OnInit {
|
||||
|
||||
constructor() { }
|
||||
|
||||
ngOnInit() {
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,116 @@
|
||||
<ion-header >
|
||||
<ion-toolbar class="header-toolbar">
|
||||
<ion-title color="light">{{ts.trPK('absenceList','absenceList')}}</ion-title>
|
||||
<ion-buttons slot="start">
|
||||
<ion-back-button color="light" class="btnBack"></ion-back-button>
|
||||
</ion-buttons>
|
||||
<ion-buttons slot="end">
|
||||
<button class="headerBtn" (click)="AccrualBalances()">
|
||||
<img class="headerImg" src="../assets/imgs/accubalance.png">
|
||||
</button>
|
||||
</ion-buttons>
|
||||
</ion-toolbar>
|
||||
</ion-header>
|
||||
|
||||
|
||||
<ion-content padding>
|
||||
|
||||
<div class="no-dataDiv" *ngIf="!GetAbsenceTransactionList || GetAbsenceTransactionList.length <= 0" >
|
||||
<ion-row>
|
||||
<img class="empty-data" src="../assets/imgs/noData.png"/>
|
||||
|
||||
|
||||
</ion-row>
|
||||
<h4> {{ts.trPK('general','noData')}}</h4>
|
||||
</div>
|
||||
|
||||
<div *ngIf="GetAbsenceTransactionList && GetAbsenceTransactionList.length > 0 ">
|
||||
<ion-card *ngFor="let item of GetAbsenceTransactionList; let i=index;">
|
||||
|
||||
<ion-card-header class="boxHdr">
|
||||
<div class="hrTitle">{{ts.trPK('absenceList','absHeader')}}</div>
|
||||
<button ion-button *ngIf="item.ATTACHMENT_EXIST=='Y'" (click)="AttachmentDocuments(item.ABSENCE_ATTENDANCE_ID)">
|
||||
<img class="imgSize" src="../assets/imgs/attachment.png"></button>
|
||||
</ion-card-header>
|
||||
<ion-card-content>
|
||||
<ion-grid>
|
||||
<div>
|
||||
<ion-row>
|
||||
<ion-col class="colBold">
|
||||
<label for="">{{ts.trPK('absenceList','startDate')}} </label>
|
||||
</ion-col>
|
||||
<ion-col>
|
||||
<label for=""> {{item.START_DATE}}</label>
|
||||
</ion-col>
|
||||
</ion-row>
|
||||
<ion-row>
|
||||
<ion-col class="colBold">
|
||||
<label for="">{{ts.trPK('absenceList','endDate')}}</label>
|
||||
</ion-col>
|
||||
<ion-col>
|
||||
<label for=""> {{item.END_DATE}}</label>
|
||||
</ion-col>
|
||||
</ion-row>
|
||||
<ion-row>
|
||||
<ion-col class="colBold">
|
||||
<label for="">{{ts.trPK('absenceList','absenceType')}} </label>
|
||||
</ion-col>
|
||||
<ion-col>
|
||||
<label for="">{{item.ABSENCE_TYPE}}</label>
|
||||
</ion-col>
|
||||
</ion-row>
|
||||
<ion-row>
|
||||
<ion-col class="colBold">
|
||||
<label for="">{{ts.trPK('absenceList','absenceCategory')}}</label>
|
||||
</ion-col>
|
||||
<ion-col>
|
||||
<label for="">{{item.ABSENCE_CATEGORY}}</label>
|
||||
</ion-col>
|
||||
</ion-row>
|
||||
<ion-row>
|
||||
<ion-col class="colBold">
|
||||
<label for="">{{ts.trPK('absenceList','days')}}</label>
|
||||
</ion-col>
|
||||
<ion-col>
|
||||
<label for="">{{item.ABSENCE_DAYS}}</label>
|
||||
</ion-col>
|
||||
</ion-row>
|
||||
<ion-row>
|
||||
<ion-col class="colBold">
|
||||
<label for="">{{ts.trPK('absenceList','hours')}}</label>
|
||||
</ion-col>
|
||||
<ion-col>
|
||||
<label for="">{{item.ABSENCE_HOURS}}</label>
|
||||
</ion-col>
|
||||
</ion-row>
|
||||
<ion-row>
|
||||
<ion-col class="colBold">
|
||||
<label for="">{{ts.trPK('absenceList','approvalStatus')}}</label>
|
||||
</ion-col>
|
||||
<ion-col>
|
||||
<label for="">{{item.APPROVAL_STATUS}}</label>
|
||||
</ion-col>
|
||||
</ion-row>
|
||||
<ion-row>
|
||||
<ion-col class="colBold">
|
||||
<label for="">{{ts.trPK('absenceList','absenceStatus')}}</label>
|
||||
</ion-col>
|
||||
<ion-col>
|
||||
<label for="">{{item.ABSENCE_STATUS}}</label>
|
||||
</ion-col>
|
||||
</ion-row>
|
||||
</div>
|
||||
</ion-grid>
|
||||
</ion-card-content>
|
||||
</ion-card>
|
||||
|
||||
</div>
|
||||
<ion-infinite-scroll (ionInfinite)="doInfinite($event)">
|
||||
<ion-infinite-scroll-content></ion-infinite-scroll-content>
|
||||
</ion-infinite-scroll>
|
||||
</ion-content>
|
||||
<ion-footer>
|
||||
<div class="centerDiv">
|
||||
<ion-button color="customnavy" class="gridBtn" (click)="CreateAbsence()">{{ts.trPK('absenceList','createAbs')}}</ion-button>
|
||||
</div>
|
||||
</ion-footer>
|
||||
@ -0,0 +1,27 @@
|
||||
import { CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
|
||||
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
|
||||
import { HomeComponent } from './home.component';
|
||||
|
||||
describe('HomeComponent', () => {
|
||||
let component: HomeComponent;
|
||||
let fixture: ComponentFixture<HomeComponent>;
|
||||
|
||||
beforeEach(async(() => {
|
||||
TestBed.configureTestingModule({
|
||||
declarations: [ HomeComponent ],
|
||||
schemas: [CUSTOM_ELEMENTS_SCHEMA],
|
||||
})
|
||||
.compileComponents();
|
||||
}));
|
||||
|
||||
beforeEach(() => {
|
||||
fixture = TestBed.createComponent(HomeComponent);
|
||||
component = fixture.componentInstance;
|
||||
fixture.detectChanges();
|
||||
});
|
||||
|
||||
it('should create', () => {
|
||||
expect(component).toBeTruthy();
|
||||
});
|
||||
});
|
||||
@ -0,0 +1,145 @@
|
||||
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 { MenuResponse } from "src/app/hmg-common/services/menu/models/menu-response";
|
||||
import { MenuService } from "src/app/hmg-common/services/menu/menuservice.service";
|
||||
import { AbsenceAttahcmentResponse } from "../models/abs.attach.response";
|
||||
import { AbsenceListService } from "../service/service.service";
|
||||
@Component({
|
||||
selector: "app-home",
|
||||
templateUrl: "./home.component.html",
|
||||
styleUrls: ["./home.component.scss"]
|
||||
})
|
||||
export class HomeComponent implements OnInit {
|
||||
P_PAGE_NUM: number;
|
||||
P_PAGE_LIMIT: number;
|
||||
GetAbsenceTransactionList: any;
|
||||
IsReachEnd: boolean = false;
|
||||
selEmp: string = "";
|
||||
respID: number;
|
||||
selMenu: MenuResponse;
|
||||
constructor(
|
||||
public common: CommonService,
|
||||
public ts: TranslatorService,
|
||||
public menuService: MenuService,
|
||||
public absService: AbsenceListService
|
||||
) {}
|
||||
|
||||
ngOnInit() {
|
||||
this.selMenu = this.common.sharedService.getSharedData(
|
||||
MenuResponse.SHARED_DATA,
|
||||
true
|
||||
);
|
||||
this.selEmp = this.common.sharedService.getSharedData(
|
||||
MenuResponse.SHARED_SEL_EMP,
|
||||
true
|
||||
);
|
||||
this.respID = this.common.sharedService.getSharedData(
|
||||
MenuResponse.SHARED_SEL_RESP_ID,
|
||||
true
|
||||
);
|
||||
this.getAbsenceTransaction();
|
||||
}
|
||||
|
||||
AccrualBalances() {
|
||||
this.common.openAccuralPage();
|
||||
}
|
||||
AttachmentDocuments(id) {
|
||||
const request = {
|
||||
P_ABSENCE_ATTENDANCE_ID: id
|
||||
};
|
||||
this.absService
|
||||
.getAbsenceAttachment(request)
|
||||
.subscribe((result: AbsenceAttahcmentResponse) => {
|
||||
this.handleAbsAttachResult(result);
|
||||
});
|
||||
}
|
||||
|
||||
private handleAbsAttachResult(result) {
|
||||
if (this.common.validResponse(result)) {
|
||||
if (this.common.hasData(result.GetAbsenceAttachmentsList)) {
|
||||
this.common.sharedService.setSharedData(
|
||||
result.GetAbsenceAttachmentsList,
|
||||
AbsenceAttahcmentResponse.SHARED_DATA
|
||||
);
|
||||
// this.navCtrl.push("AbsenceAttachmentPage");
|
||||
} else {
|
||||
let msg: string = "";
|
||||
// msg=this.translate.translate("general.notAttch");
|
||||
// this.common.showAlert(msg);
|
||||
}
|
||||
//this.GetAbsenceTransactionList =result.GetAbsenceTransactionList;
|
||||
}
|
||||
}
|
||||
getAbsenceTransaction() {
|
||||
this.IsReachEnd = false;
|
||||
const request = {
|
||||
P_SELECTED_EMPLOYEE_NUMBER: this.selEmp,
|
||||
P_MENU_TYPE: this.selMenu.List_Menu.MENU_TYPE,
|
||||
P_SELECTED_RESP_ID: this.respID,
|
||||
P_PAGE_NUM: this.P_PAGE_NUM,
|
||||
P_PAGE_LIMIT: this.P_PAGE_LIMIT
|
||||
};
|
||||
this.absService.getAbsenceList(request).subscribe((result: any) => {
|
||||
this.handleAbsListResult(result);
|
||||
});
|
||||
}
|
||||
|
||||
private handleAbsListResult(result) {
|
||||
if (this.common.validResponse(result)) {
|
||||
if (this.common.hasData(result.GetAbsenceTransactionList)) {
|
||||
this.GetAbsenceTransactionList = result.GetAbsenceTransactionList;
|
||||
this.P_PAGE_NUM++;
|
||||
let lastItemIndex = this.GetAbsenceTransactionList.length - 1;
|
||||
if (result.GetAbsenceTransactionList[lastItemIndex]) {
|
||||
let lastitem = result.GetAbsenceTransactionList[lastItemIndex];
|
||||
if (lastitem.NO_OF_ROWS == lastitem.ROW_NUM) {
|
||||
this.IsReachEnd = true;
|
||||
} else {
|
||||
this.IsReachEnd = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
doInfinite(infiniteScroll) {
|
||||
if (!this.IsReachEnd) {
|
||||
//this.P_PAGE_NUM++;
|
||||
const request = {
|
||||
P_SELECTED_EMPLOYEE_NUMBER: this.selEmp,
|
||||
P_MENU_TYPE: this.selMenu.List_Menu.MENU_TYPE,
|
||||
P_SELECTED_RESP_ID: this.respID,
|
||||
P_PAGE_NUM: this.P_PAGE_NUM,
|
||||
P_PAGE_LIMIT: this.P_PAGE_LIMIT
|
||||
};
|
||||
this.absService.getAbsenceList(request).subscribe(
|
||||
(result: any) => {
|
||||
if (this.common.validResponse(result)) {
|
||||
if (this.common.hasData(result.GetWorkList)) {
|
||||
this.P_PAGE_NUM++;
|
||||
result.GetAbsenceTransactionList.forEach(vr => {
|
||||
if (vr.ROW_NUM == vr.NO_OF_ROWS) {
|
||||
this.IsReachEnd = true;
|
||||
} else {
|
||||
this.IsReachEnd = false;
|
||||
}
|
||||
this.GetAbsenceTransactionList.push(vr);
|
||||
// this.pro.GetVacationRulesList.push(vr);
|
||||
});
|
||||
} else {
|
||||
this.IsReachEnd = true;
|
||||
}
|
||||
}
|
||||
//this.P_PAGE_NUM++;
|
||||
if (infiniteScroll) infiniteScroll.complete();
|
||||
|
||||
// console.log(resFlag);
|
||||
},
|
||||
Error => console.log(Error),
|
||||
() => infiniteScroll.complete()
|
||||
);
|
||||
} else {
|
||||
if (infiniteScroll) infiniteScroll.complete();
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,6 @@
|
||||
import {Response} from './response'
|
||||
import {AbsenceAttahcment} from './abs.attach'
|
||||
export class AbsenceAttahcmentResponse extends Response{
|
||||
public static SHARED_DATA = 'absence-attachment';
|
||||
public GetAbsenceAttachmentsList :AbsenceAttahcment[];
|
||||
}
|
||||
@ -0,0 +1,16 @@
|
||||
export class AbsenceAttahcment{
|
||||
public SEQ_NUM:number;
|
||||
public ATTACHED_DOCUMENT_ID:number;
|
||||
public FILE_NAME: string;
|
||||
public DOCUMENT_ID: number;
|
||||
public FILE_DATA: string;
|
||||
public CATEGORY_ID: number;
|
||||
public PK1_VALUE: string;
|
||||
public DATATYPE_ID: number;
|
||||
public PK2_VALUE: string;
|
||||
public ENTITY_NAME: string;
|
||||
public PK3_VALUE: string;
|
||||
public FILE_ID: number;
|
||||
public PK4_VALUE: string;
|
||||
public PK5_VALUE: string;
|
||||
}
|
||||
@ -0,0 +1,41 @@
|
||||
import {Response} from './response'
|
||||
export class AbsenceDffResponse extends Response{
|
||||
public static SHARED_DATA = 'absence_dff_resp';
|
||||
public P_TRANSACTION_ID:number;
|
||||
public APPLICATION_COLUMN_NAME:string;
|
||||
public USED_FLAG:string;
|
||||
public DESC_FLEX_NAME:string;
|
||||
public DESC_FLEX_CONTEXT_CODE:string;
|
||||
public DESC_FLEX_CONTEXT_NAME:string;
|
||||
public SEGMENT_SEQ_NUM:number;
|
||||
public SEGMENT_NAME:string;
|
||||
public SEGMENT_PROMPT:string;
|
||||
public ENABLED_FLAG:string;
|
||||
public REQUIRED_FLAG:string;
|
||||
public DISPLAY_FLAG :string;
|
||||
public READ_ONLY:string;
|
||||
public DEFAULT_TYPE:string;
|
||||
public DEFAULT_VALUE:string;
|
||||
public LONGLIST_FLAG:string;
|
||||
public FLEX_VALUE_SET_NAME:string;
|
||||
public VALIDATION_TYPE :string;
|
||||
public VALIDATION_TYPE_DSP :string;
|
||||
public FORMAT_TYPE :string;
|
||||
public FORMAT_TYPE_DSP :string;
|
||||
public MAXIMUM_SIZE: number;
|
||||
public ALPHANUMERIC_ALLOWED_FLAG :string;
|
||||
public UPPERCASE_ONLY_FLAG :string;
|
||||
public NUMERIC_MODE_ENABLED_FLAG:string;
|
||||
public NUMBER_PRECISION :string;
|
||||
public MINIMUM_VALUE :string;
|
||||
public MAXIMUM_VALUE :string;
|
||||
public PARENT_SEGMENTS_VS :string;
|
||||
public PARENT_SEGMENTS_DV :string;
|
||||
public MOBILE_ENABLED :string;
|
||||
public CHILD_SEGMENTS_DV :string;
|
||||
public PARENT_SEGMENTS_VS_SplitedVS:any;
|
||||
public CHILD_SEGMENTS_VS_Splited:any;
|
||||
public CHILD_SEGMENTS_VS:string;
|
||||
public PARENT_SEGMENTS_DV_Splited: any;
|
||||
public CHILD_SEGMENTS_DV_Splited: any;
|
||||
}
|
||||
@ -0,0 +1,5 @@
|
||||
import {Response} from './response'
|
||||
export class AbsenceResponse extends Response{
|
||||
public static SHARED_DATA = 'absence_tr_id';
|
||||
public P_TRANSACTION_ID:number;
|
||||
}
|
||||
@ -0,0 +1,43 @@
|
||||
import { Request } from './request';
|
||||
|
||||
export class AbsenceTransaction extends Request{
|
||||
public static SHARED_DATA = 'absence_transaction';
|
||||
|
||||
|
||||
public P_SELECTED_EMPLOYEE_NUMBER:string;
|
||||
public P_MENU_TYPE :string;
|
||||
public P_SELECTED_RESP_ID:number;
|
||||
public P_FUNCTION_NAME :string;
|
||||
public P_ABSENCE_ACTION :string;
|
||||
public P_ABSENCE_ATTENDANCE_ID = null;
|
||||
public P_ITEM_KEY: string ;
|
||||
public P_ABSENCE_ATTENDANCE_TYPE_ID: number ;
|
||||
public P_DATE_START: string ;
|
||||
public P_DATE_END: string ;
|
||||
public P_TIME_START:string ;
|
||||
public P_TIME_END:string ;
|
||||
public P_DESC_FLEX_CONTEXT_CODE:string ;
|
||||
public P_REPLACEMENT_USER_NAME:string ;
|
||||
public P_ATTRIBUTE1:string ;
|
||||
public P_ATTRIBUTE2 :string ;
|
||||
public P_ATTRIBUTE3:string ;
|
||||
public P_ATTRIBUTE4 :string ;
|
||||
public P_ATTRIBUTE5 :string ;
|
||||
public P_ATTRIBUTE6 :string ;
|
||||
public P_ATTRIBUTE7 :string ;
|
||||
public P_ATTRIBUTE8 :string ;
|
||||
public P_ATTRIBUTE9 :string ;
|
||||
public P_ATTRIBUTE10 :string ;
|
||||
public P_ATTRIBUTE11 :string ;
|
||||
public P_ATTRIBUTE12 :string ;
|
||||
public P_ATTRIBUTE13 :string ;
|
||||
public P_ATTRIBUTE14 :string ;
|
||||
public P_ATTRIBUTE15 :string ;
|
||||
public P_ATTRIBUTE16 :string;
|
||||
public P_ATTRIBUTE17 :string;
|
||||
public P_ATTRIBUTE18 :string;
|
||||
public P_ATTRIBUTE19 :string;
|
||||
public P_ATTRIBUTE20 :string;
|
||||
public P_ABSENCE_COMMENTS:string;
|
||||
|
||||
}
|
||||
@ -0,0 +1,9 @@
|
||||
export class ApproversList {
|
||||
public LINE_NO:number;
|
||||
public APPROVER:string;
|
||||
public APPROVER_TYPE:string;
|
||||
public ROW_NUM:number;
|
||||
public NO_OF_ROWS:number;
|
||||
}
|
||||
|
||||
|
||||
@ -0,0 +1,18 @@
|
||||
export class Request {
|
||||
public P_USER_NAME: string;
|
||||
public LanguageID: number;
|
||||
//public IPAdress: string;
|
||||
public P_SESSION_ID: number;
|
||||
public VersionID: number;
|
||||
public Channel: number;
|
||||
public P_PASSWORD: string;
|
||||
public P_MOBILE_NUMBER: string;
|
||||
public P_EMAIL_ADDRESS: string;
|
||||
public TokenID:string;
|
||||
public P_NOTIFICATION_ID:number;
|
||||
public MobileNumber: string;
|
||||
public UserName:string;
|
||||
public LogInTokenID:string;
|
||||
public MobileType:string;
|
||||
|
||||
}
|
||||
@ -0,0 +1,11 @@
|
||||
export class Response {
|
||||
public LanguageID?: number;
|
||||
public ErrorCode:string;
|
||||
public ErrorEndUserMessage:string;
|
||||
public ErrorMessage:string;
|
||||
public ErrorType: number;
|
||||
public MessageStatus: number;
|
||||
public SuccessMsg:string;
|
||||
public SuccessMsgN:string;
|
||||
public IsAuthenticated:boolean;
|
||||
}
|
||||
@ -0,0 +1,12 @@
|
||||
import { TestBed } from '@angular/core/testing';
|
||||
|
||||
import { ServiceService } from './service.service';
|
||||
|
||||
describe('ServiceService', () => {
|
||||
beforeEach(() => TestBed.configureTestingModule({}));
|
||||
|
||||
it('should be created', () => {
|
||||
const service: ServiceService = TestBed.get(ServiceService);
|
||||
expect(service).toBeTruthy();
|
||||
});
|
||||
});
|
||||
@ -0,0 +1,29 @@
|
||||
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 {AbsenceTransaction} from '../models/absence.transaction'
|
||||
import {AbsenceAttahcmentResponse} from '../models/abs.attach.response'
|
||||
|
||||
@Injectable()
|
||||
export class AbsenceListService {
|
||||
public static getAbsenceTransaction='Services/ERP.svc/REST/GET_ABSENCE_TRANSACTIONS';
|
||||
public static getAbsenceAttachment='Services/ERP.svc/REST/GET_ABSENCE_ATTACHMENTS';
|
||||
constructor(
|
||||
public api: ConnectorService,
|
||||
public authService: AuthenticationService,
|
||||
|
||||
) { }
|
||||
|
||||
public getAbsenceList(absence: any, onError?: any, errorLabel?: string): Observable<AbsenceTransaction> {
|
||||
const request = absence;
|
||||
this.authService.authenticateRequest(request);
|
||||
return this.api.post(AbsenceListService.getAbsenceTransaction, request, onError, errorLabel);
|
||||
}
|
||||
public getAbsenceAttachment(absence: any, onError?: any, errorLabel?: string): Observable<AbsenceAttahcmentResponse> {
|
||||
const request = absence;
|
||||
this.authService.authenticateRequest(request);
|
||||
return this.api.post(AbsenceListService.getAbsenceAttachment, request, onError, errorLabel);
|
||||
}
|
||||
|
||||
}
|
||||
@ -1,25 +1,27 @@
|
||||
import { NgModule } from '@angular/core';
|
||||
import { PreloadAllModules, RouterModule, Routes } from '@angular/router';
|
||||
import { NgModule } from '@angular/core';
|
||||
import { PreloadAllModules, RouterModule, Routes } from '@angular/router';
|
||||
|
||||
const routes: Routes = [
|
||||
{ path: '', redirectTo: 'authentication/login', pathMatch: 'full' },
|
||||
{
|
||||
path: 'authentication', loadChildren: './authentication/authentication.module#AuthenticationPageModule',
|
||||
data: { preload: true, delay: 1000 }
|
||||
},
|
||||
{ path: 'home', loadChildren: './home/home.module#HomePageModule' },
|
||||
{ path: 'profile', loadChildren: './profile/profile.module#ProfilePageModule' },
|
||||
{ path: 'vacation-rule', loadChildren: './vacation-rule/vacation-rule.module#VacationRulePageModule' },
|
||||
{ path: 'accrual-balances', loadChildren: './accrual-balances/accrual-balances.module#AccrualBalancesPageModule' },
|
||||
{ path: 'my-team', loadChildren: './my-team/my-team.module#MyTeamPageModule' },
|
||||
{ path: 'attendance', loadChildren: './attendance/attendance.module#AttendancePageModule' },
|
||||
{ path: 'eit', loadChildren: './eit/eit.module#EITPageModule' },
{ path: 'absence', loadChildren: './absence/absence.module#AbsencePageModule' }
|
||||
|
||||
const routes: Routes = [
|
||||
{ path: '', redirectTo: 'authentication/login', pathMatch: 'full' },
|
||||
{
|
||||
path: 'authentication', loadChildren: './authentication/authentication.module#AuthenticationPageModule',
|
||||
data: { preload: true, delay: 1000 }
|
||||
},
|
||||
{ path: 'home', loadChildren: './home/home.module#HomePageModule' },
|
||||
{ path: 'profile', loadChildren: './profile/profile.module#ProfilePageModule' },
|
||||
{ path: 'vacation-rule', loadChildren: './vacation-rule/vacation-rule.module#VacationRulePageModule' },
|
||||
{ path: 'accrual-balances', loadChildren: './accrual-balances/accrual-balances.module#AccrualBalancesPageModule' },
|
||||
{ path: 'my-team', loadChildren: './my-team/my-team.module#MyTeamPageModule' },
|
||||
{ path: 'attendance', loadChildren: './attendance/attendance.module#AttendancePageModule' }
|
||||
|
||||
];
|
||||
|
||||
@NgModule({
|
||||
imports: [
|
||||
RouterModule.forRoot(routes, { preloadingStrategy: PreloadAllModules })
|
||||
],
|
||||
exports: [RouterModule]
|
||||
})
|
||||
export class AppRoutingModule { }
|
||||
|
||||
];
|
||||
|
||||
@NgModule({
|
||||
imports: [
|
||||
RouterModule.forRoot(routes, { preloadingStrategy: PreloadAllModules })
|
||||
],
|
||||
exports: [RouterModule]
|
||||
})
|
||||
export class AppRoutingModule { }
|
||||
|
||||
@ -0,0 +1,38 @@
|
||||
import { HmgCommonModule } from 'src/app/hmg-common/hmg-common.module';
|
||||
import { NgModule } from '@angular/core';
|
||||
import { CommonModule } from '@angular/common';
|
||||
import { FormsModule } from '@angular/forms';
|
||||
import { Routes, RouterModule } from '@angular/router';
|
||||
|
||||
import { IonicModule } from '@ionic/angular';
|
||||
|
||||
import { EITPage } from './eit.page';
|
||||
import { HomeComponent } from './home/home.component';
|
||||
|
||||
const routes: Routes = [
|
||||
{
|
||||
path: '',
|
||||
component: EITPage,
|
||||
children: [
|
||||
{
|
||||
path: 'homepage',
|
||||
component: HomeComponent
|
||||
}
|
||||
]
|
||||
}
|
||||
];
|
||||
|
||||
@NgModule({
|
||||
imports: [
|
||||
CommonModule,
|
||||
FormsModule,
|
||||
IonicModule,
|
||||
HmgCommonModule,
|
||||
RouterModule.forChild(routes)
|
||||
],
|
||||
declarations: [
|
||||
EITPage,
|
||||
HomeComponent
|
||||
]
|
||||
})
|
||||
export class EITPageModule { }
|
||||
@ -0,0 +1,3 @@
|
||||
<ion-content>
|
||||
<ion-router-outlet></ion-router-outlet>
|
||||
</ion-content>
|
||||
@ -0,0 +1,27 @@
|
||||
import { CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
|
||||
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
|
||||
import { EITPage } from './eit.page';
|
||||
|
||||
describe('EITPage', () => {
|
||||
let component: EITPage;
|
||||
let fixture: ComponentFixture<EITPage>;
|
||||
|
||||
beforeEach(async(() => {
|
||||
TestBed.configureTestingModule({
|
||||
declarations: [ EITPage ],
|
||||
schemas: [CUSTOM_ELEMENTS_SCHEMA],
|
||||
})
|
||||
.compileComponents();
|
||||
}));
|
||||
|
||||
beforeEach(() => {
|
||||
fixture = TestBed.createComponent(EITPage);
|
||||
component = fixture.componentInstance;
|
||||
fixture.detectChanges();
|
||||
});
|
||||
|
||||
it('should create', () => {
|
||||
expect(component).toBeTruthy();
|
||||
});
|
||||
});
|
||||
@ -0,0 +1,15 @@
|
||||
import { Component, OnInit } from '@angular/core';
|
||||
|
||||
@Component({
|
||||
selector: 'app-eit',
|
||||
templateUrl: './eit.page.html',
|
||||
styleUrls: ['./eit.page.scss'],
|
||||
})
|
||||
export class EITPage implements OnInit {
|
||||
|
||||
constructor() { }
|
||||
|
||||
ngOnInit() {
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,38 @@
|
||||
<ion-header>
|
||||
<ion-toolbar class="header-toolbar">
|
||||
<nav-buttons></nav-buttons>
|
||||
<ion-title color="light">{{headerTitle}}</ion-title>
|
||||
</ion-toolbar>
|
||||
</ion-header>
|
||||
|
||||
<ion-content padding>
|
||||
|
||||
<ion-list>
|
||||
<ion-item lines="none" class="custCollabs ion-item-styling" *ngFor="let menuItem of menu; let i=index"
|
||||
(click)="openPage(menuItem, i);">
|
||||
<ion-row>
|
||||
<!-- Parent Pages -->
|
||||
<ion-col size="12" class="menu-name">
|
||||
<div [ngClass]="{'selectedDiv': selectedMenu == i,'notSelected': selectedMenu != i }">
|
||||
<ion-text>
|
||||
<b>{{menuItem.PROMPT}}</b>
|
||||
|
||||
</ion-text>
|
||||
</div>
|
||||
<!-- Child Pages -->
|
||||
<ion-list [hidden]="selectedMenu != i">
|
||||
<ion-item lines="none" class="childItem" *ngFor="let subPage of menuItem.children;let i2=index" text-wrap
|
||||
(click)="openPage(subPage)">
|
||||
<ion-row>
|
||||
<ion-col size="12" class="menu-name"><span ion-text color="color2"> {{subPage.PROMPT}}</span>
|
||||
</ion-col>
|
||||
</ion-row>
|
||||
</ion-item>
|
||||
</ion-list>
|
||||
</ion-col>
|
||||
</ion-row>
|
||||
<ion-icon [name]="selectedMenu == i? 'ios-arrow-down' : 'ios-arrow-forward'"
|
||||
*ngIf="menuItem.children && menuItem.MENU_ENTRY_TYPE=='MENU'" slot="end" class="arrow-down"></ion-icon>
|
||||
</ion-item>
|
||||
</ion-list>
|
||||
</ion-content>
|
||||
@ -0,0 +1,67 @@
|
||||
ion-item.custCollabs.item.item-block.item-md,
|
||||
ion-item.custCollabs.item.item-block.item-ios {
|
||||
padding: 0px;
|
||||
}
|
||||
|
||||
.ion-item-styling {
|
||||
-webkit-box-shadow: 0px 2px 7px 0px #7f8c8d;
|
||||
-moz-box-shadow: 0px 2px 7px 0px #7f8c8d;
|
||||
box-shadow: 0px 2px 7px 0px #7f8c8d;
|
||||
color: #209a83 !important;
|
||||
border: 0px;
|
||||
border-radius: 5px;
|
||||
line-height: 2;
|
||||
margin: 8px 2px;
|
||||
min-height: 40px;
|
||||
}
|
||||
|
||||
ion-item.item.item-block {
|
||||
.item-inner {
|
||||
border: 0px !important;
|
||||
padding: 0px !important;
|
||||
}
|
||||
|
||||
ion-item.childItem.item.item-block {
|
||||
padding: 0px 5px;
|
||||
width: 100%;
|
||||
ion-label.label.label-md,
|
||||
ion-label.label.label-ios {
|
||||
-webkit-box-shadow: none;
|
||||
-moz-box-shadow: none;
|
||||
box-shadow: none;
|
||||
border-bottom: 1px solid #e4e5e7;
|
||||
border-radius: 0px;
|
||||
color: #000000;
|
||||
}
|
||||
}
|
||||
|
||||
ion-col.menu-name.col {
|
||||
padding: 0px;
|
||||
}
|
||||
|
||||
div.selectedDiv {
|
||||
background: #209a83;
|
||||
color: #ffffff;
|
||||
padding: 0px 10px;
|
||||
min-height: 40px;
|
||||
}
|
||||
div.notSelected {
|
||||
padding: 0px 10px;
|
||||
}
|
||||
// ion-label.label.label-md,
|
||||
// ion-label.label.label-ios {
|
||||
}
|
||||
|
||||
ion-icon::before {
|
||||
line-height: 2;
|
||||
}
|
||||
.arrow-down{
|
||||
position: absolute;
|
||||
top: 0;
|
||||
right:0;
|
||||
}
|
||||
// .list-md > .item-block:last-child .item-inner,
|
||||
// .list-ios > .item-block:last-child .item-inner{
|
||||
|
||||
// border-bottom: 1px solid #dedede;
|
||||
// }
|
||||
@ -0,0 +1,27 @@
|
||||
import { CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
|
||||
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
|
||||
import { HomeComponent } from './home.component';
|
||||
|
||||
describe('HomeComponent', () => {
|
||||
let component: HomeComponent;
|
||||
let fixture: ComponentFixture<HomeComponent>;
|
||||
|
||||
beforeEach(async(() => {
|
||||
TestBed.configureTestingModule({
|
||||
declarations: [ HomeComponent ],
|
||||
schemas: [CUSTOM_ELEMENTS_SCHEMA],
|
||||
})
|
||||
.compileComponents();
|
||||
}));
|
||||
|
||||
beforeEach(() => {
|
||||
fixture = TestBed.createComponent(HomeComponent);
|
||||
component = fixture.componentInstance;
|
||||
fixture.detectChanges();
|
||||
});
|
||||
|
||||
it('should create', () => {
|
||||
expect(component).toBeTruthy();
|
||||
});
|
||||
});
|
||||
@ -0,0 +1,58 @@
|
||||
import { CommonService } from 'src/app/hmg-common/services/common/common.service';
|
||||
import { Component, OnInit } from '@angular/core';
|
||||
import { MenuResponse } from 'src/app/hmg-common/services/menu/models/menu-response';
|
||||
import { TranslatorService } from 'src/app/hmg-common/services/translator/translator.service';
|
||||
|
||||
@Component({
|
||||
selector: 'app-home',
|
||||
templateUrl: './home.component.html',
|
||||
styleUrls: ['./home.component.scss'],
|
||||
})
|
||||
export class HomeComponent implements OnInit {
|
||||
|
||||
menu: any;
|
||||
pages: any;
|
||||
headerTitle: string;
|
||||
selMenu: MenuResponse = new MenuResponse();
|
||||
// Selected Side Menu
|
||||
selectedMenu: any;
|
||||
|
||||
constructor(private cs: CommonService, private ts: TranslatorService) {
|
||||
this.menu = this.cs.sharedService.getSharedData('menuEntries', false);
|
||||
this.selMenu = this.cs.sharedService.getSharedData(MenuResponse.SHARED_DATA, false);
|
||||
let title: string = this.ts.trPK('eit', 'my-requests');
|
||||
this.headerTitle = this.selMenu.List_Menu.MENU_NAME ? this.selMenu.List_Menu.MENU_NAME : title;
|
||||
}
|
||||
|
||||
ngOnInit() { }
|
||||
|
||||
openPage(page, index) {
|
||||
// Reset the content nav to have just this page
|
||||
// we wouldn't want the back button to show in this scenario
|
||||
if (page.children.length == 0) {
|
||||
this.goToRequest(page);
|
||||
} else {
|
||||
if (this.selectedMenu == 0) {
|
||||
this.selectedMenu = -1;
|
||||
} else if (this.selectedMenu != -1) {
|
||||
this.selectedMenu = -1;
|
||||
} else {
|
||||
this.selectedMenu = index;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
goToRequest(menuEntry) {
|
||||
let selMenu: MenuResponse = new MenuResponse();
|
||||
selMenu = this.cs.sharedService.getSharedData(MenuResponse.SHARED_DATA, false);
|
||||
selMenu.GetMenuEntriesList = menuEntry;
|
||||
this.cs.sharedService.setSharedData(selMenu, MenuResponse.SHARED_DATA);
|
||||
if (menuEntry.REQUEST_TYPE == 'ABSENCE') {
|
||||
this.cs.openAbsencePage();
|
||||
} else if (menuEntry.REQUEST_TYPE == 'EIT') {
|
||||
// this.navCtrl.push('EitListPage');
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,12 @@
|
||||
import { TestBed } from '@angular/core/testing';
|
||||
|
||||
import { EitService } from './eit.service';
|
||||
|
||||
describe('EitService', () => {
|
||||
beforeEach(() => TestBed.configureTestingModule({}));
|
||||
|
||||
it('should be created', () => {
|
||||
const service: EitService = TestBed.get(EitService);
|
||||
expect(service).toBeTruthy();
|
||||
});
|
||||
});
|
||||
@ -0,0 +1,23 @@
|
||||
import { Observable } from 'rxjs';
|
||||
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';
|
||||
|
||||
@Injectable({
|
||||
providedIn: 'root'
|
||||
})
|
||||
export class EitService {
|
||||
|
||||
/* EIT Services URLs */
|
||||
public static getMenuEntries = 'Services/ERP.svc/REST/GET_MENU_ENTRIES';
|
||||
|
||||
constructor(public authService: AuthenticationService, public con: ConnectorService) { }
|
||||
|
||||
public getMenuEntries(menuEntries: any, onError?: any, errorLabel?: string): Observable<any> {
|
||||
const request = menuEntries;
|
||||
this.authService.authenticateRequest(request);
|
||||
console.log(request);
|
||||
return this.con.post(EitService.getMenuEntries, request, onError, errorLabel);
|
||||
}
|
||||
|
||||
}
|
||||
Loading…
Reference in New Issue