Skip to content

Commit 0ba5d0d

Browse files
author
Elaman Nazarkulov
authored
Merge pull request #84 from OpenFuturePlatform/key-master-fix
Key master fix
2 parents aeeccca + fb072fa commit 0ba5d0d

File tree

16 files changed

+123
-98
lines changed

16 files changed

+123
-98
lines changed

frontend/src/actions/gateways.js

+8
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,14 @@ export const saveGatewayApplication = formValues => async (dispatch) => {
3131
await dispatch(apiPost(getGatewayApplicationsPath(), formValues));
3232
};
3333

34+
export const updateGatewayApplication = (id) => async (dispatch) => {
35+
const gateway = await dispatch(apiPost(getGatewayApplicationsPath(id)));
36+
const error = '';
37+
const payload = { id, gateway, error, loading: false };
38+
39+
dispatch({ type: SET_GATEWAY_APPLICATION_SET, payload });
40+
};
41+
3442
export const fetchGatewayApplicationDetailsFromApi = (id) => async dispatch => {
3543
dispatch({ type: SET_GATEWAY_APPLICATION_SET, payload: { id, loading: true } });
3644

frontend/src/components/GatewayApplicationKeyGenerate.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -38,10 +38,10 @@ class GatewayApplicationKeyGenerateComponent extends Component {
3838

3939
onSubmit = async () => {
4040
const { submitWithSaving } = this.props;
41-
const { expiredDate, gatewayId } = this.state;
41+
const { expiredDate } = this.state;
4242
this.setState({ isSaving: true });
4343

44-
submitWithSaving({ expiredDate: expiredDate, gatewayId: gatewayId });
44+
submitWithSaving({ expiredDate });
4545
};
4646

4747
render() {
@@ -50,7 +50,7 @@ class GatewayApplicationKeyGenerateComponent extends Component {
5050
return (
5151
<KeyGenerateContainer>
5252
<Button primary type="button" floated="right" onClick={this.onShow}>
53-
Generate New Key
53+
Generate New Keys
5454
</Button>
5555
<Modal size="tiny" open={isVisible} onClose={this.onBackgroundClick}>
5656
<Modal.Header>Generate Application Key</Modal.Header>

frontend/src/components/GatewayApplicationWallet.js

-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ import {Table} from "../components-ui/Table";
88
import {WalletGenerate} from "./GatewayApplicationWalletGenerate";
99
import {
1010
generateGatewayApplicationWallet,
11-
getGatewayApplicationWallet,
1211
removeGatewayApplicationWallet
1312
} from "../actions/gateway-wallet";
1413

frontend/src/scenes/GatewayApplicationSummary.js

+7-4
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import {Card, Grid} from "semantic-ui-react";
33
import {WordWrap} from "../components-ui/WordWrap";
44
import {bindActionCreators} from "redux";
55
import {connect} from "react-redux";
6-
import {fetchGatewayApplicationDetails} from "../actions/gateways";
6+
import {fetchGatewayApplicationDetails, updateGatewayApplication} from "../actions/gateways";
77

88
import {GatewayApplicationWallet} from "../components/GatewayApplicationWallet";
99
import {getGatewayApplicationWallet} from "../actions/gateway-wallet";
@@ -28,8 +28,10 @@ class GatewayApplicationSummary extends Component {
2828

2929
getGatewayId = () => this.props.match.params.id;
3030

31-
onKeyGenerate = () => {
31+
onKeyGenerate = expiredDate => {
3232
const { gateway } = this.props;
33+
this.props.actions.updateGatewayApplication(gateway.id);
34+
3335
}
3436

3537
render() {
@@ -52,7 +54,7 @@ class GatewayApplicationSummary extends Component {
5254
</div>
5355
</Card.Content>
5456
<Card.Content>
55-
<GatewayKeyGenerate gateway={gateway} onSubmit={this.onKeyGenerate()} />
57+
<GatewayKeyGenerate gateway={gateway} onSubmit={this.onKeyGenerate} />
5658
<div className="table-key"><strong>Access Key</strong></div>
5759
<div className="table-value table-value-background-color access-key selectable"
5860
id="credentials-sb">{gateway.apiAccessKey}
@@ -95,7 +97,8 @@ const mapDispatchToProps = dispatch => ({
9597
actions: bindActionCreators(
9698
{
9799
fetchGatewayApplicationDetails,
98-
getGatewayApplicationWallet
100+
getGatewayApplicationWallet,
101+
updateGatewayApplication
99102
},
100103
dispatch
101104
)

payment-chooser/build/index.html

+2-6
Original file line numberDiff line numberDiff line change
@@ -34,18 +34,14 @@
3434
<h2 class="card-header-title">Your Order</h2>
3535
</div>
3636
<div class="card-body">
37-
<!--<ul class="list-inline">
38-
<li class="list-inline-item"><h4>Order ${orderId}</h4></li>
39-
<li class="list-inline-item">${amount} ${currency}</li>
40-
</ul>-->
4137
<div class="row align-items-left">
4238
<div class="col-md-6 mb-1 mb-md-0">Amount:</div>
43-
<div class="col-md-6 amount">`${currency}`</div>
39+
<div class="col-md-6 amount"></div>
4440
</div>
4541
<hr class="hr-space">
4642
<div class="row align-items-left">
4743
<div class="col-md-6 mb-1 mb-md-0">Remaining:</div>
48-
<div class="col-md-6 remaining">`${currency}`</div>
44+
<div class="col-md-6 remaining"></div>
4945
</div>
5046
</div>
5147
<div id="countdown"></div>

payment-chooser/build/resources/static/static/js/payment-chooser.js

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

payment-chooser/build/resources/static/static/js/payment-chooser.js.map

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

payment-chooser/build/resources/templates/payment-chooser.ftl

+2-6
Original file line numberDiff line numberDiff line change
@@ -34,18 +34,14 @@
3434
<h2 class="card-header-title">Your Order</h2>
3535
</div>
3636
<div class="card-body">
37-
<!--<ul class="list-inline">
38-
<li class="list-inline-item"><h4>Order ${orderId}</h4></li>
39-
<li class="list-inline-item">${amount} ${currency}</li>
40-
</ul>-->
4137
<div class="row align-items-left">
4238
<div class="col-md-6 mb-1 mb-md-0">Amount:</div>
43-
<div class="col-md-6 amount">`${currency}`</div>
39+
<div class="col-md-6 amount"></div>
4440
</div>
4541
<hr class="hr-space">
4642
<div class="row align-items-left">
4743
<div class="col-md-6 mb-1 mb-md-0">Remaining:</div>
48-
<div class="col-md-6 remaining">`${currency}`</div>
44+
<div class="col-md-6 remaining"></div>
4945
</div>
5046
</div>
5147
<div id="countdown"></div>

payment-chooser/build/static/js/payment-chooser.js

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

payment-chooser/build/static/js/payment-chooser.js.map

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)