-
+
+
Office
@@ -19,7 +19,7 @@
Office is required
-
+
First Name
@@ -75,3 +75,14 @@
+
+
+ Create Employee
+ Click to start filling the details. * mark fields are neccessary. For more details click: Manage Employees
+
+ Close
+ Create Employee
+ Back
+ Next
+
+
diff --git a/src/app/organization/employees/create-employee/create-employee.component.ts b/src/app/organization/employees/create-employee/create-employee.component.ts
index fdaf32d5b..e284be1a5 100644
--- a/src/app/organization/employees/create-employee/create-employee.component.ts
+++ b/src/app/organization/employees/create-employee/create-employee.component.ts
@@ -1,5 +1,5 @@
/** Angular Imports */
-import { Component, OnInit } from '@angular/core';
+import { Component, OnInit , TemplateRef, ElementRef, ViewChild, AfterViewInit } from '@angular/core';
import { FormGroup, FormBuilder, Validators } from '@angular/forms';
import { Router, ActivatedRoute } from '@angular/router';
@@ -7,6 +7,12 @@ import { Router, ActivatedRoute } from '@angular/router';
import { OrganizationService } from '../../organization.service';
import { SettingsService } from 'app/settings/settings.service';
import { Dates } from 'app/core/utils/dates';
+import { MatDialog } from '@angular/material/dialog';
+import { PopoverService } from '../../../configuration-wizard/popover/popover.service';
+import { ConfigurationWizardService } from '../../../configuration-wizard/configuration-wizard.service';
+
+/** Custom Dialog Component */
+import { ContinueSetupDialogComponent } from '../../../configuration-wizard/continue-setup-dialog/continue-setup-dialog.component';
/**
* Create employee component.
@@ -16,7 +22,7 @@ import { Dates } from 'app/core/utils/dates';
templateUrl: './create-employee.component.html',
styleUrls: ['./create-employee.component.scss']
})
-export class CreateEmployeeComponent implements OnInit {
+export class CreateEmployeeComponent implements OnInit, AfterViewInit {
/** Minimum joining date allowed. */
minDate = new Date(2000, 0, 1);
@@ -27,6 +33,11 @@ export class CreateEmployeeComponent implements OnInit {
/** Office data. */
officeData: any;
+ /* Reference of employee form */
+ @ViewChild('createEmployeeFormRef') createEmployeeFormRef: ElementRef
;
+ /* Template for popover on employee form */
+ @ViewChild('templateCreateEmployeeForm') templateCreateEmployeeForm: TemplateRef;
+
/**
* Retrieves the offices data from `resolve`.
* @param {FormBuilder} formBuilder Form Builder.
@@ -35,13 +46,19 @@ export class CreateEmployeeComponent implements OnInit {
* @param {ActivatedRoute} route Activated Route.
* @param {Router} router Router for navigation.
* @param {Dates} dateUtils Date Utils to format date.
+ * @param {ConfigurationWizardService} configurationWizardService ConfigurationWizard Service.
+ * @param {PopoverService} popoverService PopoverService.
+ * @param {MatDialog} dialog MatDialog.
*/
constructor(private formBuilder: FormBuilder,
private organizationService: OrganizationService,
private settingsService: SettingsService,
private route: ActivatedRoute,
private router: Router,
- private dateUtils: Dates) {
+ private dateUtils: Dates,
+ private configurationWizardService: ConfigurationWizardService,
+ private popoverService: PopoverService,
+ public dialog: MatDialog) {
this.route.data.subscribe((data: { offices: any }) => {
this.officeData = data.offices;
});
@@ -87,7 +104,78 @@ export class CreateEmployeeComponent implements OnInit {
locale
};
this.organizationService.createEmployee(data).subscribe((response: any) => {
- this.router.navigate(['../'], { relativeTo: this.route });
+ if (this.configurationWizardService.showEmployeeForm === true) {
+ this.configurationWizardService.showEmployeeForm = false;
+ this.openDialog();
+ } else {
+ this.router.navigate(['../'], { relativeTo: this.route });
+ }
+ });
+ }
+
+ /**
+ * Popover function
+ * @param template TemplateRef.
+ * @param target HTMLElement | ElementRef.
+ * @param position String.
+ * @param backdrop Boolean.
+ */
+ showPopover(template: TemplateRef, target: HTMLElement | ElementRef, position: string, backdrop: boolean): void {
+ setTimeout(() => this.popoverService.open(template, target, position, backdrop, {}), 200);
+ }
+
+ /**
+ * To show popover.
+ */
+ ngAfterViewInit() {
+ if (this.configurationWizardService.showEmployeeForm === true) {
+ setTimeout(() => {
+ this.showPopover(this.templateCreateEmployeeForm, this.createEmployeeFormRef.nativeElement, 'right', true);
+ });
+ }
+ }
+
+ /**
+ * Next Step (Define Working Days) Configuration Wizard.
+ */
+ nextStep() {
+ this.configurationWizardService.showEmployeeForm = false;
+ this.configurationWizardService.showDefineWorkingDays = true;
+ this.router.navigate(['/organization']);
+ }
+
+ /**
+ * Previous Step (Employees Page) Configuration Wizard.
+ */
+ previousStep() {
+ this.configurationWizardService.showEmployeeForm = false;
+ this.configurationWizardService.showEmployeeTable = true;
+ this.router.navigate(['/organization/employees']);
+ }
+
+ /**
+ * Opens dialog if the user wants to create more employees.
+ */
+ openDialog() {
+ const continueSetupDialogRef = this.dialog.open(ContinueSetupDialogComponent, {
+ data: {
+ stepName: 'employee'
+ },
+ });
+ continueSetupDialogRef.afterClosed().subscribe((response: { step: number }) => {
+ if (response.step === 1) {
+ this.configurationWizardService.showEmployeeForm = false;
+ this.router.navigate(['../'], { relativeTo: this.route });
+ } else if (response.step === 2) {
+ this.configurationWizardService.showEmployeeForm = true;
+ this.router.routeReuseStrategy.shouldReuseRoute = () => false;
+ this.router.onSameUrlNavigation = 'reload';
+ this.router.navigate(['/organization/employees/create']);
+ } else if (response.step === 3) {
+ this.configurationWizardService.showEmployeeForm = false;
+ this.configurationWizardService.showDefineWorkingDays = true;
+ this.router.navigate(['/organization']);
+ }
});
}
diff --git a/src/app/organization/employees/employees.component.html b/src/app/organization/employees/employees.component.html
index b0a5f5cb0..2545ce94c 100644
--- a/src/app/organization/employees/employees.component.html
+++ b/src/app/organization/employees/employees.component.html
@@ -1,27 +1,30 @@
+
Import Employees
-
+
+
Create Employee
+
-
+
Filter
-
+
@@ -63,4 +66,42 @@
-
\ No newline at end of file
+
+
+
+ Import Employees
+ This button is used to import employee details from your local device.
+
+ Close
+ Back
+ Next
+
+
+
+
+ Create Employee
+ This option allows you to create new employees in your organization.
+
+ Close
+ Back
+ Next
+
+
+
+
+ Search bar to filter employees.
+
+ Close
+ Back
+ Next
+
+
+
+
+ List of employees in the organization.
+
+ Close
+ Back
+ Next
+
+
diff --git a/src/app/organization/employees/employees.component.ts b/src/app/organization/employees/employees.component.ts
index 2e7b0db22..542d47e04 100644
--- a/src/app/organization/employees/employees.component.ts
+++ b/src/app/organization/employees/employees.component.ts
@@ -1,13 +1,17 @@
/** Angular Imports */
-import { Component, OnInit, ViewChild } from '@angular/core';
+import { Component, OnInit, TemplateRef, ElementRef, ViewChild, AfterViewInit } from '@angular/core';
import { MatPaginator } from '@angular/material/paginator';
import { MatSort } from '@angular/material/sort';
import { MatTableDataSource } from '@angular/material/table';
-import { ActivatedRoute } from '@angular/router';
+import { ActivatedRoute, Router } from '@angular/router';
/** rxjs Imports */
import { of } from 'rxjs';
+/** Custom Services */
+import { PopoverService } from '../../configuration-wizard/popover/popover.service';
+import { ConfigurationWizardService } from '../../configuration-wizard/configuration-wizard.service';
+
/**
* Employees component.
*/
@@ -16,7 +20,7 @@ import { of } from 'rxjs';
templateUrl: './employees.component.html',
styleUrls: ['./employees.component.scss']
})
-export class EmployeesComponent implements OnInit {
+export class EmployeesComponent implements OnInit, AfterViewInit {
/** Employees data. */
employeesData: any;
@@ -30,11 +34,26 @@ export class EmployeesComponent implements OnInit {
/** Sorter for employees table. */
@ViewChild(MatSort, { static: true }) sort: MatSort;
+ /* Reference of import employees button */
+ @ViewChild('buttonImportEmployees') buttonImportEmployees: ElementRef;
+ /* Template for popover on import employees button */
+ @ViewChild('templateButtonImportEmployees') templateButtonImportEmployees: TemplateRef;
+ /* Reference of employees table */
+ @ViewChild('tableEmployees') tableEmployees: ElementRef;
+ /* Template for popover on employees table */
+ @ViewChild('templateTableEmployees') templateTableEmployees: TemplateRef;
+
/**
* Retrieves the employees data from `resolve`.
* @param {ActivatedRoute} route Activated Route.
+ * @param {Router} router Router.
+ * @param {ConfigurationWizardService} configurationWizardService ConfigurationWizard Service.
+ * @param {PopoverService} popoverService PopoverService.
*/
- constructor(private route: ActivatedRoute) {
+ constructor(private route: ActivatedRoute,
+ private router: Router,
+ private configurationWizardService: ConfigurationWizardService,
+ private popoverService: PopoverService) {
this.route.data.subscribe(( data: { employees: any }) => {
this.employeesData = data.employees;
});
@@ -64,4 +83,51 @@ export class EmployeesComponent implements OnInit {
this.dataSource.sort = this.sort;
}
+ /**
+ * Popover function
+ * @param template TemplateRef.
+ * @param target HTMLElement | ElementRef.
+ * @param position String.
+ * @param backdrop Boolean.
+ */
+ showPopover(template: TemplateRef, target: HTMLElement | ElementRef, position: string, backdrop: boolean): void {
+ setTimeout(() => this.popoverService.open(template, target, position, backdrop, {}), 200);
+ }
+
+ /**
+ * To show popover.
+ */
+ ngAfterViewInit() {
+ if (this.configurationWizardService.showEmployeeList === true) {
+ setTimeout(() => {
+ this.showPopover(this.templateButtonImportEmployees, this.buttonImportEmployees.nativeElement, 'bottom', true);
+ });
+ }
+ if (this.configurationWizardService.showEmployeeTable === true) {
+ setTimeout(() => {
+ this.showPopover(this.templateTableEmployees, this.tableEmployees.nativeElement, 'top', true);
+ });
+ }
+ }
+
+ /**
+ * Next Step (Create Employee Page) Configuration Wizard.
+ */
+ nextStep() {
+ this.configurationWizardService.showEmployeeList = false;
+ this.configurationWizardService.showEmployeeTable = false;
+ this.configurationWizardService.showEmployeeForm = true;
+ this.router.navigate(['/organization/employees/create']);
+ }
+
+ /**
+ * Previous Step (Manage Employees) Configuration Wizard.
+ */
+ previousStep() {
+ this.configurationWizardService.showEmployeeList = false;
+ this.configurationWizardService.showEmployeeTable = false;
+ this.configurationWizardService.showCreateEmployee = true;
+ this.router.navigate(['/organization']);
+ }
+
}
diff --git a/src/app/organization/holidays/edit-holiday/edit-holiday.component.html b/src/app/organization/holidays/edit-holiday/edit-holiday.component.html
index 17803ff48..61bb84405 100644
--- a/src/app/organization/holidays/edit-holiday/edit-holiday.component.html
+++ b/src/app/organization/holidays/edit-holiday/edit-holiday.component.html
@@ -40,7 +40,7 @@
Repayment Scheduling Type
- {{ repayments.value }}
+ {{ repayments.value }}
diff --git a/src/app/organization/holidays/holidays.component.html b/src/app/organization/holidays/holidays.component.html
index 87f77c41a..a6244ec96 100644
--- a/src/app/organization/holidays/holidays.component.html
+++ b/src/app/organization/holidays/holidays.component.html
@@ -1,15 +1,17 @@
-
+
Filter
@@ -65,3 +67,22 @@
+
+
+ Create Holiday
+ This option allows you to create holidays for different offices in your organization.
+
+ Close
+ Back
+ Next
+
+
+
+
+ Search bar to filter holidays based on different offices.
+
+ Close
+ Back
+ Next
+
+
diff --git a/src/app/organization/holidays/holidays.component.ts b/src/app/organization/holidays/holidays.component.ts
index b3fc71b5d..f2f321786 100644
--- a/src/app/organization/holidays/holidays.component.ts
+++ b/src/app/organization/holidays/holidays.component.ts
@@ -1,9 +1,9 @@
/** Angular Imports */
-import { Component, OnInit, ViewChild } from '@angular/core';
+import { Component, OnInit, TemplateRef, ElementRef, ViewChild, AfterViewInit } from '@angular/core';
import { MatPaginator } from '@angular/material/paginator';
import { MatSort } from '@angular/material/sort';
import { MatTableDataSource } from '@angular/material/table';
-import { ActivatedRoute } from '@angular/router';
+import { ActivatedRoute, Router } from '@angular/router';
import { FormControl } from '@angular/forms';
/** rxjs Imports */
@@ -11,6 +11,8 @@ import { of } from 'rxjs';
/** Custom Services */
import { OrganizationService } from '../organization.service';
+import { PopoverService } from '../../configuration-wizard/popover/popover.service';
+import { ConfigurationWizardService } from '../../configuration-wizard/configuration-wizard.service';
/**
* Holidays component.
@@ -20,7 +22,7 @@ import { OrganizationService } from '../organization.service';
templateUrl: './holidays.component.html',
styleUrls: ['./holidays.component.scss']
})
-export class HolidaysComponent implements OnInit {
+export class HolidaysComponent implements OnInit, AfterViewInit {
/** Office selector. */
officeSelector = new FormControl();
@@ -38,14 +40,29 @@ export class HolidaysComponent implements OnInit {
/** Sorter for holidays table. */
@ViewChild(MatSort, { static: true }) sort: MatSort;
+ /* Reference of create holiday button */
+ @ViewChild('buttonCreateHoliday') buttonCreateHoliday: ElementRef
;
+ /* Template for popover on create holiday button */
+ @ViewChild('templateButtonCreateHoliday') templateButtonCreateHoliday: TemplateRef;
+ /* Reference of filter */
+ @ViewChild('filterRef') filterRef: ElementRef;
+ /* Template to show popover on filter */
+ @ViewChild('templateFilterRef') templateFilterRef: TemplateRef;
+
/**
* Retrieves the offices data from `resolve`.
* @param {OrganizationService} organizationService Organization Service.
* @param {ActivatedRoute} route Activated Route.
* @param {FormBuilder} formBuilder Form Builder.
+ * @param {Router} router Router.
+ * @param {ConfigurationWizardService} configurationWizardService ConfigurationWizard Service.
+ * @param {PopoverService} popoverService PopoverService.
*/
constructor(private organizationService: OrganizationService,
- private route: ActivatedRoute) {
+ private route: ActivatedRoute,
+ private router: Router,
+ private configurationWizardService: ConfigurationWizardService,
+ private popoverService: PopoverService) {
this.route.data.subscribe(( data: { offices: any }) => {
this.officeData = data.offices;
});
@@ -88,4 +105,51 @@ export class HolidaysComponent implements OnInit {
this.dataSource.sort = this.sort;
}
+ /**
+ * Popover function
+ * @param template TemplateRef.
+ * @param target HTMLElement | ElementRef.
+ * @param position String.
+ * @param backdrop Boolean.
+ */
+ showPopover(template: TemplateRef, target: HTMLElement | ElementRef, position: string, backdrop: boolean): void {
+ setTimeout(() => this.popoverService.open(template, target, position, backdrop, {}), 200);
+ }
+
+ /**
+ * To show popover.
+ */
+ ngAfterViewInit() {
+ if (this.configurationWizardService.showHolidayPage === true) {
+ setTimeout(() => {
+ this.showPopover(this.templateButtonCreateHoliday, this.buttonCreateHoliday.nativeElement, 'bottom', true);
+ });
+ }
+
+ if (this.configurationWizardService.showHolidayFilter === true) {
+ setTimeout(() => {
+ this.showPopover(this.templateFilterRef, this.filterRef.nativeElement, 'bottom', true);
+ });
+ }
+ }
+
+ /**
+ * Next Step (Create Employee) Configuration Wizard.
+ */
+ nextStep() {
+ this.configurationWizardService.showHolidayPage = false;
+ this.configurationWizardService.showHolidayFilter = false;
+ this.configurationWizardService.showCreateEmployee = true;
+ this.router.navigate(['/organization']);
+ }
+
+ /**
+ * Previous Step (Manage Holidays) Configuration Wizard.
+ */
+ previousStep() {
+ this.configurationWizardService.showHolidayPage = false;
+ this.configurationWizardService.showHolidayFilter = false;
+ this.configurationWizardService.showCreateHoliday = true;
+ this.router.navigate(['/organization']);
+ }
}
diff --git a/src/app/organization/manage-funds/manage-funds.component.html b/src/app/organization/manage-funds/manage-funds.component.html
index 9896bb815..dbba02ff2 100644
--- a/src/app/organization/manage-funds/manage-funds.component.html
+++ b/src/app/organization/manage-funds/manage-funds.component.html
@@ -2,7 +2,7 @@
-
+
+
+
+ Manage Funds
+ This form will be used to add fund. If you would like to add fund click on add funds button and fill the fund name then click on + button else click Next or Back. For more details click: Manage Funds
+
+ Close
+ Add Funds
+ Back
+ Next
+
+
+
diff --git a/src/app/organization/manage-funds/manage-funds.component.ts b/src/app/organization/manage-funds/manage-funds.component.ts
index 048587328..0a506fa86 100644
--- a/src/app/organization/manage-funds/manage-funds.component.ts
+++ b/src/app/organization/manage-funds/manage-funds.component.ts
@@ -1,6 +1,6 @@
/** Angular Imports */
-import { Component, OnInit, ViewChild } from '@angular/core';
-import { ActivatedRoute } from '@angular/router';
+import { Component, OnInit, TemplateRef, ElementRef, ViewChild, AfterViewInit } from '@angular/core';
+import { ActivatedRoute, Router } from '@angular/router';
import { MatDialog } from '@angular/material/dialog';
import { FormBuilder, Validators } from '@angular/forms';
@@ -13,6 +13,11 @@ import { InputBase } from 'app/shared/form-dialog/formfield/model/input-base';
/** Custom Services */
import { OrganizationService } from '../organization.service';
+import { PopoverService } from '../../configuration-wizard/popover/popover.service';
+import { ConfigurationWizardService } from '../../configuration-wizard/configuration-wizard.service';
+
+/** Custom Dialog Component */
+import { ContinueSetupDialogComponent } from '../../configuration-wizard/continue-setup-dialog/continue-setup-dialog.component';
/**
* Manage Funds component.
@@ -22,7 +27,7 @@ import { OrganizationService } from '../organization.service';
templateUrl: './manage-funds.component.html',
styleUrls: ['./manage-funds.component.scss']
})
-export class ManageFundsComponent implements OnInit {
+export class ManageFundsComponent implements OnInit, AfterViewInit {
/** Manage Funds data. */
fundsData: any;
@@ -31,17 +36,28 @@ export class ManageFundsComponent implements OnInit {
/** Funds form reference */
@ViewChild('formRef') formRef: any;
+ /* Refernce of funds form */
+ @ViewChild('fundFormRef') fundFormRef: ElementRef
;
+ /* Template for popover on funds form */
+ @ViewChild('templateFundFormRef') templateFundFormRef: TemplateRef;
+
/**
* Retrieves the manage funds data from `resolve`.
* @param {ActivatedRoute} route Activated Route
* @param {FormBuilder} formBuilder Form Builder
* @param {OrganizationService} organizationservice Organization Service
* @param {MatDialog} dialog Mat Dialog
+ * @param {Router} router Router.
+ * @param {ConfigurationWizardService} configurationWizardService ConfigurationWizard Service.
+ * @param {PopoverService} popoverService PopoverService.
*/
constructor(private route: ActivatedRoute,
private formBuilder: FormBuilder,
private organizationservice: OrganizationService,
- public dialog: MatDialog) {
+ public dialog: MatDialog,
+ private router: Router,
+ private configurationWizardService: ConfigurationWizardService,
+ private popoverService: PopoverService) {
this.route.data.subscribe(( data: { funds: any }) => {
this.fundsData = data.funds;
});
@@ -71,6 +87,10 @@ export class ManageFundsComponent implements OnInit {
name: newFund.name
});
this.formRef.resetForm();
+ if (this.configurationWizardService.showManageFunds === true) {
+ this.configurationWizardService.showManageFunds = false;
+ this.openDialog();
+ }
});
}
@@ -105,4 +125,67 @@ export class ManageFundsComponent implements OnInit {
});
}
+ /**
+ * Popover function
+ * @param template TemplateRef.
+ * @param target HTMLElement | ElementRef.
+ * @param position String.
+ * @param backdrop Boolean.
+ */
+ showPopover(template: TemplateRef, target: HTMLElement | ElementRef, position: string, backdrop: boolean): void {
+ setTimeout(() => this.popoverService.open(template, target, position, backdrop, {}), 200);
+ }
+
+ /**
+ * To show popover.
+ */
+ ngAfterViewInit() {
+ if (this.configurationWizardService.showManageFunds === true) {
+ setTimeout(() => {
+ this.showPopover(this.templateFundFormRef, this.fundFormRef.nativeElement, 'bottom', true);
+ });
+ }
+ }
+
+ /**
+ * Previous Step (Organization Page) Dialog Configuration Wizard.
+ */
+ previousStep() {
+ this.router.navigate(['/organization']);
+ }
+
+ /**
+ * Next Step (Manage Reports) Dialog Configuration Wizard.
+ */
+ nextStep() {
+ this.configurationWizardService.showManageFunds = false;
+ this.configurationWizardService.showManageReports = true;
+ this.router.navigate(['/system']);
+ }
+
+ /**
+ * Opens dialog if the user wants to edit more funds.
+ */
+ openDialog() {
+ const continueSetupDialogRef = this.dialog.open(ContinueSetupDialogComponent, {
+ data: {
+ stepName: 'fund'
+ },
+ });
+ continueSetupDialogRef.afterClosed().subscribe((response: { step: number }) => {
+ if (response.step === 1) {
+ this.configurationWizardService.showManageFunds = false;
+ this.router.navigate(['../'], { relativeTo: this.route });
+ } else if (response.step === 2) {
+ this.configurationWizardService.showManageFunds = true;
+ this.router.routeReuseStrategy.shouldReuseRoute = () => false;
+ this.router.onSameUrlNavigation = 'reload';
+ this.router.navigate(['/organization/manage-funds']);
+ } else if (response.step === 3) {
+ this.configurationWizardService.showManageFunds = false;
+ this.configurationWizardService.showManageReports = true;
+ this.router.navigate(['/system']);
+ }
+ });
+ }
}
diff --git a/src/app/organization/offices/create-office/create-office.component.html b/src/app/organization/offices/create-office/create-office.component.html
index 64416a8d3..978a41e23 100644
--- a/src/app/organization/offices/create-office/create-office.component.html
+++ b/src/app/organization/offices/create-office/create-office.component.html
@@ -6,7 +6,7 @@
-
+
Office
@@ -19,7 +19,7 @@
Parent Office
-
+
{{ office.name }}
@@ -57,3 +57,14 @@
+
+
+ Create Office
+ Click to start filling the details. * mark fields are neccessary. For more details click: Manage Offices
+
+ Close
+ Create Office
+ Back
+ Next Step
+
+
diff --git a/src/app/organization/offices/create-office/create-office.component.ts b/src/app/organization/offices/create-office/create-office.component.ts
index e51b865e8..9cdac4a07 100644
--- a/src/app/organization/offices/create-office/create-office.component.ts
+++ b/src/app/organization/offices/create-office/create-office.component.ts
@@ -1,5 +1,6 @@
/** Angular Imports */
-import { Component, OnInit } from '@angular/core';
+import { Component, OnInit, TemplateRef, ElementRef , ViewChild,
+ AfterViewInit } from '@angular/core';
import { FormGroup, FormBuilder, Validators } from '@angular/forms';
import { Router, ActivatedRoute } from '@angular/router';
@@ -7,6 +8,12 @@ import { Router, ActivatedRoute } from '@angular/router';
import { OrganizationService } from '../../organization.service';
import { SettingsService } from 'app/settings/settings.service';
import { Dates } from 'app/core/utils/dates';
+import { MatDialog } from '@angular/material/dialog';
+import { PopoverService } from '../../../configuration-wizard/popover/popover.service';
+import { ConfigurationWizardService } from '../../../configuration-wizard/configuration-wizard.service';
+
+/** Custom Dialog Component */
+import { ContinueSetupDialogComponent } from '../../../configuration-wizard/continue-setup-dialog/continue-setup-dialog.component';
/**
* Create Office component.
@@ -16,7 +23,7 @@ import { Dates } from 'app/core/utils/dates';
templateUrl: './create-office.component.html',
styleUrls: ['./create-office.component.scss']
})
-export class CreateOfficeComponent implements OnInit {
+export class CreateOfficeComponent implements OnInit, AfterViewInit {
/** Office form. */
officeForm: FormGroup;
@@ -27,6 +34,11 @@ export class CreateOfficeComponent implements OnInit {
/** Maximum Date allowed. */
maxDate = new Date();
+ /* Reference of create office form */
+ @ViewChild('createOfficeFormRef') createOfficeFormRef: ElementRef
;
+ /* template for popover on create office form */
+ @ViewChild('templateCreateOfficeForm') templateCreateOfficeForm: TemplateRef;
+
/**
* Retrieves the offices data from `resolve`.
* @param {FormBuilder} formBuilder Form Builder.
@@ -35,13 +47,19 @@ export class CreateOfficeComponent implements OnInit {
* @param {ActivatedRoute} route Activated Route.
* @param {Router} router Router for navigation.
* @param {Dates} dateUtils Date Utils to format date.
+ * @param {Router} router Router.
+ * @param {ConfigurationWizardService} configurationWizardService ConfigurationWizard Service.
+ * @param {PopoverService} popoverService PopoverService.
*/
constructor(private formBuilder: FormBuilder,
private organizationService: OrganizationService,
private settingsService: SettingsService,
private router: Router,
private route: ActivatedRoute,
- private dateUtils: Dates) {
+ private dateUtils: Dates,
+ private popoverService: PopoverService,
+ private configurationWizardService: ConfigurationWizardService,
+ public dialog: MatDialog) {
this.route.data.subscribe((data: { offices: any }) => {
this.officeData = data.offices;
});
@@ -82,7 +100,78 @@ export class CreateOfficeComponent implements OnInit {
locale
};
this.organizationService.createOffice(data).subscribe(response => {
- this.router.navigate(['../'], { relativeTo: this.route });
+ if (this.configurationWizardService.showOfficeForm === true) {
+ this.configurationWizardService.showOfficeForm = false;
+ this.openDialog();
+ } else {
+ this.router.navigate(['../'], { relativeTo: this.route });
+ }
});
}
+
+ /**
+ * Opens dialog if users wants to create more offices.
+ */
+ openDialog() {
+ const continueSetupDialogRef = this.dialog.open(ContinueSetupDialogComponent, {
+ data: {
+ stepName: 'office'
+ },
+ });
+ continueSetupDialogRef.afterClosed().subscribe((response: { step: number }) => {
+ if (response.step === 1) {
+ this.configurationWizardService.showOfficeForm = false;
+ this.router.navigate(['../'], { relativeTo: this.route });
+ } else if (response.step === 2) {
+ this.configurationWizardService.showOfficeForm = true;
+ this.router.routeReuseStrategy.shouldReuseRoute = () => false;
+ this.router.onSameUrlNavigation = 'reload';
+ this.router.navigate(['/organization/offices/create']);
+ } else if (response.step === 3) {
+ this.configurationWizardService.showOfficeForm = false;
+ this.configurationWizardService.showAddEditCurrency = true;
+ this.router.navigate(['/organization']);
+ }
+ });
+ }
+
+ /**
+ * Popover function
+ * @param template TemplateRef.
+ * @param target HTMLElement | ElementRef.
+ * @param position String.
+ * @param backdrop Boolean.
+ */
+ showPopover(template: TemplateRef, target: HTMLElement | ElementRef, position: string, backdrop: boolean): void {
+ setTimeout(() => this.popoverService.open(template, target, position, backdrop, {}), 200);
+ }
+
+ /**
+ * To show popover.
+ */
+ ngAfterViewInit() {
+ if (this.configurationWizardService.showOfficeForm === true) {
+ setTimeout(() => {
+ this.showPopover(this.templateCreateOfficeForm, this.createOfficeFormRef.nativeElement, 'right', true);
+ });
+ }
+ }
+
+ /**
+ * Next Step (Add Edit Currency) Configuration Wizard.
+ */
+ nextStep() {
+ this.configurationWizardService.showOfficeForm = false;
+ this.configurationWizardService.showAddEditCurrency = true;
+ this.router.navigate(['/organization']);
+ }
+
+ /**
+ * Previous Step (Manage Offices Page) Configuration Wizard.
+ */
+ previousStep() {
+ this.configurationWizardService.showOfficeForm = false;
+ this.configurationWizardService.showOfficeTable = true;
+ this.router.navigate(['/organization/offices']);
+ }
}
diff --git a/src/app/organization/offices/offices.component.html b/src/app/organization/offices/offices.component.html
index f347fa55a..92cdf820e 100644
--- a/src/app/organization/offices/offices.component.html
+++ b/src/app/organization/offices/offices.component.html
@@ -1,32 +1,38 @@
-
-
- Tree View
-
+
+
+
+ Tree View
+
+
+
Create Office
+
+
Import Offices
+
-
+
Filter
-
+
@@ -60,3 +66,51 @@
+
+
+ Tree View
+ This will launch an alternative view which allows you to view the office hierarchy for your organization.
+
+ Close
+ Back
+ Next
+
+
+
+
+ Create Office
+ This option allows you to create new offices in your organization.
+
+ Close
+ Back
+ Next
+
+
+
+
+ Import Offices
+ This will launch the Bulk import/Offices page.
+
+ Close
+ Back
+ Next
+
+
+
+
+ Search bar to filter offices.
+
+ Close
+ Back
+ Next
+
+
+
+
+ List of offices in the organization.
+
+ Close
+ Back
+ Next
+
+
diff --git a/src/app/organization/offices/offices.component.ts b/src/app/organization/offices/offices.component.ts
index 2061cbaf4..12e232578 100644
--- a/src/app/organization/offices/offices.component.ts
+++ b/src/app/organization/offices/offices.component.ts
@@ -1,13 +1,17 @@
/** Angular Imports */
-import { Component, OnInit, ViewChild } from '@angular/core';
+import { Component, OnInit, TemplateRef, ElementRef, ViewChild, AfterViewInit } from '@angular/core';
import { MatPaginator } from '@angular/material/paginator';
import { MatSort } from '@angular/material/sort';
import { MatTableDataSource } from '@angular/material/table';
-import { ActivatedRoute } from '@angular/router';
+import { ActivatedRoute, Router, } from '@angular/router';
/** rxjs Imports */
import { of } from 'rxjs';
+/** Custom Services */
+import { PopoverService } from '../../configuration-wizard/popover/popover.service';
+import { ConfigurationWizardService } from '../../configuration-wizard/configuration-wizard.service';
+
/**
* Offices component.
*/
@@ -16,7 +20,7 @@ import { of } from 'rxjs';
templateUrl: './offices.component.html',
styleUrls: ['./offices.component.scss']
})
-export class OfficesComponent implements OnInit {
+export class OfficesComponent implements OnInit, AfterViewInit {
/** Offices data. */
officesData: any;
@@ -30,11 +34,26 @@ export class OfficesComponent implements OnInit {
/** Sorter for offices table. */
@ViewChild(MatSort, { static: true }) sort: MatSort;
+ /* Reference of tree view button */
+ @ViewChild('buttonTreeView') buttonTreeView: ElementRef;
+ /* Template for popover on tree view button */
+ @ViewChild('templateButtonTreeView') templateButtonTreeView: TemplateRef;
+ /* Reference of offices table */
+ @ViewChild('tableOffices') tableOffices: ElementRef;
+ /* Template for popover on offices table */
+ @ViewChild('templateTableOffices') templateTableOffices: TemplateRef;
+
/**
* Retrieves the offices data from `resolve`.
* @param {ActivatedRoute} route Activated Route.
+ * @param {Router} router Router.
+ * @param {ConfigurationWizardService} configurationWizardService ConfigurationWizard Service.
+ * @param {PopoverService} popoverService PopoverService.
*/
- constructor(private route: ActivatedRoute) {
+ constructor(private route: ActivatedRoute,
+ private router: Router,
+ private configurationWizardService: ConfigurationWizardService,
+ private popoverService: PopoverService) {
this.route.data.subscribe(( data: { offices: any }) => {
this.officesData = data.offices;
});
@@ -64,4 +83,51 @@ export class OfficesComponent implements OnInit {
this.dataSource.sort = this.sort;
}
+ /**
+ * Popover function
+ * @param template TemplateRef.
+ * @param target HTMLElement | ElementRef.
+ * @param position String.
+ * @param backdrop Boolean.
+ */
+ showPopover(template: TemplateRef, target: HTMLElement | ElementRef, position: string, backdrop: boolean): void {
+ setTimeout(() => this.popoverService.open(template, target, position, backdrop, {}), 200);
+ }
+
+ /**
+ * To show popover.
+ */
+ ngAfterViewInit() {
+ if (this.configurationWizardService.showOfficeList === true) {
+ setTimeout(() => {
+ this.showPopover(this.templateButtonTreeView, this.buttonTreeView.nativeElement, 'bottom', true);
+ });
+ }
+ if (this.configurationWizardService.showOfficeTable === true) {
+ setTimeout(() => {
+ this.showPopover(this.templateTableOffices, this.tableOffices.nativeElement, 'top', true);
+ });
+ }
+ }
+
+ /**
+ * Next Step (Create Office Form) Configuration Wizard.
+ */
+ nextStep() {
+ this.configurationWizardService.showOfficeList = false;
+ this.configurationWizardService.showOfficeTable = false;
+ this.configurationWizardService.showOfficeForm = true;
+ this.router.navigate(['/organization/offices/create']);
+ }
+
+ /**
+ * Previous Step ( Manage Offices Page) Configuration Wizard.
+ */
+ previousStep() {
+ this.configurationWizardService.showOfficeList = false;
+ this.configurationWizardService.showOfficeTable = false;
+ this.configurationWizardService.showCreateOffice = true;
+ this.router.navigate(['/organization']);
+ }
+
}
diff --git a/src/app/organization/organization.component.html b/src/app/organization/organization.component.html
index 890520647..caee573d1 100644
--- a/src/app/organization/organization.component.html
+++ b/src/app/organization/organization.component.html
@@ -8,6 +8,7 @@
+
@@ -15,7 +16,9 @@
Manage Offices
Add new office or modify or deactivate office or modify hierarchy
+
+
@@ -23,7 +26,9 @@
Manage Holidays
Define holidays for office
+
+
@@ -31,6 +36,7 @@
Manage Employees
An employee represents loan officers with no access to systems
+
@@ -80,6 +86,7 @@
+
@@ -87,8 +94,9 @@
Currency Configuration
Currencies available across organization for different products
+
-
+
@@ -96,6 +104,7 @@
Manage Funds
Funds are associated with loans
+
@@ -113,6 +122,7 @@
Manage Tellers / Cashiers and Cash Allocation and Settlement
+
@@ -120,6 +130,7 @@
Working Days
Define working days and configure behaviour of payments due on holidays
+
@@ -162,3 +173,63 @@
+
+
+ Manage Offices
+ The Manage Offices page allows you to create, edit and add the offices within your organization.
+
+ Close
+ Back
+ Next
+
+
+
+
+ Currency Configuration
+ This section allows an organization to define what currencies will be used throughout their interactions within the Mifos X system.
+
+ Close
+ Back
+ Next
+
+
+
+
+ Manage Holidays
+ The ability to manage holidays for individual offices is a very useful tool for an organization spanning multiple locations.Use this option to customize holidays for each office of your organization.
+
+ Close
+ Back
+ Next
+
+
+
+
+ Manage Employees
+ With this option, you may view, edit and/or delete your organization's employees.
+
+ Close
+ Back
+ Next
+
+
+
+
+ Working Days
+ Working days page allows you to define which days of the week are working days.
+
+ Close
+ Back
+ Next
+
+
+
+
+ Manage Funds
+ This allows you to manage funds associated with loans.
+
+ Close
+ Back
+ Next
+
+
diff --git a/src/app/organization/organization.component.ts b/src/app/organization/organization.component.ts
index 46e746deb..7d630d6a7 100644
--- a/src/app/organization/organization.component.ts
+++ b/src/app/organization/organization.component.ts
@@ -1,5 +1,10 @@
/** Angular Imports */
-import { Component, OnInit } from '@angular/core';
+import { Component, OnInit, TemplateRef, ElementRef, ViewChild, AfterViewInit } from '@angular/core';
+import { ActivatedRoute, Router, NavigationEnd } from '@angular/router';
+
+/** Custom Services */
+import { PopoverService } from '../configuration-wizard/popover/popover.service';
+import { ConfigurationWizardService } from '../configuration-wizard/configuration-wizard.service';
/**
* Organization component.
@@ -9,11 +14,195 @@ import { Component, OnInit } from '@angular/core';
templateUrl: './organization.component.html',
styleUrls: ['./organization.component.scss']
})
-export class OrganizationComponent implements OnInit {
+export class OrganizationComponent implements OnInit, AfterViewInit {
- constructor() { }
+ /* Reference of manage offices */
+ @ViewChild('office') office: ElementRef;
+ /* Template for popover on manage offices */
+ @ViewChild('templateOffice') templateOffice: TemplateRef;
+ /* Reference of add/edit currency */
+ @ViewChild('addEditCurrency') addEditCurrency: ElementRef;
+ /* Template for popover on add/edit currency */
+ @ViewChild('templateAddEditCurrency') templateAddEditCurrency: TemplateRef;
+ /* Reference of manage holidays */
+ @ViewChild('holidays') holidays: ElementRef;
+ /* Template for popover on manage holidays */
+ @ViewChild('templateHolidays') templateHolidays: TemplateRef;
+ /* Reference of manage employees */
+ @ViewChild('employee') employee: ElementRef;
+ /* Template for popover on manage employee */
+ @ViewChild('templateEmployee') templateEmployee: TemplateRef;
+ /* Reference of define working days */
+ @ViewChild('workingDays') workingDays: ElementRef;
+ /* Template for popover on define working days */
+ @ViewChild('templateWorkingDays') templateWorkingDays: TemplateRef;
+ /* Reference of manage funds */
+ @ViewChild('manageFunds') manageFunds: ElementRef;
+ /* Template for popover on manage funds */
+ @ViewChild('templateManageFunds') templateManageFunds: TemplateRef;
+
+ /**
+ * @param {ActivatedRoute} activatedRoute ActivatedRoute.
+ * @param {Router} router Router.
+ * @param {ConfigurationWizardService} configurationWizardService ConfigurationWizard Service.
+ * @param {PopoverService} popoverService PopoverService.
+ */
+ constructor(private activatedRoute: ActivatedRoute,
+ private router: Router,
+ private configurationWizardService: ConfigurationWizardService,
+ private popoverService: PopoverService) { }
ngOnInit() {
}
+ /**
+ * Popover function
+ * @param template TemplateRef