2020-04-14 11:28:33 +02:00
|
|
|
import { Component, OnInit } from '@angular/core';
|
|
|
|
import { BaseComponent } from '../base-page/base.component';
|
|
|
|
import { ConfigService } from '../../services/config.service';
|
|
|
|
import { environment } from '../../../environments/environment';
|
|
|
|
import { PollUtilities } from '../../config/PollUtilities';
|
2019-08-10 16:57:36 +02:00
|
|
|
|
|
|
|
@Component({
|
2019-08-11 16:21:49 +02:00
|
|
|
selector: 'framadate-visibility',
|
|
|
|
templateUrl: './visibility.component.html',
|
2020-04-14 11:28:33 +02:00
|
|
|
styleUrls: ['./visibility.component.scss'],
|
2019-08-10 16:57:36 +02:00
|
|
|
})
|
|
|
|
export class VisibilityComponent extends BaseComponent implements OnInit {
|
2019-11-23 14:58:44 +01:00
|
|
|
showCustomPassword = false;
|
2020-04-19 14:22:10 +02:00
|
|
|
baseUrl = environment.api.baseHref;
|
2020-01-22 14:42:46 +01:00
|
|
|
environment = environment;
|
2019-08-10 16:57:36 +02:00
|
|
|
|
2020-04-14 11:28:33 +02:00
|
|
|
constructor(public config: ConfigService, public utils: PollUtilities) {
|
2019-08-11 16:21:49 +02:00
|
|
|
super(config);
|
|
|
|
}
|
2019-08-10 16:57:36 +02:00
|
|
|
|
2019-08-11 16:21:49 +02:00
|
|
|
ngOnInit() {
|
2020-02-05 11:13:36 +01:00
|
|
|
this.config.customUrl = this.utils.makeSlug(this.config);
|
2020-04-14 11:28:33 +02:00
|
|
|
this.config.expirationDate = this.config
|
|
|
|
.addDaysToDate(this.config.expiracyDateDefaultInDays, new Date())
|
|
|
|
.toISOString()
|
|
|
|
.substring(0, 10);
|
2019-11-23 14:58:44 +01:00
|
|
|
}
|
|
|
|
|
2020-01-20 15:35:33 +01:00
|
|
|
submitCreationAndGoToEnd() {
|
|
|
|
this.config.createPoll();
|
|
|
|
}
|
2019-08-10 16:57:36 +02:00
|
|
|
}
|