-
Notifications
You must be signed in to change notification settings - Fork 706
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
Analytics for litmus portal. #2065
Conversation
Signed-off-by: ishangupta-ds <[email protected]>
…lytics table. Signed-off-by: ishangupta-ds <[email protected]>
Signed-off-by: ishangupta-ds <[email protected]>
Signed-off-by: ishangupta-ds <[email protected]>
Signed-off-by: ishangupta-ds <[email protected]>
Signed-off-by: ishangupta-ds <[email protected]>
Signed-off-by: ishangupta-ds <[email protected]>
Signed-off-by: ishangupta-ds <[email protected]>
Signed-off-by: ishangupta-ds <[email protected]>
{ variables: { projectID: selectedProjectID } } | ||
{ | ||
variables: { projectID: selectedProjectID }, | ||
fetchPolicy: 'cache-and-network', |
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.
remove this...not required here
}; | ||
|
||
workflowRuns.push(edgeLow); | ||
workflowRuns.push(workflowRunOnce); | ||
workflowRuns.push(edgeHigh); | ||
|
||
setWorkflowRunDataForPlot(workflowRuns); | ||
}, [data]); | ||
}, [data, loading]); |
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.
loading is not required here as a dependency...remove this
}, [data, loading]); | |
}, [data]); |
} | ||
}); | ||
setSelectedWorkflowRunDetails(workflowTestsArray); | ||
}, [selectedWorkflowRunID, data, loading]); |
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.
}, [selectedWorkflowRunID, data, loading]); | |
}, [selectedWorkflowRunID, data]); |
@@ -0,0 +1,43 @@ | |||
import React, { useEffect } from 'react'; |
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.
avoid naming components as Custom
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.
change it to a more apt name
return setLabel(classes.passed); | ||
} | ||
return setLabel(classes.failed); | ||
}, [status, classes.failed, classes.passed]); |
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.
classes can be removed as a dependency
palette: { | ||
secondary: { | ||
light: '#FFFFFF', | ||
main: '#FFFFFF', |
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.
same here
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.
It is required @arkajyotiMukherjee do i move it to theme file?
}, | ||
|
||
calIcon: { | ||
color: 'rgba(0, 0, 0, 0.4)', |
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.
try this @ishangupta-ds
getTests(processedWorkflowRunDetails); | ||
getTestResults(processedWorkflowRunDetails); | ||
setReload(true); | ||
}, [data, loading, workflowID, reload]); |
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.
}, [data, loading, workflowID, reload]); | |
}, [data, workflowID, reload]); |
setReload(true); | ||
}, [data, loading, workflowID, reload]); | ||
|
||
useEffect(() => { |
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.
filter is a state variable it'll automatically recalculate this. no need for useEffect here
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.
I am updating the selection options dynamically upon changing he filter @arkajyotiMukherjee , if i don't use useEffect() how should i call the functions to update the drop down lists for test and test results?
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 is basic concept of state in react...we have done the same in browse workflow
filter is a state var. hence when it changes react will rerender the component where it is used...no need of useEffect
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.
That is good but I am calling 3 functions PTAL, how do I call them without use effect? If I don't use this hook those functions will never be called... getTests() and getTestResults()
} | ||
|
||
interface TestResultCallBackType { | ||
(testResult: string): void; |
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.
improve this callback situation wherever it is used
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 its more a state passing function than callback, have named it a callback as it functions similarly.. @arkajyotiMukherjee Not actually using any callback..
Signed-off-by: ishangupta-ds <[email protected]>
@arkajyotiMukherjee PTAL. cc: @rajdas98 |
setReload(true); | ||
}, [data, loading, workflowID, reload]); | ||
|
||
useEffect(() => { |
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 is basic concept of state in react...we have done the same in browse workflow
filter is a state var. hence when it changes react will rerender the component where it is used...no need of useEffect
Signed-off-by: ishangupta-ds <[email protected]>
changes made PTAL @arkajyotiMukherjee @rajdas98 |
/preview 10 |
Signed-off-by: ishangupta-ds <[email protected]>
6f0998c
/run-unit Test Status: The testing has been started please wait for the results ... |
Signed-off-by: ishangupta-ds <[email protected]>
a8e30cf
Adds Analytics section and fixes for the same to litmus portal. Signed-off-by: ishangupta-ds <[email protected]>
Proposed changes
Adds analytics section and fixes for the same to litmus portal.
Types of changes
What types of changes does your code introduce to Litmus? Put an
x
in the boxes that applyChecklist
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.Dependency
Special notes for your reviewer:
Analytics PR #3