-
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
migrate knative connector side panels to use dynamic extensions #10139
migrate knative connector side panels to use dynamic extensions #10139
Conversation
/cc @sahil143 |
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'); |
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 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 |
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 add a depricated comment on the component also
bc8f55d
to
0c2d633
Compare
@@ -17,3 +26,26 @@ export const useTopologyWorloadActionProvider = (element: GraphElement) => { | |||
return [actions, true, undefined]; | |||
}, [actions, element]); | |||
}; | |||
|
|||
export const useTopologyEdgeActionProvider = (element: BaseEdge) => { |
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.
Had to add this hook here because importing edgeActions
in the knative-plugin providers increases the main vendor bundle size
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 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.
@invincibleJai @sahil143 The problem is the moveConnection
action uses types from the react-topology package
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.
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.
0c2d633
to
2c287ff
Compare
2c287ff
to
48be4c4
Compare
7bc1340
to
dfd7dc8
Compare
/retest |
const sourceModel = modelFor(referenceFor(element.getSource().getData().resource)); | ||
return [moveSinkSource(sourceModel, element.getSource().getData().resource)]; |
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.
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) => { |
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.
60d8562
to
2ef416e
Compare
2ef416e
to
63178bb
Compare
63178bb
to
5f9b7d2
Compare
@@ -17,3 +26,26 @@ export const useTopologyWorloadActionProvider = (element: GraphElement) => { | |||
return [actions, true, undefined]; | |||
}, [actions, element]); | |||
}; | |||
|
|||
export const useTopologyEdgeActionProvider = (element: BaseEdge) => { |
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.
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.
1b6236d
to
16536c6
Compare
16536c6
to
29247cb
Compare
/retest |
29247cb
to
81cf442
Compare
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.
/lgtm
/label qe-approved
verified changes locallly
@@ -193,3 +197,26 @@ export const useUriActionsProvider = (element: GraphElement) => { | |||
return [actions, true, undefined]; | |||
}, [actions]); | |||
}; | |||
|
|||
export const useKnativeConnectorActionProvider = (element: Edge) => { |
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.
nit: can we return type
/approve |
[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 |
/label px-approved |
Task:
https://issues.redhat.com/browse/ODC-6358
Solution description:
Migrated traffic distributor connector , event source link & kafka connection link sidepanels