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
Bug 1894374: prevent prevent loading by type #7099
Bug 1894374: prevent prevent loading by type #7099
Conversation
@yaacov: This pull request references Bugzilla bug 1894374, which is invalid:
Comment In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
@matthewcarleton @glekner @pcbailey please review |
/bugzilla refresh |
@yaacov: This pull request references Bugzilla bug 1894374, which is valid. The bug has been moved to the POST state. The bug has been updated to refer to the pull request using the external bug tracker. 3 validation(s) were run on this bug
In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
@matthewcarleton I added a hint about the file extensions as you suggested in Jira, please re review: /retest |
@yaacov yes that's better :) |
lgtm! |
@@ -529,6 +513,9 @@ export const UploadPVCPage: React.FC<UploadPVCPageProps> = (props) => { | |||
const handleFileChange = (value, filename) => { | |||
setFileName(filename); | |||
setFileValue(value); | |||
|
|||
setFileNameExtension(/[.][^.]+$/.exec(filename)?.toString()); | |||
setIsFileRejected(false); |
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.
when is isFileRejected true? @yaacov
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.
it is set by the UploadPVCForm
when file extension is unexpected, but is not reset back on field clear, this line reset it back when the offending file is cleared but no new file is selected.
@yaacov please squash the commits so I can lgtm |
e160b45
to
78e1498
Compare
@glekner squashed 👍 |
/retest |
</p> | ||
</Alert> | ||
) : ( | ||
undefined |
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.
why ternary condition?
just do isFileRejected &&
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.
isFileRejected
is boolean, so if we use &&
we get into a grey area of how to render false
[1] , I preferred here to be explicit and make sure I understand isFileRejected
is boolean, by explicitly render {undefined}
instead of false
which is redundant but explicit. On the other hand it does looks prettier with &&
so changing to using &&
👍
78e1498
to
bbdb3dd
Compare
/retest |
1 similar comment
/retest |
/lgtm |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: glekner, yaacov The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
/retest Please review the full test history for this PR and help us cut down flakes. |
3 similar comments
/retest Please review the full test history for this PR and help us cut down flakes. |
/retest Please review the full test history for this PR and help us cut down flakes. |
/retest Please review the full test history for this PR and help us cut down flakes. |
/retest |
2 similar comments
/retest |
/retest |
/retest Please review the full test history for this PR and help us cut down flakes. |
6 similar comments
/retest Please review the full test history for this PR and help us cut down flakes. |
/retest Please review the full test history for this PR and help us cut down flakes. |
/retest Please review the full test history for this PR and help us cut down flakes. |
/retest Please review the full test history for this PR and help us cut down flakes. |
/retest Please review the full test history for this PR and help us cut down flakes. |
/retest Please review the full test history for this PR and help us cut down flakes. |
@yaacov: All pull requests linked via external trackers have merged: Bugzilla bug 1894374 has been moved to the MODIFIED state. In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
The file to upload using the upload screen does not have to have any extension, it is quite normal to have a raw file without any extension (e.g. my-fedora-disk and not my-fedora-disk.img). The problem is, that we block the user from uploading such a file with an error.
Screenshots:
After:
Before: