-
Notifications
You must be signed in to change notification settings - Fork 605
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 2018264: Delete Export button doesn't work in topology sidebar (general issue with unknown CSV?) #10457
Bug 2018264: Delete Export button doesn't work in topology sidebar (general issue with unknown CSV?) #10457
Conversation
@yozaam: This pull request references Bugzilla bug 2018264, 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
Requesting review from QA contact: 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. |
/retest-required |
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.
First of all, your PR works fine. 😄 But the new prop type confuses me.
This is not what the DeleteModalProps "allows". kind
is not optional, it should be defined. And if I search for deleteModal({
to get all code areas that want to open the delete modal, there is the only one that doesn't align with the other one.
(I believe) You can also fix this issue by changing csv-actions.ts
to
deleteModal({
kind: kindObj,
resource,
// ...
Similar to the other deleteModal({
calls.
Can you please check if the other changes here are then required if this caller aka the root cause is fixed? Maybe an additional null check is still worth it!
After this fix, I have still a general concern with the old code. This issue is introduced because the deleteModal
AND ALL OTHER functions exported in public/components/modals/index.ts
don't define an argument type.
It would be cool if you can check if build, tests, etc. works fine if you define the deleteModal
like this:
export const deleteModal = (props: DeleteModalProps) =>
import('./delete-modal' /* webpackChunkName: "delete-modal" */).then((m) => m.deleteModal(props));
I have just quick checked this and notice multiple errors after adding DeleteModalProps
- csv-actions.ts doesn't set the
kind
prop as mentioned above. - Some callers (csv-actions.ts and packages/operator-lifecycle-manager/src/components/operand/index.tsx) submits a
namespace
prop to the deleteModal function which is completely ignored! I think we can drop it from the caller code. - DeleteModalProps
message
prop is optional, only one caller submits this prop. - Some arguments are still missing, that happen because
DeleteModalProps
includes also& ModalComponentProps & HandlePromiseProps
. For this, I would recommend just defining theDeleteModalProps
with its own custom props.
export type DeleteModalProps = {
kind: K8sKind;
kindObj?: K8sKind;
resource: any;
close?: () => void;
redirectTo?: any;
message?: JSX.Element;
cancel?: () => void;
btnText?: string;
};
And then using these props in the function call as union type, like this:
const DeleteModal = withHandlePromise((props: DeleteModalProps & HandlePromiseProps) => {
ModalComponentProps is not used in this function, so I believe we can remove the import and ignore it as well.
Sorry, much longer than expected for an already working PR 👍 But I really think we should fix this without a new prop (which uses just another name) and I also would like to improve our TS strongly-type check quality here. Wdyt? :)
I also would like to create a tech dept story for the other missing modal props if this works fine for the delete modal.
821264e
to
c41519d
Compare
Thank you @jerolimov |
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.
Tested this locally and the code works fine for the broken as well as other known resources.
/lgtm
/approve
/retest |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: jerolimov, yozaam 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-required Please review the full test history for this PR and help us cut down flakes. |
10 similar comments
/retest-required Please review the full test history for this PR and help us cut down flakes. |
/retest-required Please review the full test history for this PR and help us cut down flakes. |
/retest-required Please review the full test history for this PR and help us cut down flakes. |
/retest-required Please review the full test history for this PR and help us cut down flakes. |
/retest-required Please review the full test history for this PR and help us cut down flakes. |
/retest-required Please review the full test history for this PR and help us cut down flakes. |
/retest-required Please review the full test history for this PR and help us cut down flakes. |
/retest-required Please review the full test history for this PR and help us cut down flakes. |
/retest-required Please review the full test history for this PR and help us cut down flakes. |
/retest-required Please review the full test history for this PR and help us cut down flakes. |
/retest-required Please review the full test history for this PR and help us cut down flakes. |
5 similar comments
/retest-required Please review the full test history for this PR and help us cut down flakes. |
/retest-required Please review the full test history for this PR and help us cut down flakes. |
/retest-required Please review the full test history for this PR and help us cut down flakes. |
/retest-required Please review the full test history for this PR and help us cut down flakes. |
/retest-required Please review the full test history for this PR and help us cut down flakes. |
@yozaam: All pull requests linked via external trackers have merged: Bugzilla bug 2018264 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. |
Fixes:
https://bugzilla.redhat.com/show_bug.cgi?id=2018264
https://issues.redhat.com/browse/OCPBUGSM-36630
Analysis / Root cause:
kind
was undefined as it was passed in the props askindObj
Solution Description:
If
kind
is undefined, then search forkindObj
and also double check ifkind
is not undefined when accessing its property labelScreen shots / Gifs for design review:
Unit test coverage report:
Test setup:
Steps to Reproduce:
Browser conformance: