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
Expand/collapse Topology Application Groups #3938
Expand/collapse Topology Application Groups #3938
Conversation
6a060db
to
018530e
Compare
Screenshot looks good. We'll probably want a follow-up where we can size the groupings better based on the content. |
018530e
to
fdc6be5
Compare
@@ -31,6 +36,9 @@ export const usePanZoom = (zoomExtent: [number, number] = ZOOM_EXTENT): PanZoomR | |||
if (node) { | |||
// TODO fix any type | |||
const $svg = d3.select(node.ownerSVGElement) as any; | |||
if (node && node.ownerSVGElement) { | |||
node.ownerSVGElement.addEventListener('mousedown', propagatePanZoomMouseEvent); |
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.
Make sure to remove this listener in the dispose function.
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.
done
9ce9d56
to
0b085b8
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.
Couple minor changes. Nothing game changing. Good cleanup 👍
@@ -220,4 +228,9 @@ const Topology: React.FC<TopologyProps> = ({ data, serviceBinding }) => { | |||
); | |||
}; | |||
|
|||
export default Topology; | |||
const TopologyStateToProps = (state: RootState) => { |
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 TopologyStateToProps = (state: RootState) => { | |
const TopologyStateToProps = (state: RootState): StateProps => { |
import ApplicationNode from './ApplicationNode'; | ||
import ApplicationGroup from './ApplicationGroup'; | ||
|
||
import './ApplicationGroup.scss'; |
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.
Want to rename this file to match?
import './ApplicationGroup.scss'; | |
import './Application.scss'; |
let { height } = textSize; | ||
const paddingX = height / 2; | ||
const paddingY = height / 14; | ||
({ height, width } = textSize); |
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.
Huh... I actually didn't know this was a valid syntax... I don't normally destruct into lets. Neat!
@@ -490,11 +490,15 @@ export const topologyModelFromDataModel = (dataModel: TopologyDataModel): Model | |||
}); | |||
|
|||
const groupNodes: NodeModel[] = dataModel.graph.groups.map((d) => { | |||
const data: any = dataModel.topology[d.id] || {}; |
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 feels wrong, but I suspect you can't type it any other way.
result.setSize( | ||
Math.max(result.width, this.bounds.width), | ||
Math.max(result.height, this.bounds.height), | ||
); | ||
// result.setSize( | ||
// Math.max(result.width, this.bounds.width), | ||
// Math.max(result.height, this.bounds.height), | ||
// ); |
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.
Dead code, delete?
I think your CI tests are bugged (they don't appear to be moving for a few hours now). I know the gpc-console one takes almost 2 hours but the others (images/analyze) do not. /assign Hopefully your fix push will rekick it. |
/kind feature |
changes to the zoom behavior to fix the click through for hiding dropdown menus looks good. |
0b085b8
to
34a43f3
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.
/retest
Ah right, Topology package doesn't have a label and I cannot approve that. /lgtm |
34a43f3
to
232e5a9
Compare
/lgtm |
/test analyze |
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
4bffa5b
to
90f425d
Compare
Removed aggregate edge handling from Visualization, make application defined. |
90f425d
to
39968d9
Compare
39968d9
to
6ddecb5
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.
import '@patternfly/patternfly/patternfly-addons.css'; | ||
|
||
export default { | ||
title: 'Collapsible Groups', |
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.
lol ok we should improve that later
const prevCenter = this.getBounds() | ||
.getCenter() | ||
.clone(); | ||
this.collapsed = collapsed; | ||
this.getBounds().setCenter(prevCenter.x, prevCenter.y); |
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 should have a TODO with a comment why this is here so we can address it better.
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.
added
@@ -65,12 +74,6 @@ export default class BaseNode<E extends NodeModel = NodeModel, D = any> extends | |||
const { padding } = this.getStyle<GroupStyle>(); | |||
const result = rect.padding(padding); | |||
|
|||
// ensure size is at least the size of the set bounds | |||
result.setSize( |
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 was used by knative service and other groups that don't currently have children.
If you kept this, does it mess up anything? You've already added a guard in the bounds getter.
> | ||
{show && renderRemove(props.element, onRemove)} | ||
{show && renderRemove(props.element, onRemove, startPoint, endPoint)} |
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.
Maybe default to this behavior instead:
{show && renderRemove(props.element, onRemove, startPoint, endPoint)} | |
{show && renderRemove(props.element, onRemove, startPoint || props.element.getStartPoint(), endPoint || props.element.getEndPoint())} |
startPoint?: Point, | ||
endPoint?: Point, |
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.
Probably useful to make these always present with the defaults being the edge start and end point?
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 using withRemoveConnector
we don't yet have the 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.
Actually, with the rework, this is no longer needed.
return ( | ||
<BaseEdge className={edgeClasses} element={element} {...others}> | ||
<EdgeConnectorArrow dragRef={editAccess ? targetDragRef : undefined} edge={element} /> | ||
{(!element.getSource().isCollapsed() || !element.getTarget().isCollapsed()) && ( |
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.
Is all this still required now that we have an aggregate edge?
656430b
to
864b7db
Compare
Fixed the empty knative service display |
@jeff-phillips-18 Is the intent to show a collapsed Knative when it's starting up? |
Yes. It's better than an empty grey box but we still have https://issues.redhat.com/browse/ODC-2437 to address it better in the future. |
Hmmm, not sure it is better... just a different kind of misleading 😄 |
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
This looks fine to me. Christian is still needed for the approval.
/approve |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: andrewballantyne, christianvogt, jeff-phillips-18, serenamarie125 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 |
/hold |
/hold cancel |
Addresses stories:
https://issues.redhat.com/browse/ODC-2459
https://issues.redhat.com/browse/ODC-2548
https://issues.redhat.com/browse/ODC-2460
https://issues.redhat.com/browse/ODC-2623
Fixes:
https://issues.redhat.com/browse/ODC-2420
https://issues.redhat.com/browse/ODC-2780
/cc @serenamarie125 @Veethika @openshift/team-ux-review