diff --git a/_locales/en/messages.json b/_locales/en/messages.json index 564f9f2c9d4d..a95e30950e26 100644 --- a/_locales/en/messages.json +++ b/_locales/en/messages.json @@ -692,23 +692,23 @@ }, "icu:SafetyNumberViewer__migration__text": { "messageformat": "Safety numbers are being updated.", - "description": "An explanatory note in SafetyNumberViewer describing the safety number migration process." + "description": "(Deleted 11/01/2023) An explanatory note in SafetyNumberViewer describing the safety number migration process." }, "icu:SafetyNumberViewer__migration__learn_more": { "messageformat": "Learn more", - "description": "A link text in SafetyNumberViewer describing the safety number migration process." + "description": "(Deleted 11/01/2023) A link text in SafetyNumberViewer describing the safety number migration process." }, "icu:SafetyNumberViewer__card__prev": { "messageformat": "Previous Safety number", - "description": "An ARIA label for safety number navigation button." + "description": "(Deleted 11/01/2023) An ARIA label for safety number navigation button." }, "icu:SafetyNumberViewer__card__next": { "messageformat": "Next Safety number", - "description": "An ARIA label for safety number navigation button." + "description": "(Deleted 11/01/2023) An ARIA label for safety number navigation button." }, "icu:SafetyNumberViewer__carousel__dot": { "messageformat": "Safety number version, {index, number} of {total, number}", - "description": "An ARIA label for safety number carousel button." + "description": "(Deleted 11/01/2023) An ARIA label for safety number carousel button." }, "icu:SafetyNumberViewer__markAsVerified": { "messageformat": "Mark as verified", @@ -718,9 +718,17 @@ "messageformat": "Clear verification", "description": "Safety number viewer, verification toggle button, when verified, clears verification state" }, + "icu:SafetyNumberViewer__hint": { + "messageformat": "To verify end-to-end encryption with {name}, compare the numbers above with their device. They can also scan your code with their device.", + "description": "Safety number viewer, text of the hint" + }, + "icu:SafetyNumberViewer__learn_more": { + "messageformat": "Learn more", + "description": "Text of 'Learn more' button of SafetyNumberViewerModal modal" + }, "icu:SafetyNumberViewer__hint--migration": { "messageformat": "To verify end-to-end encryption with {name}, match the color card above with their device and compare the numbers. If these don’t match, try the other pair of safety numbers. Only one pair needs to match.", - "description": "Safety number viewer, text of the hint during migration period" + "description": "(Deleted 11/01/2023). Safety number viewer, text of the hint during migration period" }, "icu:SafetyNumberViewer__hint--normal": { "messageformat": "To verify end-to-end encryption with {name}, compare the numbers above with their device. They can also scan your code with their device.", @@ -728,23 +736,23 @@ }, "icu:SafetyNumberOnboarding__title": { "messageformat": "Changes to safety numbers", - "description": "Title of Safety number onboarding modal" + "description": "(Deleted 11/01/2023) Title of Safety number onboarding modal" }, "icu:SafetyNumberOnboarding__p1": { "messageformat": "Safety numbers are being updated over a transition period to enable upcoming privacy features in Signal.", - "description": "Paragraph 1 of Safety number onboarding modal" + "description": "(Deleted 11/01/2023) Paragraph 1 of Safety number onboarding modal" }, "icu:SafetyNumberOnboarding__p2": { "messageformat": "To verify safety numbers, match the color card with your contact’s device. If these don’t match, try the other pair of safety numbers. Only one pair needs to match.", - "description": "Paragraph 2 of Safety number onboarding modal" + "description": "(Deleted 11/01/2023) Paragraph 2 of Safety number onboarding modal" }, "icu:SafetyNumberOnboarding__help": { "messageformat": "Need help?", - "description": "Text of a secondary button in Safety number onboarding modal" + "description": "(Deleted 11/01/2023) Text of a secondary button in Safety number onboarding modal" }, "icu:SafetyNumberOnboarding__close": { "messageformat": "Got it", - "description": "Text of a secondary button in Safety number onboarding modal" + "description": "(Deleted 11/01/2023) Text of a secondary button in Safety number onboarding modal" }, "icu:SafetyNumberNotReady__body": { "messageformat": "A safety number will be created with this person after you exchange messages with them.", diff --git a/stylesheets/components/SafetyNumberViewer.scss b/stylesheets/components/SafetyNumberViewer.scss index 6c284eb76bf1..334ac66b8a2b 100644 --- a/stylesheets/components/SafetyNumberViewer.scss +++ b/stylesheets/components/SafetyNumberViewer.scss @@ -6,48 +6,14 @@ flex-direction: column; align-items: center; text-align: center; - gap: 16px; + gap: 20px; + padding-top: 16px; + padding-inline: 10px; a { text-decoration: none; } - &__migration { - display: flex; - align-items: center; - justify-content: center; - gap: 12px; - - width: 100%; - margin-block: 0 8px; - - &__text { - flex-grow: 1; - - text-align: start; - @include font-subtitle; - @include light-theme { - color: $color-gray-60; - } - - @include dark-theme { - color: $color-gray-25; - } - - p { - margin: 0; - } - } - - &__icon { - flex-shrink: 0; - display: inline-block; - width: 48px; - height: 48px; - background: url('../images/safety-number-migration.svg'); - } - } - &__card-container { position: relative; display: flex; @@ -66,21 +32,7 @@ padding: 24px; border-radius: 12px; - &--e164 { - background-color: $color-bright-gray; - - .module-SafetyNumberViewer__card__number { - color: $color-gray-75; - } - } - - &--aci { - background-color: $color-borage-blue; - - .module-SafetyNumberViewer__card__number { - color: $color-white; - } - } + background-color: $color-borage-blue; &__qr { width: 120px; @@ -95,6 +47,7 @@ flex-wrap: wrap; gap: 8px; justify-content: center; + color: $color-white; font-family: $monospace; margin-block: 0 4px; @@ -105,86 +58,6 @@ } } } - - &__prev, - &__next { - --height: 36px; - position: absolute; - top: calc(50% - var(--height) / 2); - - width: 18px; - height: var(--height); - } - - &__prev { - inset-inline-start: 0; - @include light-theme { - @include color-svg( - '../images/icons/v3/chevron/chevron-shallow-left.svg', - $color-gray-75 - ); - } - - @include dark-theme { - @include color-svg( - '../images/icons/v3/chevron/chevron-shallow-left.svg', - $color-gray-15 - ); - } - } - - &__next { - inset-inline-end: 0; - @include light-theme { - @include color-svg( - '../images/icons/v3/chevron/chevron-shallow-right.svg', - $color-gray-75 - ); - } - - @include dark-theme { - @include color-svg( - '../images/icons/v3/chevron/chevron-shallow-right.svg', - $color-gray-15 - ); - } - } - } - - &__carousel { - display: flex; - gap: 8px; - - &__dot { - @include button-reset; - width: 8px; - height: 8px; - border-radius: 4px; - - @include light-theme { - background: $color-gray-25; - } - - @include dark-theme { - background: $color-gray-60; - } - - @include keyboard-mode { - &:focus { - box-shadow: 0 0 0 3px $color-ultramarine; - } - } - - &[aria-pressed='true'] { - @include light-theme { - background: $color-black; - } - - @include dark-theme { - background: $color-white; - } - } - } } &__help { @@ -196,6 +69,8 @@ @include dark-theme { color: $color-gray-25; } + + margin-top: 4px; } &__verification-status { diff --git a/ts/background.ts b/ts/background.ts index 2435c52def43..fbf6449c53f1 100644 --- a/ts/background.ts +++ b/ts/background.ts @@ -964,6 +964,10 @@ export async function startApp(): Promise { await window.Signal.Data.removeAllProfileKeyCredentials(); } + if (window.isBeforeVersion(lastVersion, 'v6.38.0-beta.1')) { + await window.storage.remove('hasCompletedSafetyNumberOnboarding'); + } + // This one should always be last - it could restart the app if (window.isBeforeVersion(lastVersion, 'v5.30.0-alpha')) { await deleteAllLogs(); diff --git a/ts/components/SafetyNumberModal.tsx b/ts/components/SafetyNumberModal.tsx index 18210f07b5dc..17fc3e8cab2b 100644 --- a/ts/components/SafetyNumberModal.tsx +++ b/ts/components/SafetyNumberModal.tsx @@ -1,43 +1,25 @@ // Copyright 2021 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import React, { useState, useCallback } from 'react'; +import React from 'react'; import { isSafetyNumberNotAvailable } from '../util/isSafetyNumberNotAvailable'; import { Modal } from './Modal'; import type { PropsType as SafetyNumberViewerPropsType } from './SafetyNumberViewer'; import { SafetyNumberViewer } from './SafetyNumberViewer'; -import { SafetyNumberOnboarding } from './SafetyNumberOnboarding'; import { SafetyNumberNotReady } from './SafetyNumberNotReady'; type PropsType = { toggleSafetyNumberModal: () => unknown; - hasCompletedSafetyNumberOnboarding: boolean; - markHasCompletedSafetyNumberOnboarding: () => unknown; } & Omit; export function SafetyNumberModal({ i18n, toggleSafetyNumberModal, - hasCompletedSafetyNumberOnboarding, - markHasCompletedSafetyNumberOnboarding, ...safetyNumberViewerProps }: PropsType): JSX.Element | null { const { contact } = safetyNumberViewerProps; - const [isOnboarding, setIsOnboarding] = useState( - !hasCompletedSafetyNumberOnboarding - ); - - const showOnboarding = useCallback(() => { - setIsOnboarding(true); - }, [setIsOnboarding]); - - const hideOnboarding = useCallback(() => { - setIsOnboarding(false); - markHasCompletedSafetyNumberOnboarding(); - }, [setIsOnboarding, markHasCompletedSafetyNumberOnboarding]); - let title: string | undefined; let content: JSX.Element; let hasXButton = true; @@ -49,8 +31,6 @@ export function SafetyNumberModal({ /> ); hasXButton = false; - } else if (isOnboarding) { - content = ; } else { title = i18n('icu:SafetyNumberModal__title'); @@ -58,7 +38,6 @@ export function SafetyNumberModal({ ); diff --git a/ts/components/SafetyNumberNotReady.tsx b/ts/components/SafetyNumberNotReady.tsx index 5b15caf3b125..5558520e6938 100644 --- a/ts/components/SafetyNumberNotReady.tsx +++ b/ts/components/SafetyNumberNotReady.tsx @@ -8,7 +8,7 @@ import { Modal } from './Modal'; import { Intl } from './Intl'; import { openLinkInWebBrowser } from '../util/openLinkInWebBrowser'; import type { LocalizerType } from '../types/Util'; -import { SAFETY_NUMBER_MIGRATION_URL } from '../types/support'; +import { SAFETY_NUMBER_URL } from '../types/support'; export type PropsType = { i18n: LocalizerType; @@ -16,7 +16,7 @@ export type PropsType = { }; function onLearnMore() { - openLinkInWebBrowser(SAFETY_NUMBER_MIGRATION_URL); + openLinkInWebBrowser(SAFETY_NUMBER_URL); } export function SafetyNumberNotReady({ diff --git a/ts/components/SafetyNumberOnboarding.stories.tsx b/ts/components/SafetyNumberOnboarding.stories.tsx deleted file mode 100644 index 0d81fb3535aa..000000000000 --- a/ts/components/SafetyNumberOnboarding.stories.tsx +++ /dev/null @@ -1,20 +0,0 @@ -// Copyright 2023 Signal Messenger, LLC -// SPDX-License-Identifier: AGPL-3.0-only - -import * as React from 'react'; -import { action } from '@storybook/addon-actions'; -import type { Meta } from '@storybook/react'; -import type { PropsType } from './SafetyNumberOnboarding'; -import { SafetyNumberOnboarding } from './SafetyNumberOnboarding'; -import { setupI18n } from '../util/setupI18n'; -import enMessages from '../../_locales/en/messages.json'; - -const i18n = setupI18n('en', enMessages); - -export default { - title: 'Components/SafetyNumberOnboarding', -} satisfies Meta; - -export function Default(): JSX.Element { - return ; -} diff --git a/ts/components/SafetyNumberOnboarding.tsx b/ts/components/SafetyNumberOnboarding.tsx deleted file mode 100644 index fe7bd4329e0b..000000000000 --- a/ts/components/SafetyNumberOnboarding.tsx +++ /dev/null @@ -1,78 +0,0 @@ -// Copyright 2023 Signal Messenger, LLC -// SPDX-License-Identifier: AGPL-3.0-only - -import React, { useCallback, useRef } from 'react'; -import Lottie from 'lottie-react'; -import type { LottieRefCurrentProps } from 'lottie-react'; - -import { Button, ButtonVariant } from './Button'; -import { Intl } from './Intl'; -import type { LocalizerType } from '../types/Util'; -import { SAFETY_NUMBER_MIGRATION_URL } from '../types/support'; -import { useReducedMotion } from '../hooks/useReducedMotion'; -import animationData from '../../images/safety-number-onboarding.json'; -import reducedAnimationData from '../../images/safety-number-onboarding-reduced-motion.json'; - -export type PropsType = { - i18n: LocalizerType; - onClose: () => void; -}; - -export function SafetyNumberOnboarding({ - i18n, - onClose, -}: PropsType): JSX.Element | null { - const isMotionReduced = useReducedMotion(); - const lottieRef = useRef(null); - - const onDOMLoaded = useCallback(() => { - if (isMotionReduced) { - lottieRef.current?.goToAndPlay(0); - return; - } - - lottieRef.current?.playSegments( - [ - [0, 360], - [60, 360], - ], - true - ); - }, [isMotionReduced]); - - return ( -
-

- -

-

- -

-

- -

- -
- - - -
- -
- ); -} diff --git a/ts/components/SafetyNumberViewer.stories.tsx b/ts/components/SafetyNumberViewer.stories.tsx index 1335a6cf275e..258691e75f17 100644 --- a/ts/components/SafetyNumberViewer.stories.tsx +++ b/ts/components/SafetyNumberViewer.stories.tsx @@ -7,7 +7,6 @@ import type { Meta } from '@storybook/react'; import type { PropsType } from './SafetyNumberViewer'; import { SafetyNumberViewer } from './SafetyNumberViewer'; import { setupI18n } from '../util/setupI18n'; -import { SafetyNumberIdentifierType } from '../types/safetyNumber'; import enMessages from '../../_locales/en/messages.json'; import { getDefaultConversation } from '../test-both/helpers/getDefaultConversation'; @@ -69,13 +68,13 @@ const createProps = (overrideProps: Partial = {}): PropsType => ({ contact: overrideProps.contact || contactWithAllData, generateSafetyNumber: action('generate-safety-number'), i18n, - safetyNumbers: overrideProps.safetyNumbers ?? [ - { - identifierType: SafetyNumberIdentifierType.ACIIdentifier, - numberBlocks: generateNumberBlocks(), - qrData: generateQRData(), - }, - ], + safetyNumber: + 'safetyNumber' in overrideProps + ? overrideProps.safetyNumber + : { + numberBlocks: generateNumberBlocks(), + qrData: generateQRData(), + }, toggleVerified: action('toggle-verified'), verificationDisabled: overrideProps.verificationDisabled !== undefined @@ -92,27 +91,6 @@ export function SafetyNumber(): JSX.Element { return ; } -export function SafetyNumberE164Transition(): JSX.Element { - return ( - - ); -} - export function SafetyNumberNotVerified(): JSX.Element { return ( ); diff --git a/ts/components/SafetyNumberViewer.tsx b/ts/components/SafetyNumberViewer.tsx index 68cb24c04412..03f8b3198575 100644 --- a/ts/components/SafetyNumberViewer.tsx +++ b/ts/components/SafetyNumberViewer.tsx @@ -1,8 +1,7 @@ // Copyright 2020 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import React, { useState, useCallback } from 'react'; -import classNames from 'classnames'; +import React from 'react'; import { Button, ButtonVariant } from './Button'; import { QrCode } from './QrCode'; @@ -11,18 +10,15 @@ import { Intl } from './Intl'; import { Emojify } from './conversation/Emojify'; import type { LocalizerType } from '../types/Util'; import type { SafetyNumberType } from '../types/safetyNumber'; -import { SAFETY_NUMBER_MIGRATION_URL } from '../types/support'; -import { SafetyNumberIdentifierType } from '../types/safetyNumber'; -import { arrow } from '../util/keyboard'; +import { SAFETY_NUMBER_URL } from '../types/support'; export type PropsType = { contact: ConversationType; generateSafetyNumber: (contact: ConversationType) => void; i18n: LocalizerType; onClose: () => void; - safetyNumbers?: ReadonlyArray; + safetyNumber?: SafetyNumberType; toggleVerified: (contact: ConversationType) => void; - showOnboarding?: () => void; verificationDisabled: boolean; }; @@ -31,12 +27,10 @@ export function SafetyNumberViewer({ generateSafetyNumber, i18n, onClose, - safetyNumbers, + safetyNumber, toggleVerified, - showOnboarding, verificationDisabled, }: PropsType): JSX.Element | null { - const hasSafetyNumbers = safetyNumbers != null; React.useEffect(() => { if (!contact) { return; @@ -47,42 +41,11 @@ export function SafetyNumberViewer({ // Keyboard navigation - const [selectedIndex, setSelectedIndex] = useState(0); - - const selectPrevNumber = useCallback(() => { - setSelectedIndex(x => Math.max(x - 1, 0)); - }, []); - - const selectNextNumber = useCallback(() => { - if (!safetyNumbers || safetyNumbers.length === 0) { - setSelectedIndex(0); - return; - } - setSelectedIndex(x => Math.min(x + 1, safetyNumbers.length - 1)); - }, [safetyNumbers]); - - React.useEffect(() => { - const handleKeyDown = (ev: KeyboardEvent) => { - if (ev.key === arrow('start')) { - selectPrevNumber(); - } - - if (ev.key === arrow('end')) { - selectNextNumber(); - } - }; - document.addEventListener('keydown', handleKeyDown); - - return () => { - document.removeEventListener('keydown', handleKeyDown); - }; - }, [selectPrevNumber, selectNextNumber]); - - if (!contact || !hasSafetyNumbers) { + if (!contact) { return null; } - if (!safetyNumbers.length) { + if (!safetyNumber) { return (
{i18n('icu:cannotGenerateSafetyNumber')}
@@ -110,121 +73,36 @@ export function SafetyNumberViewer({ ? i18n('icu:SafetyNumberViewer__clearVerification') : i18n('icu:SafetyNumberViewer__markAsVerified'); - const visibleSafetyNumber = safetyNumbers.at(selectedIndex); - if (!visibleSafetyNumber) { - return null; - } - - const cardClassName = classNames('module-SafetyNumberViewer__card', { - 'module-SafetyNumberViewer__card--aci': - visibleSafetyNumber.identifierType === - SafetyNumberIdentifierType.ACIIdentifier, - 'module-SafetyNumberViewer__card--e164': - visibleSafetyNumber.identifierType === - SafetyNumberIdentifierType.E164Identifier, - }); - - const numberBlocks = visibleSafetyNumber.numberBlocks.join(' '); + const numberBlocks = safetyNumber.numberBlocks.join(' '); const safetyNumberCard = (
-
+
{numberBlocks}
- - {selectedIndex > 0 && ( -
); - const carousel = ( -
- {safetyNumbers.map(({ identifierType }, index) => { - return ( -
- ); - return (
-
- - {safetyNumberCard} - {safetyNumbers.length > 1 && carousel} - diff --git a/ts/state/ducks/items.ts b/ts/state/ducks/items.ts index 787f7fee745e..b4bbe81a5514 100644 --- a/ts/state/ducks/items.ts +++ b/ts/state/ducks/items.ts @@ -85,7 +85,6 @@ export type ItemsActionType = ReadonlyDeep< export const actions = { addCustomColor, editCustomColor, - markHasCompletedSafetyNumberOnboarding, removeCustomColor, resetDefaultChatColor, savePreferredLeftPaneWidth, @@ -283,17 +282,6 @@ function savePreferredLeftPaneWidth( }; } -function markHasCompletedSafetyNumberOnboarding(): ThunkAction< - void, - RootStateType, - unknown, - ItemPutAction -> { - return dispatch => { - dispatch(putItem('hasCompletedSafetyNumberOnboarding', true)); - }; -} - function toggleNavTabsCollapse( navTabsCollapsed: boolean ): ThunkAction { diff --git a/ts/state/ducks/safetyNumber.ts b/ts/state/ducks/safetyNumber.ts index 25a33dce30f7..08be9113a5c0 100644 --- a/ts/state/ducks/safetyNumber.ts +++ b/ts/state/ducks/safetyNumber.ts @@ -5,7 +5,7 @@ import type { ReadonlyDeep } from 'type-fest'; import type { ThunkAction } from 'redux-thunk'; import { omit } from 'lodash'; -import { generateSafetyNumbers } from '../../util/safetyNumber'; +import { generateSafetyNumber } from '../../util/safetyNumber'; import type { SafetyNumberType } from '../../types/safetyNumber'; import type { ConversationType } from './conversations'; import { @@ -17,7 +17,7 @@ import * as Errors from '../../types/errors'; import type { StateType as RootStateType } from '../reducer'; export type SafetyNumberContactType = ReadonlyDeep<{ - safetyNumbers: ReadonlyArray; + safetyNumber: SafetyNumberType; safetyNumberChanged?: boolean; verificationDisabled: boolean; }>; @@ -44,7 +44,7 @@ type GenerateFulfilledActionType = ReadonlyDeep<{ type: 'safetyNumber/GENERATE_FULFILLED'; payload: { contact: ConversationType; - safetyNumbers: ReadonlyArray; + safetyNumber: SafetyNumberType; }; }>; @@ -59,7 +59,7 @@ type ToggleVerifiedFulfilledActionType = ReadonlyDeep<{ type: 'safetyNumber/TOGGLE_VERIFIED_FULFILLED'; payload: { contact: ConversationType; - safetyNumbers?: ReadonlyArray; + safetyNumber?: SafetyNumberType; safetyNumberChanged?: boolean; }; }>; @@ -83,12 +83,12 @@ function generate( ): ThunkAction { return async dispatch => { try { - const safetyNumbers = await generateSafetyNumbers(contact); + const safetyNumber = await generateSafetyNumber(contact); dispatch({ type: GENERATE_FULFILLED, payload: { contact, - safetyNumbers, + safetyNumber, }, }); } catch (error) { @@ -128,13 +128,13 @@ function toggleVerified( } catch (err) { if (err.name === 'OutgoingIdentityKeyError') { await reloadProfiles(contact.id); - const safetyNumbers = await generateSafetyNumbers(contact); + const safetyNumber = await generateSafetyNumber(contact); dispatch({ type: TOGGLE_VERIFIED_FULFILLED, payload: { contact, - safetyNumbers, + safetyNumber, safetyNumberChanged: true, }, }); @@ -224,7 +224,7 @@ export function reducer( } if (action.type === GENERATE_FULFILLED) { - const { contact, safetyNumbers } = action.payload; + const { contact, safetyNumber } = action.payload; const { id } = contact; const record = state.contacts[id]; return { @@ -232,7 +232,7 @@ export function reducer( ...state.contacts, [id]: { ...record, - safetyNumbers, + safetyNumber, }, }, }; diff --git a/ts/state/selectors/items.ts b/ts/state/selectors/items.ts index 5979f5597fc4..e1ed9a2cb9a9 100644 --- a/ts/state/selectors/items.ts +++ b/ts/state/selectors/items.ts @@ -93,12 +93,6 @@ export const getHasCompletedUsernameLinkOnboarding = createSelector( Boolean(state.hasCompletedUsernameLinkOnboarding) ); -export const getHasCompletedSafetyNumberOnboarding = createSelector( - getItems, - (state: ItemsStateType): boolean => - Boolean(state.hasCompletedSafetyNumberOnboarding) -); - export const getUsernameLinkColor = createSelector( getItems, (state: ItemsStateType): number | undefined => state.usernameLinkColor diff --git a/ts/state/smart/SafetyNumberModal.tsx b/ts/state/smart/SafetyNumberModal.tsx index 4da978e492df..728adcb62354 100644 --- a/ts/state/smart/SafetyNumberModal.tsx +++ b/ts/state/smart/SafetyNumberModal.tsx @@ -7,7 +7,6 @@ import { SafetyNumberModal } from '../../components/SafetyNumberModal'; import type { StateType } from '../reducer'; import { getContactSafetyNumber } from '../selectors/safetyNumber'; import { getConversationSelector } from '../selectors/conversations'; -import { getHasCompletedSafetyNumberOnboarding } from '../selectors/items'; import { getIntl } from '../selectors/user'; export type Props = { @@ -19,8 +18,6 @@ const mapStateToProps = (state: StateType, props: Props) => { ...props, ...getContactSafetyNumber(state, props), contact: getConversationSelector(state)(props.contactID), - hasCompletedSafetyNumberOnboarding: - getHasCompletedSafetyNumberOnboarding(state), i18n: getIntl(state), }; }; diff --git a/ts/types/safetyNumber.ts b/ts/types/safetyNumber.ts index 2fb091ade0e7..55f164f0658d 100644 --- a/ts/types/safetyNumber.ts +++ b/ts/types/safetyNumber.ts @@ -1,13 +1,7 @@ // Copyright 2023 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -export enum SafetyNumberIdentifierType { - ACIIdentifier = 'ACIIdentifier', - E164Identifier = 'E164Identifier', -} - export type SafetyNumberType = Readonly<{ - identifierType: SafetyNumberIdentifierType; numberBlocks: ReadonlyArray; qrData: Uint8Array; }>; diff --git a/ts/types/support.ts b/ts/types/support.ts index 3400ae72330b..6470591816bf 100644 --- a/ts/types/support.ts +++ b/ts/types/support.ts @@ -7,5 +7,5 @@ export const UNSUPPORTED_OS_URL = 'https://support.signal.org/hc/articles/5109141421850'; export const LINK_SIGNAL_DESKTOP = 'https://support.signal.org/hc/articles/360007320451#desktop_multiple_device'; -export const SAFETY_NUMBER_MIGRATION_URL = - 'https://support.signal.org/hc/en-us/articles/360007060632'; +export const SAFETY_NUMBER_URL = + 'https://support.signal.org/hc/articles/360007060632'; diff --git a/ts/util/lint/exceptions.json b/ts/util/lint/exceptions.json index 73c266bf1c5e..3043a4652396 100644 --- a/ts/util/lint/exceptions.json +++ b/ts/util/lint/exceptions.json @@ -15,6 +15,88 @@ "updated": "2018-09-18T19:19:27.699Z", "reasonDetail": "Part of runtime library for C++ transpiled code" }, + { + "rule": "React-useRef", + "path": "node_modules/@floating-ui/react-dom/dist/floating-ui.react-dom.esm.js", + "line": " const ref = React.useRef(value);", + "reasonCategory": "usageTrusted", + "updated": "2023-10-03T18:55:06.301Z" + }, + { + "rule": "React-useRef", + "path": "node_modules/@floating-ui/react-dom/dist/floating-ui.react-dom.esm.js", + "line": " const referenceRef = React.useRef(null);", + "reasonCategory": "usageTrusted", + "updated": "2023-10-03T18:55:06.301Z" + }, + { + "rule": "React-useRef", + "path": "node_modules/@floating-ui/react-dom/dist/floating-ui.react-dom.esm.js", + "line": " const floatingRef = React.useRef(null);", + "reasonCategory": "usageTrusted", + "updated": "2023-10-03T18:55:06.301Z" + }, + { + "rule": "React-useRef", + "path": "node_modules/@floating-ui/react-dom/dist/floating-ui.react-dom.esm.js", + "line": " const dataRef = React.useRef(data);", + "reasonCategory": "usageTrusted", + "updated": "2023-10-03T18:55:06.301Z" + }, + { + "rule": "React-useRef", + "path": "node_modules/@floating-ui/react-dom/dist/floating-ui.react-dom.esm.js", + "line": " const isMountedRef = React.useRef(false);", + "reasonCategory": "usageTrusted", + "updated": "2023-10-03T18:55:06.301Z" + }, + { + "rule": "React-useRef", + "path": "node_modules/@floating-ui/react-dom/dist/floating-ui.react-dom.esm.min.js", + "reasonCategory": "usageTrusted", + "updated": "2023-10-03T18:55:06.301Z" + }, + { + "rule": "React-useRef", + "path": "node_modules/@floating-ui/react-dom/dist/floating-ui.react-dom.umd.js", + "line": " const ref = React__namespace.useRef(value);", + "reasonCategory": "usageTrusted", + "updated": "2023-10-03T18:55:06.301Z" + }, + { + "rule": "React-useRef", + "path": "node_modules/@floating-ui/react-dom/dist/floating-ui.react-dom.umd.js", + "line": " const referenceRef = React__namespace.useRef(null);", + "reasonCategory": "usageTrusted", + "updated": "2023-10-03T18:55:06.301Z" + }, + { + "rule": "React-useRef", + "path": "node_modules/@floating-ui/react-dom/dist/floating-ui.react-dom.umd.js", + "line": " const floatingRef = React__namespace.useRef(null);", + "reasonCategory": "usageTrusted", + "updated": "2023-10-03T18:55:06.301Z" + }, + { + "rule": "React-useRef", + "path": "node_modules/@floating-ui/react-dom/dist/floating-ui.react-dom.umd.js", + "line": " const dataRef = React__namespace.useRef(data);", + "reasonCategory": "usageTrusted", + "updated": "2023-10-03T18:55:06.301Z" + }, + { + "rule": "React-useRef", + "path": "node_modules/@floating-ui/react-dom/dist/floating-ui.react-dom.umd.js", + "line": " const isMountedRef = React__namespace.useRef(false);", + "reasonCategory": "usageTrusted", + "updated": "2023-10-03T18:55:06.301Z" + }, + { + "rule": "React-useRef", + "path": "node_modules/@floating-ui/react-dom/dist/floating-ui.react-dom.umd.min.js", + "reasonCategory": "usageTrusted", + "updated": "2023-10-03T18:55:06.301Z" + }, { "rule": "React-createRef", "path": "node_modules/@indutny/frameless-titlebar/dist/index.es.js", @@ -604,6 +686,13 @@ "reasonCategory": "falseMatch", "updated": "2022-06-23T23:21:04.555Z" }, + { + "rule": "DOM-innerHTML", + "path": "node_modules/@testing-library/dom/dist/@testing-library/dom.cjs.js", + "line": " const playgroundUrl = getPlaygroundUrl(element.innerHTML);", + "reasonCategory": "usageTrusted", + "updated": "2023-10-03T18:55:06.301Z" + }, { "rule": "DOM-outerHTML", "path": "node_modules/@testing-library/dom/dist/@testing-library/dom.cjs.js", @@ -632,6 +721,13 @@ "reasonCategory": "falseMatch", "updated": "2022-06-23T23:21:04.555Z" }, + { + "rule": "DOM-innerHTML", + "path": "node_modules/@testing-library/dom/dist/@testing-library/dom.esm.js", + "line": " const playgroundUrl = getPlaygroundUrl(element.innerHTML);", + "reasonCategory": "usageTrusted", + "updated": "2023-10-03T18:55:06.301Z" + }, { "rule": "DOM-outerHTML", "path": "node_modules/@testing-library/dom/dist/@testing-library/dom.esm.js", @@ -660,6 +756,13 @@ "reasonCategory": "falseMatch", "updated": "2022-06-23T23:21:04.555Z" }, + { + "rule": "DOM-innerHTML", + "path": "node_modules/@testing-library/dom/dist/@testing-library/dom.umd.js", + "line": "\t const playgroundUrl = getPlaygroundUrl(element.innerHTML);", + "reasonCategory": "usageTrusted", + "updated": "2023-10-03T18:55:06.301Z" + }, { "rule": "DOM-outerHTML", "path": "node_modules/@testing-library/dom/dist/@testing-library/dom.umd.js", @@ -714,27 +817,6 @@ "reasonCategory": "testCode", "updated": "2022-06-23T23:21:04.555Z" }, - { - "rule": "DOM-innerHTML", - "path": "node_modules/@testing-library/dom/dist/@testing-library/dom.cjs.js", - "line": " const playgroundUrl = getPlaygroundUrl(element.innerHTML);", - "reasonCategory": "usageTrusted", - "updated": "2023-10-03T18:55:06.301Z" - }, - { - "rule": "DOM-innerHTML", - "path": "node_modules/@testing-library/dom/dist/@testing-library/dom.esm.js", - "line": " const playgroundUrl = getPlaygroundUrl(element.innerHTML);", - "reasonCategory": "usageTrusted", - "updated": "2023-10-03T18:55:06.301Z" - }, - { - "rule": "DOM-innerHTML", - "path": "node_modules/@testing-library/dom/dist/@testing-library/dom.umd.js", - "line": "\t const playgroundUrl = getPlaygroundUrl(element.innerHTML);", - "reasonCategory": "usageTrusted", - "updated": "2023-10-03T18:55:06.301Z" - }, { "rule": "DOM-innerHTML", "path": "node_modules/@testing-library/dom/dist/screen.js", @@ -908,88 +990,6 @@ "reasonCategory": "usageTrusted", "updated": "2023-10-03T18:55:06.301Z" }, - { - "rule": "React-useRef", - "path": "node_modules/@floating-ui/react-dom/dist/floating-ui.react-dom.esm.js", - "line": " const ref = React.useRef(value);", - "reasonCategory": "usageTrusted", - "updated": "2023-10-03T18:55:06.301Z" - }, - { - "rule": "React-useRef", - "path": "node_modules/@floating-ui/react-dom/dist/floating-ui.react-dom.esm.js", - "line": " const referenceRef = React.useRef(null);", - "reasonCategory": "usageTrusted", - "updated": "2023-10-03T18:55:06.301Z" - }, - { - "rule": "React-useRef", - "path": "node_modules/@floating-ui/react-dom/dist/floating-ui.react-dom.esm.js", - "line": " const floatingRef = React.useRef(null);", - "reasonCategory": "usageTrusted", - "updated": "2023-10-03T18:55:06.301Z" - }, - { - "rule": "React-useRef", - "path": "node_modules/@floating-ui/react-dom/dist/floating-ui.react-dom.esm.js", - "line": " const dataRef = React.useRef(data);", - "reasonCategory": "usageTrusted", - "updated": "2023-10-03T18:55:06.301Z" - }, - { - "rule": "React-useRef", - "path": "node_modules/@floating-ui/react-dom/dist/floating-ui.react-dom.esm.js", - "line": " const isMountedRef = React.useRef(false);", - "reasonCategory": "usageTrusted", - "updated": "2023-10-03T18:55:06.301Z" - }, - { - "rule": "React-useRef", - "path": "node_modules/@floating-ui/react-dom/dist/floating-ui.react-dom.esm.min.js", - "reasonCategory": "usageTrusted", - "updated": "2023-10-03T18:55:06.301Z" - }, - { - "rule": "React-useRef", - "path": "node_modules/@floating-ui/react-dom/dist/floating-ui.react-dom.umd.js", - "line": " const ref = React__namespace.useRef(value);", - "reasonCategory": "usageTrusted", - "updated": "2023-10-03T18:55:06.301Z" - }, - { - "rule": "React-useRef", - "path": "node_modules/@floating-ui/react-dom/dist/floating-ui.react-dom.umd.js", - "line": " const referenceRef = React__namespace.useRef(null);", - "reasonCategory": "usageTrusted", - "updated": "2023-10-03T18:55:06.301Z" - }, - { - "rule": "React-useRef", - "path": "node_modules/@floating-ui/react-dom/dist/floating-ui.react-dom.umd.js", - "line": " const floatingRef = React__namespace.useRef(null);", - "reasonCategory": "usageTrusted", - "updated": "2023-10-03T18:55:06.301Z" - }, - { - "rule": "React-useRef", - "path": "node_modules/@floating-ui/react-dom/dist/floating-ui.react-dom.umd.js", - "line": " const dataRef = React__namespace.useRef(data);", - "reasonCategory": "usageTrusted", - "updated": "2023-10-03T18:55:06.301Z" - }, - { - "rule": "React-useRef", - "path": "node_modules/@floating-ui/react-dom/dist/floating-ui.react-dom.umd.js", - "line": " const isMountedRef = React__namespace.useRef(false);", - "reasonCategory": "usageTrusted", - "updated": "2023-10-03T18:55:06.301Z" - }, - { - "rule": "React-useRef", - "path": "node_modules/@floating-ui/react-dom/dist/floating-ui.react-dom.umd.min.js", - "reasonCategory": "usageTrusted", - "updated": "2023-10-03T18:55:06.301Z" - }, { "rule": "React-findDOMNode", "path": "node_modules/focus-trap-react/dist/focus-trap-react.js", @@ -1077,190 +1077,6 @@ "updated": "2022-07-26T23:41:36.800Z", "reasonDetail": "Part of keyword list for preservation in final minified build" }, - { - "rule": "DOM-innerHTML", - "path": "node_modules/tocbot/dist/tocbot.js", - "line": " tocElement.innerHTML = ''", - "reasonCategory": "notExercisedByOurApp", - "updated": "2023-10-03T18:55:06.301Z" - }, - { - "rule": "DOM-innerHTML", - "path": "node_modules/tocbot/dist/tocbot.min.js", - "reasonCategory": "notExercisedByOurApp", - "updated": "2023-10-03T18:55:06.301Z" - }, - { - "rule": "DOM-innerHTML", - "path": "node_modules/tocbot/out/_next/static/chunks/253-af2be75f8688092d.js", - "reasonCategory": "notExercisedByOurApp", - "updated": "2023-10-03T18:55:06.301Z" - }, - { - "rule": "React-dangerouslySetInnerHTML", - "path": "node_modules/tocbot/out/_next/static/chunks/253-af2be75f8688092d.js", - "reasonCategory": "notExercisedByOurApp", - "updated": "2023-10-03T18:55:06.301Z" - }, - { - "rule": "React-ref", - "path": "node_modules/tocbot/out/_next/static/chunks/684-c4d85164cfbebace.js", - "reasonCategory": "notExercisedByOurApp", - "updated": "2023-10-03T18:55:06.301Z" - }, - { - "rule": "React-useRef", - "path": "node_modules/tocbot/out/_next/static/chunks/684-c4d85164cfbebace.js", - "reasonCategory": "notExercisedByOurApp", - "updated": "2023-10-03T18:55:06.301Z" - }, - { - "rule": "React-dangerouslySetInnerHTML", - "path": "node_modules/tocbot/out/_next/static/chunks/894.d8d3be35b7c84b33.js", - "reasonCategory": "notExercisedByOurApp", - "updated": "2023-10-03T18:55:06.301Z" - }, - { - "rule": "React-ref", - "path": "node_modules/tocbot/out/_next/static/chunks/894.d8d3be35b7c84b33.js", - "reasonCategory": "notExercisedByOurApp", - "updated": "2023-10-03T18:55:06.301Z" - }, - { - "rule": "DOM-innerHTML", - "path": "node_modules/tocbot/out/_next/static/chunks/framework-3911a61406e859ea.js", - "reasonCategory": "notExercisedByOurApp", - "updated": "2023-10-03T18:55:06.301Z" - }, - { - "rule": "React-dangerouslySetInnerHTML", - "path": "node_modules/tocbot/out/_next/static/chunks/framework-3911a61406e859ea.js", - "reasonCategory": "notExercisedByOurApp", - "updated": "2023-10-03T18:55:06.301Z" - }, - { - "rule": "React-ref", - "path": "node_modules/tocbot/out/_next/static/chunks/framework-3911a61406e859ea.js", - "reasonCategory": "notExercisedByOurApp", - "updated": "2023-10-03T18:55:06.301Z" - }, - { - "rule": "React-useRef", - "path": "node_modules/tocbot/out/_next/static/chunks/framework-3911a61406e859ea.js", - "reasonCategory": "notExercisedByOurApp", - "updated": "2023-10-03T18:55:06.301Z" - }, - { - "rule": "DOM-innerHTML", - "path": "node_modules/tocbot/out/_next/static/chunks/main-292648d00afc3512.js", - "reasonCategory": "notExercisedByOurApp", - "updated": "2023-10-03T18:55:06.301Z" - }, - { - "rule": "React-dangerouslySetInnerHTML", - "path": "node_modules/tocbot/out/_next/static/chunks/main-292648d00afc3512.js", - "reasonCategory": "notExercisedByOurApp", - "updated": "2023-10-03T18:55:06.301Z" - }, - { - "rule": "React-ref", - "path": "node_modules/tocbot/out/_next/static/chunks/main-292648d00afc3512.js", - "reasonCategory": "notExercisedByOurApp", - "updated": "2023-10-03T18:55:06.301Z" - }, - { - "rule": "React-useRef", - "path": "node_modules/tocbot/out/_next/static/chunks/main-292648d00afc3512.js", - "reasonCategory": "notExercisedByOurApp", - "updated": "2023-10-03T18:55:06.301Z" - }, - { - "rule": "React-dangerouslySetInnerHTML", - "path": "node_modules/tocbot/out/_next/static/chunks/pages/_error-b0eae765db80170a.js", - "reasonCategory": "notExercisedByOurApp", - "updated": "2023-10-03T18:55:06.301Z" - }, - { - "rule": "React-ref", - "path": "node_modules/tocbot/out/_next/static/chunks/pages/_error-b0eae765db80170a.js", - "reasonCategory": "notExercisedByOurApp", - "updated": "2023-10-03T18:55:06.301Z" - }, - { - "rule": "DOM-innerHTML", - "path": "node_modules/tocbot/out/static/js/tocbot.js", - "line": " tocElement.innerHTML = ''", - "reasonCategory": "notExercisedByOurApp", - "updated": "2023-10-03T18:55:06.301Z" - }, - { - "rule": "DOM-innerHTML", - "path": "node_modules/tocbot/out/static/js/tocbot.min.js", - "reasonCategory": "notExercisedByOurApp", - "updated": "2023-10-03T18:55:06.301Z" - }, - { - "rule": "React-dangerouslySetInnerHTML", - "path": "node_modules/tocbot/src/components/Template/Tracking/index.js", - "line": "