feat: tour integration
Tour Integration
This commit is contained in:
+14
-2
@@ -7,7 +7,7 @@
|
||||
|
||||
<mat-card-content>
|
||||
|
||||
<div fxLayout="row wrap" fxLayoutGap="2%" fxLayout.lt-md="column">
|
||||
<div #searchFormRef fxLayout="row wrap" fxLayoutGap="2%" fxLayout.lt-md="column">
|
||||
|
||||
<mat-form-field fxFlex="88%">
|
||||
<mat-label>Office</mat-label>
|
||||
@@ -21,7 +21,9 @@
|
||||
</mat-error>
|
||||
</mat-form-field>
|
||||
|
||||
<button mat-button type="button" color="primary" fxFlex="8%" (click)="retrieveOpeningBalances()">Retrieve</button>
|
||||
<div>
|
||||
<button mat-button type="button" color="primary" fxFlex="8%" (click)="retrieveOpeningBalances()">Retrieve</button>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
@@ -124,3 +126,13 @@
|
||||
</mat-card>
|
||||
|
||||
</div>
|
||||
|
||||
<ng-template #templateSearchFormRef let-popover="popover">
|
||||
<h2>Migrate opening balances (Office-wise)</h2>
|
||||
<p class="mw300">This form will be used to migrate opening balances. To know more click: <a href="https://mifosforge.jira.com/wiki/spaces/docs/pages/90243328/Migrate+opening+balances+Office-wise" target="_blank">Migrate opening balances (Office-wise)</a></p>
|
||||
<div fxLayout="row" fxLayoutAlign="end" fxLayoutGap="2%" fxLayout.lt-md="column">
|
||||
<button mat-raised-button color="warn" (click)="popover.close();configurationWizardService.closeConfigWizard()">Close</button>
|
||||
<button mat-raised-button color="primary" (click)="popover.close();popover.close();previousStep();">Back</button>
|
||||
<button mat-raised-button color="primary" (click)="popover.close();popover.close();nextStep();">Next</button>
|
||||
</div>
|
||||
</ng-template>
|
||||
|
||||
@@ -1,11 +1,14 @@
|
||||
/** Angular Imports */
|
||||
import { Component, OnInit } from '@angular/core';
|
||||
import { Component, OnInit, TemplateRef, ElementRef, ViewChild, AfterViewInit } from '@angular/core';
|
||||
import { FormGroup, FormBuilder, Validators, FormArray } from '@angular/forms';
|
||||
import { ActivatedRoute, Router } from '@angular/router';
|
||||
|
||||
/** Custom Services */
|
||||
import { AccountingService } from '../accounting.service';
|
||||
import { SettingsService } from 'app/settings/settings.service';
|
||||
import { PopoverService } from '../../configuration-wizard/popover/popover.service';
|
||||
import { ConfigurationWizardService } from '../../configuration-wizard/configuration-wizard.service';
|
||||
|
||||
/** Custom Validators */
|
||||
import { onlyOneOfTheFieldsIsRequiredValidator } from './only-one-of-the-fields-is-required.validator';
|
||||
import { Dates } from 'app/core/utils/dates';
|
||||
@@ -18,7 +21,7 @@ import { Dates } from 'app/core/utils/dates';
|
||||
templateUrl: './migrate-opening-balances.component.html',
|
||||
styleUrls: ['./migrate-opening-balances.component.scss']
|
||||
})
|
||||
export class MigrateOpeningBalancesComponent implements OnInit {
|
||||
export class MigrateOpeningBalancesComponent implements OnInit, AfterViewInit {
|
||||
|
||||
/** Minimum opening balances date allowed. */
|
||||
minDate = new Date(2000, 0, 1);
|
||||
@@ -37,6 +40,11 @@ export class MigrateOpeningBalancesComponent implements OnInit {
|
||||
/** Sum total of credits. */
|
||||
creditsSum = 0;
|
||||
|
||||
/* Reference of search form */
|
||||
@ViewChild('searchFormRef') searchFormRef: ElementRef<any>;
|
||||
/* Template for popover on search form */
|
||||
@ViewChild('templateSearchFormRef') templateSearchFormRef: TemplateRef<any>;
|
||||
|
||||
/**
|
||||
* Retrieves the offices and currencies from `resolve`.
|
||||
* @param {FormBuilder} formBuilder Form Builder.
|
||||
@@ -44,13 +52,17 @@ export class MigrateOpeningBalancesComponent implements OnInit {
|
||||
* @param {SettingsService} settingsService Settings Service.
|
||||
* @param {ActivatedRoute} route Activated Route.
|
||||
* @param {Router} router Router for navigation.
|
||||
* @param {ConfigurationWizardService} configurationWizardService ConfigurationWizard Service.
|
||||
* @param {PopoverService} popoverService PopoverService.
|
||||
*/
|
||||
constructor(private formBuilder: FormBuilder,
|
||||
private accountingService: AccountingService,
|
||||
private settingsService: SettingsService,
|
||||
private dateUtils: Dates,
|
||||
private route: ActivatedRoute,
|
||||
private router: Router) {
|
||||
private router: Router,
|
||||
private configurationWizardService: ConfigurationWizardService,
|
||||
private popoverService: PopoverService) {
|
||||
this.route.data.subscribe((data: {
|
||||
offices: any,
|
||||
currencies: any
|
||||
@@ -160,4 +172,42 @@ export class MigrateOpeningBalancesComponent implements OnInit {
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Popover function
|
||||
* @param template TemplateRef<any>.
|
||||
* @param target HTMLElement | ElementRef<any>.
|
||||
* @param position String.
|
||||
* @param backdrop Boolean.
|
||||
*/
|
||||
showPopover(template: TemplateRef<any>, target: HTMLElement | ElementRef<any>, position: string, backdrop: boolean): void {
|
||||
setTimeout(() => this.popoverService.open(template, target, position, backdrop, {}), 200);
|
||||
}
|
||||
|
||||
/**
|
||||
* To show popover.
|
||||
*/
|
||||
ngAfterViewInit() {
|
||||
if (this.configurationWizardService.showMigrateOpeningBalances === true) {
|
||||
setTimeout(() => {
|
||||
this.showPopover(this.templateSearchFormRef, this.searchFormRef.nativeElement, 'bottom', true);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Next Step (Closing Entries Accounting Page) Configuration Wizard.
|
||||
*/
|
||||
nextStep() {
|
||||
this.configurationWizardService.showMigrateOpeningBalances = false;
|
||||
this.configurationWizardService.showClosingEntries = true;
|
||||
this.router.navigate(['/accounting']);
|
||||
}
|
||||
|
||||
/**
|
||||
* Previous Step (Migrate Opening Balances Accounting Page) Configuration Wizard.
|
||||
*/
|
||||
previousStep() {
|
||||
this.router.navigate(['/accounting']);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user