-
Notifications
You must be signed in to change notification settings - Fork 626
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* refactor: clean-up adhoc single component. - Remove the unneeded header. - Move file upload callback to its own util to be reused. - Embed the file uploader in the flamebeearer. - Remove unused stuff. * feat: add an adhoc comparison component, based on comparison one. * Put the uploaded flamebearers in redux state * chore: style / typing fixes provided by the linter * chore: fix format * Fix typo Co-authored-by: eduardo aleixo <[email protected]> * Remove no longer needed comment Co-authored-by: eduardo aleixo <[email protected]> * Remove abortTimelineRequest from adhoc components. * Remove debug output Co-authored-by: eduardo aleixo <[email protected]> * Use the proper feature flag instead of the hardcoded one. * Set EnableExperimentalAdhocUI's default to true for the PR. * Add some basic sanity checks on uploaded file * Fix flamebearer upload checks. * Fix state handling in adhoc components. * Set EnableExperimentalAdhocUI to true in the test suite. * Add support for the adhoc route paths and sidebar links. adhoc-comparion-diff is commented for now, as it's yet unsupported. * Fix typo in interpolation. * Send a notification in case of parsing error. * Fix the notification and remove the alert. Thanks to @eh-am for spotting the problem. * Use flamebearer in file uploader component too. * Revert back EnableExperimentalAdhocUI to false by default. * Move FileUploader out of the FlameGraphRenderer component. Co-authored-by: eduardo aleixo <[email protected]>
- Loading branch information
Showing
11 changed files
with
221 additions
and
89 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
import React, { useEffect } from 'react'; | ||
import { connect } from 'react-redux'; | ||
import 'react-dom'; | ||
|
||
import { bindActionCreators } from 'redux'; | ||
import Box from '@ui/Box'; | ||
import FileUploader from './FileUploader'; | ||
import FlameGraphRenderer from './FlameGraph'; | ||
import Footer from './Footer'; | ||
import { setLeftFile, setRightFile } from '../redux/actions'; | ||
import styles from './ComparisonApp.module.css'; | ||
|
||
function AdhocComparison(props) { | ||
const { actions, leftFile, leftFlamebearer, rightFile, rightFlamebearer } = | ||
props; | ||
const { setLeftFile } = actions; | ||
const { setRightFile } = actions; | ||
|
||
return ( | ||
<div className="pyroscope-app"> | ||
<div className="main-wrapper"> | ||
<div | ||
className="comparison-container" | ||
data-testid="comparison-container" | ||
> | ||
<Box className={styles.comparisonPane}> | ||
<FileUploader file={leftFile} setFile={setLeftFile} /> | ||
<FlameGraphRenderer | ||
viewType="double" | ||
viewSide="left" | ||
flamebearer={leftFlamebearer} | ||
data-testid="flamegraph-renderer-left" | ||
/> | ||
</Box> | ||
<Box className={styles.comparisonPane}> | ||
<FileUploader file={rightFile} setFile={setRightFile} /> | ||
<FlameGraphRenderer | ||
viewType="double" | ||
viewSide="right" | ||
flamebearer={rightFlamebearer} | ||
data-testid="flamegraph-renderer-right" | ||
/> | ||
</Box> | ||
</div> | ||
</div> | ||
<Footer /> | ||
</div> | ||
); | ||
} | ||
|
||
const mapStateToProps = (state) => ({ | ||
...state.root, | ||
leftFile: state.root.adhocComparison.left.file, | ||
leftFlamebearer: state.root.adhocComparison.left.flamebearer, | ||
rightFile: state.root.adhocComparison.right.file, | ||
rightFlamebearer: state.root.adhocComparison.right.flamebearer, | ||
}); | ||
|
||
const mapDispatchToProps = (dispatch) => ({ | ||
actions: bindActionCreators({ setLeftFile, setRightFile }, dispatch), | ||
}); | ||
|
||
export default connect(mapStateToProps, mapDispatchToProps)(AdhocComparison); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.