funky-framadate-front/src/app/features/administration/stepper/stepper.component.ts

39 lines
1.0 KiB
TypeScript
Raw Normal View History

import { Component, Input, OnInit } from '@angular/core';
2021-11-14 15:26:26 +01:00
import { PollService } from '../../../core/services/poll.service';
import { environment } from '../../../../environments/environment';
2021-11-17 15:06:36 +01:00
import { ConfirmationService } from 'primeng/api';
2021-11-17 15:16:47 +01:00
import { Router } from '@angular/router';
2020-05-01 19:10:17 +02:00
@Component({
selector: 'app-stepper',
templateUrl: './stepper.component.html',
styleUrls: ['./stepper.component.scss'],
})
2021-11-07 14:52:49 +01:00
export class StepperComponent {
2021-12-01 19:00:00 +01:00
@Input()
public stepperConfirm: HTMLElement;
@Input()
2021-11-07 14:52:49 +01:00
public step_current: number = 1;
@Input()
public step_max: number = 5;
public environment = environment;
2021-11-14 15:26:26 +01:00
public show_shortcuts = environment.showStepperShortcuts;
2021-12-06 12:13:47 +01:00
display_cancel_dialog: boolean;
2021-11-17 15:16:47 +01:00
constructor(
public pollService: PollService,
private confirmationService: ConfirmationService,
private router: Router
2021-12-01 19:00:00 +01:00
) {
this.step_current = this.pollService.step_current;
}
2021-11-17 15:06:36 +01:00
showCancelDialog() {
2021-12-06 12:13:47 +01:00
this.display_cancel_dialog = true;
2021-11-17 15:06:36 +01:00
}
2021-12-01 19:00:00 +01:00
goToHome() {
2021-12-06 12:13:47 +01:00
this.display_cancel_dialog = false;
2021-12-01 19:00:00 +01:00
this.router.navigate(['/']);
}
2020-05-01 19:10:17 +02:00
}