From a1d5bd34f8b8181960eb6e86818a4dd16e6083d8 Mon Sep 17 00:00:00 2001 From: Audrey Hamelers Date: Thu, 27 Jun 2024 12:48:59 +0200 Subject: [PATCH 01/15] swap screen order --- .../stash_datacite/resources/_review.html.erb | 3 +-- .../shared/_dataset_steps_bottom_nav.html.erb | 12 ++++++------ .../shared/_dataset_steps_nav.html.erb | 14 ++++++++------ spec/features/stash_engine/upload_files_spec.rb | 6 +++--- 4 files changed, 18 insertions(+), 17 deletions(-) diff --git a/app/views/stash_datacite/resources/_review.html.erb b/app/views/stash_datacite/resources/_review.html.erb index 0c028b7fa9..ca8e9f8ba2 100644 --- a/app/views/stash_datacite/resources/_review.html.erb +++ b/app/views/stash_datacite/resources/_review.html.erb @@ -125,8 +125,7 @@ <% if @resource&.resource_type&.resource_type == 'collection' %> <%= link_to 'Back to Describe collection', stash_url_helpers.metadata_entry_pages_find_or_create_path(resource_id: @resource.id), class: 'o-button__icon-left', role: 'button', id: 'describe_back' %> <% else %> - <%= link_to 'Back to Upload', stash_url_helpers.up_code_resource_path(@resource), id: 'dashboard_path', - class: 'o-button__icon-left', role: 'button' %> + <%= link_to 'Back to README', stash_url_helpers.prepare_readme_resource_path(@resource), id: 'readme_path', class: 'o-button__icon-left js-nav-out', role: 'button' %> <% end %> <% if @resource.previous_curated_resource && @resource.changed_from_previous_curated.empty? %> diff --git a/app/views/stash_engine/shared/_dataset_steps_bottom_nav.html.erb b/app/views/stash_engine/shared/_dataset_steps_bottom_nav.html.erb index c91034effa..5bf408aaf2 100644 --- a/app/views/stash_engine/shared/_dataset_steps_bottom_nav.html.erb +++ b/app/views/stash_engine/shared/_dataset_steps_bottom_nav.html.erb @@ -9,13 +9,13 @@ <% if @resource&.resource_type&.resource_type == 'collection' %> <%= link_to 'Proceed to Review', stash_url_helpers.review_resource_path(@resource.id), class: 'o-button__icon-right js-nav-out', role: 'button', id: 'proceed_review' %> <% else %> - <%= link_to 'Proceed to README', stash_url_helpers.prepare_readme_resource_path(@resource), id: 'readme_path', class: 'o-button__icon-right js-nav-out', role: 'button' %> + <%= link_to 'Proceed to Upload', stash_url_helpers.upload_resource_path(@resource), id: 'upload_path', class: 'o-button__icon-right js-nav-out', role: 'button' %> <% end %> - <%when 2%> - <%= link_to 'Back to Describe dataset', stash_url_helpers.metadata_entry_pages_find_or_create_path(resource_id: @resource.id), class: 'o-button__icon-left js-nav-out', role: 'button', id: 'describe_back' %> - <%= link_to 'Proceed to Upload', stash_url_helpers.upload_resource_path(@resource), id: 'upload_path', class: 'o-button__icon-right js-nav-out', role: 'button' %> - <%when 3%> - <%= link_to 'Back to README', stash_url_helpers.prepare_readme_resource_path(@resource), id: 'readme_path', class: 'o-button__icon-left js-nav-out', role: 'button' %> + <%when 2%> + <%= link_to 'Back to Upload', stash_url_helpers.upload_resource_path(@resource), id: 'upload_path',class: 'o-button__icon-left js-nav-out', role: 'button' %> <%= link_to 'Proceed to Review', stash_url_helpers.review_resource_path(@resource.id), class: 'o-button__icon-right js-nav-out', role: 'button', id: 'proceed_review' %> + <%when 3%> + <%= link_to 'Back to Describe dataset', stash_url_helpers.metadata_entry_pages_find_or_create_path(resource_id: @resource.id), class: 'o-button__icon-left js-nav-out', role: 'button', id: 'describe_back' %> + <%= link_to 'Proceed to README', stash_url_helpers.prepare_readme_resource_path(@resource), id: 'readme_path', class: 'o-button__icon-right js-nav-out', role: 'button' %> <%end%> diff --git a/app/views/stash_engine/shared/_dataset_steps_nav.html.erb b/app/views/stash_engine/shared/_dataset_steps_nav.html.erb index 0d8e35789c..fc4dce5717 100644 --- a/app/views/stash_engine/shared/_dataset_steps_nav.html.erb +++ b/app/views/stash_engine/shared/_dataset_steps_nav.html.erb @@ -1,16 +1,18 @@
- <%= link_to "Describe #{@resource&.resource_type&.resource_type || 'dataset'}", stash_url_helpers.metadata_entry_pages_find_or_create_path(resource_id: @resource.id), - class: "c-progress__tab1#{ (params[:controller]&.end_with?('metadata_entry_pages') && params[:action] == 'find_or_create' ? '--active' : '' )} js-nav-out" %> + <%= link_to "Describe #{@resource&.resource_type&.resource_type || 'dataset'}", + stash_url_helpers.metadata_entry_pages_find_or_create_path(resource_id: @resource.id), + class: "c-progress__tab1#{ (params[:controller]&.end_with?('metadata_entry_pages') && params[:action] == 'find_or_create' ? '--active' : '' )} js-nav-out" %> <% unless @resource&.resource_type&.resource_type == 'collection' %> + <%= link_to 'Upload files', stash_url_helpers.upload_resource_path(@resource.id), + class: "c-progress__tab#{ (params[:controller]&.end_with?('resources') && params[:action].include?('upload') ? '--active' : '') } js-nav-out" %> + <%= link_to 'Prepare README', stash_url_helpers.prepare_readme_resource_path(@resource.id), - class: "c-progress__tab#{ (params[:controller]&.end_with?('resources') && params[:action].include?('readme') ? '--active' : '') } js-nav-out" %> + class: "c-progress__tab#{ (params[:controller]&.end_with?('resources') && params[:action].include?('readme') ? '--active' : '') } js-nav-out" %> - <%= link_to 'Upload files', stash_url_helpers.upload_resource_path(@resource.id), - class: "c-progress__tab#{ (params[:controller]&.end_with?('resources') && params[:action].include?('upload') ? '--active' : '') } js-nav-out" %> <% end %> <%= link_to 'Review and submit', stash_url_helpers.review_resource_path(@resource.id), - class: "c-progress__tab#{ (params[:controller]&.end_with?('resources') && params[:action] == 'review' ? '--active' : '') } js-nav-out" %> + class: "c-progress__tab#{ (params[:controller]&.end_with?('resources') && params[:action] == 'review' ? '--active' : '') } js-nav-out" %>
diff --git a/spec/features/stash_engine/upload_files_spec.rb b/spec/features/stash_engine/upload_files_spec.rb index 068c22afe7..64f79246f8 100644 --- a/spec/features/stash_engine/upload_files_spec.rb +++ b/spec/features/stash_engine/upload_files_spec.rb @@ -79,8 +79,8 @@ end it 'shows the right navigation buttons at the bottom' do - expect(page). to have_content('Back to README') - expect(page). to have_content('Proceed to Review') + expect(page). to have_content('Back to Describe dataset') + expect(page). to have_content('Proceed to README') end it 'shows only files with status different of "deleted"' do @@ -356,7 +356,7 @@ end it 'disallows navigation away with pending uploads' do - click_on('Proceed to Review') + click_on('Proceed to README') sleep 0.5 expect(page).to have_text('please click "Upload pending files"') end From a9c73abfbc799f4dffdd3cf8a7ff4f132c824c48 Mon Sep 17 00:00:00 2001 From: Audrey Hamelers Date: Thu, 27 Jun 2024 18:40:33 +0200 Subject: [PATCH 02/15] rename file --- .../react/containers/{ReadMe.jsx => ReadMeWizard.jsx} | 0 app/views/stash_engine/resources/prepare_readme.html.erb | 2 +- 2 files changed, 1 insertion(+), 1 deletion(-) rename app/javascript/react/containers/{ReadMe.jsx => ReadMeWizard.jsx} (100%) diff --git a/app/javascript/react/containers/ReadMe.jsx b/app/javascript/react/containers/ReadMeWizard.jsx similarity index 100% rename from app/javascript/react/containers/ReadMe.jsx rename to app/javascript/react/containers/ReadMeWizard.jsx diff --git a/app/views/stash_engine/resources/prepare_readme.html.erb b/app/views/stash_engine/resources/prepare_readme.html.erb index e289b4703c..9703db5296 100644 --- a/app/views/stash_engine/resources/prepare_readme.html.erb +++ b/app/views/stash_engine/resources/prepare_readme.html.erb @@ -20,7 +20,7 @@ <% end %> -<%= react_component('containers/ReadMe', { +<%= react_component('containers/ReadMeWizard', { dcsDescription: @metadata_entry.technical_info, updatePath: descriptions_update_path, fileContent: @file_content, From 68a8b1d1a319eaded9d0aa4dd63e09b09f6de0c3 Mon Sep 17 00:00:00 2001 From: Audrey Hamelers Date: Thu, 27 Jun 2024 20:55:45 +0200 Subject: [PATCH 03/15] update style --- app/assets/stylesheets/scss/_footer.scss | 14 +++++++++++--- .../metadata_entry_pages/_find_or_create.html.erb | 2 ++ .../stash_engine/resources/prepare_readme.html.erb | 5 +++-- app/views/stash_engine/resources/upload.html.erb | 4 ++-- 4 files changed, 18 insertions(+), 7 deletions(-) diff --git a/app/assets/stylesheets/scss/_footer.scss b/app/assets/stylesheets/scss/_footer.scss index 0e08ae9b47..aacbd07769 100644 --- a/app/assets/stylesheets/scss/_footer.scss +++ b/app/assets/stylesheets/scss/_footer.scss @@ -1,9 +1,17 @@ // ##### Footer Component ##### // #maincontent { - min-height: 79vh; - @media (max-width: 1060px) { min-height: 75vh; } - @media (max-width: 900px) { min-height: 70vh; } + min-height: calc(100vh - 240px); + @media (max-width: 968px) { min-height: calc(100vh - 280px); } + @media (max-width: 870px) { min-height: calc(100vh - 306px); } + @media (max-width: 640px) { min-height: calc(100vh - 346px); } + + #submission-wizard { + min-height: calc(100vh - 320px); + @media (max-width: 968px) { min-height: calc(100vh - 360px); } + @media (max-width: 870px) { min-height: calc(100vh - 386px); } + @media (max-width: 640px) { min-height: calc(100vh - 426px); } + } } .c-footer { diff --git a/app/views/stash_datacite/metadata_entry_pages/_find_or_create.html.erb b/app/views/stash_datacite/metadata_entry_pages/_find_or_create.html.erb index ceedd56622..db4a7949b6 100644 --- a/app/views/stash_datacite/metadata_entry_pages/_find_or_create.html.erb +++ b/app/views/stash_datacite/metadata_entry_pages/_find_or_create.html.erb @@ -1,3 +1,5 @@ +
<%= render partial: 'stash_engine/shared/dataset_steps_nav' %> <%= render partial: 'stash_datacite/metadata_entry_pages/metadata_entry_form' %> +
<%= render partial: 'stash_engine/shared/dataset_steps_bottom_nav', locals: {page: 1} %> diff --git a/app/views/stash_engine/resources/prepare_readme.html.erb b/app/views/stash_engine/resources/prepare_readme.html.erb index 9703db5296..30adfcd4ee 100644 --- a/app/views/stash_engine/resources/prepare_readme.html.erb +++ b/app/views/stash_engine/resources/prepare_readme.html.erb @@ -1,4 +1,5 @@ - <% @page_title = "Prepare your README – publish and preserve your data" %> +<% @page_title = "Prepare your README – publish and preserve your data" %> +
<%= render partial: 'stash_engine/shared/dataset_non_user_editor', locals: {resource: @resource} %> <%= render partial: 'stash_engine/shared/dataset_steps_nav' %> @@ -27,5 +28,5 @@ title: @resource.title || 'Title of Dataset', doi: @resource.identifier_uri }) %> - +
<%= render partial: 'stash_engine/shared/dataset_steps_bottom_nav', locals: {page: 2} %> diff --git a/app/views/stash_engine/resources/upload.html.erb b/app/views/stash_engine/resources/upload.html.erb index 4a7ef58431..0f79278e87 100644 --- a/app/views/stash_engine/resources/upload.html.erb +++ b/app/views/stash_engine/resources/upload.html.erb @@ -1,4 +1,5 @@ <% @page_title = "Upload your files — publish and preserve your data" %> +
<%= render partial: 'stash_engine/shared/dataset_non_user_editor', locals: {resource: @resource} %> <%= render partial: 'stash_engine/shared/dataset_steps_nav' %> @@ -25,9 +26,8 @@ }) %> -
+
- <%= render partial: 'stash_engine/shared/dataset_steps_bottom_nav', locals: {page: 3} %>