Skip to content

Migrate project selectors away from select2

Paul Gascou-Vaillancourt requested to merge 374098-project-selects-select2 into master

What does this MR do and why?

This migrate the remaining select2-based project selector inputs to the new ProjectSelect Vue component.

Screenshots or screen recordings

Group insights project setting

Before After
Screenshot_2023-01-20_at_7.22.25_PM Screenshot_2023-01-20_at_7.18.43_PM

Instance templates project setting

Before After
Screenshot_2023-01-20_at_7.23.00_PM Screenshot_2023-01-20_at_7.18.57_PM

Cluster management project setting

Before After
Screenshot_2023-01-20_at_7.23.14_PM Screenshot_2023-01-20_at_7.19.40_PM

Analytics Dashboards project setting

Before After
Screenshot_2023-01-24_at_11.34.41_AM Screenshot_2023-01-24_at_11.29.30_AM

How to set up and validate locally

  • Group insights project setting
    • Navigate to a group's Settings > General > Insights setting (/groups/:group/-/edit).
  • Instance templates project setting
    • Navigate to Admin > Settings > Templates > Templates setting (/admin/application_settings/templates).
  • Cluster management project setting
    • Enable the certificate_based_clusters feature flag:
      Feature.enable(:certificate_based_clusters)
    • Create a cluster in the Admin > Kubernetes page (dummy values can be used).
    • Short-circuit the condition in the HAML view by applying the following patch (I'm not sure how to access the setting without this bypass):
      diff --git a/app/views/clusters/clusters/_advanced_settings.html.haml b/app/views/clusters/clusters/_advanced_settings.html.haml
      index ddc3b7d05e1b..8e0289d91191 100644
      --- a/app/views/clusters/clusters/_advanced_settings.html.haml
      +++ b/app/views/clusters/clusters/_advanced_settings.html.haml
      @@ -4,7 +4,7 @@
         - group_id = @cluster.project.group.id if @cluster.project.group
         - user_id = @cluster.project.namespace.owner_id unless group_id
       
      -- if can?(current_user, :admin_cluster, @cluster)
      +- if true
         - unless @cluster.provided_by_user?
           .sub-section.form-group
             %h4
    • Navigate to Admin > Kubernetes > :cluster > Advanced Setting > Cluster management project settings (/admin/clusters/1?tab=settings).
  • Analytics Dashboards project setting
    • Short-circuit the condition in the HAML view by applying the following patch (I'm not sure how to access the setting without this bypass):
      diff --git a/ee/app/views/groups/_analytics_dashboards.html.haml b/ee/app/views/groups/_analytics_dashboards.html.haml
      index 7b823543c475..3f7331c3be2f 100644
      --- a/ee/app/views/groups/_analytics_dashboards.html.haml
      +++ b/ee/app/views/groups/_analytics_dashboards.html.haml
      @@ -1,4 +1,4 @@
      -- return unless can?(current_user, :read_group_analytics_dashboards, @group)
      +-# - return unless can?(current_user, :read_group_analytics_dashboards, @group)
       
       %section.settings.analytics-dashboards-settings.no-animate{ class: ('expanded' if expanded) }
         .settings-header
    • Navigate to a group's Settings > General > Analytics Dashboards setting (/groups/:group/-/edit).

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Related to #374098 (closed)

Edited by Paul Gascou-Vaillancourt

Merge request reports

Loading