Skip to content
This repository has been archived by the owner on Nov 28, 2022. It is now read-only.

feat(api explorer): adding optional handler for auth group change #1054

Merged
merged 2 commits into from
Nov 19, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions packages/api-explorer/src/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,9 @@ class ApiExplorer extends React.Component {
* @param {string} group
*/
onAuthGroupChange(group) {
// Invoke supplementary handler (if available)
this.props.onAuthGroupChange(group);

const { user } = this.props.variables;
let groupName = false;
if (user.keys) {
Expand Down Expand Up @@ -291,6 +294,7 @@ ApiExplorer.propTypes = {
oasFiles: PropTypes.shape({}).isRequired,
oasUrls: PropTypes.shape({}).isRequired,
oauth: PropTypes.bool,
onAuthGroupChange: PropTypes.func,
onError: PropTypes.func,
suggestedEdits: PropTypes.bool.isRequired,
tryItMetrics: PropTypes.func,
Expand Down Expand Up @@ -319,6 +323,7 @@ ApiExplorer.defaultProps = {
Logs: undefined,
maskErrorMessages: true,
oauth: false,
onAuthGroupChange: () => {},
onError: () => {},
tryItMetrics: () => {},
useNewMarkdownEngine: false,
Expand Down