mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2026-05-23 17:19:37 +02:00
Tearing down of old Editor (File tree) (#31784)
* merging ide-redesign/components/file-tree into features/file-tree * moving ide-redesign/contexts/settings-modal-context to features/settings/contexts * use-collapsible-file-tree.tsx → features/file-tree/hooks * use-focus-on-setting.tsx → features/settings/hooks * use-project-notification-preferences.ts → features/settings/hooks * use-rail-overflow.tsx→ features/ide-react/hooks * deleting use-switch-enable-new-editor-state.ts * use-toolbar-menu-editor-commands.tsx → features/source-editor/hooks * npm run extract-translations * modifying the test to target correct buttons and removing a test for old component * adding a test back and modifying it * changing the test GitOrigin-RevId: baa1e9a992c88b84313eea82161354d4958cf1ef
This commit is contained in:
@@ -1395,7 +1395,6 @@
|
||||
"project_approaching_file_limit": "",
|
||||
"project_categories_tags": "",
|
||||
"project_figure_modal": "",
|
||||
"project_files": "",
|
||||
"project_files_history": "",
|
||||
"project_flagged_too_many_compiles": "",
|
||||
"project_has_too_many_files_limit": "",
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
import { useTranslation } from 'react-i18next'
|
||||
import * as eventTracking from '../../../../infrastructure/event-tracking'
|
||||
import * as eventTracking from '../../../infrastructure/event-tracking'
|
||||
import { useFileTreeActionable } from '@/features/file-tree/contexts/file-tree-actionable'
|
||||
import { useFileTreeData } from '@/shared/context/file-tree-data-context'
|
||||
import React from 'react'
|
||||
import { useCommandProvider } from '@/features/ide-react/hooks/use-command-provider'
|
||||
import { usePermissionsContext } from '@/features/ide-react/context/permissions-context'
|
||||
import FileTreeActionButton from './file-tree-action-button'
|
||||
import { useRailContext } from '../../../ide-react/context/rail-context'
|
||||
import { useRailContext } from '../../ide-react/context/rail-context'
|
||||
|
||||
export default function FileTreeActionButtons({
|
||||
fileTreeExpanded,
|
||||
@@ -3,7 +3,7 @@ import { FileTree } from '@/features/ide-react/components/file-tree'
|
||||
import { OutlineContainer } from '@/features/outline/components/outline-container'
|
||||
import { VerticalResizeHandle } from '@/features/ide-react/components/resize/vertical-resize-handle'
|
||||
import { useOutlinePane } from '@/features/ide-react/hooks/use-outline-pane'
|
||||
import useCollapsibleFileTree from '../../hooks/use-collapsible-file-tree'
|
||||
import useCollapsibleFileTree from '@/features/file-tree/hooks/use-collapsible-file-tree'
|
||||
import classNames from 'classnames'
|
||||
|
||||
function FileTreeOutlinePanel() {
|
||||
@@ -6,7 +6,7 @@ import FileTreeContext from './file-tree-context'
|
||||
import FileTreeDraggablePreviewLayer from './file-tree-draggable-preview-layer'
|
||||
import FileTreeFolderList from './file-tree-folder-list'
|
||||
import FileTreeToolbar from './file-tree-toolbar'
|
||||
import FileTreeToolbarNew from '@/features/ide-redesign/components/file-tree/file-tree-toolbar'
|
||||
import FileTreeToolbarNew from '@/features/file-tree/components/file-tree-toolbar'
|
||||
import FileTreeModalDelete from './modals/file-tree-modal-delete'
|
||||
import FileTreeModalCreateFolder from './modals/file-tree-modal-create-folder'
|
||||
import FileTreeModalError from './modals/file-tree-modal-error'
|
||||
|
||||
@@ -1,124 +1,30 @@
|
||||
import { useTranslation } from 'react-i18next'
|
||||
import * as eventTracking from '../../../infrastructure/event-tracking'
|
||||
import { useFileTreeActionable } from '../contexts/file-tree-actionable'
|
||||
import { useFileTreeData } from '@/shared/context/file-tree-data-context'
|
||||
import OLTooltip from '@/shared/components/ol/ol-tooltip'
|
||||
import MaterialIcon from '@/shared/components/material-icon'
|
||||
import OLButtonToolbar from '@/shared/components/ol/ol-button-toolbar'
|
||||
import importOverleafModules from '../../../../macros/import-overleaf-module.macro'
|
||||
import React, { ElementType } from 'react'
|
||||
|
||||
const fileTreeToolbarComponents = importOverleafModules(
|
||||
'fileTreeToolbarComponents'
|
||||
) as { import: { default: ElementType }; path: string }[]
|
||||
import React from 'react'
|
||||
import useCollapsibleFileTree from '@/features/file-tree/hooks/use-collapsible-file-tree'
|
||||
import FileTreeActionButtons from './file-tree-action-buttons'
|
||||
|
||||
function FileTreeToolbar() {
|
||||
const { fileTreeReadOnly } = useFileTreeData()
|
||||
const { t } = useTranslation()
|
||||
|
||||
if (fileTreeReadOnly) return null
|
||||
const { fileTreeExpanded, toggleFileTreeExpanded } = useCollapsibleFileTree()
|
||||
|
||||
return (
|
||||
<OLButtonToolbar
|
||||
className="toolbar toolbar-filetree"
|
||||
aria-label={t('project_files')}
|
||||
>
|
||||
<FileTreeToolbarLeft />
|
||||
<FileTreeToolbarRight />
|
||||
</OLButtonToolbar>
|
||||
)
|
||||
}
|
||||
|
||||
function FileTreeToolbarLeft() {
|
||||
const { t } = useTranslation()
|
||||
const {
|
||||
canCreate,
|
||||
startCreatingFolder,
|
||||
startCreatingDocOrFile,
|
||||
startUploadingDocOrFile,
|
||||
} = useFileTreeActionable()
|
||||
|
||||
const createWithAnalytics = () => {
|
||||
eventTracking.sendMB('new-file-click', { location: 'toolbar' })
|
||||
startCreatingDocOrFile()
|
||||
}
|
||||
|
||||
const uploadWithAnalytics = () => {
|
||||
eventTracking.sendMB('upload-click', { location: 'toolbar' })
|
||||
startUploadingDocOrFile()
|
||||
}
|
||||
|
||||
if (!canCreate) return null
|
||||
|
||||
return (
|
||||
<div className="toolbar-left">
|
||||
<OLTooltip
|
||||
id="new-file"
|
||||
description={t('new_file')}
|
||||
overlayProps={{ placement: 'bottom' }}
|
||||
<div className="file-tree-toolbar">
|
||||
<button
|
||||
className="file-tree-expand-collapse-button"
|
||||
onClick={toggleFileTreeExpanded}
|
||||
aria-label={
|
||||
fileTreeExpanded ? t('hide_file_tree') : t('show_file_tree')
|
||||
}
|
||||
>
|
||||
<button className="btn" onClick={createWithAnalytics}>
|
||||
<MaterialIcon type="description" accessibilityLabel={t('new_file')} />
|
||||
</button>
|
||||
</OLTooltip>
|
||||
<OLTooltip
|
||||
id="new-folder"
|
||||
description={t('new_folder')}
|
||||
overlayProps={{ placement: 'bottom' }}
|
||||
>
|
||||
<button className="btn" onClick={startCreatingFolder} tabIndex={-1}>
|
||||
<MaterialIcon type="folder" accessibilityLabel={t('new_folder')} />
|
||||
</button>
|
||||
</OLTooltip>
|
||||
<OLTooltip
|
||||
id="upload"
|
||||
description={t('upload')}
|
||||
overlayProps={{ placement: 'bottom' }}
|
||||
>
|
||||
<button className="btn" onClick={uploadWithAnalytics} tabIndex={-1}>
|
||||
<MaterialIcon type="upload" accessibilityLabel={t('upload')} />
|
||||
</button>
|
||||
</OLTooltip>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
||||
function FileTreeToolbarRight() {
|
||||
const { t } = useTranslation()
|
||||
const { canRename, canDelete, startRenaming, startDeleting } =
|
||||
useFileTreeActionable()
|
||||
|
||||
return (
|
||||
<div className="toolbar-right">
|
||||
{fileTreeToolbarComponents.map(
|
||||
({ import: { default: Component }, path }) => (
|
||||
<Component key={path} />
|
||||
)
|
||||
)}
|
||||
|
||||
{canRename ? (
|
||||
<OLTooltip
|
||||
id="rename"
|
||||
description={t('rename')}
|
||||
overlayProps={{ placement: 'bottom' }}
|
||||
>
|
||||
<button className="btn" onClick={startRenaming} tabIndex={-1}>
|
||||
<MaterialIcon type="edit" accessibilityLabel={t('rename')} />
|
||||
</button>
|
||||
</OLTooltip>
|
||||
) : null}
|
||||
|
||||
{canDelete ? (
|
||||
<OLTooltip
|
||||
id="delete"
|
||||
description={t('delete')}
|
||||
overlayProps={{ placement: 'bottom' }}
|
||||
>
|
||||
<button className="btn" onClick={startDeleting} tabIndex={-1}>
|
||||
<MaterialIcon type="delete" accessibilityLabel={t('delete')} />
|
||||
</button>
|
||||
</OLTooltip>
|
||||
) : null}
|
||||
<MaterialIcon
|
||||
type={
|
||||
fileTreeExpanded ? 'keyboard_arrow_down' : 'keyboard_arrow_right'
|
||||
}
|
||||
/>
|
||||
<h4>{t('file_tree')}</h4>
|
||||
</button>
|
||||
<FileTreeActionButtons fileTreeExpanded={fileTreeExpanded} />
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
||||
@@ -6,7 +6,7 @@ import {
|
||||
RailTabKey,
|
||||
useRailContext,
|
||||
} from '@/features/ide-react/context/rail-context'
|
||||
import FileTreeOutlinePanel from '@/features/ide-redesign/components/file-tree/file-tree-outline-panel'
|
||||
import FileTreeOutlinePanel from '@/features/file-tree/components/file-tree-outline-panel'
|
||||
import ChatPane from '@/features/chat/components/chat-pane'
|
||||
import ChatIndicator from '@/features/chat/components/chat-indicator'
|
||||
import getMeta from '@/utils/meta'
|
||||
@@ -29,7 +29,7 @@ import RailPanel from './rail-panel'
|
||||
import RailResizeHandle from './rail-resize-handle'
|
||||
import RailModals from './rail-modals'
|
||||
import RailOverflowDropdown from './rail-overflow-dropdown'
|
||||
import useRailOverflow from '@/features/ide-redesign/hooks/use-rail-overflow'
|
||||
import useRailOverflow from '@/features/ide-react/hooks/use-rail-overflow'
|
||||
import EditorTourRailTooltip from '@/features/ide-redesign/components/editor-tour/editor-tour-rail-tooltip'
|
||||
import importOverleafModules from '../../../../../macros/import-overleaf-module.macro'
|
||||
import EditorTourThemeTooltip from '@/features/ide-redesign/components/editor-tour/editor-tour-theme-tooltip'
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { useCallback, useState } from 'react'
|
||||
import { RailElement } from '../../ide-react/util/rail-types'
|
||||
import { RailElement } from '../util/rail-types'
|
||||
import { useResizeObserver } from '@/shared/hooks/use-resize-observer'
|
||||
|
||||
const useRailOverflow = (railTabs: RailElement[]) => {
|
||||
@@ -1,32 +0,0 @@
|
||||
import { useTranslation } from 'react-i18next'
|
||||
import MaterialIcon from '@/shared/components/material-icon'
|
||||
import React from 'react'
|
||||
import useCollapsibleFileTree from '../../hooks/use-collapsible-file-tree'
|
||||
import FileTreeActionButtons from './file-tree-action-buttons'
|
||||
|
||||
function FileTreeToolbar() {
|
||||
const { t } = useTranslation()
|
||||
const { fileTreeExpanded, toggleFileTreeExpanded } = useCollapsibleFileTree()
|
||||
|
||||
return (
|
||||
<div className="file-tree-toolbar">
|
||||
<button
|
||||
className="file-tree-expand-collapse-button"
|
||||
onClick={toggleFileTreeExpanded}
|
||||
aria-label={
|
||||
fileTreeExpanded ? t('hide_file_tree') : t('show_file_tree')
|
||||
}
|
||||
>
|
||||
<MaterialIcon
|
||||
type={
|
||||
fileTreeExpanded ? 'keyboard_arrow_down' : 'keyboard_arrow_right'
|
||||
}
|
||||
/>
|
||||
<h4>{t('file_tree')}</h4>
|
||||
</button>
|
||||
<FileTreeActionButtons fileTreeExpanded={fileTreeExpanded} />
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
||||
export default FileTreeToolbar
|
||||
@@ -1,37 +0,0 @@
|
||||
import { postJSON } from '@/infrastructure/fetch-json'
|
||||
import { useUserSettingsContext } from '@/shared/context/user-settings-context'
|
||||
import { useCallback, useState } from 'react'
|
||||
|
||||
export const useSwitchEnableNewEditorState = () => {
|
||||
const [loading, setLoading] = useState(false)
|
||||
const [error, setError] = useState('')
|
||||
const { setUserSettings } = useUserSettingsContext()
|
||||
|
||||
const setEditorRedesignStatus = useCallback(
|
||||
(status: boolean): Promise<void> => {
|
||||
setLoading(true)
|
||||
setError('')
|
||||
return new Promise((resolve, reject) => {
|
||||
postJSON('/user/settings', {
|
||||
body: { enableNewEditor: status },
|
||||
})
|
||||
.then(() => {
|
||||
setUserSettings(current => ({
|
||||
...current,
|
||||
enableNewEditor: status,
|
||||
}))
|
||||
resolve()
|
||||
})
|
||||
.catch(e => {
|
||||
setError('Failed to update settings')
|
||||
reject(e)
|
||||
})
|
||||
.finally(() => {
|
||||
setLoading(false)
|
||||
})
|
||||
})
|
||||
},
|
||||
[setUserSettings]
|
||||
)
|
||||
return { loading, error, setEditorRedesignStatus }
|
||||
}
|
||||
@@ -3,7 +3,7 @@ import RadioButtonSetting, { RadioOption } from '../radio-button-setting'
|
||||
import {
|
||||
NotificationLevel,
|
||||
useProjectNotificationPreferences,
|
||||
} from '../../../ide-redesign/hooks/use-project-notification-preferences'
|
||||
} from '../../hooks/use-project-notification-preferences'
|
||||
|
||||
export default function ProjectNotificationsSetting() {
|
||||
const { t } = useTranslation()
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import MaterialIcon from '@/shared/components/material-icon'
|
||||
|
||||
import { Nav, NavLink, TabContainer, TabContent } from 'react-bootstrap'
|
||||
import { SettingsEntry } from '../../ide-redesign/contexts/settings-modal-context'
|
||||
import { SettingsEntry } from '../context/settings-modal-context'
|
||||
import SettingsTabPane from './settings-tab-pane'
|
||||
import BetaBadgeIcon from '@/shared/components/beta-badge-icon'
|
||||
import OLTooltip from '@/shared/components/ol/ol-tooltip'
|
||||
|
||||
@@ -9,8 +9,8 @@ import { SettingsModalBody } from './settings-modal-body'
|
||||
import {
|
||||
SettingsModalProvider,
|
||||
useSettingsModalContext,
|
||||
} from '../../ide-redesign/contexts/settings-modal-context'
|
||||
import useFocusOnSetting from '../../ide-redesign/hooks/use-focus-on-setting'
|
||||
} from '../context/settings-modal-context'
|
||||
import useFocusOnSetting from '../hooks/use-focus-on-setting'
|
||||
|
||||
const SettingsModalWrapper = () => {
|
||||
return (
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { TabPane } from 'react-bootstrap'
|
||||
import { SettingsTab } from '../../ide-redesign/contexts/settings-modal-context'
|
||||
import { SettingsTab } from '../context/settings-modal-context'
|
||||
import SettingsSection from './settings-section'
|
||||
import { Fragment } from 'react'
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { useEditorLeftMenuContext } from '@/features/editor-left-menu/components/editor-left-menu-context'
|
||||
import { useEffect, useState } from 'react'
|
||||
import { useSettingsModalContext } from '../contexts/settings-modal-context'
|
||||
import { useSettingsModalContext } from '../context/settings-modal-context'
|
||||
|
||||
/**
|
||||
* A hook to scroll to and focus on a specific setting in the settings modal
|
||||
@@ -2,7 +2,7 @@ import { useCallback, useEffect, useState } from 'react'
|
||||
import { useProjectContext } from '@/shared/context/project-context'
|
||||
import { getJSON, postJSON } from '@/infrastructure/fetch-json'
|
||||
import { debugConsole } from '@/utils/debugging'
|
||||
import type { NotificationPreferencesSchema } from '../../../../../modules/notifications/app/src/types.ts'
|
||||
import type { NotificationPreferencesSchema } from '../../../../../modules/notifications/app/src/types.js'
|
||||
|
||||
export type NotificationLevel = 'all' | 'replies' | 'off'
|
||||
|
||||
@@ -19,7 +19,7 @@ import {
|
||||
import MathPreviewTooltip from './math-preview-tooltip'
|
||||
import { getVisualEditorComponent } from '../utils/visual-editor'
|
||||
import EditorContextMenu from './editor-context-menu'
|
||||
import { useToolbarMenuBarEditorCommands } from '@/features/ide-redesign/hooks/use-toolbar-menu-editor-commands'
|
||||
import { useToolbarMenuBarEditorCommands } from '@/features/source-editor/hooks/use-toolbar-menu-editor-commands'
|
||||
import { useProjectContext } from '@/shared/context/project-context'
|
||||
import { useFeatureFlag } from '@/shared/context/split-test-context'
|
||||
import { useEditorOpenDocContext } from '@/features/ide-react/context/editor-open-doc-context'
|
||||
|
||||
@@ -13,7 +13,7 @@ import { redo, selectAll, undo } from '@codemirror/commands'
|
||||
import { openSearchPanel } from '@codemirror/search'
|
||||
import { useCallback } from 'react'
|
||||
import { useTranslation } from 'react-i18next'
|
||||
import { useIsNewEditorEnabled } from '../utils/new-editor-utils'
|
||||
import { useIsNewEditorEnabled } from '../../ide-redesign/utils/new-editor-utils'
|
||||
import { usePermissionsContext } from '@/features/ide-react/context/permissions-context'
|
||||
import { language } from '@codemirror/language'
|
||||
|
||||
@@ -28,7 +28,7 @@ describe('<FileTreeToolbar/>', function () {
|
||||
</EditorProviders>
|
||||
)
|
||||
|
||||
cy.findAllByRole('button').should('not.exist')
|
||||
cy.findAllByRole('button').should('have.length', 1)
|
||||
})
|
||||
|
||||
it('with one selected file', function () {
|
||||
@@ -53,7 +53,6 @@ describe('<FileTreeToolbar/>', function () {
|
||||
cy.findAllByRole('button', { name: 'New file' })
|
||||
cy.findAllByRole('button', { name: 'New folder' })
|
||||
cy.findAllByRole('button', { name: 'Upload' })
|
||||
cy.findAllByRole('button', { name: 'Rename' })
|
||||
cy.findAllByRole('button', { name: 'Delete' })
|
||||
cy.findAllByRole('button', { name: 'Close' })
|
||||
})
|
||||
})
|
||||
|
||||
@@ -3,7 +3,7 @@ import { expect } from 'chai'
|
||||
import fetchMock from 'fetch-mock'
|
||||
import { EditorProviders } from '../../../helpers/editor-providers'
|
||||
import AutoCloseBracketsSetting from '@/features/settings/components/editor-settings/auto-close-brackets-setting'
|
||||
import { SettingsModalProvider } from '@/features/ide-redesign/contexts/settings-modal-context'
|
||||
import { SettingsModalProvider } from '@/features/settings/context/settings-modal-context'
|
||||
|
||||
describe('<AutoCloseBracketsSetting />', function () {
|
||||
afterEach(function () {
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { screen, render } from '@testing-library/react'
|
||||
import { expect } from 'chai'
|
||||
import fetchMock from 'fetch-mock'
|
||||
import { SettingsModalProvider } from '@/features/ide-redesign/contexts/settings-modal-context'
|
||||
import { SettingsModalProvider } from '@/features/settings/context/settings-modal-context'
|
||||
import {
|
||||
EditorProviders,
|
||||
projectDefaults,
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { screen, render } from '@testing-library/react'
|
||||
import { expect } from 'chai'
|
||||
import fetchMock from 'fetch-mock'
|
||||
import { SettingsModalProvider } from '@/features/ide-redesign/contexts/settings-modal-context'
|
||||
import { SettingsModalProvider } from '@/features/settings/context/settings-modal-context'
|
||||
import { EditorProviders } from '../../../helpers/editor-providers'
|
||||
import AutoCompleteSetting from '@/features/settings/components/editor-settings/auto-complete-setting'
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { screen, render } from '@testing-library/react'
|
||||
import { expect } from 'chai'
|
||||
import fetchMock from 'fetch-mock'
|
||||
import { SettingsModalProvider } from '@/features/ide-redesign/contexts/settings-modal-context'
|
||||
import { SettingsModalProvider } from '@/features/settings/context/settings-modal-context'
|
||||
import { EditorProviders } from '../../../helpers/editor-providers'
|
||||
import BreadcrumbsSetting from '@/features/settings/components/editor-settings/breadcrumbs-setting'
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@ import { screen, render } from '@testing-library/react'
|
||||
import { expect } from 'chai'
|
||||
import fetchMock from 'fetch-mock'
|
||||
import { EditorProviders } from '../../../helpers/editor-providers'
|
||||
import { SettingsModalProvider } from '@/features/ide-redesign/contexts/settings-modal-context'
|
||||
import { SettingsModalProvider } from '@/features/settings/context/settings-modal-context'
|
||||
import CodeCheckSetting from '@/features/settings/components/editor-settings/code-check-setting'
|
||||
|
||||
describe('<CodeCheckSetting />', function () {
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { screen, within, render } from '@testing-library/react'
|
||||
import { expect } from 'chai'
|
||||
import fetchMock from 'fetch-mock'
|
||||
import { SettingsModalProvider } from '@/features/ide-redesign/contexts/settings-modal-context'
|
||||
import { SettingsModalProvider } from '@/features/settings/context/settings-modal-context'
|
||||
import {
|
||||
EditorProviders,
|
||||
projectDefaults,
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { fireEvent, screen, within, render } from '@testing-library/react'
|
||||
import { expect } from 'chai'
|
||||
import { SettingsModalProvider } from '@/features/ide-redesign/contexts/settings-modal-context'
|
||||
import { SettingsModalProvider } from '@/features/settings/context/settings-modal-context'
|
||||
import { EditorProviders } from '../../../helpers/editor-providers'
|
||||
import DictionarySetting from '@/features/settings/components/editor-settings/dictionary-setting'
|
||||
import RailModals from '@/features/ide-react/components/rail/rail-modals'
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { screen, within, render } from '@testing-library/react'
|
||||
import { expect } from 'chai'
|
||||
import { SettingsModalProvider } from '@/features/ide-redesign/contexts/settings-modal-context'
|
||||
import { SettingsModalProvider } from '@/features/settings/context/settings-modal-context'
|
||||
import {
|
||||
EditorProviders,
|
||||
projectDefaults,
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { screen, within, render } from '@testing-library/react'
|
||||
import { expect } from 'chai'
|
||||
import fetchMock from 'fetch-mock'
|
||||
import { SettingsModalProvider } from '@/features/ide-redesign/contexts/settings-modal-context'
|
||||
import { SettingsModalProvider } from '@/features/settings/context/settings-modal-context'
|
||||
import { EditorProviders } from '../../../helpers/editor-providers'
|
||||
import EditorThemeSetting from '@/features/settings/components/appearance-settings/editor-theme-setting'
|
||||
import userEvent from '@testing-library/user-event'
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { screen, within, render } from '@testing-library/react'
|
||||
import { expect } from 'chai'
|
||||
import fetchMock from 'fetch-mock'
|
||||
import { SettingsModalProvider } from '@/features/ide-redesign/contexts/settings-modal-context'
|
||||
import { SettingsModalProvider } from '@/features/settings/context/settings-modal-context'
|
||||
import { EditorProviders } from '../../../helpers/editor-providers'
|
||||
import FontFamilySetting from '@/features/settings/components/appearance-settings/font-family-setting'
|
||||
import userEvent from '@testing-library/user-event'
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { screen, within, render } from '@testing-library/react'
|
||||
import { expect } from 'chai'
|
||||
import fetchMock from 'fetch-mock'
|
||||
import { SettingsModalProvider } from '@/features/ide-redesign/contexts/settings-modal-context'
|
||||
import { SettingsModalProvider } from '@/features/settings/context/settings-modal-context'
|
||||
import { EditorProviders } from '../../../helpers/editor-providers'
|
||||
import FontSizeSetting from '@/features/settings/components/appearance-settings/font-size-setting'
|
||||
import userEvent from '@testing-library/user-event'
|
||||
|
||||
@@ -2,7 +2,7 @@ import { screen, within, render } from '@testing-library/react'
|
||||
import { expect } from 'chai'
|
||||
import fetchMock from 'fetch-mock'
|
||||
import type { ImageName } from '../../../../../types/project-settings'
|
||||
import { SettingsModalProvider } from '@/features/ide-redesign/contexts/settings-modal-context'
|
||||
import { SettingsModalProvider } from '@/features/settings/context/settings-modal-context'
|
||||
import {
|
||||
EditorProviders,
|
||||
projectDefaults,
|
||||
|
||||
@@ -2,7 +2,7 @@ import { screen, within, render } from '@testing-library/react'
|
||||
import { expect } from 'chai'
|
||||
import fetchMock from 'fetch-mock'
|
||||
import { EditorProviders } from '../../../helpers/editor-providers'
|
||||
import { SettingsModalProvider } from '@/features/ide-redesign/contexts/settings-modal-context'
|
||||
import { SettingsModalProvider } from '@/features/settings/context/settings-modal-context'
|
||||
import KeybindingSetting from '@/features/settings/components/editor-settings/keybinding-setting'
|
||||
import userEvent from '@testing-library/user-event'
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@ import { screen, within, render } from '@testing-library/react'
|
||||
import { expect } from 'chai'
|
||||
import fetchMock from 'fetch-mock'
|
||||
import { EditorProviders } from '../../../helpers/editor-providers'
|
||||
import { SettingsModalProvider } from '@/features/ide-redesign/contexts/settings-modal-context'
|
||||
import { SettingsModalProvider } from '@/features/settings/context/settings-modal-context'
|
||||
import LineHeightSetting from '@/features/settings/components/appearance-settings/line-height-setting'
|
||||
import userEvent from '@testing-library/user-event'
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@ import { screen, render } from '@testing-library/react'
|
||||
import { expect } from 'chai'
|
||||
import fetchMock from 'fetch-mock'
|
||||
import { EditorProviders } from '../../../helpers/editor-providers'
|
||||
import { SettingsModalProvider } from '@/features/ide-redesign/contexts/settings-modal-context'
|
||||
import { SettingsModalProvider } from '@/features/settings/context/settings-modal-context'
|
||||
import MathPreviewSetting from '@/features/settings/components/editor-settings/math-preview-setting'
|
||||
|
||||
describe('<MathPreviewSetting />', function () {
|
||||
|
||||
@@ -4,7 +4,7 @@ import fetchMock from 'fetch-mock'
|
||||
import type { OverallThemeMeta } from '../../../../../types/project-settings'
|
||||
import getMeta from '@/utils/meta'
|
||||
import { EditorProviders } from '../../../helpers/editor-providers'
|
||||
import { SettingsModalProvider } from '@/features/ide-redesign/contexts/settings-modal-context'
|
||||
import { SettingsModalProvider } from '@/features/settings/context/settings-modal-context'
|
||||
import OverallThemeSetting from '@/features/settings/components/appearance-settings/overall-theme-setting'
|
||||
|
||||
import userEvent from '@testing-library/user-event'
|
||||
|
||||
@@ -2,7 +2,7 @@ import { screen, within, render } from '@testing-library/react'
|
||||
import { expect } from 'chai'
|
||||
import fetchMock from 'fetch-mock'
|
||||
import { EditorProviders } from '../../../helpers/editor-providers'
|
||||
import { SettingsModalProvider } from '@/features/ide-redesign/contexts/settings-modal-context'
|
||||
import { SettingsModalProvider } from '@/features/settings/context/settings-modal-context'
|
||||
import PDFViewerSetting from '@/features/settings/components/editor-settings/pdf-viewer-setting'
|
||||
import userEvent from '@testing-library/user-event'
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@ import { screen, within, render } from '@testing-library/react'
|
||||
import { expect } from 'chai'
|
||||
import fetchMock from 'fetch-mock'
|
||||
import { Folder } from '../../../../../types/folder'
|
||||
import { SettingsModalProvider } from '@/features/ide-redesign/contexts/settings-modal-context'
|
||||
import { SettingsModalProvider } from '@/features/settings/context/settings-modal-context'
|
||||
import {
|
||||
EditorProviders,
|
||||
projectDefaults,
|
||||
|
||||
@@ -6,7 +6,7 @@ import {
|
||||
EditorProviders,
|
||||
projectDefaults,
|
||||
} from '../../../helpers/editor-providers'
|
||||
import { SettingsModalProvider } from '@/features/ide-redesign/contexts/settings-modal-context'
|
||||
import { SettingsModalProvider } from '@/features/settings/context/settings-modal-context'
|
||||
import SpellCheckSetting from '@/features/settings/components/editor-settings/spell-check-setting'
|
||||
import userEvent from '@testing-library/user-event'
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { screen, render } from '@testing-library/react'
|
||||
import { expect } from 'chai'
|
||||
import fetchMock from 'fetch-mock'
|
||||
import { SettingsModalProvider } from '@/features/ide-redesign/contexts/settings-modal-context'
|
||||
import { SettingsModalProvider } from '@/features/settings/context/settings-modal-context'
|
||||
import {
|
||||
EditorProviders,
|
||||
projectDefaults,
|
||||
|
||||
Reference in New Issue
Block a user