diff --git a/frontend/web/components/pages/ChangeRequestsPage.js b/frontend/web/components/pages/ChangeRequestsPage.js deleted file mode 100644 index 51141255664f..000000000000 --- a/frontend/web/components/pages/ChangeRequestsPage.js +++ /dev/null @@ -1,299 +0,0 @@ -import React, { Component } from 'react' -import ChangeRequestStore from 'common/stores/change-requests-store' -import OrganisationStore from 'common/stores/organisation-store' -import ProjectStore from 'common/stores/project-store' -import ConfigProvider from 'common/providers/ConfigProvider' -import Tabs from 'components/base/forms/Tabs' -import TabItem from 'components/base/forms/TabItem' -import JSONReference from 'components/JSONReference' -import InfoMessage from 'components/InfoMessage' -import Icon from 'components/Icon' -import { Link } from 'react-router-dom' -import PageTitle from 'components/PageTitle' -import { timeOutline } from 'ionicons/icons' -import { IonIcon } from '@ionic/react' -import Utils from 'common/utils/utils' -import PlanBasedAccess, { - featureDescriptions, -} from 'components/PlanBasedAccess' - -const ChangeRequestsPage = class extends Component { - static displayName = 'ChangeRequestsPage' - - static contextTypes = { - router: propTypes.object.isRequired, - } - - constructor(props, context) { - super(props, context) - this.state = { - live_after: new Date().toISOString(), - showArchived: false, - tab: Utils.fromParam().tab === 'closed' ? 1 : 0, - tags: [], - } - ES6Component(this) - this.listenTo(ChangeRequestStore, 'change', () => this.forceUpdate()) - this.listenTo(OrganisationStore, 'change', () => this.forceUpdate()) - } - componentDidMount = () => { - AppActions.getChangeRequests(this.props.match.params.environmentId, {}) - AppActions.getChangeRequests(this.props.match.params.environmentId, { - committed: true, - }) - AppActions.getChangeRequests(this.props.match.params.environmentId, { - live_from_after: this.state.live_after, - }) - AppActions.getOrganisation(AccountStore.getOrganisation().id) - } - - render() { - const { environmentId, projectId } = this.props.match.params - const data = - ChangeRequestStore.model && - ChangeRequestStore.model[environmentId] && - ChangeRequestStore.model[environmentId] && - ChangeRequestStore.model[environmentId].results - const dataPaging = - ChangeRequestStore.model && - ChangeRequestStore.model[environmentId] && - ChangeRequestStore.model[environmentId] && - ChangeRequestStore.model[environmentId] - - const dataClosed = - ChangeRequestStore.committed && - ChangeRequestStore.committed[environmentId] && - ChangeRequestStore.committed[environmentId].results - const dataClosedPaging = - ChangeRequestStore.committed && - ChangeRequestStore.committed[environmentId] && - ChangeRequestStore.committed[environmentId] - - const environment = ProjectStore.getEnvironment(environmentId) - - return ( -
- {environment &&
- !Utils.changeRequestsEnabled(
- environment.minimum_change_request_approvals,
- ) ? (
-