diff --git a/.circleci/config.yml b/.circleci/config.yml index fcd48b975..2fba3528d 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -1,14 +1,15 @@ version: 2.1 aliases: - -references: - images: - elixir: &ELIXIR_IMAGE heathmont/elixir-ci:1.13.1-otp-24-alpine + elixir_image: &elixir_image + image: heathmont/elixir-ci:1.13.1-otp-24-alpine + auth: + username: $DOCKER_USER + password: $DOCKER_PASS jobs: prelease: - docker: - - image: *ELIXIR_IMAGE + docker: + - *elixir_image environment: MIX_ENV: prod steps: @@ -53,8 +54,8 @@ jobs: - _build test: - docker: - - image: *ELIXIR_IMAGE + docker: + - *elixir_image environment: MIX_ENV: test steps: @@ -87,8 +88,8 @@ jobs: - run: command: mix test dockerhub: - docker: - - image: *ELIXIR_IMAGE + docker: + - *elixir_image steps: - checkout - setup_remote_docker: @@ -99,20 +100,19 @@ jobs: keys: - v10-prod-{{ .Revision }} - v10-prod- - - run: echo -e "$DOCKER_PASS" | docker login -u $DOCKER_USER --password-stdin + - run: + name: Docker login + command: docker login -u $DOCKER_USER -p $DOCKER_PASS - run: scripts/deploy/docker-build-ci push $CIRCLE_TAG deploy: - docker: - - image: *ELIXIR_IMAGE + docker: + - *elixir_image steps: - checkout - setup_remote_docker: docker_layer_caching: true - attach_workspace: at: ./ - - run: - name: Docker login - command: echo -e "$DOCKER_PASS" | docker login -u $DOCKER_USER --password-stdin - run: name: Setup robot SSH key command: | @@ -125,8 +125,8 @@ jobs: name: Deploy command: scripts/deploy/stacks-deploy $CIRCLE_TAG semrelease: - docker: - - image: *ELIXIR_IMAGE + docker: + - *elixir_image environment: MIX_ENV: test resource_class: xlarge diff --git a/lib/moon/parts/sidebar/menu_link.ex b/lib/moon/parts/sidebar/menu_link.ex index 73ab22989..84274bf40 100644 --- a/lib/moon/parts/sidebar/menu_link.ex +++ b/lib/moon/parts/sidebar/menu_link.ex @@ -15,10 +15,13 @@ defmodule Moon.Parts.Sidebar.MenuLink do prop(class, :css_class) @doc "Route to redirect to" prop(route, :any) + @doc "Additional attributes set for the tag a" + prop(attrs, :map, default: %{}) + @doc "Active page" + prop(active_page, :string, from_context: :active_page) + @doc "Default slot" slot(default) - @doc "Active page" - data(active_page, :string, from_context: :active_page) def render(assigns) do ~F""" @@ -31,12 +34,14 @@ defmodule Moon.Parts.Sidebar.MenuLink do ], @class ])} - attrs={ - "data-phx-link": "redirect", - "data-phx-link-state": "push", - route: @route, - fake: "hello" - } + attrs={Map.merge( + %{ + "data-phx-link": "redirect", + "data-phx-link-state": "push", + route: @route + }, + @attrs + )} is_active={@active_page == @route} href={@route} {=@id} diff --git a/lib/moon/parts/sidebar/slim_menu_link.ex b/lib/moon/parts/sidebar/slim_menu_link.ex index ceff600dd..52a499211 100644 --- a/lib/moon/parts/sidebar/slim_menu_link.ex +++ b/lib/moon/parts/sidebar/slim_menu_link.ex @@ -25,8 +25,10 @@ defmodule Moon.Parts.Sidebar.SlimMenuLink do prop(route, :any) @doc "Icon name" prop(icon_name, :any) + @doc "Additional attributes set for the tag a" + prop(attrs, :map, default: %{}) @doc "Active page" - data(active_page, :string, from_context: :active_page) + prop(active_page, :string, from_context: :active_page) def render(assigns) do ~F""" @@ -41,10 +43,13 @@ defmodule Moon.Parts.Sidebar.SlimMenuLink do ], @class ])} - attrs={ - "data-phx-link": "redirect", - "data-phx-link-state": "push" - } + attrs={Map.merge( + %{ + "data-phx-link": "redirect", + "data-phx-link-state": "push" + }, + @attrs + )} is_active={@active_page == @route} href={@route} > diff --git a/lib/moon/parts/wizzard/step.ex b/lib/moon/parts/wizzard/step.ex index 723c6e2bb..2334a5df3 100644 --- a/lib/moon/parts/wizzard/step.ex +++ b/lib/moon/parts/wizzard/step.ex @@ -49,8 +49,8 @@ defmodule Moon.Parts.Wizard.Step do type="button" {=@tabindex} aria-selected={"#{@is_selected}"} - disabled={@disabled || @tabindex > @selected + 1} - :on-click={!(@disabled || @tabindex > @selected + 1) && @on_change} + disabled={@disabled || @tabindex > @selected} + :on-click={!(@disabled || @tabindex > @selected) && @on_change} value={@tabindex} >