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

feat: topology group node #2477

Merged
merged 15 commits into from
Nov 28, 2023
Merged

feat: topology group node #2477

merged 15 commits into from
Nov 28, 2023

Conversation

itssharmasandeep
Copy link
Contributor

@itssharmasandeep itssharmasandeep commented Oct 20, 2023

Screen.Recording.2023-10-19.at.11.15.16.PM.mov

Screenshot 2023-10-19 at 11 21 23 PM

@codecov
Copy link

codecov bot commented Oct 20, 2023

Codecov Report

Attention: 216 lines in your changes are missing coverage. Please review.

Comparison is base (463ecab) 82.99% compared to head (844b9a5) 82.20%.

Files Patch % Lines
.../box/group-node/group-node-box-renderer.service.ts 5.76% 93 Missing and 5 partials ⚠️
...ponents/topology/utils/topology-group-node.util.ts 1.66% 51 Missing and 8 partials ⚠️
...y/src/shared/components/topology/d3/d3-topology.ts 19.35% 23 Missing and 2 partials ⚠️
...red/components/topology/d3/layouts/graph-layout.ts 0.00% 18 Missing ⚠️
...ed/components/topology/utils/topology-converter.ts 40.00% 8 Missing and 1 partial ⚠️
...opology/d3/interactions/drag/topology-node-drag.ts 36.36% 7 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2477      +/-   ##
==========================================
- Coverage   82.99%   82.20%   -0.79%     
==========================================
  Files         925      927       +2     
  Lines       20639    20860     +221     
  Branches     3262     3310      +48     
==========================================
+ Hits        17129    17149      +20     
- Misses       3389     3574     +185     
- Partials      121      137      +16     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@@ -1,3 +1,4 @@
/* eslint-disable max-lines */
Copy link
Contributor

Choose a reason for hiding this comment

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

break up this class :)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Moved the group node related code to a util class, but still it is going over around 20 lines 😑

Copy link
Contributor

Choose a reason for hiding this comment

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

Need to break it up further. Can do it in a follow up.

This comment has been minimized.

This comment has been minimized.

@itssharmasandeep itssharmasandeep marked this pull request as ready for review November 8, 2023 09:38
@itssharmasandeep itssharmasandeep requested a review from a team as a code owner November 8, 2023 09:39
Copy link

github-actions bot commented Nov 8, 2023

Unit Test Results

       4 files     316 suites   45m 16s ⏱️
1 131 tests 1 131 ✔️ 0 💤 0 ❌
1 141 runs  1 141 ✔️ 0 💤 0 ❌

Results for commit fffd64c.

Copy link

github-actions bot commented Nov 21, 2023

Test Results

       4 files  ±0     316 suites  ±0   31m 37s ⏱️ -10s
1 135 tests ±0  1 135 ✔️ ±0  0 💤 ±0  0 ±0 
1 145 runs  ±0  1 145 ✔️ ±0  0 💤 ±0  0 ±0 

Results for commit 844b9a5. ± Comparison against base commit 463ecab.

♻️ This comment has been updated with latest results.

Copy link
Contributor

@anandtiwary anandtiwary left a comment

Choose a reason for hiding this comment

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

Looks fine otherwisr

@@ -58,9 +59,18 @@ export class TopologyComponent implements OnChanges, OnDestroy {
@Input()
public shouldAutoZoomToFit?: boolean = false;

@Input()
public draggableNodes?: boolean = true;
Copy link
Contributor

Choose a reason for hiding this comment

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

Nit: this sounds like it is storing the nodes which are draggable. Could we rename it to allowNodeDrag?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Hmm, this was the property already present in the topology config, so I used the same name. do we change at both places or just input?

Copy link
Contributor

Choose a reason for hiding this comment

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

It is fine if it is an existing term

public customLayout?: TopologyLayout; // This will override `layoutType` property

@Input()
public supportGroupNode?: boolean;
Copy link
Contributor

Choose a reason for hiding this comment

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

Do we need this as an input or can we extract this info from our custom group node layout property?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The layout and group nodes are different IMO. The current flow looks like this.

  1. We create group nodes like we create entity nodes using the data that we get from the backend.
  2. We pass this data to the topology.
  3. Now topology handles group nodes based on the property.
  4. custom layout (with some business logic) is passed from the parent component and used to position the nodes on some layout logic. The layout may or may not care about the group nodes.

The one thing that we can do here is we can extract this property by checking if the nodes contain a group node or not. If this works I can make the changes

@itssharmasandeep itssharmasandeep merged commit 9811248 into main Nov 28, 2023
11 of 13 checks passed
@itssharmasandeep itssharmasandeep deleted the topology-group-node branch November 28, 2023 18:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants