Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FEQ-2166]/Tablet view - Reports, Dtrader, Tradershub #15011

Merged
merged 41 commits into from
Jun 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
41 commits
Select commit Hold shift + click to select a range
68fb3e8
[DTRA] Farhan/DTRA-945/Dtrader's Tablet View (#14346)
farhan-nurzi-deriv Apr 23, 2024
94adcf8
[TRAH] Sergei / TRAH - 2761 / Trader's hub tablet view (#13396)
sergei-deriv May 7, 2024
4a368c4
[TRAH] Sergei / TRAH-2762, TRAH-2763 / Tablet view for Jurisdiction M…
sergei-deriv May 7, 2024
4359cab
Farhan/DTRA-1195/Reports's tablet view (#14772)
farhan-nurzi-deriv May 7, 2024
00a45ad
Farhan/Lock Dtrader Tablet View on Landscape Mode (#14781)
farhan-nurzi-deriv May 9, 2024
5aaa26c
Merge branch 'master' of github.com:binary-com/deriv-app into tablet_…
balakrishna-deriv May 9, 2024
92bae63
DTRA / Kate / FEQ-2212 / Hide footer navigation links popovers (#15176)
kate-deriv May 17, 2024
cfe323b
DTRA / Kate / FEQ-2213 + FEQ-2205 / Made popover optional (#15197)
kate-deriv May 17, 2024
58cea59
[DTRA] Farhan/Dtrader Tablet Subtasks (#15123)
farhan-nurzi-deriv May 17, 2024
a4e713c
Merge branch 'master' of github.com:binary-com/deriv-app into tablet_…
balakrishna-deriv May 17, 2024
fc7a7d6
Merge branch 'master' of github.com:binary-com/deriv-app into tablet_…
balakrishna-deriv May 17, 2024
aeb3ccc
chore: update @deriv/deriv-charts to 2.1.16 (#15212)
DerivFE May 17, 2024
08be61c
[DTRA] Farhan/Fix test failing (#15216)
farhan-nurzi-deriv May 17, 2024
c243628
feat: get changes back and just delete mixin for tablet (#15182)
sergei-deriv May 20, 2024
a221e02
[FEQ] Sergei / FEQ-2200, FEQ-2201 / Add a real MT5 account, Identity …
sergei-deriv May 20, 2024
1ca3140
[DTRA] Farhan/FEQ-2208/Hide indicators and drawing tools toolbar widg…
farhan-nurzi-deriv May 21, 2024
e63dbe5
[DTRA] Farhan/FEQ-2205/Header notification icon and account settings …
farhan-nurzi-deriv May 23, 2024
9a7aada
feat: change mixins and add isTablet for datepicker (#15349)
sergei-deriv May 27, 2024
e8c91c6
feat: change 2 desktop mixins (#15362)
sergei-deriv May 27, 2024
a4eeaec
[DTRA] Farhan/Tablet view subtasks (#15376)
farhan-nurzi-deriv May 29, 2024
de343e2
Merge branch 'master' of github.com:binary-com/deriv-app into tablet_…
balakrishna-deriv May 31, 2024
5782c18
[DTRA] Farhan/FEQ-2280/tablet subtasks (#15404)
farhan-nurzi-deriv May 31, 2024
ccc60a4
FEQ-2313 / Kate / Android tablet- Long code message content is showin…
kate-deriv Jun 4, 2024
dd68f40
Fix tablet view issues (#15469)
balakrishna-deriv Jun 4, 2024
b6b26e6
fix: contract type dialog height (#15476)
akmal-deriv Jun 4, 2024
2448411
Ahmad/Fix Strike Icon color on firefox (#15481)
ahmadtaimoor-deriv Jun 5, 2024
645cd4d
fix: tablet issues (#15497)
balakrishna-deriv Jun 5, 2024
6ae3c85
Merge branch 'master' of github.com:binary-com/deriv-app into tablet_…
balakrishna-deriv Jun 7, 2024
298c374
chore: remove unused hook
balakrishna-deriv Jun 7, 2024
a82d5cc
Merge branch 'master' of github.com:binary-com/deriv-app into tablet_…
balakrishna-deriv Jun 7, 2024
6719b0a
[FEX] Sergei / FEQ - 2310, 2311, 2319, 2320, 2344 / Tablet view issue…
sergei-deriv Jun 10, 2024
6307d05
Ahmad/Strike Icon Svg fix on Firefox (#15578)
ahmadtaimoor-deriv Jun 10, 2024
6d12e89
Ahmad/ Fiix Strike Icon in firefox and update Deriv UI Package (#15609)
ahmadtaimoor-deriv Jun 11, 2024
ef2dddb
fix: creation banner and adding mt5 account (#15659)
sergei-deriv Jun 14, 2024
445f55c
Revert "fix: creation banner and adding mt5 account (#15659)" (#15661)
habib-deriv Jun 14, 2024
aa6fd7b
[FEQ] Sergei / FEQ - 2374, 2375, 2376 / Tablet view issues 4 (2) (#15…
sergei-deriv Jun 14, 2024
a09d8b7
[FEQ] Sergei / FEQ - 2376 / "Get real account" button for DIEL (#15690)
sergei-deriv Jun 20, 2024
218628f
Merge branch 'master' of github.com:binary-com/deriv-app into tablet_…
balakrishna-deriv Jun 25, 2024
a0f0229
chore: fix test cases
balakrishna-deriv Jun 25, 2024
4481f6c
chore: add observer
balakrishna-deriv Jun 26, 2024
e540069
Merge branch 'master' of github.com:binary-com/deriv-app into tablet_…
balakrishna-deriv Jun 26, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .stylelintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ module.exports = {
'shorthand-property-no-redundant-values': true,
'string-no-newline': true,
'time-min-milliseconds': 100,
'unit-allowed-list': ['fr', 'px', 'em', 'rem', '%', 'svh', 'vw', 'vh', 'deg', 'ms', 's', 'dpcm'],
'unit-allowed-list': ['fr', 'px', 'em', 'rem', '%', 'svh', 'svw', 'vw', 'vh', 'deg', 'ms', 's', 'dpcm'],
'value-keyword-case': 'lower',
},
extends: [
Expand Down
20 changes: 20 additions & 0 deletions __mocks__/globals.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,26 @@ jest.mock('@deriv-com/analytics', () => ({
},
}));

// default breakpoint to desktop
jest.mock('@deriv-com/ui', () => ({
...jest.requireActual('@deriv-com/ui'),
useDevice: () => ({ isDesktop: true }),
}));

Object.defineProperty(window, 'matchMedia', {
writable: true,
value: jest.fn().mockImplementation(query => ({
matches: false,
media: query,
onchange: null,
addListener: jest.fn(), // Deprecated
removeListener: jest.fn(), // Deprecated
addEventListener: jest.fn(),
removeEventListener: jest.fn(),
dispatchEvent: jest.fn(),
})),
});

const mock_onfido = {
init: jest.fn().mockResolvedValue({}),
};
Expand Down
2 changes: 1 addition & 1 deletion jest.config.base.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ module.exports = {
testRegex: '(/__tests__/.*|(\\.)(test|spec))\\.(js|jsx|tsx|ts)?$',
// This is needed to transform es modules imported from node_modules of the target component.
transformIgnorePatterns: [
'/node_modules/(?!(@enykeev/react-virtualized|@simplewebauthn/browser|@deriv-com/translations)).+\\.js$',
'/node_modules/(?!(@enykeev/react-virtualized|@simplewebauthn/browser|@deriv/quill-design|@deriv/quill-icons|@deriv-com/ui|@deriv-com/translations)).+\\.js$',
],
setupFiles: ['<rootDir>/../../jest.setup.js'],
setupFilesAfterEnv: ['<rootDir>/../../setupTests.js'],
Expand Down
4 changes: 3 additions & 1 deletion jest.config.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
const baseConfig = require('./jest.config.base');

module.exports = {
collectCoverage: false,
collectCoverageFrom: [
Expand All @@ -17,6 +19,6 @@ module.exports = {
'^.+\\.(ts|tsx)?$': 'ts-jest',
},
testRegex: '(/__tests__/.*|(\\.)(test|spec))\\.(js|jsx|tsx|ts)?$',
transformIgnorePatterns: ['/node_modules/(?!(@enykeev/react-virtualized|@simplewebauthn/browser)).+\\.js$'],
transformIgnorePatterns: baseConfig.transformIgnorePatterns,
testPathIgnorePatterns: ['/integration-tests/'],
};
8 changes: 4 additions & 4 deletions 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 packages/account/build/constants.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ const {
} = require('./loaders-config');

const ALIASES = {
'react/jsx-runtime': 'react/jsx-runtime.js',
Assets: path.resolve(__dirname, '../src/Assets'),
Components: path.resolve(__dirname, '../src/Components'),
Configs: path.resolve(__dirname, '../src/Configs'),
Expand Down
1 change: 1 addition & 0 deletions packages/account/jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ module.exports = {
...baseConfigForPackages,
preset: 'ts-jest',
moduleNameMapper: {
'\\.css$': '<rootDir>/../../__mocks__/styleMock.js',
'\\.s(c|a)ss$': '<rootDir>/../../__mocks__/styleMock.js',
'^.+\\.svg$': '<rootDir>/../../__mocks__/styleMock.js',
'@deriv-com/translations': '<rootDir>/../../__mocks__/translation.mock.js',
Expand Down
1 change: 1 addition & 0 deletions packages/account/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
"@deriv-com/analytics": "1.5.9",
"@deriv-com/translations": "^1.3.2",
"@deriv-com/utils": "^0.0.25",
"@deriv-com/ui": "^1.28.1",
"@deriv/api": "^1.0.0",
"@deriv/components": "^1.0.0",
"@deriv/hooks": "^1.0.0",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,17 @@
row-gap: 1.6rem;
margin-bottom: 2.4rem;

@include desktop {
@include tablet-screen {
grid-template-columns: repeat(2, 1fr);
row-gap: 3.2rem;
}

@include desktop-screen {
grid-template-columns: repeat(3, 1fr);
column-gap: calc((100% - 23.7rem * 3) / 2);
row-gap: 3.2rem;
}

&-layout {
background-color: var(--transparent-danger);
gap: 1.6rem;
Expand All @@ -25,7 +31,7 @@
width: 23.7rem;
height: 21.8rem;

@include mobile {
@include mobile-or-tablet-screen {
margin-inline: auto;
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,13 @@

.dc-datepicker {
margin-left: 2.4rem;

@include mobile-or-tablet-screen {
margin-left: unset;
}
}

@include mobile {
@include mobile-or-tablet-screen {
.dc-input {
margin-bottom: 2rem;
}
Expand Down Expand Up @@ -188,7 +192,7 @@
.dc-btn:not(:last-of-type) {
margin-right: 0.8rem;
}
@include mobile {
@include mobile-or-tablet-screen {
height: auto;
padding-bottom: unset;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import React from 'react';
import { Formik, FormikErrors, FormikHelpers, FormikValues } from 'formik';
import { useDevice } from '@deriv-com/ui';
import { Loading, Button, Text, ThemedScrollbars, FormSubmitButton, Modal, HintBox } from '@deriv/components';
import { useFileUploader } from '@deriv/hooks';
import { validAddress, validPostCode, validLetterSymbol, validLength, getLocation, WS } from '@deriv/shared';
Expand Down Expand Up @@ -37,15 +38,15 @@ type TFormState = Record<'is_btn_loading' | 'is_submit_success' | 'should_allow_

const ProofOfAddressForm = observer(
({ is_resubmit, is_for_cfd_modal, onSubmit, onSubmitForCFDModal, className }: Partial<TProofOfAddressForm>) => {
const { client, notifications, ui } = useStore();
const { isDesktop } = useDevice();
const { client, notifications } = useStore();
const { account_settings, fetchResidenceList, fetchStatesList, getChangeableFields, states_list, is_eu } =
client;
const {
addNotificationMessageByKey: addNotificationByKey,
removeNotificationMessage,
removeNotificationByKey,
} = notifications;
const { is_mobile } = ui;
const [document_files, setDocumentFiles] = React.useState<File[]>([]);
const [file_selection_error, setFileSelectionError] = React.useState<string | null>(null);
const [is_loading, setIsLoading] = React.useState(true);
Expand Down Expand Up @@ -272,7 +273,7 @@ const ProofOfAddressForm = observer(
}
const setOffset = (status: { msg: string }) => {
const mobile_scroll_offset = status?.msg ? '200px' : '154px';
return is_mobile && !is_for_cfd_modal ? mobile_scroll_offset : '80px';
return !isDesktop && !is_for_cfd_modal ? mobile_scroll_offset : '80px';
};

return (
Expand All @@ -284,12 +285,12 @@ const ProofOfAddressForm = observer(
>
{({ status, handleSubmit, isSubmitting, isValid }) => (
<>
<LeaveConfirm onDirty={is_mobile ? showForm : undefined} />
<LeaveConfirm onDirty={!isDesktop ? showForm : undefined} />
{form_state.should_show_form && (
<form noValidate className='account-form account-form_poa' onSubmit={handleSubmit}>
<ThemedScrollbars
height='572px'
is_bypassed={!is_for_cfd_modal || is_mobile}
is_bypassed={!is_for_cfd_modal || !isDesktop}
className={className}
>
<FormBody scroll_offset={setOffset(status)}>
Expand All @@ -298,7 +299,7 @@ const ProofOfAddressForm = observer(
className='account-form_poa-submit-error'
icon='IcAlertDanger'
message={
<Text as='p' size={is_mobile ? 'xxxs' : 'xs'}>
<Text as='p' size={!isDesktop ? 'xxxs' : 'xs'}>
{!status?.msg && is_resubmit && (
<Localize i18n_default_text='We were unable to verify your address with the details you provided. Please check and resubmit or choose a different document type.' />
)}
Expand Down Expand Up @@ -343,7 +344,7 @@ const ProofOfAddressForm = observer(
!!file_selection_error
}
label={localize('Continue')}
is_absolute={is_mobile}
is_absolute={!isDesktop}
is_loading={isSubmitting}
/>
</Modal.Footer>
Expand Down
Loading
Loading