import React from "react" import PropTypes from "prop-types" import { createDeepLinkPath, sanitizeUrl } from "core/utils" export default class Operations extends React.Component { static propTypes = { specSelectors: PropTypes.object.isRequired, specActions: PropTypes.object.isRequired, oas3Actions: PropTypes.object.isRequired, getComponent: PropTypes.func.isRequired, layoutSelectors: PropTypes.object.isRequired, layoutActions: PropTypes.object.isRequired, authActions: PropTypes.object.isRequired, authSelectors: PropTypes.object.isRequired, getConfigs: PropTypes.func.isRequired }; render() { let { specSelectors, getComponent, layoutSelectors, layoutActions, getConfigs } = this.props let taggedOps = specSelectors.taggedOperations() const OperationContainer = getComponent("OperationContainer", true) const Collapse = getComponent("Collapse") const Markdown = getComponent("Markdown") let { docExpansion, maxDisplayedTags, deepLinking } = getConfigs() const isDeepLinkingEnabled = deepLinking && deepLinking !== "false" let filter = layoutSelectors.currentFilter() if (filter) { if (filter !== true) { taggedOps = taggedOps.filter((tagObj, tag) => { return tag.indexOf(filter) !== -1 }) } } if (maxDisplayedTags && !isNaN(maxDisplayedTags) && maxDisplayedTags >= 0) { taggedOps = taggedOps.slice(0, maxDisplayedTags) } return (