Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove Discovery button #12081

Merged
merged 4 commits into from
Mar 4, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 0 additions & 15 deletions app/gui/integration-test/dashboard/actions/DrivePageActions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 }

Expand Down Expand Up @@ -368,20 +367,6 @@ export default class DrivePageActions<Context> extends PageActions<Context> {
}
}

/** Open the "start" modal. */
openStartModal() {
return this.step('Open "start" modal', (page) =>
page.getByText(TEXT.startWithATemplate).click(),
).into(StartModalActions<Context>)
}

/** Expect the "start" modal to be visible. */
expectStartModal() {
return this.into(StartModalActions<Context>).withStartModal(async (startModal) => {
await expect(startModal).toBeVisible()
})
}

/** Clear trash. */
clearTrash() {
return this.step('Clear trash', async (page) => {
Expand Down
61 changes: 0 additions & 61 deletions app/gui/integration-test/dashboard/actions/StartModalActions.ts

This file was deleted.

12 changes: 4 additions & 8 deletions app/gui/integration-test/dashboard/actions/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down Expand Up @@ -156,18 +155,15 @@ export function mockAll({ page, setupAPI }: MockParams) {
})
}

export interface MockAllAndLoginParams extends MockParams {}

/** Set up all mocks, and log in with dummy credentials. */
export function mockAllAndLogin({ page, setupAPI }: MockParams) {
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) => {
// @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<Context>)
}

Expand Down
7 changes: 0 additions & 7 deletions app/gui/integration-test/dashboard/assetPanel.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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. */
Expand Down
2 changes: 0 additions & 2 deletions app/gui/integration-test/dashboard/createAsset.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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)))
Expand Down
5 changes: 0 additions & 5 deletions app/gui/integration-test/dashboard/delete.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}))
2 changes: 0 additions & 2 deletions app/gui/integration-test/dashboard/loginLogout.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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()
})
Expand Down
31 changes: 0 additions & 31 deletions app/gui/integration-test/dashboard/startModal.spec.ts

This file was deleted.

33 changes: 33 additions & 0 deletions app/gui/src/dashboard/components/ErrorBoundary.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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'

// =====================
Expand Down Expand Up @@ -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<ErrorDisplayProps, 'status' | 'subtitle'> {}

/** 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 = (
<div className="flex items-center gap-1">
<Icon icon={finalIcon} />
<Text>{finalTitle}</Text>
<Button variant="outline" size="xsmall" onPress={onReset} className="ml-3">
{getText('tryAgain')}
</Button>
</div>
)

return <>{render ?? defaultRender}</>
}

export { useErrorBoundary, withErrorBoundary } from 'react-error-boundary'
1 change: 0 additions & 1 deletion app/gui/src/dashboard/layouts/Drive.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,6 @@ function DriveAssetsView(props: DriveAssetsViewProps) {
query={query}
setQuery={setQuery}
category={category}
rootDirectoryId={rootDirectoryId}
/>

{status === 'offline' ?
Expand Down
58 changes: 0 additions & 58 deletions app/gui/src/dashboard/layouts/StartModal.tsx

This file was deleted.

Loading
Loading