mirror of
https://github.com/hedgedoc/hedgedoc.git
synced 2025-05-15 15:44:45 -04:00
fix: migrate i18n code
Signed-off-by: Tilman Vatteroth <git@tilmanvatteroth.de>
This commit is contained in:
parent
ce2a5d9287
commit
743e066e64
39 changed files with 69 additions and 55 deletions
|
@ -44,7 +44,7 @@ export const CopyToClipboardButton: React.FC<CopyToClipboardButtonProps> = ({
|
||||||
ref={button}
|
ref={button}
|
||||||
size={size}
|
size={size}
|
||||||
variant={variant}
|
variant={variant}
|
||||||
title={t('renderer.highlightCode.copyCode')}
|
title={t('renderer.highlightCode.copyCode') ?? undefined}
|
||||||
onClick={copyToClipboard}
|
onClick={copyToClipboard}
|
||||||
{...cypressId(props)}>
|
{...cypressId(props)}>
|
||||||
<ForkAwesomeIcon icon='files-o' />
|
<ForkAwesomeIcon icon='files-o' />
|
||||||
|
|
|
@ -26,7 +26,7 @@ export const CurrentPasswordField: React.FC<CommonFieldProps> = ({ onChange }) =
|
||||||
type='password'
|
type='password'
|
||||||
size='sm'
|
size='sm'
|
||||||
onChange={onChange}
|
onChange={onChange}
|
||||||
placeholder={t('login.auth.password')}
|
placeholder={t('login.auth.password') ?? undefined}
|
||||||
className='bg-dark text-light'
|
className='bg-dark text-light'
|
||||||
autoComplete='current-password'
|
autoComplete='current-password'
|
||||||
required
|
required
|
||||||
|
|
|
@ -38,7 +38,7 @@ export const DisplayNameField: React.FC<DisplayNameFieldProps> = ({ onChange, va
|
||||||
value={value}
|
value={value}
|
||||||
isValid={isValid}
|
isValid={isValid}
|
||||||
onChange={onChange}
|
onChange={onChange}
|
||||||
placeholder={t('profile.displayName')}
|
placeholder={t('profile.displayName') ?? undefined}
|
||||||
className='bg-dark text-light'
|
className='bg-dark text-light'
|
||||||
autoComplete='name'
|
autoComplete='name'
|
||||||
required
|
required
|
||||||
|
|
|
@ -32,7 +32,7 @@ export const NewPasswordField: React.FC<CommonFieldProps> = ({ onChange, value }
|
||||||
size='sm'
|
size='sm'
|
||||||
isValid={isValid}
|
isValid={isValid}
|
||||||
onChange={onChange}
|
onChange={onChange}
|
||||||
placeholder={t('login.auth.password')}
|
placeholder={t('login.auth.password') ?? undefined}
|
||||||
className='bg-dark text-light'
|
className='bg-dark text-light'
|
||||||
minLength={8}
|
minLength={8}
|
||||||
autoComplete='new-password'
|
autoComplete='new-password'
|
||||||
|
|
|
@ -42,7 +42,7 @@ export const PasswordAgainField: React.FC<PasswordAgainFieldProps> = ({ onChange
|
||||||
isInvalid={isInvalid}
|
isInvalid={isInvalid}
|
||||||
isValid={isValid}
|
isValid={isValid}
|
||||||
onChange={onChange}
|
onChange={onChange}
|
||||||
placeholder={t('login.register.passwordAgain')}
|
placeholder={t('login.register.passwordAgain') ?? undefined}
|
||||||
className='bg-dark text-light'
|
className='bg-dark text-light'
|
||||||
autoComplete='new-password'
|
autoComplete='new-password'
|
||||||
required
|
required
|
||||||
|
|
|
@ -33,7 +33,7 @@ export const UsernameField: React.FC<CommonFieldProps> = ({ onChange, value }) =
|
||||||
value={value}
|
value={value}
|
||||||
isValid={isValid}
|
isValid={isValid}
|
||||||
onChange={onChange}
|
onChange={onChange}
|
||||||
placeholder={t('login.auth.username')}
|
placeholder={t('login.auth.username') ?? undefined}
|
||||||
className='bg-dark text-light'
|
className='bg-dark text-light'
|
||||||
autoComplete='username'
|
autoComplete='username'
|
||||||
autoFocus={true}
|
autoFocus={true}
|
||||||
|
|
|
@ -37,7 +37,7 @@ export const DocumentInfobar: React.FC = () => {
|
||||||
href={`/n/${noteDetails.primaryAddress}`}
|
href={`/n/${noteDetails.primaryAddress}`}
|
||||||
icon={'pencil'}
|
icon={'pencil'}
|
||||||
className={'text-primary text-decoration-none mx-1'}
|
className={'text-primary text-decoration-none mx-1'}
|
||||||
title={t('views.readOnly.editNote')}
|
title={t('views.readOnly.editNote') ?? undefined}
|
||||||
/>
|
/>
|
||||||
</ShowIf>
|
</ShowIf>
|
||||||
</span>
|
</span>
|
||||||
|
|
|
@ -26,13 +26,13 @@ const DarkModeButton: React.FC = () => {
|
||||||
<Button
|
<Button
|
||||||
onClick={enable}
|
onClick={enable}
|
||||||
variant={darkModeEnabled ? 'secondary' : 'outline-secondary'}
|
variant={darkModeEnabled ? 'secondary' : 'outline-secondary'}
|
||||||
title={t('editor.darkMode.switchToDark')}>
|
title={t('editor.darkMode.switchToDark') ?? undefined}>
|
||||||
<ForkAwesomeIcon icon='moon' />
|
<ForkAwesomeIcon icon='moon' />
|
||||||
</Button>
|
</Button>
|
||||||
<Button
|
<Button
|
||||||
onClick={disable}
|
onClick={disable}
|
||||||
variant={darkModeEnabled ? 'outline-secondary' : 'secondary'}
|
variant={darkModeEnabled ? 'outline-secondary' : 'secondary'}
|
||||||
title={t('editor.darkMode.switchToLight')}>
|
title={t('editor.darkMode.switchToLight') ?? undefined}>
|
||||||
<ForkAwesomeIcon icon='sun-o' />
|
<ForkAwesomeIcon icon='sun-o' />
|
||||||
</Button>
|
</Button>
|
||||||
</ButtonGroup>
|
</ButtonGroup>
|
||||||
|
|
|
@ -23,7 +23,7 @@ export const HelpButton: React.FC = () => {
|
||||||
<Fragment>
|
<Fragment>
|
||||||
<Button
|
<Button
|
||||||
{...cypressId('editor-help-button')}
|
{...cypressId('editor-help-button')}
|
||||||
title={t('editor.documentBar.help')}
|
title={t('editor.documentBar.help') ?? undefined}
|
||||||
className='ms-2 text-secondary'
|
className='ms-2 text-secondary'
|
||||||
size='sm'
|
size='sm'
|
||||||
variant='outline-light'
|
variant='outline-light'
|
||||||
|
|
|
@ -22,7 +22,7 @@ export const ReadOnlyModeButton: React.FC = () => {
|
||||||
<Link href={`/s/${noteIdentifier}`}>
|
<Link href={`/s/${noteIdentifier}`}>
|
||||||
<a target='_blank'>
|
<a target='_blank'>
|
||||||
<Button
|
<Button
|
||||||
title={t('editor.documentBar.readOnlyMode')}
|
title={t('editor.documentBar.readOnlyMode') ?? undefined}
|
||||||
className='ms-2 text-secondary'
|
className='ms-2 text-secondary'
|
||||||
size='sm'
|
size='sm'
|
||||||
variant='outline-light'>
|
variant='outline-light'>
|
||||||
|
|
|
@ -22,7 +22,7 @@ export const SlideModeButton: React.FC = () => {
|
||||||
<Link href={`/p/${noteIdentifier}`}>
|
<Link href={`/p/${noteIdentifier}`}>
|
||||||
<a target='_blank'>
|
<a target='_blank'>
|
||||||
<Button
|
<Button
|
||||||
title={t('editor.documentBar.slideMode')}
|
title={t('editor.documentBar.slideMode') ?? undefined}
|
||||||
className='ms-2 text-secondary'
|
className='ms-2 text-secondary'
|
||||||
size='sm'
|
size='sm'
|
||||||
variant='outline-light'>
|
variant='outline-light'>
|
||||||
|
|
|
@ -28,13 +28,13 @@ export const SyncScrollButtons: React.FC = () => {
|
||||||
<Button
|
<Button
|
||||||
onClick={enable}
|
onClick={enable}
|
||||||
variant={syncScrollEnabled ? 'secondary' : 'outline-secondary'}
|
variant={syncScrollEnabled ? 'secondary' : 'outline-secondary'}
|
||||||
title={t('editor.appBar.syncScroll.enable')}>
|
title={t('editor.appBar.syncScroll.enable') ?? undefined}>
|
||||||
<EnabledScroll />
|
<EnabledScroll />
|
||||||
</Button>
|
</Button>
|
||||||
<Button
|
<Button
|
||||||
onClick={disable}
|
onClick={disable}
|
||||||
variant={syncScrollEnabled ? 'outline-secondary' : 'secondary'}
|
variant={syncScrollEnabled ? 'outline-secondary' : 'secondary'}
|
||||||
title={t('editor.appBar.syncScroll.disable')}>
|
title={t('editor.appBar.syncScroll.disable') ?? undefined}>
|
||||||
<DisabledScroll />
|
<DisabledScroll />
|
||||||
</Button>
|
</Button>
|
||||||
</ButtonGroup>
|
</ButtonGroup>
|
||||||
|
|
|
@ -3,8 +3,8 @@
|
||||||
*
|
*
|
||||||
* SPDX-License-Identifier: AGPL-3.0-only
|
* SPDX-License-Identifier: AGPL-3.0-only
|
||||||
*/
|
*/
|
||||||
import React, { useCallback, useMemo, useState } from 'react'
|
|
||||||
import type { FormEvent } from 'react'
|
import type { FormEvent } from 'react'
|
||||||
|
import React, { useCallback, useMemo, useState } from 'react'
|
||||||
import { Button, Form, InputGroup } from 'react-bootstrap'
|
import { Button, Form, InputGroup } from 'react-bootstrap'
|
||||||
import { ForkAwesomeIcon } from '../../../common/fork-awesome/fork-awesome-icon'
|
import { ForkAwesomeIcon } from '../../../common/fork-awesome/fork-awesome-icon'
|
||||||
import { useTranslation } from 'react-i18next'
|
import { useTranslation } from 'react-i18next'
|
||||||
|
@ -50,7 +50,7 @@ export const AliasesAddForm: React.FC = () => {
|
||||||
<InputGroup className={'me-1 mb-1'} hasValidation={true}>
|
<InputGroup className={'me-1 mb-1'} hasValidation={true}>
|
||||||
<Form.Control
|
<Form.Control
|
||||||
value={newAlias}
|
value={newAlias}
|
||||||
placeholder={t('editor.modal.aliases.addAlias')}
|
placeholder={t('editor.modal.aliases.addAlias') ?? undefined}
|
||||||
onChange={onNewAliasInputChange}
|
onChange={onNewAliasInputChange}
|
||||||
isInvalid={!newAliasValid}
|
isInvalid={!newAliasValid}
|
||||||
required={true}
|
required={true}
|
||||||
|
@ -61,7 +61,7 @@ export const AliasesAddForm: React.FC = () => {
|
||||||
variant='light'
|
variant='light'
|
||||||
className={'text-secondary ms-2'}
|
className={'text-secondary ms-2'}
|
||||||
disabled={!newAliasValid || newAlias === ''}
|
disabled={!newAliasValid || newAlias === ''}
|
||||||
title={t('editor.modal.aliases.addAlias')}
|
title={t('editor.modal.aliases.addAlias') ?? undefined}
|
||||||
{...testId('addAliasButton')}>
|
{...testId('addAliasButton')}>
|
||||||
<ForkAwesomeIcon icon={'plus'} />
|
<ForkAwesomeIcon icon={'plus'} />
|
||||||
</Button>
|
</Button>
|
||||||
|
|
|
@ -48,7 +48,7 @@ export const AliasesListEntry: React.FC<AliasesListEntryProps> = ({ alias }) =>
|
||||||
className={'me-2 text-warning'}
|
className={'me-2 text-warning'}
|
||||||
variant='light'
|
variant='light'
|
||||||
disabled={true}
|
disabled={true}
|
||||||
title={t('editor.modal.aliases.isPrimary')}
|
title={t('editor.modal.aliases.isPrimary') ?? undefined}
|
||||||
{...testId('aliasIsPrimary')}>
|
{...testId('aliasIsPrimary')}>
|
||||||
<ForkAwesomeIcon icon={'star'} />
|
<ForkAwesomeIcon icon={'star'} />
|
||||||
</Button>
|
</Button>
|
||||||
|
@ -57,7 +57,7 @@ export const AliasesListEntry: React.FC<AliasesListEntryProps> = ({ alias }) =>
|
||||||
<Button
|
<Button
|
||||||
className={'me-2'}
|
className={'me-2'}
|
||||||
variant='light'
|
variant='light'
|
||||||
title={t('editor.modal.aliases.makePrimary')}
|
title={t('editor.modal.aliases.makePrimary') ?? undefined}
|
||||||
onClick={onMakePrimaryClick}
|
onClick={onMakePrimaryClick}
|
||||||
{...testId('aliasButtonMakePrimary')}>
|
{...testId('aliasButtonMakePrimary')}>
|
||||||
<ForkAwesomeIcon icon={'star-o'} />
|
<ForkAwesomeIcon icon={'star-o'} />
|
||||||
|
@ -66,7 +66,7 @@ export const AliasesListEntry: React.FC<AliasesListEntryProps> = ({ alias }) =>
|
||||||
<Button
|
<Button
|
||||||
variant='light'
|
variant='light'
|
||||||
className={'text-danger'}
|
className={'text-danger'}
|
||||||
title={t('editor.modal.aliases.removeAlias')}
|
title={t('editor.modal.aliases.removeAlias') ?? undefined}
|
||||||
onClick={onRemoveClick}
|
onClick={onRemoveClick}
|
||||||
{...testId('aliasButtonRemove')}>
|
{...testId('aliasButtonRemove')}>
|
||||||
<ForkAwesomeIcon icon={'times'} />
|
<ForkAwesomeIcon icon={'times'} />
|
||||||
|
|
|
@ -34,8 +34,8 @@ export const PermissionAddEntryField: React.FC<PermissionAddEntryFieldProps> = (
|
||||||
return (
|
return (
|
||||||
<li className={'list-group-item'}>
|
<li className={'list-group-item'}>
|
||||||
<InputGroup className={'me-1 mb-1'}>
|
<InputGroup className={'me-1 mb-1'}>
|
||||||
<FormControl value={newEntryIdentifier} placeholder={t(i18nKey)} onChange={onChange} />
|
<FormControl value={newEntryIdentifier} placeholder={t(i18nKey) ?? undefined} onChange={onChange} />
|
||||||
<Button variant='light' className={'text-secondary ms-2'} title={t(i18nKey)} onClick={onSubmit}>
|
<Button variant='light' className={'text-secondary ms-2'} title={t(i18nKey) ?? undefined} onClick={onSubmit}>
|
||||||
<ForkAwesomeIcon icon={'plus'} />
|
<ForkAwesomeIcon icon={'plus'} />
|
||||||
</Button>
|
</Button>
|
||||||
</InputGroup>
|
</InputGroup>
|
||||||
|
|
|
@ -68,18 +68,22 @@ export const PermissionEntryButtons: React.FC<PermissionEntryButtonsProps> = ({
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div>
|
<div>
|
||||||
<Button variant='light' className={'text-danger me-2'} title={t(i18nKeys.remove, { name })} onClick={onRemove}>
|
<Button
|
||||||
|
variant='light'
|
||||||
|
className={'text-danger me-2'}
|
||||||
|
title={t(i18nKeys.remove, { name }) ?? undefined}
|
||||||
|
onClick={onRemove}>
|
||||||
<ForkAwesomeIcon icon={'times'} />
|
<ForkAwesomeIcon icon={'times'} />
|
||||||
</Button>
|
</Button>
|
||||||
<ToggleButtonGroup type='radio' name='edit-mode' value={currentSetting}>
|
<ToggleButtonGroup type='radio' name='edit-mode' value={currentSetting}>
|
||||||
<Button
|
<Button
|
||||||
title={t(i18nKeys.setReadOnly, { name })}
|
title={t(i18nKeys.setReadOnly, { name }) ?? undefined}
|
||||||
variant={currentSetting === AccessLevel.READ_ONLY ? 'secondary' : 'outline-secondary'}
|
variant={currentSetting === AccessLevel.READ_ONLY ? 'secondary' : 'outline-secondary'}
|
||||||
onClick={onSetReadOnly}>
|
onClick={onSetReadOnly}>
|
||||||
<ForkAwesomeIcon icon='eye' />
|
<ForkAwesomeIcon icon='eye' />
|
||||||
</Button>
|
</Button>
|
||||||
<Button
|
<Button
|
||||||
title={t(i18nKeys.setWriteable, { name })}
|
title={t(i18nKeys.setWriteable, { name }) ?? undefined}
|
||||||
variant={currentSetting === AccessLevel.WRITEABLE ? 'secondary' : 'outline-secondary'}
|
variant={currentSetting === AccessLevel.WRITEABLE ? 'secondary' : 'outline-secondary'}
|
||||||
onClick={onSetWriteable}>
|
onClick={onSetWriteable}>
|
||||||
<ForkAwesomeIcon icon='pencil' />
|
<ForkAwesomeIcon icon='pencil' />
|
||||||
|
|
|
@ -68,19 +68,19 @@ export const PermissionEntrySpecialGroup: React.FC<PermissionEntrySpecialGroupPr
|
||||||
<div>
|
<div>
|
||||||
<ToggleButtonGroup type='radio' name='edit-mode'>
|
<ToggleButtonGroup type='radio' name='edit-mode'>
|
||||||
<Button
|
<Button
|
||||||
title={t('editor.modal.permissions.denyGroup', { name })}
|
title={t('editor.modal.permissions.denyGroup', { name }) ?? undefined}
|
||||||
variant={level === AccessLevel.NONE ? 'secondary' : 'outline-secondary'}
|
variant={level === AccessLevel.NONE ? 'secondary' : 'outline-secondary'}
|
||||||
onClick={onSetEntryDenied}>
|
onClick={onSetEntryDenied}>
|
||||||
<ForkAwesomeIcon icon={'ban'} />
|
<ForkAwesomeIcon icon={'ban'} />
|
||||||
</Button>
|
</Button>
|
||||||
<Button
|
<Button
|
||||||
title={t('editor.modal.permissions.viewOnlyGroup', { name })}
|
title={t('editor.modal.permissions.viewOnlyGroup', { name }) ?? undefined}
|
||||||
variant={level === AccessLevel.READ_ONLY ? 'secondary' : 'outline-secondary'}
|
variant={level === AccessLevel.READ_ONLY ? 'secondary' : 'outline-secondary'}
|
||||||
onClick={onSetEntryReadOnly}>
|
onClick={onSetEntryReadOnly}>
|
||||||
<ForkAwesomeIcon icon={'eye'} />
|
<ForkAwesomeIcon icon={'eye'} />
|
||||||
</Button>
|
</Button>
|
||||||
<Button
|
<Button
|
||||||
title={t('editor.modal.permissions.editGroup', { name })}
|
title={t('editor.modal.permissions.editGroup', { name }) ?? undefined}
|
||||||
variant={level === AccessLevel.WRITEABLE ? 'secondary' : 'outline-secondary'}
|
variant={level === AccessLevel.WRITEABLE ? 'secondary' : 'outline-secondary'}
|
||||||
onClick={() => onSetEntryWriteable}>
|
onClick={() => onSetEntryWriteable}>
|
||||||
<ForkAwesomeIcon icon={'pencil'} />
|
<ForkAwesomeIcon icon={'pencil'} />
|
||||||
|
|
|
@ -36,12 +36,12 @@ export const PermissionOwnerChange: React.FC<PermissionOwnerChangeProps> = ({ on
|
||||||
<InputGroup className={'me-1 mb-1'}>
|
<InputGroup className={'me-1 mb-1'}>
|
||||||
<FormControl
|
<FormControl
|
||||||
value={ownerFieldValue}
|
value={ownerFieldValue}
|
||||||
placeholder={t('editor.modal.permissions.ownerChange.placeholder')}
|
placeholder={t('editor.modal.permissions.ownerChange.placeholder') ?? undefined}
|
||||||
onChange={onChangeField}
|
onChange={onChangeField}
|
||||||
/>
|
/>
|
||||||
<Button
|
<Button
|
||||||
variant='light'
|
variant='light'
|
||||||
title={t('common.save')}
|
title={t('common.save') ?? undefined}
|
||||||
onClick={onClickConfirm}
|
onClick={onClickConfirm}
|
||||||
className={'ms-2'}
|
className={'ms-2'}
|
||||||
disabled={confirmButtonDisabled}>
|
disabled={confirmButtonDisabled}>
|
||||||
|
|
|
@ -27,7 +27,10 @@ export const PermissionOwnerInfo: React.FC<PermissionOwnerInfoProps> = ({ onEdit
|
||||||
return (
|
return (
|
||||||
<Fragment>
|
<Fragment>
|
||||||
<UserAvatarForUsername username={noteOwner} />
|
<UserAvatarForUsername username={noteOwner} />
|
||||||
<Button variant='light' title={t('editor.modal.permissions.ownerChange.button')} onClick={onEditOwner}>
|
<Button
|
||||||
|
variant='light'
|
||||||
|
title={t('editor.modal.permissions.ownerChange.button') ?? undefined}
|
||||||
|
onClick={onEditOwner}>
|
||||||
<ForkAwesomeIcon icon={'pencil'} />
|
<ForkAwesomeIcon icon={'pencil'} />
|
||||||
</Button>
|
</Button>
|
||||||
</Fragment>
|
</Fragment>
|
||||||
|
|
|
@ -61,7 +61,7 @@ export const EmojiPickerButton: React.FC = () => {
|
||||||
{...cypressId('show-emoji-picker')}
|
{...cypressId('show-emoji-picker')}
|
||||||
variant='light'
|
variant='light'
|
||||||
onClick={showPicker}
|
onClick={showPicker}
|
||||||
title={t('editor.editorToolbar.emoji')}
|
title={t('editor.editorToolbar.emoji') ?? undefined}
|
||||||
disabled={!changeEditorContent}
|
disabled={!changeEditorContent}
|
||||||
ref={buttonRef}>
|
ref={buttonRef}>
|
||||||
<ForkAwesomeIcon icon='smile-o' />
|
<ForkAwesomeIcon icon='smile-o' />
|
||||||
|
|
|
@ -74,7 +74,7 @@ export const CustomTableSizeModal: React.FC<CustomTableSizeModalProps> = ({ show
|
||||||
<Form.Control
|
<Form.Control
|
||||||
type={'number'}
|
type={'number'}
|
||||||
min={1}
|
min={1}
|
||||||
placeholder={t('editor.editorToolbar.table.cols')}
|
placeholder={t('editor.editorToolbar.table.cols') ?? undefined}
|
||||||
isInvalid={tableSize.columns <= 0}
|
isInvalid={tableSize.columns <= 0}
|
||||||
onChange={onColChange}
|
onChange={onColChange}
|
||||||
/>
|
/>
|
||||||
|
@ -82,7 +82,7 @@ export const CustomTableSizeModal: React.FC<CustomTableSizeModalProps> = ({ show
|
||||||
<Form.Control
|
<Form.Control
|
||||||
type={'number'}
|
type={'number'}
|
||||||
min={1}
|
min={1}
|
||||||
placeholder={t('editor.editorToolbar.table.rows')}
|
placeholder={t('editor.editorToolbar.table.rows') ?? undefined}
|
||||||
isInvalid={tableSize.rows <= 0}
|
isInvalid={tableSize.rows <= 0}
|
||||||
onChange={onRowChange}
|
onChange={onRowChange}
|
||||||
/>
|
/>
|
||||||
|
|
|
@ -60,7 +60,7 @@ export const TableSizePickerPopover = React.forwardRef<HTMLDivElement, TableSize
|
||||||
{...cypressAttribute('col', `${col + 1}`)}
|
{...cypressAttribute('col', `${col + 1}`)}
|
||||||
{...cypressAttribute('row', `${row + 1}`)}
|
{...cypressAttribute('row', `${row + 1}`)}
|
||||||
onMouseEnter={onSizeHover(row + 1, col + 1)}
|
onMouseEnter={onSizeHover(row + 1, col + 1)}
|
||||||
title={t('editor.editorToolbar.table.titleWithSize', { cols: col + 1, rows: row + 1 })}
|
title={t('editor.editorToolbar.table.titleWithSize', { cols: col + 1, rows: row + 1 }) ?? undefined}
|
||||||
onClick={() => onTableSizeSelected(row + 1, col + 1)}
|
onClick={() => onTableSizeSelected(row + 1, col + 1)}
|
||||||
/>
|
/>
|
||||||
)
|
)
|
||||||
|
|
|
@ -53,7 +53,7 @@ export const UploadImageButton: React.FC = () => {
|
||||||
variant='light'
|
variant='light'
|
||||||
onClick={buttonClick}
|
onClick={buttonClick}
|
||||||
disabled={!codeMirror}
|
disabled={!codeMirror}
|
||||||
title={t('editor.editorToolbar.uploadImage')}
|
title={t('editor.editorToolbar.uploadImage') ?? undefined}
|
||||||
{...cypressId('editor-toolbar-upload-image-button')}>
|
{...cypressId('editor-toolbar-upload-image-button')}>
|
||||||
<ForkAwesomeIcon icon={'upload'} />
|
<ForkAwesomeIcon icon={'upload'} />
|
||||||
</Button>
|
</Button>
|
||||||
|
|
|
@ -37,7 +37,7 @@ export const ClearHistoryButton: React.FC = () => {
|
||||||
<Fragment>
|
<Fragment>
|
||||||
<Button
|
<Button
|
||||||
variant={'light'}
|
variant={'light'}
|
||||||
title={t('landing.history.toolbar.clear')}
|
title={t('landing.history.toolbar.clear') ?? undefined}
|
||||||
onClick={showModal}
|
onClick={showModal}
|
||||||
{...cypressId('history-clear-button')}>
|
{...cypressId('history-clear-button')}>
|
||||||
<ForkAwesomeIcon icon={'trash'} />
|
<ForkAwesomeIcon icon={'trash'} />
|
||||||
|
|
|
@ -17,7 +17,7 @@ export const ExportHistoryButton: React.FC = () => {
|
||||||
const { t } = useTranslation()
|
const { t } = useTranslation()
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Button variant={'light'} title={t('landing.history.toolbar.export')} onClick={downloadHistory}>
|
<Button variant={'light'} title={t('landing.history.toolbar.export') ?? undefined} onClick={downloadHistory}>
|
||||||
<ForkAwesomeIcon icon='download' />
|
<ForkAwesomeIcon icon='download' />
|
||||||
</Button>
|
</Button>
|
||||||
)
|
)
|
||||||
|
|
|
@ -19,7 +19,7 @@ export const HistoryRefreshButton: React.FC = () => {
|
||||||
const refreshHistory = useSafeRefreshHistoryStateCallback()
|
const refreshHistory = useSafeRefreshHistoryStateCallback()
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Button variant={'light'} title={t('landing.history.toolbar.refresh')} onClick={refreshHistory}>
|
<Button variant={'light'} title={t('landing.history.toolbar.refresh') ?? undefined} onClick={refreshHistory}>
|
||||||
<ForkAwesomeIcon icon='refresh' />
|
<ForkAwesomeIcon icon='refresh' />
|
||||||
</Button>
|
</Button>
|
||||||
)
|
)
|
||||||
|
|
|
@ -89,7 +89,10 @@ export const HistoryToolbar: React.FC = () => {
|
||||||
</div>
|
</div>
|
||||||
<ShowIf condition={userExists}>
|
<ShowIf condition={userExists}>
|
||||||
<div className={'me-1 mb-1'}>
|
<div className={'me-1 mb-1'}>
|
||||||
<Button variant={'light'} title={t('landing.history.toolbar.uploadAll')} onClick={onUploadAllToRemote}>
|
<Button
|
||||||
|
variant={'light'}
|
||||||
|
title={t('landing.history.toolbar.uploadAll') ?? undefined}
|
||||||
|
onClick={onUploadAllToRemote}>
|
||||||
<ForkAwesomeIcon icon='cloud-upload' />
|
<ForkAwesomeIcon icon='cloud-upload' />
|
||||||
</Button>
|
</Button>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -32,7 +32,7 @@ export const HistoryViewModeToggleButton: React.FC = () => {
|
||||||
return (
|
return (
|
||||||
<ToggleButtonGroup type='radio' name='options' dir='auto' className={'button-height'} onChange={onViewStateChange}>
|
<ToggleButtonGroup type='radio' name='options' dir='auto' className={'button-height'} onChange={onViewStateChange}>
|
||||||
<Button
|
<Button
|
||||||
title={t('landing.history.toolbar.cards')}
|
title={t('landing.history.toolbar.cards') ?? undefined}
|
||||||
variant={historyToolbarState.viewState === ViewStateEnum.CARD ? 'light' : 'outline-light'}
|
variant={historyToolbarState.viewState === ViewStateEnum.CARD ? 'light' : 'outline-light'}
|
||||||
onClick={() => onViewStateChange(ViewStateEnum.CARD)}>
|
onClick={() => onViewStateChange(ViewStateEnum.CARD)}>
|
||||||
<ForkAwesomeIcon icon={'sticky-note'} className={'fa-fix-line-height'} />
|
<ForkAwesomeIcon icon={'sticky-note'} className={'fa-fix-line-height'} />
|
||||||
|
@ -40,7 +40,7 @@ export const HistoryViewModeToggleButton: React.FC = () => {
|
||||||
<Button
|
<Button
|
||||||
{...cypressId('history-mode-table')}
|
{...cypressId('history-mode-table')}
|
||||||
variant={historyToolbarState.viewState === ViewStateEnum.TABLE ? 'light' : 'outline-light'}
|
variant={historyToolbarState.viewState === ViewStateEnum.TABLE ? 'light' : 'outline-light'}
|
||||||
title={t('landing.history.toolbar.table')}
|
title={t('landing.history.toolbar.table') ?? undefined}
|
||||||
onClick={() => onViewStateChange(ViewStateEnum.TABLE)}>
|
onClick={() => onViewStateChange(ViewStateEnum.TABLE)}>
|
||||||
<ForkAwesomeIcon icon={'table'} className={'fa-fix-line-height'} />
|
<ForkAwesomeIcon icon={'table'} className={'fa-fix-line-height'} />
|
||||||
</Button>
|
</Button>
|
||||||
|
|
|
@ -129,7 +129,7 @@ export const ImportHistoryButton: React.FC = () => {
|
||||||
/>
|
/>
|
||||||
<Button
|
<Button
|
||||||
variant={'light'}
|
variant={'light'}
|
||||||
title={t('landing.history.toolbar.import')}
|
title={t('landing.history.toolbar.import') ?? undefined}
|
||||||
onClick={onUploadButtonClick}
|
onClick={onUploadButtonClick}
|
||||||
{...cypressId('import-history-file-button')}>
|
{...cypressId('import-history-file-button')}>
|
||||||
<ForkAwesomeIcon icon='upload' />
|
<ForkAwesomeIcon icon='upload' />
|
||||||
|
|
|
@ -26,8 +26,8 @@ export const KeywordSearchInput: React.FC = () => {
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<FormControl
|
<FormControl
|
||||||
placeholder={t('landing.history.toolbar.searchKeywords')}
|
placeholder={t('landing.history.toolbar.searchKeywords') ?? undefined}
|
||||||
aria-label={t('landing.history.toolbar.searchKeywords')}
|
aria-label={t('landing.history.toolbar.searchKeywords') ?? undefined}
|
||||||
onChange={onChange}
|
onChange={onChange}
|
||||||
value={historyToolbarState.search}
|
value={historyToolbarState.search}
|
||||||
/>
|
/>
|
||||||
|
|
|
@ -43,7 +43,7 @@ export const TagSelectionInput: React.FC = () => {
|
||||||
id={'tagsSelection'}
|
id={'tagsSelection'}
|
||||||
options={tags}
|
options={tags}
|
||||||
multiple={true}
|
multiple={true}
|
||||||
placeholder={t('landing.history.toolbar.selectTags')}
|
placeholder={t('landing.history.toolbar.selectTags') ?? undefined}
|
||||||
onChange={onChange}
|
onChange={onChange}
|
||||||
selected={historyToolbarState.selectedTags}
|
selected={historyToolbarState.selectedTags}
|
||||||
/>
|
/>
|
||||||
|
|
|
@ -19,7 +19,7 @@ export const NewGuestNoteButton: React.FC = () => {
|
||||||
return (
|
return (
|
||||||
<Link href={'/new'} passHref={true}>
|
<Link href={'/new'} passHref={true}>
|
||||||
<Button
|
<Button
|
||||||
title={t('landing.navigation.newGuestNote')}
|
title={t('landing.navigation.newGuestNote') ?? undefined}
|
||||||
variant='primary'
|
variant='primary'
|
||||||
size='sm'
|
size='sm'
|
||||||
className='d-inline-flex align-items-center'
|
className='d-inline-flex align-items-center'
|
||||||
|
|
|
@ -19,7 +19,7 @@ export const NewUserNoteButton: React.FC = () => {
|
||||||
return (
|
return (
|
||||||
<Link href={'/new'} passHref={true}>
|
<Link href={'/new'} passHref={true}>
|
||||||
<Button
|
<Button
|
||||||
title={t('landing.navigation.newNote')}
|
title={t('landing.navigation.newNote') ?? undefined}
|
||||||
variant='primary'
|
variant='primary'
|
||||||
size='sm'
|
size='sm'
|
||||||
className='d-inline-flex align-items-center'
|
className='d-inline-flex align-items-center'
|
||||||
|
|
|
@ -40,7 +40,11 @@ export const SignInButton: React.FC<SignInButtonProps> = ({ variant, ...props })
|
||||||
return (
|
return (
|
||||||
<ShowIf condition={authProviders.length > 0}>
|
<ShowIf condition={authProviders.length > 0}>
|
||||||
<Link href={loginLink} passHref={true}>
|
<Link href={loginLink} passHref={true}>
|
||||||
<Button title={t('login.signIn')} {...cypressId('sign-in-button')} variant={variant || 'success'} {...props}>
|
<Button
|
||||||
|
title={t('login.signIn') ?? undefined}
|
||||||
|
{...cypressId('sign-in-button')}
|
||||||
|
variant={variant || 'success'}
|
||||||
|
{...props}>
|
||||||
<Trans i18nKey='login.signIn' />
|
<Trans i18nKey='login.signIn' />
|
||||||
</Button>
|
</Button>
|
||||||
</Link>
|
</Link>
|
||||||
|
|
|
@ -24,7 +24,7 @@ export const PasswordField: React.FC<AuthFieldProps> = ({ onChange, invalid }) =
|
||||||
isInvalid={invalid}
|
isInvalid={invalid}
|
||||||
type='password'
|
type='password'
|
||||||
size='sm'
|
size='sm'
|
||||||
placeholder={t('login.auth.password')}
|
placeholder={t('login.auth.password') ?? undefined}
|
||||||
onChange={onChange}
|
onChange={onChange}
|
||||||
className='bg-dark text-light'
|
className='bg-dark text-light'
|
||||||
autoComplete='current-password'
|
autoComplete='current-password'
|
||||||
|
|
|
@ -24,7 +24,7 @@ export const UsernameField: React.FC<AuthFieldProps> = ({ onChange, invalid }) =
|
||||||
isInvalid={invalid}
|
isInvalid={invalid}
|
||||||
type='text'
|
type='text'
|
||||||
size='sm'
|
size='sm'
|
||||||
placeholder={t('login.auth.username')}
|
placeholder={t('login.auth.username') ?? undefined}
|
||||||
onChange={onChange}
|
onChange={onChange}
|
||||||
className='bg-dark text-light'
|
className='bg-dark text-light'
|
||||||
autoComplete='username'
|
autoComplete='username'
|
||||||
|
|
|
@ -38,7 +38,7 @@ export const AccessTokenCreationFormLabelField: React.FC<AccessTokenCreationForm
|
||||||
<Form.Control
|
<Form.Control
|
||||||
type='text'
|
type='text'
|
||||||
size='sm'
|
size='sm'
|
||||||
placeholder={t('profile.accessTokens.label')}
|
placeholder={t('profile.accessTokens.label') ?? undefined}
|
||||||
value={formValues.label}
|
value={formValues.label}
|
||||||
className='bg-dark text-light'
|
className='bg-dark text-light'
|
||||||
onChange={onChangeLabel}
|
onChange={onChangeLabel}
|
||||||
|
|
|
@ -60,7 +60,7 @@ export const MermaidChart: React.FC<CodeProps> = ({ code }) => {
|
||||||
const message = (error as Error).message
|
const message = (error as Error).message
|
||||||
log.error(error)
|
log.error(error)
|
||||||
diagramContainer.current?.querySelectorAll('svg').forEach((child) => child.remove())
|
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])
|
}, [code, t])
|
||||||
|
|
||||||
|
|
|
@ -46,8 +46,8 @@ export const VegaLiteChart: React.FC<CodeProps> = ({ code }) => {
|
||||||
editor: false
|
editor: false
|
||||||
},
|
},
|
||||||
i18n: {
|
i18n: {
|
||||||
PNG_ACTION: t('renderer.vega-lite.png'),
|
PNG_ACTION: t('renderer.vega-lite.png') ?? undefined,
|
||||||
SVG_ACTION: t('renderer.vega-lite.svg')
|
SVG_ACTION: t('renderer.vega-lite.svg') ?? undefined
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}, [code, vegaEmbed])
|
}, [code, vegaEmbed])
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue