From 2b6514d6e41399b100465bac1d26fdd2049443da Mon Sep 17 00:00:00 2001 From: Elyor Djalilov Date: Tue, 21 May 2024 12:52:41 +0500 Subject: [PATCH 1/7] fixed condition for displaying country and city --- .../active-session/SessionsTable/RowView/SessionsRow.js | 6 +----- .../SessionsTable/RowView/SessionsRowContent.js | 3 +-- .../SessionsTable/TableView/SessionsTableRow.js | 7 ++----- 3 files changed, 4 insertions(+), 12 deletions(-) diff --git a/packages/client/src/pages/Profile/Section/Body/sub-components/active-session/SessionsTable/RowView/SessionsRow.js b/packages/client/src/pages/Profile/Section/Body/sub-components/active-session/SessionsTable/RowView/SessionsRow.js index 3b27e7bf79..f39c275353 100644 --- a/packages/client/src/pages/Profile/Section/Body/sub-components/active-session/SessionsTable/RowView/SessionsRow.js +++ b/packages/client/src/pages/Profile/Section/Body/sub-components/active-session/SessionsTable/RowView/SessionsRow.js @@ -36,7 +36,6 @@ import TickSvgUrl from "PUBLIC_DIR/images/tick.svg?url"; const SessionsRow = (props) => { const { item, - standalone, sectionWidth, currentSession, setPlatformModalData, @@ -88,19 +87,16 @@ const SessionsRow = (props) => { ip={item.ip} sectionWidth={sectionWidth} showTickIcon={showTickIcon} - standalone={standalone} /> ); }; -export default inject(({ setup, settingsStore }) => { - const { standalone } = settingsStore; +export default inject(({ setup }) => { const { currentSession, setLogoutDialogVisible, setPlatformModalData } = setup; return { - standalone, currentSession, setLogoutDialogVisible, setPlatformModalData, diff --git a/packages/client/src/pages/Profile/Section/Body/sub-components/active-session/SessionsTable/RowView/SessionsRowContent.js b/packages/client/src/pages/Profile/Section/Body/sub-components/active-session/SessionsTable/RowView/SessionsRowContent.js index 5802105237..e5110da95c 100644 --- a/packages/client/src/pages/Profile/Section/Body/sub-components/active-session/SessionsTable/RowView/SessionsRowContent.js +++ b/packages/client/src/pages/Profile/Section/Body/sub-components/active-session/SessionsTable/RowView/SessionsRowContent.js @@ -47,7 +47,6 @@ const StyledRowContent = styled(RowContent)` const SessionsRowContent = ({ id, - standalone, platform, browser, date, @@ -70,7 +69,7 @@ const SessionsRowContent = ({ )} {convertTime(date)} - {!standalone && ( + {country && city && ( {country} {` ${city}`} diff --git a/packages/client/src/pages/Profile/Section/Body/sub-components/active-session/SessionsTable/TableView/SessionsTableRow.js b/packages/client/src/pages/Profile/Section/Body/sub-components/active-session/SessionsTable/TableView/SessionsTableRow.js index edd6c7da49..27bae74cf0 100644 --- a/packages/client/src/pages/Profile/Section/Body/sub-components/active-session/SessionsTable/TableView/SessionsTableRow.js +++ b/packages/client/src/pages/Profile/Section/Body/sub-components/active-session/SessionsTable/TableView/SessionsTableRow.js @@ -82,7 +82,6 @@ const SessionsTableRow = (props) => { const { item, hideColumns, - standalone, currentSession, setPlatformModalData, setLogoutDialogVisible, @@ -125,7 +124,7 @@ const SessionsTableRow = (props) => { - {!standalone ? ( + {country && city ? ( <> {country}, {city} @@ -153,13 +152,11 @@ const SessionsTableRow = (props) => { ); }; -export default inject(({ setup, settingsStore }) => { - const { standalone } = settingsStore; +export default inject(({ setup }) => { const { currentSession, setLogoutDialogVisible, setPlatformModalData } = setup; return { - standalone, currentSession, setLogoutDialogVisible, setPlatformModalData, From 980637fcf1ac649d66a140be8d12b1a07f702fc2 Mon Sep 17 00:00:00 2001 From: Elyor Djalilov Date: Tue, 21 May 2024 13:04:52 +0500 Subject: [PATCH 2/7] added additional conditions --- .../SessionsTable/RowView/SessionsRowContent.js | 13 ++++++++++--- .../SessionsTable/TableView/SessionsTableRow.js | 12 ++++++++++++ 2 files changed, 22 insertions(+), 3 deletions(-) diff --git a/packages/client/src/pages/Profile/Section/Body/sub-components/active-session/SessionsTable/RowView/SessionsRowContent.js b/packages/client/src/pages/Profile/Section/Body/sub-components/active-session/SessionsTable/RowView/SessionsRowContent.js index e5110da95c..6827b0ed00 100644 --- a/packages/client/src/pages/Profile/Section/Body/sub-components/active-session/SessionsTable/RowView/SessionsRowContent.js +++ b/packages/client/src/pages/Profile/Section/Body/sub-components/active-session/SessionsTable/RowView/SessionsRowContent.js @@ -69,10 +69,17 @@ const SessionsRowContent = ({ )} {convertTime(date)} - {country && city && ( + {(country || city) && ( - {country} - {` ${city}`} + {country && city ? ( + <> + {country} {city} + + ) : country ? ( + <>{country} + ) : ( + <>{city} + )} )} diff --git a/packages/client/src/pages/Profile/Section/Body/sub-components/active-session/SessionsTable/TableView/SessionsTableRow.js b/packages/client/src/pages/Profile/Section/Body/sub-components/active-session/SessionsTable/TableView/SessionsTableRow.js index 27bae74cf0..08789f53fc 100644 --- a/packages/client/src/pages/Profile/Section/Body/sub-components/active-session/SessionsTable/TableView/SessionsTableRow.js +++ b/packages/client/src/pages/Profile/Section/Body/sub-components/active-session/SessionsTable/TableView/SessionsTableRow.js @@ -130,6 +130,18 @@ const SessionsTableRow = (props) => { {ip} + ) : country ? ( + <> + {country} + + {ip} + + ) : city ? ( + <> + {city} + + {ip} + ) : ( <>{ip} )} From 835e99dc05a23cd6e70e0038981298360ba7955c Mon Sep 17 00:00:00 2001 From: Elyor Djalilov Date: Tue, 21 May 2024 13:21:13 +0500 Subject: [PATCH 3/7] removed duplicate divider --- .../TableView/SessionsTableRow.js | 22 ++++++++----------- 1 file changed, 9 insertions(+), 13 deletions(-) diff --git a/packages/client/src/pages/Profile/Section/Body/sub-components/active-session/SessionsTable/TableView/SessionsTableRow.js b/packages/client/src/pages/Profile/Section/Body/sub-components/active-session/SessionsTable/TableView/SessionsTableRow.js index 08789f53fc..fa9efa3fce 100644 --- a/packages/client/src/pages/Profile/Section/Body/sub-components/active-session/SessionsTable/TableView/SessionsTableRow.js +++ b/packages/client/src/pages/Profile/Section/Body/sub-components/active-session/SessionsTable/TableView/SessionsTableRow.js @@ -130,20 +130,16 @@ const SessionsTableRow = (props) => { {ip} - ) : country ? ( - <> - {country} - - {ip} - - ) : city ? ( - <> - {city} - - {ip} - ) : ( - <>{ip} + <> + {country || city ? ( + <> + {country || city} + + + ) : null} + {ip} + )} From 45c380a4885366775bb7a93de6b9263456c07a7a Mon Sep 17 00:00:00 2001 From: Elyor Djalilov Date: Tue, 21 May 2024 13:28:33 +0500 Subject: [PATCH 4/7] removed duplicate divider --- .../TableView/SessionsTableRow.js | 18 +++++------------- 1 file changed, 5 insertions(+), 13 deletions(-) diff --git a/packages/client/src/pages/Profile/Section/Body/sub-components/active-session/SessionsTable/TableView/SessionsTableRow.js b/packages/client/src/pages/Profile/Section/Body/sub-components/active-session/SessionsTable/TableView/SessionsTableRow.js index fa9efa3fce..5c34790e03 100644 --- a/packages/client/src/pages/Profile/Section/Body/sub-components/active-session/SessionsTable/TableView/SessionsTableRow.js +++ b/packages/client/src/pages/Profile/Section/Body/sub-components/active-session/SessionsTable/TableView/SessionsTableRow.js @@ -124,23 +124,15 @@ const SessionsTableRow = (props) => { - {country && city ? ( + {(country || city) && ( <> - {country}, {city} + {country && <>{country}} + {country && city && ", "} + {city && <>{city}} - {ip} - - ) : ( - <> - {country || city ? ( - <> - {country || city} - - - ) : null} - {ip} )} + {ip} From 03eade07013c81f3df83db252a68e638e36460d7 Mon Sep 17 00:00:00 2001 From: Elyor Djalilov Date: Tue, 21 May 2024 13:38:27 +0500 Subject: [PATCH 5/7] refactored conditions --- .../SessionsTable/TableView/SessionsTableRow.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/client/src/pages/Profile/Section/Body/sub-components/active-session/SessionsTable/TableView/SessionsTableRow.js b/packages/client/src/pages/Profile/Section/Body/sub-components/active-session/SessionsTable/TableView/SessionsTableRow.js index 5c34790e03..6f472af87d 100644 --- a/packages/client/src/pages/Profile/Section/Body/sub-components/active-session/SessionsTable/TableView/SessionsTableRow.js +++ b/packages/client/src/pages/Profile/Section/Body/sub-components/active-session/SessionsTable/TableView/SessionsTableRow.js @@ -126,9 +126,9 @@ const SessionsTableRow = (props) => { {(country || city) && ( <> - {country && <>{country}} + {country} {country && city && ", "} - {city && <>{city}} + {city} )} From 382dee0e2c46348410568e87c83033f066c0b076 Mon Sep 17 00:00:00 2001 From: Elyor Djalilov Date: Tue, 21 May 2024 13:42:07 +0500 Subject: [PATCH 6/7] refactored conditions for row view --- .../SessionsTable/RowView/SessionsRowContent.js | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/packages/client/src/pages/Profile/Section/Body/sub-components/active-session/SessionsTable/RowView/SessionsRowContent.js b/packages/client/src/pages/Profile/Section/Body/sub-components/active-session/SessionsTable/RowView/SessionsRowContent.js index 6827b0ed00..c869b71b94 100644 --- a/packages/client/src/pages/Profile/Section/Body/sub-components/active-session/SessionsTable/RowView/SessionsRowContent.js +++ b/packages/client/src/pages/Profile/Section/Body/sub-components/active-session/SessionsTable/RowView/SessionsRowContent.js @@ -71,15 +71,9 @@ const SessionsRowContent = ({ {convertTime(date)} {(country || city) && ( - {country && city ? ( - <> - {country} {city} - - ) : country ? ( - <>{country} - ) : ( - <>{city} - )} + {country} + {country && city && " "} + {city} )} From 778fbb2c9534a00b37d6e88c52ebe5c5c389bfec Mon Sep 17 00:00:00 2001 From: Elyor Djalilov Date: Tue, 21 May 2024 13:48:56 +0500 Subject: [PATCH 7/7] added comma after country --- .../active-session/SessionsTable/RowView/SessionsRowContent.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/client/src/pages/Profile/Section/Body/sub-components/active-session/SessionsTable/RowView/SessionsRowContent.js b/packages/client/src/pages/Profile/Section/Body/sub-components/active-session/SessionsTable/RowView/SessionsRowContent.js index c869b71b94..dc39f35d65 100644 --- a/packages/client/src/pages/Profile/Section/Body/sub-components/active-session/SessionsTable/RowView/SessionsRowContent.js +++ b/packages/client/src/pages/Profile/Section/Body/sub-components/active-session/SessionsTable/RowView/SessionsRowContent.js @@ -72,7 +72,7 @@ const SessionsRowContent = ({ {(country || city) && ( {country} - {country && city && " "} + {country && city && ", "} {city} )}