Skip to content

Background Migrations - Cleanup Margins

Zack Cuddy requested to merge 361508-fix-bg-migrations-margin into master

What does this MR do and why?

Closes #361508 (closed)

This change removes the extra right margin off of the title section of Background Migrations. Instead it moves it to a conditional left margin on the GlListbox when on larger screens.

Moving the margin to the GlListbox will allow the margin to only show up when the element is there (Multi DB). On Single DB instances there is no listbox.

Screenshots or screen recordings

Before After
Single DB (Desktop) Single_Desktop_-_Before Single_Desktop_-_After
Single DB (Mobile) Single_Mobile_-_Before Single_Mobile_-_After
Multi DB (Desktop) Multi_Desktop_-_Before Multi_Desktop_-_After
Multi DB (Mobile) Multi_Mobile_-_Before Multi_Mobile_-_After

How to set up and validate locally

For Single DB Instances

Setup

  1. Navigate to your /gitlab directory in your terminal
  2. Run the command gdk config get gitlab.rails.multiple_databases
  3. If gdk config get gitlab.rails.multiple_databases is true
    • Run the command gdk config set gitlab.rails.multiple_databases false
    • Run gdk reconfigure

Test

  1. Navigate to the background migrations tab (ex. http://127.0.0.1:3000/admin/background_migrations).
  2. Ensure there is no "extra" right margin on the title section for both desktop and mobile

For Multi DB Instances

Setup

  1. Navigate to your /gitlab directory in your terminal
  2. Run the command gdk config get gitlab.rails.multiple_databases
  3. If gdk config get gitlab.rails.multiple_databases is false
    • Run the command gdk config set gitlab.rails.multiple_databases true
    • Run gdk reconfigure

Seed Data

  1. Navigate to your /gitlab directory in your terminal
  2. Run the command rails c
  3. Copy and paste the following code in the rails console that appears:
Gitlab::Database::EachDatabase.each_database_connection do
  active_migration = FactoryBot.create(:batched_background_migration, :active)
  finished_migration = FactoryBot.create(:batched_background_migration, :finished)
  failed_migration = FactoryBot.create(:batched_background_migration, :failed)

  FactoryBot.create(:batched_background_migration_job, :succeeded, batched_migration: active_migration)
  FactoryBot.create(:batched_background_migration_job, :running, batched_migration: active_migration)
  FactoryBot.create(:batched_background_migration_job, :succeeded, batched_migration: finished_migration)
  FactoryBot.create(:batched_background_migration_job, :succeeded, batched_migration: finished_migration)
  FactoryBot.create(:batched_background_migration_job, :succeeded, batched_migration: finished_migration)
  FactoryBot.create(:batched_background_migration_job, :failed, batched_migration: failed_migration)
end

Test

  1. Navigate to the background migrations tab (ex. http://127.0.0.1:3000/admin/background_migrations).
  2. Ensure there is margin between the title section and listbox on Desktop
  3. Ensure there is no extra right margin on the title section on Mobile

MR acceptance checklist

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

Edited by Zack Cuddy

Merge request reports

Loading