import React from "react" import PropTypes from "prop-types" import { helpers } from "swagger-client" import { createDeepLinkPath } from "core/utils" const { opId } = helpers 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, specActions, oas3Actions, getComponent, layoutSelectors, layoutActions, authActions, authSelectors, getConfigs, fn } = this.props let taggedOps = specSelectors.taggedOperations() const OperationContainer = getComponent("OperationContainer", true) const Collapse = getComponent("Collapse") 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 (