From 2f4c76d48adcb421d7b7ea0c83df0d0064a433b7 Mon Sep 17 00:00:00 2001 From: Hasta Ragil Saputra Date: Tue, 29 Jan 2019 15:12:06 +0700 Subject: [PATCH 01/21] feat: email verification --- src/common/pages/Login/LoginBtn.js | 45 ++++++++++++++++++++++++++---- src/common/stores/authenticaton.js | 7 +++++ 2 files changed, 46 insertions(+), 6 deletions(-) diff --git a/src/common/pages/Login/LoginBtn.js b/src/common/pages/Login/LoginBtn.js index 99a09eb..7e390fd 100644 --- a/src/common/pages/Login/LoginBtn.js +++ b/src/common/pages/Login/LoginBtn.js @@ -1,6 +1,7 @@ import React from 'react'; import withStyles from "@material-ui/core/styles/withStyles"; import {styles} from '../Register/registerStyle'; +import {notification} from 'antd'; import Grid from '@material-ui/core/Grid'; import Paper from '@material-ui/core/Paper'; @@ -43,7 +44,39 @@ class BTNLoginPage extends React.Component{ this.authStore = props.appstate.auth; } - handleChange = name => event => { + componentDidMount() { + const urlParams = new URLSearchParams(window.location.search); + + if(urlParams.has('key')) { + this.setState({ + isLoading: true + }); + + this.authStore.verifyEmail(urlParams.get('key')).then((res) => { + if(res.login_request_id) { + notification.open({ + message: 'Email Verification', + description: 'Email verification success' + }); + this.setState({ + isLoading: false + }); + //redirect to otp page + } else { + notification.open({ + message: 'Email Verification', + description: res.message + }); + this.setState({ + isLoading: false + }); + // res.message + } + }) + } + } + + handleChange = name => event => { this.setState({ [name]: event.target.value, }); @@ -131,7 +164,7 @@ class BTNLoginPage extends React.Component{ { - this.state.isNeedEmailVerification && + this.state.isNeedEmailVerification && Your account still need email verification @@ -139,7 +172,7 @@ class BTNLoginPage extends React.Component{ Still not received any email? Resend email - +
} - +
@@ -205,4 +238,4 @@ class BTNLoginPage extends React.Component{ } } -export default withStyles(styles)(BTNLoginPage); \ No newline at end of file +export default withStyles(styles)(BTNLoginPage); diff --git a/src/common/stores/authenticaton.js b/src/common/stores/authenticaton.js index d4ba8d7..9b4f500 100644 --- a/src/common/stores/authenticaton.js +++ b/src/common/stores/authenticaton.js @@ -73,6 +73,13 @@ export class Authentication { }) } + @action + verifyEmail(key) { + return this.http.post('authentication/email_verification', { + key + }) + } + @action logout() { this.context.setToken(""); From 23094db62290aef27f729cba1c2328f0469f5a9c Mon Sep 17 00:00:00 2001 From: enggar_ganteng Date: Tue, 29 Jan 2019 15:17:42 +0700 Subject: [PATCH 02/21] update : login page and auth store --- src/common/pages/Login/LoginBtn.js | 9 ++++++++- src/common/stores/authenticaton.js | 25 +++++++++++++++++++++++++ 2 files changed, 33 insertions(+), 1 deletion(-) diff --git a/src/common/pages/Login/LoginBtn.js b/src/common/pages/Login/LoginBtn.js index 99a09eb..bd06044 100644 --- a/src/common/pages/Login/LoginBtn.js +++ b/src/common/pages/Login/LoginBtn.js @@ -74,6 +74,13 @@ class BTNLoginPage extends React.Component{ else if(res.state == "email_verification"){ this.setState({isNeedEmailVerification:true,isLoading:false}); } + else if(res.state == "phone_verification"){ + this.authStore.otpData = res; + setTimeout(()=>{ + this.props.history.push(LINKS.OTP); + this.setState({isLoading:false}); + },1000); + } }).catch(err => { console.log("err login",err); this.setState({loginFailed:true,isLoading:false}); @@ -137,7 +144,7 @@ class BTNLoginPage extends React.Component{ Your account still need email verification - Still not received any email? Resend email + Still not received any email? this.authStore.resendEmail(this.state.email)}>Resend email
diff --git a/src/common/stores/authenticaton.js b/src/common/stores/authenticaton.js index d4ba8d7..4fc6016 100644 --- a/src/common/stores/authenticaton.js +++ b/src/common/stores/authenticaton.js @@ -37,6 +37,7 @@ export class Authentication { // airline_settings: [] // } }; + @observable otpData = {} constructor(context) { this.context = context; @@ -117,6 +118,30 @@ export class Authentication { }) } + @action + resendEmail(data) { + this.isRegistering = true; + return this.http.post("/resend_email_verification", data) + .then(res => { + return res; + }) + .catch(err => { + throw err; + }) + } + + @action + validateOtp(data) { + this.isRegistering = true; + return this.http.post("/validate_otp", data) + .then(res => { + return res; + }) + .catch(err => { + throw err; + }) + } + createCookie(name,value,days) { let expires if (days) { From c066c37db8fef3eb94d931d146fc71243c74ed82 Mon Sep 17 00:00:00 2001 From: ahmadzuhdi Date: Tue, 29 Jan 2019 15:17:49 +0700 Subject: [PATCH 03/21] feat: add referal in register --- src/common/pages/RegisterNew/index.js | 32 +++++++++++++++++++++++++-- 1 file changed, 30 insertions(+), 2 deletions(-) diff --git a/src/common/pages/RegisterNew/index.js b/src/common/pages/RegisterNew/index.js index 9cd62c4..f15288b 100644 --- a/src/common/pages/RegisterNew/index.js +++ b/src/common/pages/RegisterNew/index.js @@ -40,6 +40,8 @@ class RegisterPage extends React.Component { fileList_ktp: [], fileList_photo: [], + query: {}, + // form confirmPassword: "", phone_number: "", @@ -65,6 +67,18 @@ class RegisterPage extends React.Component { } componentDidMount() { + let {location:{search}} = this.props; + search = search.substr(1); + + const query = search.split("&") + .map(q => q.split('=')) + .reduce((all, q) => { + all[q[0]] = q[1]; + return all; + }, {}); + + this.setState({query}); + this.place.getAllProvince(); } @@ -114,6 +128,15 @@ class RegisterPage extends React.Component { }; register = () => { + + if (this.state.upload_photo === '') { + return message.warning("please upload photo"); + } + + if (this.state.upload_ktp === '') { + return message.warning("please upload ktp"); + } + this.setState({ isLoading: true }); let data = { fullname: this.state.full_name, @@ -129,11 +152,13 @@ class RegisterPage extends React.Component { district_id: this.state.district, subdistrict_id: this.state.subdistrict, zip_code: this.state.zip_code, + referal: this.state.query.referal, additional_data: {} }; this.authStore.register(data).then(res => { setTimeout(() => { this.setState({ isLoading: false }); + message.success("Please check your email to confirm your account"); }, 1000); }).catch(err => { this.setState({ isLoading: false }); @@ -478,8 +503,11 @@ class RegisterPage extends React.Component {
-
From be87bb811371ee7f24d0e719753e40737280f040 Mon Sep 17 00:00:00 2001 From: Rifqy Zacky Ariadhy Date: Tue, 29 Jan 2019 15:31:26 +0700 Subject: [PATCH 04/21] update: adjust stepper component to using material-ui v3 --- package-lock.json | 20 +++-- src/common/pages/Vouchers/Stepper/index.js | 85 +++++++++++--------- src/common/pages/Vouchers/Stepper/style.scss | 8 +- 3 files changed, 69 insertions(+), 44 deletions(-) diff --git a/package-lock.json b/package-lock.json index 2557cee..062ebd4 100644 --- a/package-lock.json +++ b/package-lock.json @@ -7894,6 +7894,7 @@ "brace-expansion": { "version": "1.1.11", "bundled": true, + "optional": true, "requires": { "balanced-match": "^1.0.0", "concat-map": "0.0.1" @@ -7905,15 +7906,18 @@ }, "code-point-at": { "version": "1.1.0", - "bundled": true + "bundled": true, + "optional": true }, "concat-map": { "version": "0.0.1", - "bundled": true + "bundled": true, + "optional": true }, "console-control-strings": { "version": "1.1.0", - "bundled": true + "bundled": true, + "optional": true }, "core-util-is": { "version": "1.0.2", @@ -8003,7 +8007,8 @@ }, "inherits": { "version": "2.0.3", - "bundled": true + "bundled": true, + "optional": true }, "ini": { "version": "1.3.5", @@ -8012,6 +8017,7 @@ "is-fullwidth-code-point": { "version": "1.0.0", "bundled": true, + "optional": true, "requires": { "number-is-nan": "^1.0.0" } @@ -8034,6 +8040,7 @@ "minipass": { "version": "2.3.5", "bundled": true, + "optional": true, "requires": { "safe-buffer": "^5.1.2", "yallist": "^3.0.0" @@ -8120,7 +8127,8 @@ }, "number-is-nan": { "version": "1.0.1", - "bundled": true + "bundled": true, + "optional": true }, "object-assign": { "version": "4.1.1", @@ -8129,6 +8137,7 @@ "once": { "version": "1.4.0", "bundled": true, + "optional": true, "requires": { "wrappy": "1" } @@ -8214,6 +8223,7 @@ "string-width": { "version": "1.0.2", "bundled": true, + "optional": true, "requires": { "code-point-at": "^1.0.0", "is-fullwidth-code-point": "^1.0.0", diff --git a/src/common/pages/Vouchers/Stepper/index.js b/src/common/pages/Vouchers/Stepper/index.js index db027d9..1a39608 100644 --- a/src/common/pages/Vouchers/Stepper/index.js +++ b/src/common/pages/Vouchers/Stepper/index.js @@ -1,26 +1,40 @@ import {inject, observer} from "mobx-react"; +import PropTypes from 'prop-types'; import React from "react"; import './style.scss'; -import { - Step, - Stepper, - StepLabel, -} from 'material-ui/Stepper'; +import Button from '@material-ui/core/Button'; import RaisedButton from 'material-ui/RaisedButton'; import FlatButton from 'material-ui/FlatButton'; import NavigationArrowBack from 'material-ui/svg-icons/navigation/arrow-back'; -import {Divider} from "material-ui"; +import {Divider} from "@material-ui/core"; import CheckoutVouchers from "../Checkout"; import PaymentVouchers from "../Payment"; import {LINKS} from "../../../routes"; import {notification, Modal} from "antd"; import FinishVouchers from "../Finish"; +import { withStyles } from '@material-ui/core/styles'; +import Stepper from '@material-ui/core/Stepper'; +import Step from '@material-ui/core/Step'; +import StepLabel from '@material-ui/core/StepLabel'; const confirm = Modal.confirm; +const styles = theme => ({ + button: { + margin: theme.spacing.unit, + }, + input: { + display: 'none', + }, + divider: { + marginBottom: 10, + marginTop: 10, + } +}); + @inject('appstate') @observer -export default class VoucherStepperComponent extends React.Component { +export class VoucherStepper extends React.Component { constructor(props) { super(props); @@ -38,7 +52,7 @@ export default class VoucherStepperComponent extends React.Component { componentWillMount() { if(!this.vouchersStore.dataItems.name){ // alert('jalan') - this.props.history.push(LINKS.VOUCHERS); + this.props.history.push(LINKS.DASHBOARD); } // alert('engga') } @@ -94,19 +108,24 @@ export default class VoucherStepperComponent extends React.Component { }; renderButton = () => { + const {classes} = this.props; return(
- this.props.history.goBack() : this.handlePrev} - style={{marginRight: 12}} - /> - + {/* this.props.history.goBack() : this.handlePrev}*/} + {/*style={{marginRight: 12}}*/} + {/*/>*/} + + + {/**/}
); }; @@ -126,6 +145,7 @@ export default class VoucherStepperComponent extends React.Component { render() { const {finished, stepIndex} = this.state; + const {classes} = this.props; const contentStyle = {margin: '0 16px'}; if(!this.vouchersStore.dataItems.name){ @@ -158,25 +178,10 @@ export default class VoucherStepperComponent extends React.Component { Finish - + + {/**/}
- {finished ? ( -

- { - event.preventDefault(); - this.setState({stepIndex: 0, finished: false}); - }} - > - Click here - to reset the example. -

- ) : ( -
-

{this.getStepContent(stepIndex)}

-
- )} + {this.getStepContent(stepIndex)}
@@ -184,3 +189,9 @@ export default class VoucherStepperComponent extends React.Component { } } + +VoucherStepper.propTypes = { + classes: PropTypes.object.isRequired, +}; + +export default withStyles(styles)(VoucherStepper); diff --git a/src/common/pages/Vouchers/Stepper/style.scss b/src/common/pages/Vouchers/Stepper/style.scss index f4639bd..8a1090f 100644 --- a/src/common/pages/Vouchers/Stepper/style.scss +++ b/src/common/pages/Vouchers/Stepper/style.scss @@ -1,9 +1,13 @@ .stepper{ margin-top: 5vh; + display: flex; + justify-content: center; + align-items: center; + //background-color: #fff; .divider-container{ - max-width: 65vw; + max-width: 75vw; } .stepper-container{ - max-width: 65vw; + max-width: 75vw; } } From 1268bfb8d17630d182ef054975c2a4fa699449f3 Mon Sep 17 00:00:00 2001 From: ahmadzuhdi Date: Tue, 29 Jan 2019 15:43:03 +0700 Subject: [PATCH 05/21] update: add input for referal register --- src/common/pages/RegisterNew/index.js | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/src/common/pages/RegisterNew/index.js b/src/common/pages/RegisterNew/index.js index f15288b..79a8d4a 100644 --- a/src/common/pages/RegisterNew/index.js +++ b/src/common/pages/RegisterNew/index.js @@ -501,6 +501,24 @@ class RegisterPage extends React.Component { + + { + this.setState({ + query: { + ...this.state.query, + referal: event.target.value + } + }) + }} + margin="normal" + type={"text"} + fullWidth + variant="outlined" + /> +
diff --git a/src/common/pages/RegisterNew/styles.js b/src/common/pages/RegisterNew/styles.js index 88b6b1d..7f6ce1b 100644 --- a/src/common/pages/RegisterNew/styles.js +++ b/src/common/pages/RegisterNew/styles.js @@ -10,7 +10,8 @@ export const styles = theme => ({ }, gridContainer : { flex :1, - justifyContent:'center' + justifyContent: 'center', + flexDirection: 'column' }, registerContainer: { marginTop : 50 @@ -34,4 +35,4 @@ export const styles = theme => ({ background : yellow['500'], padding : 20 }, -}); \ No newline at end of file +}); From af56a6e4fb5a9df0468642a373e79ce288224890 Mon Sep 17 00:00:00 2001 From: Rifqy Zacky Ariadhy Date: Tue, 29 Jan 2019 17:11:21 +0700 Subject: [PATCH 13/21] update: responsive layout checkout stepper --- src/common/pages/Vouchers/Checkout/index.js | 2 +- src/common/pages/Vouchers/Checkout/style.scss | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/common/pages/Vouchers/Checkout/index.js b/src/common/pages/Vouchers/Checkout/index.js index c172b0f..0a23dd7 100644 --- a/src/common/pages/Vouchers/Checkout/index.js +++ b/src/common/pages/Vouchers/Checkout/index.js @@ -114,7 +114,7 @@ export class CheckoutVouchers extends React.Component {

{this.props.appstate.wallet.data.point || 0} Points

- +

Total Pembayaran Point

diff --git a/src/common/pages/Vouchers/Checkout/style.scss b/src/common/pages/Vouchers/Checkout/style.scss index 28d8771..477240c 100644 --- a/src/common/pages/Vouchers/Checkout/style.scss +++ b/src/common/pages/Vouchers/Checkout/style.scss @@ -42,6 +42,10 @@ width: 90vw; margin-left: -3.5vw; } + + .right-container{ + margin-left: -2.5vw; + } } .checkout-parent{ From e6319a3c339964556eb9d0e1283c726ee0c59e9b Mon Sep 17 00:00:00 2001 From: Hasta Ragil Saputra Date: Tue, 29 Jan 2019 17:13:02 +0700 Subject: [PATCH 14/21] fix size --- src/common/pages/RegisterNew/index.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/common/pages/RegisterNew/index.js b/src/common/pages/RegisterNew/index.js index 9c6c746..89c59a4 100644 --- a/src/common/pages/RegisterNew/index.js +++ b/src/common/pages/RegisterNew/index.js @@ -363,7 +363,10 @@ class RegisterPage extends React.Component { showUploadList={false} {...this.createUploadProps("ktp")} > - {upload_ktp ? avatar : uploadButtonKtp} + {upload_ktp ? avatar : uploadButtonKtp} From 65cb2b73422ca5fc647d67459685faef5f833d97 Mon Sep 17 00:00:00 2001 From: Hasta Ragil Saputra Date: Tue, 29 Jan 2019 17:25:36 +0700 Subject: [PATCH 15/21] fix: height --- src/common/pages/RegisterNew/index.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/common/pages/RegisterNew/index.js b/src/common/pages/RegisterNew/index.js index 89c59a4..83874e2 100644 --- a/src/common/pages/RegisterNew/index.js +++ b/src/common/pages/RegisterNew/index.js @@ -378,7 +378,10 @@ class RegisterPage extends React.Component { showUploadList={false} {...this.createUploadProps("photo")} > - {upload_photo ? avatar : uploadButtonPhoto} + {upload_photo ? avatar : uploadButtonPhoto} From c05011938c01f447381a9b24c413a0d1ec1b8754 Mon Sep 17 00:00:00 2001 From: ahmadzuhdi Date: Tue, 29 Jan 2019 17:27:18 +0700 Subject: [PATCH 16/21] update: redirect after register --- package.json | 3 ++- src/common/pages/RegisterNew/index.js | 6 ++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index 2f4919b..bda0a9a 100644 --- a/package.json +++ b/package.json @@ -17,7 +17,8 @@ "dev:parcel": "node scripts/dev-parcel.js", "deploy": "rsync -chavzP -e \"ssh -p 2222\" --stats dist/ root@209.58.165.19:/home/apps/giift/giift-customer-btn", "deploy:giift": "rsync -chavzP -e \"ssh -p 2222\" --stats dist/ root@209.58.165.19:/home/apps/giift/giift-customer", - "dev2:parcel": "node scripts/link-assets.js; parcel public/index.parcel.html --out-file index.html --global $" + "dev2:parcel": "node scripts/link-assets.js; parcel public/index.parcel.html --out-file index.html --global $", + "build:deploy": "npm run build:parcel:prod && npm run deploy" }, "author": "Asacreative", "repository": { diff --git a/src/common/pages/RegisterNew/index.js b/src/common/pages/RegisterNew/index.js index 83874e2..88e3aaf 100644 --- a/src/common/pages/RegisterNew/index.js +++ b/src/common/pages/RegisterNew/index.js @@ -22,6 +22,7 @@ import { Upload, Icon, message } from 'antd'; import AutoComplete from './../../components/AutoComplete'; import {appConfig} from "../../config/app"; +import {LINKS} from "../../routes"; // const province = require("./../../../../assets/data/province.json"); // const city = require("./../../../../assets/data/city.json"); @@ -156,10 +157,11 @@ class RegisterPage extends React.Component { additional_data: {} }; this.authStore.register(data).then(res => { + message.success("Please check your email to confirm your account"); setTimeout(() => { this.setState({ isLoading: false }); - message.success("Please check your email to confirm your account"); - }, 1000); + this.props.history.push(LINKS.LOGIN); + }, 250); }).catch(err => { this.setState({ isLoading: false }); From 65bd5a6f9189f62f9ddabfd75f06e1d9c7a01b57 Mon Sep 17 00:00:00 2001 From: Hasta Ragil Saputra Date: Tue, 29 Jan 2019 17:28:47 +0700 Subject: [PATCH 17/21] deploy --- package.json | 1 + 1 file changed, 1 insertion(+) diff --git a/package.json b/package.json index bda0a9a..634af2a 100644 --- a/package.json +++ b/package.json @@ -18,6 +18,7 @@ "deploy": "rsync -chavzP -e \"ssh -p 2222\" --stats dist/ root@209.58.165.19:/home/apps/giift/giift-customer-btn", "deploy:giift": "rsync -chavzP -e \"ssh -p 2222\" --stats dist/ root@209.58.165.19:/home/apps/giift/giift-customer", "dev2:parcel": "node scripts/link-assets.js; parcel public/index.parcel.html --out-file index.html --global $", + "build2:parcel:prod": "node scripts/link-assets.js; parcel build public/index.parcel.html --out-file index.html --detailed-report --no-source-maps", "build:deploy": "npm run build:parcel:prod && npm run deploy" }, "author": "Asacreative", From e8945f7608cebd2de950ba09f9b4bcaff8ead08b Mon Sep 17 00:00:00 2001 From: Rifqy Zacky Ariadhy Date: Tue, 29 Jan 2019 17:56:39 +0700 Subject: [PATCH 18/21] update: responsive layout payment stepper --- src/common/pages/Vouchers/Payment/index.js | 39 +++++++++------ src/common/pages/Vouchers/Payment/style.scss | 50 ++++++++++++++++++++ src/common/pages/Vouchers/Stepper/index.js | 1 + 3 files changed, 75 insertions(+), 15 deletions(-) create mode 100644 src/common/pages/Vouchers/Payment/style.scss diff --git a/src/common/pages/Vouchers/Payment/index.js b/src/common/pages/Vouchers/Payment/index.js index ebf93cf..f70e85b 100644 --- a/src/common/pages/Vouchers/Payment/index.js +++ b/src/common/pages/Vouchers/Payment/index.js @@ -8,12 +8,13 @@ import { Affix, Card, Slider, Select, Row, Col, Icon, Tag,Rate, Button, Checkbox import {startCase} from 'lodash'; import LoadingDialog from "../../LoadingDialog"; import Loader from 'react-loader-advanced'; -// import './style.scss'; +import './style.scss'; import {DIALOG} from "../../../stores/global_ui"; import EmptyComponent from '../../EmptyComponent'; import NavigationArrowBack from 'material-ui/svg-icons/navigation/arrow-back'; import {LINKS} from "../../../routes"; import {APP_TYPE} from "../../../config/app"; +import get from "lodash.get"; const Panel = Collapse.Panel; @@ -51,16 +52,23 @@ export default class PaymentVouchers extends React.Component { const qty = 1; const total = price * qty; - let applicationName = 'Giift'; - let applicationLogo = 'http://giift.asacreative.com/giift_logo_wide.4d15de72.png'; - if(APP_TYPE === 'btn') { - applicationName = 'BTN'; - applicationLogo = 'http://btn-redemption-2.bangun-kreatif.com/dr6u0fppdi4xy.cloudfront.net/FilesDirectory/Albilad/ImgIconImage/logo-btn.png'; + // let applicationName = 'Giift'; + // let applicationLogo = 'http://giift.asacreative.com/giift_logo_wide.4d15de72.png'; + // if(APP_TYPE === 'btn') { + // applicationName = 'BTN'; + // applicationLogo = 'http://btn-redemption-2.bangun-kreatif.com/dr6u0fppdi4xy.cloudfront.net/FilesDirectory/Albilad/ImgIconImage/logo-btn.png'; + // } + const logoUrl = (this.props.vouchersStore.dataItems.images.logo) ? get(this.vouchersStore.dataItems, 'images.logo', '') : 'http://lorempixel.com/400/200'; + + let image = logoUrl; + + if (!image.includes('http')) { + image = this.http.appendImagePath(image); } return(
-
+
@@ -94,16 +102,17 @@ export default class PaymentVouchers extends React.Component {
-
- -
-

- Points {applicationName} +
+ +
+

+ {this.props.vouchersStore.dataItems.name} - {this.props.vouchersStore.skuName} +

+

+ BTN Points Payment

-
- -
+
}>
diff --git a/src/common/pages/Vouchers/Payment/style.scss b/src/common/pages/Vouchers/Payment/style.scss new file mode 100644 index 0000000..a94c708 --- /dev/null +++ b/src/common/pages/Vouchers/Payment/style.scss @@ -0,0 +1,50 @@ +.upper-card{ + +} + +.bottom-card{ + +} + +@media(min-width: 1000px){ + .image-logo{ + width: 10vw; + height: 10vh; + } + + .item-container{ + height: 10vh; + display: flex; + flex-direction: column; + justify-content: center; + .item-name{ + padding-top: 1vh; + margin-bottom: -0.25vh; + font-size: 1.35em; + } + + .item-points{ + font-size: 0.95em; + color: #aaa; + } + } +} + +@media(max-width: 999px){ + .image-logo{ + width: 25vw; + height: 10vh; + } + + .item-container{ + .item-name{ + font-size: 1.15em; + margin-bottom: -0.25vh; + } + + .item-points{ + font-size: 0.75em; + color: #aaa; + } + } +} diff --git a/src/common/pages/Vouchers/Stepper/index.js b/src/common/pages/Vouchers/Stepper/index.js index ca7af00..990bf94 100644 --- a/src/common/pages/Vouchers/Stepper/index.js +++ b/src/common/pages/Vouchers/Stepper/index.js @@ -66,6 +66,7 @@ export class VoucherStepper extends React.Component { title: 'Anda yakin mau menukarkan voucher?', content: 'Sistem akan langsung memotong point anda ketika anda menekan tombol konfirmasi dibawah.', onOk: () => { + this.globalUI.showDialogLoading(); this.vouchersStore.buyVoucher(this.vouchersStore.skuId) .then(res => { const openNotificationWithIcon = (type) => { From b5afc1b120c0b9840695b7e59d1bffee5950e1a9 Mon Sep 17 00:00:00 2001 From: Hasta Ragil Saputra Date: Tue, 29 Jan 2019 18:12:44 +0700 Subject: [PATCH 19/21] fix transaction --- src/common/pages/Wallet/index.js | 66 ++++++++++++++++---------------- src/common/stores/transaction.js | 4 +- 2 files changed, 36 insertions(+), 34 deletions(-) diff --git a/src/common/pages/Wallet/index.js b/src/common/pages/Wallet/index.js index 1b9b1a1..d3c3b42 100644 --- a/src/common/pages/Wallet/index.js +++ b/src/common/pages/Wallet/index.js @@ -53,6 +53,7 @@ export default class WalletComponent extends React.Component { } componentDidMount() { + this.props.appstate.transaction.getAll(); this.purchasedItemStore.getAll().then(res => { console.log(res, 'ini purchased items') }) @@ -74,38 +75,39 @@ export default class WalletComponent extends React.Component { const voucher = ; const points = ; - const data = [ - { - id: faker.random.uuid(), - created_at: faker.date.past(), - type: 'Points', - amount: faker.commerce.price() - }, - { - id: faker.random.uuid(), - created_at: faker.date.past(), - type: 'Points', - amount: faker.commerce.price() - }, - { - id: faker.random.uuid(), - created_at: faker.date.past(), - type: 'Voucher', - amount: faker.commerce.price() - }, - { - id: faker.random.uuid(), - created_at: faker.date.past(), - type: 'Voucher', - amount: faker.commerce.price() - }, - { - id: faker.random.uuid(), - created_at: faker.date.past(), - type: 'Points', - amount: faker.commerce.price() - }, - ]; + // const data = [ + // { + // id: faker.random.uuid(), + // created_at: faker.date.past(), + // type: 'Points', + // amount: faker.commerce.price() + // }, + // { + // id: faker.random.uuid(), + // created_at: faker.date.past(), + // type: 'Points', + // amount: faker.commerce.price() + // }, + // { + // id: faker.random.uuid(), + // created_at: faker.date.past(), + // type: 'Voucher', + // amount: faker.commerce.price() + // }, + // { + // id: faker.random.uuid(), + // created_at: faker.date.past(), + // type: 'Voucher', + // amount: faker.commerce.price() + // }, + // { + // id: faker.random.uuid(), + // created_at: faker.date.past(), + // type: 'Points', + // amount: faker.commerce.price() + // }, + // ]; + const data = this.props.appstate.transaction.list; const columns = [{ title: 'Id', diff --git a/src/common/stores/transaction.js b/src/common/stores/transaction.js index c943449..8cea6ab 100644 --- a/src/common/stores/transaction.js +++ b/src/common/stores/transaction.js @@ -98,7 +98,7 @@ export default class Transaction { }; } - // @action + // @action // getAll() { // this.isLoading = true; // return this.http.get("transaction") @@ -111,7 +111,7 @@ export default class Transaction { @action getAll() { this.isLoading = true; - return this.http.get("transaction") + return this.http.get("transactions") .then(res => { this.list = res; this.isLoading = false; From 20f975fa02eb3e309b50e6e2d35d53d8bfea1015 Mon Sep 17 00:00:00 2001 From: Rifqy Zacky Ariadhy Date: Tue, 29 Jan 2019 18:48:41 +0700 Subject: [PATCH 20/21] update: responsive layout stepper --- package-lock.json | 54 ++++++++++++++++++++++ package.json | 1 + src/common/pages/Vouchers/Modal/index.js | 3 +- src/common/pages/Vouchers/Payment/index.js | 14 +++--- 4 files changed, 65 insertions(+), 7 deletions(-) diff --git a/package-lock.json b/package-lock.json index e8b384b..79d81e7 100644 --- a/package-lock.json +++ b/package-lock.json @@ -14836,6 +14836,60 @@ } } }, + "react-html-parser": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/react-html-parser/-/react-html-parser-2.0.2.tgz", + "integrity": "sha512-XeerLwCVjTs3njZcgCOeDUqLgNIt/t+6Jgi5/qPsO/krUWl76kWKXMeVs2LhY2gwM6X378DkhLjur0zUQdpz0g==", + "requires": { + "htmlparser2": "^3.9.0" + }, + "dependencies": { + "domelementtype": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/domelementtype/-/domelementtype-1.3.1.tgz", + "integrity": "sha512-BSKB+TSpMpFI/HOxCNr1O8aMOTZ8hT3pM3GQ0w/mWRmkhEDSFJkkyzz4XQsBV44BChwGkrDfMyjVD0eA2aFV3w==" + }, + "domhandler": { + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/domhandler/-/domhandler-2.4.2.tgz", + "integrity": "sha512-JiK04h0Ht5u/80fdLMCEmV4zkNh2BcoMFBmZ/91WtYZ8qVXSKjiw7fXMgFPnHcSZgOo3XdinHvmnDUeMf5R4wA==", + "requires": { + "domelementtype": "1" + } + }, + "htmlparser2": { + "version": "3.10.0", + "resolved": "https://registry.npmjs.org/htmlparser2/-/htmlparser2-3.10.0.tgz", + "integrity": "sha512-J1nEUGv+MkXS0weHNWVKJJ+UrLfePxRWpN3C9bEi9fLxL2+ggW94DQvgYVXsaT30PGwYRIZKNZXuyMhp3Di4bQ==", + "requires": { + "domelementtype": "^1.3.0", + "domhandler": "^2.3.0", + "domutils": "^1.5.1", + "entities": "^1.1.1", + "inherits": "^2.0.1", + "readable-stream": "^3.0.6" + } + }, + "readable-stream": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.1.1.tgz", + "integrity": "sha512-DkN66hPyqDhnIQ6Jcsvx9bFjhw214O4poMBcIMgPVpQvNy9a0e0Uhg5SqySyDKAmUlwt8LonTBz1ezOnM8pUdA==", + "requires": { + "inherits": "^2.0.3", + "string_decoder": "^1.1.1", + "util-deprecate": "^1.0.1" + } + }, + "string_decoder": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.2.0.tgz", + "integrity": "sha512-6YqyX6ZWEYguAxgZzHGL7SsCeGx3V2TtOTqZz1xSTSWnqsbWwbptafNyvf/ACquZUXV3DANr5BDIwNYe1mN42w==", + "requires": { + "safe-buffer": "~5.1.0" + } + } + } + }, "react-images": { "version": "0.5.19", "resolved": "https://registry.npmjs.org/react-images/-/react-images-0.5.19.tgz", diff --git a/package.json b/package.json index 634af2a..8590e64 100644 --- a/package.json +++ b/package.json @@ -114,6 +114,7 @@ "react-handsontable": "^0.3.1", "react-helmet": "^5.2.0", "react-hot-loader": "^4.6.3", + "react-html-parser": "^2.0.2", "react-images": "^0.5.13", "react-infinite-scroller": "^1.2.4", "react-intl": "^2.8.0", diff --git a/src/common/pages/Vouchers/Modal/index.js b/src/common/pages/Vouchers/Modal/index.js index f8b43a8..36d4d56 100644 --- a/src/common/pages/Vouchers/Modal/index.js +++ b/src/common/pages/Vouchers/Modal/index.js @@ -7,6 +7,7 @@ import { Route } from 'react-router-dom' import {LINKS} from "../../../routes"; import NumberFormat from 'react-number-format'; import get from 'lodash.get'; +import ReactHtmlParser from "react-html-parser"; const Option = Select.Option; @@ -83,7 +84,7 @@ export default class ModalVouchersComponent extends React.Component { flex: 0.7, padding: 30 }}> -

{data.description}

+

{ReactHtmlParser(data.description)}

{(additional_data.information != null) && diff --git a/src/common/pages/Vouchers/Payment/index.js b/src/common/pages/Vouchers/Payment/index.js index f70e85b..0199c49 100644 --- a/src/common/pages/Vouchers/Payment/index.js +++ b/src/common/pages/Vouchers/Payment/index.js @@ -15,6 +15,7 @@ import NavigationArrowBack from 'material-ui/svg-icons/navigation/arrow-back'; import {LINKS} from "../../../routes"; import {APP_TYPE} from "../../../config/app"; import get from "lodash.get"; +import ReactHtmlParser, { processNodes, convertNodeToElement, htmlparser2 } from 'react-html-parser'; const Panel = Collapse.Panel; @@ -35,7 +36,7 @@ export default class PaymentVouchers extends React.Component { } componentDidMount() { - + console.log(this.props.vouchersStore, 'this.props.vouchersStore this.props.vouchersStore this.props.vouchersStore') } render() { @@ -115,13 +116,14 @@ export default class PaymentVouchers extends React.Component {
}>
- +
-
    -
  • Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book.
  • -
  • Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book.
  • -
+
+ {ReactHtmlParser(this.props.vouchersStore.dataItems.description)} + {/*
  • Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book.
  • */} + {/*
  • Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book.
  • */} +

    From 54d88ac0feb77beba09ba534eed73aac7da0a6e7 Mon Sep 17 00:00:00 2001 From: tsabit ghazwan Date: Tue, 29 Jan 2019 18:50:06 +0700 Subject: [PATCH 21/21] fix: email and role on profile panel --- src/common/pages/App/index.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/common/pages/App/index.js b/src/common/pages/App/index.js index 0de5898..a38e3c9 100644 --- a/src/common/pages/App/index.js +++ b/src/common/pages/App/index.js @@ -611,9 +611,9 @@ export default class App extends React.Component { style={{ padding: '0px 16px 0px', fontSize: 14 }} disabled={true} primaryText={{this.authStore.userProfile.username || 'Username'}} + style={{ fontWeight: 500 }}>{this.props.appstate.userData.email|| 'Username'}} secondaryText={

    {_.capitalize(this.authStore.userProfile.role) || 'role'}

    } + style={{ fontWeight: 400 }}>{_.capitalize(this.props.appstate.userData.role) || 'role'}

    } />