Skip to content
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

Update Event Source & Channel Sources for Add flow #6294

Merged
merged 1 commit into from Aug 14, 2020

Conversation

rottencandy
Copy link
Contributor

Fixes:
https://issues.redhat.com/browse/ODC-4460

Analysis / Root cause:
Event Sources list gets fetched only on plugin load, and do not get updated after operator install.

Solution Description:
Use hooks to fetch and update Event & Channel sources when required in the Add page.

Unit test coverage report:
Unchanged.

Browser conformance:

  • Chrome
  • Firefox
  • Safari
  • Edge

Comment on lines 224 to 225
// eslint-disable-next-line react-hooks/exhaustive-deps
}, []);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it's okay to keep the dependency here

Suggested change
// eslint-disable-next-line react-hooks/exhaustive-deps
}, []);
}, [setModelRefs]);

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated.

@@ -66,8 +66,7 @@ export const useChannelList = (namespace: string): ChannelListProps => {
})
// eslint-disable-next-line no-console
.catch((err) => console.warn(err.message));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you please add a console warning msg here as well

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added

@rottencandy rottencandy force-pushed the eventsources branch 4 times, most recently from b5573b3 to 645e9df Compare August 12, 2020 13:57
React.useEffect(() => {
_.forIn(channelResourcesList, (channelRef: string) => {
const accessList = [];
_.forIn(channelResourcesList.channels, (channelRef: string) => {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we add the .loaded condition here and wrap for both forIn and promise in it.

@@ -36,10 +36,10 @@ export const getChannelKind = (ref: string): string => {

export const useChannelList = (namespace: string): ChannelListProps => {
const [accessData, setAccessData] = useSafetyFirst({ loaded: false, channelList: [] });
const channelResourcesList = getDynamicChannelModelRefs();
const accessList = [];
const channelResourcesList = useChannelResourcesList();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

better to destructure loaded and channels here

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated.

@karthikjeeyar
Copy link
Contributor

Verified locally works fine
/lgtm

@openshift-ci-robot openshift-ci-robot added the lgtm Indicates that a PR is ready to be merged. label Aug 12, 2020
@invincibleJai
Copy link
Member

/approve

Verified the changes , it works as expected i.e on installation of serverless and creating knativeEventing CR , user don't need to refresh but if user adds channel or sources CRD explicitly (external ones not builtIn) then need reload.

@openshift-ci-robot openshift-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Aug 12, 2020
@rottencandy
Copy link
Contributor Author

/retest

Copy link
Contributor

@sahil143 sahil143 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/lgtm

@openshift-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: invincibleJai, karthikjeeyar, rottencandy, sahil143

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 /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@rottencandy
Copy link
Contributor Author

/retest

1 similar comment
@rottencandy
Copy link
Contributor Author

/retest

@openshift-bot
Copy link
Contributor

/retest

Please review the full test history for this PR and help us cut down flakes.

@rottencandy
Copy link
Contributor Author

/retest

@openshift-bot
Copy link
Contributor

/retest

Please review the full test history for this PR and help us cut down flakes.

4 similar comments
@openshift-bot
Copy link
Contributor

/retest

Please review the full test history for this PR and help us cut down flakes.

@openshift-bot
Copy link
Contributor

/retest

Please review the full test history for this PR and help us cut down flakes.

@openshift-bot
Copy link
Contributor

/retest

Please review the full test history for this PR and help us cut down flakes.

@openshift-bot
Copy link
Contributor

/retest

Please review the full test history for this PR and help us cut down flakes.

@openshift-bot
Copy link
Contributor

/retest

Please review the full test history for this PR and help us cut down flakes.

1 similar comment
@openshift-bot
Copy link
Contributor

/retest

Please review the full test history for this PR and help us cut down flakes.

@rottencandy
Copy link
Contributor Author

/retest

@openshift-bot
Copy link
Contributor

/retest

Please review the full test history for this PR and help us cut down flakes.

3 similar comments
@openshift-bot
Copy link
Contributor

/retest

Please review the full test history for this PR and help us cut down flakes.

@openshift-bot
Copy link
Contributor

/retest

Please review the full test history for this PR and help us cut down flakes.

@openshift-bot
Copy link
Contributor

/retest

Please review the full test history for this PR and help us cut down flakes.

@openshift-merge-robot openshift-merge-robot merged commit e6567b2 into openshift:master Aug 14, 2020
@spadgett spadgett added this to the v4.6 milestone Aug 20, 2020
@rottencandy rottencandy deleted the eventsources branch September 8, 2020 08:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. component/knative Related to knative-plugin lgtm Indicates that a PR is ready to be merged.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

8 participants