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

hide toggle switch loading indicator as requested by product team

Jonas Jabarifc179ada0c5c
diff --git a/app/components/projects/settings/project_custom_field_sections/custom_field_row_component.html.erb b/app/components/projects/settings/project_custom_field_sections/custom_field_row_component.html.erb
index ba1bb17b16b..8e538fb20a3 100644
--- a/app/components/projects/settings/project_custom_field_sections/custom_field_row_component.html.erb
+++ b/app/components/projects/settings/project_custom_field_sections/custom_field_row_component.html.erb
@@ -27,6 +27,7 @@
# 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_project_custom_fields_path(
project_custom_field_project_mapping: {
@@ -40,7 +41,8 @@
checked: active_in_project?,
enabled: !@project_custom_field.required?, # required fields cannot be disabled
size: :small,
- status_label_position: :start
+ status_label_position: :start,
+ classes: "op-primer-adjustments__toggle-switch--hidden-loading-indicator",
))
end
end
diff --git a/frontend/src/global_styles/openproject/_primer-adjustments.sass b/frontend/src/global_styles/openproject/_primer-adjustments.sass
index 2b184707dc6..a84b94e232e 100644
--- a/frontend/src/global_styles/openproject/_primer-adjustments.sass
+++ b/frontend/src/global_styles/openproject/_primer-adjustments.sass
@@ -55,3 +55,7 @@ ul.tabnav-tabs
.breadcrumb-item.breadcrumb-item-selected
a
pointer-events: none
+
+.op-primer-adjustments__toggle-switch--hidden-loading-indicator
+ .ToggleSwitch-statusIcon
+ display: none