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

Expand/collapse Topology Application Groups #3938

Merged

Conversation

jeff-phillips-18
Copy link
Member

@jeff-phillips-18 jeff-phillips-18 commented Jan 13, 2020

@openshift-ci-robot openshift-ci-robot added size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. component/dev-console Related to dev-console labels Jan 13, 2020
@christianvogt
Copy link
Contributor

Screenshot looks good. We'll probably want a follow-up where we can size the groupings better based on the content.

@@ -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);
Copy link
Contributor

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.

Copy link
Member Author

Choose a reason for hiding this comment

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

done

@jeff-phillips-18 jeff-phillips-18 force-pushed the collapse-groups branch 2 times, most recently from 9ce9d56 to 0b085b8 Compare January 14, 2020 18:00
@jeff-phillips-18
Copy link
Member Author

Updated to show group badge in application group label:

image

Copy link
Contributor

@andrewballantyne andrewballantyne left a 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) => {
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
const TopologyStateToProps = (state: RootState) => {
const TopologyStateToProps = (state: RootState): StateProps => {

import ApplicationNode from './ApplicationNode';
import ApplicationGroup from './ApplicationGroup';

import './ApplicationGroup.scss';
Copy link
Contributor

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?

Suggested change
import './ApplicationGroup.scss';
import './Application.scss';

let { height } = textSize;
const paddingX = height / 2;
const paddingY = height / 14;
({ height, width } = textSize);
Copy link
Contributor

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] || {};
Copy link
Contributor

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.

Comment on lines 69 to 81
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),
// );
Copy link
Contributor

Choose a reason for hiding this comment

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

Dead code, delete?

@andrewballantyne
Copy link
Contributor

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.

@andrewballantyne
Copy link
Contributor

/kind feature
/kind bug

@openshift-ci-robot openshift-ci-robot added kind/feature Categorizes issue or PR as related to a new feature. kind/bug Categorizes issue or PR as related to a bug. labels Jan 15, 2020
@christianvogt
Copy link
Contributor

changes to the zoom behavior to fix the click through for hiding dropdown menus looks good.

Copy link
Contributor

@andrewballantyne andrewballantyne left a comment

Choose a reason for hiding this comment

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

/retest

@andrewballantyne
Copy link
Contributor

Ah right, Topology package doesn't have a label and I cannot approve that.

/lgtm

@openshift-ci-robot openshift-ci-robot added the lgtm Indicates that a PR is ready to be merged. label Jan 15, 2020
@openshift-ci-robot openshift-ci-robot removed the lgtm Indicates that a PR is ready to be merged. label Jan 15, 2020
@andrewballantyne
Copy link
Contributor

/lgtm

@openshift-ci-robot openshift-ci-robot added the lgtm Indicates that a PR is ready to be merged. label Jan 15, 2020
@jeff-phillips-18
Copy link
Member Author

/test analyze

@openshift-ci-robot openshift-ci-robot removed the lgtm Indicates that a PR is ready to be merged. label Jan 15, 2020
Copy link
Contributor

@andrewballantyne andrewballantyne left a comment

Choose a reason for hiding this comment

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

/lgtm

@jeff-phillips-18
Copy link
Member Author

Removed aggregate edge handling from Visualization, make application defined.

Copy link
Contributor

@christianvogt christianvogt left a comment

Choose a reason for hiding this comment

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

Got this when i created a knative service:
image

import '@patternfly/patternfly/patternfly-addons.css';

export default {
title: 'Collapsible Groups',
Copy link
Contributor

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

Comment on lines +152 to +156
const prevCenter = this.getBounds()
.getCenter()
.clone();
this.collapsed = collapsed;
this.getBounds().setCenter(prevCenter.x, prevCenter.y);
Copy link
Contributor

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.

Copy link
Member Author

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(
Copy link
Contributor

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)}
Copy link
Contributor

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:

Suggested change
{show && renderRemove(props.element, onRemove, startPoint, endPoint)}
{show && renderRemove(props.element, onRemove, startPoint || props.element.getStartPoint(), endPoint || props.element.getEndPoint())}

Comment on lines 21 to 22
startPoint?: Point,
endPoint?: Point,
Copy link
Contributor

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?

Copy link
Member Author

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.

Copy link
Member Author

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()) && (
Copy link
Contributor

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?

@jeff-phillips-18
Copy link
Member Author

Fixed the empty knative service display

@andrewballantyne
Copy link
Contributor

@jeff-phillips-18 Is the intent to show a collapsed Knative when it's starting up?

image

@jeff-phillips-18
Copy link
Member Author

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.

@andrewballantyne
Copy link
Contributor

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 😄

Copy link
Contributor

@andrewballantyne andrewballantyne left a 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.

@openshift-ci-robot openshift-ci-robot added the lgtm Indicates that a PR is ready to be merged. label Jan 24, 2020
@christianvogt
Copy link
Contributor

/approve

@openshift-ci-robot
Copy link
Contributor

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

@openshift-ci-robot openshift-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jan 24, 2020
@spadgett
Copy link
Member

/hold
for merge queue fix #4065

@openshift-ci-robot openshift-ci-robot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Jan 24, 2020
@spadgett
Copy link
Member

/hold cancel

@openshift-ci-robot openshift-ci-robot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Jan 25, 2020
@openshift-merge-robot openshift-merge-robot merged commit 26a0fc1 into openshift:master Jan 25, 2020
@spadgett spadgett added this to the v4.4 milestone Jan 27, 2020
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/shared Related to console-shared kind/bug Categorizes issue or PR as related to a bug. kind/feature Categorizes issue or PR as related to a new feature. lgtm Indicates that a PR is ready to be merged. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

7 participants