From d5bc5777b787060dfaa84c1ed7599bff272b5507 Mon Sep 17 00:00:00 2001
From: Tykayn
Date: Thu, 29 Apr 2021 10:17:13 +0200
Subject: [PATCH 01/18] add good hash in route
---
src/app/core/components/footer/footer.component.html | 2 +-
src/app/core/services/api.service.ts | 11 ++++++++---
src/app/core/services/poll.service.ts | 6 +++++-
.../consultation/consultation-routing.module.ts | 8 +++++---
.../features/consultation/consultation.component.html | 6 +++---
.../features/consultation/consultation.component.ts | 3 ++-
src/app/routes-framadate.ts | 4 ++--
src/environments/environment.ts | 8 ++++----
8 files changed, 30 insertions(+), 18 deletions(-)
diff --git a/src/app/core/components/footer/footer.component.html b/src/app/core/components/footer/footer.component.html
index 9410a3e2..a62e391f 100644
--- a/src/app/core/components/footer/footer.component.html
+++ b/src/app/core/components/footer/footer.component.html
@@ -45,7 +45,7 @@
dessin-anime
-
+
consulter le sondage
diff --git a/src/app/core/services/api.service.ts b/src/app/core/services/api.service.ts
index b4a427e9..b80e686f 100644
--- a/src/app/core/services/api.service.ts
+++ b/src/app/core/services/api.service.ts
@@ -41,8 +41,13 @@ export class ApiService {
this.axiosInstance.defaults.headers.post['Content-Type'] = 'application/json';
this.axiosInstance.defaults.headers.post['Accept'] = 'application/json';
this.axiosInstance.defaults.headers.post['Charset'] = 'UTF-8';
+ this.axiosInstance.defaults.headers.post['Accept-Charset'] = 'UTF-8';
this.axiosInstance.defaults.headers.post['Access-Control-Allow-Methods'] = 'GET, POST, PUT, DELETE, OPTIONS';
+ this.axiosInstance.defaults.headers.post['Referrer-Policy'] = 'origin-when-cross-origin';
this.axiosInstance.defaults.headers.post['Access-Control-Allow-Origin'] = '*';
+ this.axiosInstance.defaults.headers.post['Allow-Origin'] = '*';
+ this.axiosInstance.defaults.headers.post['Access-Control-Allow-Headers'] =
+ 'Origin, X-Requested-With, Content-Type, Accept';
console.log('this.axiosInstance.defaults.headers', this.axiosInstance.defaults.headers);
}
@@ -116,11 +121,11 @@ export class ApiService {
console.log('vote_stack', vote_stack);
console.log('this.baseHref', this.baseHref);
- let headers = ApiService.makeHeaders(vote_stack);
+ const headers = ApiService.makeHeaders(vote_stack);
console.log('headers', headers);
- let url = `${this.baseHref}/poll/${poll.custom_url}/answer`;
+ const url = `${this.baseHref}/poll/${poll.custom_url}/answer`;
- let axiosconf = {
+ const axiosconf = {
url,
method: 'POST',
body: vote_stack,
diff --git a/src/app/core/services/poll.service.ts b/src/app/core/services/poll.service.ts
index d8dec5e1..f1ef9c65 100644
--- a/src/app/core/services/poll.service.ts
+++ b/src/app/core/services/poll.service.ts
@@ -75,7 +75,11 @@ export class PollService implements Resolve {
if (slug) {
const poll: Poll | undefined = await this.apiService.getPollBySlug(slug);
console.log({ loadPollBySlugResponse: poll });
- this.updateCurrentPoll(poll);
+ if (poll) {
+ this.updateCurrentPoll(poll);
+ } else {
+ this.toastService.display(`sondage ${slug} non trouvé`);
+ }
}
}
public async loadPollBySlugWithPasswordHash(slug: string, hash: string): Promise {
diff --git a/src/app/features/consultation/consultation-routing.module.ts b/src/app/features/consultation/consultation-routing.module.ts
index ceeb4b99..e09b8d72 100644
--- a/src/app/features/consultation/consultation-routing.module.ts
+++ b/src/app/features/consultation/consultation-routing.module.ts
@@ -4,10 +4,12 @@ import { RouterModule, Routes } from '@angular/router';
import { ConsultationComponent } from './consultation.component';
const routes: Routes = [
- { path: '', component: ConsultationComponent },
- { path: '/:hash', component: ConsultationComponent },
+ {
+ path: '/',
+ component: ConsultationComponent,
+ children: [{ path: '/:hash', component: ConsultationComponent }],
+ },
];
-
@NgModule({
imports: [RouterModule.forChild(routes)],
exports: [RouterModule],
diff --git a/src/app/features/consultation/consultation.component.html b/src/app/features/consultation/consultation.component.html
index 6acc730f..282057e0 100644
--- a/src/app/features/consultation/consultation.component.html
+++ b/src/app/features/consultation/consultation.component.html
@@ -103,14 +103,14 @@
(click)="addVoteStack()"
[disabled]="!myTempVoteStack"
[ngClass]="{ 'btn--primary': myTempVoteStack }"
- *ngIf="!myVoteStack || !myVoteStack.id"
+ *ngIf="!storageService.vote_stack || !storageService.vote_stack.id"
>
Envoyer
Mettre à jour
diff --git a/src/app/features/consultation/consultation.component.ts b/src/app/features/consultation/consultation.component.ts
index c6aa4e66..ff7fefdd 100644
--- a/src/app/features/consultation/consultation.component.ts
+++ b/src/app/features/consultation/consultation.component.ts
@@ -9,6 +9,7 @@ import { PollUtilities } from '../old-stuff/config/PollUtilities';
import { Comment } from '../../core/models/comment.model';
import { StorageService } from '../../core/services/storage.service';
import { ApiService } from '../../core/services/api.service';
+import { Stack } from '../../core/models/stack.model';
@Component({
selector: 'app-consultation',
@@ -74,7 +75,7 @@ export class ConsultationComponent implements OnInit, OnDestroy {
}
}
- updateVote() {
+ updateVote(votestack: Stack) {
alert('TODO');
}
diff --git a/src/app/routes-framadate.ts b/src/app/routes-framadate.ts
index 05c20a5f..3b18424f 100644
--- a/src/app/routes-framadate.ts
+++ b/src/app/routes-framadate.ts
@@ -25,7 +25,7 @@ export const routes: Routes = [
path: 'poll/:slug/administration',
loadChildren: () =>
import('./features/administration/administration.module').then((m) => m.AdministrationModule),
- resolve: { poll: PollService },
+ // resolve: { poll: PollService },
},
{
path: 'poll/:slug/consultation',
@@ -35,7 +35,7 @@ export const routes: Routes = [
{
path: 'poll/:slug/participation',
loadChildren: () => import('./features/participation/participation.module').then((m) => m.ParticipationModule),
- resolve: { poll: PollService },
+ // resolve: { poll: PollService },
},
{
path: 'oldstuff',
diff --git a/src/environments/environment.ts b/src/environments/environment.ts
index 229e5d01..b0fcef5a 100644
--- a/src/environments/environment.ts
+++ b/src/environments/environment.ts
@@ -4,12 +4,12 @@
const backendApiUrlsInDev = {
local: '/api/v1',
- // remote: 'http://localhost:8000/api/v1',
- remote: 'https://framadate-api.cipherbliss.com/api/v1',
+ remote: 'http://localhost:8000/api/v1',
+ // remote: 'https://framadate-api.cipherbliss.com/api/v1',
};
const apiV1 = {
- // baseHref: 'http://localhost:8000/api/v1',
- baseHref: 'https://framadate-api.cipherbliss.com/api/v1',
+ baseHref: 'http://localhost:8000/api/v1',
+ // baseHref: 'https://framadate-api.cipherbliss.com/api/v1',
api_new_poll: '/poll/',
api_get_poll: '/poll/{id}',
api_new_vote_stack: '/poll/{id}/answer',
From fdcb7327f0b65a4ce8c7ae6f8a5bec9f5592c026 Mon Sep 17 00:00:00 2001
From: Tykayn
Date: Thu, 29 Apr 2021 10:41:47 +0200
Subject: [PATCH 02/18] move old stuff
---
.../old-stuff/config/PollConfig.ts | 2 +-
.../old-stuff/config/defaultConfigs.ts | 0
.../date-value-accessor.metadata.json | 0
.../date-value-accessor.ts | 0
.../date-value-accessor/index.metadata.json | 0
.../custom-lib/date-value-accessor/index.ts | 0
.../date-value-accessor/module.metadata.json | 0
.../custom-lib/date-value-accessor/module.ts | 0
.../old-stuff/mocks/choice.ts | 0
.../mocks/comment-same-text-error.json | 0
.../mocks/comment-too-fast-error.json | 0
.../mocks/config-poll-dessins-animes.json | 0
.../old-stuff/mocks/created-comment.json | 0
.../old-stuff/mocks/mock-comments.ts | 0
.../old-stuff/mocks/mock-graph.ts | 0
.../old-stuff/mocks/mock-poll3.ts | 0
.../old-stuff/mocks/mock-success-vote.ts | 0
.../old-stuff/mocks/mockmypolls.ts | 0
.../old-stuff/mocks/votestack-success.json | 0
.../old-stuff/old-stuff-routing.module.ts | 0
.../old-stuff/old-stuff.module.ts | 2 +-
.../pages/admin/admin.component.html | 0
.../pages/admin/admin.component.scss | 0
.../pages/admin/admin.component.spec.ts | 0
.../old-stuff/pages/admin/admin.component.ts | 4 +--
.../pages/answers/answers.component.html | 0
.../pages/answers/answers.component.scss | 0
.../pages/answers/answers.component.spec.ts | 0
.../pages/answers/answers.component.ts | 0
.../create-or-retrieve.component.html | 0
.../create-or-retrieve.component.scss | 0
.../create-or-retrieve.component.spec.ts | 0
.../create-or-retrieve.component.ts | 0
.../pages/dates/dates.component.html | 0
.../pages/dates/dates.component.scss | 0
.../pages/dates/dates.component.spec.ts | 0
.../old-stuff/pages/dates/dates.component.ts | 4 +--
.../end-confirmation.component.html | 0
.../end-confirmation.component.scss | 0
.../end-confirmation.component.spec.ts | 0
.../end-confirmation.component.ts | 2 +-
.../example/base-page/base.component.html | 0
.../example/base-page/base.component.scss | 0
.../example/base-page/base.component.spec.ts | 0
.../pages/example/base-page/base.component.ts | 0
.../pages/example/kind/kind.component.html | 2 +-
.../pages/example/kind/kind.component.scss | 0
.../pages/example/kind/kind.component.spec.ts | 0
.../pages/example/kind/kind.component.ts | 0
.../example/pictures/pictures.component.html | 0
.../example/pictures/pictures.component.scss | 0
.../pictures/pictures.component.spec.ts | 0
.../example/pictures/pictures.component.ts | 0
.../old-stuff/pages/home/home.component.html | 0
.../old-stuff/pages/home/home.component.scss | 0
.../pages/home/home.component.spec.ts | 0
.../old-stuff/pages/home/home.component.ts | 0
.../pages/password/password.component.html | 0
.../pages/password/password.component.scss | 0
.../pages/password/password.component.spec.ts | 0
.../pages/password/password.component.ts | 0
.../poll-display/poll-display.component.html | 0
.../poll-display/poll-display.component.scss | 1 +
.../poll-display.component.spec.ts | 0
.../poll-display/poll-display.component.ts | 2 +-
.../poll-graphic/poll-graphic.component.html | 0
.../poll-graphic/poll-graphic.component.scss | 0
.../poll-graphic.component.spec.ts | 0
.../poll-graphic/poll-graphic.component.ts | 0
.../pages/resume/resume.component.html | 0
.../pages/resume/resume.component.scss | 0
.../pages/resume/resume.component.spec.ts | 0
.../pages/resume/resume.component.ts | 0
.../visibility/visibility.component.html | 0
.../visibility/visibility.component.scss | 0
.../visibility/visibility.component.spec.ts | 0
.../pages/visibility/visibility.component.ts | 4 +--
.../choices-list/choices-list.component.html | 0
.../choices-list/choices-list.component.scss | 0
.../choices-list.component.spec.ts | 0
.../choices-list/choices-list.component.ts | 0
.../comments-list.component.html | 0
.../comments-list.component.scss | 0
.../comments-list.component.spec.ts | 0
.../comments-list/comments-list.component.ts | 0
.../voting-choice.component.html | 0
.../voting-choice.component.scss | 2 +-
.../voting-choice.component.spec.ts | 0
.../voting-choice/voting-choice.component.ts | 0
.../voting-comment.component.html | 0
.../voting-comment.component.scss | 0
.../voting-comment.component.spec.ts | 0
.../voting-comment.component.ts | 0
.../voting-graph/voting-graph.component.html | 0
.../voting-graph/voting-graph.component.scss | 0
.../voting-graph.component.spec.ts | 0
.../voting-graph/voting-graph.component.ts | 0
.../voting-navigation.component.html | 0
.../voting-navigation.component.scss | 0
.../voting-navigation.component.spec.ts | 0
.../voting-navigation.component.ts | 0
.../voting-summary.component.html | 0
.../voting-summary.component.scss | 2 +-
.../voting-summary.component.spec.ts | 0
.../voting-summary.component.ts | 0
.../pages/voting/voting.component.html | 0
.../pages/voting/voting.component.scss | 0
.../pages/voting/voting.component.spec.ts | 0
.../pages/voting/voting.component.ts | 0
.../old-stuff/services/config.service.ts | 6 ++--
.../services/progression.service.spec.ts | 0
.../ui/copy-text/copy-text.component.html | 0
.../ui/copy-text/copy-text.component.scss | 0
.../ui/copy-text/copy-text.component.spec.ts | 0
.../ui/copy-text/copy-text.component.ts | 2 +-
.../resettable-input.directive.spec.ts | 0
.../directives/resettable-input.directive.ts | 0
.../erasable-input.component.html | 0
.../erasable-input.component.scss | 0
.../erasable-input.component.spec.ts | 0
.../erasable-input.component.ts | 0
.../ui/two-links/two-links.component.html | 0
.../ui/two-links/two-links.component.scss | 0
.../ui/two-links/two-links.component.spec.ts | 0
.../ui/two-links/two-links.component.ts | 0
.../components/footer/footer.component.html | 29 -------------------
.../components/header/header.component.html | 28 ++++++++++++++++++
.../config => core/services}/DateUtilities.ts | 0
.../config => core/services}/PollUtilities.ts | 3 +-
.../form/date-select/date-select.component.ts | 9 ++++--
.../consultation-routing.module.ts | 2 +-
.../consultation/consultation.component.ts | 2 +-
.../poll-display/poll-display.component.scss | 1 -
src/app/routes-framadate.ts | 4 ---
134 files changed, 56 insertions(+), 57 deletions(-)
rename {src/app/features => mocks}/old-stuff/config/PollConfig.ts (97%)
rename {src/app/features => mocks}/old-stuff/config/defaultConfigs.ts (100%)
rename {src/app/features => mocks}/old-stuff/custom-lib/date-value-accessor/date-value-accessor.metadata.json (100%)
rename {src/app/features => mocks}/old-stuff/custom-lib/date-value-accessor/date-value-accessor.ts (100%)
rename {src/app/features => mocks}/old-stuff/custom-lib/date-value-accessor/index.metadata.json (100%)
rename {src/app/features => mocks}/old-stuff/custom-lib/date-value-accessor/index.ts (100%)
rename {src/app/features => mocks}/old-stuff/custom-lib/date-value-accessor/module.metadata.json (100%)
rename {src/app/features => mocks}/old-stuff/custom-lib/date-value-accessor/module.ts (100%)
rename {src/app/features => mocks}/old-stuff/mocks/choice.ts (100%)
rename {src/app/features => mocks}/old-stuff/mocks/comment-same-text-error.json (100%)
rename {src/app/features => mocks}/old-stuff/mocks/comment-too-fast-error.json (100%)
rename {src/app/features => mocks}/old-stuff/mocks/config-poll-dessins-animes.json (100%)
rename {src/app/features => mocks}/old-stuff/mocks/created-comment.json (100%)
rename {src/app/features => mocks}/old-stuff/mocks/mock-comments.ts (100%)
rename {src/app/features => mocks}/old-stuff/mocks/mock-graph.ts (100%)
rename {src/app/features => mocks}/old-stuff/mocks/mock-poll3.ts (100%)
rename {src/app/features => mocks}/old-stuff/mocks/mock-success-vote.ts (100%)
rename {src/app/features => mocks}/old-stuff/mocks/mockmypolls.ts (100%)
rename {src/app/features => mocks}/old-stuff/mocks/votestack-success.json (100%)
rename {src/app/features => mocks}/old-stuff/old-stuff-routing.module.ts (100%)
rename {src/app/features => mocks}/old-stuff/old-stuff.module.ts (98%)
rename {src/app/features => mocks}/old-stuff/pages/admin/admin.component.html (100%)
rename {src/app/features => mocks}/old-stuff/pages/admin/admin.component.scss (100%)
rename {src/app/features => mocks}/old-stuff/pages/admin/admin.component.spec.ts (100%)
rename {src/app/features => mocks}/old-stuff/pages/admin/admin.component.ts (91%)
rename {src/app/features => mocks}/old-stuff/pages/answers/answers.component.html (100%)
rename {src/app/features => mocks}/old-stuff/pages/answers/answers.component.scss (100%)
rename {src/app/features => mocks}/old-stuff/pages/answers/answers.component.spec.ts (100%)
rename {src/app/features => mocks}/old-stuff/pages/answers/answers.component.ts (100%)
rename {src/app/features => mocks}/old-stuff/pages/create-or-retrieve/create-or-retrieve.component.html (100%)
rename {src/app/features => mocks}/old-stuff/pages/create-or-retrieve/create-or-retrieve.component.scss (100%)
rename {src/app/features => mocks}/old-stuff/pages/create-or-retrieve/create-or-retrieve.component.spec.ts (100%)
rename {src/app/features => mocks}/old-stuff/pages/create-or-retrieve/create-or-retrieve.component.ts (100%)
rename {src/app/features => mocks}/old-stuff/pages/dates/dates.component.html (100%)
rename {src/app/features => mocks}/old-stuff/pages/dates/dates.component.scss (100%)
rename {src/app/features => mocks}/old-stuff/pages/dates/dates.component.spec.ts (100%)
rename {src/app/features => mocks}/old-stuff/pages/dates/dates.component.ts (95%)
rename {src/app/features => mocks}/old-stuff/pages/end-confirmation/end-confirmation.component.html (100%)
rename {src/app/features => mocks}/old-stuff/pages/end-confirmation/end-confirmation.component.scss (100%)
rename {src/app/features => mocks}/old-stuff/pages/end-confirmation/end-confirmation.component.spec.ts (100%)
rename {src/app/features => mocks}/old-stuff/pages/end-confirmation/end-confirmation.component.ts (90%)
rename {src/app/features => mocks}/old-stuff/pages/example/base-page/base.component.html (100%)
rename {src/app/features => mocks}/old-stuff/pages/example/base-page/base.component.scss (100%)
rename {src/app/features => mocks}/old-stuff/pages/example/base-page/base.component.spec.ts (100%)
rename {src/app/features => mocks}/old-stuff/pages/example/base-page/base.component.ts (100%)
rename {src/app/features => mocks}/old-stuff/pages/example/kind/kind.component.html (98%)
rename {src/app/features => mocks}/old-stuff/pages/example/kind/kind.component.scss (100%)
rename {src/app/features => mocks}/old-stuff/pages/example/kind/kind.component.spec.ts (100%)
rename {src/app/features => mocks}/old-stuff/pages/example/kind/kind.component.ts (100%)
rename {src/app/features => mocks}/old-stuff/pages/example/pictures/pictures.component.html (100%)
rename {src/app/features => mocks}/old-stuff/pages/example/pictures/pictures.component.scss (100%)
rename {src/app/features => mocks}/old-stuff/pages/example/pictures/pictures.component.spec.ts (100%)
rename {src/app/features => mocks}/old-stuff/pages/example/pictures/pictures.component.ts (100%)
rename {src/app/features => mocks}/old-stuff/pages/home/home.component.html (100%)
rename {src/app/features => mocks}/old-stuff/pages/home/home.component.scss (100%)
rename {src/app/features => mocks}/old-stuff/pages/home/home.component.spec.ts (100%)
rename {src/app/features => mocks}/old-stuff/pages/home/home.component.ts (100%)
rename {src/app/features => mocks}/old-stuff/pages/password/password.component.html (100%)
rename {src/app/features => mocks}/old-stuff/pages/password/password.component.scss (100%)
rename {src/app/features => mocks}/old-stuff/pages/password/password.component.spec.ts (100%)
rename {src/app/features => mocks}/old-stuff/pages/password/password.component.ts (100%)
rename {src/app/features => mocks}/old-stuff/pages/poll/poll-display/poll-display.component.html (100%)
create mode 100644 mocks/old-stuff/pages/poll/poll-display/poll-display.component.scss
rename {src/app/features => mocks}/old-stuff/pages/poll/poll-display/poll-display.component.spec.ts (100%)
rename {src/app/features => mocks}/old-stuff/pages/poll/poll-display/poll-display.component.ts (96%)
rename {src/app/features => mocks}/old-stuff/pages/poll/poll-graphic/poll-graphic.component.html (100%)
rename {src/app/features => mocks}/old-stuff/pages/poll/poll-graphic/poll-graphic.component.scss (100%)
rename {src/app/features => mocks}/old-stuff/pages/poll/poll-graphic/poll-graphic.component.spec.ts (100%)
rename {src/app/features => mocks}/old-stuff/pages/poll/poll-graphic/poll-graphic.component.ts (100%)
rename {src/app/features => mocks}/old-stuff/pages/resume/resume.component.html (100%)
rename {src/app/features => mocks}/old-stuff/pages/resume/resume.component.scss (100%)
rename {src/app/features => mocks}/old-stuff/pages/resume/resume.component.spec.ts (100%)
rename {src/app/features => mocks}/old-stuff/pages/resume/resume.component.ts (100%)
rename {src/app/features => mocks}/old-stuff/pages/visibility/visibility.component.html (100%)
rename {src/app/features => mocks}/old-stuff/pages/visibility/visibility.component.scss (100%)
rename {src/app/features => mocks}/old-stuff/pages/visibility/visibility.component.spec.ts (100%)
rename {src/app/features => mocks}/old-stuff/pages/visibility/visibility.component.ts (85%)
rename {src/app/features => mocks}/old-stuff/pages/voting/choices-list/choices-list.component.html (100%)
rename {src/app/features => mocks}/old-stuff/pages/voting/choices-list/choices-list.component.scss (100%)
rename {src/app/features => mocks}/old-stuff/pages/voting/choices-list/choices-list.component.spec.ts (100%)
rename {src/app/features => mocks}/old-stuff/pages/voting/choices-list/choices-list.component.ts (100%)
rename {src/app/features => mocks}/old-stuff/pages/voting/comments-list/comments-list.component.html (100%)
rename {src/app/features => mocks}/old-stuff/pages/voting/comments-list/comments-list.component.scss (100%)
rename {src/app/features => mocks}/old-stuff/pages/voting/comments-list/comments-list.component.spec.ts (100%)
rename {src/app/features => mocks}/old-stuff/pages/voting/comments-list/comments-list.component.ts (100%)
rename {src/app/features => mocks}/old-stuff/pages/voting/voting-choice/voting-choice.component.html (100%)
rename {src/app/features => mocks}/old-stuff/pages/voting/voting-choice/voting-choice.component.scss (98%)
rename {src/app/features => mocks}/old-stuff/pages/voting/voting-choice/voting-choice.component.spec.ts (100%)
rename {src/app/features => mocks}/old-stuff/pages/voting/voting-choice/voting-choice.component.ts (100%)
rename {src/app/features => mocks}/old-stuff/pages/voting/voting-comment/voting-comment.component.html (100%)
rename {src/app/features => mocks}/old-stuff/pages/voting/voting-comment/voting-comment.component.scss (100%)
rename {src/app/features => mocks}/old-stuff/pages/voting/voting-comment/voting-comment.component.spec.ts (100%)
rename {src/app/features => mocks}/old-stuff/pages/voting/voting-comment/voting-comment.component.ts (100%)
rename {src/app/features => mocks}/old-stuff/pages/voting/voting-graph/voting-graph.component.html (100%)
rename {src/app/features => mocks}/old-stuff/pages/voting/voting-graph/voting-graph.component.scss (100%)
rename {src/app/features => mocks}/old-stuff/pages/voting/voting-graph/voting-graph.component.spec.ts (100%)
rename {src/app/features => mocks}/old-stuff/pages/voting/voting-graph/voting-graph.component.ts (100%)
rename {src/app/features => mocks}/old-stuff/pages/voting/voting-navigation/voting-navigation.component.html (100%)
rename {src/app/features => mocks}/old-stuff/pages/voting/voting-navigation/voting-navigation.component.scss (100%)
rename {src/app/features => mocks}/old-stuff/pages/voting/voting-navigation/voting-navigation.component.spec.ts (100%)
rename {src/app/features => mocks}/old-stuff/pages/voting/voting-navigation/voting-navigation.component.ts (100%)
rename {src/app/features => mocks}/old-stuff/pages/voting/voting-summary/voting-summary.component.html (100%)
rename {src/app/features => mocks}/old-stuff/pages/voting/voting-summary/voting-summary.component.scss (84%)
rename {src/app/features => mocks}/old-stuff/pages/voting/voting-summary/voting-summary.component.spec.ts (100%)
rename {src/app/features => mocks}/old-stuff/pages/voting/voting-summary/voting-summary.component.ts (100%)
rename {src/app/features => mocks}/old-stuff/pages/voting/voting.component.html (100%)
rename {src/app/features => mocks}/old-stuff/pages/voting/voting.component.scss (100%)
rename {src/app/features => mocks}/old-stuff/pages/voting/voting.component.spec.ts (100%)
rename {src/app/features => mocks}/old-stuff/pages/voting/voting.component.ts (100%)
rename {src/app/features => mocks}/old-stuff/services/config.service.ts (99%)
rename {src/app/features => mocks}/old-stuff/services/progression.service.spec.ts (100%)
rename {src/app/features => mocks}/old-stuff/ui/copy-text/copy-text.component.html (100%)
rename {src/app/features => mocks}/old-stuff/ui/copy-text/copy-text.component.scss (100%)
rename {src/app/features => mocks}/old-stuff/ui/copy-text/copy-text.component.spec.ts (100%)
rename {src/app/features => mocks}/old-stuff/ui/copy-text/copy-text.component.ts (88%)
rename {src/app/features => mocks}/old-stuff/ui/directives/resettable-input.directive.spec.ts (100%)
rename {src/app/features => mocks}/old-stuff/ui/directives/resettable-input.directive.ts (100%)
rename {src/app/features => mocks}/old-stuff/ui/erasable-input/erasable-input.component.html (100%)
rename {src/app/features => mocks}/old-stuff/ui/erasable-input/erasable-input.component.scss (100%)
rename {src/app/features => mocks}/old-stuff/ui/erasable-input/erasable-input.component.spec.ts (100%)
rename {src/app/features => mocks}/old-stuff/ui/erasable-input/erasable-input.component.ts (100%)
rename {src/app/features => mocks}/old-stuff/ui/two-links/two-links.component.html (100%)
rename {src/app/features => mocks}/old-stuff/ui/two-links/two-links.component.scss (100%)
rename {src/app/features => mocks}/old-stuff/ui/two-links/two-links.component.spec.ts (100%)
rename {src/app/features => mocks}/old-stuff/ui/two-links/two-links.component.ts (100%)
rename src/app/{features/old-stuff/config => core/services}/DateUtilities.ts (100%)
rename src/app/{features/old-stuff/config => core/services}/PollUtilities.ts (94%)
delete mode 100644 src/app/features/old-stuff/pages/poll/poll-display/poll-display.component.scss
diff --git a/src/app/features/old-stuff/config/PollConfig.ts b/mocks/old-stuff/config/PollConfig.ts
similarity index 97%
rename from src/app/features/old-stuff/config/PollConfig.ts
rename to mocks/old-stuff/config/PollConfig.ts
index 483b5539..b45b3573 100644
--- a/src/app/features/old-stuff/config/PollConfig.ts
+++ b/mocks/old-stuff/config/PollConfig.ts
@@ -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 {
diff --git a/src/app/features/old-stuff/config/defaultConfigs.ts b/mocks/old-stuff/config/defaultConfigs.ts
similarity index 100%
rename from src/app/features/old-stuff/config/defaultConfigs.ts
rename to mocks/old-stuff/config/defaultConfigs.ts
diff --git a/src/app/features/old-stuff/custom-lib/date-value-accessor/date-value-accessor.metadata.json b/mocks/old-stuff/custom-lib/date-value-accessor/date-value-accessor.metadata.json
similarity index 100%
rename from src/app/features/old-stuff/custom-lib/date-value-accessor/date-value-accessor.metadata.json
rename to mocks/old-stuff/custom-lib/date-value-accessor/date-value-accessor.metadata.json
diff --git a/src/app/features/old-stuff/custom-lib/date-value-accessor/date-value-accessor.ts b/mocks/old-stuff/custom-lib/date-value-accessor/date-value-accessor.ts
similarity index 100%
rename from src/app/features/old-stuff/custom-lib/date-value-accessor/date-value-accessor.ts
rename to mocks/old-stuff/custom-lib/date-value-accessor/date-value-accessor.ts
diff --git a/src/app/features/old-stuff/custom-lib/date-value-accessor/index.metadata.json b/mocks/old-stuff/custom-lib/date-value-accessor/index.metadata.json
similarity index 100%
rename from src/app/features/old-stuff/custom-lib/date-value-accessor/index.metadata.json
rename to mocks/old-stuff/custom-lib/date-value-accessor/index.metadata.json
diff --git a/src/app/features/old-stuff/custom-lib/date-value-accessor/index.ts b/mocks/old-stuff/custom-lib/date-value-accessor/index.ts
similarity index 100%
rename from src/app/features/old-stuff/custom-lib/date-value-accessor/index.ts
rename to mocks/old-stuff/custom-lib/date-value-accessor/index.ts
diff --git a/src/app/features/old-stuff/custom-lib/date-value-accessor/module.metadata.json b/mocks/old-stuff/custom-lib/date-value-accessor/module.metadata.json
similarity index 100%
rename from src/app/features/old-stuff/custom-lib/date-value-accessor/module.metadata.json
rename to mocks/old-stuff/custom-lib/date-value-accessor/module.metadata.json
diff --git a/src/app/features/old-stuff/custom-lib/date-value-accessor/module.ts b/mocks/old-stuff/custom-lib/date-value-accessor/module.ts
similarity index 100%
rename from src/app/features/old-stuff/custom-lib/date-value-accessor/module.ts
rename to mocks/old-stuff/custom-lib/date-value-accessor/module.ts
diff --git a/src/app/features/old-stuff/mocks/choice.ts b/mocks/old-stuff/mocks/choice.ts
similarity index 100%
rename from src/app/features/old-stuff/mocks/choice.ts
rename to mocks/old-stuff/mocks/choice.ts
diff --git a/src/app/features/old-stuff/mocks/comment-same-text-error.json b/mocks/old-stuff/mocks/comment-same-text-error.json
similarity index 100%
rename from src/app/features/old-stuff/mocks/comment-same-text-error.json
rename to mocks/old-stuff/mocks/comment-same-text-error.json
diff --git a/src/app/features/old-stuff/mocks/comment-too-fast-error.json b/mocks/old-stuff/mocks/comment-too-fast-error.json
similarity index 100%
rename from src/app/features/old-stuff/mocks/comment-too-fast-error.json
rename to mocks/old-stuff/mocks/comment-too-fast-error.json
diff --git a/src/app/features/old-stuff/mocks/config-poll-dessins-animes.json b/mocks/old-stuff/mocks/config-poll-dessins-animes.json
similarity index 100%
rename from src/app/features/old-stuff/mocks/config-poll-dessins-animes.json
rename to mocks/old-stuff/mocks/config-poll-dessins-animes.json
diff --git a/src/app/features/old-stuff/mocks/created-comment.json b/mocks/old-stuff/mocks/created-comment.json
similarity index 100%
rename from src/app/features/old-stuff/mocks/created-comment.json
rename to mocks/old-stuff/mocks/created-comment.json
diff --git a/src/app/features/old-stuff/mocks/mock-comments.ts b/mocks/old-stuff/mocks/mock-comments.ts
similarity index 100%
rename from src/app/features/old-stuff/mocks/mock-comments.ts
rename to mocks/old-stuff/mocks/mock-comments.ts
diff --git a/src/app/features/old-stuff/mocks/mock-graph.ts b/mocks/old-stuff/mocks/mock-graph.ts
similarity index 100%
rename from src/app/features/old-stuff/mocks/mock-graph.ts
rename to mocks/old-stuff/mocks/mock-graph.ts
diff --git a/src/app/features/old-stuff/mocks/mock-poll3.ts b/mocks/old-stuff/mocks/mock-poll3.ts
similarity index 100%
rename from src/app/features/old-stuff/mocks/mock-poll3.ts
rename to mocks/old-stuff/mocks/mock-poll3.ts
diff --git a/src/app/features/old-stuff/mocks/mock-success-vote.ts b/mocks/old-stuff/mocks/mock-success-vote.ts
similarity index 100%
rename from src/app/features/old-stuff/mocks/mock-success-vote.ts
rename to mocks/old-stuff/mocks/mock-success-vote.ts
diff --git a/src/app/features/old-stuff/mocks/mockmypolls.ts b/mocks/old-stuff/mocks/mockmypolls.ts
similarity index 100%
rename from src/app/features/old-stuff/mocks/mockmypolls.ts
rename to mocks/old-stuff/mocks/mockmypolls.ts
diff --git a/src/app/features/old-stuff/mocks/votestack-success.json b/mocks/old-stuff/mocks/votestack-success.json
similarity index 100%
rename from src/app/features/old-stuff/mocks/votestack-success.json
rename to mocks/old-stuff/mocks/votestack-success.json
diff --git a/src/app/features/old-stuff/old-stuff-routing.module.ts b/mocks/old-stuff/old-stuff-routing.module.ts
similarity index 100%
rename from src/app/features/old-stuff/old-stuff-routing.module.ts
rename to mocks/old-stuff/old-stuff-routing.module.ts
diff --git a/src/app/features/old-stuff/old-stuff.module.ts b/mocks/old-stuff/old-stuff.module.ts
similarity index 98%
rename from src/app/features/old-stuff/old-stuff.module.ts
rename to mocks/old-stuff/old-stuff.module.ts
index 3dea8e28..c4502415 100644
--- a/src/app/features/old-stuff/old-stuff.module.ts
+++ b/mocks/old-stuff/old-stuff.module.ts
@@ -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';
diff --git a/src/app/features/old-stuff/pages/admin/admin.component.html b/mocks/old-stuff/pages/admin/admin.component.html
similarity index 100%
rename from src/app/features/old-stuff/pages/admin/admin.component.html
rename to mocks/old-stuff/pages/admin/admin.component.html
diff --git a/src/app/features/old-stuff/pages/admin/admin.component.scss b/mocks/old-stuff/pages/admin/admin.component.scss
similarity index 100%
rename from src/app/features/old-stuff/pages/admin/admin.component.scss
rename to mocks/old-stuff/pages/admin/admin.component.scss
diff --git a/src/app/features/old-stuff/pages/admin/admin.component.spec.ts b/mocks/old-stuff/pages/admin/admin.component.spec.ts
similarity index 100%
rename from src/app/features/old-stuff/pages/admin/admin.component.spec.ts
rename to mocks/old-stuff/pages/admin/admin.component.spec.ts
diff --git a/src/app/features/old-stuff/pages/admin/admin.component.ts b/mocks/old-stuff/pages/admin/admin.component.ts
similarity index 91%
rename from src/app/features/old-stuff/pages/admin/admin.component.ts
rename to mocks/old-stuff/pages/admin/admin.component.ts
index 370973d2..ba67f433 100644
--- a/src/app/features/old-stuff/pages/admin/admin.component.ts
+++ b/mocks/old-stuff/pages/admin/admin.component.ts
@@ -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 { PollUtilities } from '../../../../src/app/core/services/PollUtilities';
+import { environment } from '../../../../src/environments/environment';
@Component({
selector: 'app-admin',
diff --git a/src/app/features/old-stuff/pages/answers/answers.component.html b/mocks/old-stuff/pages/answers/answers.component.html
similarity index 100%
rename from src/app/features/old-stuff/pages/answers/answers.component.html
rename to mocks/old-stuff/pages/answers/answers.component.html
diff --git a/src/app/features/old-stuff/pages/answers/answers.component.scss b/mocks/old-stuff/pages/answers/answers.component.scss
similarity index 100%
rename from src/app/features/old-stuff/pages/answers/answers.component.scss
rename to mocks/old-stuff/pages/answers/answers.component.scss
diff --git a/src/app/features/old-stuff/pages/answers/answers.component.spec.ts b/mocks/old-stuff/pages/answers/answers.component.spec.ts
similarity index 100%
rename from src/app/features/old-stuff/pages/answers/answers.component.spec.ts
rename to mocks/old-stuff/pages/answers/answers.component.spec.ts
diff --git a/src/app/features/old-stuff/pages/answers/answers.component.ts b/mocks/old-stuff/pages/answers/answers.component.ts
similarity index 100%
rename from src/app/features/old-stuff/pages/answers/answers.component.ts
rename to mocks/old-stuff/pages/answers/answers.component.ts
diff --git a/src/app/features/old-stuff/pages/create-or-retrieve/create-or-retrieve.component.html b/mocks/old-stuff/pages/create-or-retrieve/create-or-retrieve.component.html
similarity index 100%
rename from src/app/features/old-stuff/pages/create-or-retrieve/create-or-retrieve.component.html
rename to mocks/old-stuff/pages/create-or-retrieve/create-or-retrieve.component.html
diff --git a/src/app/features/old-stuff/pages/create-or-retrieve/create-or-retrieve.component.scss b/mocks/old-stuff/pages/create-or-retrieve/create-or-retrieve.component.scss
similarity index 100%
rename from src/app/features/old-stuff/pages/create-or-retrieve/create-or-retrieve.component.scss
rename to mocks/old-stuff/pages/create-or-retrieve/create-or-retrieve.component.scss
diff --git a/src/app/features/old-stuff/pages/create-or-retrieve/create-or-retrieve.component.spec.ts b/mocks/old-stuff/pages/create-or-retrieve/create-or-retrieve.component.spec.ts
similarity index 100%
rename from src/app/features/old-stuff/pages/create-or-retrieve/create-or-retrieve.component.spec.ts
rename to mocks/old-stuff/pages/create-or-retrieve/create-or-retrieve.component.spec.ts
diff --git a/src/app/features/old-stuff/pages/create-or-retrieve/create-or-retrieve.component.ts b/mocks/old-stuff/pages/create-or-retrieve/create-or-retrieve.component.ts
similarity index 100%
rename from src/app/features/old-stuff/pages/create-or-retrieve/create-or-retrieve.component.ts
rename to mocks/old-stuff/pages/create-or-retrieve/create-or-retrieve.component.ts
diff --git a/src/app/features/old-stuff/pages/dates/dates.component.html b/mocks/old-stuff/pages/dates/dates.component.html
similarity index 100%
rename from src/app/features/old-stuff/pages/dates/dates.component.html
rename to mocks/old-stuff/pages/dates/dates.component.html
diff --git a/src/app/features/old-stuff/pages/dates/dates.component.scss b/mocks/old-stuff/pages/dates/dates.component.scss
similarity index 100%
rename from src/app/features/old-stuff/pages/dates/dates.component.scss
rename to mocks/old-stuff/pages/dates/dates.component.scss
diff --git a/src/app/features/old-stuff/pages/dates/dates.component.spec.ts b/mocks/old-stuff/pages/dates/dates.component.spec.ts
similarity index 100%
rename from src/app/features/old-stuff/pages/dates/dates.component.spec.ts
rename to mocks/old-stuff/pages/dates/dates.component.spec.ts
diff --git a/src/app/features/old-stuff/pages/dates/dates.component.ts b/mocks/old-stuff/pages/dates/dates.component.ts
similarity index 95%
rename from src/app/features/old-stuff/pages/dates/dates.component.ts
rename to mocks/old-stuff/pages/dates/dates.component.ts
index 1caed356..f78a93d9 100644
--- a/src/app/features/old-stuff/pages/dates/dates.component.ts
+++ b/mocks/old-stuff/pages/dates/dates.component.ts
@@ -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 { DateUtilities } from '../../../../src/app/core/services/DateUtilities';
import { otherDefaultDates } from '../../config/defaultConfigs';
import { ConfigService } from '../../services/config.service';
import { BaseComponent } from '../example/base-page/base.component';
diff --git a/src/app/features/old-stuff/pages/end-confirmation/end-confirmation.component.html b/mocks/old-stuff/pages/end-confirmation/end-confirmation.component.html
similarity index 100%
rename from src/app/features/old-stuff/pages/end-confirmation/end-confirmation.component.html
rename to mocks/old-stuff/pages/end-confirmation/end-confirmation.component.html
diff --git a/src/app/features/old-stuff/pages/end-confirmation/end-confirmation.component.scss b/mocks/old-stuff/pages/end-confirmation/end-confirmation.component.scss
similarity index 100%
rename from src/app/features/old-stuff/pages/end-confirmation/end-confirmation.component.scss
rename to mocks/old-stuff/pages/end-confirmation/end-confirmation.component.scss
diff --git a/src/app/features/old-stuff/pages/end-confirmation/end-confirmation.component.spec.ts b/mocks/old-stuff/pages/end-confirmation/end-confirmation.component.spec.ts
similarity index 100%
rename from src/app/features/old-stuff/pages/end-confirmation/end-confirmation.component.spec.ts
rename to mocks/old-stuff/pages/end-confirmation/end-confirmation.component.spec.ts
diff --git a/src/app/features/old-stuff/pages/end-confirmation/end-confirmation.component.ts b/mocks/old-stuff/pages/end-confirmation/end-confirmation.component.ts
similarity index 90%
rename from src/app/features/old-stuff/pages/end-confirmation/end-confirmation.component.ts
rename to mocks/old-stuff/pages/end-confirmation/end-confirmation.component.ts
index ac4eab66..cba66989 100644
--- a/src/app/features/old-stuff/pages/end-confirmation/end-confirmation.component.ts
+++ b/mocks/old-stuff/pages/end-confirmation/end-confirmation.component.ts
@@ -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';
diff --git a/src/app/features/old-stuff/pages/example/base-page/base.component.html b/mocks/old-stuff/pages/example/base-page/base.component.html
similarity index 100%
rename from src/app/features/old-stuff/pages/example/base-page/base.component.html
rename to mocks/old-stuff/pages/example/base-page/base.component.html
diff --git a/src/app/features/old-stuff/pages/example/base-page/base.component.scss b/mocks/old-stuff/pages/example/base-page/base.component.scss
similarity index 100%
rename from src/app/features/old-stuff/pages/example/base-page/base.component.scss
rename to mocks/old-stuff/pages/example/base-page/base.component.scss
diff --git a/src/app/features/old-stuff/pages/example/base-page/base.component.spec.ts b/mocks/old-stuff/pages/example/base-page/base.component.spec.ts
similarity index 100%
rename from src/app/features/old-stuff/pages/example/base-page/base.component.spec.ts
rename to mocks/old-stuff/pages/example/base-page/base.component.spec.ts
diff --git a/src/app/features/old-stuff/pages/example/base-page/base.component.ts b/mocks/old-stuff/pages/example/base-page/base.component.ts
similarity index 100%
rename from src/app/features/old-stuff/pages/example/base-page/base.component.ts
rename to mocks/old-stuff/pages/example/base-page/base.component.ts
diff --git a/src/app/features/old-stuff/pages/example/kind/kind.component.html b/mocks/old-stuff/pages/example/kind/kind.component.html
similarity index 98%
rename from src/app/features/old-stuff/pages/example/kind/kind.component.html
rename to mocks/old-stuff/pages/example/kind/kind.component.html
index 10c0467e..0cf28006 100644
--- a/src/app/features/old-stuff/pages/example/kind/kind.component.html
+++ b/mocks/old-stuff/pages/example/kind/kind.component.html
@@ -47,7 +47,7 @@
-
+
primary - outline - default
diff --git a/src/app/features/old-stuff/pages/example/kind/kind.component.scss b/mocks/old-stuff/pages/example/kind/kind.component.scss
similarity index 100%
rename from src/app/features/old-stuff/pages/example/kind/kind.component.scss
rename to mocks/old-stuff/pages/example/kind/kind.component.scss
diff --git a/src/app/features/old-stuff/pages/example/kind/kind.component.spec.ts b/mocks/old-stuff/pages/example/kind/kind.component.spec.ts
similarity index 100%
rename from src/app/features/old-stuff/pages/example/kind/kind.component.spec.ts
rename to mocks/old-stuff/pages/example/kind/kind.component.spec.ts
diff --git a/src/app/features/old-stuff/pages/example/kind/kind.component.ts b/mocks/old-stuff/pages/example/kind/kind.component.ts
similarity index 100%
rename from src/app/features/old-stuff/pages/example/kind/kind.component.ts
rename to mocks/old-stuff/pages/example/kind/kind.component.ts
diff --git a/src/app/features/old-stuff/pages/example/pictures/pictures.component.html b/mocks/old-stuff/pages/example/pictures/pictures.component.html
similarity index 100%
rename from src/app/features/old-stuff/pages/example/pictures/pictures.component.html
rename to mocks/old-stuff/pages/example/pictures/pictures.component.html
diff --git a/src/app/features/old-stuff/pages/example/pictures/pictures.component.scss b/mocks/old-stuff/pages/example/pictures/pictures.component.scss
similarity index 100%
rename from src/app/features/old-stuff/pages/example/pictures/pictures.component.scss
rename to mocks/old-stuff/pages/example/pictures/pictures.component.scss
diff --git a/src/app/features/old-stuff/pages/example/pictures/pictures.component.spec.ts b/mocks/old-stuff/pages/example/pictures/pictures.component.spec.ts
similarity index 100%
rename from src/app/features/old-stuff/pages/example/pictures/pictures.component.spec.ts
rename to mocks/old-stuff/pages/example/pictures/pictures.component.spec.ts
diff --git a/src/app/features/old-stuff/pages/example/pictures/pictures.component.ts b/mocks/old-stuff/pages/example/pictures/pictures.component.ts
similarity index 100%
rename from src/app/features/old-stuff/pages/example/pictures/pictures.component.ts
rename to mocks/old-stuff/pages/example/pictures/pictures.component.ts
diff --git a/src/app/features/old-stuff/pages/home/home.component.html b/mocks/old-stuff/pages/home/home.component.html
similarity index 100%
rename from src/app/features/old-stuff/pages/home/home.component.html
rename to mocks/old-stuff/pages/home/home.component.html
diff --git a/src/app/features/old-stuff/pages/home/home.component.scss b/mocks/old-stuff/pages/home/home.component.scss
similarity index 100%
rename from src/app/features/old-stuff/pages/home/home.component.scss
rename to mocks/old-stuff/pages/home/home.component.scss
diff --git a/src/app/features/old-stuff/pages/home/home.component.spec.ts b/mocks/old-stuff/pages/home/home.component.spec.ts
similarity index 100%
rename from src/app/features/old-stuff/pages/home/home.component.spec.ts
rename to mocks/old-stuff/pages/home/home.component.spec.ts
diff --git a/src/app/features/old-stuff/pages/home/home.component.ts b/mocks/old-stuff/pages/home/home.component.ts
similarity index 100%
rename from src/app/features/old-stuff/pages/home/home.component.ts
rename to mocks/old-stuff/pages/home/home.component.ts
diff --git a/src/app/features/old-stuff/pages/password/password.component.html b/mocks/old-stuff/pages/password/password.component.html
similarity index 100%
rename from src/app/features/old-stuff/pages/password/password.component.html
rename to mocks/old-stuff/pages/password/password.component.html
diff --git a/src/app/features/old-stuff/pages/password/password.component.scss b/mocks/old-stuff/pages/password/password.component.scss
similarity index 100%
rename from src/app/features/old-stuff/pages/password/password.component.scss
rename to mocks/old-stuff/pages/password/password.component.scss
diff --git a/src/app/features/old-stuff/pages/password/password.component.spec.ts b/mocks/old-stuff/pages/password/password.component.spec.ts
similarity index 100%
rename from src/app/features/old-stuff/pages/password/password.component.spec.ts
rename to mocks/old-stuff/pages/password/password.component.spec.ts
diff --git a/src/app/features/old-stuff/pages/password/password.component.ts b/mocks/old-stuff/pages/password/password.component.ts
similarity index 100%
rename from src/app/features/old-stuff/pages/password/password.component.ts
rename to mocks/old-stuff/pages/password/password.component.ts
diff --git a/src/app/features/old-stuff/pages/poll/poll-display/poll-display.component.html b/mocks/old-stuff/pages/poll/poll-display/poll-display.component.html
similarity index 100%
rename from src/app/features/old-stuff/pages/poll/poll-display/poll-display.component.html
rename to mocks/old-stuff/pages/poll/poll-display/poll-display.component.html
diff --git a/mocks/old-stuff/pages/poll/poll-display/poll-display.component.scss b/mocks/old-stuff/pages/poll/poll-display/poll-display.component.scss
new file mode 100644
index 00000000..97075968
--- /dev/null
+++ b/mocks/old-stuff/pages/poll/poll-display/poll-display.component.scss
@@ -0,0 +1 @@
+@import '../../../../../src/styles/variables';
diff --git a/src/app/features/old-stuff/pages/poll/poll-display/poll-display.component.spec.ts b/mocks/old-stuff/pages/poll/poll-display/poll-display.component.spec.ts
similarity index 100%
rename from src/app/features/old-stuff/pages/poll/poll-display/poll-display.component.spec.ts
rename to mocks/old-stuff/pages/poll/poll-display/poll-display.component.spec.ts
diff --git a/src/app/features/old-stuff/pages/poll/poll-display/poll-display.component.ts b/mocks/old-stuff/pages/poll/poll-display/poll-display.component.ts
similarity index 96%
rename from src/app/features/old-stuff/pages/poll/poll-display/poll-display.component.ts
rename to mocks/old-stuff/pages/poll/poll-display/poll-display.component.ts
index 9489db1a..768b8686 100644
--- a/src/app/features/old-stuff/pages/poll/poll-display/poll-display.component.ts
+++ b/mocks/old-stuff/pages/poll/poll-display/poll-display.component.ts
@@ -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({
diff --git a/src/app/features/old-stuff/pages/poll/poll-graphic/poll-graphic.component.html b/mocks/old-stuff/pages/poll/poll-graphic/poll-graphic.component.html
similarity index 100%
rename from src/app/features/old-stuff/pages/poll/poll-graphic/poll-graphic.component.html
rename to mocks/old-stuff/pages/poll/poll-graphic/poll-graphic.component.html
diff --git a/src/app/features/old-stuff/pages/poll/poll-graphic/poll-graphic.component.scss b/mocks/old-stuff/pages/poll/poll-graphic/poll-graphic.component.scss
similarity index 100%
rename from src/app/features/old-stuff/pages/poll/poll-graphic/poll-graphic.component.scss
rename to mocks/old-stuff/pages/poll/poll-graphic/poll-graphic.component.scss
diff --git a/src/app/features/old-stuff/pages/poll/poll-graphic/poll-graphic.component.spec.ts b/mocks/old-stuff/pages/poll/poll-graphic/poll-graphic.component.spec.ts
similarity index 100%
rename from src/app/features/old-stuff/pages/poll/poll-graphic/poll-graphic.component.spec.ts
rename to mocks/old-stuff/pages/poll/poll-graphic/poll-graphic.component.spec.ts
diff --git a/src/app/features/old-stuff/pages/poll/poll-graphic/poll-graphic.component.ts b/mocks/old-stuff/pages/poll/poll-graphic/poll-graphic.component.ts
similarity index 100%
rename from src/app/features/old-stuff/pages/poll/poll-graphic/poll-graphic.component.ts
rename to mocks/old-stuff/pages/poll/poll-graphic/poll-graphic.component.ts
diff --git a/src/app/features/old-stuff/pages/resume/resume.component.html b/mocks/old-stuff/pages/resume/resume.component.html
similarity index 100%
rename from src/app/features/old-stuff/pages/resume/resume.component.html
rename to mocks/old-stuff/pages/resume/resume.component.html
diff --git a/src/app/features/old-stuff/pages/resume/resume.component.scss b/mocks/old-stuff/pages/resume/resume.component.scss
similarity index 100%
rename from src/app/features/old-stuff/pages/resume/resume.component.scss
rename to mocks/old-stuff/pages/resume/resume.component.scss
diff --git a/src/app/features/old-stuff/pages/resume/resume.component.spec.ts b/mocks/old-stuff/pages/resume/resume.component.spec.ts
similarity index 100%
rename from src/app/features/old-stuff/pages/resume/resume.component.spec.ts
rename to mocks/old-stuff/pages/resume/resume.component.spec.ts
diff --git a/src/app/features/old-stuff/pages/resume/resume.component.ts b/mocks/old-stuff/pages/resume/resume.component.ts
similarity index 100%
rename from src/app/features/old-stuff/pages/resume/resume.component.ts
rename to mocks/old-stuff/pages/resume/resume.component.ts
diff --git a/src/app/features/old-stuff/pages/visibility/visibility.component.html b/mocks/old-stuff/pages/visibility/visibility.component.html
similarity index 100%
rename from src/app/features/old-stuff/pages/visibility/visibility.component.html
rename to mocks/old-stuff/pages/visibility/visibility.component.html
diff --git a/src/app/features/old-stuff/pages/visibility/visibility.component.scss b/mocks/old-stuff/pages/visibility/visibility.component.scss
similarity index 100%
rename from src/app/features/old-stuff/pages/visibility/visibility.component.scss
rename to mocks/old-stuff/pages/visibility/visibility.component.scss
diff --git a/src/app/features/old-stuff/pages/visibility/visibility.component.spec.ts b/mocks/old-stuff/pages/visibility/visibility.component.spec.ts
similarity index 100%
rename from src/app/features/old-stuff/pages/visibility/visibility.component.spec.ts
rename to mocks/old-stuff/pages/visibility/visibility.component.spec.ts
diff --git a/src/app/features/old-stuff/pages/visibility/visibility.component.ts b/mocks/old-stuff/pages/visibility/visibility.component.ts
similarity index 85%
rename from src/app/features/old-stuff/pages/visibility/visibility.component.ts
rename to mocks/old-stuff/pages/visibility/visibility.component.ts
index e29a8fb1..63f581f4 100644
--- a/src/app/features/old-stuff/pages/visibility/visibility.component.ts
+++ b/mocks/old-stuff/pages/visibility/visibility.component.ts
@@ -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 { PollUtilities } from '../../../../src/app/core/services/PollUtilities';
import { ConfigService } from '../../services/config.service';
import { BaseComponent } from '../example/base-page/base.component';
diff --git a/src/app/features/old-stuff/pages/voting/choices-list/choices-list.component.html b/mocks/old-stuff/pages/voting/choices-list/choices-list.component.html
similarity index 100%
rename from src/app/features/old-stuff/pages/voting/choices-list/choices-list.component.html
rename to mocks/old-stuff/pages/voting/choices-list/choices-list.component.html
diff --git a/src/app/features/old-stuff/pages/voting/choices-list/choices-list.component.scss b/mocks/old-stuff/pages/voting/choices-list/choices-list.component.scss
similarity index 100%
rename from src/app/features/old-stuff/pages/voting/choices-list/choices-list.component.scss
rename to mocks/old-stuff/pages/voting/choices-list/choices-list.component.scss
diff --git a/src/app/features/old-stuff/pages/voting/choices-list/choices-list.component.spec.ts b/mocks/old-stuff/pages/voting/choices-list/choices-list.component.spec.ts
similarity index 100%
rename from src/app/features/old-stuff/pages/voting/choices-list/choices-list.component.spec.ts
rename to mocks/old-stuff/pages/voting/choices-list/choices-list.component.spec.ts
diff --git a/src/app/features/old-stuff/pages/voting/choices-list/choices-list.component.ts b/mocks/old-stuff/pages/voting/choices-list/choices-list.component.ts
similarity index 100%
rename from src/app/features/old-stuff/pages/voting/choices-list/choices-list.component.ts
rename to mocks/old-stuff/pages/voting/choices-list/choices-list.component.ts
diff --git a/src/app/features/old-stuff/pages/voting/comments-list/comments-list.component.html b/mocks/old-stuff/pages/voting/comments-list/comments-list.component.html
similarity index 100%
rename from src/app/features/old-stuff/pages/voting/comments-list/comments-list.component.html
rename to mocks/old-stuff/pages/voting/comments-list/comments-list.component.html
diff --git a/src/app/features/old-stuff/pages/voting/comments-list/comments-list.component.scss b/mocks/old-stuff/pages/voting/comments-list/comments-list.component.scss
similarity index 100%
rename from src/app/features/old-stuff/pages/voting/comments-list/comments-list.component.scss
rename to mocks/old-stuff/pages/voting/comments-list/comments-list.component.scss
diff --git a/src/app/features/old-stuff/pages/voting/comments-list/comments-list.component.spec.ts b/mocks/old-stuff/pages/voting/comments-list/comments-list.component.spec.ts
similarity index 100%
rename from src/app/features/old-stuff/pages/voting/comments-list/comments-list.component.spec.ts
rename to mocks/old-stuff/pages/voting/comments-list/comments-list.component.spec.ts
diff --git a/src/app/features/old-stuff/pages/voting/comments-list/comments-list.component.ts b/mocks/old-stuff/pages/voting/comments-list/comments-list.component.ts
similarity index 100%
rename from src/app/features/old-stuff/pages/voting/comments-list/comments-list.component.ts
rename to mocks/old-stuff/pages/voting/comments-list/comments-list.component.ts
diff --git a/src/app/features/old-stuff/pages/voting/voting-choice/voting-choice.component.html b/mocks/old-stuff/pages/voting/voting-choice/voting-choice.component.html
similarity index 100%
rename from src/app/features/old-stuff/pages/voting/voting-choice/voting-choice.component.html
rename to mocks/old-stuff/pages/voting/voting-choice/voting-choice.component.html
diff --git a/src/app/features/old-stuff/pages/voting/voting-choice/voting-choice.component.scss b/mocks/old-stuff/pages/voting/voting-choice/voting-choice.component.scss
similarity index 98%
rename from src/app/features/old-stuff/pages/voting/voting-choice/voting-choice.component.scss
rename to mocks/old-stuff/pages/voting/voting-choice/voting-choice.component.scss
index 4b2f821e..c619c0b3 100644
--- a/src/app/features/old-stuff/pages/voting/voting-choice/voting-choice.component.scss
+++ b/mocks/old-stuff/pages/voting/voting-choice/voting-choice.component.scss
@@ -5,7 +5,7 @@
// -- IMPORTS
// ----------------------------
-@import '../../../../../../styles/variables';
+@import '../../../../../src/styles/variables';
// -- VARIABLES
// ----------------------------
diff --git a/src/app/features/old-stuff/pages/voting/voting-choice/voting-choice.component.spec.ts b/mocks/old-stuff/pages/voting/voting-choice/voting-choice.component.spec.ts
similarity index 100%
rename from src/app/features/old-stuff/pages/voting/voting-choice/voting-choice.component.spec.ts
rename to mocks/old-stuff/pages/voting/voting-choice/voting-choice.component.spec.ts
diff --git a/src/app/features/old-stuff/pages/voting/voting-choice/voting-choice.component.ts b/mocks/old-stuff/pages/voting/voting-choice/voting-choice.component.ts
similarity index 100%
rename from src/app/features/old-stuff/pages/voting/voting-choice/voting-choice.component.ts
rename to mocks/old-stuff/pages/voting/voting-choice/voting-choice.component.ts
diff --git a/src/app/features/old-stuff/pages/voting/voting-comment/voting-comment.component.html b/mocks/old-stuff/pages/voting/voting-comment/voting-comment.component.html
similarity index 100%
rename from src/app/features/old-stuff/pages/voting/voting-comment/voting-comment.component.html
rename to mocks/old-stuff/pages/voting/voting-comment/voting-comment.component.html
diff --git a/src/app/features/old-stuff/pages/voting/voting-comment/voting-comment.component.scss b/mocks/old-stuff/pages/voting/voting-comment/voting-comment.component.scss
similarity index 100%
rename from src/app/features/old-stuff/pages/voting/voting-comment/voting-comment.component.scss
rename to mocks/old-stuff/pages/voting/voting-comment/voting-comment.component.scss
diff --git a/src/app/features/old-stuff/pages/voting/voting-comment/voting-comment.component.spec.ts b/mocks/old-stuff/pages/voting/voting-comment/voting-comment.component.spec.ts
similarity index 100%
rename from src/app/features/old-stuff/pages/voting/voting-comment/voting-comment.component.spec.ts
rename to mocks/old-stuff/pages/voting/voting-comment/voting-comment.component.spec.ts
diff --git a/src/app/features/old-stuff/pages/voting/voting-comment/voting-comment.component.ts b/mocks/old-stuff/pages/voting/voting-comment/voting-comment.component.ts
similarity index 100%
rename from src/app/features/old-stuff/pages/voting/voting-comment/voting-comment.component.ts
rename to mocks/old-stuff/pages/voting/voting-comment/voting-comment.component.ts
diff --git a/src/app/features/old-stuff/pages/voting/voting-graph/voting-graph.component.html b/mocks/old-stuff/pages/voting/voting-graph/voting-graph.component.html
similarity index 100%
rename from src/app/features/old-stuff/pages/voting/voting-graph/voting-graph.component.html
rename to mocks/old-stuff/pages/voting/voting-graph/voting-graph.component.html
diff --git a/src/app/features/old-stuff/pages/voting/voting-graph/voting-graph.component.scss b/mocks/old-stuff/pages/voting/voting-graph/voting-graph.component.scss
similarity index 100%
rename from src/app/features/old-stuff/pages/voting/voting-graph/voting-graph.component.scss
rename to mocks/old-stuff/pages/voting/voting-graph/voting-graph.component.scss
diff --git a/src/app/features/old-stuff/pages/voting/voting-graph/voting-graph.component.spec.ts b/mocks/old-stuff/pages/voting/voting-graph/voting-graph.component.spec.ts
similarity index 100%
rename from src/app/features/old-stuff/pages/voting/voting-graph/voting-graph.component.spec.ts
rename to mocks/old-stuff/pages/voting/voting-graph/voting-graph.component.spec.ts
diff --git a/src/app/features/old-stuff/pages/voting/voting-graph/voting-graph.component.ts b/mocks/old-stuff/pages/voting/voting-graph/voting-graph.component.ts
similarity index 100%
rename from src/app/features/old-stuff/pages/voting/voting-graph/voting-graph.component.ts
rename to mocks/old-stuff/pages/voting/voting-graph/voting-graph.component.ts
diff --git a/src/app/features/old-stuff/pages/voting/voting-navigation/voting-navigation.component.html b/mocks/old-stuff/pages/voting/voting-navigation/voting-navigation.component.html
similarity index 100%
rename from src/app/features/old-stuff/pages/voting/voting-navigation/voting-navigation.component.html
rename to mocks/old-stuff/pages/voting/voting-navigation/voting-navigation.component.html
diff --git a/src/app/features/old-stuff/pages/voting/voting-navigation/voting-navigation.component.scss b/mocks/old-stuff/pages/voting/voting-navigation/voting-navigation.component.scss
similarity index 100%
rename from src/app/features/old-stuff/pages/voting/voting-navigation/voting-navigation.component.scss
rename to mocks/old-stuff/pages/voting/voting-navigation/voting-navigation.component.scss
diff --git a/src/app/features/old-stuff/pages/voting/voting-navigation/voting-navigation.component.spec.ts b/mocks/old-stuff/pages/voting/voting-navigation/voting-navigation.component.spec.ts
similarity index 100%
rename from src/app/features/old-stuff/pages/voting/voting-navigation/voting-navigation.component.spec.ts
rename to mocks/old-stuff/pages/voting/voting-navigation/voting-navigation.component.spec.ts
diff --git a/src/app/features/old-stuff/pages/voting/voting-navigation/voting-navigation.component.ts b/mocks/old-stuff/pages/voting/voting-navigation/voting-navigation.component.ts
similarity index 100%
rename from src/app/features/old-stuff/pages/voting/voting-navigation/voting-navigation.component.ts
rename to mocks/old-stuff/pages/voting/voting-navigation/voting-navigation.component.ts
diff --git a/src/app/features/old-stuff/pages/voting/voting-summary/voting-summary.component.html b/mocks/old-stuff/pages/voting/voting-summary/voting-summary.component.html
similarity index 100%
rename from src/app/features/old-stuff/pages/voting/voting-summary/voting-summary.component.html
rename to mocks/old-stuff/pages/voting/voting-summary/voting-summary.component.html
diff --git a/src/app/features/old-stuff/pages/voting/voting-summary/voting-summary.component.scss b/mocks/old-stuff/pages/voting/voting-summary/voting-summary.component.scss
similarity index 84%
rename from src/app/features/old-stuff/pages/voting/voting-summary/voting-summary.component.scss
rename to mocks/old-stuff/pages/voting/voting-summary/voting-summary.component.scss
index df5b9f7c..8fc60aa0 100644
--- a/src/app/features/old-stuff/pages/voting/voting-summary/voting-summary.component.scss
+++ b/mocks/old-stuff/pages/voting/voting-summary/voting-summary.component.scss
@@ -1,4 +1,4 @@
-@import '../../../../../../styles/variables';
+@import '../../../../../src/styles/variables';
.person {
font-weight: 700;
diff --git a/src/app/features/old-stuff/pages/voting/voting-summary/voting-summary.component.spec.ts b/mocks/old-stuff/pages/voting/voting-summary/voting-summary.component.spec.ts
similarity index 100%
rename from src/app/features/old-stuff/pages/voting/voting-summary/voting-summary.component.spec.ts
rename to mocks/old-stuff/pages/voting/voting-summary/voting-summary.component.spec.ts
diff --git a/src/app/features/old-stuff/pages/voting/voting-summary/voting-summary.component.ts b/mocks/old-stuff/pages/voting/voting-summary/voting-summary.component.ts
similarity index 100%
rename from src/app/features/old-stuff/pages/voting/voting-summary/voting-summary.component.ts
rename to mocks/old-stuff/pages/voting/voting-summary/voting-summary.component.ts
diff --git a/src/app/features/old-stuff/pages/voting/voting.component.html b/mocks/old-stuff/pages/voting/voting.component.html
similarity index 100%
rename from src/app/features/old-stuff/pages/voting/voting.component.html
rename to mocks/old-stuff/pages/voting/voting.component.html
diff --git a/src/app/features/old-stuff/pages/voting/voting.component.scss b/mocks/old-stuff/pages/voting/voting.component.scss
similarity index 100%
rename from src/app/features/old-stuff/pages/voting/voting.component.scss
rename to mocks/old-stuff/pages/voting/voting.component.scss
diff --git a/src/app/features/old-stuff/pages/voting/voting.component.spec.ts b/mocks/old-stuff/pages/voting/voting.component.spec.ts
similarity index 100%
rename from src/app/features/old-stuff/pages/voting/voting.component.spec.ts
rename to mocks/old-stuff/pages/voting/voting.component.spec.ts
diff --git a/src/app/features/old-stuff/pages/voting/voting.component.ts b/mocks/old-stuff/pages/voting/voting.component.ts
similarity index 100%
rename from src/app/features/old-stuff/pages/voting/voting.component.ts
rename to mocks/old-stuff/pages/voting/voting.component.ts
diff --git a/src/app/features/old-stuff/services/config.service.ts b/mocks/old-stuff/services/config.service.ts
similarity index 99%
rename from src/app/features/old-stuff/services/config.service.ts
rename to mocks/old-stuff/services/config.service.ts
index 50b10d55..9e1d6434 100644
--- a/src/app/features/old-stuff/services/config.service.ts
+++ b/mocks/old-stuff/services/config.service.ts
@@ -3,10 +3,10 @@ import { Injectable } from '@angular/core';
import { Router } from '@angular/router';
import { ConfirmationService } from 'primeng/api';
-import { environment } from '../../../../environments/environment';
-import { ToastService } from '../../../core/services/toast.service';
+import { environment } from '../../../src/environments/environment';
+import { ToastService } from '../../../src/app/core/services/toast.service';
import { PollConfig } from '../config/PollConfig';
-import { PollUtilities } from '../config/PollUtilities';
+import { PollUtilities } from '../../../src/app/core/services/PollUtilities';
import { mockPoll3 } from '../mocks/mock-poll3';
import { mockSuccessVote } from '../mocks/mock-success-vote';
import { mockMyPolls } from '../mocks/mockmypolls';
diff --git a/src/app/features/old-stuff/services/progression.service.spec.ts b/mocks/old-stuff/services/progression.service.spec.ts
similarity index 100%
rename from src/app/features/old-stuff/services/progression.service.spec.ts
rename to mocks/old-stuff/services/progression.service.spec.ts
diff --git a/src/app/features/old-stuff/ui/copy-text/copy-text.component.html b/mocks/old-stuff/ui/copy-text/copy-text.component.html
similarity index 100%
rename from src/app/features/old-stuff/ui/copy-text/copy-text.component.html
rename to mocks/old-stuff/ui/copy-text/copy-text.component.html
diff --git a/src/app/features/old-stuff/ui/copy-text/copy-text.component.scss b/mocks/old-stuff/ui/copy-text/copy-text.component.scss
similarity index 100%
rename from src/app/features/old-stuff/ui/copy-text/copy-text.component.scss
rename to mocks/old-stuff/ui/copy-text/copy-text.component.scss
diff --git a/src/app/features/old-stuff/ui/copy-text/copy-text.component.spec.ts b/mocks/old-stuff/ui/copy-text/copy-text.component.spec.ts
similarity index 100%
rename from src/app/features/old-stuff/ui/copy-text/copy-text.component.spec.ts
rename to mocks/old-stuff/ui/copy-text/copy-text.component.spec.ts
diff --git a/src/app/features/old-stuff/ui/copy-text/copy-text.component.ts b/mocks/old-stuff/ui/copy-text/copy-text.component.ts
similarity index 88%
rename from src/app/features/old-stuff/ui/copy-text/copy-text.component.ts
rename to mocks/old-stuff/ui/copy-text/copy-text.component.ts
index 31c295b9..c9029eb2 100644
--- a/src/app/features/old-stuff/ui/copy-text/copy-text.component.ts
+++ b/mocks/old-stuff/ui/copy-text/copy-text.component.ts
@@ -1,7 +1,7 @@
import { Component, Input, OnInit } from '@angular/core';
import { ClipboardService } from 'ngx-clipboard';
-import { ToastService } from '../../../../core/services/toast.service';
+import { ToastService } from '../../../../src/app/core/services/toast.service';
@Component({
selector: 'app-copy-text',
diff --git a/src/app/features/old-stuff/ui/directives/resettable-input.directive.spec.ts b/mocks/old-stuff/ui/directives/resettable-input.directive.spec.ts
similarity index 100%
rename from src/app/features/old-stuff/ui/directives/resettable-input.directive.spec.ts
rename to mocks/old-stuff/ui/directives/resettable-input.directive.spec.ts
diff --git a/src/app/features/old-stuff/ui/directives/resettable-input.directive.ts b/mocks/old-stuff/ui/directives/resettable-input.directive.ts
similarity index 100%
rename from src/app/features/old-stuff/ui/directives/resettable-input.directive.ts
rename to mocks/old-stuff/ui/directives/resettable-input.directive.ts
diff --git a/src/app/features/old-stuff/ui/erasable-input/erasable-input.component.html b/mocks/old-stuff/ui/erasable-input/erasable-input.component.html
similarity index 100%
rename from src/app/features/old-stuff/ui/erasable-input/erasable-input.component.html
rename to mocks/old-stuff/ui/erasable-input/erasable-input.component.html
diff --git a/src/app/features/old-stuff/ui/erasable-input/erasable-input.component.scss b/mocks/old-stuff/ui/erasable-input/erasable-input.component.scss
similarity index 100%
rename from src/app/features/old-stuff/ui/erasable-input/erasable-input.component.scss
rename to mocks/old-stuff/ui/erasable-input/erasable-input.component.scss
diff --git a/src/app/features/old-stuff/ui/erasable-input/erasable-input.component.spec.ts b/mocks/old-stuff/ui/erasable-input/erasable-input.component.spec.ts
similarity index 100%
rename from src/app/features/old-stuff/ui/erasable-input/erasable-input.component.spec.ts
rename to mocks/old-stuff/ui/erasable-input/erasable-input.component.spec.ts
diff --git a/src/app/features/old-stuff/ui/erasable-input/erasable-input.component.ts b/mocks/old-stuff/ui/erasable-input/erasable-input.component.ts
similarity index 100%
rename from src/app/features/old-stuff/ui/erasable-input/erasable-input.component.ts
rename to mocks/old-stuff/ui/erasable-input/erasable-input.component.ts
diff --git a/src/app/features/old-stuff/ui/two-links/two-links.component.html b/mocks/old-stuff/ui/two-links/two-links.component.html
similarity index 100%
rename from src/app/features/old-stuff/ui/two-links/two-links.component.html
rename to mocks/old-stuff/ui/two-links/two-links.component.html
diff --git a/src/app/features/old-stuff/ui/two-links/two-links.component.scss b/mocks/old-stuff/ui/two-links/two-links.component.scss
similarity index 100%
rename from src/app/features/old-stuff/ui/two-links/two-links.component.scss
rename to mocks/old-stuff/ui/two-links/two-links.component.scss
diff --git a/src/app/features/old-stuff/ui/two-links/two-links.component.spec.ts b/mocks/old-stuff/ui/two-links/two-links.component.spec.ts
similarity index 100%
rename from src/app/features/old-stuff/ui/two-links/two-links.component.spec.ts
rename to mocks/old-stuff/ui/two-links/two-links.component.spec.ts
diff --git a/src/app/features/old-stuff/ui/two-links/two-links.component.ts b/mocks/old-stuff/ui/two-links/two-links.component.ts
similarity index 100%
rename from src/app/features/old-stuff/ui/two-links/two-links.component.ts
rename to mocks/old-stuff/ui/two-links/two-links.component.ts
diff --git a/src/app/core/components/footer/footer.component.html b/src/app/core/components/footer/footer.component.html
index a62e391f..fbf8ee53 100644
--- a/src/app/core/components/footer/footer.component.html
+++ b/src/app/core/components/footer/footer.component.html
@@ -26,34 +26,5 @@
canal Matrix
-
- Environnement de développement: voici des liens de démonstration issus des fixtures Doctrine de
- date-poll-api.
-
- consulter le sondage
-
- aujourdhui-ou-demain
-
-
-
-
- citron
-
-
-
-
- dessin-anime
-
-
-
- consulter le sondage
-
-
- citron
-
-
- avec son hash md5 de mot de passe intégré
-
-
diff --git a/src/app/core/components/header/header.component.html b/src/app/core/components/header/header.component.html
index 41034276..cb97f35a 100644
--- a/src/app/core/components/header/header.component.html
+++ b/src/app/core/components/header/header.component.html
@@ -46,4 +46,32 @@
menu mobile
+
+ Environnement de développement: voici des liens de démonstration issus des fixtures Doctrine de date-poll-api.
+
+ consulter le sondage
+
+ aujourdhui-ou-demain
+
+
+
+
+ citron
+
+
+
+
+ dessin-anime
+
+
+
+ consulter le sondage
+
+
+ citron
+
+
+ avec son hash md5 de mot de passe intégré
+
+
diff --git a/src/app/features/old-stuff/config/DateUtilities.ts b/src/app/core/services/DateUtilities.ts
similarity index 100%
rename from src/app/features/old-stuff/config/DateUtilities.ts
rename to src/app/core/services/DateUtilities.ts
diff --git a/src/app/features/old-stuff/config/PollUtilities.ts b/src/app/core/services/PollUtilities.ts
similarity index 94%
rename from src/app/features/old-stuff/config/PollUtilities.ts
rename to src/app/core/services/PollUtilities.ts
index 30db26cf..9e710b9e 100644
--- a/src/app/features/old-stuff/config/PollUtilities.ts
+++ b/src/app/core/services/PollUtilities.ts
@@ -1,7 +1,6 @@
import { HttpHeaders } from '@angular/common/http';
-import { PollConfig } from './PollConfig';
import { Injectable } from '@angular/core';
-import { Poll } from '../../../core/models/poll.model';
+import { Poll } from '../models/poll.model';
@Injectable({
providedIn: 'root',
diff --git a/src/app/features/administration/form/date-select/date-select.component.ts b/src/app/features/administration/form/date-select/date-select.component.ts
index 2208051f..e06eecdc 100644
--- a/src/app/features/administration/form/date-select/date-select.component.ts
+++ b/src/app/features/administration/form/date-select/date-select.component.ts
@@ -3,11 +3,16 @@ import { FormArray, FormBuilder, FormGroup, Validators } from '@angular/forms';
import { UuidService } from '../../../../core/services/uuid.service';
import { ToastService } from '../../../../core/services/toast.service';
import { PollService } from '../../../../core/services/poll.service';
-import { DateUtilities } from '../../../old-stuff/config/DateUtilities';
+import { DateUtilities } from '../../../../core/services/DateUtilities';
import { ApiService } from '../../../../core/services/api.service';
import { Router } from '@angular/router';
import { DOCUMENT } from '@angular/common';
-import { DateChoice, moreTimeOfDay, otherDefaultDates, TimeSlices } from '../../../old-stuff/config/defaultConfigs';
+import {
+ DateChoice,
+ moreTimeOfDay,
+ otherDefaultDates,
+ TimeSlices,
+} from '../../../../../../mocks/old-stuff/config/defaultConfigs';
import { CdkDragDrop, moveItemInArray, transferArrayItem } from '@angular/cdk/drag-drop';
import { TranslateService } from '@ngx-translate/core';
diff --git a/src/app/features/consultation/consultation-routing.module.ts b/src/app/features/consultation/consultation-routing.module.ts
index e09b8d72..36484ca2 100644
--- a/src/app/features/consultation/consultation-routing.module.ts
+++ b/src/app/features/consultation/consultation-routing.module.ts
@@ -5,7 +5,7 @@ import { ConsultationComponent } from './consultation.component';
const routes: Routes = [
{
- path: '/',
+ path: '',
component: ConsultationComponent,
children: [{ path: '/:hash', component: ConsultationComponent }],
},
diff --git a/src/app/features/consultation/consultation.component.ts b/src/app/features/consultation/consultation.component.ts
index ff7fefdd..7a495ecf 100644
--- a/src/app/features/consultation/consultation.component.ts
+++ b/src/app/features/consultation/consultation.component.ts
@@ -5,7 +5,7 @@ import { Poll } from '../../core/models/poll.model';
import { ModalService } from '../../core/services/modal.service';
import { PollService } from '../../core/services/poll.service';
import { DateService } from '../../core/services/date.service';
-import { PollUtilities } from '../old-stuff/config/PollUtilities';
+import { PollUtilities } from '../../core/services/PollUtilities';
import { Comment } from '../../core/models/comment.model';
import { StorageService } from '../../core/services/storage.service';
import { ApiService } from '../../core/services/api.service';
diff --git a/src/app/features/old-stuff/pages/poll/poll-display/poll-display.component.scss b/src/app/features/old-stuff/pages/poll/poll-display/poll-display.component.scss
deleted file mode 100644
index 5ab410dc..00000000
--- a/src/app/features/old-stuff/pages/poll/poll-display/poll-display.component.scss
+++ /dev/null
@@ -1 +0,0 @@
-@import '../../../../../../styles/variables';
diff --git a/src/app/routes-framadate.ts b/src/app/routes-framadate.ts
index 3b18424f..64e14374 100644
--- a/src/app/routes-framadate.ts
+++ b/src/app/routes-framadate.ts
@@ -37,10 +37,6 @@ export const routes: Routes = [
loadChildren: () => import('./features/participation/participation.module').then((m) => m.ParticipationModule),
// resolve: { poll: PollService },
},
- {
- path: 'oldstuff',
- loadChildren: () => import('./features/old-stuff/old-stuff.module').then((m) => m.OldStuffModule),
- },
{
path: 'success',
component: SuccessComponent,
From b9181b5b3fe6b7163ffefbb0bea3e70a186bee53 Mon Sep 17 00:00:00 2001
From: Tykayn
Date: Thu, 29 Apr 2021 10:45:22 +0200
Subject: [PATCH 03/18] rename utils services
---
mocks/old-stuff/pages/admin/admin.component.ts | 4 ++--
mocks/old-stuff/pages/dates/dates.component.ts | 4 ++--
mocks/old-stuff/pages/visibility/visibility.component.ts | 4 ++--
mocks/old-stuff/services/config.service.ts | 4 ++--
.../services/{DateUtilities.ts => date.utilities.service.ts} | 2 +-
.../services/{PollUtilities.ts => poll.utilities.service.ts} | 2 +-
.../administration/form/date-select/date-select.component.ts | 4 ++--
src/app/features/consultation/consultation.component.ts | 4 ++--
8 files changed, 14 insertions(+), 14 deletions(-)
rename src/app/core/services/{DateUtilities.ts => date.utilities.service.ts} (97%)
rename src/app/core/services/{PollUtilities.ts => poll.utilities.service.ts} (98%)
diff --git a/mocks/old-stuff/pages/admin/admin.component.ts b/mocks/old-stuff/pages/admin/admin.component.ts
index ba67f433..cb56c601 100644
--- a/mocks/old-stuff/pages/admin/admin.component.ts
+++ b/mocks/old-stuff/pages/admin/admin.component.ts
@@ -2,7 +2,7 @@ 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 '../../../../src/app/core/services/PollUtilities';
+import { PollUtilitiesService } from '../../../../src/app/core/services/poll.utilities.service';
import { environment } from '../../../../src/environments/environment';
@Component({
@@ -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
) {}
diff --git a/mocks/old-stuff/pages/dates/dates.component.ts b/mocks/old-stuff/pages/dates/dates.component.ts
index f78a93d9..ce9d8046 100644
--- a/mocks/old-stuff/pages/dates/dates.component.ts
+++ b/mocks/old-stuff/pages/dates/dates.component.ts
@@ -2,7 +2,7 @@ import { DOCUMENT } from '@angular/common';
import { ChangeDetectorRef, Component, Inject, OnInit } from '@angular/core';
import { ToastService } from '../../../../src/app/core/services/toast.service';
-import { DateUtilities } from '../../../../src/app/core/services/DateUtilities';
+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);
diff --git a/mocks/old-stuff/pages/visibility/visibility.component.ts b/mocks/old-stuff/pages/visibility/visibility.component.ts
index 63f581f4..6d18a1fd 100644
--- a/mocks/old-stuff/pages/visibility/visibility.component.ts
+++ b/mocks/old-stuff/pages/visibility/visibility.component.ts
@@ -2,7 +2,7 @@ import { Location } from '@angular/common';
import { Component, OnInit } from '@angular/core';
import { environment } from '../../../../src/environments/environment';
-import { PollUtilities } from '../../../../src/app/core/services/PollUtilities';
+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,7 +16,7 @@ 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);
}
diff --git a/mocks/old-stuff/services/config.service.ts b/mocks/old-stuff/services/config.service.ts
index 9e1d6434..d24f085e 100644
--- a/mocks/old-stuff/services/config.service.ts
+++ b/mocks/old-stuff/services/config.service.ts
@@ -6,7 +6,7 @@ import { ConfirmationService } from 'primeng/api';
import { environment } from '../../../src/environments/environment';
import { ToastService } from '../../../src/app/core/services/toast.service';
import { PollConfig } from '../config/PollConfig';
-import { PollUtilities } from '../../../src/app/core/services/PollUtilities';
+import { PollUtilitiesService } from '../../../src/app/core/services/poll.utilities.service';
import { mockPoll3 } from '../mocks/mock-poll3';
import { mockSuccessVote } from '../mocks/mock-success-vote';
import { mockMyPolls } from '../mocks/mockmypolls';
@@ -25,7 +25,7 @@ export class ConfigService extends PollConfig {
private http: HttpClient,
private toastService: ToastService,
private router: Router,
- private utils: PollUtilities,
+ private utils: PollUtilitiesService,
private confirmationService: ConfirmationService
) {
super();
diff --git a/src/app/core/services/DateUtilities.ts b/src/app/core/services/date.utilities.service.ts
similarity index 97%
rename from src/app/core/services/DateUtilities.ts
rename to src/app/core/services/date.utilities.service.ts
index 58cc0b2a..e33e01f2 100644
--- a/src/app/core/services/DateUtilities.ts
+++ b/src/app/core/services/date.utilities.service.ts
@@ -3,7 +3,7 @@ import { Injectable } from '@angular/core';
@Injectable({
providedIn: 'root',
})
-export class DateUtilities {
+export class DateUtilitiesService {
/**
* add some days to a date, to compute intervals
* @param days
diff --git a/src/app/core/services/PollUtilities.ts b/src/app/core/services/poll.utilities.service.ts
similarity index 98%
rename from src/app/core/services/PollUtilities.ts
rename to src/app/core/services/poll.utilities.service.ts
index 9e710b9e..e252ac91 100644
--- a/src/app/core/services/PollUtilities.ts
+++ b/src/app/core/services/poll.utilities.service.ts
@@ -5,7 +5,7 @@ import { Poll } from '../models/poll.model';
@Injectable({
providedIn: 'root',
})
-export class PollUtilities {
+export class PollUtilitiesService {
// utils functions
/**
* generate unique id to have a default url for future poll
diff --git a/src/app/features/administration/form/date-select/date-select.component.ts b/src/app/features/administration/form/date-select/date-select.component.ts
index e06eecdc..227e8839 100644
--- a/src/app/features/administration/form/date-select/date-select.component.ts
+++ b/src/app/features/administration/form/date-select/date-select.component.ts
@@ -3,7 +3,7 @@ import { FormArray, FormBuilder, FormGroup, Validators } from '@angular/forms';
import { UuidService } from '../../../../core/services/uuid.service';
import { ToastService } from '../../../../core/services/toast.service';
import { PollService } from '../../../../core/services/poll.service';
-import { DateUtilities } from '../../../../core/services/DateUtilities';
+import { DateUtilitiesService } from '../../../../core/services/date.utilities.service';
import { ApiService } from '../../../../core/services/api.service';
import { Router } from '@angular/router';
import { DOCUMENT } from '@angular/common';
@@ -43,7 +43,7 @@ export class DateSelectComponent implements OnInit {
private uuidService: UuidService,
private toastService: ToastService,
private pollService: PollService,
- public dateUtilities: DateUtilities,
+ public dateUtilities: DateUtilitiesService,
private apiService: ApiService,
private router: Router,
private translateService: TranslateService,
diff --git a/src/app/features/consultation/consultation.component.ts b/src/app/features/consultation/consultation.component.ts
index 7a495ecf..d738cc28 100644
--- a/src/app/features/consultation/consultation.component.ts
+++ b/src/app/features/consultation/consultation.component.ts
@@ -5,7 +5,7 @@ import { Poll } from '../../core/models/poll.model';
import { ModalService } from '../../core/services/modal.service';
import { PollService } from '../../core/services/poll.service';
import { DateService } from '../../core/services/date.service';
-import { PollUtilities } from '../../core/services/PollUtilities';
+import { PollUtilitiesService } from '../../core/services/poll.utilities.service';
import { Comment } from '../../core/models/comment.model';
import { StorageService } from '../../core/services/storage.service';
import { ApiService } from '../../core/services/api.service';
@@ -34,7 +34,7 @@ export class ConsultationComponent implements OnInit, OnDestroy {
constructor(
private router: Router,
- private utils: PollUtilities,
+ private utils: PollUtilitiesService,
private _Activatedroute: ActivatedRoute,
public storageService: StorageService,
public api: ApiService,
From 3a89645e66b9445e61bf67c50805b9682a538931 Mon Sep 17 00:00:00 2001
From: Tykayn
Date: Thu, 29 Apr 2021 10:56:36 +0200
Subject: [PATCH 04/18] auto send vote in dev mode
---
.../core/services/poll.utilities.service.ts | 80 ++++++++++++++++-
.../consultation/consultation.component.ts | 87 +++----------------
2 files changed, 87 insertions(+), 80 deletions(-)
diff --git a/src/app/core/services/poll.utilities.service.ts b/src/app/core/services/poll.utilities.service.ts
index e252ac91..3514cde9 100644
--- a/src/app/core/services/poll.utilities.service.ts
+++ b/src/app/core/services/poll.utilities.service.ts
@@ -1,6 +1,7 @@
import { HttpHeaders } from '@angular/common/http';
import { Injectable } from '@angular/core';
import { Poll } from '../models/poll.model';
+import { Comment } from '../models/comment.model';
@Injectable({
providedIn: 'root',
@@ -67,11 +68,84 @@ export class PollUtilitiesService {
'Access-Control-Allow-Origin': '*',
};
- const requestOptions = {
- headers: new HttpHeaders(headerDict),
+ return {
+ headers: headerDict,
body: bodyContent,
};
+ }
- return requestOptions;
+ exportCSV(poll: Poll): void {
+ let rows = [];
+ const now = new Date();
+ const headers = [
+ ['export de sondage Framadate ', poll.custom_url],
+ ['le', now.toISOString()],
+ [poll.id, poll.title, poll.custom_url, poll.creation_date],
+ ['pseudo'],
+ ];
+
+ const listOfChoices = ['choices : '];
+ poll.choices.map((choice) => {
+ listOfChoices.push(choice.name);
+ });
+ listOfChoices.push('pseudo');
+
+ poll.stacks.map((voteStack) => {
+ const voteStackInArray = [voteStack.pseudo];
+ const keysVotes = Object.keys(voteStack.votes);
+
+ keysVotes.map((id) => {
+ voteStackInArray.push(voteStack.votes[id].value ? voteStack.votes[id].value : '');
+ });
+ rows.push(voteStackInArray);
+ });
+ const headersComments = [['comments'], ['pseudo', 'text', 'creation_date']];
+ const comments = [];
+ poll.comments.map((item: Comment) => {
+ comments.push([item.pseudo, item.text, new Date(item.created_at), '\n']);
+ });
+ headers.push(listOfChoices);
+ rows = [headers, listOfChoices, rows, headersComments, comments];
+
+ const convertedCsv = rows
+ .map((elem) => {
+ console.log('elem', elem);
+ return elem
+ .map((item) => {
+ console.log('item', item);
+ if (typeof item === typeof Array) {
+ return item.join('\n');
+ }
+ return item;
+ })
+ .join('\n');
+ })
+ .join('\n');
+ console.log('rows', rows);
+ console.log('convertedCsv', convertedCsv);
+
+ const csvContent = 'data:text/csv;charset=utf-8,' + convertedCsv;
+ console.log('csvContent', csvContent);
+ const encodedUri = encodeURI(csvContent);
+ const link = document.createElement('a');
+ link.setAttribute('href', encodedUri);
+ const exportFileName =
+ (poll.urlPublic ? poll.urlPublic : this.makeSlug(poll)) + '_export_' + new Date() + '.csv';
+ link.setAttribute('download', exportFileName);
+ document.body.appendChild(link); // Required for FF
+ link.click(); // This will download the data file named "my_data.csv".
+ }
+
+ download(filename: string, text: string): void {
+ const element = document.createElement('a');
+ element.setAttribute('href', 'data:text/plain;charset=utf-8,' + encodeURIComponent(text));
+ element.setAttribute('download', filename);
+
+ element.style.display = 'none';
+ document.body.appendChild(element);
+
+ element.click();
+
+ document.body.removeChild(element);
}
}
diff --git a/src/app/features/consultation/consultation.component.ts b/src/app/features/consultation/consultation.component.ts
index d738cc28..132a061a 100644
--- a/src/app/features/consultation/consultation.component.ts
+++ b/src/app/features/consultation/consultation.component.ts
@@ -10,6 +10,7 @@ import { Comment } from '../../core/models/comment.model';
import { StorageService } from '../../core/services/storage.service';
import { ApiService } from '../../core/services/api.service';
import { Stack } from '../../core/models/stack.model';
+import { environment } from '../../../environments/environment';
@Component({
selector: 'app-consultation',
@@ -50,6 +51,10 @@ export class ConsultationComponent implements OnInit, OnDestroy {
if (newpoll) {
this.isArchived = new Date(newpoll.expiracy_date) < new Date();
this.poll.is_archived = this.isArchived;
+
+ if (!environment.production) {
+ this.addVoteStack();
+ }
}
});
@@ -83,7 +88,9 @@ export class ConsultationComponent implements OnInit, OnDestroy {
this.api.sendVoteStackOfPoll(this.poll, this.storageService.vote_stack).subscribe((resp) => {
console.log('resp', resp);
- this.api.getPollBySlug(this.poll.custom_url);
+ if (resp) {
+ this.api.getPollBySlug(this.poll.custom_url);
+ }
});
}
@@ -91,85 +98,11 @@ export class ConsultationComponent implements OnInit, OnDestroy {
* export all the poll data available to the public as a CSV single file
*/
exportCSV() {
- let rows = [];
- const now = new Date();
- const headers = [
- ['export de sondage Framadate ', this.poll.custom_url],
- ['le', now.toISOString()],
- [this.poll.id, this.poll.title, this.poll.custom_url, this.poll.creation_date],
- ['pseudo'],
- ];
-
- const listOfChoices = ['choices : '];
- this.poll.choices.map((choice) => {
- listOfChoices.push(choice.name);
- });
- listOfChoices.push('pseudo');
-
- this.poll.stacks.map((voteStack) => {
- const voteStackInArray = [voteStack.pseudo];
- const keysVotes = Object.keys(voteStack.votes);
-
- keysVotes.map((id) => {
- voteStackInArray.push(voteStack.votes[id].value ? voteStack.votes[id].value : '');
- });
- rows.push(voteStackInArray);
- });
- const headersComments = [['comments'], ['pseudo', 'text', 'creation_date']];
- const comments = [];
- this.poll.comments.map((item: Comment) => {
- comments.push([item.pseudo, item.text, new Date(item.created_at), '\n']);
- });
- headers.push(listOfChoices);
- rows = [headers, listOfChoices, rows, headersComments, comments];
-
- const convertedCsv = rows
- .map((elem) => {
- console.log('elem', elem);
- return elem
- .map((item) => {
- console.log('item', item);
- if (typeof item === typeof Array) {
- return item.join('\n');
- }
- return item;
- })
- .join('\n');
- })
- .join('\n');
- console.log('rows', rows);
- console.log('convertedCsv', convertedCsv);
-
- const csvContent = 'data:text/csv;charset=utf-8,' + convertedCsv;
- console.log('csvContent', csvContent);
- const encodedUri = encodeURI(csvContent);
- const link = document.createElement('a');
- link.setAttribute('href', encodedUri);
- const exportFileName =
- (this.poll.urlPublic ? this.poll.urlPublic : this.utils.makeSlug(this.poll)) +
- '_export_' +
- new Date() +
- '.csv';
- link.setAttribute('download', exportFileName);
- document.body.appendChild(link); // Required for FF
- link.click(); // This will download the data file named "my_data.csv".
+ this.utils.exportCSV(this.poll);
}
exportJson() {
- this.download('export_poll_' + this.pollSlug + '.json', JSON.stringify(this.poll));
- }
-
- download(filename, text) {
- const element = document.createElement('a');
- element.setAttribute('href', 'data:text/plain;charset=utf-8,' + encodeURIComponent(text));
- element.setAttribute('download', filename);
-
- element.style.display = 'none';
- document.body.appendChild(element);
-
- element.click();
-
- document.body.removeChild(element);
+ this.utils.download('export_poll_' + this.pollSlug + '.json', JSON.stringify(this.poll));
}
duplicate() {
From 31f0f19a9ae2120ac3394414e79649a44ee2de14 Mon Sep 17 00:00:00 2001
From: Tykayn
Date: Thu, 29 Apr 2021 12:49:23 +0200
Subject: [PATCH 05/18] manage mobile menu, and add poll title to page title
---
src/app/app.component.html | 2 +-
.../components/header/header.component.html | 5 +-
.../components/header/header.component.ts | 6 +-
.../navigation/navigation.component.html | 88 ++++++++++---------
.../navigation/navigation.component.ts | 5 +-
src/app/core/services/poll.service.ts | 4 +
.../consultation/consultation.component.ts | 5 +-
.../feedback/feedback.component.scss | 2 +-
src/environments/environment.prod.ts | 3 +-
src/environments/environment.ts | 3 +-
10 files changed, 71 insertions(+), 52 deletions(-)
diff --git a/src/app/app.component.html b/src/app/app.component.html
index ce833dc8..8f398fd4 100644
--- a/src/app/app.component.html
+++ b/src/app/app.component.html
@@ -1,6 +1,6 @@
-
+
diff --git a/src/app/core/components/header/header.component.html b/src/app/core/components/header/header.component.html
index cb97f35a..74d20d14 100644
--- a/src/app/core/components/header/header.component.html
+++ b/src/app/core/components/header/header.component.html
@@ -43,10 +43,11 @@
-
+
Environnement de développement: voici des liens de démonstration issus des fixtures Doctrine de date-poll-api.
consulter le sondage
diff --git a/src/app/core/components/header/header.component.ts b/src/app/core/components/header/header.component.ts
index 57146ba7..c0854c11 100644
--- a/src/app/core/components/header/header.component.ts
+++ b/src/app/core/components/header/header.component.ts
@@ -15,9 +15,9 @@ import { environment } from '../../../../environments/environment';
export class HeaderComponent implements OnInit {
public _user: Observable = this.userService.user;
public env = environment;
- @Input() public appTitle: string = 'FramaDate Funky';
- @Input() public appLogo: string;
- mobileMenuVisible = false;
+ @Input() public appTitle = environment.appTitle;
+ @Input() public appLogo = environment.appLogo;
+ mobileMenuVisible = true;
constructor(private userService: UserService) {}
diff --git a/src/app/core/components/sibebar/navigation/navigation.component.html b/src/app/core/components/sibebar/navigation/navigation.component.html
index fa4f467a..91d19652 100644
--- a/src/app/core/components/sibebar/navigation/navigation.component.html
+++ b/src/app/core/components/sibebar/navigation/navigation.component.html
@@ -5,58 +5,66 @@
- « {{ poll.slug }} »
+ « {{ poll.custom_url }} »
-
-
Modules
-
-
- Old stuff
-
-
- Administration
-
-
- Consultation
-
-
- Participation
+
-
+
Accueil
diff --git a/src/app/core/components/sibebar/navigation/navigation.component.ts b/src/app/core/components/sibebar/navigation/navigation.component.ts
index cc46e897..37884608 100644
--- a/src/app/core/components/sibebar/navigation/navigation.component.ts
+++ b/src/app/core/components/sibebar/navigation/navigation.component.ts
@@ -1,4 +1,4 @@
-import { Component, OnInit } from '@angular/core';
+import { Component, Input, OnInit } from '@angular/core';
import { Observable } from 'rxjs';
import { Poll } from '../../../models/poll.model';
@@ -13,6 +13,9 @@ import { environment } from '../../../../../environments/environment';
export class NavigationComponent implements OnInit {
public _pollsAvailables: Observable
= this.mockingService.pollsAvailables;
public devModeEnabled = !environment.production;
+ @Input() public appTitle = 'FramaDate Funky';
+ @Input() public appLogo: string;
+ public environment = environment;
constructor(private mockingService: MockingService) {}
diff --git a/src/app/core/services/poll.service.ts b/src/app/core/services/poll.service.ts
index f1ef9c65..b145f707 100644
--- a/src/app/core/services/poll.service.ts
+++ b/src/app/core/services/poll.service.ts
@@ -13,6 +13,7 @@ import { UuidService } from './uuid.service';
import { HttpClient } from '@angular/common/http';
import { environment } from '../../../environments/environment';
import { StorageService } from './storage.service';
+import { Title } from '@angular/platform-browser';
@Injectable({
providedIn: 'root',
@@ -28,6 +29,7 @@ export class PollService implements Resolve {
private storageService: StorageService,
private userService: UserService,
private uuidService: UuidService,
+ private titleService: Title,
private toastService: ToastService
) {}
@@ -74,9 +76,11 @@ export class PollService implements Resolve {
console.log('slug', slug);
if (slug) {
const poll: Poll | undefined = await this.apiService.getPollBySlug(slug);
+
console.log({ loadPollBySlugResponse: poll });
if (poll) {
this.updateCurrentPoll(poll);
+ this.titleService.setTitle(`☑️ ${poll.title} - ${environment.appTitle}`);
} else {
this.toastService.display(`sondage ${slug} non trouvé`);
}
diff --git a/src/app/features/consultation/consultation.component.ts b/src/app/features/consultation/consultation.component.ts
index 132a061a..3ae752ba 100644
--- a/src/app/features/consultation/consultation.component.ts
+++ b/src/app/features/consultation/consultation.component.ts
@@ -11,6 +11,7 @@ import { StorageService } from '../../core/services/storage.service';
import { ApiService } from '../../core/services/api.service';
import { Stack } from '../../core/models/stack.model';
import { environment } from '../../../environments/environment';
+import { Title } from '@angular/platform-browser';
@Component({
selector: 'app-consultation',
@@ -62,7 +63,7 @@ export class ConsultationComponent implements OnInit, OnDestroy {
console.log('params', params);
this.pollSlug = params.get('slug');
this.passHash = params.get('hash');
- console.log('hash, slug', this.passHash, this.pollSlug);
+
if (this.passHash) {
this.pollService.loadPollBySlugWithPasswordHash(this.pollSlug, this.passHash);
} else {
@@ -86,7 +87,7 @@ export class ConsultationComponent implements OnInit, OnDestroy {
addVoteStack() {
this.api.sendVoteStackOfPoll(this.poll, this.storageService.vote_stack).subscribe((resp) => {
- console.log('resp', resp);
+ console.log('sendVoteStackOfPoll resp', resp);
if (resp) {
this.api.getPollBySlug(this.poll.custom_url);
diff --git a/src/app/shared/components/feedback/feedback.component.scss b/src/app/shared/components/feedback/feedback.component.scss
index b5963fdb..c7b6c2f5 100644
--- a/src/app/shared/components/feedback/feedback.component.scss
+++ b/src/app/shared/components/feedback/feedback.component.scss
@@ -1,6 +1,6 @@
:host {
position: fixed;
- bottom: 1em;
+ bottom: 4em;
right: 1em;
color: white;
.feedback-choices {
diff --git a/src/environments/environment.prod.ts b/src/environments/environment.prod.ts
index 77223ef5..5e832bca 100644
--- a/src/environments/environment.prod.ts
+++ b/src/environments/environment.prod.ts
@@ -3,7 +3,7 @@ const backendApiUrlsInDev = {
remote: 'https://framadate-api.cipherbliss.com/api/v1',
};
const apiV1 = {
- baseHref: 'http://localhost:8000/api/v1',
+ baseHref: 'https://framadate-api.cipherbliss.com/api/v1',
api_new_poll: '/poll/',
api_get_poll: '/poll/{id}',
'api_test-mail-poll': '/api/v1/poll/mail/test-mail-poll/{emailChoice}',
@@ -12,6 +12,7 @@ const apiV1 = {
export const environment = {
production: true,
+ display_routes: true,
autofill: true,
appTitle: 'FramaDate Funky',
appVersion: '2.1.0',
diff --git a/src/environments/environment.ts b/src/environments/environment.ts
index b0fcef5a..c483393a 100644
--- a/src/environments/environment.ts
+++ b/src/environments/environment.ts
@@ -18,7 +18,8 @@ const apiV1 = {
};
export const environment = {
- production: false,
+ production: true,
+ display_routes: true,
autofill: true,
appTitle: 'FramaDate Funky',
appVersion: '2.1.0',
From 78a88d3163f73a161649a0ed17d4038f458d5bcc Mon Sep 17 00:00:00 2001
From: Tykayn
Date: Thu, 29 Apr 2021 12:56:48 +0200
Subject: [PATCH 06/18] nav disable default show
---
.../components/sibebar/navigation/navigation.component.html | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/app/core/components/sibebar/navigation/navigation.component.html b/src/app/core/components/sibebar/navigation/navigation.component.html
index 91d19652..98404d74 100644
--- a/src/app/core/components/sibebar/navigation/navigation.component.html
+++ b/src/app/core/components/sibebar/navigation/navigation.component.html
@@ -64,7 +64,7 @@
-
+
Accueil
From 69f8eac147f413a1f7bbb9c2d2b12b6526e63419 Mon Sep 17 00:00:00 2001
From: Tykayn
Date: Thu, 29 Apr 2021 16:12:56 +0200
Subject: [PATCH 07/18] nav items for demos in mobile menu
---
.../components/header/header.component.html | 59 +++++----
.../components/header/header.component.ts | 2 +-
.../navigation/navigation.component.html | 124 ++++++++----------
.../navigation/navigation.component.scss | 4 +
4 files changed, 97 insertions(+), 92 deletions(-)
diff --git a/src/app/core/components/header/header.component.html b/src/app/core/components/header/header.component.html
index 74d20d14..24188ab8 100644
--- a/src/app/core/components/header/header.component.html
+++ b/src/app/core/components/header/header.component.html
@@ -49,30 +49,41 @@
Environnement de développement: voici des liens de démonstration issus des fixtures Doctrine de date-poll-api.
-
- consulter le sondage
-
- aujourdhui-ou-demain
-
-
-
-
- citron
-
-
-
-
- dessin-anime
-
-
-
- consulter le sondage
+
diff --git a/src/app/core/components/header/header.component.ts b/src/app/core/components/header/header.component.ts
index c0854c11..f2b56dd6 100644
--- a/src/app/core/components/header/header.component.ts
+++ b/src/app/core/components/header/header.component.ts
@@ -17,7 +17,7 @@ export class HeaderComponent implements OnInit {
public env = environment;
@Input() public appTitle = environment.appTitle;
@Input() public appLogo = environment.appLogo;
- mobileMenuVisible = true;
+ mobileMenuVisible = false;
constructor(private userService: UserService) {}
diff --git a/src/app/core/components/sibebar/navigation/navigation.component.html b/src/app/core/components/sibebar/navigation/navigation.component.html
index 98404d74..2ee6ea2d 100644
--- a/src/app/core/components/sibebar/navigation/navigation.component.html
+++ b/src/app/core/components/sibebar/navigation/navigation.component.html
@@ -1,70 +1,60 @@
-
-
-
-
-
-
-
-
Modules
-
-
-
-
- « tester une page 404 »
-
-
-
- consulter le sondage
-
- aujourdhui-ou-demain
-
-
-
-
- citron
-
- sans pass
-
-
-
- dessin-anime
-
-
-
-
- citron
-
-
- avec son hash md5 de mot de passe intégré
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Accueil
+
+ {{ 'creation.title' | translate }}
+
+
diff --git a/src/app/core/components/sibebar/navigation/navigation.component.scss b/src/app/core/components/sibebar/navigation/navigation.component.scss
index e69de29b..f3234026 100644
--- a/src/app/core/components/sibebar/navigation/navigation.component.scss
+++ b/src/app/core/components/sibebar/navigation/navigation.component.scss
@@ -0,0 +1,4 @@
+em {
+ margin-left: 1ch;
+ margin-right: 1ch;
+}
From 9e4d5187b523891568387526e1a7cc749d6a5a44 Mon Sep 17 00:00:00 2001
From: Tykayn
Date: Thu, 29 Apr 2021 16:17:35 +0200
Subject: [PATCH 08/18] change icons for answer
---
src/assets/img/buddy/icon_voter_MAYBE.svg | 10 ++++++++++
src/assets/img/buddy/icon_voter_NO.svg | 3 +++
src/assets/img/buddy/icon_voter_YES.svg | 9 +++++++++
src/assets/img/check-2.svg | 6 ------
src/assets/img/check.svg | 3 ---
src/assets/img/croix.svg | 3 ---
src/assets/img/icon_voter_MAYBE.svg | 12 ++++--------
src/assets/img/icon_voter_NO.svg | 2 +-
src/assets/img/icon_voter_YES.svg | 10 ++--------
9 files changed, 29 insertions(+), 29 deletions(-)
create mode 100644 src/assets/img/buddy/icon_voter_MAYBE.svg
create mode 100644 src/assets/img/buddy/icon_voter_NO.svg
create mode 100644 src/assets/img/buddy/icon_voter_YES.svg
delete mode 100644 src/assets/img/check-2.svg
delete mode 100644 src/assets/img/check.svg
delete mode 100644 src/assets/img/croix.svg
diff --git a/src/assets/img/buddy/icon_voter_MAYBE.svg b/src/assets/img/buddy/icon_voter_MAYBE.svg
new file mode 100644
index 00000000..f8d8ade1
--- /dev/null
+++ b/src/assets/img/buddy/icon_voter_MAYBE.svg
@@ -0,0 +1,10 @@
+
+
+
+
+
+
+
+
+
+
diff --git a/src/assets/img/buddy/icon_voter_NO.svg b/src/assets/img/buddy/icon_voter_NO.svg
new file mode 100644
index 00000000..4c9e3c03
--- /dev/null
+++ b/src/assets/img/buddy/icon_voter_NO.svg
@@ -0,0 +1,3 @@
+
+
+
diff --git a/src/assets/img/buddy/icon_voter_YES.svg b/src/assets/img/buddy/icon_voter_YES.svg
new file mode 100644
index 00000000..3d97906e
--- /dev/null
+++ b/src/assets/img/buddy/icon_voter_YES.svg
@@ -0,0 +1,9 @@
+
+
+
+
+
+
+
+
+
diff --git a/src/assets/img/check-2.svg b/src/assets/img/check-2.svg
deleted file mode 100644
index 2fd97ed2..00000000
--- a/src/assets/img/check-2.svg
+++ /dev/null
@@ -1,6 +0,0 @@
-
-
-
-
-
-
diff --git a/src/assets/img/check.svg b/src/assets/img/check.svg
deleted file mode 100644
index 52234938..00000000
--- a/src/assets/img/check.svg
+++ /dev/null
@@ -1,3 +0,0 @@
-
-
-
diff --git a/src/assets/img/croix.svg b/src/assets/img/croix.svg
deleted file mode 100644
index 1c398859..00000000
--- a/src/assets/img/croix.svg
+++ /dev/null
@@ -1,3 +0,0 @@
-
-
-
diff --git a/src/assets/img/icon_voter_MAYBE.svg b/src/assets/img/icon_voter_MAYBE.svg
index f8d8ade1..2fd97ed2 100644
--- a/src/assets/img/icon_voter_MAYBE.svg
+++ b/src/assets/img/icon_voter_MAYBE.svg
@@ -1,10 +1,6 @@
-
-
-
-
-
-
-
-
+
+
+
+
diff --git a/src/assets/img/icon_voter_NO.svg b/src/assets/img/icon_voter_NO.svg
index 4c9e3c03..1c398859 100644
--- a/src/assets/img/icon_voter_NO.svg
+++ b/src/assets/img/icon_voter_NO.svg
@@ -1,3 +1,3 @@
-
+
diff --git a/src/assets/img/icon_voter_YES.svg b/src/assets/img/icon_voter_YES.svg
index 3d97906e..52234938 100644
--- a/src/assets/img/icon_voter_YES.svg
+++ b/src/assets/img/icon_voter_YES.svg
@@ -1,9 +1,3 @@
-
-
-
-
-
-
-
-
+
+
From 765299e1c3ae69bebfbad281592d9460ef4f9aa4 Mon Sep 17 00:00:00 2001
From: Tykayn
Date: Fri, 30 Apr 2021 09:26:54 +0200
Subject: [PATCH 09/18] toast message on error send vote stack
---
src/app/core/services/poll.service.ts | 33 -------------------
.../consultation/consultation.component.ts | 7 ++--
.../poll-results-detailed.component.html | 1 -
.../poll-results-detailed.component.ts | 9 +----
4 files changed, 5 insertions(+), 45 deletions(-)
diff --git a/src/app/core/services/poll.service.ts b/src/app/core/services/poll.service.ts
index b145f707..94302300 100644
--- a/src/app/core/services/poll.service.ts
+++ b/src/app/core/services/poll.service.ts
@@ -171,39 +171,6 @@ export class PollService implements Resolve {
this.toastService.display('Les commentaires de ce sondage ont été supprimés.');
}
- public buildAnswersByChoiceLabelByPseudo(poll: Poll): Map> {
- const pseudos: Set = new Set();
- poll.choices.forEach((choice: Choice) => {
- // choice.voters.forEach((users: Set) => {
- // users.forEach((user: Owner) => {
- // pseudos.add(user.pseudo);
- // });
- // });
- });
-
- const list = new Map>();
- pseudos.forEach((pseudo: string) => {
- list.set(
- pseudo,
- new Map(
- poll.choices.map((choice: Choice) => {
- return [choice.name, undefined];
- })
- )
- );
- });
-
- poll.choices.forEach((choice: Choice) => {
- choice.participants.forEach((users: Set, answer: Answer) => {
- users.forEach((user: Owner) => {
- list.get(user.pseudo).set(choice.name, answer);
- });
- });
- });
-
- return list;
- }
-
newPollFromForm(form: any): any {
const newpoll = new Poll(
this.userService.getCurrentUser(),
diff --git a/src/app/features/consultation/consultation.component.ts b/src/app/features/consultation/consultation.component.ts
index 3ae752ba..94a19b98 100644
--- a/src/app/features/consultation/consultation.component.ts
+++ b/src/app/features/consultation/consultation.component.ts
@@ -6,12 +6,11 @@ import { ModalService } from '../../core/services/modal.service';
import { PollService } from '../../core/services/poll.service';
import { DateService } from '../../core/services/date.service';
import { PollUtilitiesService } from '../../core/services/poll.utilities.service';
-import { Comment } from '../../core/models/comment.model';
import { StorageService } from '../../core/services/storage.service';
import { ApiService } from '../../core/services/api.service';
import { Stack } from '../../core/models/stack.model';
import { environment } from '../../../environments/environment';
-import { Title } from '@angular/platform-browser';
+import { ToastService } from '../../core/services/toast.service';
@Component({
selector: 'app-consultation',
@@ -42,7 +41,7 @@ export class ConsultationComponent implements OnInit, OnDestroy {
public api: ApiService,
public pollService: PollService,
public dateService: DateService,
- private modalService: ModalService
+ public toastService: ToastService
) {}
ngOnInit(): void {
@@ -91,6 +90,8 @@ export class ConsultationComponent implements OnInit, OnDestroy {
if (resp) {
this.api.getPollBySlug(this.poll.custom_url);
+ } else {
+ this.toastService.display('erreur à la réception du nouveau vote', 'error');
}
});
}
diff --git a/src/app/features/consultation/poll-results-detailed/poll-results-detailed.component.html b/src/app/features/consultation/poll-results-detailed/poll-results-detailed.component.html
index 44e6e7fb..8468857a 100644
--- a/src/app/features/consultation/poll-results-detailed/poll-results-detailed.component.html
+++ b/src/app/features/consultation/poll-results-detailed/poll-results-detailed.component.html
@@ -19,7 +19,6 @@
Score
-
{{ choice.score }}
diff --git a/src/app/features/consultation/poll-results-detailed/poll-results-detailed.component.ts b/src/app/features/consultation/poll-results-detailed/poll-results-detailed.component.ts
index e88994bd..556c2df3 100644
--- a/src/app/features/consultation/poll-results-detailed/poll-results-detailed.component.ts
+++ b/src/app/features/consultation/poll-results-detailed/poll-results-detailed.component.ts
@@ -9,24 +9,17 @@ import { PollService } from '../../../core/services/poll.service';
templateUrl: './poll-results-detailed.component.html',
styleUrls: ['./poll-results-detailed.component.scss'],
})
-export class PollResultsDetailedComponent implements OnInit {
+export class PollResultsDetailedComponent {
@Input() public poll: Poll;
constructor(private pollService: PollService) {}
- ngOnInit(): void {}
-
- public buildAnswersByChoiceLabelByPseudo(): Map> {
- return this.pollService.buildAnswersByChoiceLabelByPseudo(this.poll);
- }
-
stackHasVotesForChoice(stack, choice: any) {
return undefined !== stack.votes[choice];
}
getValue(stack, choice: any) {
if (this.stackHasVotesForChoice(stack, choice)) {
- console.log('stack.votes[choice.id]', stack.votes[choice]);
return stack.votes[choice].value;
}
return null;
From 585d3a215e62ee115d0bace3c5bc0c6f650c2b59 Mon Sep 17 00:00:00 2001
From: Tykayn
Date: Fri, 30 Apr 2021 10:59:46 +0200
Subject: [PATCH 10/18] creation poll style, fill DTO for creation
---
mocks/db.json | 4 +-
mocks/old-stuff/config/PollConfig.ts | 2 +-
mocks/old-stuff/old-stuff-routing.module.ts | 2 +-
.../old-stuff/pages/admin/admin.component.ts | 2 +-
.../poll-display/poll-display.component.ts | 2 +-
.../visibility/visibility.component.html | 4 +-
.../pages/visibility/visibility.component.ts | 2 +-
mocks/old-stuff/services/config.service.ts | 8 +-
src/app/app-routing.module.ts | 2 +-
src/app/core/models/poll.model.ts | 37 +----
src/app/core/services/api.service.ts | 36 +++--
src/app/core/services/poll.service.ts | 125 +++++++----------
.../core/services/poll.utilities.service.ts | 11 +-
.../base-config/base-config.component.html | 59 ++++----
.../form/base-config/base-config.component.ts | 12 +-
.../administration/form/form.component.html | 129 ++++++++++--------
.../administration/form/form.component.scss | 18 ++-
.../administration/form/form.component.ts | 35 +++--
.../kind-select/kind-select.component.html | 4 +-
.../consultation/consultation.component.html | 2 +-
.../consultation/consultation.component.ts | 23 ++--
src/app/routes-framadate.ts | 6 +-
src/environments/environment.prod.ts | 1 +
src/environments/environment.ts | 3 +-
src/styles/partials/_form-controls.scss | 4 +-
25 files changed, 268 insertions(+), 265 deletions(-)
diff --git a/mocks/db.json b/mocks/db.json
index c1bf054c..ef57cf5a 100644
--- a/mocks/db.json
+++ b/mocks/db.json
@@ -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,
diff --git a/mocks/old-stuff/config/PollConfig.ts b/mocks/old-stuff/config/PollConfig.ts
index b45b3573..99ceac24 100644
--- a/mocks/old-stuff/config/PollConfig.ts
+++ b/mocks/old-stuff/config/PollConfig.ts
@@ -54,7 +54,7 @@ export class PollConfig {
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';
diff --git a/mocks/old-stuff/old-stuff-routing.module.ts b/mocks/old-stuff/old-stuff-routing.module.ts
index 8a84fe53..a51f91e5 100644
--- a/mocks/old-stuff/old-stuff-routing.module.ts
+++ b/mocks/old-stuff/old-stuff-routing.module.ts
@@ -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 },
];
diff --git a/mocks/old-stuff/pages/admin/admin.component.ts b/mocks/old-stuff/pages/admin/admin.component.ts
index cb56c601..5e0c1fd3 100644
--- a/mocks/old-stuff/pages/admin/admin.component.ts
+++ b/mocks/old-stuff/pages/admin/admin.component.ts
@@ -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 });
diff --git a/mocks/old-stuff/pages/poll/poll-display/poll-display.component.ts b/mocks/old-stuff/pages/poll/poll-display/poll-display.component.ts
index 768b8686..61a98bbe 100644
--- a/mocks/old-stuff/pages/poll/poll-display/poll-display.component.ts
+++ b/mocks/old-stuff/pages/poll/poll-display/poll-display.component.ts
@@ -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;
diff --git a/mocks/old-stuff/pages/visibility/visibility.component.html b/mocks/old-stuff/pages/visibility/visibility.component.html
index 1244f37e..d57e4f74 100644
--- a/mocks/old-stuff/pages/visibility/visibility.component.html
+++ b/mocks/old-stuff/pages/visibility/visibility.component.html
@@ -102,8 +102,8 @@
{{ 'visibility.access_instructions' | translate }}
diff --git a/mocks/old-stuff/pages/visibility/visibility.component.ts b/mocks/old-stuff/pages/visibility/visibility.component.ts
index 6d18a1fd..c2996329 100644
--- a/mocks/old-stuff/pages/visibility/visibility.component.ts
+++ b/mocks/old-stuff/pages/visibility/visibility.component.ts
@@ -21,7 +21,7 @@ export class VisibilityComponent extends BaseComponent implements OnInit {
}
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()
diff --git a/mocks/old-stuff/services/config.service.ts b/mocks/old-stuff/services/config.service.ts
index d24f085e..fe22909f 100644
--- a/mocks/old-stuff/services/config.service.ts
+++ b/mocks/old-stuff/services/config.service.ts
@@ -97,12 +97,12 @@ export class ConfigService extends PollConfig {
// TODO: http requests moved to apiService
this.customUrlIsUnique = null;
if (!slug) {
- slug = 'un slug';
+ slug = 'un custom_url';
}
this.loading = true;
// TODO
- this.todo('check slug is unique');
+ this.todo('check custom_url is unique');
this.http
.get(`${this.apiBaseHref}/check-slug-is-uniq/${slug}`, this.utils.makeHeaders({ slug: this.customUrl }))
.subscribe(
@@ -163,7 +163,7 @@ export class ConfigService extends PollConfig {
}
/**
- * get one poll by its slug choice_label
+ * get one poll by its custom_url choice_label
* @param url
*/
getPollByURL(url: string) {
@@ -219,7 +219,7 @@ export class ConfigService extends PollConfig {
this.pollId = res.poll.id;
this.owner_modifier_token = res.owner_modifier_token;
this.urlPublic = this.apiBaseHref + '/vote/poll/id/' + res.poll.id;
- this.urlSlugPublic = this.apiBaseHref + '/vote/poll/slug/' + res.poll.id;
+ this.urlSlugPublic = this.apiBaseHref + '/vote/poll/custom_url/' + res.poll.id;
if (res.poll.customUrl) {
this.urlSlugPublic = this.apiBaseHref + '/vote/poll/id/' + res.poll.customUrl;
}
diff --git a/src/app/app-routing.module.ts b/src/app/app-routing.module.ts
index 4a0e9f19..f347c701 100644
--- a/src/app/app-routing.module.ts
+++ b/src/app/app-routing.module.ts
@@ -3,7 +3,7 @@ import { RouterModule } from '@angular/router';
import { routes } from './routes-framadate';
@NgModule({
- imports: [RouterModule.forRoot(routes, { useHash: true })],
+ imports: [RouterModule.forRoot(routes)],
exports: [RouterModule],
})
export class AppRoutingModule {}
diff --git a/src/app/core/models/poll.model.ts b/src/app/core/models/poll.model.ts
index cab6ce48..a9fc1241 100644
--- a/src/app/core/models/poll.model.ts
+++ b/src/app/core/models/poll.model.ts
@@ -10,14 +10,10 @@ export class Poll {
public default_expiracy_days_from_now = 60;
- public title = 'mon titre';
-
public kind: string;
public description?: string;
- public custom_url?: string;
-
public expiracy_date?: string;
public creation_date?: string;
@@ -49,40 +45,13 @@ export class Poll {
public dateChoices: Choice[] = [];
// sets of days as strings, config to set identical time for days in a special days poll
public timeChoices: Choice[] = []; // ranges of time expressed as strings
- constructor(public owner: Owner = new Owner(), public urlPublic: string = '', public slug: string = '') {}
-
- public static adaptFromLocalJsonServer(
- item: Pick
- ): Poll {
- return new Poll(
- new Owner(item.owner.pseudo, item.owner.email, undefined),
- ''
- // item.slug,
- // item.title,
- // item.description
- // item.configuration,
- // item.comments
- // .map(
- // (c: Pick) =>
- // new Comment(c.author, c.content, new Date(c.dateCreated))
- // )
- // .sort(Comment.sortChronologically),
- // item.choices.map((c: Pick) => {
- // const choice = new Choice(c.label, c.url, new Map(c.participants));
- // choice.participants.forEach((value, key) => {
- // choice.participants.set(key, new Set(value));
- // });
- // choice.updateCounts();
- // return choice;
- // })
- );
- }
+ constructor(public owner: Owner = new Owner(), public title = 'mon titre', public custom_url: string = '') {}
public getAdministrationUrl(): string {
- return `${environment.api.baseHref}/administration/polls/${this.slug}`;
+ return `${environment.api.baseHref}/administration/polls/${this.custom_url}`;
}
public getParticipationUrl(): string {
- return `${environment.api.baseHref}/participation/polls/${this.slug}`;
+ return `${environment.api.baseHref}/participation/polls/${this.custom_url}`;
}
}
diff --git a/src/app/core/services/api.service.ts b/src/app/core/services/api.service.ts
index b80e686f..73dc252b 100644
--- a/src/app/core/services/api.service.ts
+++ b/src/app/core/services/api.service.ts
@@ -116,7 +116,7 @@ export class ApiService {
* @param poll
* @param vote_stack
*/
- public sendVoteStackOfPoll(poll: Poll, vote_stack: Stack): Observable {
+ public sendNewVoteStackOfPoll(poll: Poll, vote_stack: Stack): Observable {
// api_new_vote_stack POST ANY ANY /api/v1/poll/{id}/answer
console.log('vote_stack', vote_stack);
@@ -181,7 +181,7 @@ export class ApiService {
}
}
- public async getPollBySlug(slug: string): Promise {
+ public async getPollByCustomUrl(slug: string): Promise {
try {
// TODO: this interceptor should be avoided if backends returns the good object
const adapterInterceptor: number = this.axiosInstance.interceptors.response.use(
@@ -192,7 +192,7 @@ export class ApiService {
);
const response: AxiosResponse = await this.axiosInstance.get(`${this.pollsEndpoint}/${slug}`);
- console.log('fetch API : asking for poll with slug=' + slug, { response });
+ console.log('fetch API : asking for poll with custom_url=' + slug, { response });
axios.interceptors.request.eject(adapterInterceptor);
@@ -206,12 +206,12 @@ export class ApiService {
}
}
- public async getPollBySlugWithHash(slug: string, hash: string): Promise {
+ public async getPollByCustomUrlWithHash(slug: string, hash: string): Promise {
try {
const response: AxiosResponse = await this.axiosInstance.get(
`${this.pollsEndpoint}/${slug}/pass/${hash}`
);
- console.log('fetch API : asking for poll with slug=' + slug, { response });
+ console.log('fetch API : asking for poll with custom_url=' + slug, { response });
return response && response.data && !Array.isArray(response.data) ? response.data : undefined;
} catch (error) {
@@ -225,7 +225,7 @@ export class ApiService {
public async getSlug(slug: string): Promise {
try {
- // TODO: scenario should be : if we can get this slug, it exists. if not, it doesn't. It's just a GET.
+ // TODO: scenario should be : if we can get this custom_url, it exists. if not, it doesn't. It's just a GET.
const response: AxiosResponse = await this.axiosInstance.get(
`${this.pollsEndpoint}${this.slugsEndpoint}/${slug}`
);
@@ -244,12 +244,9 @@ export class ApiService {
////////////
// UPDATE //
- public async sendEmailToUserOfItsPollsList(email: string): Promise {
- // If user is not authenticated: the list of polls is send to user's email by the backend.
+ public async sendUpdateVoteStack(vote_stack: Stack) {
try {
- await this.axiosInstance.get(
- `${this.usersEndpoint}/${email}${this.usersPollsEndpoint}${this.usersPollsSendEmailEndpoint}`
- );
+ return await this.axiosInstance.patch(`${this.baseHref}/vote_stack/${vote_stack.id}`, vote_stack);
} catch (error) {
ApiService.handleError(error);
}
@@ -295,9 +292,6 @@ export class ApiService {
}
}
- /////////////////////
- // PRIVATE METHODS //
-
public async deletePollAnswers(slug: string): Promise {
try {
const response: AxiosResponse = await this.axiosInstance.delete(
@@ -319,4 +313,18 @@ export class ApiService {
ApiService.handleError(error);
}
}
+ /////////////////////
+ // PRIVATE METHODS //
+ /////////////////////
+
+ public async sendEmailToUserOfItsPollsList(email: string): Promise {
+ // If user is not authenticated: the list of polls is send to user's email by the backend.
+ try {
+ await this.axiosInstance.get(
+ `${this.usersEndpoint}/${email}${this.usersPollsEndpoint}${this.usersPollsSendEmailEndpoint}`
+ );
+ } catch (error) {
+ ApiService.handleError(error);
+ }
+ }
}
diff --git a/src/app/core/services/poll.service.ts b/src/app/core/services/poll.service.ts
index 94302300..3a717d84 100644
--- a/src/app/core/services/poll.service.ts
+++ b/src/app/core/services/poll.service.ts
@@ -40,15 +40,19 @@ export class PollService implements Resolve {
*/
public async resolve(route: ActivatedRouteSnapshot, state: RouterStateSnapshot): Promise {
const segments: string[] = state.url.split('/');
- const wantedSlug: string = segments.includes('poll') ? segments[segments.indexOf('poll') + 1] : '';
- if (!wantedSlug && state.url.includes('administration')) {
+ const wantedcustom_url: string = segments.includes('poll') ? segments[segments.indexOf('poll') + 1] : '';
+ if (!wantedcustom_url && state.url.includes('administration')) {
// creation of new poll
const poll = new Poll(this.userService.getCurrentUser(), this.uuidService.getUUID(), '');
this._poll.next(poll);
- this.router.navigate(['poll/' + poll.slug + '/administration']);
+ this.router.navigate(['poll/' + poll.custom_url + '/administration']);
}
- if (!this._poll.getValue() || !this._poll.getValue().slug || this._poll.getValue().slug !== wantedSlug) {
- await this.loadPollBySlug(wantedSlug);
+ if (
+ !this._poll.getValue() ||
+ !this._poll.getValue().custom_url ||
+ this._poll.getValue().custom_url !== wantedcustom_url
+ ) {
+ await this.loadPollBycustom_url(wantedcustom_url);
}
if (this._poll.getValue()) {
return this._poll.getValue();
@@ -72,25 +76,25 @@ export class PollService implements Resolve {
}
}
- public async loadPollBySlug(slug: string): Promise {
- console.log('slug', slug);
- if (slug) {
- const poll: Poll | undefined = await this.apiService.getPollBySlug(slug);
+ public async loadPollBycustom_url(custom_url: string): Promise {
+ console.log('custom_url', custom_url);
+ if (custom_url) {
+ const poll: Poll | undefined = await this.apiService.getPollByCustomUrl(custom_url);
- console.log({ loadPollBySlugResponse: poll });
+ console.log({ loadPollBycustom_urlResponse: poll });
if (poll) {
this.updateCurrentPoll(poll);
this.titleService.setTitle(`☑️ ${poll.title} - ${environment.appTitle}`);
} else {
- this.toastService.display(`sondage ${slug} non trouvé`);
+ this.toastService.display(`sondage ${custom_url} non trouvé`);
}
}
}
- public async loadPollBySlugWithPasswordHash(slug: string, hash: string): Promise {
- console.log('slug', slug);
- if (slug) {
- const poll: Poll | undefined = await this.apiService.getPollBySlugWithHash(slug, hash);
- console.log({ loadPollBySlugResponse: poll });
+ public async loadPollBycustom_urlWithPasswordHash(custom_url: string, hash: string): Promise {
+ console.log('custom_url', custom_url);
+ if (custom_url) {
+ const poll: Poll | undefined = await this.apiService.getPollByCustomUrlWithHash(custom_url, hash);
+ console.log({ loadPollBycustom_urlResponse: poll });
this.updateCurrentPoll(poll);
}
}
@@ -98,15 +102,17 @@ export class PollService implements Resolve {
public updateCurrentPoll(poll: Poll): void {
this.storageService.setChoicesForVoteStack(poll.choices);
+ this.toastService.display('sondage bien mis à jour', 'success');
+
console.log('poll', poll);
this._poll.next(poll);
}
/**
- * make a uniq slug for the current poll creation
+ * make a uniq custom_url for the current poll creation
* @param config
*/
- makeSlug(config: Poll): string {
+ makecustom_url(config: Poll): string {
console.log('config', config);
let str = '';
str =
@@ -152,80 +158,45 @@ export class PollService implements Resolve {
const currentPoll = this._poll.getValue();
currentPoll.choices.find((c) => c.name === choice.name)?.updateParticipation(user, response);
this.updateCurrentPoll(currentPoll);
- this.apiService.createParticipation(currentPoll.slug, choice.name, user.pseudo, response);
+ this.apiService.createParticipation(currentPoll.custom_url, choice.name, user.pseudo, response);
this.toastService.display('Votre participation au sondage a été enregistrée.');
}
public async deleteAllAnswers(): Promise {
- await this.apiService.deletePollAnswers(this._poll.getValue().slug);
+ await this.apiService.deletePollAnswers(this._poll.getValue().custom_url);
this.toastService.display('Les participations des votants à ce sondage ont été supprimées.');
}
public async addComment(comment: string): Promise {
- await this.apiService.createComment(this._poll.getValue().slug, comment);
+ await this.apiService.createComment(this._poll.getValue().custom_url, comment);
this.toastService.display('Votre commentaire a été enregistré.');
}
public async deleteComments(): Promise {
- await this.apiService.deletePollComments(this._poll.getValue().slug);
+ await this.apiService.deletePollComments(this._poll.getValue().custom_url);
this.toastService.display('Les commentaires de ce sondage ont été supprimés.');
}
- newPollFromForm(form: any): any {
- const newpoll = new Poll(
- this.userService.getCurrentUser(),
- this.uuidService.getUUID(),
- form.controls.title.value
- );
- /**
- * convert to API version 1 config poll
- */
- const apiV1Poll = {
- menuVisible: true,
- expiracyDateDefaultInDays: newpoll.configuration.expiresDaysDelay,
- deletionDateAfterLastModification: newpoll.configuration.expiracyAfterLastModificationInDays,
- pollType: newpoll.configuration.isAboutDate ? 'dates' : 'classic', // classic or dates
- title: newpoll.title,
- description: newpoll.description,
- myName: newpoll.owner.pseudo,
- myComment: '',
- isAdmin: true, // when we create a poll, we are admin on it
- myVoteStack: {},
- myTempVoteStack: 0,
- myEmail: newpoll.owner.email,
- myPolls: [], // 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
- */
- allowSeveralHours: 'true',
- // access
- visibility: newpoll.configuration.areResultsPublic, // visible to one with the link:
- voteChoices: newpoll.configuration.isMaybeAnswerAvailable ? 'yes, maybe, no' : 'yes', // possible answers to a vote choice: only "yes", "yes, maybe, no"
- creationDate: new Date(),
- 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
- currentPoll: null, // current poll selected with createPoll or getPoll of ConfigService
- passwordAccess: newpoll.configuration.isProtectedByPassword,
- password: newpoll.configuration.password,
- customUrl: newpoll.slug, // custom slug in the url, must be unique
- customUrlIsUnique: null, // given by the backend
- urlSlugPublic: null,
- urlPublic: null,
- urlAdmin: null,
- adminKey: '', // key to change config of the poll
- owner_modifier_token: '', // key to change a vote stack
- canModifyAnswers: newpoll.configuration.isAllowingtoChangeOwnAnswers, // bool for the frontend selector
- whoCanChangeAnswers: newpoll.configuration.whoCanChangeAnswers, // everybody, self, nobody (: just admin)
- dateList: newpoll.dateChoices, // sets of days as strings, config to set identical time for days in a special days poll
- timeList: newpoll.timeChoices, // ranges of time expressed as strings
+ /**
+ * @description convert to API version 1 data transition object
+ * @param form
+ */
+ newPollFromForm(form: any): Poll {
+ const newOwner = this.storageService.vote_stack.owner;
- answers: newpoll.choices,
- // modals
- displayConfirmVoteModalAdmin: false,
- };
- console.log('apiV1Poll', apiV1Poll);
- return apiV1Poll;
+ const newpoll = new Poll(newOwner, form.value.custom_url, form.value.title);
+
+ const pollKeys = Object.keys(newpoll);
+ const formFields = Object.keys(form.value);
+
+ for (const fieldOfForm of formFields) {
+ if (pollKeys.indexOf(fieldOfForm) !== -1) {
+ newpoll[fieldOfForm] = form.value[fieldOfForm];
+ }
+ }
+ newpoll.expiracy_date = form.value.expiracy_date;
+
+ console.log('newpoll', newpoll);
+ return newpoll;
}
}
diff --git a/src/app/core/services/poll.utilities.service.ts b/src/app/core/services/poll.utilities.service.ts
index 3514cde9..0b6471fe 100644
--- a/src/app/core/services/poll.utilities.service.ts
+++ b/src/app/core/services/poll.utilities.service.ts
@@ -20,7 +20,7 @@ export class PollUtilitiesService {
}
/**
- * make a uniq slug for the current poll creation
+ * make a uniq custom_url for the current poll creation
* @param str
*/
makeSlug(config: Poll) {
@@ -37,7 +37,12 @@ export class PollUtilitiesService {
config.creatorPseudo +
'_' +
config.title;
- str = str.replace(/^\s+|\s+$/g, ''); // trim
+
+ return this.makeSlugFromString(str);
+ }
+
+ makeSlugFromString(text: string): string {
+ let str = text.replace(/^\s+|\s+$/g, ''); // trim
str = str.toLowerCase();
// remove accents, swap ñ for n, etc
@@ -130,7 +135,7 @@ export class PollUtilitiesService {
const link = document.createElement('a');
link.setAttribute('href', encodedUri);
const exportFileName =
- (poll.urlPublic ? poll.urlPublic : this.makeSlug(poll)) + '_export_' + new Date() + '.csv';
+ (poll.custom_url ? poll.custom_url : this.makeSlug(poll)) + '_export_' + new Date() + '.csv';
link.setAttribute('download', exportFileName);
document.body.appendChild(link); // Required for FF
link.click(); // This will download the data file named "my_data.csv".
diff --git a/src/app/features/administration/form/base-config/base-config.component.html b/src/app/features/administration/form/base-config/base-config.component.html
index 85decc75..2984cca1 100644
--- a/src/app/features/administration/form/base-config/base-config.component.html
+++ b/src/app/features/administration/form/base-config/base-config.component.html
@@ -4,7 +4,6 @@
{{ 'creation.choose_title' | translate }}
- slug: {{ form.value.slug }}
Titre
@@ -66,7 +69,7 @@
-
+
{{ 'choices.title' | translate }}
diff --git a/src/app/features/administration/form/base-config/base-config.component.ts b/src/app/features/administration/form/base-config/base-config.component.ts
index 8d0b4d7b..8c34ab6c 100644
--- a/src/app/features/administration/form/base-config/base-config.component.ts
+++ b/src/app/features/administration/form/base-config/base-config.component.ts
@@ -8,6 +8,7 @@ import { Router } from '@angular/router';
import { DOCUMENT } from '@angular/common';
import { Poll } from '../../../../core/models/poll.model';
import { environment } from '../../../../../environments/environment';
+import { PollUtilitiesService } from '../../../../core/services/poll.utilities.service';
@Component({
selector: 'app-base-config',
@@ -26,6 +27,7 @@ export class BaseConfigComponent {
private uuidService: UuidService,
private toastService: ToastService,
private pollService: PollService,
+ private utilitiesService: PollUtilitiesService,
private apiService: ApiService,
private router: Router,
@Inject(DOCUMENT) private document: Document
@@ -52,11 +54,11 @@ export class BaseConfigComponent {
if (this.form.valid) {
console.log('Le sondage est correctement rempli, prêt à enregistrer.');
const newpoll = this.pollService.newPollFromForm(this.form);
- // TODO : save the poll
-
this.apiService.createPoll(newpoll).then((resp) => {
console.log('resp', resp);
router.navigate(['success']);
+
+ this.toastService.display('sauvegarde du nouveau sondage réussie');
});
} else {
this.toastService.display('invalid form');
@@ -65,14 +67,14 @@ export class BaseConfigComponent {
}
public updateSlug(): void {
- const newValueFormatted = 'TODO';
+ const newValueFormatted = this.pollService.makecustom_url(this.poll);
this.form.patchValue({ slug: newValueFormatted });
}
/**
- * set the poll slug from other data of the poll
+ * set the poll custom_url from other data of the poll
*/
automaticSlug() {
- this.form.patchValue({ slug: this.pollService.makeSlug(this.form.value) });
+ this.form.patchValue({ slug: this.utilitiesService.makeUuid() });
}
}
diff --git a/src/app/features/administration/form/form.component.html b/src/app/features/administration/form/form.component.html
index 1938a652..0ab9696a 100644
--- a/src/app/features/administration/form/form.component.html
+++ b/src/app/features/administration/form/form.component.html
@@ -1,69 +1,86 @@