Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ADD] launching task arrays by selecting multiple files in New Boutiques #1298

Open
wants to merge 6 commits into
base: dev
Choose a base branch
from

Conversation

natacha-beck
Copy link
Contributor

Closed #1201

Copy link
Member

@prioux prioux left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Double check all his, I really am not sure it works.

BrainPortal/app/models/boutiques_portal_task.rb Outdated Show resolved Hide resolved
BrainPortal/app/models/boutiques_portal_task.rb Outdated Show resolved Hide resolved
@natacha-beck natacha-beck changed the base branch from master to dev February 13, 2023 16:30
@natacha-beck

This comment was marked as outdated.

@natacha-beck

This comment was marked as outdated.

@prioux

This comment was marked as outdated.

@@ -522,21 +523,27 @@ def sanitize_param(input)
# Make sure the file ID is valid, accessible, not already used and
# of the correct type.
when :file
unless (Integer(value) rescue nil)
if !(Integer(value) rescue nil) && !single_file_input?
Copy link
Member

@prioux prioux Apr 19, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't understand why the fact we have a single file input is important when validating that a file's value is an integer? It shoudl always be validated, no?

@prioux
Copy link
Member

prioux commented Apr 19, 2023

I will need to review this carefully, just a read of the code is not enough for me to approve it. The changes are too complex and subtle.

Copy link
Member

@prioux prioux left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this entire change set is wrong. The code modified here is mostly in the method sanitize_params(), which is a validation method, not a method supposed to actually perform behavioral actions like assigning input files. It's just supposed to verify them.

Please reconsider the whole thing, it's sanitize_params is not the right place to implement this feaure.

file = Userfile.find_accessible_by_user(value, self.user, :access_requested => file_access_symbol()) rescue nil
unless file
params_errors.add(invokename, ": cannot find userfile (ID #{value})")
file_ids = value.blank? ? self.params[:interface_userfile_ids] : [value]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a list of userfile IDs [ 1, 2, 3 ]....

unless file
params_errors.add(invokename, ": cannot find userfile (ID #{value})")
file_ids = value.blank? ? self.params[:interface_userfile_ids] : [value]
file_ids = Userfile.find_all_accessible_by_user( self.user,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And not this is a list of PAIRS, ids and names [ [ 1, 'hello' ], [ 2, 'bye' ] ]

Why is that variable still called file_ids ?

:access_requested => file_access_symbol
).where(:id => file_ids).pluck(:id, :name) rescue nil

if !file_ids.present?
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How about .empty?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Boutiques Boutiques integration Enhancement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Re-implement launching task arrays by selecting multiple files in New Boutiques
2 participants