This commit is contained in:
tykayn 2021-04-30 16:51:54 +02:00 committed by Baptiste Lemoine
commit bdfcef490c
176 changed files with 997 additions and 828 deletions

View File

@ -6,7 +6,7 @@
"polls": [
{
"id": 1,
"slug": "picnic",
"custom_url": "picnic",
"configuration": {
"id": 1,
"isAboutDate": true,
@ -24,7 +24,7 @@
},
{
"id": 2,
"slug": "vacances",
"custom_url": "vacances",
"configuration": {
"id": 2,
"isAboutDate": true,

View File

@ -1,7 +1,7 @@
/**
* une option de date dans les sondages spéciaux
*/
import { environment } from '../../../../environments/environment';
import { environment } from '../../../src/environments/environment';
import { DateChoice, defaultAnswers, otherDefaultDates, PollAnswer } from './defaultConfigs';
export interface DateOption {
@ -40,7 +40,7 @@ export class PollConfig {
myEmail: string = environment.production ? '' : 'tktest@tktest.com';
myPolls: any = []; // list of retrieved polls from the backend api
/*
date specific poll, we have the choice to setup different hours (timeList) for all possible dates (dateList), or use the same hours for all dates
date specific poll, we have the choice to setup different hours (timeSlices) for all possible dates (dateList), or use the same hours for all dates
*/
allowSeveralHours = 'true';
// access
@ -50,11 +50,11 @@ export class PollConfig {
expirationDate = ''; // expiracy date
voteStackId = null; // id of the vote stack to update
pollId = null; // id of the current poll when created. data given by the backend api
pollSlug = null; // id of the current poll when created. data given by the backend api
custom_url = null; // id of the current poll when created. data given by the backend api
currentPoll; // current poll selected with createPoll or getPoll of ConfigService
passwordAccess = 0;
password = '';
customUrl = ''; // custom slug in the url, must be unique
customUrl = ''; // custom custom_url in the url, must be unique
customUrlIsUnique = null; // given by the backend
urlSlugPublic = null;
urlPublic = environment.production ? '' : document.location.href + '/poll/id/4';

View File

@ -33,7 +33,7 @@ const routes: Routes = [
{ path: 'step/end', component: EndConfirmationComponent },
{ path: 'graphic/:poll', component: PollGraphicComponent },
{ path: 'vote/poll/id/:id', component: PollDisplayComponent },
{ path: 'vote/poll/slug/:slug', component: PollDisplayComponent },
{ path: 'vote/poll/custom_url/:custom_url', component: PollDisplayComponent },
{ path: 'votingchoice', component: VotingChoiceComponent },
{ path: 'voting', component: VotingComponent },
];

View File

@ -3,7 +3,7 @@ import { NgModule } from '@angular/core';
import { TranslateModule } from '@ngx-translate/core';
import { ConfirmationService, DialogModule, MessageService } from 'primeng';
import { SharedModule } from '../../shared/shared.module';
import { SharedModule } from '../../src/app/shared/shared.module';
import { DateValueAccessorModule } from './custom-lib/date-value-accessor';
import { OldStuffRoutingModule } from './old-stuff-routing.module';
import { AdminComponent } from './pages/admin/admin.component';

View File

@ -2,8 +2,8 @@ import { Component, OnInit } from '@angular/core';
import { ConfigService } from '../../services/config.service';
import { ActivatedRoute, Router } from '@angular/router';
import { HttpClient } from '@angular/common/http';
import { PollUtilities } from '../../config/PollUtilities';
import { environment } from '../../../../../environments/environment';
import { PollUtilitiesService } from '../../../../src/app/core/services/poll.utilities.service';
import { environment } from '../../../../src/environments/environment';
@Component({
selector: 'app-admin',
@ -16,7 +16,7 @@ export class AdminComponent implements OnInit {
constructor(
public config: ConfigService,
public router: Router,
private utils: PollUtilities,
private utils: PollUtilitiesService,
public http: HttpClient,
public activeRoute: ActivatedRoute
) {}
@ -39,7 +39,7 @@ export class AdminComponent implements OnInit {
});
}
// fetch poll with its ID or slug.
// fetch poll with its ID or custom_url.
fetchPoll() {
const token = this.tokenForAdministration;
const headers = this.utils.makeHeaders({ token: token });

View File

@ -1,8 +1,8 @@
import { DOCUMENT } from '@angular/common';
import { ChangeDetectorRef, Component, Inject, OnInit } from '@angular/core';
import { ToastService } from '../../../../core/services/toast.service';
import { DateUtilities } from '../../config/DateUtilities';
import { ToastService } from '../../../../src/app/core/services/toast.service';
import { DateUtilitiesService } from '../../../../src/app/core/services/date.utilities.service';
import { otherDefaultDates } from '../../config/defaultConfigs';
import { ConfigService } from '../../services/config.service';
import { BaseComponent } from '../example/base-page/base.component';
@ -23,7 +23,7 @@ export class DatesComponent extends BaseComponent implements OnInit {
public config: ConfigService,
private cd: ChangeDetectorRef,
private toastService: ToastService,
private dateUtilities: DateUtilities,
private dateUtilities: DateUtilitiesService,
@Inject(DOCUMENT) private document: any
) {
super(config);

View File

@ -1,7 +1,7 @@
import { HttpClient } from '@angular/common/http';
import { Component, OnInit } from '@angular/core';
import { ToastService } from '../../../../core/services/toast.service';
import { ToastService } from '../../../../src/app/core/services/toast.service';
import { ConfigService } from '../../services/config.service';
import { BaseComponent } from '../example/base-page/base.component';

View File

@ -47,7 +47,7 @@
<br />
<a href="/" class="btn btn--primary btn--outline">
<a href='/' class="btn btn--primary btn--outline">
primary - outline - default
</a>

View File

@ -0,0 +1 @@
@import '../../../../../src/styles/variables';

View File

@ -3,7 +3,7 @@ import { BaseComponent } from '../../example/base-page/base.component';
import { ConfigService } from '../../../services/config.service';
import { mockComments } from '../../../mocks/mock-comments';
import { ActivatedRoute, Router } from '@angular/router';
import { environment } from '../../../../../../environments/environment';
import { environment } from '../../../../../src/environments/environment';
import { mockPoll3 } from '../../../mocks/mock-poll3';
@Component({
@ -28,7 +28,7 @@ export class PollDisplayComponent extends BaseComponent implements OnInit {
ngOnInit(): void {}
// fetch poll with its ID or slug.
// fetch poll with its ID or custom_url.
fetchPoll() {
const id = this.activeRoute.snapshot.params.poll;
const pollSlug = this.activeRoute.snapshot.params.pollSlug;

View File

@ -102,8 +102,8 @@
{{ 'visibility.access_instructions' | translate }}
</sub>
<div class="preview-url">
<a [href]="'/vote/poll/slug/' + config.customUrl">
{{ '/vote/poll/slug/' + config.customUrl }}
<a [href]="'/vote/poll/custom_url/' + config.customUrl">
{{ '/vote/poll/custom_url/' + config.customUrl }}
</a>
</div>
<br />

View File

@ -1,8 +1,8 @@
import { Location } from '@angular/common';
import { Component, OnInit } from '@angular/core';
import { environment } from '../../../../../environments/environment';
import { PollUtilities } from '../../config/PollUtilities';
import { environment } from '../../../../src/environments/environment';
import { PollUtilitiesService } from '../../../../src/app/core/services/poll.utilities.service';
import { ConfigService } from '../../services/config.service';
import { BaseComponent } from '../example/base-page/base.component';
@ -16,12 +16,12 @@ export class VisibilityComponent extends BaseComponent implements OnInit {
public showCustomPassword = false;
public baseUrl = environment.api.baseHref;
constructor(public config: ConfigService, public utils: PollUtilities) {
constructor(public config: ConfigService, public utils: PollUtilitiesService) {
super(config);
}
ngOnInit(): void {
this.config.customUrl = 'un slug';
this.config.customUrl = 'un custom_url';
this.config.expirationDate = this.config
.addDaysToDate(this.config.expiracyDateDefaultInDays, new Date())
.toISOString()

View File

@ -5,7 +5,7 @@
// -- IMPORTS
// ----------------------------
@import '../../../../../../styles/variables';
@import '../../../../../src/styles/variables';
// -- VARIABLES
// ----------------------------

Some files were not shown because too many files have changed in this diff Show More