-
Notifications
You must be signed in to change notification settings - Fork 24
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
IDSEQ-1178 - Stronger validation for input filenames #2538
Changes from 2 commits
dfb9963
764f3b5
aa56e5d
a236276
cce4f00
78baee8
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -129,6 +129,12 @@ class LocalSampleFileUpload extends React.Component { | |
Paired files must be labeled with "_R1" or | ||
"_R2" at the end of the basename. | ||
</li> | ||
<li> | ||
File names must be no longer than 120 characters and can only | ||
contain letters from English alphabet (A-Z, upper and lower | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. super nit: *the English alphabet ? (and below) |
||
case), numbers (0-9), periods (.), hyphens (-) and underscores | ||
(_). Spaces are not allowed. | ||
</li> | ||
</ul> | ||
</div> | ||
)} | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -133,6 +133,13 @@ class RemoteSampleFileUpload extends React.Component { | |
Paired files must be labeled with "_R1" or | ||
"_R2" at the end of the basename. | ||
</li> | ||
<li> | ||
File names must be no longer than 120 characters and can only | ||
contain letters from English alphabet (A-Z, upper and lower | ||
case), numbers (0-9), periods (.), hyphens (-) and underscores | ||
(_). Spaces are not allowed. | ||
</li> | ||
<li>File names must be no longer than 140 characters.</li> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This line is not included above? Any particular reason? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. No, actually that line should have been removed, since the previous item already includes it. Thank you for pointing it out. |
||
</ul> | ||
</div> | ||
)} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you make this text a constant for reuse?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You mean, the entire text or just this new sentence? Because it seems there are other lines that can be reused as well.
Do you think this is a blocker for this PR or is it a sanitization task that we should consider a specific PR dedicated to remove such redundancies?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would prefer to do it since it is a new sentence. It is not the problem of redundancy but keeping it in sync.
I see your point but I prefer to start doing it and set an example than keep following a bad pattern.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Considering this is not only about this sentence, but the entire block of instructions (the previous 2
<li>
items are exactly the same), would it make sense to create a new react component with these instructions instead of using a constant?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@tfrcarvalho Do we have any pre-existing pattern that I should follow in this case?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, you got me convinced. Let's just make a low priority jira task to just consolidate this