;
+
+ beforeEach(async(() => {
+ TestBed.configureTestingModule({
+ declarations: [ SubordinateLeaveComponent ],
+ schemas: [CUSTOM_ELEMENTS_SCHEMA],
+ })
+ .compileComponents();
+ }));
+
+ beforeEach(() => {
+ fixture = TestBed.createComponent(SubordinateLeaveComponent);
+ component = fixture.componentInstance;
+ fixture.detectChanges();
+ });
+
+ it('should create', () => {
+ expect(component).toBeTruthy();
+ });
+});
diff --git a/Mohem/src/app/my-team/subordinate-leave/subordinate-leave.component.ts b/Mohem/src/app/my-team/subordinate-leave/subordinate-leave.component.ts
new file mode 100644
index 00000000..cdcbd788
--- /dev/null
+++ b/Mohem/src/app/my-team/subordinate-leave/subordinate-leave.component.ts
@@ -0,0 +1,57 @@
+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 { MyTeamService } from '../service/my-team.service';
+import * as moment from 'moment';
+
+@Component({
+ selector: 'app-subordinate-leave',
+ templateUrl: './subordinate-leave.component.html',
+ styleUrls: ['./subordinate-leave.component.scss'],
+})
+export class SubordinateLeaveComponent implements OnInit {
+ public startDate: any;
+ public endDate: any;
+ public list = [];
+ public noData = true;
+
+ constructor(
+ public ts: TranslatorService,
+ public common: CommonService,
+ public myTeamService: MyTeamService,
+ ) { }
+
+ ngOnInit() {}
+
+ subordinateLeaveList() {
+ const Sdata = this.common.convertDateToJsonDateUpdated(this.startDate);
+ const Edata = this.common.convertDateToJsonDateUpdated(this.endDate);
+ this.myTeamService.getEmployeeSubordinatesLeave({
+ P_DATE_FROM: Sdata,
+ P_DATE_TO: Edata
+ }, () => { }, this.ts.trPK('general', 'retry')).subscribe((result) => {
+ if (this.common.validResponse(result)) {
+ this.list = result.GetSubordinatesLeavesTotalVacationsList;
+ this.noData = false;
+ }
+ });
+ }
+
+ getDate(date) {
+ const newDate = this.common.localizeDate(new Date(this.common.getDateTimeISOFromStringUpdated(date).split(' ')[0]));
+ return newDate;
+ }
+ diffDays(date) {
+ const date1 = new Date(this.common.getDateTimeISOFromStringUpdated(date.DATE_START).split(' ')[0]);
+ const date2 = new Date(this.common.getDateTimeISOFromStringUpdated(date.DATE_END).split(' ')[0]);
+ const diff = Math.abs(date1.getTime() - date2.getTime());
+ const diffDays = Math.ceil(diff / (1000 * 3600 * 24));
+ return diffDays;
+ }
+
+ checkDate() {
+ if (this.startDate && this.endDate) {
+ return false;
+ } else { return true; }
+ }
+}
diff --git a/Mohem/src/app/notification/home/home.component.html b/Mohem/src/app/notification/home/home.component.html
index 326c7d16..45af49e2 100644
--- a/Mohem/src/app/notification/home/home.component.html
+++ b/Mohem/src/app/notification/home/home.component.html
@@ -12,11 +12,9 @@
{{ts.trPK('work-list','open-analysis')}}
-
-
{{totalRequestCount}}
- 0 && itemType === ''">{{newWorkListResponse[0].NO_OF_ROWS + ITGCount}}
- 0 && selectedFilter !== 'ALL' && itemType !== ''">{{newWorkListResponse[0].NO_OF_ROWS}}
+ {{totalRequestCount}}
+
+
{{ts.trPK('work-list','total')}}
{{ts.trPK('work-list','open-reqest')}}
@@ -45,7 +43,7 @@
{{ts.trPK('work-list','clear-search')}}
-
+
{{ts.trPK('work-list','advanced-search')}}
@@ -74,7 +72,6 @@
0 ? 'work-list-container' : ''" *ngIf="selectedFilter == 'ITG'" >
-
-
diff --git a/Mohem/src/app/notification/home/home.component.ts b/Mohem/src/app/notification/home/home.component.ts
index 7b47aad2..ce8635c3 100644
--- a/Mohem/src/app/notification/home/home.component.ts
+++ b/Mohem/src/app/notification/home/home.component.ts
@@ -186,7 +186,7 @@ export class HomeComponent implements OnInit {
this.WorkListObj.P_SEARCH_SENT_DATE = '';
this.WorkListObj.P_SEARCH_ITEM_TYPE_DSP_NAME = '';
this.WorkListObj.P_PAGE_NUM = 0;
- this.WorkListObj.P_PAGE_LIMIT = 5;
+ this.WorkListObj.P_PAGE_LIMIT = 25;
}
ngOnInit() {
@@ -212,7 +212,6 @@ export class HomeComponent implements OnInit {
this.selectedFilter = 'HR';
this.filters[0].active = true;
this.isPostNoLoad = true;
- // this.disableFilters();
this.resetData();
this.direction = TranslatorService.getCurrentLanguageName();
this.worklistNotifications = this.common.sharedService.getSharedData('worklistNotifications', false);
@@ -303,11 +302,10 @@ export class HomeComponent implements OnInit {
}
activeFilter(index: number) {
- if (index !== 4) {
- this.common.startLoading();
- }
- console.log(this.filters);
- if (this.currentActiveIndex !== index) {
+ if (index !== this.currentActiveIndex) {
+ if (index !== 4) {
+ this.common.startLoading();
+ }
this.previousActiveIndex = this.currentActiveIndex;
this.currentActiveIndex = index;
this.filters[this.previousActiveIndex].active = false;
@@ -315,7 +313,6 @@ export class HomeComponent implements OnInit {
this.selectedFilter = this.filters[this.currentActiveIndex].key;
const filterValue = this.filters[this.currentActiveIndex].value;
if (this.selectedFilter !== 'ITG') {
- // this.getFilteredData(this.selectedFilter);
this.initiateNewWorklistData(this.selectedFilter, filterValue);
}
}
@@ -325,9 +322,12 @@ export class HomeComponent implements OnInit {
this.common.openProfile('sideMenu');
}
- disableFilters() {
+ configureFilters() {
for (const filter of this.filters) {
if (filter.key === this.itemType) {
+ const index = this.filters.map(function(e) { return e.key; }).indexOf(this.itemType);
+ this.currentActiveIndex = index;
+ this.previousActiveIndex = 0;
filter.disable = false;
filter.active = true;
this.selectedFilter = filter.name;
@@ -339,12 +339,26 @@ export class HomeComponent implements OnInit {
filter.active = false;
}
}
+
if (this.itemType === '') {
this.filters[0].active = true;
}
}
+ enableFilters() {
+ this.currentActiveIndex = 0;
+ this.previousActiveIndex = 0;
+ for (const filter of this.filters) {
+ filter.disable = false;
+ if (filter.key === this.itemType) {
+ filter.active = true;
+ } else {
+ filter.active = false;
+ }
+ }
+ }
+
async openSearchModal() {
const modal = await this.modalController.create({
component: WorklistAdvancedSearchComponent,
@@ -369,19 +383,10 @@ export class HomeComponent implements OnInit {
this.newWorkListResponse = [];
this.showFormattedData = [];
this.allFormattedData = [];
- // this.selectedFilter = 'ALL';
if (this.itemType !== '') {
- this.disableFilters();
+ this.configureFilters();
}
-
- this.filters[this.currentActiveIndex].active = false;
- this.currentActiveIndex = 0;
- this.previousActiveIndex = 0;
- this.filters[this.currentActiveIndex].active = true;
- // if (this.itemType !== '') {
- // this.disableFilters();
- // }
this.isPostNoLoad = false;
this.getAllPushNotificationFun();
}
@@ -494,7 +499,6 @@ export class HomeComponent implements OnInit {
this.showFormattedData = this.sortArray(categorizedWorkListResponse);
this.allFormattedData = this.showFormattedData;
this.common.sharedService.setSharedData(this.newWorkListResponse, HomeComponent.NOTIFICATION_ARR);
- // this.assignDataToFilters();
}
} else {
this.newWorkListResponse = [];
@@ -503,7 +507,6 @@ export class HomeComponent implements OnInit {
}
this.data.datasets[0].data[4] = this.ITGCount;
this.showChart = true;
- // this.common.stopLoading();
this.isLoading = false;
}
}
@@ -562,11 +565,11 @@ export class HomeComponent implements OnInit {
clearSearch() {
this.common.startLoading();
- this.isLoading = true;
- this.itemType = '';
- this.selectedFilter = 'ALL';
+ this.isLoading = false;
+ this.itemType = 'HRSSA';
+ this.selectedFilter = 'HR';
this.isPostNoLoad = true;
- // this.disableFilters();
+ this.enableFilters();
this.resetData();
this.getAllPushNotificationFun();
}
diff --git a/Mohem/src/app/notification/work-list-replacement-roll/work-list-replacement-roll.component.ts b/Mohem/src/app/notification/work-list-replacement-roll/work-list-replacement-roll.component.ts
index 480ed036..1da215da 100644
--- a/Mohem/src/app/notification/work-list-replacement-roll/work-list-replacement-roll.component.ts
+++ b/Mohem/src/app/notification/work-list-replacement-roll/work-list-replacement-roll.component.ts
@@ -360,7 +360,7 @@ export class WorkListReplacementRollComponent implements OnInit {
// }
// }, 5000);
- this.cs.openNotificationPage();
+ // this.cs.openNotificationPage();
// this.messageSuccess = true;
// setTimeout(() => {
diff --git a/Mohem/src/app/notification/worklist-main-po/worklist-main-po.component.ts b/Mohem/src/app/notification/worklist-main-po/worklist-main-po.component.ts
index f0dcf22c..eecd523e 100644
--- a/Mohem/src/app/notification/worklist-main-po/worklist-main-po.component.ts
+++ b/Mohem/src/app/notification/worklist-main-po/worklist-main-po.component.ts
@@ -1171,66 +1171,43 @@ export class WorklistMainPoComponent implements OnInit {
}
async openRepRolModal() {
-
-
this.common.sharedService.setSharedData(this.actionHistoryRes, 'actionHistoryData');
-
const modal = await this.modalCtrl.create({
component: WorkListReplacementRollComponent,
backdropDismiss: false,
-
});
modal.cssClass = 'replaceRoll-modal';
-
modal.onDidDismiss()
.then((data) => {
- console.log(data.data);
-
- if (data.data.data == "cancel" || data.data.data == undefined) {
+ if (data.data.data === 'cancel' || data.data.data === undefined) {
return;
- } else if (data.data.data == "Success") {
- // this.openNotificationsDashboard();
- // this.messageSuccess = true;
+ } else if (data.data.data === 'Success') {
this.common.greenToastPK('worklist', 'save-successfully');
setTimeout(() => {
- // this.messageSuccess = false;
- this.common.redToastPK('worklist', 'save-error');
this.nextNotfification();
}, 2000);
- // this.nextNotfification();
-
+ } else {
+ this.common.redToastPK('worklist', 'save-error');
}
});
return await modal.present();
-
-
-
}
async openRFCModal() {
-
-
-
-
const modal = await this.modalCtrl.create({
component: WorkListRfcComponent,
backdropDismiss: false,
});
modal.cssClass = 'replaceRoll-modal';
-
modal.onDidDismiss()
.then((data) => {
console.log(data.data);
-
if (data.data == "cancel" || data.data == undefined) {
return;
- } else {
-
-
- }
+ } else {}
});
return await modal.present();
diff --git a/Mohem/src/app/profile/home/home.component.html b/Mohem/src/app/profile/home/home.component.html
index 287f4038..ca16c02d 100644
--- a/Mohem/src/app/profile/home/home.component.html
+++ b/Mohem/src/app/profile/home/home.component.html
@@ -1,4 +1,4 @@
-
+
diff --git a/Mohem/src/assets/icon/bar-chart-outline.svg b/Mohem/src/assets/icon/bar-chart-outline.svg
new file mode 100644
index 00000000..d17a6598
--- /dev/null
+++ b/Mohem/src/assets/icon/bar-chart-outline.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/Mohem/src/assets/icon/bar-chart.svg b/Mohem/src/assets/icon/bar-chart.svg
new file mode 100644
index 00000000..7a070f16
--- /dev/null
+++ b/Mohem/src/assets/icon/bar-chart.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/Mohem/src/assets/localization/i18n.json b/Mohem/src/assets/localization/i18n.json
index 6d68cc24..76791853 100644
--- a/Mohem/src/assets/localization/i18n.json
+++ b/Mohem/src/assets/localization/i18n.json
@@ -1966,6 +1966,18 @@
"team-stats": {
"en": "Team Statistics",
"ar": "إحصائيات الفريق"
+ },
+ "subordinate-leave":{
+ "en":"Subordinate Leave",
+ "ar":"إجازة التابعيين"
+ },
+ "select-duration":{
+ "en":"Select Duration",
+ "ar":"اختر الفترة"
+ },
+ "no-of-days":{
+ "en":"No. of days",
+ "ar":"عدد الايام"
}
},
"searchForReplacment": {
@@ -2070,6 +2082,10 @@
"submit": {
"en": "Are you sure you want to submit?",
"ar": "هل انت متاكد من ارسال الطلب؟"
+ },
+ "cei":{
+ "en":"child Education",
+ "ar":"تعليم الطفل"
}
},
"submitAbsence": {