From 6e4a5a05e81b15ec26a49cea4568497b7c96096d Mon Sep 17 00:00:00 2001 From: Thomas Citharel Date: Tue, 5 Nov 2019 11:49:22 +0100 Subject: [PATCH 1/7] Optimize svg pictures and color them with $secondary Signed-off-by: Thomas Citharel --- js/src/assets/Circle-icons-calendar.svg | 135 +---- js/src/assets/mobilizon_logo.svg | 32 +- js/src/assets/profile.svg | 66 +-- js/src/assets/texting.svg | 749 +----------------------- js/src/assets/undraw_events.svg | 2 +- 5 files changed, 5 insertions(+), 979 deletions(-) diff --git a/js/src/assets/Circle-icons-calendar.svg b/js/src/assets/Circle-icons-calendar.svg index 2f44e710e..381a5ec32 100644 --- a/js/src/assets/Circle-icons-calendar.svg +++ b/js/src/assets/Circle-icons-calendar.svg @@ -1,134 +1 @@ - - - -image/svg+xml - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file + \ No newline at end of file diff --git a/js/src/assets/mobilizon_logo.svg b/js/src/assets/mobilizon_logo.svg index 3e755d528..df6363deb 100644 --- a/js/src/assets/mobilizon_logo.svg +++ b/js/src/assets/mobilizon_logo.svg @@ -1,31 +1 @@ - - Mobilizon Logo - - - - - - - - - - - - - - - - + \ No newline at end of file diff --git a/js/src/assets/profile.svg b/js/src/assets/profile.svg index ddb82adb6..8ae198cf5 100644 --- a/js/src/assets/profile.svg +++ b/js/src/assets/profile.svg @@ -1,65 +1 @@ - - - - - - image/svg+xml - - - - - - - 47 all - ">"> - -"> - - - +">">"> \ No newline at end of file diff --git a/js/src/assets/texting.svg b/js/src/assets/texting.svg index 11dbca332..fa1307f73 100644 --- a/js/src/assets/texting.svg +++ b/js/src/assets/texting.svg @@ -1,748 +1 @@ - - - - - - image/svg+xml - - - - - - - texting - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + \ No newline at end of file diff --git a/js/src/assets/undraw_events.svg b/js/src/assets/undraw_events.svg index 4166e453e..7256b98bc 100644 --- a/js/src/assets/undraw_events.svg +++ b/js/src/assets/undraw_events.svg @@ -1 +1 @@ -events \ No newline at end of file + \ No newline at end of file From 0fc79d12192dd9bc9584b5721f327f46a7ca0bf2 Mon Sep 17 00:00:00 2001 From: Thomas Citharel Date: Tue, 5 Nov 2019 11:49:45 +0100 Subject: [PATCH 2/7] Fix for adding addresses Signed-off-by: Thomas Citharel --- lib/mobilizon/events/event.ex | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/mobilizon/events/event.ex b/lib/mobilizon/events/event.ex index fcd1ea745..71820ee80 100644 --- a/lib/mobilizon/events/event.ex +++ b/lib/mobilizon/events/event.ex @@ -187,8 +187,8 @@ defmodule Mobilizon.Events.Event do # In case the provided addresses is an existing one @spec put_address(Changeset.t(), map) :: Changeset.t() - defp put_address(%Changeset{} = changeset, %{physical_address: %{id: id} = _physical_address}) do - case Addresses.get_address!(id) do + defp put_address(%Changeset{} = changeset, %{physical_address: %{id: id} = _physical_address}) when not is_nil(id) do + case Addresses.get_address(id) do %Address{} = address -> put_assoc(changeset, :physical_address, address) From 1fd7dbe14b25a58900aa0b804a3697a9ad266c29 Mon Sep 17 00:00:00 2001 From: Thomas Citharel Date: Tue, 5 Nov 2019 15:03:35 +0100 Subject: [PATCH 3/7] Handle update identity with bad identity username Signed-off-by: Thomas Citharel --- config/dev.exs | 2 +- .../views/Account/children/EditIdentity.vue | 30 ++++++++++++------- 2 files changed, 20 insertions(+), 12 deletions(-) diff --git a/config/dev.exs b/config/dev.exs index ac5f5a921..ce28a21d0 100644 --- a/config/dev.exs +++ b/config/dev.exs @@ -52,7 +52,7 @@ config :mobilizon, MobilizonWeb.Endpoint, # Do not include metadata nor timestamps in development logs config :logger, :console, format: "[$level] $message\n", level: :debug -config :mobilizon, Mobilizon.Service.Geospatial, service: Mobilizon.Service.Geospatial.Nominatim +config :mobilizon, Mobilizon.Service.Geospatial, service: Mobilizon.Service.Geospatial.GoogleMaps # Set a higher stacktrace during development. Avoid configuring such # in production as building large stacktraces may be expensive. diff --git a/js/src/views/Account/children/EditIdentity.vue b/js/src/views/Account/children/EditIdentity.vue index edcafe955..34052b0b7 100644 --- a/js/src/views/Account/children/EditIdentity.vue +++ b/js/src/views/Account/children/EditIdentity.vue @@ -134,9 +134,14 @@ export default class EditIdentity extends Vue { this.resetFields(); this.identityName = val; + const identity = await this.getIdentity(); - if (this.identityName) { - this.identity = await this.getIdentity(); + if (!identity) { + return await this.$router.push({ name: 'CreateIdentity' }); + } + + if (this.identityName && identity) { + this.identity = identity; this.avatarFile = await buildFileFromIPicture(this.identity.avatar); } @@ -280,15 +285,18 @@ export default class EditIdentity extends Vue { }); } - private async getIdentity() { - const result = await this.$apollo.query({ - query: FETCH_PERSON, - variables: { - username: this.identityName, - }, - }); - - return new Person(result.data.fetchPerson); + private async getIdentity(): Promise { + try { + const result = await this.$apollo.query({ + query: FETCH_PERSON, + variables: { + username: this.identityName, + }, + }); + return new Person(result.data.fetchPerson); + } catch (e) { + return null; + } } private handleError(err: any) { From 1c161bb1f6c3af97af9fd7a3bccb54596ae95412 Mon Sep 17 00:00:00 2001 From: Thomas Citharel Date: Tue, 5 Nov 2019 15:09:40 +0100 Subject: [PATCH 4/7] Improve search field placeholder contrast Signed-off-by: Thomas Citharel --- js/src/components/SearchField.vue | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/js/src/components/SearchField.vue b/js/src/components/SearchField.vue index 275e91948..1c7eb77b4 100644 --- a/js/src/components/SearchField.vue +++ b/js/src/components/SearchField.vue @@ -25,5 +25,9 @@ export default class SearchField extends Vue { input.searchField { box-shadow: none; border-color: #b5b5b5; + + &::placeholder { + color: gray; + } } - \ No newline at end of file + From 050833490ed767b646aa143f528155c4c2670757 Mon Sep 17 00:00:00 2001 From: Thomas Citharel Date: Tue, 5 Nov 2019 15:51:34 +0100 Subject: [PATCH 5/7] Fix add to calendar section with low screen width Signed-off-by: Thomas Citharel --- js/src/views/Event/Event.vue | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/js/src/views/Event/Event.vue b/js/src/views/Event/Event.vue index 14fe43f80..f96290106 100644 --- a/js/src/views/Event/Event.vue +++ b/js/src/views/Event/Event.vue @@ -173,8 +173,8 @@ import {ParticipantRole} from "@/types/event.model";