Fix Cypress tests and add a different welcome message when coming from

registration

Signed-off-by: Thomas Citharel <tcit@tcit.fr>
This commit is contained in:
Thomas Citharel 2019-10-15 17:33:02 +02:00
parent 5ebbb57d0e
commit 3c635ce4b4
No known key found for this signature in database
GPG key ID: A061B9DDE0CA0773
7 changed files with 24 additions and 12 deletions

View file

@ -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 <b>digital common</b>, that everyone can make their own, which respects <b>privacy and activism by design</b>.": "We want to develop a <b>digital common</b>, that everyone can make their own, which respects <b>privacy and activism by design</b>.",
"We wont change the world from Facebook. The tool we dream of, surveillance capitalism corporations wont develop it, as they couldnt profit from it. This is an opportunity to build something better, by taking another approach.": "We wont change the world from Facebook. The tool we dream of, surveillance capitalism corporations wont develop it, as they couldnt 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.",

View file

@ -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 <b>digital common</b>, that everyone can make their own, which respects <b>privacy and activism by design</b>.": "Nous voulons développer un <b>commun numérique</b>, que tout le monde pourra sapproprier, conçu dans <b>le respect de la vie privée et de laction militante</b>.",
"We wont change the world from Facebook. The tool we dream of, surveillance capitalism corporations wont develop it, as they couldnt profit from it. This is an opportunity to build something better, by taking another approach.": "On ne changera pas le monde depuis Facebook. Loutil dont nous rêvons, les entreprises du capitalisme de surveillance sont incapables de le produire, car elles ne sauraient pas en tirer profit. Cest loccasion de faire mieux quelles, 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.",

View file

@ -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 deveniment 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 leveniment « {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 deveniment daquí {days} jorns | Avètz un eveniment daquí {days} jorns. | Avètz {count} eveniments daquí {days} jorns",
"You and one other person are going to this event": "Sètz lunica 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.",

View file

@ -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);

View file

@ -25,9 +25,12 @@
</div>
</section>
<div class="container" v-if="config">
<section v-if="currentActor.id && welcomeBack">
<b-message type="is-info">
{{ $t('Welcome back {username}', { username: currentActor.displayName() }) }}
<section v-if="currentActor.id">
<b-message type="is-info" v-if="welcomeBack">
{{ $t('Welcome back {username}!', { username: currentActor.displayName() }) }}
</b-message>
<b-message type="is-info" v-if="newRegisteredUser">
{{ $t('Welcome to Mobilizon, {username}!', { username: currentActor.displayName() }) }}
</b-message>
</section>
<section v-if="currentActor.id && goingToEvents.size > 0" class="container">
@ -187,9 +190,18 @@ export default class Home extends Vue {
return window.localStorage.getItem('welcome-back') === 'yes';
}
get newRegisteredUser() {
return window.localStorage.getItem('new-registered-user') === 'yes';
}
mounted() {
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) {
return (new Date(date)).toDateString() === (new Date()).toDateString();

View file

@ -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!');
});
});

View file

@ -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!');
});
});