Skip to content

Commit 07f5312

Browse files
author
Elaman Nazarkulov
authored
Merge pull request #133 from OpenFuturePlatform/public-api-elaman
Frontend application list remove button style
2 parents 403b8e5 + 91e3100 commit 07f5312

File tree

2 files changed

+60
-66
lines changed

2 files changed

+60
-66
lines changed

frontend/src/components/GatewayApplicationList.js

Lines changed: 60 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -4,80 +4,81 @@ import {Button, Card, Divider, Grid, Icon} from 'semantic-ui-react';
44
import {ProjectPagination} from '../components-ui/ProjectPagination';
55
import {GATEWAY_LIMIT} from '../const';
66
import {
7-
fetchGatewayApplications,
8-
removeGatewayApplication
7+
fetchGatewayApplications,
8+
removeGatewayApplication
99
} from "../actions/gateways";
1010
import {GatewayApplicationRemove} from "./GatewayApplicationRemove";
1111
import {WordWrap} from "../components-ui/WordWrap";
1212
import {Link} from "react-router-dom";
1313

1414

1515
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+
}
3019

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+
};
3523

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+
}
5127

52-
<Button basic color='red'>
53-
<GatewayApplicationRemove gateway={gateway} onSubmit={() => this.onRemoveGateway(gateway)} />
54-
</Button>
28+
renderApplications() {
29+
const gateways = this.props.gateways;
5530

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>
6235

63-
render() {
64-
const gateways = this.props.gateways;
65-
return (
6636
<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>
7155
</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+
}
7474
}
75-
const mapStateToProps = ({ gateways }) => ({ gateways: gateways });
75+
76+
const mapStateToProps = ({gateways}) => ({gateways: gateways});
7677

7778
export default connect(
78-
mapStateToProps,
79-
{
80-
fetchGatewayApplications,
81-
removeGatewayApplication
82-
}
79+
mapStateToProps,
80+
{
81+
fetchGatewayApplications,
82+
removeGatewayApplication
83+
}
8384
)(GatewayApplicationList);

src/main/kotlin/io/openfuture/api/config/WebMvcConfig.kt

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,10 @@
11
package io.openfuture.api.config
22

33
import io.openfuture.api.annotation.resolver.CurrentUserArgumentResolver
4-
import io.openfuture.api.config.interceptor.AccessKeyHolder
5-
import io.openfuture.api.config.interceptor.AccessKeyInterceptor
64
import io.openfuture.api.service.UserService
7-
import org.springframework.context.annotation.Bean
85
import org.springframework.context.annotation.Configuration
9-
import org.springframework.context.annotation.Scope
10-
import org.springframework.context.annotation.ScopedProxyMode
11-
import org.springframework.web.context.WebApplicationContext
126
import org.springframework.web.method.support.HandlerMethodArgumentResolver
137
import org.springframework.web.servlet.config.annotation.CorsRegistry
14-
import org.springframework.web.servlet.config.annotation.InterceptorRegistry
158
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer
169

1710

0 commit comments

Comments
 (0)