From 23470a010cd699b801a96a5f1092ec55d17b2b05 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 2f44e710..381a5ec3 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 3e755d52..df6363de 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 ddb82adb..8ae198cf 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 11dbca33..fa1307f7 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 4166e453..7256b98b 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 f91f8ab926db4031ff37b001b99dbcec4ed9884f 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 fcd1ea74..71820ee8 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 08dab070e7bd6791a4edc98e45957a4ff8b4d0de 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 ac5f5a92..ce28a21d 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 edcafe95..34052b0b 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 aac614d5973e68c4afdcfe08c05bbcf9b6d8aba9 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 275e9194..1c7eb77b 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 a46f4c058c7ea7c0ea0de6aadea02e5edbb0fe74 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 14fe43f8..f9629010 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";