This repository has been archived by the owner on May 27, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
943: Add ability to import from experimenter r=jaredkerim a=rehandalal Needs a little more work: - [x] Authentication (jkerim to whitelist the recipe endpoint) - [x] Show comment field and make it blocking - [x] Error handling r? Co-authored-by: Rehan Dalal <rehandalal@gmail.com>
- Loading branch information
Showing
11 changed files
with
189 additions
and
14 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
import { notification } from 'antd'; | ||
import PropTypes from 'prop-types'; | ||
import React from 'react'; | ||
import { connect } from 'react-redux'; | ||
|
||
import { fetchExperimentRecipeData } from 'console/state/recipes/actions'; | ||
|
||
@connect( | ||
null, | ||
{ | ||
fetchExperimentRecipeData, | ||
}, | ||
) | ||
class QueryActions extends React.PureComponent { | ||
static propTypes = { | ||
fetchExperimentRecipeData: PropTypes.func.isRequired, | ||
slug: PropTypes.string.isRequired, | ||
}; | ||
|
||
async componentDidMount() { | ||
const { slug } = this.props; | ||
try { | ||
await this.props.fetchExperimentRecipeData(slug); | ||
} catch (error) { | ||
notification.error({ | ||
message: 'Import Error', | ||
description: error.message, | ||
duration: 0, | ||
}); | ||
} | ||
} | ||
|
||
async componentDidUpdate(prevProps) { | ||
const { slug } = this.props; | ||
if (slug !== prevProps.slug) { | ||
try { | ||
await this.props.fetchExperimentRecipeData(slug); | ||
} catch (error) { | ||
notification.error({ | ||
message: 'Import Error', | ||
description: error.message, | ||
duration: 0, | ||
}); | ||
} | ||
} | ||
} | ||
|
||
render() { | ||
return null; | ||
} | ||
} | ||
|
||
export default QueryActions; |
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
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