mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2024-09-21 07:26:15 +08:00
Merge pull request #2458 from aignatov-bio/ai-sci-4441-remove-uneditable-projects-in-create-task-widget
Remove uneditable projects from create task widget [SCI-4441]
This commit is contained in:
commit
25211dd70b
|
@ -20,7 +20,9 @@ module Dashboard
|
|||
end
|
||||
|
||||
def project_filter
|
||||
projects = current_team.projects.search(current_user, false, params[:query], 1, current_team).select(:id, :name)
|
||||
projects = current_team.projects.search(current_user, false, params[:query], 1, current_team)
|
||||
.where('user_projects.role <= 1')
|
||||
.select(:id, :name)
|
||||
projects = projects.map { |i| { value: i.id, label: escape_input(i.name) } }
|
||||
if (projects.map { |i| i[:label] }.exclude? params[:query]) && params[:query].present?
|
||||
projects = [{ value: 0, label: params[:query] }] + projects
|
||||
|
|
|
@ -95,7 +95,7 @@ class ExperimentsController < ApplicationController
|
|||
@experiment.last_modified_by = current_user
|
||||
|
||||
if @experiment.save
|
||||
experiment_annotation_notification(old_text)
|
||||
experiment_annotation_notification(old_text) if old_text
|
||||
|
||||
activity_type = if experiment_params[:archived] == 'false'
|
||||
:restore_experiment
|
||||
|
|
Loading…
Reference in a new issue