diff --git a/README.md b/README.md index a3a5cd2ba..bd0877f62 100644 --- a/README.md +++ b/README.md @@ -60,6 +60,8 @@ Run `ng generate component component-name` to generate a new component. You can Run `ng build` to build the project. The build artifacts will be stored in the `dist/` directory. Use the `--prod` flag for a production build. +Run `npm run build:prod` to build a production artifacts Instead. + ### Further help To get more help on the Angular CLI use `ng help` or go check out the diff --git a/src/app/organization/employees/employees.component.html b/src/app/organization/employees/employees.component.html index 959b76470..b0a5f5cb0 100644 --- a/src/app/organization/employees/employees.component.html +++ b/src/app/organization/employees/employees.component.html @@ -1,11 +1,11 @@
- - @@ -14,53 +14,53 @@
-
- - Filter - - -
+
+ + Filter + + +
-
+
- +
- - - - + + + + - - - - + + + + - - - - + + + + - - - - + + + + - - + + -
Name {{ employee.displayName }} Name {{ employee.displayName }} Loan Officer -
- - -
-
Loan Officer +
+ + +
+
Office {{ employees.officeName }} Office {{ employees.officeName }} Status -
- -
-
Status +
+ +
+
+ - + -
+
-
+
\ No newline at end of file diff --git a/src/app/organization/holidays/view-holidays/view-holidays.component.html b/src/app/organization/holidays/view-holidays/view-holidays.component.html index 3a2c872ae..7b64a41af 100644 --- a/src/app/organization/holidays/view-holidays/view-holidays.component.html +++ b/src/app/organization/holidays/view-holidays/view-holidays.component.html @@ -1,15 +1,15 @@
- - - - @@ -17,52 +17,52 @@
- + - + -
+
-
- Name -
+
+ Name +
-
- {{ holidayData.name }} -
+
+ {{ holidayData.name }} +
-
- From Date -
+
+ From Date +
-
- {{ holidayData.fromDate | date }} -
+
+ {{ holidayData.fromDate | date }} +
-
- To Date -
+
+ To Date +
-
- {{ holidayData.toDate | date }} -
+
+ {{ holidayData.toDate | date }} +
-
- Repayments Scheduled To -
+
+ Repayments Scheduled To +
-
- {{ holidayData.repaymentsRescheduledTo | date }} -
+
+ {{ holidayData.repaymentsRescheduledTo | date }} +
-
- Next Repayment Date -
+
+ Next Repayment Date +
-
+
-
+
-
+
-
+
\ No newline at end of file diff --git a/src/app/organization/holidays/view-holidays/view-holidays.component.ts b/src/app/organization/holidays/view-holidays/view-holidays.component.ts index 34522bec7..d794f14ee 100644 --- a/src/app/organization/holidays/view-holidays/view-holidays.component.ts +++ b/src/app/organization/holidays/view-holidays/view-holidays.component.ts @@ -7,6 +7,7 @@ import { MatDialog } from '@angular/material/dialog'; import { OrganizationService } from 'app/organization/organization.service'; /** Custom Components. */ +import { ConfirmationDialogComponent } from '../../../shared/confirmation-dialog/confirmation-dialog.component'; import { DeleteDialogComponent } from '../../../shared/delete-dialog/delete-dialog.component'; /** @@ -27,10 +28,10 @@ export class ViewHolidaysComponent { * @param {ActivatedRoute} route Activated Route. */ constructor(private route: ActivatedRoute, - private router: Router, - private dialog: MatDialog, - private organizationService: OrganizationService ) { - this.route.data.subscribe((data: { holidays: any}) => { + private router: Router, + private dialog: MatDialog, + private organizationService: OrganizationService) { + this.route.data.subscribe((data: { holidays: any }) => { this.holidayData = data.holidays; }); } @@ -52,4 +53,21 @@ export class ViewHolidaysComponent { }); } + /** + * Activate holiday. + */ + activateHoliday() { + const unAssignStaffDialogRef = this.dialog.open(ConfirmationDialogComponent, { + data: { heading: 'Holiday', dialogContext: `Are you sure you want to activate ${this.holidayData.name} holiday` } + }); + unAssignStaffDialogRef.afterClosed().subscribe((response: { confirm: any }) => { + if (response.confirm) { + this.organizationService.activateHoliday(this.holidayData.id) + .subscribe(() => { + this.router.navigate(['/organization/holidays']); + }); + } + }); + } + } diff --git a/src/app/organization/organization.service.ts b/src/app/organization/organization.service.ts index 3762ba537..820b17792 100644 --- a/src/app/organization/organization.service.ts +++ b/src/app/organization/organization.service.ts @@ -93,8 +93,8 @@ export class OrganizationService { */ getOfficerTemplate(officerId: string, officeId: string): Observable { const httpParams = new HttpParams() - .set('fromLoanOfficerId', officerId.toString()) - .set('officeId', officerId.toString()); + .set('fromLoanOfficerId', officerId.toString()) + .set('officeId', officerId.toString()); return this.http.get('/loans/loanreassignment/template', { params: httpParams }); } @@ -134,9 +134,9 @@ export class OrganizationService { return this.http.put(`/offices/${officeId}`, office); } - /** - * @returns {Observable} - */ + /** + * @returns {Observable} + */ getOfficeDatatables(): Observable { const httpParams = new HttpParams().set('apptable', 'm_office'); return this.http.get(`/datatables`, { params: httpParams }); @@ -222,7 +222,7 @@ export class OrganizationService { * @returns {Observable} Currencies data */ updateCurrencies(currencies: any[]): Observable { - return this.http.put('/currencies', {currencies}); + return this.http.put('/currencies', { currencies }); } /** @@ -431,7 +431,7 @@ export class OrganizationService { */ settleCash(tellerId: string, cashierId: string, cashData: any): Observable { const httpParams = new HttpParams().set('command', 'settle'); - return this.http.post(`/tellers/${tellerId}/cashiers/${cashierId}/settle`, cashData, {params: httpParams}); + return this.http.post(`/tellers/${tellerId}/cashiers/${cashierId}/settle`, cashData, { params: httpParams }); } /** @@ -442,7 +442,7 @@ export class OrganizationService { */ allocateCash(tellerId: string, cashierId: string, cashData: any): Observable { const httpParams = new HttpParams().set('command', 'allocate'); - return this.http.post(`/tellers/${tellerId}/cashiers/${cashierId}/allocate`, cashData, {params: httpParams}); + return this.http.post(`/tellers/${tellerId}/cashiers/${cashierId}/allocate`, cashData, { params: httpParams }); } /** Get Cashier Template. @@ -639,6 +639,17 @@ export class OrganizationService { return this.http.delete(`/holidays/${holidayId}`); } + /** + * Activate Holiday. + * @param holidayId Holiday Id to be deleted. + * @returns {Observable} Resource Id. + */ + activateHoliday(holidayId: string): Observable { + const httpParams = new HttpParams() + .set('command', 'activate'); + return this.http.post(`/holidays/${holidayId}`, null, { params: httpParams }); + } + /** * @param {any} employeeId Employee ID of Employee to be edited. * @returns {Observable} @@ -695,7 +706,7 @@ export class OrganizationService { */ getImports(entity: string): Observable { const httpParams = new HttpParams().set('entityType', entity); - return this.http.get('/imports', { params: httpParams } ); + return this.http.get('/imports', { params: httpParams }); } /** @@ -754,7 +765,7 @@ export class OrganizationService { if (legalFormType.length) { httpParams = httpParams.set('legalFormType', legalFormType); } - return this.http.get(`${urlSuffix}/downloadtemplate`, { params: httpParams, responseType: 'arraybuffer', observe: 'response'} ); + return this.http.get(`${urlSuffix}/downloadtemplate`, { params: httpParams, responseType: 'arraybuffer', observe: 'response' }); } /** @@ -764,8 +775,8 @@ export class OrganizationService { getImportDocument(id: any): Observable { const httpParams = new HttpParams() .set('importDocumentId', id) - .set('tenantIdentifier', 'default' ); - return this.http.get('/imports/downloadOutputTemplate', { params: httpParams, responseType: 'arraybuffer', observe: 'response'}); + .set('tenantIdentifier', 'default'); + return this.http.get('/imports/downloadOutputTemplate', { params: httpParams, responseType: 'arraybuffer', observe: 'response' }); } /** @@ -783,7 +794,7 @@ export class OrganizationService { formData.append('file', file); formData.append('locale', this.settingsService.language.code); formData.append('dateFormat', this.settingsService.dateFormat); - return this.http.post(`${urlSuffix}/uploadtemplate`, formData , { params: httpParams } ); + return this.http.post(`${urlSuffix}/uploadtemplate`, formData, { params: httpParams }); } }