Skip to content

Commit

Permalink
Merge branch 'master' into Vinu/79411/derivez-cashier-transfer
Browse files Browse the repository at this point in the history
  • Loading branch information
vinu-deriv committed Nov 15, 2022
2 parents 311ac41 + 5033f3c commit 4970da2
Show file tree
Hide file tree
Showing 13 changed files with 5,290 additions and 3,050 deletions.
25 changes: 25 additions & 0 deletions .commitlintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
{
"extends": ["@commitlint/config-conventional", "@commitlint/config-nx-scopes"],
"rules": {
"type-enum": [
2,
"always",
[
"build",
"bugfix",
"ci",
"chore",
"docs",
"feat",
"fix",
"hotfix",
"perf",
"refactor",
"revert",
"style",
"test",
"redeploy"
]
]
}
}
4 changes: 4 additions & 0 deletions .husky/commit-msg
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

npx --no -- commitlint --edit
8,267 changes: 5,229 additions & 3,038 deletions package-lock.json

Large diffs are not rendered by default.

9 changes: 6 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,11 @@
"@babel/plugin-syntax-dynamic-import": "^7.8.3",
"@babel/preset-env": "^7.12.11",
"@babel/preset-react": "^7.16.7",
"@commitlint/cli": "^17.1.2",
"@commitlint/config-conventional": "^17.1.0",
"@commitlint/config-nx-scopes": "^17.0.0",
"@jest/globals": "^26.5.3",
"@nrwl/nx-cloud": "latest",
"@testing-library/react": "^12.0.0",
"@types/jest": "^27.4.1",
"@types/node": "^17.0.27",
Expand All @@ -28,7 +32,6 @@
"@types/react-virtualized": "^9.21.21",
"@typescript-eslint/eslint-plugin": "^5.8.0",
"@typescript-eslint/parser": "^5.8.0",
"ts-jest": "^26.4.2",
"babel-polyfill": "^6.26.0",
"chai": "^4.2.0",
"eslint": "^7.18.0",
Expand All @@ -49,6 +52,7 @@
"lerna": "^5.5.1",
"lint-staged": "^10.4.0",
"mocha": "^7.1.1",
"nx": "^14.5.10",
"postcss": "^8.3.6",
"prettier": "^2.1.2",
"react-test-renderer": "^16.13.1",
Expand All @@ -58,8 +62,7 @@
"stylelint-no-unsupported-browser-features": "^4.0.0",
"stylelint-selector-bem-pattern": "^2.1.0",
"stylelint-webpack-plugin": "^2.1.1",
"nx": "^14.5.10",
"@nrwl/nx-cloud": "latest"
"ts-jest": "^26.4.2"
},
"scripts": {
"build:all": "nx build @deriv/components --skip-nx-cache && nx run-many --target=build",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,11 @@ const normalized_payment_methods = {
Mandirisyariah: ['mandirisyariah'],
Moneygram: ['moneygram'],
Paypal: ['paypal'],
PerfectMoney: ['perfectmoney'],
PerfectMoney: ['perfectmoneyandwebmoney', 'perfectmoney'],
Permatabank: ['permatabank'],
Tether: ['tether'],
Verve: ['verve'],
WebMoney: ['perfectmoneyandwebmoney', 'webmoney'],
Wechatpay: ['wechatpay'],
Zenithbank: ['zenithbank'],
};
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions packages/components/src/components/icon/icons.js
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,8 @@ import './cashier/ic-cashier-viettle-pay.svg';
import './cashier/ic-cashier-visa-dark.svg';
import './cashier/ic-cashier-visa-light.svg';
import './cashier/ic-cashier-wallet.svg';
import './cashier/ic-cashier-web-money-dark.svg';
import './cashier/ic-cashier-web-money-light.svg';
import './cashier/ic-cashier-wechatpay-dark.svg';
import './cashier/ic-cashier-wechatpay-light.svg';
import './cashier/ic-cashier-withdraw-wallet.svg';
Expand Down Expand Up @@ -296,6 +298,7 @@ import './common/ic-driving-licence-front.svg';
import './common/ic-driving-license-dashboard.svg';
import './common/ic-driving-license.svg';
import './common/ic-edit.svg';
import './common/ic-email-changed.svg';
import './common/ic-email-firewall.svg';
import './common/ic-email-outline-new.svg';
import './common/ic-email-outline.svg';
Expand Down
4 changes: 3 additions & 1 deletion packages/components/stories/icon/icons.js
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,6 @@ export const icons =
'IcCashierPaymentAgent',
'IcCashierPaypalDark',
'IcCashierPaypalLight',
'IcCashierPaymentAgent',
'IcCashierPerfectMoneyDark',
'IcCashierPerfectMoneyLight',
'IcCashierPermatabankDark',
Expand Down Expand Up @@ -182,6 +181,8 @@ export const icons =
'IcCashierVisaDark',
'IcCashierVisaLight',
'IcCashierWallet',
'IcCashierWebMoneyDark',
'IcCashierWebMoneyLight',
'IcCashierWechatpayDark',
'IcCashierWechatpayLight',
'IcCashierWithdrawWallet',
Expand Down Expand Up @@ -304,6 +305,7 @@ export const icons =
'IcDrivingLicenseDashboard',
'IcDrivingLicense',
'IcEdit',
'IcEmailChanged',
'IcEmailFirewall',
'IcEmailOutlineNew',
'IcEmailOutline',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ const OrderDetails = observer(() => {
disposeReactions();
order_store.setOrderPaymentMethodDetails(undefined);
order_store.setOrderId(null);
order_store.setActiveOrder(null);
general_store.props.setP2POrderProps({
order_id: order_store.order_id,
redirectToOrderDetails: general_store.redirectToOrderDetails,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ const OrderRow = ({ style, row: order }) => {

const onRowClick = () => {
if (should_show_order_details.current) {
return order_store.setQueryDetails(order);
return order_store.setOrderId(order.id);
}

return () => {};
Expand Down
3 changes: 2 additions & 1 deletion packages/p2p/src/stores/my-ads-store.js
Original file line number Diff line number Diff line change
Expand Up @@ -414,6 +414,7 @@ export default class MyAdsStore extends BaseStore {
}

onClickUpdatePaymentMethods(id, is_buy_advert) {
this.setIsTableLoading(true);
requestWS({
p2p_advert_update: 1,
id,
Expand All @@ -425,14 +426,14 @@ export default class MyAdsStore extends BaseStore {
: {}),
}).then(response => {
if (!response.error) {
this.setAdverts([]);
this.loadMoreAds({ startIndex: 0 });
this.hideQuickAddModal();
} else {
this.setUpdatePaymentMethodsErrorMessage(response.error.message);
this.setIsQuickAddModalOpen(false);
this.setIsQuickAddErrorModalOpen(true);
}
this.setIsTableLoading(false);
});
}

Expand Down
17 changes: 12 additions & 5 deletions packages/p2p/src/stores/order-store.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import { api_error_codes } from '../constants/api-error-codes';
export default class OrderStore {
constructor(root_store) {
makeObservable(this, {
active_order: observable,
api_error_message: observable,
cancellation_block_duration: observable,
cancellation_count_period: observable,
Expand Down Expand Up @@ -47,6 +48,7 @@ export default class OrderStore {
onOrdersUpdate: action.bound,
onPageReturn: action.bound,
onUnmount: action.bound,
setActiveOrder: action.bound,
setForceRerenderOrders: action.bound,
setApiErrorMessage: action.bound,
setCancellationBlockDuration: action.bound,
Expand Down Expand Up @@ -91,6 +93,7 @@ export default class OrderStore {
);
}

active_order = null;
api_error_message = '';
cancellation_block_duration = 0;
cancellation_count_period = 0;
Expand Down Expand Up @@ -124,11 +127,7 @@ export default class OrderStore {
}

get order_information() {
const { general_store } = this.root_store;
const order = this.orders.find(o => o.id === this.order_id);
return order
? createExtendedOrderDetails(order, general_store.client.loginid, general_store.props.server_time)
: null;
return this.active_order;
}

get nav() {
Expand Down Expand Up @@ -255,6 +254,7 @@ export default class OrderStore {
this.root_store.general_store.redirectTo(this.nav.location);
}
this.setOrderId(null);
this.setActiveOrder(null);
}

loadMoreOrders({ startIndex }) {
Expand Down Expand Up @@ -370,6 +370,10 @@ export default class OrderStore {
});
}

setActiveOrder(active_order) {
this.active_order = active_order;
}

setQueryDetails(input_order) {
const { general_store } = this.root_store;
const order_information = createExtendedOrderDetails(
Expand All @@ -386,6 +390,9 @@ export default class OrderStore {
if (order_information?.payment_method_details) {
this.setOrderPaymentMethodDetails(Object.values(order_information?.payment_method_details));
}

this.setActiveOrder(order_information);

// When viewing specific order, update its read state in localStorage.
const { notifications } = this.root_store.general_store.getLocalStorageSettingsForLoginId();

Expand Down

0 comments on commit 4970da2

Please sign in to comment.