gigascience / gigadb-website

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

File attribute, character limit when adding via Admin pages #2066

Open tuli opened 3 days ago

tuli commented 3 days ago

User story

As a curator I want to associate sample value to a dataset file So that the the sample used or refered to by the file is linked

Acceptance tests

 Scenario: Can add very long sample value
    Given I have signed in as admin
    And I am on "/adminFile/update/id/13973"
    And I press the button "Show New Attribute Fields"
    When I select "Example data" in menu "FileAttributes_new_attribute_id"
    And I fill in the text input "FileAttributes[new][value]" with "embryophyta_odb10 C:99.1%[S:77.9%,D:21.2%],F:0.4%,M:0.5%,n:1614"
    And I press the button "Add attribute"
    Then I should see a file attribute table
      | Attribute Name | Value     | Unit |
      | last_modified  | 2013-7-15 |      |
      | Example data            | embryophyta_odb10 C:99.1%[S:77.9%,D:21.2%],F:0.4%,M:0.5%,n:1614       |      |
 Scenario: Can edit in a very long sample value
    Given I have signed in as admin
    And I am on "/adminFile/update/id/13973"
    And I press the button "Edit"
    And I fill in the text input "FileAttributes[edit][value]" with "Monday 15th July 2013, 00:00:00 AM Europe/Paris, 3463456435745634256234623456234562 bytes changed, version 235235.3423523"
    And I press the button "Save Attribute"
    Then I should see a file attribute table
      | Attribute Name | Value     | Unit |
      | last_modified  | Monday 15th July 2013, 00:00:00 AM Europe/Paris, 3463456435745634256234623456234562 bytes changed, version 235235.3423523 |      |

Additional infos

Describe the bug There is a character limit on File Attributes when added via the File Admin page.

To Reproduce Steps to reproduce the behavior:

  1. Go to https://gigadb.org/adminFile/update/id/546450
  2. Scroll down to Attributes
  3. Note that "embryophyta_odb10 C99.1%[S" was truncated during spreadsheet upload (a different issue).
  4. Click Edit
  5. Attempt to add "embryophyta_odb10 C:99.1%[S:77.9%,D:21.2%],F:0.4%,M:0.5%,n:1614"
  6. Note that only "embryophyta_odb10 C:99.1%[S:77.9%,D:21.2%],F:0.4%," is allowed.

Expected behavior When I paste "embryophyta_odb10 C:99.1%[S:77.9%,D:21.2%],F:0.4%,M:0.5%,n:1614" I want the whole value to be pasted in.

Screenshots Screenshot 2024-10-22 at 14 28 54

Desktop (please complete the following information): iOS Venture 13.4 Browser Safari Version 16.5

Additional context This is for a dataset that I am making public. I can still do so w/o these values (I can add them later), but it's something that I'd like fixed soon please.

rija commented 2 days ago

Hi @luistoptal,

After checking the database schema (which allow long sample values), the issue seems to be only an HTML issue (max 50 limit in HTML).

This issue would benefit from a new test scenarios being added to tests/acceptance/AdminFileAttributes.feature. See the "Acceptance tests" section in the description of this issue for example scenarios.