From daae55d62cbed40f78c141aa067a945b2814f96f Mon Sep 17 00:00:00 2001 From: Warrick Corfe-Tan Date: Mon, 20 Sep 2021 15:44:19 +1000 Subject: [PATCH 1/5] Adding survey button to settings menu. --- _locales/en/messages.json | 4 +++- .../session/settings/SessionSettings.tsx | 17 +++++++++++++++++ 2 files changed, 20 insertions(+), 1 deletion(-) diff --git a/_locales/en/messages.json b/_locales/en/messages.json index 760fc8836b..8b649412bc 100644 --- a/_locales/en/messages.json +++ b/_locales/en/messages.json @@ -441,5 +441,7 @@ "deletionTypeTitle": "Deletion Type", "deleteJustForMe": "Delete just for me", "messageDeletedPlaceholder": "This message has been deleted", - "messageDeleted": "Message deleted" + "messageDeleted": "Message deleted", + "surveyTitle": "Take our Session Survey", + "goToOurSurvey": "Go to our survey" } diff --git a/ts/components/session/settings/SessionSettings.tsx b/ts/components/session/settings/SessionSettings.tsx index 92a9196ef0..05db39c865 100644 --- a/ts/components/session/settings/SessionSettings.tsx +++ b/ts/components/session/settings/SessionSettings.tsx @@ -463,6 +463,23 @@ class SettingsViewInner extends React.Component { info: (value: number) => `${value}%`, }, }, + { + id: 'session-survey', + title: window.i18n('surveyTitle'), + description: undefined, + hidden: false, + type: SessionSettingType.Button, + category: SessionSettingCategory.Appearance, + setFn: undefined, + comparisonValue: undefined, + onClick: () => { + void shell.openExternal('https://getsession.org/survey'); + }, + content: { + buttonText: window.i18n('goToOurSurvey'), + buttonColor: SessionButtonColor.Primary, + }, + }, { id: 'help-translation', title: window.i18n('translation'), From 14bcbe4ab6a0a7572a7b1bacc6495604d97adec0 Mon Sep 17 00:00:00 2001 From: Ian Macdonald Date: Sat, 18 Sep 2021 21:57:30 +0200 Subject: [PATCH 2/5] Display the service node's IP address after its country. --- ts/components/dialog/OnionStatusPathDialog.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ts/components/dialog/OnionStatusPathDialog.tsx b/ts/components/dialog/OnionStatusPathDialog.tsx index 42b94ff9f8..9a84f5589e 100644 --- a/ts/components/dialog/OnionStatusPathDialog.tsx +++ b/ts/components/dialog/OnionStatusPathDialog.tsx @@ -69,7 +69,7 @@ const OnionPathModalInner = () => { {nodes.map((snode: Snode | any, index: number) => { let labelText = snode.label ? snode.label - : countryLookup.byIso(ip2country(snode.ip))?.country; + : `${countryLookup.byIso(ip2country(snode.ip))?.country} [${snode.ip}]`; if (!labelText) { labelText = window.i18n('unknownCountry'); } From 76100903cb2c969bffafc4530c84dfd92288472d Mon Sep 17 00:00:00 2001 From: Audric Ackermann Date: Wed, 22 Sep 2021 11:17:41 +1000 Subject: [PATCH 3/5] show ip of onion path on hover of country name --- stylesheets/_session.scss | 1 + .../dialog/OnionStatusPathDialog.tsx | 27 ++++++++++++++++--- 2 files changed, 24 insertions(+), 4 deletions(-) diff --git a/stylesheets/_session.scss b/stylesheets/_session.scss index a594052e0d..45bf13b71c 100644 --- a/stylesheets/_session.scss +++ b/stylesheets/_session.scss @@ -1095,6 +1095,7 @@ input { flex-direction: column; margin: $session-margin-sm; align-items: flex-start; + min-width: 10vw; position: relative; .onion__node { diff --git a/ts/components/dialog/OnionStatusPathDialog.tsx b/ts/components/dialog/OnionStatusPathDialog.tsx index 9a84f5589e..8b3624a2e7 100644 --- a/ts/components/dialog/OnionStatusPathDialog.tsx +++ b/ts/components/dialog/OnionStatusPathDialog.tsx @@ -19,6 +19,8 @@ import { Flex } from '../basic/Flex'; import { SessionIcon, SessionIconButton } from '../session/icon'; import { SessionSpinner } from '../session/SessionSpinner'; import { SessionWrapperModal } from '../session/SessionWrapperModal'; +// tslint:disable-next-line: no-submodule-imports +import useHover from 'react-use/lib/useHover'; export type StatusLightType = { glowStartDelay: number; @@ -26,6 +28,25 @@ export type StatusLightType = { color?: string; }; +const OnionCountryDisplay = ({ + index, + labelText, + snodeIp, +}: { + snodeIp?: string; + labelText: string; + index: number; +}) => { + const element = (hovered: boolean) => ( +
+ {hovered && snodeIp ? snodeIp : labelText} +
+ ); + const [hoverable] = useHover(element); + + return hoverable; +}; + const OnionPathModalInner = () => { const onionPath = useSelector(getFirstOnionPath); const isOnline = useSelector(getIsOnline); @@ -69,14 +90,12 @@ const OnionPathModalInner = () => { {nodes.map((snode: Snode | any, index: number) => { let labelText = snode.label ? snode.label - : `${countryLookup.byIso(ip2country(snode.ip))?.country} [${snode.ip}]`; + : `${countryLookup.byIso(ip2country(snode.ip))?.country}`; if (!labelText) { labelText = window.i18n('unknownCountry'); } return labelText ? ( -
- {labelText} -
+ ) : null; })} From e8c17f2b6e1a50117f97878bdf46c65b20a8076b Mon Sep 17 00:00:00 2001 From: Audric Ackermann Date: Wed, 22 Sep 2021 11:19:59 +1000 Subject: [PATCH 4/5] bump to v1.7.3 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 7eac174a15..a373f893a9 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "session-desktop", "productName": "Session", "description": "Private messaging from your desktop", - "version": "1.7.2", + "version": "1.7.3", "license": "GPL-3.0", "author": { "name": "Loki Project", From 87aa4dfbf4b9c9aba5fff592066db372bf5f2111 Mon Sep 17 00:00:00 2001 From: Audric Ackermann Date: Wed, 22 Sep 2021 13:35:36 +1000 Subject: [PATCH 5/5] center ip and countries in onion path dialog --- stylesheets/_session.scss | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/stylesheets/_session.scss b/stylesheets/_session.scss index 45bf13b71c..285e29ef23 100644 --- a/stylesheets/_session.scss +++ b/stylesheets/_session.scss @@ -1094,7 +1094,7 @@ input { display: flex; flex-direction: column; margin: $session-margin-sm; - align-items: flex-start; + align-items: center; min-width: 10vw; position: relative; @@ -1122,6 +1122,7 @@ input { } .onion__node__country { margin: $session-margin-sm; + min-width: 150px; } .onion__growing-icon {