mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2025-12-11 22:56:41 +08:00
Fix folders exports, add error message
SCI-5351
This commit is contained in:
parent
dbdfe4177d
commit
ddbc22b274
4 changed files with 6 additions and 5 deletions
|
|
@ -180,8 +180,8 @@
|
|||
// Show the modal
|
||||
exportProjectsModal.modal('show');
|
||||
},
|
||||
error: function() {
|
||||
// TODO
|
||||
error: function(data) {
|
||||
HelperModule.flashAlertMsg(data.responseJSON.flash, 'danger');
|
||||
}
|
||||
});
|
||||
});
|
||||
|
|
|
|||
|
|
@ -65,6 +65,8 @@ class TeamsController < ApplicationController
|
|||
status: 'error'
|
||||
}
|
||||
end
|
||||
else
|
||||
render json: { flash: I18n.t('projects.export_projects.zero_projects_flash') }, status: :unprocessable_entity
|
||||
end
|
||||
end
|
||||
|
||||
|
|
|
|||
|
|
@ -87,9 +87,7 @@ class ProjectFolder < ApplicationRecord
|
|||
end
|
||||
|
||||
def inner_projects
|
||||
project_folders.map do |inner_folder|
|
||||
projects + inner_folder.inner_projects
|
||||
end.flatten
|
||||
Project.where(project_folder: ProjectFolder.inner_folders(team, self) + [self])
|
||||
end
|
||||
|
||||
private
|
||||
|
|
|
|||
|
|
@ -460,6 +460,7 @@ en:
|
|||
modal_text_p3_html: "Please note that the number of exports is limited to %{limit} requests per day. After you confirm this export you will have %{num} left."
|
||||
modal_submit: "Export"
|
||||
success_flash: "Export request received. Your export request is being processed."
|
||||
zero_projects_flash: "You have to select at least one project"
|
||||
activity:
|
||||
visibility_hidden: "Project members only"
|
||||
visibility_visible: "All team members"
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue