Commit 8e5abb6f authored by Andrew Fontaine's avatar Andrew Fontaine

Merge branch '296884-disable-unpausing-indexing-if-a-reindex-is-in-progress' into 'master'

Disable pause indexing checkbox if a reindex is in progress

See merge request gitlab-org/gitlab!60953
parents eb8a3ed7 61e2d44b
...@@ -48,7 +48,7 @@ ...@@ -48,7 +48,7 @@
.form-group .form-group
.form-check .form-check
- pending_migrations = elasticsearch_available && Elastic::DataMigrationService.pending_migrations? && Gitlab::CurrentSettings.elasticsearch_pause_indexing? - pending_migrations = elasticsearch_available && Elastic::DataMigrationService.pending_migrations? && Gitlab::CurrentSettings.elasticsearch_pause_indexing?
- disable_checkbox = !Gitlab::CurrentSettings.elasticsearch_indexing? || pending_migrations - disable_checkbox = !Gitlab::CurrentSettings.elasticsearch_indexing? || pending_migrations || @elasticsearch_reindexing_task&.in_progress?
= f.check_box :elasticsearch_pause_indexing, class: 'form-check-input', data: { qa_selector: 'pause_checkbox' }, disabled: disable_checkbox = f.check_box :elasticsearch_pause_indexing, class: 'form-check-input', data: { qa_selector: 'pause_checkbox' }, disabled: disable_checkbox
= f.label :elasticsearch_pause_indexing, class: 'form-check-label' do = f.label :elasticsearch_pause_indexing, class: 'form-check-label' do
= _('Pause Elasticsearch indexing') = _('Pause Elasticsearch indexing')
......
---
title: Disable pause indexing checkbox if a reindex is in progress
merge_request: 60953
author:
type: changed
...@@ -97,6 +97,22 @@ RSpec.describe 'admin/application_settings/_elasticsearch_form' do ...@@ -97,6 +97,22 @@ RSpec.describe 'admin/application_settings/_elasticsearch_form' do
assign(:elasticsearch_reindexing_task, task) assign(:elasticsearch_reindexing_task, task)
end end
context 'when task is in progress' do
let(:task) { build(:elastic_reindexing_task, state: :reindexing) }
it 'renders a disabled pause checkbox' do
render
expect(rendered).to have_css('input[id=application_setting_elasticsearch_pause_indexing][disabled="disabled"]')
end
it 'renders a disabled trigger cluster reindexing link' do
render
expect(rendered).to have_css('a.gl-button[disabled="disabled"]', text: 'Trigger cluster reindexing')
end
end
context 'without extended details' do context 'without extended details' do
let(:task) { build(:elastic_reindexing_task) } let(:task) { build(:elastic_reindexing_task) }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment