Skip to content

Commit

Permalink
#872 Update essential cookies description
Browse files Browse the repository at this point in the history
  • Loading branch information
thekingofcity committed Nov 15, 2024
1 parent 570462e commit 8ec1f26
Show file tree
Hide file tree
Showing 12 changed files with 79 additions and 58 deletions.
5 changes: 1 addition & 4 deletions src/components/page-header/donation-modal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,11 @@ import { TfiGallery } from 'react-icons/tfi';
import { Events } from '../../constants/constants';
import AfdianIcon from '../../images/afdian.png';
import OpenCollectiveIcon from '../../images/opencollective-icon.webp';
import { useRootSelector } from '../../redux';

const DonationModal = (props: { isOpen: boolean; onClose: () => void }) => {
const { isOpen, onClose } = props;
const { t } = useTranslation();
const {
telemetry: { project: isAllowAppTelemetry },
} = useRootSelector(state => state.app);
const isAllowAppTelemetry = rmgRuntime.isAllowAnalytics();

const handleGalleryDonationOpen = () => {
if (rmgRuntime.isStandaloneWindow()) {
Expand Down
3 changes: 2 additions & 1 deletion src/components/page-header/download-actions.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,10 @@ export default function DownloadActions() {
const bgColor = useColorModeValue('white', 'var(--chakra-colors-gray-800)');
const dispatch = useRootDispatch();
const {
telemetry: { app: isAllowAppTelemetry, project: isAllowProjectTelemetry },
telemetry: { project: isAllowProjectTelemetry },
} = useRootSelector(state => state.app);
const param = useRootSelector(state => state.param);
const isAllowAppTelemetry = rmgRuntime.isAllowAnalytics();
const { t } = useTranslation();

const graph = React.useRef(window.graph);
Expand Down
2 changes: 1 addition & 1 deletion src/components/page-header/open-actions.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@ export default function OpenActions() {
const { t } = useTranslation();
const dispatch = useRootDispatch();
const {
telemetry: { project: isAllowAppTelemetry },
preference: { autoParallel },
} = useRootSelector(state => state.app);
const isAllowAppTelemetry = rmgRuntime.isAllowAnalytics();

const graph = React.useRef(window.graph);
const fileInputRef = React.useRef<HTMLInputElement | null>(null);
Expand Down
3 changes: 2 additions & 1 deletion src/components/page-header/rmp-gallery-app-clip.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,9 @@ export default function RmpGalleryAppClip(props: RmpGalleryAppClipProps) {
const { t } = useTranslation();
const dispatch = useRootDispatch();
const {
telemetry: { app: isAllowAppTelemetry, project: isAllowProjectTelemetry },
telemetry: { project: isAllowProjectTelemetry },
} = useRootSelector(state => state.app);
const isAllowAppTelemetry = rmgRuntime.isAllowAnalytics();

const graph = React.useRef(window.graph);

Expand Down
66 changes: 39 additions & 27 deletions src/components/page-header/settings-modal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ import React from 'react';
import { useTranslation } from 'react-i18next';
import { MdArrowBack, MdArrowDownward, MdArrowForward, MdArrowUpward, MdOpenInNew, MdReadMore } from 'react-icons/md';
import { useRootDispatch, useRootSelector } from '../../redux';
import { setAutoParallel, setTelemetryApp } from '../../redux/app/app-slice';
import { setAutoParallel, setTelemetryProject } from '../../redux/app/app-slice';
import { setKeepLastPath } from '../../redux/runtime/runtime-slice';
import { isMacClient } from '../../util/helpers';
import { MAX_PARALLEL_LINES_FREE, MAX_PARALLEL_LINES_PRO } from '../../util/parallel';
Expand All @@ -56,7 +56,7 @@ const SettingsModal = (props: { isOpen: boolean; onClose: () => void }) => {
const { isOpen, onClose } = props;
const { activeSubscriptions } = useRootSelector(state => state.account);
const {
telemetry: { app: isAllowAppTelemetry },
telemetry: { project: isAllowProjectTelemetry },
preference: { autoParallel },
} = useRootSelector(state => state.app);
const { keepLastPath, parallelLinesCount } = useRootSelector(state => state.runtime);
Expand All @@ -72,8 +72,10 @@ const SettingsModal = (props: { isOpen: boolean; onClose: () => void }) => {
const [isUnlockSimplePathOpen, setIsUnlockSimplePathOpen] = React.useState(false);
const [isManagerOpen, setIsManagerOpen] = React.useState(false);

const isAllowAnalytics = rmgRuntime.isAllowAnalytics();
const handleAdditionalTelemetry = (allowAppTelemetry: boolean) => dispatch(setTelemetryApp(allowAppTelemetry));
const isAllowAppTelemetry = rmgRuntime.isAllowAnalytics();
const handleAdditionalTelemetry = (allowTelemetry: boolean) => {
dispatch(setTelemetryProject(allowTelemetry));
};

const maximumParallelLines = activeSubscriptions.RMP_CLOUD ? MAX_PARALLEL_LINES_PRO : MAX_PARALLEL_LINES_FREE;
const isParallelLineDisabled = parallelLinesCount >= maximumParallelLines;
Expand Down Expand Up @@ -355,33 +357,43 @@ const SettingsModal = (props: { isOpen: boolean; onClose: () => void }) => {
{t('header.settings.telemetry.title')}
</Text>
<Box mt="3">
<Box display="flex" mb="1">
<Text flex="1">{t('header.settings.telemetry.essential')}</Text>
<Switch isChecked={isAllowAnalytics} isDisabled />
</Box>
<Text fontSize="sm" lineHeight="100%" color="gray.600">
{t('header.settings.telemetry.essentialInfo')}
{t('header.settings.telemetry.info')}
</Text>
<Link
color={linkColour}
fontSize="sm"
lineHeight="100%"
href="https://support.google.com/analytics/answer/11593727"
isExternal={true}
>
{t('header.settings.telemetry.essentialLink')} <Icon as={MdOpenInNew} />
</Link>

<Box display="flex" mb="1">
<Text flex="1">{t('header.settings.telemetry.additional')}</Text>
<Switch
isChecked={isAllowAppTelemetry}
onChange={({ target: { checked } }) => handleAdditionalTelemetry(checked)}
/>
<Box mt="3" mb="1">
<Box display="flex" mb="1">
<Text flex="1">{t('header.settings.telemetry.essential')}</Text>
<Tooltip label={t('header.settings.telemetry.essentialTooltip')}>
<Switch isChecked={isAllowAppTelemetry} isDisabled />
</Tooltip>
</Box>
<Text fontSize="sm" lineHeight="100%" color="gray.600">
{t('header.settings.telemetry.essentialInfo')}
</Text>
<Link
color={linkColour}
fontSize="sm"
lineHeight="100%"
href="https://support.google.com/analytics/answer/11593727"
isExternal={true}
>
{t('header.settings.telemetry.essentialLink')} <Icon as={MdOpenInNew} />
</Link>
</Box>

<Box mt="1" mb="1">
<Box display="flex">
<Text flex="1">{t('header.settings.telemetry.additional')}</Text>
<Switch
isChecked={isAllowProjectTelemetry}
onChange={({ target: { checked } }) => handleAdditionalTelemetry(checked)}
/>
</Box>
<Text fontSize="sm" lineHeight="100%" color="gray.600">
{t('header.settings.telemetry.additionalInfo')}
</Text>
</Box>
<Text fontSize="sm" lineHeight="100%" color="gray.600">
{t('header.settings.telemetry.additionalInfo')}
</Text>
</Box>
</Box>
</VStack>
Expand Down
7 changes: 2 additions & 5 deletions src/components/page-header/window-header.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { IoMdHeart } from 'react-icons/io';
import { MdHelp, MdRedo, MdSettings, MdTranslate, MdUndo } from 'react-icons/md';
import { Events } from '../../constants/constants';
import { useRootDispatch, useRootSelector } from '../../redux';
import { redoAction, saveGraph, undoAction } from '../../redux/param/param-slice';
import { redoAction, undoAction } from '../../redux/param/param-slice';
import { refreshEdgesThunk, refreshNodesThunk, setIsDonationModalOpen } from '../../redux/runtime/runtime-slice';
import AboutModal from './about-modal';
import DonationModal from './donation-modal';
Expand All @@ -21,12 +21,9 @@ import { ZoomPopover } from './zoom-popover';
export default function WindowHeader() {
const { t } = useTranslation();
const dispatch = useRootDispatch();
const {
telemetry: { app: isAllowAppTelemetry },
} = useRootSelector(state => state.app);
const { past, future } = useRootSelector(state => state.param);
const { isDonationModalOpen } = useRootSelector(state => state.runtime);
const graph = React.useRef(window.graph);
const isAllowAppTelemetry = rmgRuntime.isAllowAnalytics();

const [isSettingsModalOpen, setIsSettingsModalOpen] = React.useState(false);
const [isAboutModalOpen, setIsAboutModalOpen] = React.useState(false);
Expand Down
6 changes: 4 additions & 2 deletions src/i18n/translations/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -638,11 +638,13 @@
},
"telemetry": {
"title": "Telemetry",
"info": "To help improve Rail Map Painter and keep contributors motivated to enhance the project, anonymous usage data is collected through Google Analytics. This data is used solely for enhancing the user experience and optimizing the tool's functionality and is never shared with third parties.",
"essential": "Basic",
"essentialInfo": "Rail Map Painter uses Google Analytics to collect data that helps the contributors know how and when our users visit this project. Since there is no user registration and backend service in Rail Map Painter, this is the only feedback that contributors can get and be motivated to keep updating the project. Be assured that all the data transferred will not contain any personal identifiable information and data from your project.",
"essentialTooltip": "Change this global setting in Rail Map Toolkit",
"essentialInfo": "Rail Map Painter collects essential usage data that helps us understand how and when users interact with the tool. Rest assured, no personally identifiable information or data from your projects is ever collected.",
"essentialLink": "Click this link to see detailed fields that Google Analytics may collect.",
"additional": "Additional",
"additionalInfo": "Rail Map Painter also sends additional events when you interact with your mouse or keyboard such as project creation or station addition. As always, they do not contain any personal identifiable information and are only used for statistics purpose."
"additionalInfo": "Rail Map Painter also gathers data on interactions, such as project creation or station addition, when you input. These additional data is also anonymous and are only used for statistical analysis to help us make the tool better."
}
},
"about": {
Expand Down
10 changes: 6 additions & 4 deletions src/i18n/translations/ja.json
Original file line number Diff line number Diff line change
Expand Up @@ -637,12 +637,14 @@
}
},
"telemetry": {
"title": "テレメトリ",
"title": "テレメトリー",
"info": "鉄道路線図画家を改善し、貢献者がプロジェクトを向上させる意欲を維持するため、Google Analytics を通じて匿名の使用データを収集しています。このデータはユーザー体験の向上とツールの最適化のためだけに使用され、第三者と共有されることはありません。",
"essential": "基本",
"essentialInfo": "Rail Map Painterでは、Google Analyticsを使用してデータを収集し、貢献者がユーザーがこのプロジェクトを訪れる方法やタイミングを知るのに役立ちます。Rail Map Painterにはユーザー登録やバックエンドサービスがないため、これが貢献者がフィードバックを得てプロジェクトを更新し続けることにつながる唯一の手段です。転送されるすべてのデータには、個人を特定できる情報やプロジェクトのデータは含まれませんので、安心してください。",
"essentialLink": "Google Analyticsが収集する詳細なフィールドを確認するには、このリンクをクリックしてください。",
"essentialTooltip": "鉄道路線図ツールキットでこのグローバル設定を変更する",
"essentialInfo": "鉄道路線図画家は、ツールがどのように、またいつ使用されるかを理解するための基本的な使用データを収集します。ご安心ください。個人を特定できる情報やプロジェクトデータは一切収集されません。",
"essentialLink": "Google Analytics が収集する可能性のある詳細フィールドを表示するには、こちらのリンクをクリックしてください。",
"additional": "追加",
"additionalInfo": "Rail Map Painterでは、マウスやキーボードとのやり取り(作品の作成や駅の追加など)時に、追加のイベントも送信されます。これらのイベントも個人を特定できる情報は含まれず、統計目的にのみ使用されます"
"additionalInfo": "鉄道路線図画家は、プロジェクトの作成や駅の追加など、入力時のインタラクションに関するデータも収集します。これらの追加データも匿名であり、ツールを改善するための統計分析にのみ使用されます"
}
},
"about": {
Expand Down
12 changes: 7 additions & 5 deletions src/i18n/translations/ko.json
Original file line number Diff line number Diff line change
Expand Up @@ -636,12 +636,14 @@
}
},
"telemetry": {
"title": "원격 계측",
"title": "원격 측정",
"info": "지하철 노선도 그리기를 개선하고 기여자가 프로젝트를 향상시키는 데 동기를 부여하기 위해 Google Analytics를 통해 익명의 사용 데이터를 수집합니다. 이 데이터는 사용자 경험을 향상하고 도구 기능을 최적화하는 데에만 사용되며, 제3자와 절대 공유되지 않습니다.",
"essential": "기본",
"essentialInfo": "지하철 노선도 그리기기는 Google Analytics를 사용하여 데이터를 수집하여 사용자가 프로젝트에 액세스하는 방법과 시기를 이해하는 데 도움이 됩니다.지하철 노선도 그리기 장치에는 사용자 등록과 백엔드 서비스가 없기 때문에 프로젝트를 계속 업데이트할 수 있는 기여자의 유일한 피드백입니다.전송되는 모든 데이터에는 프로젝트에 포함된 개인 정보 및 데이터가 포함되어 있지 않습니다.",
"essentialLink": "Google Analytics에서 수집할 수 있는 세부 필드를 보려면 이 링크를 클릭하십시오.",
"additional": "별도",
"additionalInfo": "마우스나 키보드를 사용하여 상호 작용할 때(보기: 프로젝트 생성 또는 사이트 추가), 지하철 노선도 그리기기는 다른 이벤트도 보냅니다. 항상 그렇듯이 개인 신원 정보를 포함하지 않으며 통계 목적으로만 사용됩니다."
"essentialTooltip": "지하철 노선도 툴킷에서 이 전역 설정을 변경하세요",
"essentialInfo": "지하철 노선도 그리기는 도구를 언제, 어떻게 사용하는지 이해하기 위해 기본적인 사용 데이터를 수집합니다. 안심하세요. 개인 식별이 가능한 정보나 프로젝트 데이터는 절대 수집되지 않습니다.",
"essentialLink": "Google Analytics에서 수집할 수 있는 세부 필드를 보려면 이 링크를 클릭하세요.",
"additional": "추가",
"additionalInfo": "지하철 노선도 그리기는 프로젝트 생성이나 역 추가와 같은 입력 시의 상호작용 데이터도 수집합니다. 이러한 추가 데이터도 익명으로 처리되며, 도구를 개선하기 위한 통계 분석에만 사용됩니다."
}
},
"about": {
Expand Down
10 changes: 6 additions & 4 deletions src/i18n/translations/zh-Hans.json
Original file line number Diff line number Diff line change
Expand Up @@ -637,11 +637,13 @@
},
"telemetry": {
"title": "遥测",
"essential": "基本",
"essentialInfo": "地铁线路图绘制器使用 Google Analytics 收集数据,帮助贡献者了解我们的用户如何以及何时访问该项目。由于地铁线路图绘制器中没有用户注册和后端服务,因此这是贡献者们唯一可以获得并有动力继续更新项目的反馈。请放心,所有传输的数据都不会包含您项目中的任何个人身份信息和数据。",
"essentialLink": "单击此链接可查看 Google Analytics 可能收集的详细字段。",
"info": "为了帮助改进地铁线路图绘制器并激励贡献者提升项目,我们通过 Google Analytics 收集匿名使用数据。这些数据仅用于增强用户体验和优化工具功能,绝不会与第三方共享。",
"essential": "基础",
"essentialTooltip": "在地铁线路图工具包中更改此全局设置",
"essentialInfo": "地铁线路图绘制器收集一些基本使用数据,以帮助我们了解用户如何以及何时与工具交互。请放心,我们从不收集任何可识别个人身份的信息或您的项目数据。",
"essentialLink": "点击此链接查看 Google Analytics 可能收集的详细字段。",
"additional": "额外",
"additionalInfo": "当您使用鼠标或键盘进行交互(例如项目创建或站点添加)时,地铁线路图绘制器还会发送其他事件。 一如既往,它们不包含任何个人身份信息,且仅用于统计目的"
"additionalInfo": "地铁线路图绘制器还会收集有关交互的数据,例如项目创建或站点添加等操作。这些额外数据同样是匿名的,仅用于统计分析以帮助我们改进工具"
}
},
"about": {
Expand Down
Loading

0 comments on commit 8ec1f26

Please sign in to comment.