Skip to content

OpenProject is the leading open source project management software for product, project and portfolio management. A powerful Jira alternative with agile planning, issue tracking, roadmaps, Gantt charts, time tracking, collaboration features, and more. Available on premises or in the cloud. ⭐ Star us on GitHub

1.5 KB
Raw Blame
<%=
  flex_layout(
    align_items: :center,
    justify_content: :space_between
  ) do |step_container|
    step_container.with_column(mr: 2, classes: "min-width-0") do
      render(
        Projects::PhaseDefinitionComponent.new(
          definition,
          edit_link: definition_editable?,
          phase_text_options: { classes: "filter-target-visible-text" }
        )
      )
    end
    # py: 1 quick fix: prevents the row from bouncing as the toggle switch currently changes height while toggling
    step_container.with_column(py: 1, mr: 2) do
      # buggy currently:
      # small variant +  status_label_position: :start leads to a small bounce while toggling
      # behavior can be seen on primer's viewbook as well -> https://view-components-storybook.eastus.cloudapp.azure.com/view-components/lookbook/inspect/primer/alpha/toggle_switch/small
      # quick fix: don't display loading indicator which is causing the bounce
      render(
        Primer::Alpha::ToggleSwitch.new(
          src: toggle_project_settings_life_cycle_step_path(id: definition.id),
          csrf_token: form_authenticity_token,
          data: { test_selector: "toggle-project-life-cycle-#{definition.id}" },
          aria: { label: toggle_aria_label },
          checked: active?,
          size: :small,
          status_label_position: :start,
          classes: "op-primer-adjustments__toggle-switch--hidden-loading-indicator",
          on_label: t(:label_switch_on),
          off_label: t(:label_switch_off)
        )
      )
    end
  end
%>