From 3c635ce4b4e0748b63a4821bbc1924cd305f6913 Mon Sep 17 00:00:00 2001 From: Thomas Citharel Date: Tue, 15 Oct 2019 17:33:02 +0200 Subject: [PATCH] Fix Cypress tests and add a different welcome message when coming from registration Signed-off-by: Thomas Citharel --- js/src/i18n/en_US.json | 4 ++-- js/src/i18n/fr_FR.json | 4 ++-- js/src/i18n/oc.json | 3 +-- js/src/views/Account/Register.vue | 1 + js/src/views/Home.vue | 20 ++++++++++++++++---- js/tests/e2e/specs/login.js | 2 +- js/tests/e2e/specs/register.js | 2 +- 7 files changed, 24 insertions(+), 12 deletions(-) diff --git a/js/src/i18n/en_US.json b/js/src/i18n/en_US.json index 514194fa3..3f782a7e9 100644 --- a/js/src/i18n/en_US.json +++ b/js/src/i18n/en_US.json @@ -159,7 +159,6 @@ "No events found": "No events found", "No group found": "No group found", "No groups found": "No groups found", - "No participants yet": "No participants yet", "No results for \"{queryText}\"": "No results for \"{queryText}\"", "Number of places": "Number of places", "OK": "OK", @@ -283,9 +282,10 @@ "We want to develop a digital common, that everyone can make their own, which respects privacy and activism by design.": "We want to develop a digital common, that everyone can make their own, which respects privacy and activism by design.", "We won’t change the world from Facebook. The tool we dream of, surveillance capitalism corporations won’t develop it, as they couldn’t profit from it. This is an opportunity to build something better, by taking another approach.": "We won’t change the world from Facebook. The tool we dream of, surveillance capitalism corporations won’t develop it, as they couldn’t profit from it. This is an opportunity to build something better, by taking another approach.", "Website / URL": "Website / URL", - "Welcome back {username}": "Welcome back {username}", + "Welcome back {username}!": "Welcome back {username}!", "Welcome back!": "Welcome back!", "Welcome on your administration panel": "Welcome on your administration panel", + "Welcome to Mobilizon, {username}!": "Welcome to Mobilizon, {username}!", "Who can view this event and participate": "Who can view this event and participate", "World map": "World map", "You and one other person are going to this event": "You're the only one going to this event | You and one other person are going to this event | You and {approved} persons are going to this event.", diff --git a/js/src/i18n/fr_FR.json b/js/src/i18n/fr_FR.json index 437afe6a1..eb5c80b9e 100644 --- a/js/src/i18n/fr_FR.json +++ b/js/src/i18n/fr_FR.json @@ -159,7 +159,6 @@ "No events found": "Aucun événement trouvé", "No group found": "Aucun groupe trouvé", "No groups found": "Aucun groupe trouvé", - "No participants yet": "Aucun⋅e participant⋅e pour le moment", "No results for \"{queryText}\"": "Pas de résultats pour « {queryText} »", "Number of places": "Nombre de places", "OK": "OK", @@ -283,9 +282,10 @@ "We want to develop a digital common, that everyone can make their own, which respects privacy and activism by design.": "Nous voulons développer un commun numérique, que tout le monde pourra s’approprier, conçu dans le respect de la vie privée et de l’action militante.", "We won’t change the world from Facebook. The tool we dream of, surveillance capitalism corporations won’t develop it, as they couldn’t profit from it. This is an opportunity to build something better, by taking another approach.": "On ne changera pas le monde depuis Facebook. L’outil dont nous rêvons, les entreprises du capitalisme de surveillance sont incapables de le produire, car elles ne sauraient pas en tirer profit. C’est l’occasion de faire mieux qu’elles, en faisant autrement.", "Website / URL": "Site web / URL", - "Welcome back {username}": "Bon retour {username}", + "Welcome back {username}!": "Bon retour {username} !", "Welcome back!": "Bon retour !", "Welcome on your administration panel": "Bienvenue sur votre espace d'administration", + "Welcome to Mobilizon, {username}!": "Bienvenue sur Mobilizon, {username} !", "Who can view this event and participate": "Qui peut voir cet événement et y participer", "World map": "Carte mondiale", "You and one other person are going to this event": "Vous êtes le ou la seule à vous rendre à cet événement | Vous et une autre personne vous rendez à cet événement | Vous et {approved} autres personnes vous rendez à cet événement.", diff --git a/js/src/i18n/oc.json b/js/src/i18n/oc.json index e4b3780d5..31e37da73 100644 --- a/js/src/i18n/oc.json +++ b/js/src/i18n/oc.json @@ -156,7 +156,6 @@ "Only accessible through link and search (private)": "Solament accessible via ligam e la recèrca (privat)", "One person is going": "Degun i va pas | Una persona i va | {approved} personas i van", "No results for \"{queryText}\"": "Cap de resultats per « {queryText} »", - "No participants yet.": "Cap de participacion pel moment.", "No groups found": "Cap de grop pas trobat", "No group found": "Cap de grop pas trobat", "No events found": "Cap d’eveniment pas trobat", @@ -210,7 +209,7 @@ "Are you sure you want to cancel your participation at event \"{title}\"?": "Volètz vertadièrament anullar vòstra participacion a l’eveniment « {title} » ?", "A validation email was sent to {email}": "Un corrièl de validat es estat enviar a {email}", "Welcome back!": "Tornatz ben aquí !", - "Welcome back {username}": "Tornatz ben {username}", + "Welcome back {username}!": "Tornatz ben {username} !", "You have one event in {days} days.": "Avètz pas cap d’eveniment d’aquí {days} jorns | Avètz un eveniment d’aquí {days} jorns. | Avètz {count} eveniments d’aquí {days} jorns", "You and one other person are going to this event": "Sètz l’unica persona a anar a aqueste eveniment | Vos e una persona mai anatz a aqueste eveniment | Vos e {approved} personas mai anatz a aqueste eveniment.", "This will delete / anonymize all content (events, comments, messages, participations…) created from this identity.": "Aquò suprimirà / far venir anonim tot lo contengut (eveniments, comentaris, messatges, participacions…) creat amb aquesta identitat.", diff --git a/js/src/views/Account/Register.vue b/js/src/views/Account/Register.vue index e8d34a0f8..d4b23a775 100644 --- a/js/src/views/Account/Register.vue +++ b/js/src/views/Account/Register.vue @@ -108,6 +108,7 @@ export default class Register extends Vue { }); if (data) { this.validationSent = true; + window.localStorage.setItem('new-registered-user', 'yes'); if (this.userAlreadyActivated) { await changeIdentity(this.$apollo.provider.defaultClient, data.registerPerson); diff --git a/js/src/views/Home.vue b/js/src/views/Home.vue index e8418764e..a73796d1a 100644 --- a/js/src/views/Home.vue +++ b/js/src/views/Home.vue @@ -25,9 +25,12 @@
-
- - {{ $t('Welcome back {username}', { username: currentActor.displayName() }) }} +
+ + {{ $t('Welcome back {username}!', { username: currentActor.displayName() }) }} + + + {{ $t('Welcome to Mobilizon, {username}!', { username: currentActor.displayName() }) }}
@@ -187,8 +190,17 @@ export default class Home extends Vue { return window.localStorage.getItem('welcome-back') === 'yes'; } + get newRegisteredUser() { + return window.localStorage.getItem('new-registered-user') === 'yes'; + } + mounted() { - window.localStorage.removeItem('welcome-back'); + if (window.localStorage.getItem('welcome-back')) { + window.localStorage.removeItem('welcome-back'); + } + if (window.localStorage.getItem('new-registered-user')) { + window.localStorage.removeItem('new-registered-user'); + } } isToday(date: Date) { diff --git a/js/tests/e2e/specs/login.js b/js/tests/e2e/specs/login.js index d7f35781d..2b99e6629 100644 --- a/js/tests/e2e/specs/login.js +++ b/js/tests/e2e/specs/login.js @@ -78,6 +78,6 @@ describe('Login', () => { cy.wait(1000); cy.get('.navbar-link span.icon i').should('have.class', 'mdi-account-circle'); - cy.contains('article.message.is-info', 'Welcome back DuplicateNot'); + cy.contains('article.message.is-info', 'Welcome to Mobilizon, DuplicateNot!'); }); }); diff --git a/js/tests/e2e/specs/register.js b/js/tests/e2e/specs/register.js index abedfd5db..f161663e7 100644 --- a/js/tests/e2e/specs/register.js +++ b/js/tests/e2e/specs/register.js @@ -66,6 +66,6 @@ describe('Registration', () => { }); cy.get('.navbar-link span.icon i').should('have.class', 'mdi-account-circle'); - cy.contains('article.message.is-info', 'Welcome back tester account'); + cy.contains('article.message.is-info', 'Welcome to Mobilizon, tester account!'); }); }); \ No newline at end of file