diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 01e949201..a66d55db4 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -3,8 +3,9 @@ image: tcitworld/mobilizon-ci stages: - install - check - - build + - build-js - test + - docker - package - upload - deploy @@ -50,6 +51,8 @@ install: lint-elixir: stage: check + before_script: + - mix deps.get script: - export EXITVALUE=0 - mix credo --strict -a || export EXITVALUE=1 @@ -57,21 +60,24 @@ lint-elixir: - exit $EXITVALUE lint-front: + image: node:14 stage: check before_script: - export EXITVALUE=0 - - cd js + - yarn --cwd "js" install --frozen-lockfile script: - - yarn run lint || export EXITVALUE=1 - - yarn run prettier -c . || export EXITVALUE=1 + - yarn --cwd "js" run lint || export EXITVALUE=1 + - yarn --cwd "js" run prettier -c . || export EXITVALUE=1 - exit $EXITVALUE build-frontend: - stage: build + stage: build-js + image: node:14 before_script: - apt update - apt install -y --no-install-recommends python build-essential webp imagemagick gifsicle jpegoptim optipng pngquant script: + - yarn --cwd "js" install --frozen-lockfile - yarn --cwd "js" run build artifacts: expire_in: 5 days @@ -82,6 +88,8 @@ build-frontend: deps: stage: check + before_script: + - mix deps.get script: - export EXITVALUE=0 - mix hex.outdated || export EXITVALUE=1 @@ -99,6 +107,7 @@ exunit: variables: MIX_ENV: test before_script: + - mix deps.get - mix ecto.create - mix ecto.migrate script: @@ -114,6 +123,8 @@ jest: stage: test needs: - lint-front + before_script: + - yarn --cwd "js" install --frozen-lockfile script: - yarn --cwd "js" run test:unit --no-color --ci --reporters=default --reporters=jest-junit artifacts: @@ -146,14 +157,12 @@ jest: # - js/tests/e2e/screenshots/**/*.png # - js/tests/e2e/videos/**/*.mp4 -# pages: -# stage: deploy -# script: -# # - mkdir public -# # Mobilizon documentation is now on https://framagit.org/framasoft/joinmobilizon/documentation -# # Mix docs disabled because of https://github.com/elixir-lang/ex_doc/issues/1172 -# # - mix docs -# # - mv doc public/backend +pages: + stage: deploy + script: + - mkdir public + - mix docs + - mv doc public/backend # #- yarn run --cwd "js" styleguide:build # #- mv js/styleguide public/frontend # rules: @@ -164,7 +173,7 @@ jest: # - public .docker: &docker - stage: build + stage: docker cache: {} image: name: gcr.io/kaniko-project/executor:debug diff --git a/js/src/views/Home.vue b/js/src/views/Home.vue index 482172935..1a8a27520 100644 --- a/js/src/views/Home.vue +++ b/js/src/views/Home.vue @@ -261,10 +261,12 @@ {{ $t("No events found") }}
- - {{ - $t("The events you created are not shown here.") - }} +
+ + {{ + $t("The events you created are not shown here.") + }} +
diff --git a/lib/mobilizon/events/events.ex b/lib/mobilizon/events/events.ex index 916efc708..d601fb8ff 100644 --- a/lib/mobilizon/events/events.ex +++ b/lib/mobilizon/events/events.ex @@ -1340,19 +1340,12 @@ defmodule Mobilizon.Events do end @spec events_for_search_query(String.t()) :: Ecto.Query.t() + defp events_for_search_query(""), do: Event + defp events_for_search_query(search_string) do - Event - |> do_event_for_search_query(search_string) - end - - @spec do_event_for_search_query(Ecto.Query.t(), String.t()) :: Ecto.Query.t() - defp do_event_for_search_query(query, ""), do: query - - defp do_event_for_search_query(query, search_string) do - from(event in query, + from(event in Event, join: id_and_rank in matching_event_ids_and_ranks(search_string), - on: id_and_rank.id == event.id, - order_by: [desc: id_and_rank.rank] + on: id_and_rank.id == event.id ) end diff --git a/lib/web/templates/email/instance_follow.text.eex b/lib/web/templates/email/instance_follow.text.eex index 22c26f5d9..3e2809774 100644 --- a/lib/web/templates/email/instance_follow.text.eex +++ b/lib/web/templates/email/instance_follow.text.eex @@ -2,6 +2,6 @@ == <%= gettext "%{name} (%{domain}) just requested to follow your instance.", name: @follower.name, domain: @follower.domain %> <%= gettext "If you accept, this instance will receive all of your public events." %> -<%= gettext "Note: %{name} (%{domain}) following you doesn't necessarily imply that you follow this instance, but you can ask to follow them too." %> +<%= gettext "Note: %{name} (%{domain}) following you doesn't necessarily imply that you follow this instance, but you can ask to follow them too.", name: @follower.name, domain: @follower.domain %> <%= gettext "To accept this invitation, head over to the instance's admin settings." %> <%= "#{Mobilizon.Web.Endpoint.url()}/settings/admin/relays/followers" %>