From ff56f6aba87eb2d2ad828ea15cbb893c892a2479 Mon Sep 17 00:00:00 2001 From: Sergei Garin Date: Mon, 20 Jan 2025 12:38:02 +0400 Subject: [PATCH 1/4] Fix start modal tests --- .../integration-test/dashboard/actions/index.ts | 17 ++++++++++++----- .../dashboard/startModal.spec.ts | 9 +++++++-- 2 files changed, 19 insertions(+), 7 deletions(-) diff --git a/app/gui/integration-test/dashboard/actions/index.ts b/app/gui/integration-test/dashboard/actions/index.ts index cbcd73b865f6..edff93543c99 100644 --- a/app/gui/integration-test/dashboard/actions/index.ts +++ b/app/gui/integration-test/dashboard/actions/index.ts @@ -156,17 +156,24 @@ export function mockAll({ page, setupAPI }: MockParams) { }) } +export interface MockAllAndLoginParams extends MockParams { + readonly hideStartModal?: boolean | undefined +} + /** Set up all mocks, and log in with dummy credentials. */ -export function mockAllAndLogin({ page, setupAPI }: MockParams) { +export function mockAllAndLogin({ page, setupAPI, hideStartModal = true }: MockAllAndLoginParams) { const actions = mockAll({ page, setupAPI }) + return actions .step('Login', (page) => login({ page })) .step('Wait for dashboard to load', waitForDashboardToLoad) .step('Check if start modal is shown', async (page) => { - // @ts-expect-error This is the only place in which the private member `.context` - // should be accessed. - const context = actions.context - await new StartModalActions(page, context).close() + if (hideStartModal) { + // @ts-expect-error This is the only place in which the private member `.context` + // should be accessed. + const context = actions.context + await new StartModalActions(page, context).close() + } }) .into(DrivePageActions) } diff --git a/app/gui/integration-test/dashboard/startModal.spec.ts b/app/gui/integration-test/dashboard/startModal.spec.ts index 26c46abda262..b1393c47aa3f 100644 --- a/app/gui/integration-test/dashboard/startModal.spec.ts +++ b/app/gui/integration-test/dashboard/startModal.spec.ts @@ -2,6 +2,7 @@ import { expect, test, type Page } from '@playwright/test' import { mockAllAndLogin } from './actions' +import StartModalActions from './actions/StartModalActions' /** Find an editor container. */ function locateEditor(page: Page) { @@ -22,8 +23,12 @@ function locateSamples(page: Page) { } test('create project from template', ({ page }) => - mockAllAndLogin({ page, setupAPI: (api) => api.setFeatureFlags({ enableCloudExecution: true }) }) - .openStartModal() + mockAllAndLogin({ + page, + setupAPI: (api) => api.setFeatureFlags({ enableCloudExecution: true }), + hideStartModal: false, + }) + .into(StartModalActions) .createProjectFromTemplate(0) .do(async (thePage) => { await expect(locateEditor(thePage)).toBeAttached() From b7300c9c58a37271a39cebe3ca699eac84f313f6 Mon Sep 17 00:00:00 2001 From: Sergei Garin Date: Tue, 4 Mar 2025 12:57:33 +0300 Subject: [PATCH 2/4] Remove start modal --- .../dashboard/components/ErrorBoundary.tsx | 33 +++++ app/gui/src/dashboard/layouts/StartModal.tsx | 58 -------- .../dashboard/Drive/DriveBar/DriveBar.tsx | 66 +-------- .../Drive/DriveBar/DriveBarToolbar.tsx | 132 +++++++++++------- 4 files changed, 116 insertions(+), 173 deletions(-) delete mode 100644 app/gui/src/dashboard/layouts/StartModal.tsx diff --git a/app/gui/src/dashboard/components/ErrorBoundary.tsx b/app/gui/src/dashboard/components/ErrorBoundary.tsx index ae2349dab156..276072dcdde1 100644 --- a/app/gui/src/dashboard/components/ErrorBoundary.tsx +++ b/app/gui/src/dashboard/components/ErrorBoundary.tsx @@ -13,10 +13,12 @@ import * as textProvider from '#/providers/TextProvider' import * as ariaComponents from '#/components/AriaComponents' import * as result from '#/components/Result' +import { Button, Text, type SvgUseIcon } from '#/components/AriaComponents' import { useEventCallback } from '#/hooks/eventCallbackHooks' import * as errorUtils from '#/utilities/error' import { OfflineError } from '#/utilities/HttpClient' import type { FallbackProps } from 'react-error-boundary' +import { Icon } from './Icon' import SvgMask from './SvgMask' // ===================== @@ -201,4 +203,35 @@ export function ErrorDisplay(props: ErrorDisplayProps): React.JSX.Element { return <>{render ?? defaultRender} } +/** Props for an {@link InlineErrorDisplay}. */ +export interface InlineErrorDisplayProps extends Omit {} + +/** Displays an error inline. */ +export function InlineErrorDisplay(props: InlineErrorDisplayProps) { + const { error, resetErrorBoundary, onBeforeFallbackShown, title, resetQueries = () => {} } = props + + const { getText } = textProvider.useText() + + const render = onBeforeFallbackShown?.({ error, resetErrorBoundary, resetQueries }) + + const onReset = useEventCallback(() => { + resetErrorBoundary() + }) + + const finalTitle = title ?? getText('somethingWentWrong') + const finalIcon: SvgUseIcon = 'error' + + const defaultRender = ( +
+ + {finalTitle} + +
+ ) + + return <>{render ?? defaultRender} +} + export { useErrorBoundary, withErrorBoundary } from 'react-error-boundary' diff --git a/app/gui/src/dashboard/layouts/StartModal.tsx b/app/gui/src/dashboard/layouts/StartModal.tsx deleted file mode 100644 index 9068c51f1a07..000000000000 --- a/app/gui/src/dashboard/layouts/StartModal.tsx +++ /dev/null @@ -1,58 +0,0 @@ -/** @file A modal containing project templates and news. */ -import * as React from 'react' - -import * as textProvider from '#/providers/TextProvider' - -import Samples from '#/layouts/Samples' -import WhatsNew from '#/layouts/WhatsNew' - -import * as ariaComponents from '#/components/AriaComponents' - -// ================== -// === StartModal === -// ================== - -/** Props for a {@link StartModal}. */ -export interface StartModalProps { - readonly createProject: (templateId?: string | null, templateName?: string | null) => void -} - -/** A modal containing project templates and news. */ -export default function StartModal(props: StartModalProps) { - const { createProject } = props - const { getText } = textProvider.useText() - - return ( - - {(opts) => ( -
- - - { - createProject(templateId, templateName) - opts.close() - }} - /> - - { - createProject(templateId, templateName) - opts.close() - }} - /> - - { - createProject(templateId, templateName) - opts.close() - }} - /> -
- )} -
- ) -} diff --git a/app/gui/src/dashboard/pages/dashboard/Drive/DriveBar/DriveBar.tsx b/app/gui/src/dashboard/pages/dashboard/Drive/DriveBar/DriveBar.tsx index 42af11792a2e..670901c51bff 100644 --- a/app/gui/src/dashboard/pages/dashboard/Drive/DriveBar/DriveBar.tsx +++ b/app/gui/src/dashboard/pages/dashboard/Drive/DriveBar/DriveBar.tsx @@ -6,12 +6,7 @@ import type { Category } from '#/layouts/CategorySwitcher/Category' import type Backend from '#/services/Backend' import type AssetQuery from '#/utilities/AssetQuery' -import { useEffect, useState } from 'react' -import { useErrorBoundary } from '#/components/ErrorBoundary' -import { listDirectoryQueryOptions } from '#/hooks/backendHooks' -import type { DirectoryId } from '#/services/Backend' -import { useQueryClient, useSuspenseQuery } from '@tanstack/react-query' import { DriveBarNavigation } from './DriveBarNavigation' import { DriveBarToolbar } from './DriveBarToolbar' @@ -21,77 +16,20 @@ export interface DriveBarProps { readonly query: AssetQuery readonly setQuery: React.Dispatch> readonly category: Category - readonly rootDirectoryId: DirectoryId } -const CATEGORIES_TO_DISPLAY_START_MODAL = ['cloud', 'local', 'local-directory'] - /** * Displays the current directory path and permissions, upload and download buttons, * and a column display mode switcher. */ export function DriveBar(props: DriveBarProps) { - const { backend, query, setQuery, category, rootDirectoryId } = props - - const [shouldForceHideStartModal, setShouldForceHideStartModal] = useState(false) - const { showBoundary } = useErrorBoundary() - - const queryClient = useQueryClient() - const rootDirectoryQuery = listDirectoryQueryOptions({ - backend, - category, - parentId: rootDirectoryId, - }) - - const { - data: isEmpty, - error, - isFetching, - } = useSuspenseQuery({ - ...rootDirectoryQuery, - select: (data) => data.length === 0, - }) - - // Show the error boundary if the query failed, but has data. - if (error != null && !isFetching) { - showBoundary(error) - // Remove the query from the cache. - // This will force the query to be refetched when the user navigates again. - queryClient.removeQueries({ queryKey: rootDirectoryQuery.queryKey }) - } - - // When the directory is no longer empty, we need to hide the start modal. - // This includes the cases when the directory wasn't empty before, but it's now empty - // (e.g. when the user deletes the last asset). - useEffect(() => { - if (!isEmpty) { - setShouldForceHideStartModal(true) - } - }, [isEmpty]) - - // When the root directory changes, we need to show the start modal - // if the directory is empty. - useEffect(() => { - setShouldForceHideStartModal(false) - }, [category.type]) - - const shouldDisplayStartModal = - isEmpty && - CATEGORIES_TO_DISPLAY_START_MODAL.includes(category.type) && - !shouldForceHideStartModal + const { backend, query, setQuery, category } = props return (
- +
) } diff --git a/app/gui/src/dashboard/pages/dashboard/Drive/DriveBar/DriveBarToolbar.tsx b/app/gui/src/dashboard/pages/dashboard/Drive/DriveBar/DriveBarToolbar.tsx index dbc3ce561d04..2c417bb3d663 100644 --- a/app/gui/src/dashboard/pages/dashboard/Drive/DriveBar/DriveBarToolbar.tsx +++ b/app/gui/src/dashboard/pages/dashboard/Drive/DriveBar/DriveBarToolbar.tsx @@ -17,12 +17,19 @@ import { Text, useVisualTooltip, } from '#/components/AriaComponents' +import { ErrorBoundary, InlineErrorDisplay } from '#/components/ErrorBoundary' import { deleteAssetsMutationOptions, downloadAssetsMutationOptions, getAllTrashedItems, } from '#/hooks/backendBatchedHooks' -import { useNewDatalink, useNewFolder, useNewProject, useNewSecret } from '#/hooks/backendHooks' +import { + listDirectoryQueryOptions, + useNewDatalink, + useNewFolder, + useNewProject, + useNewSecret, +} from '#/hooks/backendHooks' import { useUploadFiles } from '#/hooks/backendUploadFilesHooks' import { useEventCallback } from '#/hooks/eventCallbackHooks' import { useOffline } from '#/hooks/offlineHooks' @@ -34,7 +41,6 @@ import { type Category, } from '#/layouts/CategorySwitcher/Category' import { useDirectoryIds } from '#/layouts/Drive/directoryIdsHooks' -import StartModal from '#/layouts/StartModal' import ConfirmDeleteModal from '#/modals/ConfirmDeleteModal' import UpsertDatalinkModal from '#/modals/UpsertDatalinkModal' import UpsertSecretModal from '#/modals/UpsertSecretModal' @@ -44,10 +50,12 @@ import { useInputBindings } from '#/providers/InputBindingsProvider' import { useSetModal } from '#/providers/ModalProvider' import { useText } from '#/providers/TextProvider' import type Backend from '#/services/Backend' +import type { DirectoryId } from '#/services/Backend' import type AssetQuery from '#/utilities/AssetQuery' import * as sanitizedEventTargets from '#/utilities/sanitizedEventTargets' -import { useMutation, useQueryClient } from '@tanstack/react-query' +import { useMutation, useQueryClient, useSuspenseQuery } from '@tanstack/react-query' import { readUserSelectedFile } from 'enso-common/src/utilities/file' +import type { PropsWithChildren } from 'react' /** Props for a {@link DriveBar}. */ export interface DriveBarToolbarProps { @@ -55,8 +63,6 @@ export interface DriveBarToolbarProps { readonly query: AssetQuery readonly setQuery: React.Dispatch> readonly category: Category - readonly isEmpty: boolean - readonly shouldDisplayStartModal: boolean } /** @@ -64,9 +70,8 @@ export interface DriveBarToolbarProps { * and a column display mode switcher. */ export function DriveBarToolbar(props: DriveBarToolbarProps) { - const { backend, query, setQuery, category, isEmpty, shouldDisplayStartModal } = props + const { backend, query, setQuery, category } = props - const queryClient = useQueryClient() const { unsetModal } = useSetModal() const { getText } = useText() const driveStore = useDriveStore() @@ -100,7 +105,6 @@ export function DriveBarToolbar(props: DriveBarToolbarProps) { : null const downloadAssetsMutation = useMutation(downloadAssetsMutationOptions(backend)) - const deleteAssetsMutation = useMutation(deleteAssetsMutationOptions(backend)) const newFolder = useNewFolder(backend, category) const uploadFilesRaw = useUploadFiles(backend, category) const uploadFiles = useEventCallback(async (files: readonly File[]) => { @@ -124,13 +128,6 @@ export function DriveBarToolbar(props: DriveBarToolbarProps) { ]) => await newProjectRaw({ templateName, templateId }, currentDirectoryId), }) - const isCreatingProject = newProjectMutation.isPending - - const clearTrash = useEventCallback(async () => { - const allTrashedItems = await getAllTrashedItems(queryClient, backend) - await deleteAssetsMutation.mutateAsync([allTrashedItems.map((item) => item.id), true]) - }) - const attachEventListeners = useEventCallback(() => inputBindings.attach(sanitizedEventTargets.document.body, 'keydown', { ...(isCloud ? @@ -185,23 +182,18 @@ export function DriveBarToolbar(props: DriveBarToolbarProps) { } case 'trash': { return ( - - - - - { - await clearTrash() - }} - /> - - {pasteDataStatus} - {searchBar} - {assetPanelToggle} - + + + {pasteDataStatus} + {searchBar} + {assetPanelToggle} + + ) } case 'cloud': @@ -217,26 +209,8 @@ export function DriveBarToolbar(props: DriveBarToolbarProps) { buttonVariants={{ isDisabled: shouldBeDisabled }} {...createAssetsVisualTooltip.targetProps} > - - - - { - void newProjectMutation.mutateAsync([templateId, templateName]) - }} - /> - + + { + await clearTrash() + }} + /> + + + {children} + + ) +} From 8b69ce10f8fe73d2768e1212f351d73cc83e6bc5 Mon Sep 17 00:00:00 2001 From: Sergei Garin Date: Tue, 4 Mar 2025 13:01:34 +0300 Subject: [PATCH 3/4] Remove start modal --- .../dashboard/actions/DrivePageActions.ts | 15 ----- .../dashboard/actions/StartModalActions.ts | 61 ------------------- .../dashboard/actions/index.ts | 15 +---- .../dashboard/assetPanel.spec.ts | 7 --- .../dashboard/createAsset.spec.ts | 2 - .../integration-test/dashboard/delete.spec.ts | 5 -- .../dashboard/loginLogout.spec.ts | 2 - .../dashboard/startModal.spec.ts | 36 ----------- 8 files changed, 2 insertions(+), 141 deletions(-) delete mode 100644 app/gui/integration-test/dashboard/actions/StartModalActions.ts delete mode 100644 app/gui/integration-test/dashboard/startModal.spec.ts diff --git a/app/gui/integration-test/dashboard/actions/DrivePageActions.ts b/app/gui/integration-test/dashboard/actions/DrivePageActions.ts index 7cbef0ea6018..952e99012c6a 100644 --- a/app/gui/integration-test/dashboard/actions/DrivePageActions.ts +++ b/app/gui/integration-test/dashboard/actions/DrivePageActions.ts @@ -8,7 +8,6 @@ import EditorPageActions from './EditorPageActions' import { goToPageActions, type GoToPageActions } from './goToPageActions' import NewDataLinkModalActions from './NewDataLinkModalActions' import PageActions from './PageActions' -import StartModalActions from './StartModalActions' const ASSET_ROW_SAFE_POSITION = { x: 150, y: 16 } @@ -368,20 +367,6 @@ export default class DrivePageActions extends PageActions { } } - /** Open the "start" modal. */ - openStartModal() { - return this.step('Open "start" modal', (page) => - page.getByText(TEXT.startWithATemplate).click(), - ).into(StartModalActions) - } - - /** Expect the "start" modal to be visible. */ - expectStartModal() { - return this.into(StartModalActions).withStartModal(async (startModal) => { - await expect(startModal).toBeVisible() - }) - } - /** Clear trash. */ clearTrash() { return this.step('Clear trash', async (page) => { diff --git a/app/gui/integration-test/dashboard/actions/StartModalActions.ts b/app/gui/integration-test/dashboard/actions/StartModalActions.ts deleted file mode 100644 index 2322d6733fa5..000000000000 --- a/app/gui/integration-test/dashboard/actions/StartModalActions.ts +++ /dev/null @@ -1,61 +0,0 @@ -/** @file Actions for the "home" page. */ -import type { Page } from '@playwright/test' -import BaseActions, { type LocatorCallback } from './BaseActions' -import DrivePageActions from './DrivePageActions' -import EditorPageActions from './EditorPageActions' - -/** Find a samples list. */ -function locateSamplesList(page: Page) { - // This has no identifying features. - return page.getByTestId('samples') -} - -/** Find all samples list. */ -function locateSamples(page: Page) { - // This has no identifying features. - return locateSamplesList(page).getByRole('button') -} - -/** Actions for the "start" modal. */ -export default class StartModalActions extends BaseActions { - /** Close this modal and go back to the Drive page. */ - close() { - return this.step('Close start modal', async (page) => { - const isOnScreen = await this.isStartModalShown(page) - if (isOnScreen) { - await this.locateStartModal(page).getByTestId('close-button').click() - } - }).into(DrivePageActions) - } - - /** Locate the "start" modal. */ - private locateStartModal(page: Page) { - return page.getByTestId('start-modal') - } - - /** Check if the Asset Panel is shown. */ - private isStartModalShown(page: Page) { - return this.locateStartModal(page) - .isHidden() - .then( - (result) => !result, - () => false, - ) - } - - /** Create a project from the template at the given index. */ - createProjectFromTemplate(index: number) { - return this.step(`Create project from template #${index}`, (page) => - locateSamples(page) - .nth(index + 1) - .click(), - ).into(EditorPageActions) - } - - /** Interact with the "start" modal. */ - withStartModal(callback: LocatorCallback) { - return this.step('Interact with start modal', async (page, context) => { - await callback(this.locateStartModal(page), context) - }) - } -} diff --git a/app/gui/integration-test/dashboard/actions/index.ts b/app/gui/integration-test/dashboard/actions/index.ts index edff93543c99..b5e1302d376f 100644 --- a/app/gui/integration-test/dashboard/actions/index.ts +++ b/app/gui/integration-test/dashboard/actions/index.ts @@ -17,7 +17,6 @@ import { import DrivePageActions from './DrivePageActions' import LATEST_GITHUB_RELEASES from './latestGithubReleases.json' with { type: 'json' } import LoginPageActions from './LoginPageActions' -import StartModalActions from './StartModalActions' /** An example password that does not meet validation requirements. */ export const INVALID_PASSWORD = 'password' @@ -156,25 +155,15 @@ export function mockAll({ page, setupAPI }: MockParams) { }) } -export interface MockAllAndLoginParams extends MockParams { - readonly hideStartModal?: boolean | undefined -} +export interface MockAllAndLoginParams extends MockParams {} /** Set up all mocks, and log in with dummy credentials. */ -export function mockAllAndLogin({ page, setupAPI, hideStartModal = true }: MockAllAndLoginParams) { +export function mockAllAndLogin({ page, setupAPI }: MockAllAndLoginParams) { const actions = mockAll({ page, setupAPI }) return actions .step('Login', (page) => login({ page })) .step('Wait for dashboard to load', waitForDashboardToLoad) - .step('Check if start modal is shown', async (page) => { - if (hideStartModal) { - // @ts-expect-error This is the only place in which the private member `.context` - // should be accessed. - const context = actions.context - await new StartModalActions(page, context).close() - } - }) .into(DrivePageActions) } diff --git a/app/gui/integration-test/dashboard/assetPanel.spec.ts b/app/gui/integration-test/dashboard/assetPanel.spec.ts index 37e8ffd05102..ba0c47716853 100644 --- a/app/gui/integration-test/dashboard/assetPanel.spec.ts +++ b/app/gui/integration-test/dashboard/assetPanel.spec.ts @@ -19,13 +19,6 @@ function locateAssetPanelDescription(page: Page) { return locateAssetPanel(page).getByTestId('asset-panel-description') } -/** Find asset permissions in an asset panel. */ -// eslint-disable-next-line @typescript-eslint/no-unused-vars -function locateAssetPanelPermissions(page: Page) { - // This has no identifying features. - return locateAssetPanel(page).getByTestId('asset-panel-permissions').getByRole('button') -} - /** An example description for the asset selected in the asset panel. */ const DESCRIPTION = 'foo bar' /** An example owner username for the asset selected in the asset panel. */ diff --git a/app/gui/integration-test/dashboard/createAsset.spec.ts b/app/gui/integration-test/dashboard/createAsset.spec.ts index 8db20ab0f219..1a704d7e176f 100644 --- a/app/gui/integration-test/dashboard/createAsset.spec.ts +++ b/app/gui/integration-test/dashboard/createAsset.spec.ts @@ -24,8 +24,6 @@ test('create folder', ({ page }) => test('create project', ({ page }) => mockAllAndLogin({ page }) .newEmptyProject() - // FIXME[sb]: https://github.com/enso-org/cloud-v2/issues/1615 - // Uncomment once cloud execution in the browser is re-enabled. .waitForEditorToLoad() .goToPage.drive() .driveTable.withRows((rows) => expect(rows).toHaveCount(1))) diff --git a/app/gui/integration-test/dashboard/delete.spec.ts b/app/gui/integration-test/dashboard/delete.spec.ts index f1b68c344370..461d586b92db 100644 --- a/app/gui/integration-test/dashboard/delete.spec.ts +++ b/app/gui/integration-test/dashboard/delete.spec.ts @@ -83,11 +83,6 @@ test('clear trash', ({ page }) => .clearTrash() .driveTable.expectTrashPlaceholderRow() .goToCategory.cloud() - .expectStartModal() - .withStartModal(async (startModal) => { - await expect(startModal).toBeVisible() - }) - .close() .driveTable.withRows(async (rows) => { await expect(rows).toHaveCount(0) })) diff --git a/app/gui/integration-test/dashboard/loginLogout.spec.ts b/app/gui/integration-test/dashboard/loginLogout.spec.ts index c4660ff68333..2d6ff1cf1b0f 100644 --- a/app/gui/integration-test/dashboard/loginLogout.spec.ts +++ b/app/gui/integration-test/dashboard/loginLogout.spec.ts @@ -20,8 +20,6 @@ test.use({ storageState: { cookies: [], origins: [] } }) test('login and logout', ({ page }) => mockAll({ page }) .login() - .expectStartModal() - .close() .withDriveView(async (driveView) => { await expect(driveView).toBeVisible() }) diff --git a/app/gui/integration-test/dashboard/startModal.spec.ts b/app/gui/integration-test/dashboard/startModal.spec.ts deleted file mode 100644 index b1393c47aa3f..000000000000 --- a/app/gui/integration-test/dashboard/startModal.spec.ts +++ /dev/null @@ -1,36 +0,0 @@ -/** @file Test the "change password" modal. */ -import { expect, test, type Page } from '@playwright/test' - -import { mockAllAndLogin } from './actions' -import StartModalActions from './actions/StartModalActions' - -/** Find an editor container. */ -function locateEditor(page: Page) { - // Test ID of a placeholder editor component used during testing. - return page.locator('.ProjectView') -} - -/** Find a samples list. */ -function locateSamplesList(page: Page) { - // This has no identifying features. - return page.getByTestId('samples') -} - -/** Find all samples list. */ -function locateSamples(page: Page) { - // This has no identifying features. - return locateSamplesList(page).getByRole('button') -} - -test('create project from template', ({ page }) => - mockAllAndLogin({ - page, - setupAPI: (api) => api.setFeatureFlags({ enableCloudExecution: true }), - hideStartModal: false, - }) - .into(StartModalActions) - .createProjectFromTemplate(0) - .do(async (thePage) => { - await expect(locateEditor(thePage)).toBeAttached() - await expect(locateSamples(page).first()).not.toBeVisible() - })) From b99a5b46986f25a5de6a1914740aa90c25ad9257 Mon Sep 17 00:00:00 2001 From: Sergei Garin Date: Tue, 4 Mar 2025 13:19:51 +0300 Subject: [PATCH 4/4] Fix ts --- app/gui/src/dashboard/layouts/Drive.tsx | 1 - .../pages/dashboard/Drive/DriveBar/DriveBarToolbar.tsx | 4 ++-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/app/gui/src/dashboard/layouts/Drive.tsx b/app/gui/src/dashboard/layouts/Drive.tsx index 3441d4ac61a6..69f22510bca3 100644 --- a/app/gui/src/dashboard/layouts/Drive.tsx +++ b/app/gui/src/dashboard/layouts/Drive.tsx @@ -204,7 +204,6 @@ function DriveAssetsView(props: DriveAssetsViewProps) { query={query} setQuery={setQuery} category={category} - rootDirectoryId={rootDirectoryId} /> {status === 'offline' ? diff --git a/app/gui/src/dashboard/pages/dashboard/Drive/DriveBar/DriveBarToolbar.tsx b/app/gui/src/dashboard/pages/dashboard/Drive/DriveBar/DriveBarToolbar.tsx index 2c417bb3d663..aa8b4bb81410 100644 --- a/app/gui/src/dashboard/pages/dashboard/Drive/DriveBar/DriveBarToolbar.tsx +++ b/app/gui/src/dashboard/pages/dashboard/Drive/DriveBar/DriveBarToolbar.tsx @@ -82,7 +82,7 @@ export function DriveBarToolbar(props: DriveBarToolbarProps) { const { user } = useFullUserSession() const canDownload = useCanDownload() - const { currentDirectoryId } = useDirectoryIds({ category }) + const { currentDirectoryId, rootDirectoryId } = useDirectoryIds({ category }) const shouldBeDisabled = isCloud && isOffline @@ -187,7 +187,7 @@ export function DriveBarToolbar(props: DriveBarToolbarProps) { shouldBeDisabled={shouldBeDisabled} backend={backend} category={category} - rootDirectoryId={currentDirectoryId} + rootDirectoryId={rootDirectoryId} > {pasteDataStatus} {searchBar}