-
Notifications
You must be signed in to change notification settings - Fork 30
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
RHSTOR-6347: Enable recipe-based DR enrollment for discovered applications #1589
RHSTOR-6347: Enable recipe-based DR enrollment for discovered applications #1589
Conversation
@GowthamShanmugam: This pull request references RHSTOR-6347 which is a valid jira issue. 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 openshift-eng/jira-lifecycle-plugin repository. |
c079f30
to
536c3a3
Compare
f677a51
to
4384c78
Compare
|
||
const prevLoader = React.useRef<PromiseComponent>(null); | ||
|
||
const setComponent = React.useCallback( | ||
(value) => { | ||
Component.current = value; | ||
setLoaded(true); | ||
if (mounted.current) { | ||
setLoaded(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.
To fix unit test case waring, React state update on an unmounted component
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.
Just curious: there are other state variables too, why jest is complaining only about this one in particular ??
Also, why doesn't it do so for other components that we have in this repo, why only this ??
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.
are we sure there isn't some other reason for this warning ??
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 verified in the console warning that this error is only being raised in jest, and I am not receiving it. The async function's state update, which was carried out after the component unmounts, is the cause of this error. This is occurring as a result of the jest test case being executed more quickly.
adding act() function has resolved this issue.
@@ -295,23 +294,23 @@ export const PVCDetailsWizardContent: React.FC<PVCDetailsWizardContentProps> = | |||
return ( | |||
<Form> | |||
<FormGroup> | |||
<Text> | |||
<span> |
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.
To fix unit test case waring, div cannot appear as a descendant of p
4384c78
to
761ed9b
Compare
761ed9b
to
74d61f1
Compare
@@ -152,7 +156,7 @@ export const SelectableTable: SelectableTableProps = < | |||
onSelect: onSelect, | |||
isSelected: isRowSelected(getUID(row), selectedRows), | |||
isDisabled: | |||
!isRowSelectable?.(row) || | |||
(!!isRowSelectable && !isRowSelectable?.(row)) || |
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.
this is not needed... !isRowSelectable?.(row)
syntax will only execute when function exists, else not...
(!!isRowSelectable && !isRowSelectable?.(row)) || | |
(!isRowSelectable?.(row) || |
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.
original line was correct...
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.
The issue in original condition is,
isRowSelectable?: IsRowSelectable; is mentioned as optional. But if the component is not passing isRowSelectable, then !isRowSelectable?.(row)always returns True, and all the rows are disabled by default. It's not correct.
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.
got it !!
then probably we can remove ?.
part entirely... it's not needed when we are using condition like !!isRowSelectable && ...
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, is it won't affect fusion UI? i think fusion is using this table
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 should not affect 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.
oh! got it. which ? part you have mentioned
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 meant using !!isRowSelectable && !isRowSelectable(row))
instead of !!isRowSelectable && !isRowSelectable?.(row))
.
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 we optionally call isRowSelectable
.
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, changes done
@@ -47,13 +47,18 @@ const useAsynchronousLoading: UseAsynchronousLoading = ( | |||
const Component = React.useRef<React.ComponentType>(null); | |||
const [loadingStarted, setLoadingStarted] = React.useState(false); | |||
const [loaded, setLoaded] = React.useState(false); | |||
// Mount status for safty state updates |
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.
// Mount status for safty state updates | |
// Mount status for safely state updates |
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.
we can remove the comment as well... it's kind of self-explanatory from variable name itself...
47a7fc9
to
ca5546c
Compare
sortedRows?.filter((selectedRow) => | ||
!!isRowSelectable | ||
? isRowSelectable(selectedRow) | ||
: true && hasNoDeletionTimestamp(selectedRow) | ||
) || []; |
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 do we need this ??
sortedRows?.filter(isRowSelectable || hasNoDeletionTimestamp) || [];
format is correct, filter
takes a callback as it's argument.
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.
even if isRowSelectable
is undefined here that should work as expected...
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! my bad
// fireEvent.click(screen.getByText('Recipe')); | ||
// fireEvent.click(screen.getByText('Select a recipe')); | ||
// fireEvent.click(screen.getByText('mock-recipe-1')); | ||
fireEvent.click(screen.getByText('Recipe')); |
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.
Please don't use fireEvent: use user-event
instead.
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 have n example of user-event
usage here.
…tions Signed-off-by: Gowtham Shanmugasundaram <[email protected]>
ca5546c
to
1fe79bd
Compare
/approve |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: GowthamShanmugam, SanjalKatiyar 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 |
4bae5b0
into
red-hat-storage:master
No description provided.