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

Merge branch 'implementation/47147-extend-existing-view-for-adding-storages-to-projects' into implementation/47150-add-help-text-to-project-folder-label

Kabiru Mwenja0c6662a1be4b
diff --cc modules/storages/app/views/storages/project_settings/_form.html.erb
index fc5f5a3b54e,588242ecab1..0fa8b459ee3
--- a/modules/storages/app/views/storages/project_settings/_form.html.erb
+++ b/modules/storages/app/views/storages/project_settings/_form.html.erb
@@@ -12,35 -22,58 +22,66 @@@
<% end %>
</div>
- <div class="form--field -required">
- <%= styled_label_tag :project_folder_mode, class: "-bold" do %>
- <%= t(:"storages.label_project_folder") %>
- <%= angular_component_tag 'op-static-attribute-help-text',
- inputs: {
- title: "Title",
- content: "Lorem ipsum sit ajsakjdkassjd asdjkasjd",
- }
- %>
- <% end %>
- <div class="form--field-container -horizontal">
- <%= f.label :project_folder_mode, class: "form--label-with-radio-button" do %>
- <%= f.radio_button :project_folder_mode, 'inactive', no_label: true %>
- <%= t(:"storages.label_no_specific_folder") %>
+ <% if OpenProject::FeatureDecisions.storage_project_folders_active? %>
+ <div class="form--field -required">
- <label class="form--label -bold">Project folder</label>
++ <%= styled_label_tag :project_folder_mode, class: "-bold" do %>
++ <%= t(:"storages.label_project_folder") %>
++ <%= angular_component_tag 'op-static-attribute-help-text',
++ inputs: {
++ title: "Title",
++ content: "Lorem ipsum sit ajsakjdkassjd asdjkasjd",
++ }
++ %>
+ <% end %>
+ <div class="form--field-container -horizontal">
+ <%= f.label :project_folder_mode, class: "form--label-with-radio-button" do %>
+ <%= f.radio_button :project_folder_mode, 'inactive', no_label: true %>
+ <%= t(:"storages.label_no_specific_folder") %>
+ <% end %>
+ </div>
+ <p class="form--field-instructions">
+ <%= t(:"storages.instructions.no_specific_folder") %>
+ </p>
+
+ <div class="form--field-container -horizontal">
+ <%= f.label :project_folder_mode, class: "form--label-with-radio-button" do %>
+ <%= f.radio_button :project_folder_mode, 'manual', no_label: true %>
+ <%= t(:"storages.label_existing_manual_folder") %>
+ <% end %>
+ </div>
+ <p class="form--field-instructions -xwide">
+ <%= t(:"storages.instructions.existing_manual_folder") %>
+ </p>
</div>
- <p class="form--field-instructions">
- <%= t(:"storages.instructions.no_specific_folder") %>
- </p>
- <div class="form--field-container -horizontal">
- <%= f.label :project_folder_mode, class: "form--label-with-radio-button" do %>
- <%= f.radio_button :project_folder_mode, 'manual', no_label: true %>
- <%= t(:"storages.label_existing_manual_folder") %>
- <% end %>
+ <div style="display:none;" id="storages_manual_folder_selection" class="form--field -required">
+ <label class="form--label -bold"> <%= t(:"storages.label_existing_manual_folder_selection") %> </label>
+ <div class="form--field-container -horizontal">
+ <%= f.text_field :project_folder_id,
+ placeholder: t(:"storages.placeholder_existing_folder_selection"),
+ container_class: "-middle",
+ no_label: true
+ %>
+ </div>
</div>
- <p class="form--field-instructions -xwide">
- <%= t(:"storages.instructions.existing_manual_folder") %>
- </p>
- </div>
- <%= styled_button_tag t(:button_add), class: "-highlight -with-icon icon-checkmark" %>
+ <%= nonced_javascript_tag do -%>
+ jQuery(function($) {
+ <%# Show manual folder selection on reload when checked %>
+ $("#storages_project_storage_project_folder_mode_manual").is(':checked') && $("#storages_manual_folder_selection").show();
+
+ $("input[type='radio']").change(function() {
+ if ($(this).val() == 'manual') {
+ $("#storages_manual_folder_selection").show();
+ } else {
+ $("#storages_manual_folder_selection").hide();
+ }
+ })
+ });
+ <% end -%>
+ <% end %>
+
+ <div class="form--field">
+ <%= styled_button_tag submit_button_label, class: "-highlight -with-icon icon-checkmark" %>
+ <%= link_to t(:button_cancel), project_settings_projects_storages_path(@project), class: 'button -with-icon icon-cancel' %>
+ </div>
diff --cc modules/storages/config/locales/en.yml
index 98676ab7d75,f63a1de19ea..e17b4041447
--- a/modules/storages/config/locales/en.yml
+++ b/modules/storages/config/locales/en.yml
@@@ -90,9 -96,9 +96,10 @@@ en
label_oauth_application_details: "OAuth application details"
label_oauth_client_details: "OAuth client details"
label_provider_type: "Provider type"
+ label_project_folder: "Project folder"
label_new_storage: "New storage"
label_existing_manual_folder: "Existing folder with manually managed permissions"
+ label_existing_manual_folder_selection: "Existing folder selection"
label_no_specific_folder: "No specific folder"
label_storage: "Storage"
label_storages: "Storages"