diff --git a/src/app/app-routing.module.ts b/src/app/app-routing.module.ts index ccd87b60..7df9717d 100644 --- a/src/app/app-routing.module.ts +++ b/src/app/app-routing.module.ts @@ -5,7 +5,7 @@ import {RouterModule, Routes} from '@angular/router'; const routes: Routes = []; @NgModule({ - imports: [RouterModule.forRoot(routes, {useHash: true})], + imports: [RouterModule.forRoot(routes, {useHash: true, anchorScrolling: 'enabled',})], exports: [RouterModule] }) export class AppRoutingModule { diff --git a/src/app/app.component.ts b/src/app/app.component.ts index cce83e93..52e5c17e 100644 --- a/src/app/app.component.ts +++ b/src/app/app.component.ts @@ -33,6 +33,7 @@ export class AppComponent { this.route.events.subscribe((event: any) => { this.scrollGoToTop(); + console.log('event', event) if (event.url) { const tab = event.url.split('/'); diff --git a/src/app/config/PollConfig.ts b/src/app/config/PollConfig.ts index 06d71694..3b3a0269 100644 --- a/src/app/config/PollConfig.ts +++ b/src/app/config/PollConfig.ts @@ -32,7 +32,7 @@ export class PollConfig { myComment: string = 'wouah trop bien framadate!'; isAdmin: boolean = true; myEmail: string = "tktest@tktest.com"; - myPolls: any;// list of retrieved polls from the backend api + myPolls: any = [];// list of retrieved polls from the backend api // date specific poll, we have the choice to setup different hours (timeList) for all possible dates (dateList), or use the same hours for all dates allowSeveralHours = 'false'; // access diff --git a/src/app/config/mocks/mock1.ts b/src/app/config/mocks/mock1.ts new file mode 100644 index 00000000..bfedb4bb --- /dev/null +++ b/src/app/config/mocks/mock1.ts @@ -0,0 +1,109 @@ +export const mockPoll1 = { + "message": "your poll config", + "data": { + "id": 1, + "title": "citron ou orange", + "customUrl": null, + "description": "votre sorbert préféré", + "creationDate": { + "date": "2020-01-22 14:28:19.000000", + "timezone_type": 3, + "timezone": "Europe/Paris" + }, + "expiracyDate": { + "date": "2020-01-22 14:28:19.000000", + "timezone_type": 3, + "timezone": "Europe/Paris" + }, + "owner": { + "__initializer__": {}, + "__cloner__": {}, + "__isInitialized__": false + }, + "kind": "text", + "allowedAnswers": [ + "yes" + ], + "modificationPolicy": "nobody", + "mailOnComment": null, + "mailOnVote": true, + "hideResults": null, + "showResultEvenIfPasswords": null, + "votes": {}, + "stacksOfVotes": {}, + "choices": {}, + "comments": {}, + "defaultExpiracyDaysFromNow": 60 + }, + "stacks_count": 2, + "stacks": [ + { + "id": 1, + "pseudo": "voting_people_TEST", + "creation_date": { + "date": "2020-01-22 14:28:19.000000", + "timezone_type": 3, + "timezone": "Europe/Paris" + }, + "votes": [ + { + "id": 1, + "vote_id": 1, + "value": "yes", + "choice_id": 1, + "text": "orange" + }, + { + "id": 1, + "vote_id": 2, + "value": "yes", + "choice_id": 2, + "text": null + } + ] + }, + { + "id": 2, + "pseudo": "voting_people_TEST", + "creation_date": { + "date": "2020-01-22 14:28:19.000000", + "timezone_type": 3, + "timezone": "Europe/Paris" + }, + "votes": [ + { + "id": 2, + "vote_id": 3, + "value": "maybe", + "choice_id": 1, + "text": "orange" + } + ] + } + ], + "choices_count": 2, + "choices": [ + { + "id": 1, + "date": { + "date": "2020-01-22 14:28:19.000000", + "timezone_type": 3, + "timezone": "Europe/Paris" + }, + "text": "orange", + "url": null + }, + { + "id": 2, + "date": { + "date": "2020-01-22 14:28:19.000000", + "timezone_type": 3, + "timezone": "Europe/Paris" + }, + "text": "citron", + "url": null + } + ], + "comments": [], + "comments_count": 0 +}; diff --git a/src/app/pages/poll-display/poll-display.component.html b/src/app/pages/poll-display/poll-display.component.html index 0794a3ba..d142edb0 100644 --- a/src/app/pages/poll-display/poll-display.component.html +++ b/src/app/pages/poll-display/poll-display.component.html @@ -146,7 +146,7 @@ (click)='config.addComment()' > + *ngFor="let c of config.currentPoll.comments " >
@@ -156,14 +156,14 @@

Pour partager le sondage, vous pouvez diffuser ce lien : - - {{config.urlPublic}} + + {{config.currentPoll.urlPublic}}