diff --git a/src/components/common/copyable/copy-to-clipboard-button/copy-to-clipboard-button.tsx b/src/components/common/copyable/copy-to-clipboard-button/copy-to-clipboard-button.tsx index bd8c3a3c5..d891f982b 100644 --- a/src/components/common/copyable/copy-to-clipboard-button/copy-to-clipboard-button.tsx +++ b/src/components/common/copyable/copy-to-clipboard-button/copy-to-clipboard-button.tsx @@ -44,7 +44,7 @@ export const CopyToClipboardButton: React.FC = ({ ref={button} size={size} variant={variant} - title={t('renderer.highlightCode.copyCode')} + title={t('renderer.highlightCode.copyCode') ?? undefined} onClick={copyToClipboard} {...cypressId(props)}> diff --git a/src/components/common/fields/current-password-field.tsx b/src/components/common/fields/current-password-field.tsx index 8d4a0ba7d..07647a345 100644 --- a/src/components/common/fields/current-password-field.tsx +++ b/src/components/common/fields/current-password-field.tsx @@ -26,7 +26,7 @@ export const CurrentPasswordField: React.FC = ({ onChange }) = type='password' size='sm' onChange={onChange} - placeholder={t('login.auth.password')} + placeholder={t('login.auth.password') ?? undefined} className='bg-dark text-light' autoComplete='current-password' required diff --git a/src/components/common/fields/display-name-field.tsx b/src/components/common/fields/display-name-field.tsx index d59c3be33..4fd7a177c 100644 --- a/src/components/common/fields/display-name-field.tsx +++ b/src/components/common/fields/display-name-field.tsx @@ -38,7 +38,7 @@ export const DisplayNameField: React.FC = ({ onChange, va value={value} isValid={isValid} onChange={onChange} - placeholder={t('profile.displayName')} + placeholder={t('profile.displayName') ?? undefined} className='bg-dark text-light' autoComplete='name' required diff --git a/src/components/common/fields/new-password-field.tsx b/src/components/common/fields/new-password-field.tsx index 911c46077..c8f156939 100644 --- a/src/components/common/fields/new-password-field.tsx +++ b/src/components/common/fields/new-password-field.tsx @@ -32,7 +32,7 @@ export const NewPasswordField: React.FC = ({ onChange, value } size='sm' isValid={isValid} onChange={onChange} - placeholder={t('login.auth.password')} + placeholder={t('login.auth.password') ?? undefined} className='bg-dark text-light' minLength={8} autoComplete='new-password' diff --git a/src/components/common/fields/password-again-field.tsx b/src/components/common/fields/password-again-field.tsx index 2e4e33068..e98e72daf 100644 --- a/src/components/common/fields/password-again-field.tsx +++ b/src/components/common/fields/password-again-field.tsx @@ -42,7 +42,7 @@ export const PasswordAgainField: React.FC = ({ onChange isInvalid={isInvalid} isValid={isValid} onChange={onChange} - placeholder={t('login.register.passwordAgain')} + placeholder={t('login.register.passwordAgain') ?? undefined} className='bg-dark text-light' autoComplete='new-password' required diff --git a/src/components/common/fields/username-field.tsx b/src/components/common/fields/username-field.tsx index 22c50123d..ff28cb6f1 100644 --- a/src/components/common/fields/username-field.tsx +++ b/src/components/common/fields/username-field.tsx @@ -33,7 +33,7 @@ export const UsernameField: React.FC = ({ onChange, value }) = value={value} isValid={isValid} onChange={onChange} - placeholder={t('login.auth.username')} + placeholder={t('login.auth.username') ?? undefined} className='bg-dark text-light' autoComplete='username' autoFocus={true} diff --git a/src/components/document-read-only-page/document-infobar.tsx b/src/components/document-read-only-page/document-infobar.tsx index ea7ad2525..06b3753e4 100644 --- a/src/components/document-read-only-page/document-infobar.tsx +++ b/src/components/document-read-only-page/document-infobar.tsx @@ -37,7 +37,7 @@ export const DocumentInfobar: React.FC = () => { href={`/n/${noteDetails.primaryAddress}`} icon={'pencil'} className={'text-primary text-decoration-none mx-1'} - title={t('views.readOnly.editNote')} + title={t('views.readOnly.editNote') ?? undefined} /> diff --git a/src/components/editor-page/app-bar/dark-mode-button.tsx b/src/components/editor-page/app-bar/dark-mode-button.tsx index 595d55915..5fddd8373 100644 --- a/src/components/editor-page/app-bar/dark-mode-button.tsx +++ b/src/components/editor-page/app-bar/dark-mode-button.tsx @@ -26,13 +26,13 @@ const DarkModeButton: React.FC = () => { diff --git a/src/components/editor-page/app-bar/help-button/help-button.tsx b/src/components/editor-page/app-bar/help-button/help-button.tsx index 7331de031..2f784896d 100644 --- a/src/components/editor-page/app-bar/help-button/help-button.tsx +++ b/src/components/editor-page/app-bar/help-button/help-button.tsx @@ -23,7 +23,7 @@ export const HelpButton: React.FC = () => { diff --git a/src/components/editor-page/document-bar/aliases/aliases-add-form.tsx b/src/components/editor-page/document-bar/aliases/aliases-add-form.tsx index 3b0725917..1d302dcc0 100644 --- a/src/components/editor-page/document-bar/aliases/aliases-add-form.tsx +++ b/src/components/editor-page/document-bar/aliases/aliases-add-form.tsx @@ -3,8 +3,8 @@ * * SPDX-License-Identifier: AGPL-3.0-only */ -import React, { useCallback, useMemo, useState } from 'react' import type { FormEvent } from 'react' +import React, { useCallback, useMemo, useState } from 'react' import { Button, Form, InputGroup } from 'react-bootstrap' import { ForkAwesomeIcon } from '../../../common/fork-awesome/fork-awesome-icon' import { useTranslation } from 'react-i18next' @@ -50,7 +50,7 @@ export const AliasesAddForm: React.FC = () => { { variant='light' className={'text-secondary ms-2'} disabled={!newAliasValid || newAlias === ''} - title={t('editor.modal.aliases.addAlias')} + title={t('editor.modal.aliases.addAlias') ?? undefined} {...testId('addAliasButton')}> diff --git a/src/components/editor-page/document-bar/aliases/aliases-list-entry.tsx b/src/components/editor-page/document-bar/aliases/aliases-list-entry.tsx index baaef11a5..f5893908f 100644 --- a/src/components/editor-page/document-bar/aliases/aliases-list-entry.tsx +++ b/src/components/editor-page/document-bar/aliases/aliases-list-entry.tsx @@ -48,7 +48,7 @@ export const AliasesListEntry: React.FC = ({ alias }) => className={'me-2 text-warning'} variant='light' disabled={true} - title={t('editor.modal.aliases.isPrimary')} + title={t('editor.modal.aliases.isPrimary') ?? undefined} {...testId('aliasIsPrimary')}> @@ -57,7 +57,7 @@ export const AliasesListEntry: React.FC = ({ alias }) => diff --git a/src/components/editor-page/document-bar/permissions/permission-entry-buttons.tsx b/src/components/editor-page/document-bar/permissions/permission-entry-buttons.tsx index 480266652..6377fde80 100644 --- a/src/components/editor-page/document-bar/permissions/permission-entry-buttons.tsx +++ b/src/components/editor-page/document-bar/permissions/permission-entry-buttons.tsx @@ -68,18 +68,22 @@ export const PermissionEntryButtons: React.FC = ({ return (
- diff --git a/src/components/editor-page/editor-pane/tool-bar/emoji-picker/emoji-picker-button.tsx b/src/components/editor-page/editor-pane/tool-bar/emoji-picker/emoji-picker-button.tsx index 32ab4e20a..cf49027a0 100644 --- a/src/components/editor-page/editor-pane/tool-bar/emoji-picker/emoji-picker-button.tsx +++ b/src/components/editor-page/editor-pane/tool-bar/emoji-picker/emoji-picker-button.tsx @@ -61,7 +61,7 @@ export const EmojiPickerButton: React.FC = () => { {...cypressId('show-emoji-picker')} variant='light' onClick={showPicker} - title={t('editor.editorToolbar.emoji')} + title={t('editor.editorToolbar.emoji') ?? undefined} disabled={!changeEditorContent} ref={buttonRef}> diff --git a/src/components/editor-page/editor-pane/tool-bar/table-picker/custom-table-size-modal.tsx b/src/components/editor-page/editor-pane/tool-bar/table-picker/custom-table-size-modal.tsx index 999772b92..d57c889ce 100644 --- a/src/components/editor-page/editor-pane/tool-bar/table-picker/custom-table-size-modal.tsx +++ b/src/components/editor-page/editor-pane/tool-bar/table-picker/custom-table-size-modal.tsx @@ -74,7 +74,7 @@ export const CustomTableSizeModal: React.FC = ({ show @@ -82,7 +82,7 @@ export const CustomTableSizeModal: React.FC = ({ show diff --git a/src/components/editor-page/editor-pane/tool-bar/table-picker/table-size-picker-popover.tsx b/src/components/editor-page/editor-pane/tool-bar/table-picker/table-size-picker-popover.tsx index c02670b25..cb311dfff 100644 --- a/src/components/editor-page/editor-pane/tool-bar/table-picker/table-size-picker-popover.tsx +++ b/src/components/editor-page/editor-pane/tool-bar/table-picker/table-size-picker-popover.tsx @@ -60,7 +60,7 @@ export const TableSizePickerPopover = React.forwardRef onTableSizeSelected(row + 1, col + 1)} /> ) diff --git a/src/components/editor-page/editor-pane/tool-bar/upload-image-button/upload-image-button.tsx b/src/components/editor-page/editor-pane/tool-bar/upload-image-button/upload-image-button.tsx index 1d6297c9c..5b3c1d8d4 100644 --- a/src/components/editor-page/editor-pane/tool-bar/upload-image-button/upload-image-button.tsx +++ b/src/components/editor-page/editor-pane/tool-bar/upload-image-button/upload-image-button.tsx @@ -53,7 +53,7 @@ export const UploadImageButton: React.FC = () => { variant='light' onClick={buttonClick} disabled={!codeMirror} - title={t('editor.editorToolbar.uploadImage')} + title={t('editor.editorToolbar.uploadImage') ?? undefined} {...cypressId('editor-toolbar-upload-image-button')}> diff --git a/src/components/history-page/history-toolbar/clear-history-button.tsx b/src/components/history-page/history-toolbar/clear-history-button.tsx index f340d59eb..9c6b2b7d8 100644 --- a/src/components/history-page/history-toolbar/clear-history-button.tsx +++ b/src/components/history-page/history-toolbar/clear-history-button.tsx @@ -37,7 +37,7 @@ export const ClearHistoryButton: React.FC = () => { ) diff --git a/src/components/history-page/history-toolbar/history-refresh-button.tsx b/src/components/history-page/history-toolbar/history-refresh-button.tsx index ae47dfeb7..f5d373ab6 100644 --- a/src/components/history-page/history-toolbar/history-refresh-button.tsx +++ b/src/components/history-page/history-toolbar/history-refresh-button.tsx @@ -19,7 +19,7 @@ export const HistoryRefreshButton: React.FC = () => { const refreshHistory = useSafeRefreshHistoryStateCallback() return ( - ) diff --git a/src/components/history-page/history-toolbar/history-toolbar.tsx b/src/components/history-page/history-toolbar/history-toolbar.tsx index badaae08a..e319213bb 100644 --- a/src/components/history-page/history-toolbar/history-toolbar.tsx +++ b/src/components/history-page/history-toolbar/history-toolbar.tsx @@ -89,7 +89,10 @@ export const HistoryToolbar: React.FC = () => {
-
diff --git a/src/components/history-page/history-toolbar/history-view-mode-toggle-button.tsx b/src/components/history-page/history-toolbar/history-view-mode-toggle-button.tsx index fb32245f5..c5e53b9fc 100644 --- a/src/components/history-page/history-toolbar/history-view-mode-toggle-button.tsx +++ b/src/components/history-page/history-toolbar/history-view-mode-toggle-button.tsx @@ -32,7 +32,7 @@ export const HistoryViewModeToggleButton: React.FC = () => { return ( diff --git a/src/components/history-page/history-toolbar/import-history-button.tsx b/src/components/history-page/history-toolbar/import-history-button.tsx index 9782d1f16..4d18d1510 100644 --- a/src/components/history-page/history-toolbar/import-history-button.tsx +++ b/src/components/history-page/history-toolbar/import-history-button.tsx @@ -129,7 +129,7 @@ export const ImportHistoryButton: React.FC = () => { /> diff --git a/src/components/login-page/auth/fields/password-field.tsx b/src/components/login-page/auth/fields/password-field.tsx index a6e96bf62..a6662754d 100644 --- a/src/components/login-page/auth/fields/password-field.tsx +++ b/src/components/login-page/auth/fields/password-field.tsx @@ -24,7 +24,7 @@ export const PasswordField: React.FC = ({ onChange, invalid }) = isInvalid={invalid} type='password' size='sm' - placeholder={t('login.auth.password')} + placeholder={t('login.auth.password') ?? undefined} onChange={onChange} className='bg-dark text-light' autoComplete='current-password' diff --git a/src/components/login-page/auth/fields/username-field.tsx b/src/components/login-page/auth/fields/username-field.tsx index 5e088aee9..d8241ee8a 100644 --- a/src/components/login-page/auth/fields/username-field.tsx +++ b/src/components/login-page/auth/fields/username-field.tsx @@ -24,7 +24,7 @@ export const UsernameField: React.FC = ({ onChange, invalid }) = isInvalid={invalid} type='text' size='sm' - placeholder={t('login.auth.username')} + placeholder={t('login.auth.username') ?? undefined} onChange={onChange} className='bg-dark text-light' autoComplete='username' diff --git a/src/components/profile-page/access-tokens/access-token-creation-form/access-token-creation-form-label-field.tsx b/src/components/profile-page/access-tokens/access-token-creation-form/access-token-creation-form-label-field.tsx index f2e60b6c3..99aa346ec 100644 --- a/src/components/profile-page/access-tokens/access-token-creation-form/access-token-creation-form-label-field.tsx +++ b/src/components/profile-page/access-tokens/access-token-creation-form/access-token-creation-form-label-field.tsx @@ -38,7 +38,7 @@ export const AccessTokenCreationFormLabelField: React.FC = ({ code }) => { const message = (error as Error).message log.error(error) diagramContainer.current?.querySelectorAll('svg').forEach((child) => child.remove()) - throw new Error(message || t('renderer.mermaid.unknownError')) + throw new Error(message ?? t('renderer.mermaid.unknownError')) } }, [code, t]) diff --git a/src/extensions/extra-integrations/vega-lite/vega-lite-chart.tsx b/src/extensions/extra-integrations/vega-lite/vega-lite-chart.tsx index 5823b0930..a7eda8a07 100644 --- a/src/extensions/extra-integrations/vega-lite/vega-lite-chart.tsx +++ b/src/extensions/extra-integrations/vega-lite/vega-lite-chart.tsx @@ -46,8 +46,8 @@ export const VegaLiteChart: React.FC = ({ code }) => { editor: false }, i18n: { - PNG_ACTION: t('renderer.vega-lite.png'), - SVG_ACTION: t('renderer.vega-lite.svg') + PNG_ACTION: t('renderer.vega-lite.png') ?? undefined, + SVG_ACTION: t('renderer.vega-lite.svg') ?? undefined } }) }, [code, vegaEmbed])