funky-framadate-front/mocks/old-stuff/pages/visibility/visibility.component.ts

35 lines
1.1 KiB
TypeScript
Raw Normal View History

2020-04-22 12:56:18 +02:00
import { Location } from '@angular/common';
import { Component, OnInit } from '@angular/core';
2020-04-22 12:56:18 +02:00
2021-04-29 10:41:47 +02:00
import { environment } from '../../../../src/environments/environment';
2021-04-29 10:45:22 +02:00
import { PollUtilitiesService } from '../../../../src/app/core/services/poll.utilities.service';
2020-04-22 12:56:18 +02:00
import { ConfigService } from '../../services/config.service';
import { BaseComponent } from '../example/base-page/base.component';
2019-08-10 16:57:36 +02:00
@Component({
2020-04-22 12:56:18 +02:00
selector: 'app-visibility',
2020-04-21 10:50:26 +02:00
templateUrl: './visibility.component.html',
styleUrls: ['./visibility.component.scss'],
2019-08-10 16:57:36 +02:00
})
export class VisibilityComponent extends BaseComponent implements OnInit {
2020-04-22 12:56:18 +02:00
public location: Location;
public showCustomPassword = false;
public baseUrl = environment.api.baseHref;
2019-08-10 16:57:36 +02:00
2021-04-29 10:45:22 +02:00
constructor(public config: ConfigService, public utils: PollUtilitiesService) {
2020-04-21 10:50:26 +02:00
super(config);
}
2019-08-10 16:57:36 +02:00
2020-04-22 12:56:18 +02:00
ngOnInit(): void {
2021-04-27 13:04:32 +02:00
this.config.customUrl = 'un slug';
2020-04-21 10:50:26 +02:00
this.config.expirationDate = this.config
.addDaysToDate(this.config.expiracyDateDefaultInDays, new Date())
.toISOString()
.substring(0, 10);
}
2020-04-22 12:56:18 +02:00
public submitCreationAndGoToEnd(): void {
2020-04-21 10:50:26 +02:00
this.config.createPoll();
}
2019-08-10 16:57:36 +02:00
}