Skip to content

Commit

Permalink
Frontend application list remove button style
Browse files Browse the repository at this point in the history
  • Loading branch information
physcom committed Oct 18, 2023
1 parent c95ceef commit 91e3100
Show file tree
Hide file tree
Showing 2 changed files with 60 additions and 66 deletions.
119 changes: 60 additions & 59 deletions frontend/src/components/GatewayApplicationList.js
Expand Up @@ -4,80 +4,81 @@ import {Button, Card, Divider, Grid, Icon} from 'semantic-ui-react';
import {ProjectPagination} from '../components-ui/ProjectPagination';
import {GATEWAY_LIMIT} from '../const';
import {
fetchGatewayApplications,
removeGatewayApplication
fetchGatewayApplications,
removeGatewayApplication
} from "../actions/gateways";
import {GatewayApplicationRemove} from "./GatewayApplicationRemove";
import {WordWrap} from "../components-ui/WordWrap";
import {Link} from "react-router-dom";


class GatewayApplicationList extends Component {
componentDidMount() {
this.fetchGatewayApplications();
}

fetchGatewayApplications = (offset = 0, limit = GATEWAY_LIMIT) => {
this.props.fetchGatewayApplications(offset, limit);
};

onRemoveGateway = gateway => {
this.props.removeGatewayApplication(gateway.id);
}

renderApplications() {
const gateways = this.props.gateways;
componentDidMount() {
this.fetchGatewayApplications();
}

return gateways.list.map((gateway, index) => {
return (
<Card fluid key={index}>
<Card.Content>
fetchGatewayApplications = (offset = 0, limit = GATEWAY_LIMIT) => {
this.props.fetchGatewayApplications(offset, limit);
};

<Grid.Row>
<Grid.Column width={8}>
<Link to={`/applications/${gateway.id}`}>
<Card.Header>
<WordWrap>{gateway.name}</WordWrap>
</Card.Header>
</Link>
<div className="meta">
Webhook: {gateway.webHook}
</div>
</Grid.Column>
</Grid.Row>
</Card.Content>
<Card.Content extra>
<div className='ui three buttons'>
onRemoveGateway = gateway => {
this.props.removeGatewayApplication(gateway.id);
}

<Button basic color='red'>
<GatewayApplicationRemove gateway={gateway} onSubmit={() => this.onRemoveGateway(gateway)} />
</Button>
renderApplications() {
const gateways = this.props.gateways;

</div>
</Card.Content>
</Card>
);
});
}
return gateways.list.map((gateway, index) => {
return (
<Card fluid key={index}>
<Card.Content>

render() {
const gateways = this.props.gateways;
return (
<Grid.Row>
<Grid.Column width={16}>
{this.renderApplications()}
<ProjectPagination limit={GATEWAY_LIMIT} totalCount={gateways.totalCount} onChange={this.fetchGatewayApplications} />
</Grid.Column>
<Grid.Column width={8}>
<Link to={`/applications/${gateway.id}`}>
<Card.Header>
<WordWrap>{gateway.name}</WordWrap>
</Card.Header>
</Link>
<div className="meta" style={{display: "inline-flex", width: "100%"}}>
<div className="webhook" style={{width: "100%"}}>
Webhook: {gateway.webHook}
</div>
<div className='ui buttons'>
<Button basic color='red'>
<GatewayApplicationRemove gateway={gateway} onSubmit={() => this.onRemoveGateway(gateway)}/>
</Button>
</div>
</div>

</Grid.Column>
</Grid.Row>
);
}
</Card.Content>
</Card>
);
});
}

render() {
const gateways = this.props.gateways;
return (
<Grid.Row>
<Grid.Column width={16}>
{this.renderApplications()}
<ProjectPagination limit={GATEWAY_LIMIT} totalCount={gateways.totalCount}
onChange={this.fetchGatewayApplications}/>
</Grid.Column>
</Grid.Row>
);
}
}
const mapStateToProps = ({ gateways }) => ({ gateways: gateways });

const mapStateToProps = ({gateways}) => ({gateways: gateways});

export default connect(
mapStateToProps,
{
fetchGatewayApplications,
removeGatewayApplication
}
mapStateToProps,
{
fetchGatewayApplications,
removeGatewayApplication
}
)(GatewayApplicationList);
7 changes: 0 additions & 7 deletions src/main/kotlin/io/openfuture/api/config/WebMvcConfig.kt
@@ -1,17 +1,10 @@
package io.openfuture.api.config

import io.openfuture.api.annotation.resolver.CurrentUserArgumentResolver
import io.openfuture.api.config.interceptor.AccessKeyHolder
import io.openfuture.api.config.interceptor.AccessKeyInterceptor
import io.openfuture.api.service.UserService
import org.springframework.context.annotation.Bean
import org.springframework.context.annotation.Configuration
import org.springframework.context.annotation.Scope
import org.springframework.context.annotation.ScopedProxyMode
import org.springframework.web.context.WebApplicationContext
import org.springframework.web.method.support.HandlerMethodArgumentResolver
import org.springframework.web.servlet.config.annotation.CorsRegistry
import org.springframework.web.servlet.config.annotation.InterceptorRegistry
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer


Expand Down

0 comments on commit 91e3100

Please sign in to comment.