Commit 610a8f24 authored by Clement Ho's avatar Clement Ho

Merge branch 'sh-fix-importer-status' into 'master'

Fix invisible rows on importer status

Closes #47363

See merge request gitlab-org/gitlab-ce!19458
parents 53457cb0 b61e1e7a
...@@ -58,7 +58,7 @@ class ImporterStatus { ...@@ -58,7 +58,7 @@ class ImporterStatus {
job.find('.import-target').html(`<a href="${data.full_path}">${data.full_path}</a>`); job.find('.import-target').html(`<a href="${data.full_path}">${data.full_path}</a>`);
$('table.import-jobs tbody').prepend(job); $('table.import-jobs tbody').prepend(job);
job.addClass('active'); job.addClass('table-active');
const connectingVerb = this.ciCdOnly ? __('connecting') : __('importing'); const connectingVerb = this.ciCdOnly ? __('connecting') : __('importing');
job.find('.import-actions').html(sprintf( job.find('.import-actions').html(sprintf(
_.escape(__('%{loadingIcon} Started')), { _.escape(__('%{loadingIcon} Started')), {
...@@ -81,7 +81,7 @@ class ImporterStatus { ...@@ -81,7 +81,7 @@ class ImporterStatus {
switch (job.import_status) { switch (job.import_status) {
case 'finished': case 'finished':
jobItem.removeClass('active').addClass('success'); jobItem.removeClass('table-active').addClass('table-success');
statusField.html(`<span><i class="fa fa-check"></i> ${__('Done')}</span>`); statusField.html(`<span><i class="fa fa-check"></i> ${__('Done')}</span>`);
break; break;
case 'scheduled': case 'scheduled':
......
...@@ -389,11 +389,11 @@ module ProjectsHelper ...@@ -389,11 +389,11 @@ module ProjectsHelper
def project_status_css_class(status) def project_status_css_class(status)
case status case status
when "started" when "started"
"active" "table-active"
when "failed" when "failed"
"danger" "table-danger"
when "finished" when "finished"
"success" "table-success"
end end
end end
......
...@@ -5,9 +5,9 @@ describe ProjectsHelper do ...@@ -5,9 +5,9 @@ describe ProjectsHelper do
describe "#project_status_css_class" do describe "#project_status_css_class" do
it "returns appropriate class" do it "returns appropriate class" do
expect(project_status_css_class("started")).to eq("active") expect(project_status_css_class("started")).to eq("table-active")
expect(project_status_css_class("failed")).to eq("danger") expect(project_status_css_class("failed")).to eq("table-danger")
expect(project_status_css_class("finished")).to eq("success") expect(project_status_css_class("finished")).to eq("table-success")
end end
end end
......
...@@ -45,7 +45,7 @@ describe('Importer Status', () => { ...@@ -45,7 +45,7 @@ describe('Importer Status', () => {
currentTarget: document.querySelector('.js-add-to-import'), currentTarget: document.querySelector('.js-add-to-import'),
}) })
.then(() => { .then(() => {
expect(document.querySelector('tr').classList.contains('active')).toEqual(true); expect(document.querySelector('tr').classList.contains('table-active')).toEqual(true);
done(); done();
}) })
.catch(done.fail); .catch(done.fail);
......
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