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

chore(litmus-portal): Home Page Stats for Litmus Portal. #2053

Merged
merged 13 commits into from
Sep 13, 2020

Conversation

ishangupta-ds
Copy link
Member

@ishangupta-ds ishangupta-ds commented Sep 12, 2020

Proposed changes

Adding basic analytics for home page of litmus portal.
fixes #1788

This PR also removes two outdated test cases from the cypress test suite of PassedVsFailed component.

Types of changes

What types of changes does your code introduce to Litmus? Put an x in the boxes that apply

  • New feature (non-breaking change which adds functionality)
  • Bugfix (non-breaking change which fixes an issue)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation Update (if none of the other choices applies)

Checklist

Put an x in the boxes that apply. You can also fill these out after creating the PR. If you're unsure about any of them, don't hesitate to ask. We're here to help! This is simply a reminder of what we are going to look for before merging your code.

  • I have read the CONTRIBUTING doc
  • I have signed the commit for DCO to be passed.
  • Lint and unit tests pass locally with my changes
  • I have added tests that prove my fix is effective or that my feature works (if appropriate)
  • I have added necessary documentation (if appropriate)

Dependency

  • None.

Special notes for your reviewer:

Analytics PR #1

Signed-off-by: ishangupta-ds <ishan.gupta@mayadata.io>
Signed-off-by: ishangupta-ds <ishan.gupta@mayadata.io>
Signed-off-by: ishangupta-ds <ishan.gupta@mayadata.io>
Signed-off-by: ishangupta-ds <ishan.gupta@mayadata.io>
Signed-off-by: ishangupta-ds <ishan.gupta@mayadata.io>
@ishangupta-ds
Copy link
Member Author

image

DefaultDBServerURL string = os.Getenv("DB_SERVER")
DefaultAPISecret string = "litmus-portal@123"
DefaultUserName string = "admin"
DefaultUserPassword string = "litmus"
Copy link
Contributor

Choose a reason for hiding this comment

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

Can you change these back

Copy link
Member Author

Choose a reason for hiding this comment

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

already reverted. @arkajyotiMukherjee

const width: number = 2;
const resultValue = ((value as number) / (maxValue as number)) * 100;
useEffect(() => {
return setColor('#5B44BA');
Copy link
Contributor

Choose a reason for hiding this comment

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

why does color require to be a state variable if I never changes.
use a fixed color from theme data with useTheme()

Copy link
Member Author

Choose a reason for hiding this comment

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

Some components were already there just reused code from them, will make changes for this.. @arkajyotiMukherjee

const [color, setColor] = useState(' ');
const width: number = 2;
const resultValue = ((value as number) / (maxValue as number)) * 100;
useEffect(() => {
Copy link
Contributor

Choose a reason for hiding this comment

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

This useEffect is not needed

alt="Failed Icon"
<Avatar
style={{
backgroundColor: '#CA2C2C',
Copy link
Contributor

Choose a reason for hiding this comment

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

put all colors in theme...if it is in react component use "useTheme" if it is used in styles...use normal theme value you get

@arkajyotiMukherjee
Copy link
Contributor

arkajyotiMukherjee commented Sep 13, 2020

/preview 20

LINK EXPIRES IN : 20mins

SVC Name Address Protocol
http 3.136.2.227:31114 TCP
graphql-server 3.136.2.227:30111 TCP
auth-server 3.136.2.227:30454 TCP

LINK EXPIRED

@Jonsy13
Copy link
Contributor

Jonsy13 commented Sep 13, 2020

/run-unit


Test Status: The testing has been started please wait for the results ...
Test Failed: Some tests are failed please check
Run ID: 252034782

@Jonsy13
Copy link
Contributor

Jonsy13 commented Sep 13, 2020

/run-unit


Test Status: The testing has been started please wait for the results ...
Test Failed: Some tests are failed please check
Run ID: 252037236

@Jonsy13
Copy link
Contributor

Jonsy13 commented Sep 13, 2020

/run-unit


Test Status: The testing has been started please wait for the results ...
Test Failed: Some tests are failed please check
Run ID: 252124178

Signed-off-by: ishangupta-ds <ishan.gupta@mayadata.io>
Signed-off-by: ishangupta-ds <ishan.gupta@mayadata.io>
@ishangupta-ds
Copy link
Member Author

ishangupta-ds commented Sep 13, 2020

/run-unit


Test Status: The testing has been started please wait for the results ...
Test Failed: Some tests are failed please check
Run ID: 252134477

Signed-off-by: ishangupta-ds <ishan.gupta@mayadata.io>
@ishangupta-ds
Copy link
Member Author

ishangupta-ds commented Sep 13, 2020

/run-unit


Test Status: The testing has been started please wait for the results ...
Test Failed: Some tests are failed please check
Run ID: 252159361

@ishangupta-ds
Copy link
Member Author

ishangupta-ds commented Sep 13, 2020

@rajdas98 @arkajyotiMukherjee @amityt @S-ayanide all the suggested changes have been made PTAL.

@ishangupta-ds
Copy link
Member Author

ishangupta-ds commented Sep 13, 2020

/preview 10

LINK EXPIRES IN : 10mins

SVC Name Address Protocol
http 3.136.2.227:30720 TCP
graphql-server 3.136.2.227:32640 TCP
auth-server 3.136.2.227:32324 TCP

LINK EXPIRED

@@ -17,6 +17,7 @@
"@material-ui/core": "^4.10.2",
"@material-ui/icons": "^4.9.1",
"@material-ui/pickers": "^3.2.10",
"@types/lodash": "^4.14.161",
Copy link
Member

Choose a reason for hiding this comment

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

I believe this should be a dev dependency

Comment on lines 12 to 15
/*
Reusable Semi Circular Progress Bar
Required Params: value
*/
Copy link
Member

Choose a reason for hiding this comment

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

Remove this comment, doesn't make sense in this context

@S-ayanide
Copy link
Member

S-ayanide commented Sep 13, 2020

This PR looks good to me, just a very minor change. 👍

WORKFLOW_DETAILS,
{
variables: { projectID: userData.selectedProjectID },
fetchPolicy: 'cache-and-network',
Copy link
Contributor

Choose a reason for hiding this comment

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

remove fetch policy

Copy link
Member Author

Choose a reason for hiding this comment

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

it('Pass Icon is present', () => {
mount(wrapper);
cy.get('[data-cy=passIcon]')
.should('have.attr', 'src')
Copy link
Contributor

Choose a reason for hiding this comment

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

did we plan on removing all test cases @Jonsy13 @S-ayanide

Copy link
Member Author

@ishangupta-ds ishangupta-ds Sep 13, 2020

Choose a reason for hiding this comment

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

yeah we are not using these icons i am using the available icons in material ui as they are same, and moreover pngs were used earlier which were getting blurred... so these conditions will always fail @arkajyotiMukherjee cc: @Jonsy13 @S-ayanide

Copy link
Contributor

Choose a reason for hiding this comment

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

No @arkajyotiMukherjee It's not decided.Tests will remain.

Copy link
Member Author

Choose a reason for hiding this comment

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

without icons how do i make the old test cases pass? @Jonsy13 @arkajyotiMukherjee

Copy link
Member

Choose a reason for hiding this comment

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

@ishangupta-ds Can we add the two tests but instead use you Avatar icon and other icons from MUI itself? If that's possible for now!

Copy link
Contributor

Choose a reason for hiding this comment

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

Yes @S-ayanide That should be good.

Copy link
Member Author

Choose a reason for hiding this comment

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

It is not accessible as png now we have to check for the material icon, i have another PR pending for the analytics, will be adding test cases after this release @S-ayanide @Jonsy13 ..if it is good?

@S-ayanide
Copy link
Member

S-ayanide commented Sep 13, 2020

/run-unit


Test Status: The testing has been started please wait for the results ...
Test Failed: Some tests are failed please check
Run ID: 252445349

Signed-off-by: ishangupta-ds <ishan.gupta@mayadata.io>
@ishangupta-ds
Copy link
Member Author

@arkajyotiMukherjee @S-ayanide @Jonsy13 @rajdas98 PTAL.

@imrajdas imrajdas merged commit 1199ab3 into litmuschaos:master Sep 13, 2020
imrajdas pushed a commit to imrajdas/litmus that referenced this pull request Sep 14, 2020
…#2053)

This commit removes two outdated test cases from the cypress test suite of PassedVsFailed component

Signed-off-by: ishangupta-ds <ishan.gupta@mayadata.io>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
No open projects
Litmus-Portal-Frontend-1.8.0
  
Awaiting triage
Development

Successfully merging this pull request may close these issues.

Basic home screen analytics section UI development for Litmus Portal.
5 participants