Skip to content

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

[#50437] Improve waiting modal appearance.

Pavel Balashou8ec5e0a06064
diff --git a/modules/storages/app/components/storages/open_project_storage_modal_component.html.erb b/modules/storages/app/components/storages/open_project_storage_modal_component.html.erb
index 4230687862a..81e480bae87 100644
--- a/modules/storages/app/components/storages/open_project_storage_modal_component.html.erb
+++ b/modules/storages/app/components/storages/open_project_storage_modal_component.html.erb
@@ -1,11 +1,10 @@
<%= render(
- Primer::Alpha::Dialog.new(
- id: self.class.dialog_id,
- title: 'Modal',
- visually_hide_title: true,
- data: @data)
+ Primer::Alpha::Dialog.new(id: self.class.dialog_id,
+ title: 'Open project folder modal',
+ data: @data)
) do |dialog| %>
- <% dialog.with_body(id: self.class.dialog_body_id) do %>
+ <% dialog.with_header(display: :none) %>
+ <% dialog.with_body(id: self.class.dialog_body_id, p: 2) do %>
<%= render(self.class::Body.new(@state)) %>
<% end %>
<% end %>
diff --git a/modules/storages/app/components/storages/open_project_storage_modal_component/body.html.erb b/modules/storages/app/components/storages/open_project_storage_modal_component/body.html.erb
index 22d9632fb5b..b1a350ec781 100644
--- a/modules/storages/app/components/storages/open_project_storage_modal_component/body.html.erb
+++ b/modules/storages/app/components/storages/open_project_storage_modal_component/body.html.erb
@@ -1,28 +1,26 @@
-<% case @state %>
-<% when :waiting %>
- <%= render(Primer::OpenProject::FlexLayout.new(align_items: :center)) do |flex| %>
+<%= render(Primer::OpenProject::FlexLayout.new(align_items: :center, p: 4)) do |flex| %>
+ <% case @state %>
+ <% when :waiting %>
<% flex.with_row do %>
<div class="op-loading-indicator">
<div></div><div></div>
</div>
<% end %>
<% flex.with_row do %>
- <%= render(Primer::Beta::Text.new) { I18n.t('storages.open_project_storage_modal.waiting.a') } %>
+ <%= render(Primer::Beta::Heading.new(tag: :h2, text_align: :center)) { I18n.t('storages.open_project_storage_modal.waiting.a') } %>
<% end %>
<% flex.with_row do %>
- <%= render(Primer::Beta::Text.new) { I18n.t('storages.open_project_storage_modal.waiting.b') } %>
+ <%= render(Primer::Beta::Text.new(text_align: :center, color: :muted)) { I18n.t('storages.open_project_storage_modal.waiting.b') } %>
<% end %>
- <% end %>
-<% when :success %>
- <%= render(Primer::OpenProject::FlexLayout.new(align_items: :center)) do |flex| %>
+ <% when :success %>
<% flex.with_row do %>
<%= render(Primer::Beta::Octicon.new(:"check-circle", size: :medium, color: :success)) %>
<% end %>
<% flex.with_row do %>
- <%= render(Primer::Beta::Text.new) { I18n.t('storages.open_project_storage_modal.success.a') } %>
+ <%= render(Primer::Beta::Heading.new(tag: :h2, text_align: :center)) { I18n.t('storages.open_project_storage_modal.success.a') } %>
<% end %>
<% flex.with_row do %>
- <%= render(Primer::Beta::Text.new) { I18n.t('storages.open_project_storage_modal.success.b') } %>
+ <%= render(Primer::Beta::Text.new(text_align: :center, color: :muted)) { I18n.t('storages.open_project_storage_modal.success.b') } %>
<% end %>
<% end %>
<% end %>
diff --git a/modules/storages/spec/requests/project_storages_open_spec.rb b/modules/storages/spec/requests/project_storages_open_spec.rb
index 280c8625cea..48bd577c090 100644
--- a/modules/storages/spec/requests/project_storages_open_spec.rb
+++ b/modules/storages/spec/requests/project_storages_open_spec.rb
@@ -75,7 +75,7 @@ RSpec.describe 'projects/:project_id/project_storages/:id/open' do
get route, {}, { 'HTTP_ACCEPT' => 'text/vnd.turbo-stream.html' }
expect(last_response.status).to eq (200)
- expect(last_response.body).to eq ("<turbo-stream action=\"update\" target=\"open-project-storage-modal-body-component\">\n <template>\n <div data-view-component=\"true\" class=\"flex-items-center d-flex flex-column\">\n <div data-view-component=\"true\"> <svg aria-hidden=\"true\" height=\"24\" viewBox=\"0 0 24 24\" version=\"1.1\" width=\"24\" data-view-component=\"true\" class=\"octicon octicon-check-circle color-fg-success\">\n <path d=\"M17.28 9.28a.75.75 0 0 0-1.06-1.06l-5.97 5.97-2.47-2.47a.75.75 0 0 0-1.06 1.06l3 3a.75.75 0 0 0 1.06 0l6.5-6.5Z\"></path><path d=\"M12 1c6.075 0 11 4.925 11 11s-4.925 11-11 11S1 18.075 1 12 5.925 1 12 1ZM2.5 12a9.5 9.5 0 0 0 9.5 9.5 9.5 9.5 0 0 0 9.5-9.5A9.5 9.5 0 0 0 12 2.5 9.5 9.5 0 0 0 2.5 12Z\"></path>\n</svg>\n</div>\n <div data-view-component=\"true\"> <span data-view-component=\"true\">Integration setup completed</span>\n</div>\n <div data-view-component=\"true\"> <span data-view-component=\"true\">You are being redirected</span>\n</div>\n</div>\n\n\n </template>\n</turbo-stream>\n\n")
+ expect(last_response.body).to eq ("<turbo-stream action=\"update\" target=\"open-project-storage-modal-body-component\">\n <template>\n <div data-view-component=\"true\" class=\"flex-items-center p-4 d-flex flex-column\">\n <div data-view-component=\"true\"> <svg aria-hidden=\"true\" height=\"24\" viewBox=\"0 0 24 24\" version=\"1.1\" width=\"24\" data-view-component=\"true\" class=\"octicon octicon-check-circle color-fg-success\">\n <path d=\"M17.28 9.28a.75.75 0 0 0-1.06-1.06l-5.97 5.97-2.47-2.47a.75.75 0 0 0-1.06 1.06l3 3a.75.75 0 0 0 1.06 0l6.5-6.5Z\"></path><path d=\"M12 1c6.075 0 11 4.925 11 11s-4.925 11-11 11S1 18.075 1 12 5.925 1 12 1ZM2.5 12a9.5 9.5 0 0 0 9.5 9.5 9.5 9.5 0 0 0 9.5-9.5A9.5 9.5 0 0 0 12 2.5 9.5 9.5 0 0 0 2.5 12Z\"></path>\n</svg>\n</div>\n <div data-view-component=\"true\"> <h2 data-view-component=\"true\" class=\"text-center\">Integration setup completed</h2>\n</div>\n <div data-view-component=\"true\"> <span data-view-component=\"true\" class=\"text-center color-fg-muted\">You are being redirected</span>\n</div>\n</div>\n\n\n </template>\n</turbo-stream>\n\n")
end
end
end