Skip to content

Commit

Permalink
Merge branch 'master' of github.com:binary-com/deriv-app into bug-743…
Browse files Browse the repository at this point in the history
…62-feedback-button-does-nothing
  • Loading branch information
ameerul-deriv committed Sep 15, 2022
2 parents d57ed78 + a9995ce commit aaeac4a
Show file tree
Hide file tree
Showing 47 changed files with 659 additions and 523 deletions.
1 change: 0 additions & 1 deletion .github/workflows/generate_and_push_deriv_api_types.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,3 @@ After a new version has been published the action will automatically create a PR
Required GitHub secrets:

- `NPM_ACCESS_TOKEN`: To allow for automatic publishing of new version of `@deriv/api-types`
- `PERSONAL_ACCESS_TOKEN`: (GitHub PAT) To allow the action to authenticate with Git for git operations.
2 changes: 1 addition & 1 deletion .github/workflows/generate_and_push_deriv_api_types.yml
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ jobs:
# Use "gh" to create a PR from the CLI.
sudo apt install gh
gh auth login --with-token <<< ${{ secrets.PERSONAL_ACCESS_TOKEN }}
gh auth login --with-token <<< ${{ github.token }}
gh pr close "$package_name" || true
gh pr create --title "Bump $package_name from $safe_old_version to $new_version" --body "\`\`\`diff $pr_body \`\`\`" --base "master" --head "binary-com:$package_name"
fi
1 change: 0 additions & 1 deletion .github/workflows/push_and_pull_crowdin_translations.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,4 @@ This action will automatically extract strings from the Deriv.app repo and uploa
Required GitHub secrets:

- `NPM_ACCESS_TOKEN`: To allow for automatic publishing of new version of `@deriv/api-types`
- `PERSONAL_ACCESS_TOKEN`: (GitHub PAT) To allow the action to authenticate with Git for git operations.
- `CROWDIN_API_TOKEN`: To allow us to download and upload new language files to and from Crowdin.
1 change: 1 addition & 0 deletions jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ module.exports = {
transform: {
'^.+\\.jsx?$': 'babel-jest',
'^.+/es/^.+$': 'babel-jest',
'^.+\\.(ts|tsx)?$': 'ts-jest',
},
testRegex: ['__tests__', '.*.spec.js'],
transformIgnorePatterns: ['/node_modules/(?!react-virtualized).+\\.js$'],
Expand Down
126 changes: 125 additions & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
"@types/react-router-dom": "^5.1.6",
"@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 Down
Original file line number Diff line number Diff line change
Expand Up @@ -140,4 +140,11 @@ const idv_document_data = {
sample_image: '',
},
},
zw: {
national_id: {
new_display_name: 'National ID',
example_format: '081234567F53',
sample_image: getImageLocation('zw_national_identity_card.png'),
},
},
};
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@ Blockly.Blocks.trade_definition_contracttype = {
colour: Blockly.Colours.Special1.colour,
colourSecondary: Blockly.Colours.Special1.colourSecondary,
colourTertiary: Blockly.Colours.Special1.colourTertiary,
tooltip: localize(
'If the contract type is “Both”, then the Purchase Conditions should include both Rise and Fall using the “Conditional Block"'
),
previousStatement: null,
nextStatement: null,
});
Expand Down
3 changes: 2 additions & 1 deletion packages/bot-skeleton/src/scratch/hooks/css.js
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ Blockly.Css.CONTENT = [
'margin: 4px;',
'border-radius: 4px;',
'background: $colour_numPadBackground;',
'color: $colour_numPadText;',
'color: var(--text-general);',
'outline: none;',
'border: 1px solid $colour_numPadBorder;',
'cursor: pointer;',
Expand All @@ -235,6 +235,7 @@ Blockly.Css.CONTENT = [
'margin-top: 10%;',
'width: 80%;',
'height: 80%;',
'filter: invert(1);',
'}',

'.blocklyNumPadButton:active {',
Expand Down
2 changes: 0 additions & 2 deletions packages/cashier/globals.d.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,2 @@
declare module '@deriv/components';
declare module '@deriv/p2p';
declare module '@deriv/translations';
declare module '@deriv/shared';
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ const CashierLocked = ({

let icon = 'IcCashierLocked';
let title = localize('Cashier is locked');
let message = localize(
let message: string | JSX.Element = localize(
'Your cashier is currently locked. Please contact us via live chat to find out how to unlock it.'
);

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import classNames from 'classnames';
import React from 'react';
import { Field, FieldProps, Formik, Form } from 'formik';
import { Button, Dropdown, Icon, Input, Loading, Money, MobileWrapper, Text } from '@deriv/components';
import { Button, Dropdown, Icon, Input, Loading, Money, Text } from '@deriv/components';
import {
getDecimalPlaces,
getCurrencyDisplayCode,
Expand Down Expand Up @@ -170,7 +170,7 @@ const AccountTransferForm = ({
}: TAccountTransferFormProps) => {
const [from_accounts, setFromAccounts] = React.useState({});
const [to_accounts, setToAccounts] = React.useState({});
const [transfer_to_hint, setTransferToHint] = React.useState();
const [transfer_to_hint, setTransferToHint] = React.useState<string>();

const { daily_transfers } = account_limits;
const mt5_remaining_transfers = daily_transfers?.mt5;
Expand Down Expand Up @@ -202,6 +202,10 @@ const AccountTransferForm = ({
return undefined;
};

const shouldShowTransferButton = (amount: string) => {
return selected_from.currency === selected_to.currency ? !amount : !converter_from_amount;
};

const getAccounts = (type: string, { is_mt, is_dxtrade }: TAccount) => {
if (type === 'from') {
if (is_mt) return mt_accounts_from;
Expand Down Expand Up @@ -376,7 +380,7 @@ const AccountTransferForm = ({
validateOnBlur={false}
enableReinitialize
>
{({ errors, handleChange, isSubmitting, touched, setFieldValue, setFieldTouched, setFieldError }) => (
{({ errors, handleChange, isSubmitting, setFieldValue, setFieldError, values }) => (
<React.Fragment>
{isSubmitting || accounts_list.length === 0 ? (
<div className='cashier__loader-wrapper' data-testid='dt_cashier_loader_wrapper'>
Expand Down Expand Up @@ -406,8 +410,7 @@ const AccountTransferForm = ({
onChangeTransferFrom(e);
handleChange(e);
setFieldValue('amount', '');
setFieldError('amount', '');
setFieldTouched('amount', false);
setTimeout(() => setFieldError('amount', ''));
}}
error={selected_from.error}
/>
Expand All @@ -429,8 +432,7 @@ const AccountTransferForm = ({
onChange={(e: TReactChangeEvent) => {
onChangeTransferTo(e);
setFieldValue('amount', '');
setFieldError('amount', '');
setFieldTouched('amount', false);
setTimeout(() => setFieldError('amount', ''));
}}
hint={transfer_to_hint}
error={selected_to.error}
Expand All @@ -445,15 +447,14 @@ const AccountTransferForm = ({
setErrorMessage('');
handleChange(e);
setAccountTransferAmount(e.target.value);
setFieldTouched('amount', true, false);
}}
className='cashier__input dc-input--no-placeholder account-transfer-form__input'
classNameHint='account-transfer-form__hint'
data-testid='dt_account_transfer_form_input'
name='amount'
type='text'
label={localize('Amount')}
error={touched.amount && errors.amount ? errors.amount : ''}
error={errors.amount ? errors.amount : ''}
required
trailing_icon={
selected_from.currency ? (
Expand Down Expand Up @@ -556,7 +557,9 @@ const AccountTransferForm = ({
!!selected_to.error ||
!+selected_from.balance ||
!!converter_from_error ||
!!converter_to_error
!!converter_to_error ||
!!errors.amount ||
shouldShowTransferButton(values.amount)
}
primary
large
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,24 +38,21 @@
padding-left: 0;
}
}
.cashier__form-submit {
row-gap: 1rem;
}
}

& .cashier__form-submit {
text-align: center;
display: flex;
justify-content: center;
flex-flow: row;
align-items: center;
column-gap: 0.8rem;
margin: 2.4rem 0 3.2rem;

&-button {
margin: 0;
max-width: 18rem;

&:first-child {
margin-right: 0.4rem;
}
&:last-child {
margin-left: 0.4rem;
}
}
}
&__transferred-contact {
Expand Down
Loading

0 comments on commit aaeac4a

Please sign in to comment.