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
Fixed backingstore creation page css and added basic check. #3213
Fixed backingstore creation page css and added basic check. #3213
Conversation
const [disabled, setDisabled] = React.useState(true); | ||
|
||
React.useEffect(() => { | ||
if (bsName.length > 0) setDisabled(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.
if (bsName.length > 0) setDisabled(false); | |
if (bsName.length > 0 || providerDataState.target.length > 0) setDisabled(false); | |
else setDisabled(true); |
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.
&& ?
6beb20c
to
c130d20
Compare
/kind bug |
c130d20
to
e7d84f7
Compare
e7d84f7
to
b4e8212
Compare
/test e2e-gcp-console |
/hold |
@@ -58,6 +58,7 @@ const CreateBackingStoreFormPage: React.FC<CreateBackingStoreFormPageProps> = ({ | |||
variant="info" | |||
title="What is a BackingStore?" | |||
action={<AlertActionCloseButton onClose={() => setShowHelp(false)} />} | |||
className="nb-bs__info" |
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.
What is this class for ?
Not seeing used anywhere.
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.
right! removed it during merge conflicts. But forgot to remove this. Thanks.
React.useEffect(() => { | ||
if (bsName.length > 0 && providerDataState.target.length > 0) setDisabled(false); | ||
else setDisabled(true); | ||
}, [bsName, providerDataState]); |
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.
What's the use case for setting it through state, why not using isRequired
?
The button itself wont submit without it and will display a message.
This would reduce extra costs on UI end too.
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.
Also, are we allowing user to create backing store without selecting secret ?
I think secret should be selected as required too.
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.
There are scenarios when secret is not required. Hence no need to enforce it.
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.
isRequired
does not disable the button. It adds the *. But the request still goes through.
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.
yeah! and you will get error message to fill out the field.
I feel it should be like that and this is how it is at various places in openshift.
e.g create pvc, projects,etc.
I am seeing this Lines 56 to 68 in b4e8212
|
This is how the design is. There is no external link. @afreen23 |
b4e8212
to
f0fee18
Compare
|
||
const { cancel, close, inProgress, errorMessage, handlePromise, isPage } = props; | ||
React.useEffect(() => { | ||
if (bsName.length > 0 && providerDataState.target.length > 0) setDisabled(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.
dont you need to call trim() to make sure you wont accept just space like
?
You can also make it shorter by calling just setDisabled(!(bsName.length > 0 && providerDataState.target.length > 0))
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.
ack
I just feel info at both places would be consistent. It could be missed though @shirimordechay ^^ |
c42c86b
to
d01178a
Compare
/test e2e-gcp-console |
11f22c4
to
2e31aac
Compare
/hold cancel |
/retest images e2e-gcp-console |
/retest |
2e31aac
to
3f89e6d
Compare
3f89e6d
to
de12447
Compare
/lgtm |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: afreen23, bipuladh, cloudbehl 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. |
/retest |
/retest Please review the full test history for this PR and help us cut down flakes. |
4 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. |
Scrshot: