Background Migrations - Cleanup Margins
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 DB (Mobile) | ||
Multi DB (Desktop) | ||
Multi DB (Mobile) |
How to set up and validate locally
For Single DB Instances
Setup
- Navigate to your
/gitlab
directory in your terminal - Run the command
gdk config get gitlab.rails.multiple_databases
- If
gdk config get gitlab.rails.multiple_databases
is true- Run the command
gdk config set gitlab.rails.multiple_databases false
- Run
gdk reconfigure
- Run the command
Test
- Navigate to the background migrations tab (ex.
http://127.0.0.1:3000/admin/background_migrations
). - Ensure there is no "extra" right margin on the title section for both desktop and mobile
For Multi DB Instances
Setup
- Navigate to your
/gitlab
directory in your terminal - Run the command
gdk config get gitlab.rails.multiple_databases
- If
gdk config get gitlab.rails.multiple_databases
is false- Run the command
gdk config set gitlab.rails.multiple_databases true
- Run
gdk reconfigure
- Run the command
Seed Data
- Navigate to your
/gitlab
directory in your terminal - Run the command
rails c
- 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
- Navigate to the background migrations tab (ex.
http://127.0.0.1:3000/admin/background_migrations
). - Ensure there is margin between the title section and listbox on Desktop
- 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.
-
I have evaluated the MR acceptance checklist for this MR.
Edited by Zack Cuddy