@@ -4,80 +4,81 @@ import {Button, Card, Divider, Grid, Icon} from 'semantic-ui-react';
4
4
import { ProjectPagination } from '../components-ui/ProjectPagination' ;
5
5
import { GATEWAY_LIMIT } from '../const' ;
6
6
import {
7
- fetchGatewayApplications ,
8
- removeGatewayApplication
7
+ fetchGatewayApplications ,
8
+ removeGatewayApplication
9
9
} from "../actions/gateways" ;
10
10
import { GatewayApplicationRemove } from "./GatewayApplicationRemove" ;
11
11
import { WordWrap } from "../components-ui/WordWrap" ;
12
12
import { Link } from "react-router-dom" ;
13
13
14
14
15
15
class GatewayApplicationList extends Component {
16
- componentDidMount ( ) {
17
- this . fetchGatewayApplications ( ) ;
18
- }
19
-
20
- fetchGatewayApplications = ( offset = 0 , limit = GATEWAY_LIMIT ) => {
21
- this . props . fetchGatewayApplications ( offset , limit ) ;
22
- } ;
23
-
24
- onRemoveGateway = gateway => {
25
- this . props . removeGatewayApplication ( gateway . id ) ;
26
- }
27
-
28
- renderApplications ( ) {
29
- const gateways = this . props . gateways ;
16
+ componentDidMount ( ) {
17
+ this . fetchGatewayApplications ( ) ;
18
+ }
30
19
31
- return gateways . list . map ( ( gateway , index ) => {
32
- return (
33
- < Card fluid key = { index } >
34
- < Card . Content >
20
+ fetchGatewayApplications = ( offset = 0 , limit = GATEWAY_LIMIT ) => {
21
+ this . props . fetchGatewayApplications ( offset , limit ) ;
22
+ } ;
35
23
36
- < Grid . Row >
37
- < Grid . Column width = { 8 } >
38
- < Link to = { `/applications/${ gateway . id } ` } >
39
- < Card . Header >
40
- < WordWrap > { gateway . name } </ WordWrap >
41
- </ Card . Header >
42
- </ Link >
43
- < div className = "meta" >
44
- Webhook: { gateway . webHook }
45
- </ div >
46
- </ Grid . Column >
47
- </ Grid . Row >
48
- </ Card . Content >
49
- < Card . Content extra >
50
- < div className = 'ui three buttons' >
24
+ onRemoveGateway = gateway => {
25
+ this . props . removeGatewayApplication ( gateway . id ) ;
26
+ }
51
27
52
- < Button basic color = 'red' >
53
- < GatewayApplicationRemove gateway = { gateway } onSubmit = { ( ) => this . onRemoveGateway ( gateway ) } />
54
- </ Button >
28
+ renderApplications ( ) {
29
+ const gateways = this . props . gateways ;
55
30
56
- </ div >
57
- </ Card . Content >
58
- </ Card >
59
- ) ;
60
- } ) ;
61
- }
31
+ return gateways . list . map ( ( gateway , index ) => {
32
+ return (
33
+ < Card fluid key = { index } >
34
+ < Card . Content >
62
35
63
- render ( ) {
64
- const gateways = this . props . gateways ;
65
- return (
66
36
< Grid . Row >
67
- < Grid . Column width = { 16 } >
68
- { this . renderApplications ( ) }
69
- < ProjectPagination limit = { GATEWAY_LIMIT } totalCount = { gateways . totalCount } onChange = { this . fetchGatewayApplications } />
70
- </ Grid . Column >
37
+ < Grid . Column width = { 8 } >
38
+ < Link to = { `/applications/${ gateway . id } ` } >
39
+ < Card . Header >
40
+ < WordWrap > { gateway . name } </ WordWrap >
41
+ </ Card . Header >
42
+ </ Link >
43
+ < div className = "meta" style = { { display : "inline-flex" , width : "100%" } } >
44
+ < div className = "webhook" style = { { width : "100%" } } >
45
+ Webhook: { gateway . webHook }
46
+ </ div >
47
+ < div className = 'ui buttons' >
48
+ < Button basic color = 'red' >
49
+ < GatewayApplicationRemove gateway = { gateway } onSubmit = { ( ) => this . onRemoveGateway ( gateway ) } />
50
+ </ Button >
51
+ </ div >
52
+ </ div >
53
+
54
+ </ Grid . Column >
71
55
</ Grid . Row >
72
- ) ;
73
- }
56
+ </ Card . Content >
57
+ </ Card >
58
+ ) ;
59
+ } ) ;
60
+ }
61
+
62
+ render ( ) {
63
+ const gateways = this . props . gateways ;
64
+ return (
65
+ < Grid . Row >
66
+ < Grid . Column width = { 16 } >
67
+ { this . renderApplications ( ) }
68
+ < ProjectPagination limit = { GATEWAY_LIMIT } totalCount = { gateways . totalCount }
69
+ onChange = { this . fetchGatewayApplications } />
70
+ </ Grid . Column >
71
+ </ Grid . Row >
72
+ ) ;
73
+ }
74
74
}
75
- const mapStateToProps = ( { gateways } ) => ( { gateways : gateways } ) ;
75
+
76
+ const mapStateToProps = ( { gateways} ) => ( { gateways : gateways } ) ;
76
77
77
78
export default connect (
78
- mapStateToProps ,
79
- {
80
- fetchGatewayApplications,
81
- removeGatewayApplication
82
- }
79
+ mapStateToProps ,
80
+ {
81
+ fetchGatewayApplications,
82
+ removeGatewayApplication
83
+ }
83
84
) ( GatewayApplicationList ) ;
0 commit comments