1
1
// @flow
2
2
3
3
import React , { Component } from 'react'
4
- import { Row , Col , Panel , ListGroup , ListGroupItem } from 'react-bootstrap'
5
- import { LinkContainer } from 'react-router-bootstrap'
4
+ import { Row , Col } from 'react-bootstrap'
6
5
7
6
import * as projectActions from '../actions/projects'
8
7
import {
9
- getComponentMessages ,
10
- isModuleEnabled
8
+ getComponentMessages
11
9
} from '../../common/util/config'
12
10
import type { ManagerUserState } from '../../types/reducers'
13
11
import type { Project } from '../../types'
14
12
15
- import DeploymentSettings from './deployment/DeploymentSettings'
16
13
import ProjectSettingsForm from './ProjectSettingsForm'
17
14
18
15
type Props = {
@@ -28,63 +25,32 @@ export default class ProjectSettings extends Component<Props> {
28
25
messages = getComponentMessages ( 'ProjectSettings' )
29
26
30
27
_updateProjectSettings = ( project : Project , settings : Object ) => {
31
- const { updateProject} = this . props
28
+ const { updateProject } = this . props
32
29
// Update project and re-fetch feeds.
33
30
updateProject ( project . id , settings , true )
34
31
}
35
32
36
33
render ( ) {
37
34
const {
38
- activeSettingsPanel ,
39
35
deleteProject ,
40
36
project,
41
37
projectEditDisabled,
42
38
updateProject,
43
39
user
44
40
} = this . props
45
- const activePanel = ! activeSettingsPanel
46
- ? < ProjectSettingsForm
47
- deleteProject = { deleteProject }
48
- editDisabled = { projectEditDisabled }
49
- onCancelUrl = { `project/${ project . id } /` }
50
- project = { project }
51
- updateProject = { updateProject }
52
- showDangerZone
53
- user = { user }
54
- />
55
- : < DeploymentSettings
56
- project = { project }
57
- updateProject = { updateProject }
58
- editDisabled = { projectEditDisabled } />
59
- return (
60
- < Row >
61
- < Col xs = { 12 } sm = { 3 } >
62
- < Panel >
63
- < ListGroup >
64
- < LinkContainer
65
- to = { `/project/${ project . id } /settings` } >
66
- < ListGroupItem >
67
- { this . messages ( 'title' ) }
68
- </ ListGroupItem >
69
- </ LinkContainer >
70
- { isModuleEnabled ( 'deployment' )
71
- ? (
72
- < LinkContainer
73
- data-test-id = 'deployment-settings-link'
74
- to = { `/project/${ project . id } /settings/deployment` }
75
- >
76
- < ListGroupItem > { this . messages ( 'deployment.title' ) } </ ListGroupItem >
77
- </ LinkContainer >
78
- )
79
- : null
80
- }
81
- </ ListGroup >
82
- </ Panel >
83
- </ Col >
84
- < Col xs = { 12 } sm = { 7 } >
85
- { activePanel }
86
- </ Col >
87
- </ Row >
88
- )
41
+ return < Row >
42
+ < Col xs = { 12 } sm = { 2 } />
43
+ < Col xs = { 12 } sm= { 7 } >
44
+ < ProjectSettingsForm
45
+ deleteProject = { deleteProject }
46
+ editDisabled = { projectEditDisabled }
47
+ onCancelUrl = { `project/${ project . id } /` }
48
+ project = { project }
49
+ updateProject = { updateProject }
50
+ showDangerZone
51
+ user = { user }
52
+ />
53
+ < / C o l >
54
+ </Row >
89
55
}
90
56
}
0 commit comments