From 2720b6596241874df330373645952f6a53ebeb5c Mon Sep 17 00:00:00 2001 From: Baptiste Lemoine Date: Thu, 16 Jan 2020 11:33:13 +0100 Subject: [PATCH] :zap: check for uniqueness of the slug, slug the title by default --- src/app/config/PollConfig.ts | 4 +- .../visibility/visibility.component.html | 5 +- .../pages/visibility/visibility.component.ts | 24 +------ src/app/services/config.service.ts | 64 ++++++++++++++++++- src/assets/scss/atoms/_forms.scss | 2 +- 5 files changed, 71 insertions(+), 28 deletions(-) diff --git a/src/app/config/PollConfig.ts b/src/app/config/PollConfig.ts index 6a620997..102a55e5 100644 --- a/src/app/config/PollConfig.ts +++ b/src/app/config/PollConfig.ts @@ -59,12 +59,14 @@ export class PollConfig { // access visibility = 'link_only'; // visible to anyone with the link: voteChoices = 'only_yes'; // possible answers to a vote choice: only "yes", "yes, maybe, no" + creationDate = new Date(); expirationDate = ''; // expiracy date pollId = null; // id of the current poll when created. data given by the backend api selectedPoll = null; // current poll selected with createPoll or getPoll of ConfigService passwordAccess = 0; password = ''; - customUrl = ''; + customUrl = ''; // custom slug in the url, must be unique + customUrlIsUnique = null; // given by the backend urlPublic = environment.baseApiHref + '/default-url'; urlAdmin = environment.baseApiHref + '/default-url/admin/d65es45fd45sdf45sd345f312sdf31sgfd345'; canModifyAnswers = 1;// everybody, self, nobody (= just admin) diff --git a/src/app/pages/visibility/visibility.component.html b/src/app/pages/visibility/visibility.component.html index 89c9844c..314f3a9c 100644 --- a/src/app/pages/visibility/visibility.component.html +++ b/src/app/pages/visibility/visibility.component.html @@ -107,11 +107,14 @@ class="input-lg" name="url" id="url" - [value]="baseUrl+'/'+config.customUrl"> + [(ngModel)]="config.customUrl"> {{"visibility.access_instructions"|translate}} +
+ {{baseUrl + '/' + config.customUrl}} +