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

ui-tooltip and circle changes made in graph for waived nodes and profiles #4456

Merged

Conversation

vivekshankar1
Copy link
Collaborator

@vivekshankar1 vivekshankar1 commented Nov 30, 2020

πŸ”© Description: What code changed, and why?

To show the waived nodes and profile data on the compliance graph.

⛓️ Related Resources

OFFR-E-10 #4382

πŸ‘ Definition of Done

Changes should be for both node status and profile status tab.
There should be a new waved line in the graph
Waived data should show up in the tooltip on compliance graph.
The intersection dots should accommodate the new waived circle.

πŸ‘Ÿ How to Build and Test the Change

Add some waived data. You can see the new line and numbers in the tooltip.

βœ… Checklist

πŸ“· Screenshots, if applicable

Screenshot 2020-11-30 at 11 18 52 PM

@netlify
Copy link

netlify bot commented Nov 30, 2020

Deploy preview for chef-automate ready!

Built with commit 5a4cf01

https://deploy-preview-4456--chef-automate.netlify.app

@SEAjamieD
Copy link
Contributor

Hi @vivekshankar1, is this PR related to this ticket: #4382?

It looks like they may be. If so, I will connect them πŸ‘

@vivekshankar1
Copy link
Collaborator Author

vivekshankar1 commented Dec 1, 2020

Hi @vivekshankar1, is this PR related to this ticket: #4382?

It looks like they may be. If so, I will connect them πŸ‘

Thanks @SEAjamieD, yes this is the issue ticket. I did not have access to chef repo till now(hence the pr from forked branch), got access just now. Should we send the pr again by directly pushing to the official automate remote?

@SEAjamieD
Copy link
Contributor

Hi @vivekshankar1, is this PR related to this ticket: #4382?
It looks like they may be. If so, I will connect them πŸ‘

Thanks @SEAjamieD, yes this is the issue ticket. I did not have access to chef repo till now(hence the pr from forked branch), got access just now. Should we send the pr again by directly pushing to the official automate remote?

Awesome! Thanks for tackling this. I've linked this PR to the #4382 so that its tracked until we decide what our new ticketing system will be.

I'm not sure if you'll need to create a new PR, @msorens would you be able to address this question? Vivek's PR is off a forked repo - so you know if it is necessary to open a new PR?

@SEAjamieD SEAjamieD added automate-ui bug πŸ› Something isn't working ui labels Dec 1, 2020
@msorens
Copy link
Contributor

msorens commented Dec 1, 2020

Should not be a problem to merge this PR once it is reviewed and approved. Should there be any problem when we attempt that, we can always regenerate the PR afresh at that time.

@kalroy kalroy requested a review from lancewf December 2, 2020 09:04
@lancewf lancewf requested a review from a team December 2, 2020 16:42
Copy link
Contributor

@SEAjamieD SEAjamieD left a comment

Choose a reason for hiding this comment

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

Everything is looking good so far as I can tell from the code alone. I'm working on getting this spun up now, but am having issues I think because its from a fork.

I'm going to hold off on approving until I can get the branch running - but from this initial pass its looking good. πŸŽ‰

@SEAjamieD SEAjamieD requested a review from a team December 2, 2020 22:25
Comment on lines +252 to +264
if (d.failed === d.passed && d.failed === d.skipped && d.failed === d.waived) { return 10; }
if (d.failed === d.passed && d.failed === d.skipped) { return 8; }
if (d.failed === d.passed || d.failed === d.skipped) { return 6; }
if (d.failed === d.passed && d.failed === d.waived) { return 8; }
if (d.failed === d.skipped && d.failed === d.waived) { return 8; }
if (d.failed === d.passed || d.failed === d.skipped || d.failed === d.waived) { return 6; }
return 4;
});

update.select('.status-dot.passed')
.attr('r', d => d.passed === d.skipped ? 6 : 4);
.attr('r', d => {
if (d.passed === d.skipped && d.passed === d.waived) { return 8; }
if (d.passed === d.skipped || d.passed === d.waived) { return 6; }
return 4;
Copy link
Contributor

Choose a reason for hiding this comment

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

Out of curiosity - what is the reason here for returning 10, 8, 6, or 4?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Hi @SEAjamieD ,
As there are 4 circles now (max value increased from 8 to 10), each circle will take 2 units and base circle default was 4.
That makes 4+2+2+2 = 10
if there are 3 circles then, 4+2+2 = 8
if there are 2 circles then, 4+2 = 6
if its only 1 circle then 4

Copy link
Contributor

Choose a reason for hiding this comment

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

Thanks @vivekshankar1! I appreciate the education πŸ‘

Copy link
Contributor

Choose a reason for hiding this comment

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

@vivekshankar1 I want to urge a follow-up that makes the code much less obfuscated. As it is, it is very challenging to figure out what it is doing, but since you have already done the figuring, you are at an ideal point to explain it. 😁
I would consider replacing the magic numbers with named constants. Also, it needs some comments. I would start with explaining what the block of update.select('.status-dot.failed') is supposed to be doing, as I have no idea.
(Thanks for pointing that out, @SEAjamieD )

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Copy link
Contributor

@SEAjamieD SEAjamieD left a comment

Choose a reason for hiding this comment

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

Was able to spin this up, it's looking and working as advertised. Great job πŸŽ‰

@SEAjamieD SEAjamieD requested a review from a team December 2, 2020 22:45
Copy link
Contributor

@alexpop alexpop left a comment

Choose a reason for hiding this comment

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

Smashing job!

@vivekshankar1
Copy link
Collaborator Author

vivekshankar1 commented Jan 9, 2021

Issue found during acceptance testing:
Clicking on a particular date in the trend graph does not load the data for that date and pie charts not clickable. #4515

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Compliance summary doesn't match trend data as waived node and controls are missing
4 participants