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

migrate knative connector side panels to use dynamic extensions #10139

Merged

Conversation

debsmita1
Copy link
Contributor

Task:
https://issues.redhat.com/browse/ODC-6358

Solution description:
Migrated traffic distributor connector , event source link & kafka connection link sidepanels

@openshift-ci openshift-ci bot added the component/dev-console Related to dev-console label Sep 27, 2021
@openshift-ci openshift-ci bot added component/knative Related to knative-plugin component/olm Related to OLM component/shared Related to console-shared component/topology Related to topology kind/i18n Indicates issue or PR relates to internationalization or has content that needs to be translated labels Sep 27, 2021
@debsmita1
Copy link
Contributor Author

/cc @sahil143
/assign @invincibleJai

Comment on lines 13 to 18
case TYPE_REVISION_TRAFFIC:
return i18next.t('knative-plugin~Traffic distribution connector');
case TYPE_EVENT_SOURCE_LINK:
return i18next.t('knative-plugin~Event source connector');
case TYPE_KAFKA_CONNECTION_LINK:
return i18next.t('knative-plugin~Kafka connector');
Copy link
Contributor

Choose a reason for hiding this comment

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

I would suggest adding these as the label on edge data model while forming the model data transformers. Then we wouldn't need to create resource link sections for the type.

element.getLabel() is being used incase resource-link is not found in SideBarHeader component

@@ -1,3 +1,5 @@
// remove this file after migrating all the connectors
Copy link
Contributor

Choose a reason for hiding this comment

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

Please add a depricated comment on the component also

@debsmita1 debsmita1 force-pushed the knative-connectors branch 3 times, most recently from bc8f55d to 0c2d633 Compare September 30, 2021 18:31
@openshift-ci openshift-ci bot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Sep 30, 2021
@@ -17,3 +26,26 @@ export const useTopologyWorloadActionProvider = (element: GraphElement) => {
return [actions, true, undefined];
}, [actions, element]);
};

export const useTopologyEdgeActionProvider = (element: BaseEdge) => {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Had to add this hook here because importing edgeActions in the knative-plugin providers increases the main vendor bundle size

Copy link
Member

Choose a reason for hiding this comment

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

yeah, but this may not be ideal to have this in topology. will recommend check with @sahil143 once if we can handle it and avoid the bundle issue. cc @sahil143

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@invincibleJai @sahil143 The problem is the moveConnection action uses types from the react-topology package

Copy link
Contributor

Choose a reason for hiding this comment

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

Ideally we shouldn't be using edgeActions now. It's bad util which pulls action conditionally and not just for Event source link or traffic connector but for visual connector and SBR as well.

try moving the code in this hook from edgeAction and get available target only for the edge that this hook is contributing actions.

@openshift-ci openshift-ci bot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Sep 30, 2021
@debsmita1 debsmita1 force-pushed the knative-connectors branch 2 times, most recently from 7bc1340 to dfd7dc8 Compare October 6, 2021 06:01
@debsmita1
Copy link
Contributor Author

/retest

Comment on lines 88 to 89
const sourceModel = modelFor(referenceFor(element.getSource().getData().resource));
return [moveSinkSource(sourceModel, element.getSource().getData().resource)];
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
const sourceModel = modelFor(referenceFor(element.getSource().getData().resource));
return [moveSinkSource(sourceModel, element.getSource().getData().resource)];
const resource = element.getSource().getData().resource;
const sourceModel = modelFor(referenceFor(resource));
return [moveSinkSource(sourceModel, resource)];

@@ -17,3 +26,26 @@ export const useTopologyWorloadActionProvider = (element: GraphElement) => {
return [actions, true, undefined];
}, [actions, element]);
};

export const useTopologyEdgeActionProvider = (element: BaseEdge) => {
Copy link
Member

Choose a reason for hiding this comment

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

yeah, but this may not be ideal to have this in topology. will recommend check with @sahil143 once if we can handle it and avoid the bundle issue. cc @sahil143

@debsmita1 debsmita1 force-pushed the knative-connectors branch 2 times, most recently from 60d8562 to 2ef416e Compare October 8, 2021 10:39
@openshift-ci openshift-ci bot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Oct 10, 2021
@openshift-ci openshift-ci bot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Oct 11, 2021
@@ -17,3 +26,26 @@ export const useTopologyWorloadActionProvider = (element: GraphElement) => {
return [actions, true, undefined];
}, [actions, element]);
};

export const useTopologyEdgeActionProvider = (element: BaseEdge) => {
Copy link
Contributor

Choose a reason for hiding this comment

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

Ideally we shouldn't be using edgeActions now. It's bad util which pulls action conditionally and not just for Event source link or traffic connector but for visual connector and SBR as well.

try moving the code in this hook from edgeAction and get available target only for the edge that this hook is contributing actions.

@debsmita1 debsmita1 changed the title migrate knative connector side panels migrate knative connector side panels to use dynamic extensions Oct 14, 2021
@debsmita1 debsmita1 force-pushed the knative-connectors branch 2 times, most recently from 1b6236d to 16536c6 Compare October 14, 2021 18:10
@openshift-ci openshift-ci bot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Oct 17, 2021
@openshift-ci openshift-ci bot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Oct 18, 2021
@sahil143
Copy link
Contributor

/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
/label qe-approved

verified changes locallly

@openshift-ci openshift-ci bot added the qe-approved Signifies that QE has signed off on this PR label Oct 21, 2021
@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Oct 21, 2021
@@ -193,3 +197,26 @@ export const useUriActionsProvider = (element: GraphElement) => {
return [actions, true, undefined];
}, [actions]);
};

export const useKnativeConnectorActionProvider = (element: Edge) => {
Copy link
Member

Choose a reason for hiding this comment

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

nit: can we return type

@invincibleJai
Copy link
Member

/approve

@openshift-ci
Copy link
Contributor

openshift-ci bot commented Oct 26, 2021

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: debsmita1, invincibleJai, 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

@openshift-ci openshift-ci bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Oct 26, 2021
@debsmita1
Copy link
Contributor Author

/label px-approved
/label docs-approved

@openshift-ci openshift-ci bot added px-approved Signifies that Product Support has signed off on this PR docs-approved Signifies that Docs has signed off on this PR labels Oct 26, 2021
@openshift-merge-robot openshift-merge-robot merged commit 7a9aad2 into openshift:master Oct 26, 2021
@spadgett spadgett added this to the v4.10 milestone Dec 8, 2021
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/dev-console Related to dev-console component/knative Related to knative-plugin component/olm Related to OLM component/shared Related to console-shared component/topology Related to topology docs-approved Signifies that Docs has signed off on this PR kind/i18n Indicates issue or PR relates to internationalization or has content that needs to be translated lgtm Indicates that a PR is ready to be merged. px-approved Signifies that Product Support has signed off on this PR qe-approved Signifies that QE has signed off on this PR
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants