Skip to content

Commit

Permalink
remove project-wide deployment settings
Browse files Browse the repository at this point in the history
  • Loading branch information
miles-grant-ibigroup committed Dec 13, 2024
1 parent dce68d2 commit 4778738
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 387 deletions.
68 changes: 17 additions & 51 deletions lib/manager/components/ProjectSettings.js
Original file line number Diff line number Diff line change
@@ -1,18 +1,15 @@
// @flow

import React, { Component } from 'react'
import { Row, Col, Panel, ListGroup, ListGroupItem } from 'react-bootstrap'
import { LinkContainer } from 'react-router-bootstrap'
import { Row, Col } from 'react-bootstrap'

import * as projectActions from '../actions/projects'
import {
getComponentMessages,
isModuleEnabled
getComponentMessages
} from '../../common/util/config'
import type { ManagerUserState } from '../../types/reducers'
import type { Project } from '../../types'

import DeploymentSettings from './deployment/DeploymentSettings'
import ProjectSettingsForm from './ProjectSettingsForm'

type Props = {
Expand All @@ -28,63 +25,32 @@ export default class ProjectSettings extends Component<Props> {
messages = getComponentMessages('ProjectSettings')

_updateProjectSettings = (project: Project, settings: Object) => {
const {updateProject} = this.props
const { updateProject } = this.props
// Update project and re-fetch feeds.
updateProject(project.id, settings, true)
}

render () {
const {
activeSettingsPanel,
deleteProject,
project,
projectEditDisabled,
updateProject,
user
} = this.props
const activePanel = !activeSettingsPanel
? <ProjectSettingsForm
deleteProject={deleteProject}
editDisabled={projectEditDisabled}
onCancelUrl={`project/${project.id}/`}
project={project}
updateProject={updateProject}
showDangerZone
user={user}
/>
: <DeploymentSettings
project={project}
updateProject={updateProject}
editDisabled={projectEditDisabled} />
return (
<Row>
<Col xs={12} sm={3}>
<Panel>
<ListGroup>
<LinkContainer
to={`/project/${project.id}/settings`}>
<ListGroupItem>
{this.messages('title')}
</ListGroupItem>
</LinkContainer>
{isModuleEnabled('deployment')
? (
<LinkContainer
data-test-id='deployment-settings-link'
to={`/project/${project.id}/settings/deployment`}
>
<ListGroupItem>{this.messages('deployment.title')}</ListGroupItem>
</LinkContainer>
)
: null
}
</ListGroup>
</Panel>
</Col>
<Col xs={12} sm={7}>
{activePanel}
</Col>
</Row>
)
return <Row>
<Col xs={12} sm={2} />
<Col xs={12} sm={7}>
<ProjectSettingsForm
deleteProject={deleteProject}
editDisabled={projectEditDisabled}
onCancelUrl={`project/${project.id}/`}
project={project}
updateProject={updateProject}
showDangerZone
user={user}
/>
</Col>
</Row>
}
}
Loading

0 comments on commit 4778738

Please sign in to comment.