Skip to content

Commit

Permalink
Fix: Max length for attribute value set to 1000(Merge pull request gi…
Browse files Browse the repository at this point in the history
…gascience#2069)

max length for attribute value set to 1000 in the view and models

Refs:  gigascience#2066
  • Loading branch information
rija authored Nov 12, 2024
2 parents b329684 + 4b22978 commit 1deb11f
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 4 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).

## Unreleased

- Fix #2066: Max length for attribute value set to 1000 in file admin form
- Feat #1968: Add curators manual for operating tools on bastion server
- Feat #1750: Switch to guzzle instead of cURL
- Fix #2042: Batch deletion of file attributes and samples
Expand Down
2 changes: 1 addition & 1 deletion protected/models/FileAttributes.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ public function rules()
return array(
array('file_id, attribute_id', 'required'),
array('file_id, attribute_id', 'numerical', 'integerOnly' => true),
array('value', 'length', 'max' => 50),
array('value', 'length', 'max' => 1000),
array('unit_id', 'length', 'max' => 30),
// The following rule is used by search().
// Please remove those attributes that should not be searched.
Expand Down
5 changes: 3 additions & 2 deletions protected/views/adminFile/_form.php
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,8 @@
'class' => 'mb-10'
],
'inputOptions' => [
'class' => 'attr-form'
'class' => 'attr-form',
'maxlength' => 1000
],
'tooltip' => 'The value of the chosen attribute for this file'
]);
Expand Down Expand Up @@ -316,4 +317,4 @@ function toggleNewAttrForm() {
}, 200);
})
})
</script>
</script>
16 changes: 15 additions & 1 deletion tests/acceptance/AdminFileAttributes.feature
Original file line number Diff line number Diff line change
Expand Up @@ -158,4 +158,18 @@ Feature: A curator can manage file attributes in admin file update page
Then I should see a file attribute table
| Attribute Name | Value | Unit |
| last_modified | 2013-7-15 | |
| age | 35 | |
| age | 35 | |

@ok @issue-2066
Scenario: Works for the new attribute's length value up to 1000
Given I have signed in as admin
And I am on "/adminFile/update/id/13973"
And I press the button "Edit"
And I press the button "Show New Attribute Fields"
When I select "comment" 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 | |
| comment | embryophyta_odb10 C:99.1%[S:77.9%,D:21.2%],F:0.4%,M:0.5%,n:1614 | |

0 comments on commit 1deb11f

Please sign in to comment.