Browse Source

Merge branch 'feature/reformat_all_files' into 'develop'

reformat all files + move routes.ts to AppRoutingModule

See merge request framasoft/framadate/funky-framadate-front!28
develop
ty kayn 2 years ago
parent
commit
d9c325a0e9
  1. 1
      package.json
  2. 50
      src/app/app-routing.module.ts
  3. 32
      src/app/app.component.html
  4. 48
      src/app/app.component.spec.ts
  5. 57
      src/app/app.component.ts
  6. 115
      src/app/app.module.ts
  7. 17
      src/app/config/DateUtilities.ts
  8. 19
      src/app/config/PollConfig.ts
  9. 38
      src/app/config/PollUtilities.ts
  10. 79
      src/app/config/Routes.ts
  11. 89
      src/app/config/defaultConfigs.ts
  12. 20
      src/app/config/graph-canevas-options.ts
  13. 18
      src/app/config/mocks/choice.ts
  14. 25
      src/app/config/mocks/mock-comments.ts
  15. 38
      src/app/config/mocks/mock-graph.ts
  16. 966
      src/app/config/mocks/mock-poll3.ts
  17. 1246
      src/app/config/mocks/mock-success-vote.ts
  18. 87
      src/app/config/mocks/mockmypolls.ts
  19. 18
      src/app/custom-lib/date-value-accessor/date-value-accessor.ts
  20. 1
      src/app/custom-lib/date-value-accessor/index.ts
  21. 6
      src/app/custom-lib/date-value-accessor/module.ts
  22. 70
      src/app/debugger/debugger.component.html
  23. 31
      src/app/debugger/debugger.component.spec.ts
  24. 14
      src/app/debugger/debugger.component.ts
  25. 31
      src/app/header/header.component.spec.ts
  26. 13
      src/app/header/header.component.ts
  27. 120
      src/app/pages/admin/admin.component.html
  28. 78
      src/app/pages/admin/admin.component.scss
  29. 31
      src/app/pages/admin/admin.component.spec.ts
  30. 14
      src/app/pages/admin/admin.component.ts
  31. 126
      src/app/pages/answers/answers.component.html
  32. 31
      src/app/pages/answers/answers.component.spec.ts
  33. 52
      src/app/pages/answers/answers.component.ts
  34. 2
      src/app/pages/base-page/base.component.html
  35. 31
      src/app/pages/base-page/base.component.spec.ts
  36. 14
      src/app/pages/base-page/base.component.ts
  37. 121
      src/app/pages/create-or-retrieve/create-or-retrieve.component.html
  38. 34
      src/app/pages/create-or-retrieve/create-or-retrieve.component.scss
  39. 31
      src/app/pages/create-or-retrieve/create-or-retrieve.component.spec.ts
  40. 15
      src/app/pages/create-or-retrieve/create-or-retrieve.component.ts
  41. 303
      src/app/pages/dates/dates.component.html
  42. 4
      src/app/pages/dates/dates.component.scss
  43. 31
      src/app/pages/dates/dates.component.spec.ts
  44. 65
      src/app/pages/dates/dates.component.ts
  45. 118
      src/app/pages/end-confirmation/end-confirmation.component.html
  46. 31
      src/app/pages/end-confirmation/end-confirmation.component.spec.ts
  47. 26
      src/app/pages/end-confirmation/end-confirmation.component.ts
  48. 152
      src/app/pages/home/home.component.html
  49. 31
      src/app/pages/home/home.component.spec.ts
  50. 13
      src/app/pages/home/home.component.ts
  51. 500
      src/app/pages/kind/kind.component.html
  52. 1
      src/app/pages/kind/kind.component.scss
  53. 31
      src/app/pages/kind/kind.component.spec.ts
  54. 13
      src/app/pages/kind/kind.component.ts
  55. 12
      src/app/pages/password/password.component.html
  56. 18
      src/app/pages/password/password.component.scss
  57. 31
      src/app/pages/password/password.component.spec.ts
  58. 15
      src/app/pages/password/password.component.ts
  59. 3
      src/app/pages/pictures/pictures.component.html
  60. 31
      src/app/pages/pictures/pictures.component.spec.ts
  61. 13
      src/app/pages/pictures/pictures.component.ts
  62. 116
      src/app/pages/poll-display/poll-display.component.html
  63. 4
      src/app/pages/poll-display/poll-display.component.scss
  64. 31
      src/app/pages/poll-display/poll-display.component.spec.ts
  65. 40
      src/app/pages/poll-display/poll-display.component.ts
  66. 164
      src/app/pages/resume/resume.component.html
  67. 31
      src/app/pages/resume/resume.component.spec.ts
  68. 15
      src/app/pages/resume/resume.component.ts
  69. 288
      src/app/pages/visibility/visibility.component.html
  70. 31
      src/app/pages/visibility/visibility.component.spec.ts
  71. 21
      src/app/pages/visibility/visibility.component.ts
  72. 41
      src/app/pages/voting/choices-list/choices-list.component.html
  73. 31
      src/app/pages/voting/choices-list/choices-list.component.spec.ts
  74. 12
      src/app/pages/voting/choices-list/choices-list.component.ts
  75. 85
      src/app/pages/voting/comments-list/comments-list.component.html
  76. 34
      src/app/pages/voting/comments-list/comments-list.component.spec.ts
  77. 12
      src/app/pages/voting/comments-list/comments-list.component.ts
  78. 269
      src/app/pages/voting/voting-choice/voting-choice.component.html
  79. 33
      src/app/pages/voting/voting-choice/voting-choice.component.scss
  80. 41
      src/app/pages/voting/voting-choice/voting-choice.component.spec.ts
  81. 28
      src/app/pages/voting/voting-choice/voting-choice.component.ts
  82. 24
      src/app/pages/voting/voting-comment/voting-comment.component.html
  83. 9
      src/app/pages/voting/voting-comment/voting-comment.component.spec.ts
  84. 14
      src/app/pages/voting/voting-comment/voting-comment.component.ts
  85. 31
      src/app/pages/voting/voting-graph/voting-graph.component.spec.ts
  86. 15
      src/app/pages/voting/voting-graph/voting-graph.component.ts
  87. 57
      src/app/pages/voting/voting-navigation/voting-navigation.component.html
  88. 31
      src/app/pages/voting/voting-navigation/voting-navigation.component.spec.ts
  89. 11
      src/app/pages/voting/voting-navigation/voting-navigation.component.ts
  90. 269
      src/app/pages/voting/voting-summary/voting-summary.component.html
  91. 2
      src/app/pages/voting/voting-summary/voting-summary.component.scss
  92. 31
      src/app/pages/voting/voting-summary/voting-summary.component.spec.ts
  93. 24
      src/app/pages/voting/voting-summary/voting-summary.component.ts
  94. 7
      src/app/pages/voting/voting.component.html
  95. 31
      src/app/pages/voting/voting.component.spec.ts
  96. 15
      src/app/pages/voting/voting.component.ts
  97. 35
      src/app/poll-graphic/poll-graphic.component.html
  98. 31
      src/app/poll-graphic/poll-graphic.component.spec.ts
  99. 72
      src/app/poll-graphic/poll-graphic.component.ts
  100. 1224
      src/app/services/config.service.ts
  101. Some files were not shown because too many files have changed in this diff Show More

1
package.json

@ -6,7 +6,6 @@
"ng": "ng",
"start": "ng serve",
"compodoc": "compodoc -p tsconfig.json",
"serve": "ng serve",
"build": "ng build --crossOrigin=anonymous --prod",
"package": "cat dist/framadate/*.js > dist/framadate/framadate-scripts-bundled.js && ls -l dist/framadate",
"bld:pkg": "npm run build && npm run package",

50
src/app/app-routing.module.ts

@ -1,12 +1,48 @@
import {NgModule} from '@angular/core';
import {RouterModule, Routes} from '@angular/router';
import { NgModule } from '@angular/core';
import { RouterModule, Routes } from '@angular/router';
import { AdminComponent } from './pages/admin/admin.component';
import { AnswersComponent } from './pages/answers/answers.component';
import { BaseComponent } from './pages/base-page/base.component';
import { CreateOrRetrieveComponent } from './pages/create-or-retrieve/create-or-retrieve.component';
import { DatesComponent } from './pages/dates/dates.component';
import { EndConfirmationComponent } from './pages/end-confirmation/end-confirmation.component';
import { HomeComponent } from './pages/home/home.component';
import { KindComponent } from './pages/kind/kind.component';
import { PasswordComponent } from './pages/password/password.component';
import { PicturesComponent } from './pages/pictures/pictures.component';
import { PollDisplayComponent } from './pages/poll-display/poll-display.component';
import { ResumeComponent } from './pages/resume/resume.component';
import { VisibilityComponent } from './pages/visibility/visibility.component';
import { VotingChoiceComponent } from './pages/voting/voting-choice/voting-choice.component';
import { VotingComponent } from './pages/voting/voting.component';
import { PollGraphicComponent } from './poll-graphic/poll-graphic.component';
const routes: Routes = [];
const routes: Routes = [
{ path: '', redirectTo: 'step/creation', pathMatch: 'full' },
{ path: 'home', component: HomeComponent },
{ path: 'base', component: BaseComponent },
{ path: 'step/base', component: BaseComponent },
{ path: 'step/creation', component: CreateOrRetrieveComponent },
{ path: 'step/date', component: DatesComponent },
{ path: 'step/kind', component: KindComponent },
{ path: 'step/answers', component: AnswersComponent },
{ path: 'step/admin', component: AdminComponent },
{ path: 'step/pictures', component: PicturesComponent },
{ path: 'step/visibility', component: VisibilityComponent },
{ path: 'step/resume', component: ResumeComponent },
{ path: 'step/end', component: EndConfirmationComponent },
{ path: 'graphic/:poll', component: PollGraphicComponent },
{ path: 'vote/poll/id/:poll', component: PollDisplayComponent },
{ path: 'vote/poll/slug/:pollSlug', component: PollDisplayComponent },
{ path: 'votingchoice', component: VotingChoiceComponent },
{ path: 'voting', component: VotingComponent },
{ path: 'step/password', component: PasswordComponent },
{ path: '**', redirectTo: '/home', pathMatch: 'full' },
];
@NgModule({
imports: [RouterModule.forRoot(routes, {useHash: true, anchorScrolling: 'enabled',})],
exports: [RouterModule]
imports: [RouterModule.forRoot(routes, { useHash: true, anchorScrolling: 'enabled' })],
exports: [RouterModule],
})
export class AppRoutingModule {
}
export class AppRoutingModule {}

32
src/app/app.component.html

@ -1,47 +1,31 @@
<div
id='big_container'
class={{this.config.preferences.themeClass}}
>
<header class='big-header'>
<div class='container'>
<div class='columns'>
<div class='column'>
<div id="big_container" class="{{ this.config.preferences.themeClass }}">
<header class="big-header">
<div class="container">
<div class="columns">
<div class="column">
<framadate-master-head></framadate-master-head>
</div>
<div class='column'>
<div class="column">
<framadate-language></framadate-language>
</div>
</div>
</div>
</header>
<main>
<div class="container">
<div class="columns">
<div class="column is-one-quarter">
<framadate-theme-selector></framadate-theme-selector>
<framadate-navigation
*ngIf="config.menuVisible"
[step]="step"
></framadate-navigation>
<framadate-debugger
*ngIf="isDevelopmentEnv"
></framadate-debugger>
<framadate-navigation *ngIf="config.menuVisible" [step]="step"></framadate-navigation>
<framadate-debugger *ngIf="isDevelopmentEnv"></framadate-debugger>
<p-toast position="top-right"></p-toast>
</div>
<div class="column">
<router-outlet></router-outlet>
</div>
</div>
</div>
</main>
</div>

48
src/app/app.component.spec.ts

@ -3,33 +3,29 @@ import { RouterTestingModule } from '@angular/router/testing';
import { AppComponent } from './app.component';
describe('AppComponent', () => {
beforeEach(async(() => {
TestBed.configureTestingModule({
imports: [
RouterTestingModule
],
declarations: [
AppComponent
],
}).compileComponents();
}));
beforeEach(async(() => {
TestBed.configureTestingModule({
imports: [RouterTestingModule],
declarations: [AppComponent],
}).compileComponents();
}));
it('should create the app', () => {
const fixture = TestBed.createComponent(AppComponent);
const app = fixture.debugElement.componentInstance;
expect(app).toBeTruthy();
});
it('should create the app', () => {
const fixture = TestBed.createComponent(AppComponent);
const app = fixture.debugElement.componentInstance;
expect(app).toBeTruthy();
});
it(`should have as title 'framadate'`, () => {
const fixture = TestBed.createComponent(AppComponent);
const app = fixture.debugElement.componentInstance;
expect(app.title).toEqual('framadate');
});
it(`should have as title 'framadate'`, () => {
const fixture = TestBed.createComponent(AppComponent);
const app = fixture.debugElement.componentInstance;
expect(app.title).toEqual('framadate');
});
it('should render title in a h1 tag', () => {
const fixture = TestBed.createComponent(AppComponent);
fixture.detectChanges();
const compiled = fixture.debugElement.nativeElement;
expect(compiled.querySelector('h1').textContent).toContain('Welcome to framadate!');
});
it('should render title in a h1 tag', () => {
const fixture = TestBed.createComponent(AppComponent);
fixture.detectChanges();
const compiled = fixture.debugElement.nativeElement;
expect(compiled.querySelector('h1').textContent).toContain('Welcome to framadate!');
});
});

57
src/app/app.component.ts

@ -1,46 +1,43 @@
import {Component, Inject} from '@angular/core';
import {TranslateService} from '@ngx-translate/core';
import {NavigationStart, Router} from '@angular/router';
import {DOCUMENT} from '@angular/common';
import {filter} from 'rxjs/operators';
import {ConfigService} from './services/config.service';
import {environment} from '../environments/environment';
import { Component, Inject } from '@angular/core';
import { TranslateService } from '@ngx-translate/core';
import { NavigationStart, Router } from '@angular/router';
import { DOCUMENT } from '@angular/common';
import { filter } from 'rxjs/operators';
import { ConfigService } from './services/config.service';
import { environment } from '../environments/environment';
@Component({
selector: 'app-root',
templateUrl: './app.component.html',
styleUrls: ['./app.component.scss']
styleUrls: ['./app.component.scss'],
})
export class AppComponent {
step: string;
isDevelopmentEnv=false;
constructor(private translate: TranslateService,
public config: ConfigService,
@Inject(DOCUMENT) private document,
private route: Router) {
isDevelopmentEnv = false;
constructor(
private translate: TranslateService,
public config: ConfigService,
@Inject(DOCUMENT) private document,
private route: Router
) {
this.detectCurrentTabOnRouteChange();
this.isDevelopmentEnv = !environment.production
this.isDevelopmentEnv = !environment.production;
}
detectCurrentTabOnRouteChange() {
this.route.events.subscribe((event: any) => {
});
this.route.events.pipe(filter(event => event instanceof NavigationStart)).subscribe((event: NavigationStart) => {
this.scrollGoToTop();
this.updateCurrentTab(event);
// only if there is a poll ID
this.config.fetchPollFromRoute(event);
})
this.route.events.subscribe((event: any) => {});
this.route.events
.pipe(filter((event) => event instanceof NavigationStart))
.subscribe((event: NavigationStart) => {
this.scrollGoToTop();
this.updateCurrentTab(event);
// only if there is a poll ID
this.config.fetchPollFromRoute(event);
});
}
scrollGoToTop() {
this.document.documentElement.scrollTop = 0;
}
@ -55,6 +52,4 @@ export class AppComponent {
}
}
}
}

115
src/app/app.module.ts

@ -1,65 +1,63 @@
import {BrowserModule} from '@angular/platform-browser';
import {NgModule} from '@angular/core';
import {AppRoutingModule} from './app-routing.module';
import {AppComponent} from './app.component';
import {BaseComponent} from './pages/base-page/base.component';
import {KindComponent} from './pages/kind/kind.component';
import {HeaderComponent} from './header/header.component';
import {FormsModule} from '@angular/forms';
import {NavigationComponent} from './ui/navigation/navigation.component';
import {RouterModule} from '@angular/router';
import {Routes} from './config/Routes';
import {CommonModule, registerLocaleData} from '@angular/common';
import {DatesComponent} from './pages/dates/dates.component';
import {DebuggerComponent} from './debugger/debugger.component';
import {VisibilityComponent} from './pages/visibility/visibility.component';
import {ResumeComponent} from './pages/resume/resume.component';
import {PicturesComponent} from './pages/pictures/pictures.component';
import {AnswersComponent} from './pages/answers/answers.component';
import {EndConfirmationComponent} from './pages/end-confirmation/end-confirmation.component';
import {CreateOrRetrieveComponent} from './pages/create-or-retrieve/create-or-retrieve.component';
import localeFr from '@angular/common/locales/fr';
import { CommonModule, registerLocaleData } from '@angular/common';
import { HttpClient, HttpClientModule } from '@angular/common/http';
import localeEn from '@angular/common/locales/en';
import {VotingSummaryComponent} from './pages/voting/voting-summary/voting-summary.component';
import {VotingGraphComponent} from './pages/voting/voting-graph/voting-graph.component';
import {VotingChoiceComponent} from './pages/voting/voting-choice/voting-choice.component';
import {PasswordComponent} from './pages/password/password.component';
import {HomeComponent} from './pages/home/home.component';
import {HttpClient, HttpClientModule} from '@angular/common/http';
import {MarkdownModule} from 'ngx-markdown';
import localeFr from '@angular/common/locales/fr';
import { NgModule } from '@angular/core';
import { FormsModule } from '@angular/forms';
import { BrowserModule } from '@angular/platform-browser';
import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
import {
MissingTranslationHandler,
MissingTranslationHandlerParams,
TranslateLoader,
TranslateModule,
TranslateService
TranslateService,
} from '@ngx-translate/core';
import {TranslateHttpLoader} from '@ngx-translate/http-loader';
import {PollGraphicComponent} from './poll-graphic/poll-graphic.component';
import { TranslateHttpLoader } from '@ngx-translate/http-loader';
import { ClipboardModule } from 'ngx-clipboard';
import { MarkdownModule } from 'ngx-markdown';
import { ConfirmationService, MessageModule, MessageService } from 'primeng';
import { ConfirmDialogModule } from 'primeng/confirmdialog';
import { DialogModule } from 'primeng/dialog';
import { ToastModule } from 'primeng/toast';
import {AdminComponent} from './pages/admin/admin.component';
import {SelectorComponent} from './ui/selector/selector.component';
import {BrowserAnimationsModule} from '@angular/platform-browser/animations';
import {ConfigService} from './services/config.service';
import {PollService} from './services/poll.service';
import {ToastModule} from 'primeng/toast';
import {ConfirmationService, MessageModule, MessageService} from 'primeng';
import {PollDisplayComponent} from './pages/poll-display/poll-display.component';
import {VotingComponent} from './pages/voting/voting.component';
import {VotingCommentComponent} from './pages/voting/voting-comment/voting-comment.component';
import {ResettableInputDirective} from './ui/directives/resettable-input.directive';
import {ClipboardModule} from 'ngx-clipboard';
import {ErasableInputComponent} from './ui/erasable-input/erasable-input.component';
import {ConfirmDialogModule} from 'primeng/confirmdialog';
import {DialogModule} from 'primeng/dialog';
import {DateValueAccessorModule} from './custom-lib/date-value-accessor';
import {CopyTextComponent} from './ui/copy-text/copy-text.component';
import {CommentsListComponent} from './pages/voting/comments-list/comments-list.component';
import {ChoicesListComponent} from './pages/voting/choices-list/choices-list.component';
import {VotingNavigationComponent} from './pages/voting/voting-navigation/voting-navigation.component';
import { ThemeSelectorComponent } from './ui/theme-selector/theme-selector.component';
import { AppRoutingModule } from './app-routing.module';
import { AppComponent } from './app.component';
import { DateValueAccessorModule } from './custom-lib/date-value-accessor';
import { DebuggerComponent } from './debugger/debugger.component';
import { HeaderComponent } from './header/header.component';
import { AdminComponent } from './pages/admin/admin.component';
import { AnswersComponent } from './pages/answers/answers.component';
import { BaseComponent } from './pages/base-page/base.component';
import { CreateOrRetrieveComponent } from './pages/create-or-retrieve/create-or-retrieve.component';
import { DatesComponent } from './pages/dates/dates.component';
import { EndConfirmationComponent } from './pages/end-confirmation/end-confirmation.component';
import { HomeComponent } from './pages/home/home.component';
import { KindComponent } from './pages/kind/kind.component';
import { PasswordComponent } from './pages/password/password.component';
import { PicturesComponent } from './pages/pictures/pictures.component';
import { PollDisplayComponent } from './pages/poll-display/poll-display.component';
import { ResumeComponent } from './pages/resume/resume.component';
import { VisibilityComponent } from './pages/visibility/visibility.component';
import { ChoicesListComponent } from './pages/voting/choices-list/choices-list.component';
import { CommentsListComponent } from './pages/voting/comments-list/comments-list.component';
import { VotingChoiceComponent } from './pages/voting/voting-choice/voting-choice.component';
import { VotingCommentComponent } from './pages/voting/voting-comment/voting-comment.component';
import { VotingGraphComponent } from './pages/voting/voting-graph/voting-graph.component';
import { VotingNavigationComponent } from './pages/voting/voting-navigation/voting-navigation.component';
import { VotingSummaryComponent } from './pages/voting/voting-summary/voting-summary.component';
import { VotingComponent } from './pages/voting/voting.component';
import { PollGraphicComponent } from './poll-graphic/poll-graphic.component';
import { ConfigService } from './services/config.service';
import { PollService } from './services/poll.service';
import { CopyTextComponent } from './ui/copy-text/copy-text.component';
import { ResettableInputDirective } from './ui/directives/resettable-input.directive';
import { ErasableInputComponent } from './ui/erasable-input/erasable-input.component';
import { MasterHeadComponent } from './ui/navigation/master-head/master-head.component';
import { NavigationComponent } from './ui/navigation/navigation.component';
import { LanguageComponent } from './ui/selector/language/language.component';
import { SelectorComponent } from './ui/selector/selector.component';
import { ThemeSelectorComponent } from './ui/theme-selector/theme-selector.component';
export class MyMissingTranslationHandler implements MissingTranslationHandler {
handle(params: MissingTranslationHandlerParams) {
@ -70,7 +68,7 @@ export class MyMissingTranslationHandler implements MissingTranslationHandler {
registerLocaleData(localeFr, 'fr');
registerLocaleData(localeEn, 'en');
export function HttpLoaderFactory(http: HttpClient) {
export function HttpLoaderFactory(http: HttpClient): TranslateHttpLoader {
return new TranslateHttpLoader(http);
}
@ -109,7 +107,6 @@ export function HttpLoaderFactory(http: HttpClient) {
ThemeSelectorComponent,
MasterHeadComponent,
LanguageComponent,
],
imports: [
ConfirmDialogModule,
@ -132,15 +129,13 @@ export function HttpLoaderFactory(http: HttpClient) {
loader: {
provide: TranslateLoader,
useFactory: HttpLoaderFactory,
deps: [HttpClient]
}
deps: [HttpClient],
},
}),
HttpClientModule,
FormsModule,
RouterModule.forRoot(Routes, {useHash: true})
],
providers: [TranslateService, ConfigService, PollService, MessageService, ConfirmationService],
bootstrap: [AppComponent]
bootstrap: [AppComponent],
})
export class AppModule {
}
export class AppModule {}

17
src/app/config/DateUtilities.ts

@ -1,10 +1,9 @@
import {Injectable} from "@angular/core";
import { Injectable } from '@angular/core';
@Injectable({
providedIn: 'root'
providedIn: 'root',
})
export class DateUtilities {
/**
* add some days to a date, to compute intervals
* @param days
@ -14,7 +13,7 @@ export class DateUtilities {
date = new Date(date.valueOf());
date.setDate(date.getDate() + days);
return date;
};
}
/**
*
@ -29,9 +28,9 @@ export class DateUtilities {
while (+d1 < +d2) {
dates.push({
literal: this.formateDate(d1),
date_object: d1
date_object: d1,
});
d1.setDate(d1.getDate() + interval)
d1.setDate(d1.getDate() + interval);
}
return dates.slice(0);
}
@ -42,7 +41,7 @@ export class DateUtilities {
* @param d2
*/
dayDiff(d1: Date, d2: Date): Number {
return Number(((d2.getTime()) - (d1.getTime()) / 31536000000));
return Number(d2.getTime() - d1.getTime() / 31536000000);
}
/**
@ -55,10 +54,10 @@ export class DateUtilities {
date.getFullYear(),
this.getDoubleDigits(date.getMonth() + 1),
this.getDoubleDigits(date.getDate()),
].join('-')
].join('-');
}
getDoubleDigits(str) {
return ("00" + str).slice(-2);
return ('00' + str).slice(-2);
}
}

19
src/app/config/PollConfig.ts

@ -1,8 +1,8 @@
/**
* une option de date dans les sondages spéciaux
*/
import {environment} from '../../environments/environment';
import {DateChoice, defaultAnswers, otherDefaultDates, PollAnswer} from './defaultConfigs';
import { environment } from '../../environments/environment';
import { DateChoice, defaultAnswers, otherDefaultDates, PollAnswer } from './defaultConfigs';
export interface DateOption {
timeList: any;
@ -18,22 +18,17 @@ const baseConfigValues = {
myEmail: '',
};
/**
* configuration of the poll, add new fields at will
*/
export class PollConfig {
menuVisible = true;
expiracyDateDefaultInDays = 60;
deletionDateAfterLastModification = 180;
step = 0; // step in the progress of creating a poll
stepMax = 3; // step max in the progress of creating a poll
pollType = 'dates';// classic or dates
pollType = 'dates'; // classic or dates
title: string = environment.production ? '' : 'titre';
description: string = environment.production ? '' : 'ma description';
@ -43,7 +38,7 @@ export class PollConfig {
myVoteStack: any;
myTempVoteStack = 0;
myEmail: string = environment.production ? '' : 'tktest@tktest.com';
myPolls: any = [];// list of retrieved polls from the backend api
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
*/
@ -66,9 +61,9 @@ export class PollConfig {
urlAdmin = environment.baseHref + '/#/admin/d65es45fd45sdf45sd345f312sdf31sgfd345';
adminKey = ''; // key to change config of the poll
owner_modifier_token = ''; // key to change a vote stack
canModifyAnswers = true;// bool for the frontend selector
whoModifiesAnswers = 'everybody';// everybody, self, nobody (= just admin)
whoCanChangeAnswers = 'everybody';// everybody, self, nobody (= just admin)
canModifyAnswers = true; // bool for the frontend selector
whoModifiesAnswers = 'everybody'; // everybody, self, nobody (= just admin)
whoCanChangeAnswers = 'everybody'; // everybody, self, nobody (= just admin)
dateList: any = otherDefaultDates; // sets of days as strings, config to set identical time for days in a special days poll
timeList: DateChoice[] = otherDefaultDates; // ranges of time expressed as strings

38
src/app/config/PollUtilities.ts

@ -1,9 +1,9 @@
import {HttpHeaders} from "@angular/common/http";
import {PollConfig} from "./PollConfig";
import {Injectable} from "@angular/core";
import { HttpHeaders } from '@angular/common/http';
import { PollConfig } from './PollConfig';
import { Injectable } from '@angular/core';
@Injectable({
providedIn: 'root'
providedIn: 'root',
})
export class PollUtilities {
// utils functions
@ -12,7 +12,8 @@ export class PollUtilities {
*/
makeUuid() {
return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function (c) {
var r = Math.random() * 16 | 0, v = c == 'x' ? r : (r & 0x3 | 0x8);
var r = (Math.random() * 16) | 0,
v = c == 'x' ? r : (r & 0x3) | 0x8;
return v.toString(16);
});
}
@ -23,18 +24,28 @@ export class PollUtilities {
*/
makeSlug(config: PollConfig) {
let str = '';
str = config.creationDate.getFullYear() + '_' + (config.creationDate.getMonth() + 1) + '_' + config.creationDate.getDate() + '_' + config.myName + '_' + config.title;
str =
config.creationDate.getFullYear() +
'_' +
(config.creationDate.getMonth() + 1) +
'_' +
config.creationDate.getDate() +
'_' +
config.myName +
'_' +
config.title;
str = str.replace(/^\s+|\s+$/g, ''); // trim
str = str.toLowerCase();
// remove accents, swap ñ for n, etc
var from = "àáäâèéëêìíïîòóöôùúüûñç·/_,:;";
var to = "aaaaeeeeiiiioooouuuunc------";
var from = 'àáäâèéëêìíïîòóöôùúüûñç·/_,:;';
var to = 'aaaaeeeeiiiioooouuuunc------';
for (var i = 0, l = from.length; i < l; i++) {
str = str.replace(new RegExp(from.charAt(i), 'g'), to.charAt(i));
}
str = str.replace(/[^a-z0-9 -]/g, '') // remove invalid chars
str = str
.replace(/[^a-z0-9 -]/g, '') // remove invalid chars
.replace(/\s+/g, '-') // collapse whitespace and replace by -
.replace(/-+/g, '-'); // collapse dashes
@ -46,18 +57,17 @@ export class PollUtilities {
* @param bodyContent
*/
makeHeaders(bodyContent?: any) {
const headerDict = {
'Charset': 'UTF-8',
Charset: 'UTF-8',
'Content-Type': 'application/json',
'Accept': 'application/json',
Accept: 'application/json',
'Access-Control-Allow-Methods': 'GET, POST, PUT, DELETE, OPTIONS',
'Access-Control-Allow-Origin': '*'
'Access-Control-Allow-Origin': '*',
};
const requestOptions = {
headers: new HttpHeaders(headerDict),
body: bodyContent
body: bodyContent,
};
return requestOptions;

79
src/app/config/Routes.ts

@ -1,45 +1,42 @@
import {KindComponent} from '../pages/kind/kind.component';
import {DatesComponent} from '../pages/dates/dates.component';
import {VisibilityComponent} from '../pages/visibility/visibility.component';
import {ResumeComponent} from '../pages/resume/resume.component';
import {PicturesComponent} from '../pages/pictures/pictures.component';
import {EndConfirmationComponent} from '../pages/end-confirmation/end-confirmation.component';
import {AnswersComponent} from '../pages/answers/answers.component';
import {AdminComponent} from '../pages/admin/admin.component';
import {CreateOrRetrieveComponent} from '../pages/create-or-retrieve/create-or-retrieve.component';
import {BaseComponent} from '../pages/base-page/base.component';
import {HomeComponent} from "../pages/home/home.component";
import {PollGraphicComponent} from '../poll-graphic/poll-graphic.component';
import {PollDisplayComponent} from "../pages/poll-display/poll-display.component";
import {VotingComponent} from "../pages/voting/voting.component";
import {PasswordComponent} from "../pages/password/password.component";
import {VotingChoiceComponent} from "../pages/voting/voting-choice/voting-choice.component";
import { AdminComponent } from '../pages/admin/admin.component';
import { AnswersComponent } from '../pages/answers/answers.component';
import { BaseComponent } from '../pages/base-page/base.component';
import { CreateOrRetrieveComponent } from '../pages/create-or-retrieve/create-or-retrieve.component';
import { DatesComponent } from '../pages/dates/dates.component';
import { EndConfirmationComponent } from '../pages/end-confirmation/end-confirmation.component';
import { HomeComponent } from '../pages/home/home.component';
import { KindComponent } from '../pages/kind/kind.component';
import { PasswordComponent } from '../pages/password/password.component';
import { PicturesComponent } from '../pages/pictures/pictures.component';
import { PollDisplayComponent } from '../pages/poll-display/poll-display.component';
import { ResumeComponent } from '../pages/resume/resume.component';
import { VisibilityComponent } from '../pages/visibility/visibility.component';
import { VotingChoiceComponent } from '../pages/voting/voting-choice/voting-choice.component';
import { VotingComponent } from '../pages/voting/voting.component';
import { PollGraphicComponent } from '../poll-graphic/poll-graphic.component';
/**
* each step in the form is a component
*/
export const Routes =
[
{path: '', redirectTo: 'step/creation', pathMatch: 'full'},
{path: 'home', component: HomeComponent},
{path: 'base', component: BaseComponent},
{path: 'step/base', component: BaseComponent},
{path: 'step/creation', component: CreateOrRetrieveComponent},
{path: 'step/date', component: DatesComponent},
{path: 'step/kind', component: KindComponent},
{path: 'step/answers', component: AnswersComponent},
{path: 'step/admin', component: AdminComponent},
{path: 'step/pictures', component: PicturesComponent},
{path: 'step/visibility', component: VisibilityComponent},
{path: 'step/resume', component: ResumeComponent},
{path: 'step/end', component: EndConfirmationComponent},
{path: 'graphic/:poll', component: PollGraphicComponent},
{path: 'vote/poll/id/:poll', component: PollDisplayComponent},
{path: 'vote/poll/slug/:pollSlug', component: PollDisplayComponent},
{path: 'votingchoice', component: VotingChoiceComponent},
{path: 'voting', component: VotingComponent},
{path: 'step/password', component: PasswordComponent},
{path: '**', redirectTo: '/home', pathMatch: 'full'},
]
;
export const Routes = [
{ path: '', redirectTo: 'step/creation', pathMatch: 'full' },
{ path: 'home', component: HomeComponent },
{ path: 'base', component: BaseComponent },
{ path: 'step/base', component: BaseComponent },
{ path: 'step/creation', component: CreateOrRetrieveComponent },
{ path: 'step/date', component: DatesComponent },
{ path: 'step/kind', component: KindComponent },
{ path: 'step/answers', component: AnswersComponent },
{ path: 'step/admin', component: AdminComponent },
{ path: 'step/pictures', component: PicturesComponent },
{ path: 'step/visibility', component: VisibilityComponent },
{ path: 'step/resume', component: ResumeComponent },
{ path: 'step/end', component: EndConfirmationComponent },
{ path: 'graphic/:poll', component: PollGraphicComponent },
{ path: 'vote/poll/id/:poll', component: PollDisplayComponent },
{ path: 'vote/poll/slug/:pollSlug', component: PollDisplayComponent },
{ path: 'votingchoice', component: VotingChoiceComponent },
{ path: 'voting', component: VotingComponent },
{ path: 'step/password', component: PasswordComponent },
{ path: '**', redirectTo: '/home', pathMatch: 'full' },
];

89
src/app/config/defaultConfigs.ts

@ -1,106 +1,107 @@
export interface DateChoice {
literal: string,
timeList: TimeSlices[],
date_object: Date
literal: string;
timeList: TimeSlices[];
date_object: Date;
}
export interface TimeSlices {
literal: string
literal: string;
}
export interface PollAnswer {
id: number,
text: string,
url: string,
file: string,
literal: string,
date_object: Date,
timeList: TimeSlices[]
id: number;
text: string;
url: string;
file: string;
literal: string;
date_object: Date;
timeList: TimeSlices[];
}
const currentYear = new Date().getFullYear();
const currentMonth = new Date().getMonth();
const currentDay = new Date().getDate();
export const basicSlicesOfDay: TimeSlices[] = [
{literal: 'matin'},
{literal: 'midi'},
{literal: 'soir'}
];
export const basicSlicesOfDay: TimeSlices[] = [{ literal: 'matin' }, { literal: 'midi' }, { literal: 'soir' }];
export const otherSlicesOfDay: TimeSlices[] = [
{literal: 'aux aurores'},
{literal: 'au petit dej'},
{literal: 'au deuxième petit dej des hobbits'}
{ literal: 'aux aurores' },
{ literal: 'au petit dej' },
{ literal: 'au deuxième petit dej des hobbits' },
];
export const defaultTimeOfDay: TimeSlices[] = (() => {
return [...basicSlicesOfDay]
return [...basicSlicesOfDay];
})();
export const otherTimeOfDay: TimeSlices[] = (() => {
return [...otherSlicesOfDay]
return [...otherSlicesOfDay];
})();
export const moreTimeOfDay: TimeSlices[] = (() => {
return [...otherSlicesOfDay]
return [...otherSlicesOfDay];
})();
export const defaultDates: DateChoice[] = [
{
literal: `${currentYear}-${currentMonth}-${currentDay}`,
date_object: new Date(),
timeList: defaultTimeOfDay
timeList: defaultTimeOfDay,
},
{
literal: `${currentYear}-${currentMonth}-${currentDay + 1}`,
date_object: new Date(),
timeList: defaultTimeOfDay
timeList: defaultTimeOfDay,
},
{
literal: `${currentYear}-${currentMonth}-${currentDay + 2}`,
date_object: new Date(),
timeList: defaultTimeOfDay
}
timeList: defaultTimeOfDay,
},
];
export const otherDefaultDates: DateChoice[] = [
{
literal: `${currentYear}-${currentMonth}-${currentDay}`,
date_object: new Date(),
timeList: defaultTimeOfDay
timeList: defaultTimeOfDay,
},
{
literal: `${currentYear}-${currentMonth}-${currentDay + 1}`,
date_object: new Date(currentYear, currentMonth, currentDay + 1),
timeList: otherTimeOfDay
timeList: otherTimeOfDay,
},
{
literal: `${currentYear}-${currentMonth}-${currentDay + 2}`,
date_object: new Date(),
timeList: moreTimeOfDay
}
timeList: moreTimeOfDay,
},
];
export const defaultAnswers: PollAnswer[] = [{
id: 0,
text: 'réponse de démo 1',
file: '',
url: 'https://mastodon.cipherbliss.com/system/media_attachments/files/001/439/118/original/6fcf149bd902841b.png?1579471574',
literal: `${currentYear}-${currentMonth}-${currentDay}`,
date_object: new Date(),
timeList: otherSlicesOfDay
},
export const defaultAnswers: PollAnswer[] = [
{
id: 0,
text: 'réponse de démo 1',
file: '',
url:
'https://mastodon.cipherbliss.com/system/media_attachments/files/001/439/118/original/6fcf149bd902841b.png?1579471574',
literal: `${currentYear}-${currentMonth}-${currentDay}`,
date_object: new Date(),
timeList: otherSlicesOfDay,
},
{
id: 1,
text: 'réponse 2',
file: '',
url: 'https://mastodon.cipherbliss.com/system/media_attachments/files/001/439/118/original/6fcf149bd902841b.png?1579471574',
url:
'https://mastodon.cipherbliss.com/system/media_attachments/files/001/439/118/original/6fcf149bd902841b.png?1579471574',
literal: `${currentYear}-${currentMonth}-${currentDay + 1}`,
date_object: new Date(),
timeList: basicSlicesOfDay
timeList: basicSlicesOfDay,
},
{
id: 2,
text: 'la réponse D',
file: '',
url: 'https://mastodon.cipherbliss.com/system/media_attachments/files/001/439/118/original/6fcf149bd902841b.png?1579471574',
url:
'https://mastodon.cipherbliss.com/system/media_attachments/files/001/439/118/original/6fcf149bd902841b.png?1579471574',
literal: `${currentYear}-${currentMonth}-${currentDay + 2}`,
date_object: new Date(),
timeList: otherSlicesOfDay
}];
timeList: otherSlicesOfDay,
},
];

20
src/app/config/graph-canevas-options.ts

@ -1,24 +1,24 @@
export var graphOptions = {
legend: {display: false},
legend: { display: false },
scales: {
xAxes: [
{
gridLines: {drawBorder: false, display: false},
gridLines: { drawBorder: false, display: false },
display: false,
stacked: true,
ticks: {
beginAtZero: true,
maxRotation: 0,
minRotation: 0
}
}
minRotation: 0,
},
},
],
yAxes: [
{
gridLines: {drawBorder: true, display: false},
gridLines: { drawBorder: true, display: false },
display: true,
stacked: true
}
]
}
stacked: true,
},
],
},
};

18
src/app/config/mocks/choice.ts

@ -1,11 +1,11 @@
export const mockChoice = {
"id": 11,
"date": {
"date": "2020-01-30 12:25:13.000000",
"timezone_type": 3,
"timezone": "Europe/Berlin"
export const mockChoice = {
id: 11,
date: {
date: '2020-01-30 12:25:13.000000',
timezone_type: 3,
timezone: 'Europe/Berlin',
},
"text": "Les mondes engloutis",
"url": null,
"answer": null,
text: 'Les mondes engloutis',
url: null,
answer: null,
};

25
src/app/config/mocks/mock-comments.ts

@ -1,20 +1,21 @@
export const mockComments = [
{
pseudo: "Bulbizarre",
"date": {
"date": "2020-01-22 16:00:22.000000",
"timezone_type": 3,
"timezone": "Europe/Paris"
pseudo: 'Bulbizarre',
date: {
date: '2020-01-22 16:00:22.000000',
timezone_type: 3,
timezone: 'Europe/Paris',
},
text: "Pokem ipsum dolor sit amet Electric Cottonee Scratch Leech Life Ice Berry Ducklett. Leaf Green Durant Zoroark\n" +
" Skitty Rock Luxio Surskit. Glacier Badge",
text:
'Pokem ipsum dolor sit amet Electric Cottonee Scratch Leech Life Ice Berry Ducklett. Leaf Green Durant Zoroark\n' +
' Skitty Rock Luxio Surskit. Glacier Badge',
},
{
pseudo: "Marylin",
"date": {
"date": "2020-01-22 16:00:22.000000",
"timezone_type": 3,
"timezone": "Europe/Paris"
pseudo: 'Marylin',
date: {
date: '2020-01-22 16:00:22.000000',
timezone_type: 3,
timezone: 'Europe/Paris',
},
text: "j'ai vu de la lumière o_o",
},

38
src/app/config/mocks/mock-graph.ts

@ -1,52 +1,52 @@
export const mockGraphConfig = {
step: 0,
stepMax: 3,
pollType: "special dates",
title: "",
description: "",
myName: "",
visibility: "link_only",
pollType: 'special dates',
title: '',
description: '',
myName: '',
visibility: 'link_only',
// date specific poll
allowSeveralHours: "true",
dateLgfgfgfgist: ["jeudi", "vendredi", "samedi"], // sets of days as strings
timeList: ["08:00", "08:30", "09:00"], // ranges of time expressed as strings
allowSeveralHours: 'true',
dateLgfgfgfgist: ['jeudi', 'vendredi', 'samedi'], // sets of days as strings
timeList: ['08:00', '08:30', '09:00'], // ranges of time expressed as strings
answers: [
{
id: 0,
text: "no"
text: 'no',
},
{
id: 1,
text: "yes"
text: 'yes',
},
{
id: 2,
text: "maybe"
text: 'maybe',
},
{
id: 3,
text: "maybe"
text: 'maybe',
},
{
id: 4,
text: "maybe"
text: 'maybe',
},
{
id: 5,
text: "maybe"
text: 'maybe',
},
{
id: 6,
text: "maybe"
text: 'maybe',
},
{
id: 7,
text: "maybe"
text: 'maybe',
},
{
id: 8,
text: "maybe"
}
]
text: 'maybe',
},
],
};

966
src/app/config/mocks/mock-poll3.ts

File diff suppressed because it is too large Load Diff

1246
src/app/config/mocks/mock-success-vote.ts

File diff suppressed because it is too large Load Diff

87
src/app/config/mocks/mockmypolls.ts

@ -1,43 +1,44 @@
export const mockMyPolls =
[{
"id": 1000001,
"title": "blehehehe heh hehhe e test1",
"customUrl": null,
"description": "maaaaaaaaaaah",
"creationDate": {"date": "2020-01-20 14:21:16.270157", "timezone_type": 3, "timezone": "Europe/Paris"},
"expiracyDate": {"date": "2020-01-20 14:21:16.270178", "timezone_type": 3, "timezone": "Europe/Paris"},
"owner": null,
"kind": "text",
"allowedAnswers": ["yes"],
"modificationPolicy": "nobody",
"mailOnComment": null,
"mailOnVote": null,
"hideResults": null,
"showResultEvenIfPasswords": null,
"votes": {},
"stacksOfVotes": {},
"choices": {},
"comments": {},
"defaultExpiracyDaysFromNow": 60
}, {
"id": 1000002,
"title": "bleh z zr erth tuyjikioy yylil test2",
"customUrl": null,
"description": "maaaaaaaaaaah 2",
"creationDate": {"date": "2020-01-20 14:21:16.270157", "timezone_type": 3, "timezone": "Europe/Paris"},
"expiracyDate": {"date": "2020-01-20 14:21:16.270178", "timezone_type": 3, "timezone": "Europe/Paris"},
"owner": null,
"kind": "text",
"allowedAnswers": ["yes"],
"modificationPolicy": "nobody",
"mailOnComment": null,
"mailOnVote": null,
"hideResults": null,
"showResultEvenIfPasswords": null,
"votes": {},
"stacksOfVotes": {},
"choices": {},
"comments": {},
"defaultExpiracyDaysFromNow": 60
}]
;
export const mockMyPolls = [
{
id: 1000001,
title: 'blehehehe heh hehhe e test1',
customUrl: null,
description: 'maaaaaaaaaaah',
creationDate: { date: '2020-01-20 14:21:16.270157', timezone_type: 3, timezone: 'Europe/Paris' },
expiracyDate: { date: '2020-01-20 14:21:16.270178', timezone_type: 3, timezone: 'Europe/Paris' },
owner: null,
kind: 'text',
allowedAnswers: ['yes'],
modificationPolicy: 'nobody',
mailOnComment: null,
mailOnVote: null,
hideResults: null,
showResultEvenIfPasswords: null,
votes: {},
stacksOfVotes: {},
choices: {},
comments: {},
defaultExpiracyDaysFromNow: 60,
},
{
id: 1000002,
title: 'bleh z zr erth tuyjikioy yylil test2',
customUrl: null,
description: 'maaaaaaaaaaah 2',
creationDate: { date: '2020-01-20 14:21:16.270157', timezone_type: 3, timezone: 'Europe/Paris' },
expiracyDate: { date: '2020-01-20 14:21:16.270178', timezone_type: 3, timezone: 'Europe/Paris' },
owner: null,
kind: 'text',
allowedAnswers: ['yes'],
modificationPolicy: 'nobody',
mailOnComment: null,
mailOnVote: null,
hideResults: null,
showResultEvenIfPasswords: null,
votes: {},
stacksOfVotes: {},
choices: {},
comments: {},
defaultExpiracyDaysFromNow: 60,
},
];

18
src/app/custom-lib/date-value-accessor/date-value-accessor.ts

@ -1,10 +1,10 @@
import {Directive, ElementRef, forwardRef, HostListener, Renderer2} from '@angular/core';
import {ControlValueAccessor, NG_VALUE_ACCESSOR} from '@angular/forms';
import { Directive, ElementRef, forwardRef, HostListener, Renderer2 } from '@angular/core';
import { ControlValueAccessor, NG_VALUE_ACCESSOR } from '@angular/forms';
export const DATE_VALUE_ACCESSOR: any = {
provide: NG_VALUE_ACCESSOR,
useExisting: forwardRef(() => DateValueAccessor),
multi: true
multi: true,
};
/**
@ -19,17 +19,13 @@ export const DATE_VALUE_ACCESSOR: any = {
// this selector is an opt-in version
selector: '[useValueAsDate]',
providers: [DATE_VALUE_ACCESSOR]
providers: [DATE_VALUE_ACCESSOR],
})
export class DateValueAccessor implements ControlValueAccessor {
@HostListener('input', ['$event.target.valueAsDate']) onChange = (_: any) => {};
@HostListener('blur', []) onTouched = () => {};
@HostListener('input', ['$event.target.valueAsDate']) onChange = (_: any) => {
};
@HostListener('blur', []) onTouched = () => {
};
constructor(private _renderer: Renderer2, private _elementRef: ElementRef) {
}
constructor(private _renderer: Renderer2, private _elementRef: ElementRef) {}
writeValue(value: Date): void {
if (!value) {

1
src/app/custom-lib/date-value-accessor/index.ts

@ -1,3 +1,2 @@
export * from './module';
export * from './date-value-accessor';

6
src/app/custom-lib/date-value-accessor/module.ts

@ -2,7 +2,7 @@ import { NgModule } from '@angular/core';
import { DateValueAccessor } from './date-value-accessor';
@NgModule({
declarations: [DateValueAccessor],
exports: [DateValueAccessor]
declarations: [DateValueAccessor],
exports: [DateValueAccessor],
})
export class DateValueAccessorModule { }
export class DateValueAccessorModule {}

70
src/app/debugger/debugger.component.html

@ -1,52 +1,30 @@
<div class="well debug" >
<strong >
<h2 i18n >
<div class="well debug">
<strong>
<h2 i18n>
infos de debug - environement de Dev
</h2 >
<span class="demo" >
{{"config.demo"|translate}}
</span >
</strong >
<ul >
<li >
étape actuelle {{config.step}} / {{config.stepMax}}
</li >
<li >
formulaire valide : {{formIsValid}}
</li >
<li >
type de formulaire: {{config.pollType}}
</li >
</ul >
<button
class="btn btn--primary"
i18n
(click)="config.createPoll()"
>
</h2>
<span class="demo">
{{ 'config.demo' | translate }}
</span>
</strong>
<ul>
<li>étape actuelle {{ config.step }} / {{ config.stepMax }}</li>
<li>formulaire valide : {{ formIsValid }}</li>
<li>type de formulaire: {{ config.pollType }}</li>
</ul>
<button class="btn btn--primary" i18n (click)="config.createPoll()">
Envoyer le formulaire
</button >
<button
class="btn btn--primary"
i18n
(click)="config.getPollById( '1', 'example password')"
>
</button>
<button class="btn btn--primary" i18n (click)="config.getPollById('1', 'example password')">
get poll 1
</button >
<button
class="btn btn--primary"
i18n
(click)="config.getMyPolls( 'tktest@tktest.com')"
>
</button>
<button class="btn btn--primary" i18n (click)="config.getMyPolls('tktest@tktest.com')">
get my polls
</button >
<button
class="btn btn--success"
(click)="launchToast()" >
</button>
<button class="btn btn--success" (click)="launchToast()">
launch success toast
</button >
<a
[routerLink]="'/vote/poll/id/3'"
class="btn btn--success" >
</button>
<a [routerLink]="'/vote/poll/id/3'" class="btn btn--success">
See example of vote page