mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2024-11-15 05:34:53 +08:00
Merge branch 'develop' into ai-sci-11264-show-file-versions-with-view-permissions
This commit is contained in:
commit
67f142438f
6 changed files with 41 additions and 6 deletions
|
@ -151,7 +151,25 @@ class GlobalActivitiesController < ApplicationController
|
||||||
end
|
end
|
||||||
|
|
||||||
def activity_filter_params
|
def activity_filter_params
|
||||||
params.permit(:name, filter: {})
|
params.permit(
|
||||||
|
:name,
|
||||||
|
filter: [
|
||||||
|
:to_date,
|
||||||
|
:from_date,
|
||||||
|
{ types: [] },
|
||||||
|
{ subjects: {
|
||||||
|
'Report' => [],
|
||||||
|
'Project' => [],
|
||||||
|
'MyModule' => [],
|
||||||
|
'Protocol' => [],
|
||||||
|
'Experiment' => [],
|
||||||
|
'RepositoryRow' => [],
|
||||||
|
'RepositoryBase' => []
|
||||||
|
} },
|
||||||
|
{ users: [] },
|
||||||
|
{ teams: [] }
|
||||||
|
]
|
||||||
|
)
|
||||||
end
|
end
|
||||||
|
|
||||||
def activity_filters
|
def activity_filters
|
||||||
|
|
|
@ -361,7 +361,7 @@ class ReportsController < ApplicationController
|
||||||
|
|
||||||
def report_params
|
def report_params
|
||||||
params.require(:report)
|
params.require(:report)
|
||||||
.permit(:name, :description, :grouped_by, :report_contents, settings: {})
|
.permit(:name, :description, :grouped_by, :report_contents, settings: permit_report_settings_structure(Report::DEFAULT_SETTINGS))
|
||||||
end
|
end
|
||||||
|
|
||||||
def search_params
|
def search_params
|
||||||
|
|
|
@ -145,7 +145,10 @@ class SearchController < ApplicationController
|
||||||
|
|
||||||
def quick
|
def quick
|
||||||
results = if params[:filter].present?
|
results = if params[:filter].present?
|
||||||
object_quick_search(params[:filter].singularize)
|
class_name = params[:filter].singularize
|
||||||
|
return render_422(t('general.invalid_params')) unless Constants::QUICK_SEARCH_SEARCHABLE_OBJECTS.include?(class_name)
|
||||||
|
|
||||||
|
object_quick_search(class_name)
|
||||||
else
|
else
|
||||||
Constants::QUICK_SEARCH_SEARCHABLE_OBJECTS.filter_map do |object|
|
Constants::QUICK_SEARCH_SEARCHABLE_OBJECTS.filter_map do |object|
|
||||||
next if object == 'label_template' && !LabelTemplate.enabled?
|
next if object == 'label_template' && !LabelTemplate.enabled?
|
||||||
|
|
|
@ -106,4 +106,17 @@ module ReportsHelper
|
||||||
experiment_element.experiment.description
|
experiment_element.experiment.description
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def permit_report_settings_structure(settings_definition)
|
||||||
|
settings_definition.each_with_object([]) do |(key, value), permitted|
|
||||||
|
permitted << case value
|
||||||
|
when Hash
|
||||||
|
{ key => permit_report_settings_structure(value) }
|
||||||
|
when Array
|
||||||
|
{ key => [] }
|
||||||
|
else
|
||||||
|
key
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -134,11 +134,11 @@ export default {
|
||||||
document.getElementById('editImageButton').click();
|
document.getElementById('editImageButton').click();
|
||||||
},
|
},
|
||||||
refreshPreview() {
|
refreshPreview() {
|
||||||
const imageElement = document.querySelector('.file-preview-container .asset-image');
|
const filePreview = document.querySelector('.file-preview-container');
|
||||||
|
|
||||||
if (!imageElement) return;
|
if (!filePreview) return;
|
||||||
|
|
||||||
$('#filePreviewModal').modal('hide');
|
window.location.reload();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
|
@ -4305,6 +4305,7 @@ en:
|
||||||
comment_placeholder: "Your Message"
|
comment_placeholder: "Your Message"
|
||||||
comment_placeholder_new: "Add new comment…"
|
comment_placeholder_new: "Add new comment…"
|
||||||
archived: "Archived"
|
archived: "Archived"
|
||||||
|
invalid_params: "Invalid params"
|
||||||
sort:
|
sort:
|
||||||
title: "Sorting"
|
title: "Sorting"
|
||||||
new_html: "Started last"
|
new_html: "Started last"
|
||||||
|
|
Loading…
Reference in a new issue