Skip to content
Snippets Groups Projects
Commit 2cb9f1cb authored by Alex ORLUC's avatar Alex ORLUC
Browse files

FEAT #13671 TIME 0:15 auto next step if verify ok

parent 203ca4fa
No related branches found
No related tags found
No related merge requests found
import { Component, OnInit } from '@angular/core'; import { Component, OnInit, Output, EventEmitter } from '@angular/core';
import { FormBuilder, FormGroup, Validators, ValidationErrors, ValidatorFn } from '@angular/forms'; import { FormBuilder, FormGroup, Validators, ValidationErrors, ValidatorFn } from '@angular/forms';
import { NotificationService } from '../../../service/notification/notification.service'; import { NotificationService } from '../../../service/notification/notification.service';
import { HttpClient } from '@angular/common/http'; import { HttpClient } from '@angular/common/http';
...@@ -25,6 +25,8 @@ export class DatabaseComponent implements OnInit { ...@@ -25,6 +25,8 @@ export class DatabaseComponent implements OnInit {
dataFiles: string[] = []; dataFiles: string[] = [];
@Output() nextStep = new EventEmitter<string>();
constructor( constructor(
public http: HttpClient, public http: HttpClient,
private _formBuilder: FormBuilder, private _formBuilder: FormBuilder,
...@@ -103,6 +105,7 @@ export class DatabaseComponent implements OnInit { ...@@ -103,6 +105,7 @@ export class DatabaseComponent implements OnInit {
this.dbExist = data.status === 200; this.dbExist = data.status === 200;
this.notify.success(this.lang.rightInformations); this.notify.success(this.lang.rightInformations);
this.stepFormGroup.controls['stateStep'].setValue('success'); this.stepFormGroup.controls['stateStep'].setValue('success');
this.nextStep.emit();
}), }),
catchError((err: any) => { catchError((err: any) => {
this.dbExist = false; this.dbExist = false;
......
import { Component, OnInit } from '@angular/core'; import { Component, OnInit, EventEmitter, Output } from '@angular/core';
import { FormBuilder, FormGroup, Validators, ValidatorFn } from '@angular/forms'; import { FormBuilder, FormGroup, Validators, ValidatorFn } from '@angular/forms';
import { NotificationService } from '../../../service/notification/notification.service'; import { NotificationService } from '../../../service/notification/notification.service';
import { tap } from 'rxjs/internal/operators/tap'; import { tap } from 'rxjs/internal/operators/tap';
...@@ -17,6 +17,8 @@ export class DocserversComponent implements OnInit { ...@@ -17,6 +17,8 @@ export class DocserversComponent implements OnInit {
lang: any = LANG; lang: any = LANG;
stepFormGroup: FormGroup; stepFormGroup: FormGroup;
@Output() nextStep = new EventEmitter<string>();
constructor( constructor(
private _formBuilder: FormBuilder, private _formBuilder: FormBuilder,
private notify: NotificationService, private notify: NotificationService,
...@@ -66,6 +68,7 @@ export class DocserversComponent implements OnInit { ...@@ -66,6 +68,7 @@ export class DocserversComponent implements OnInit {
tap((data: any) => { tap((data: any) => {
this.notify.success(this.lang.rightInformations); this.notify.success(this.lang.rightInformations);
this.stepFormGroup.controls['stateStep'].setValue('success'); this.stepFormGroup.controls['stateStep'].setValue('success');
this.nextStep.emit();
}), }),
catchError((err: any) => { catchError((err: any) => {
this.notify.error(this.lang.pathUnreacheable); this.notify.error(this.lang.pathUnreacheable);
......
...@@ -36,7 +36,7 @@ ...@@ -36,7 +36,7 @@
<ng-template matStepLabel>{{lang.database}}</ng-template> <ng-template matStepLabel>{{lang.database}}</ng-template>
<div class="stepContainer"> <div class="stepContainer">
<div class="stepContent"> <div class="stepContent">
<app-database #appDatabase #stepContent></app-database> <app-database #appDatabase #stepContent (nextStep)="nextStep()"></app-database>
</div> </div>
<button mat-fab matStepperPrevious [title]="lang.previous" class="previousStepButton" color="primary"> <button mat-fab matStepperPrevious [title]="lang.previous" class="previousStepButton" color="primary">
<mat-icon class="fa fa-arrow-left"></mat-icon> <mat-icon class="fa fa-arrow-left"></mat-icon>
...@@ -50,7 +50,7 @@ ...@@ -50,7 +50,7 @@
<ng-template matStepLabel>{{lang.docserver}}</ng-template> <ng-template matStepLabel>{{lang.docserver}}</ng-template>
<div class="stepContainer"> <div class="stepContainer">
<div class="stepContent"> <div class="stepContent">
<app-docservers #appDocservers #stepContent></app-docservers> <app-docservers #appDocservers #stepContent (nextStep)="nextStep()"></app-docservers>
</div> </div>
<button mat-fab matStepperPrevious [title]="lang.previous" class="previousStepButton" color="primary"> <button mat-fab matStepperPrevious [title]="lang.previous" class="previousStepButton" color="primary">
<mat-icon class="fa fa-arrow-left"></mat-icon> <mat-icon class="fa fa-arrow-left"></mat-icon>
......
...@@ -34,6 +34,7 @@ export class InstallerComponent implements OnInit, AfterViewInit { ...@@ -34,6 +34,7 @@ export class InstallerComponent implements OnInit, AfterViewInit {
lang: any = LANG; lang: any = LANG;
@ViewChildren('stepContent') stepContent: any; @ViewChildren('stepContent') stepContent: any;
@ViewChild('stepper', { static: true }) stepper: MatStepper;
constructor( constructor(
private http: HttpClient, private http: HttpClient,
...@@ -71,6 +72,10 @@ export class InstallerComponent implements OnInit, AfterViewInit { ...@@ -71,6 +72,10 @@ export class InstallerComponent implements OnInit, AfterViewInit {
this.stepContent.toArray()[ev.selectedIndex].initStep(); this.stepContent.toArray()[ev.selectedIndex].initStep();
} }
nextStep() {
this.stepper.next();
}
endInstall() { endInstall() {
let installContent: StepAction[] = []; let installContent: StepAction[] = [];
this.stepContent.toArray().forEach((component: any) => { this.stepContent.toArray().forEach((component: any) => {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment