feat: tour integration
Tour Integration
This commit is contained in:
+20
-2
@@ -1,13 +1,13 @@
|
||||
<div class="container">
|
||||
|
||||
<div fxLayout="row">
|
||||
<div #filter fxLayout="row">
|
||||
<mat-form-field fxFlex>
|
||||
<mat-label>Filter</mat-label>
|
||||
<input matInput (keyup)="applyFilter($event.target.value)">
|
||||
</mat-form-field>
|
||||
</div>
|
||||
|
||||
<div class="mat-elevation-z8">
|
||||
<div #configurationsTable class="mat-elevation-z8">
|
||||
|
||||
<table mat-table [dataSource]="dataSource" matSort>
|
||||
|
||||
@@ -54,3 +54,21 @@
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<ng-template #templateFilter let-data let-popover="popover">
|
||||
<h4>Search bar to filter configurations.</h4>
|
||||
<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();previousStep()">Back</button>
|
||||
<button mat-raised-button color="primary" (click)="popover.close();showPopover(templateConfigurationsTable, configurationsTable, 'top', true)">Next</button>
|
||||
</div>
|
||||
</ng-template>
|
||||
|
||||
<ng-template #templateConfigurationsTable let-data let-popover="popover">
|
||||
<h4 class="mw300">Global Configuration options and their current status. For more details click: <a href="https://mifosforge.jira.com/wiki/spaces/docs/pages/67895362/Global+Configuration" target="_blank">Global Configurations</a></h4>
|
||||
<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();showPopover(templateFilter, filter, 'bottom', true)">Back</button>
|
||||
<button mat-raised-button color="primary" (click)="popover.close();nextStep()">Next</button>
|
||||
</div>
|
||||
</ng-template>
|
||||
|
||||
+70
-4
@@ -1,20 +1,23 @@
|
||||
/** 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 { AlertService } from 'app/core/alert/alert.service';
|
||||
import { SettingsService } from 'app/settings/settings.service';
|
||||
import { ActivatedRoute, Router } from '@angular/router';
|
||||
|
||||
/** Custom Services */
|
||||
import { SystemService } from '../../system.service';
|
||||
import { PopoverService } from '../../../configuration-wizard/popover/popover.service';
|
||||
import { ConfigurationWizardService } from '../../../configuration-wizard/configuration-wizard.service';
|
||||
|
||||
@Component({
|
||||
selector: 'mifosx-global-configurations-tab',
|
||||
templateUrl: './global-configurations-tab.component.html',
|
||||
styleUrls: ['./global-configurations-tab.component.scss']
|
||||
})
|
||||
export class GlobalConfigurationsTabComponent implements OnInit {
|
||||
export class GlobalConfigurationsTabComponent implements OnInit, AfterViewInit {
|
||||
|
||||
/** Configuration data. */
|
||||
configurationData: any;
|
||||
@@ -28,14 +31,29 @@ export class GlobalConfigurationsTabComponent implements OnInit {
|
||||
/** Sorter for configurations table. */
|
||||
@ViewChild(MatSort, { static: true }) sort: MatSort;
|
||||
|
||||
/* Reference of filter */
|
||||
@ViewChild('filter') filter: ElementRef<any>;
|
||||
/* Template for popover on filter */
|
||||
@ViewChild('templateFilter') templateFilter: TemplateRef<any>;
|
||||
/* Reference of configurations table */
|
||||
@ViewChild('configurationsTable') configurationsTable: ElementRef<any>;
|
||||
/* Template for popover on configurations table */
|
||||
@ViewChild('templateConfigurationsTable') templateConfigurationsTable: TemplateRef<any>;
|
||||
|
||||
/**
|
||||
* Retrieves the configurations data from `resolve`.
|
||||
* @param {ActivatedRoute} route Activated Route.
|
||||
* @param {SystemService} systemService System Service.
|
||||
* @param {Router} router Router for navigation.
|
||||
* @param {ConfigurationWizardService} configurationWizardService ConfigurationWizard Service.
|
||||
* @param {PopoverService} popoverService PopoverService.
|
||||
*/
|
||||
constructor(private alertService: AlertService,
|
||||
private systemService: SystemService) {
|
||||
constructor(private route: ActivatedRoute,
|
||||
private alertService: AlertService,
|
||||
private systemService: SystemService,
|
||||
private router: Router,
|
||||
private configurationWizardService: ConfigurationWizardService,
|
||||
private popoverService: PopoverService) {
|
||||
this.configurationData = this.systemService.getConfigurations();
|
||||
}
|
||||
|
||||
@@ -80,4 +98,52 @@ export class GlobalConfigurationsTabComponent 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.showConfigurationsPage === true) {
|
||||
setTimeout(() => {
|
||||
this.showPopover(this.templateFilter, this.filter.nativeElement, 'bottom', true);
|
||||
});
|
||||
}
|
||||
|
||||
if (this.configurationWizardService.showConfigurationsList === true) {
|
||||
setTimeout(() => {
|
||||
this.showPopover(this.templateConfigurationsTable, this.configurationsTable.nativeElement, 'top', true);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Next Step (Scheduler Jobs System Page) Configuration Wizard.
|
||||
*/
|
||||
nextStep() {
|
||||
this.configurationWizardService.showConfigurationsPage = false;
|
||||
this.configurationWizardService.showConfigurationsList = false;
|
||||
this.configurationWizardService.showSchedulerJobs = true;
|
||||
this.router.navigate(['/system']);
|
||||
}
|
||||
|
||||
/**
|
||||
* Previous Step (Global Configurations System Page) Configuration Wizard.
|
||||
*/
|
||||
previousStep() {
|
||||
this.configurationWizardService.showConfigurationsPage = false;
|
||||
this.configurationWizardService.showConfigurationsList = false;
|
||||
this.configurationWizardService.showConfigurations = true;
|
||||
this.router.navigate(['/system']);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user