OpenProject is the leading open source project management software for product, project and portfolio management. A powerful Jira alternative with agile planning, issue tracking, roadmaps, Gantt charts, time tracking, collaboration features, and more. Available on premises or in the cloud. ⭐ Star us on GitHub
Ruby agile-developmentangularbcfboardsbug-trackerganttgantt-chartifcissue-trackerjira-alternativekanbanopenprojectproduct-managementproject-managementproject-planningroadmaprubyscrumtimelineworkflows
fix specs; refactor modal body getters
as-op1480a92b22a9
diff --git a/modules/job_status/app/components/job_status/dialog/body_component.html.erb b/modules/job_status/app/components/job_status/dialog/body_component.html.erbindex 13f76a5ea50..f64caec3c35 100644--- a/modules/job_status/app/components/job_status/dialog/body_component.html.erb+++ b/modules/job_status/app/components/job_status/dialog/body_component.html.erb@@ -14,16 +14,16 @@component.with_heading(tag: :h2).with_content(title)component.with_description { message }end %>- <% if redirect_url? %>+ <% if redirect_url.present? %><%= render(Primer::Beta::Link.new(href: redirect_url,target: "_blank",data: {- "job-status-polling-target": job_errors? ? nil : "redirect"+ "job-status-polling-target": job_errors.present? ? nil : "redirect"})) { I18n.t('js.job_status.redirect_link') } %><% end %>- <% if download_url? %>+ <% if download_url.present? %><%= flex_layout do |flex|flex.with_row(text_align: :center) { render(Primer::Beta::Text.new) { I18n.t('js.job_status.download_starts') } }flex.with_row(text_align: :center) {@@ -38,7 +38,7 @@}end %><% end %>- <% if job_html? %>+ <% if job_html.present? %><%= flex_layout do |flex|flex.with_row(text_align: :center) { job_html.html_safe }end %>diff --git a/modules/job_status/app/components/job_status/dialog/body_component.rb b/modules/job_status/app/components/job_status/dialog/body_component.rbindex ea8f5f4bd41..db0b19595bc 100644--- a/modules/job_status/app/components/job_status/dialog/body_component.rb+++ b/modules/job_status/app/components/job_status/dialog/body_component.rb@@ -55,46 +55,24 @@ module JobStatus::JobStatus::Status.statuses.slice(:success).valuesend- def redirect_url?- return false if job.nil?-- job.payload["redirect"].present?- end-def redirect_url- job.payload["redirect"]- end-- def download_url?- return false if job.nil?-- job.payload["download"].present?+ job&.payload&.dig("redirect")enddef download_url- job.payload["download"]+ job&.payload&.dig("download")enddef job_errors- job.payload["errors"]- end-- def job_errors?- return false if job.nil?-- job.payload["errors"].present?- end-- def job_html?- return false if job.nil?-- job.payload["html"].present?+ job&.payload&.dig("errors")enddef job_html- return false if job.nil?+ job&.payload&.dig("html")+ end- job.payload["html"].present?+ def job_errors?+ job_errors.present?enddef pending?@@ -112,7 +90,7 @@ module JobStatusreturn I18n.t("js.job_status.errors") if has_error?- job.payload["title"] || I18n.t("js.job_status.title")+ job.payload&.dig("title") || I18n.t("js.job_status.title")enddef icondiff --git a/spec/features/work_packages/bulk/copy_work_package_spec.rb b/spec/features/work_packages/bulk/copy_work_package_spec.rbindex e93ab25a120..17401f6c5be 100644--- a/spec/features/work_packages/bulk/copy_work_package_spec.rb+++ b/spec/features/work_packages/bulk/copy_work_package_spec.rb@@ -109,7 +109,7 @@ RSpec.describe "Copy work packages through Rails view", :js, :with_cuprite donotes.set_markdown "A note on copy"click_on "Copy and follow"- expect(page).to have_text "The job has been queued and will be processed shortly."+ expect(page).to have_text("The job has been queued and will be processed shortly.", wait: 10)perform_enqueued_jobsdiff --git a/spec/features/work_packages/bulk/move_work_package_spec.rb b/spec/features/work_packages/bulk/move_work_package_spec.rbindex ad576c7af4b..3b61c35aecb 100644--- a/spec/features/work_packages/bulk/move_work_package_spec.rb+++ b/spec/features/work_packages/bulk/move_work_package_spec.rb@@ -98,9 +98,8 @@ RSpec.describe "Moving a work package through Rails view", :js doit "copies them in the background and shows a status page", :with_cuprite doclick_on "Move and follow"wait_for_reload- page.find_test_selector("job-status--header")- expect(page).to have_text "The job has been queued and will be processed shortly."+ expect(page).to have_text("The job has been queued and will be processed shortly.", wait: 10)perform_enqueued_jobs