From d0d7141ca8bbfd55308c8d4a0edb8fdcbf464d8b Mon Sep 17 00:00:00 2001 From: Thisyahlen Date: Thu, 27 Oct 2022 14:38:32 +0800 Subject: [PATCH 1/7] fix view disabled button --- src/javascript/app/pages/user/view_popup/view_popup.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/javascript/app/pages/user/view_popup/view_popup.js b/src/javascript/app/pages/user/view_popup/view_popup.js index 2832c505e251f..0a6c96686f97b 100644 --- a/src/javascript/app/pages/user/view_popup/view_popup.js +++ b/src/javascript/app/pages/user/view_popup/view_popup.js @@ -56,6 +56,11 @@ const ViewPopup = (() => { } getContract(); + + if (btn_view) { + ViewPopupUI.enableButton($(btn_view)); + ViewPopupUI.cleanup(true); + } }; const responseContract = (response) => { From 596fe3a53efbe4ae32671fda30e686cca8d36655 Mon Sep 17 00:00:00 2001 From: aizad-deriv <103104395+aizad-deriv@users.noreply.github.com> Date: Mon, 30 Jan 2023 13:53:24 +0800 Subject: [PATCH 2/7] fix: move Derived to the correct position based on requirements (#7287) * fix: move Derived to the correct position based on requirements * resolved: remove transition none from css * fix: Derived label now sticky for Synthetics * resolved: added mixins for duplicated styles * fix: change font size and font weight based on design * fix: font-weight for symbols * fix: change font-weight for symbols --------- Co-authored-by: Matin shafiei --- src/javascript/app/pages/trade/markets.jsx | 14 ++- src/sass/app/components/market.scss | 132 ++++++++++++++++----- 2 files changed, 113 insertions(+), 33 deletions(-) diff --git a/src/javascript/app/pages/trade/markets.jsx b/src/javascript/app/pages/trade/markets.jsx index 39af419a53b12..fd8c7d481872d 100644 --- a/src/javascript/app/pages/trade/markets.jsx +++ b/src/javascript/app/pages/trade/markets.jsx @@ -78,13 +78,13 @@ const List = ({ ) : (
{(obj.key === derived_category && isMobile()) &&
{obj.subgroup_name}
} -
+
{obj.name}
{Object.entries(obj.submarket).sort((a, b) => sortSubmarket(a[0], b[0])) @@ -329,6 +329,7 @@ class Markets extends React.Component { const class_under = 'put_under'; const TITLE_HEIGHT = 40; const DEFAULT_TOP = this.references.list.offsetTop; + const SUBGROUP_LABEL = document.getElementsByClassName('label'); const current_viewed_node = Object.values(market_nodes).find(node => ( node.dataset.offsetTop <= position @@ -355,11 +356,12 @@ class Markets extends React.Component { current_viewed_node.children[0].removeAttribute('style'); current_viewed_node.children[0].classList.remove(class_under); } - if (Object.values(current_viewed_node.children[0].classList).includes('label')) { - current_viewed_node.children[1].classList.add(class_sticky); - } else { - current_viewed_node.children[0].classList.add(class_sticky); + if (isMobile() && (current_viewed_node.classList.contains('subgroup') && !current_viewed_node.classList.contains('label'))) { + SUBGROUP_LABEL[0].classList.add(class_sticky); + SUBGROUP_LABEL[0].removeAttribute('style'); + SUBGROUP_LABEL[0].classList.remove(class_under); } + current_viewed_node.children[0].classList.add(class_sticky); current_viewed_node.style.paddingTop = `${TITLE_HEIGHT}px`; } diff --git a/src/sass/app/components/market.scss b/src/sass/app/components/market.scss index 9e690c8e1a1fe..9e79844dfdda3 100644 --- a/src/sass/app/components/market.scss +++ b/src/sass/app/components/market.scss @@ -1,3 +1,22 @@ +@mixin market_name($FONT-SIZE, $FONT-WEIGHT, $COLOR) { + font-size: $FONT-SIZE; + padding: 10px 0; + font-weight: $FONT-WEIGHT; + flex: 1 0 auto; + color: $COLOR; + transition: none; +} +@mixin sticky($FONT-WEIGHT) { + position: absolute; + width: 431px; + top: 60px; + background: $COLOR_WHITE; + @media (max-width: 767px) { + top: 123px; + width: calc(100% - $FONT-WEIGHT); + } +} + .markets { min-width: 120px; position: relative; @@ -284,31 +303,14 @@ &:last-of-type { padding-bottom: 80px; } - .label { - font-size: 20px; - padding: 16px 0px; - font-weight: 700; - } .market_name { - font-size: 18px; - padding: 10px 0; - font-weight: 400; - flex: 1 0 auto; - color: $COLOR_BLUE; - transition: none; + @include market_name(18px, 500, $COLOR_BLUE); @media (min-width: 320px) and (max-width: 767px) { - font-size: 20px; + font-size: 16px; } &.sticky { - position: absolute; - width: 431px; - top: 60px; - background: $COLOR_WHITE; - @media (max-width: 767px) { - top: 123px; - width: calc(100% - 20px); - } + @include sticky(16px); } &.put_under { z-index: -1; @@ -321,13 +323,89 @@ margin-bottom: 10px; .submarket_name { - font-size: 12px; - padding: 10px 0 0; + @include market_name(12px, 400, $COLOR_ORANGE); + } + .symbols { + display: flex; + flex-wrap: wrap; + flex-direction: row; flex: 1 0 auto; - font-weight: 300; - color: $COLOR_ORANGE; - @media (min-width: 320px) and (max-width: 767px) { + + .symbol_name { + padding: 5px; + margin: 10px 0 5px 5px; + line-height: 18px; + cursor: pointer; + width: 162px; font-size: 14px; + font-weight: 500; + transition: all 0.2s; + @media (min-width: 320px) and (max-width: 767px) { + width: 200px; + font-size: 14px; + } + + &:hover { + background: $COLOR_GRAY; + } + &.active { + background: $COLOR_BLUE; + color: $COLOR_WHITE; + @media (min-width: 320px) and (max-width: 767px) { + background: $COLOR_BLUE; + color: $COLOR_WHITE; + font-weight: normal; + padding-left: 5px; + } + } + } + } + } + } + .subgroup { + display: flex; + flex-direction: column; + flex: 0 0 auto; + padding-bottom: 40px; + + &:last-of-type { + padding-bottom: 80px; + } + .label { + @include market_name(18px,700, $COLOR_BLUE); + + &.sticky { + @include sticky(18px); + } + &.put_under { + z-index: -1; + } + } + .subgroup_name { + @include market_name(18px,500, $COLOR_BLUE); + @media (min-width: 320px) and (max-width: 767px) { + font-size: 16px; + } + + @media (min-width: 767px) { + &.sticky { + @include sticky(16px); + } + &.put_under { + z-index: -1; + } + } + } + .submarket { + display: flex; + flex-direction: column; + flex: 1 0 auto; + margin-bottom: 10px; + + .submarket_name { + @include market_name(12px, 400, $COLOR_ORANGE); + @media (min-width: 320px) and (max-width: 767px) { + font-size: 12px; } } .symbols { @@ -343,11 +421,11 @@ cursor: pointer; width: 162px; font-size: 14px; - font-weight: 400; + font-weight: 500; transition: all 0.2s; @media (min-width: 320px) and (max-width: 767px) { width: 200px; - font-size: 16px; + font-size: 14px; } &:hover { From ef449b25e26ee758dec8cdea71ea81b533e1053b Mon Sep 17 00:00:00 2001 From: Sui Sin <103026762+suisin-deriv@users.noreply.github.com> Date: Mon, 30 Jan 2023 13:54:29 +0800 Subject: [PATCH 3/7] fixed POI broken page for refuted clients (#7289) Co-authored-by: Matin shafiei --- src/javascript/app/pages/user/account/authenticate.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/javascript/app/pages/user/account/authenticate.js b/src/javascript/app/pages/user/account/authenticate.js index 11d1fc1fe88da..6f55d649ac4c0 100644 --- a/src/javascript/app/pages/user/account/authenticate.js +++ b/src/javascript/app/pages/user/account/authenticate.js @@ -1307,7 +1307,9 @@ const Authenticate = (() => { $('#idv_document_failed_try_again_btn').setVisibility(0); $('#idv_document_failed_text').setVisibility(1); $('#idv_document_failed_upload_btn').setVisibility(1); - $('#idv_document_failed_upload_btn').on('click', () => { + $('#idv_document_failed_upload_btn').on('click', (e) => { + e.preventDefault(); + e.stopPropagation(); $('#idv_document_failed').setVisibility(0); if (Number(onfido_submissions_left) > 0) { handleCountrySelector(); From cd9ec06a64406f5c6cf8b2ab8b2785ff28ef7487 Mon Sep 17 00:00:00 2001 From: Sui Sin <103026762+suisin-deriv@users.noreply.github.com> Date: Mon, 30 Jan 2023 13:55:36 +0800 Subject: [PATCH 4/7] =?UTF-8?q?Suisin/Changes=20on=20authenticate.js=20to?= =?UTF-8?q?=20show=20Manual=20Upload=20after=20Onfido=20fail=203=20?= =?UTF-8?q?=E2=80=A6=20(#7269)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Changes on authenticate.js to show Manual Upload after Onfido fail 3 times * Update logic for handle manual * Fix: Displaying Pending Message when websocket network message is in pending --------- Co-authored-by: Matin shafiei --- .../app/pages/user/account/authenticate.js | 31 +++++++++++++++---- 1 file changed, 25 insertions(+), 6 deletions(-) diff --git a/src/javascript/app/pages/user/account/authenticate.js b/src/javascript/app/pages/user/account/authenticate.js index 6f55d649ac4c0..de3fc7e02bda0 100644 --- a/src/javascript/app/pages/user/account/authenticate.js +++ b/src/javascript/app/pages/user/account/authenticate.js @@ -1378,7 +1378,7 @@ const Authenticate = (() => { case 'suspected': case 'rejected': if (Number(submissions_left) < 1) { - $('#limited_poi').setVisibility(1); + handleManual(); } else { const maximum_reasons = rejected_reasons.slice(0, 3); const has_minimum_reasons = rejected_reasons.length > 3; @@ -1440,13 +1440,32 @@ const Authenticate = (() => { } }; - const handleManual = () => { - $('#idv-container').setVisibility(0); + const handleManual = async () => { + account_status = await getAccountStatus(); + const { manual } = account_status.authentication.identity.services; + const { status } = manual; $('#authentication_tab').setVisibility(1); - $('#msg_personal_details').setVisibility(1); TabSelector.updateTabDisplay(); - $('#not_authenticated_uns').setVisibility(1); - initUnsupported(); + + switch (status){ + case 'none': + $('#idv-container').setVisibility(0); + $('#msg_personal_details').setVisibility(1); + $('#not_authenticated_uns').setVisibility(1); + initUnsupported(); + break; + case 'pending': + $('#idv-container').setVisibility(0); + $('#upload_complete').setVisibility(1); + break; + case 'rejected': + case 'suspected': + $('#idv-container').setVisibility(0); + $('#limited_poi').setVisibility(1); + break; + default: + break; + } }; const initAuthentication = async () => { From 8b9d036959ae2628ffc9da3a3038eabc9852f605 Mon Sep 17 00:00:00 2001 From: Maryia <103177211+maryia-deriv@users.noreply.github.com> Date: Mon, 30 Jan 2023 08:57:33 +0300 Subject: [PATCH 5/7] fix: blank page caused by disallowed synthetics (#7305) Co-authored-by: Matin shafiei --- src/javascript/app/common/active_symbols.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/javascript/app/common/active_symbols.js b/src/javascript/app/common/active_symbols.js index 4959fa3a39bfe..cdafd3a1cfba7 100644 --- a/src/javascript/app/common/active_symbols.js +++ b/src/javascript/app/common/active_symbols.js @@ -26,7 +26,7 @@ const submarket_order = { }; const ActiveSymbols = (() => { - const groupBy = (xs, key) => ( + const groupBy = (xs = [], key) => ( xs.reduce((rv, x) => { (rv[x[key]] = rv[x[key]] || []).push(x); return rv; From e80f1d54c42dda26618b7b119d76c944eadd40e9 Mon Sep 17 00:00:00 2001 From: aizad-deriv <103104395+aizad-deriv@users.noreply.github.com> Date: Mon, 30 Jan 2023 13:59:34 +0800 Subject: [PATCH 6/7] Aizad/Fix Derived toggle click on reload (#7293) * task: fix derived toggle click on reload * fix: active icon behavior * resolved: replace with classNames function --------- Co-authored-by: Matin shafiei --- src/javascript/app/pages/trade/markets.jsx | 53 ++++++++++++++++------ src/sass/app/components/market.scss | 5 ++ 2 files changed, 45 insertions(+), 13 deletions(-) diff --git a/src/javascript/app/pages/trade/markets.jsx b/src/javascript/app/pages/trade/markets.jsx index fd8c7d481872d..14edc1ffc40b6 100644 --- a/src/javascript/app/pages/trade/markets.jsx +++ b/src/javascript/app/pages/trade/markets.jsx @@ -191,7 +191,10 @@ class Markets extends React.Component { }; toggleAccordion = () => { - this.setState({ open_accordion: !this.state.open_accordion }); + this.setState((prevState) => ({ + ...prevState, + open_accordion: !prevState.open_accordion, + })); } getCurrentUnderlying = () => { @@ -228,7 +231,6 @@ class Markets extends React.Component { } else { this.setState({ subgroup_active: false, - open_accordion : false, }); } } @@ -523,11 +525,16 @@ class Markets extends React.Component {
{group_markets[item].markets.map((m) => (
- + {m.name}
))}
@@ -538,18 +545,30 @@ class Markets extends React.Component { >
- + {group_markets[item].markets[0].subgroup_name} - +
-
+
{group_markets[item].markets.map((m) => (
@@ -576,9 +595,14 @@ class Markets extends React.Component { onClick = {scrollToMarket.bind(null, m.key)} key = {m.key} data-market = {m.key} - className={active_market === m.key ? 'active' : ''} + className={classNames('', { + 'active': active_market === m.key, + })} > - + ))} @@ -591,7 +615,10 @@ class Markets extends React.Component { 'active': (active_market === derived_category || subgroup_active), })} > - + ) ); diff --git a/src/sass/app/components/market.scss b/src/sass/app/components/market.scss index 9e79844dfdda3..9a9d783351196 100644 --- a/src/sass/app/components/market.scss +++ b/src/sass/app/components/market.scss @@ -170,6 +170,11 @@ display: flex; flex-direction: column; + .accordion-label { + &:hover { + text-decoration: none; + } + } .accordion-content { flex-direction: column; display: none; From edb27995c3c9e6f864adfbd19b9f3fa1ca9dbeeb Mon Sep 17 00:00:00 2001 From: Thisyahlen Nair Date: Tue, 31 Jan 2023 12:03:14 +0800 Subject: [PATCH 7/7] fix: disabled view button --- .../app/pages/user/view_popup/view_popup.js | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/src/javascript/app/pages/user/view_popup/view_popup.js b/src/javascript/app/pages/user/view_popup/view_popup.js index 0a6c96686f97b..634d7e89a6dfc 100644 --- a/src/javascript/app/pages/user/view_popup/view_popup.js +++ b/src/javascript/app/pages/user/view_popup/view_popup.js @@ -50,17 +50,8 @@ const ViewPopup = (() => { ViewPopupUI.setOnCloseFunction(onClose); } - if (btn_view) { - ViewPopupUI.disableButton($(btn_view)); - ViewPopupUI.cleanup(false); - } - getContract(); - - if (btn_view) { - ViewPopupUI.enableButton($(btn_view)); - ViewPopupUI.cleanup(true); - } + }; const responseContract = (response) => {