From 168776aef8299a9e6d473d987d298d2486e43591 Mon Sep 17 00:00:00 2001 From: Maksim Eltyshev Date: Wed, 11 Feb 2026 14:03:37 +0100 Subject: [PATCH] chore: Bump terms --- client/src/assets/docs/whats-new.md | 2 +- .../components/common/Login/TermsModal.jsx | 67 +++++++-- .../common/Login/TermsModal.module.scss | 13 ++ client/src/locales/ar-YE/login.js | 1 - client/src/locales/bg-BG/login.js | 1 - client/src/locales/ca-ES/login.js | 1 - client/src/locales/cs-CZ/login.js | 1 - client/src/locales/da-DK/login.js | 1 - client/src/locales/de-DE/login.js | 1 - client/src/locales/el-GR/login.js | 1 - client/src/locales/en-GB/login.js | 1 - client/src/locales/en-US/login.js | 1 - client/src/locales/es-ES/login.js | 1 - client/src/locales/et-EE/login.js | 1 - client/src/locales/fa-IR/login.js | 1 - client/src/locales/fi-FI/login.js | 1 - client/src/locales/fr-FR/login.js | 1 - client/src/locales/hu-HU/login.js | 1 - client/src/locales/id-ID/login.js | 1 - client/src/locales/it-IT/login.js | 1 - client/src/locales/ja-JP/login.js | 1 - client/src/locales/ko-KR/login.js | 1 - client/src/locales/nl-NL/login.js | 1 - client/src/locales/pl-PL/login.js | 1 - client/src/locales/pt-BR/login.js | 1 - client/src/locales/pt-PT/login.js | 1 - client/src/locales/ro-RO/login.js | 1 - client/src/locales/ru-RU/login.js | 1 - client/src/locales/sk-SK/login.js | 1 - client/src/locales/sr-Cyrl-RS/login.js | 1 - client/src/locales/sr-Latn-RS/login.js | 1 - client/src/locales/sv-SE/login.js | 1 - client/src/locales/tr-TR/login.js | 1 - client/src/locales/uk-UA/login.js | 1 - client/src/locales/uz-UZ/login.js | 1 - client/src/locales/vi-VN/login.js | 1 - client/src/locales/zh-CN/login.js | 1 - client/src/locales/zh-TW/login.js | 1 - server/terms/cloud/de-DE.md | 140 +++++++++++++++--- server/terms/cloud/en-US.md | 140 +++++++++++++++--- server/terms/self-hosted/de-DE.md | 107 +++++++++---- server/terms/self-hosted/en-US.md | 107 +++++++++---- 42 files changed, 456 insertions(+), 155 deletions(-) diff --git a/client/src/assets/docs/whats-new.md b/client/src/assets/docs/whats-new.md index 97412d2a..a05384f8 100644 --- a/client/src/assets/docs/whats-new.md +++ b/client/src/assets/docs/whats-new.md @@ -1,4 +1,4 @@ -## [2.0.0] - 2026-02-10 +## [2.0.0] - 2026-02-11 ### Added diff --git a/client/src/components/common/Login/TermsModal.jsx b/client/src/components/common/Login/TermsModal.jsx index 3fe09b36..fe2385d1 100644 --- a/client/src/components/common/Login/TermsModal.jsx +++ b/client/src/components/common/Login/TermsModal.jsx @@ -3,10 +3,10 @@ * Licensed under the Fair Use License: https://github.com/plankanban/planka/blob/master/LICENSE.md */ -import React, { useCallback, useState } from 'react'; +import React, { useCallback, useMemo, useState } from 'react'; import { useDispatch, useSelector } from 'react-redux'; import { useTranslation } from 'react-i18next'; -import { Button, Checkbox, Dropdown, Modal } from 'semantic-ui-react'; +import { Button, Checkbox, Dropdown, Modal, Segment } from 'semantic-ui-react'; import selectors from '../../../selectors'; import entryActions from '../../../entry-actions'; @@ -18,6 +18,25 @@ import styles from './TermsModal.module.scss'; const LOCALES = TERMS_LANGUAGES.map((language) => localeByLanguage[language]); +const splitTermsAndConfirmations = (content) => { + const separator = '\n---\n'; + const index = content.lastIndexOf(separator); + + if (index === -1) { + return [content.trim(), []]; + } + + const terms = content.slice(0, index).trim(); + + const confirmations = content + .slice(index + separator.length) + .split('\n') + .map((confirmation) => confirmation.replace(/^✔️\s*/, '').replace(/\*\*(.*?)\*\*/, '$1')) + .filter(Boolean); + + return [terms, confirmations]; +}; + const TermsModal = React.memo(() => { const { termsForm: { payload: terms, isSubmitting, isCancelling, isLanguageUpdating }, @@ -25,7 +44,12 @@ const TermsModal = React.memo(() => { const dispatch = useDispatch(); const [t] = useTranslation(); - const [isTermsAccepted, setIsTermsAccepted] = useState(false); + const [acceptedConfirmationsSet, setAcceptedConfirmationsSet] = useState(new Set()); + + const [content, confirmations] = useMemo( + () => splitTermsAndConfirmations(terms.content), + [terms.content], + ); const handleContinueClick = useCallback(() => { dispatch(entryActions.acceptTerms(terms.signature)); @@ -42,10 +66,22 @@ const TermsModal = React.memo(() => { [dispatch], ); - const handleToggleAcceptClick = useCallback((_, { checked }) => { - setIsTermsAccepted(checked); + const handleToggleConfirmationAccept = useCallback((index) => { + setAcceptedConfirmationsSet((prevAcceptedConfirmationsSet) => { + const nextAcceptedConfirmationsSet = new Set(prevAcceptedConfirmationsSet); + + if (nextAcceptedConfirmationsSet.has(index)) { + nextAcceptedConfirmationsSet.delete(index); + } else { + nextAcceptedConfirmationsSet.add(index); + } + + return nextAcceptedConfirmationsSet; + }); }, []); + const isAllConfirmationsAccepted = acceptedConfirmationsSet.size === confirmations.length; + return ( @@ -63,7 +99,20 @@ const TermsModal = React.memo(() => { className={styles.language} onChange={handleLanguageChange} /> - {terms.content} + {content} + {confirmations.length > 0 && ( + + {confirmations.map((confirmation, index) => ( + handleToggleConfirmationAccept(index)} + /> + ))} + + )}