gigascience / gigadb-website

Source code for running GigaDB
http://gigadb.org
GNU General Public License v3.0
9 stars 15 forks source link

Specify which usages an attributes is allowed for E564 #274

Open only1chunts opened 5 years ago

only1chunts commented 5 years ago

This is perhaps a task within the story #422 of Epic #564

user stories

As a curator I want to able to specify which usages an attribute can be allowed for So that the attributes are not misused

Acceptance criteria

Given there is a "BUSCO v5 result" attribute When I add it to a file record And I add it to a sample record Then saving both records should succeed

Given there is a "Geographic location" attribute When I add it to a file record And I add it to a sample record Then saving the sample record should succeed And saving the file record should fail with error "You cannot use attribute Geographic location on a file object"

Given there is a "license" attribute When I add it to a file record And I add it to a sample record Then saving the file record should succeed And saving the sample record should fail with error "You cannot use attribute license on a sample object"

Additional information

As an Admin- I would expect to see another column in the attributes table to allow me to define which data-tables can see each attribute As a submitter - I expect to only see attributes that are relevant to the type of item I am updating, e.g. sample attributes in the submission wizard should only show me sample attributes, and the file uploader only shows attributes suitable for files As a general user/viewer - i should see the current list of sample or files attributes with definitions on the sample and file attributes list pages

Currently the ATTRIBUTES table has attributes for Samples And for Files And for Datasets And for Experiments, we should add a column in the table to show which attributes are to be used in which tables. Some attributes maybe appropriate for multiple tables. This information will be used in submission wizard to reduce the number of attributes to show for samples AND for the file upload tools to allow users to select from a smaller number of attributes. It will also be used to show the help page view of Sample attributes (#272) and file attributes (#1165).

This Story is part of Epic #564

This is for attributes that already exists. Having authors being able to requests new attributes to be added to the system is taken care of in the ticket #1665

rija commented 2 years ago

If we filter the list of attribute possible for the context, we don't validate the saving of attribute because it becomes impossible to put the wrong attribute as the list is already filtered. We can make that change in the submission wizard, file upload wizard and the files attributes admin.

However, the sample attributes, at this stage sill take free text input for adding attributes. To be consistent, work on this story should changing that free text input into a filter like on file attributes. then this work is really about changing the schema and filtering list of possible attributes depending on the context.

rija commented 2 years ago

For the schema change, it's better to have two columns, valid_on_file, and valid_on_sample that take a boolean type (true or false), it make the filtering code less verbose.

only1chunts commented 2 years ago

This should also include valid on dataset. There's the forward thinking that it might be worth putting valid on experiment and valid on protocol, but I guess they can be added later if we need them.

On Fri, 13 May 2022, 08:07 Rija Ménagé, @.***> wrote:

For the schema change, it's better to have two columns, valid_on_file, and valid_on_sample that take a boolean type (true or false), it make the filtering code less verbose.

— Reply to this email directly, view it on GitHub https://github.com/gigascience/gigadb-website/issues/274#issuecomment-1125725250, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABOB5GJI6OJADN6UO7LXADLVJX5S5ANCNFSM4GSJNUCQ . You are receiving this because you authored the thread.Message ID: @.***>