From 051e4d8ee469370a7ae7b68cce6a1325394b9c12 Mon Sep 17 00:00:00 2001 From: Baptiste Lemoine Date: Thu, 16 Jan 2020 10:45:56 +0100 Subject: [PATCH] :zap: reorganize poll display page and urls in config --- src/app/config/PollConfig.ts | 6 ++-- src/app/config/Routes.ts | 3 +- .../visibility/visibility.component.html | 6 ++-- .../pages/visibility/visibility.component.ts | 2 ++ src/assets/scss/atoms/_forms.scss | 33 ++++++------------- src/environments/environment.prod.ts | 1 + src/environments/environment.ts | 1 + 7 files changed, 24 insertions(+), 28 deletions(-) diff --git a/src/app/config/PollConfig.ts b/src/app/config/PollConfig.ts index 88339e4f..6a620997 100644 --- a/src/app/config/PollConfig.ts +++ b/src/app/config/PollConfig.ts @@ -1,6 +1,8 @@ /** * une option de date dans les sondages spéciaux */ +import {environment} from "../../environments/environment"; + export interface DateOption { timeList: any; literal: string; @@ -63,8 +65,8 @@ export class PollConfig { passwordAccess = 0; password = ''; customUrl = ''; - urlPublic = 'https://framadate.org/default-url'; - urlAdmin = 'https://framadate.org/default-url/admin/d65es45fd45sdf45sd345f312sdf31sgfd345'; + urlPublic = environment.baseApiHref + '/default-url'; + urlAdmin = environment.baseApiHref + '/default-url/admin/d65es45fd45sdf45sd345f312sdf31sgfd345'; canModifyAnswers = 1;// everybody, self, nobody (= just admin) whoModifiesAnswers = "self";// everybody, self, nobody (= just admin) whoCanChangeAnswers = 'everybody';// everybody, self, nobody (= just admin) diff --git a/src/app/config/Routes.ts b/src/app/config/Routes.ts index 1fe1b9ca..45deca18 100644 --- a/src/app/config/Routes.ts +++ b/src/app/config/Routes.ts @@ -15,6 +15,7 @@ import {PollDisplayComponent} from "../pages/poll-display/poll-display.component import {VotingComponent} from "../pages/voting/voting.component"; import {PasswordComponent} from "../pages/password/password.component"; + /** * each step in the form is a component */ @@ -36,8 +37,8 @@ export const Routes = {path: 'graphic/:poll', component: PollGraphicComponent}, {path: 'vote/poll/id/:poll', component: PollDisplayComponent}, {path: 'votechoice', component: VoteChoiceComponent}, - {path: '**', redirectTo: '/home', pathMatch: 'full'}, {path: 'voting', component: VotingComponent}, {path: 'step/password', component: PasswordComponent}, + {path: '**', redirectTo: '/home', pathMatch: 'full'}, ] ; diff --git a/src/app/pages/visibility/visibility.component.html b/src/app/pages/visibility/visibility.component.html index 1f2123df..89c9844c 100644 --- a/src/app/pages/visibility/visibility.component.html +++ b/src/app/pages/visibility/visibility.component.html @@ -107,7 +107,7 @@ class="input-lg" name="url" id="url" - [(ngModel)]="config.customUrl"> + [value]="baseUrl+'/'+config.customUrl"> {{"visibility.access_instructions"|translate}} @@ -139,7 +139,9 @@ min="8" *ngIf="showCustomPassword" [(ngModel)]="config.password"> - diff --git a/src/app/pages/visibility/visibility.component.ts b/src/app/pages/visibility/visibility.component.ts index cfa20022..75898128 100644 --- a/src/app/pages/visibility/visibility.component.ts +++ b/src/app/pages/visibility/visibility.component.ts @@ -1,6 +1,7 @@ import {Component, OnInit} from '@angular/core'; import {BaseComponent} from '../base-page/base.component'; import {ConfigService} from '../../services/config.service'; +import {environment} from "../../../environments/environment"; @Component({ selector: 'framadate-visibility', @@ -9,6 +10,7 @@ import {ConfigService} from '../../services/config.service'; }) export class VisibilityComponent extends BaseComponent implements OnInit { showCustomPassword = false; + baseUrl = environment.baseApiHref; constructor(public config: ConfigService) { super(config); diff --git a/src/assets/scss/atoms/_forms.scss b/src/assets/scss/atoms/_forms.scss index f39115de..5180aa05 100644 --- a/src/assets/scss/atoms/_forms.scss +++ b/src/assets/scss/atoms/_forms.scss @@ -77,22 +77,17 @@ label { } } -form { - display: flex; - margin: auto; - flex-direction: column; - align-items: center; - justify-content: flex-start; -} +input { + &:not([id]) { + color: $dusty-orange; -.popup { - display: flex; - flex-direction: column; - z-index: 2222222222; -} - -.row { - flex-direction: row; + &:before { + content: "cet input n'a pas d'attribut id, c'est mal."; + color: $violet; + display: block; + padding: 1em; + } + } } label { @@ -108,14 +103,6 @@ label { flex-wrap: wrap; } -.comment { - display: flex; -} - -.commeny span { - flex-direction: row; -} - .cname { padding-left: 17px; font-weight: bold; diff --git a/src/environments/environment.prod.ts b/src/environments/environment.prod.ts index 47e900ae..736fe13f 100644 --- a/src/environments/environment.prod.ts +++ b/src/environments/environment.prod.ts @@ -1,4 +1,5 @@ export const environment = { production: true, + baseHref: "https://framadate-api.cipherbliss.com/", baseApiHref: 'https://framadate-api.cipherbliss.com/api/v1' }; diff --git a/src/environments/environment.ts b/src/environments/environment.ts index 0ab15255..fc436014 100644 --- a/src/environments/environment.ts +++ b/src/environments/environment.ts @@ -4,6 +4,7 @@ export const environment = { production: false, + baseHref: "https://framadate-api.cipherbliss.com/", baseApiHref: "https://framadate-api.cipherbliss.com/api/v1" // baseApiHref: "http://localhost:8000/api/v1" };