Skip to content

Restructure dashboard codebase #13278

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

Draft
wants to merge 23 commits into
base: develop
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
65a7a92
[dashboard] Move `dashboard/components/` to `react-components/`
somebody1234 Jun 14, 2025
74bb420
[dashboard] Move `dashboard/authentication/` to `authentication/`
somebody1234 Jun 14, 2025
487fbf6
[dashboard] Fix errors
somebody1234 Jun 14, 2025
f664226
[dashboard] Fix ESLint config
somebody1234 Jun 14, 2025
d6107f8
[dashboard] Move `dashboard/layouts/Settings/` to `settings/`
somebody1234 Jun 14, 2025
c5487da
[dashboard] Move `*/Drive/` to `data-catalog/`
somebody1234 Jun 14, 2025
f8d3732
[dashboard] Fix errors
somebody1234 Jun 14, 2025
d7a0f54
Merge branch 'develop' into wip/sb/restructure-dashboard-gui
somebody1234 Jun 14, 2025
d66aeba
[dashboard] Prettier
somebody1234 Jun 15, 2025
4905ea3
Merge branch 'develop' into wip/sb/restructure-dashboard-gui
somebody1234 Jun 16, 2025
d1243d4
Merge branch 'develop' into wip/sb/restructure-dashboard-gui
somebody1234 Jun 16, 2025
6fa79a3
[dashboard] Move `dashboard/services/` to `services/`
somebody1234 Jun 16, 2025
7afff3a
[dashboard] Move some hooks and modals
somebody1234 Jun 16, 2025
967d61d
[dashboard] Update `CODEOWNERS`; Move `dashboard/data/` to `data/`
somebody1234 Jun 16, 2025
5f2d84f
[dashboard] Remove unused assets
somebody1234 Jun 16, 2025
342b5f5
[dashboard] Prettier
somebody1234 Jun 16, 2025
ad8a336
[dashboard] Remove unused function
somebody1234 Jun 16, 2025
77bf213
[dashboard] Move `components/` to `components/ui/`
somebody1234 Jun 16, 2025
20ca79e
[dashboard] Move `dashboard/modules/payments/` to `payments/`
somebody1234 Jun 16, 2025
8e942a7
[dashboard] Move `dashboard/layouts/AssetPanel/` to `panels/`
somebody1234 Jun 16, 2025
56cd066
[dashboard] Move all files out of `modals/`, `pages/` and `layouts/`
somebody1234 Jun 16, 2025
555d3eb
[dashboard] Fix errors
somebody1234 Jun 16, 2025
c0ddddc
[dashboard] Move `dashboard/assets/` to `assets/`
somebody1234 Jun 16, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
17 changes: 7 additions & 10 deletions .github/CODEOWNERS
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@
CHANGELOG.md

# The repository settings
/.github/ @jdunkerley @AdRiley @hubertp @Frizi
/.github/ @jdunkerley @AdRiley @hubertp @Frizi
/.github/CODEOWNERS @jdunkerley @jaroslavtulach @farmaazon @AdRiley @PabloBuchu @wdanilo

# Build script & utilities
/run @jdunkerley @AdRiley @hubertp @Frizi
/run.bat @jdunkerley @AdRiley @hubertp @Frizi
/build @jdunkerley @AdRiley @hubertp @Frizi
/run @jdunkerley @AdRiley @hubertp @Frizi
/run.bat @jdunkerley @AdRiley @hubertp @Frizi
/build @jdunkerley @AdRiley @hubertp @Frizi

# Rust Libraries and Related Files
rust-toolchain.toml @vitvakatu @Frizi @kazcw @farmaazon @AdRiley
Expand All @@ -31,19 +31,16 @@ tsconfig.json

# GUI/Dashboard
/app @Frizi @farmaazon @vitvakatu @kazcw @AdRiley @PabloBuchu @indiv0 @somebody1234
/app/gui/integration-test @Frizi @farmaazon @vitvakatu @kazcw @AdRiley @PabloBuchu @indiv0 @somebody1234
/app/gui/src/dashboard @Frizi @farmaazon @vitvakatu @kazcw @AdRiley @PabloBuchu @indiv0 @somebody1234
/app/gui/src/project-view @Frizi @farmaazon @vitvakatu @kazcw @AdRiley @PabloBuchu @indiv0 @somebody1234
/app/gui @Frizi @farmaazon @vitvakatu @kazcw @AdRiley @PabloBuchu @indiv0 @somebody1234
/app/ide-desktop/ @Frizi @farmaazon @vitvakatu @kazcw @AdRiley @PabloBuchu @indiv0 @somebody1234
/app/ide-desktop/client/tasks/signArchivesMacOs.ts @jdunkerley @hubertp
/app/ide-desktop/client/tests @Frizi @farmaazon @vitvakatu @kazcw @AdRiley @PabloBuchu @indiv0 @somebody1234
/app/ydoc-server/ @Frizi @farmaazon @vitvakatu @kazcw @AdRiley
/app/ydoc-server-nodejs/ @Frizi @farmaazon @vitvakatu @kazcw @AdRiley
/app/ydoc-server-polyglot/ @Frizi @farmaazon @vitvakatu @kazcw @AdRiley
/app/ydoc-shared/ @Frizi @farmaazon @vitvakatu @kazcw @AdRiley
# The data-link schema is owned by the libraries team
/app/gui/src/dashboard/data/datalinkSchema.json @radeusgd @jdunkerley @GregoryTravis @AdRiley
/app/gui/src/dashboard/data/__tests__ @radeusgd @jdunkerley @GregoryTravis @AdRiley @PabloBuchu @indiv0 @somebody1234
/app/gui/src/data/datalinkSchema.json @radeusgd @jdunkerley @GregoryTravis @AdRiley
/app/gui/src/data/__tests__ @radeusgd @jdunkerley @GregoryTravis @AdRiley @PabloBuchu @indiv0 @somebody1234

# Engine (old)
# This section should be removed once the engine moves to /app/engine
Expand Down
2 changes: 1 addition & 1 deletion app/gui/.storybook/preview.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import type { Preview as VuePreview } from '@storybook/vue3'
import isChromatic from 'chromatic/isChromatic'
import { StrictMode, useLayoutEffect, useState } from 'react'

import UIProviders from '#/components/UIProviders'
import UIProviders from '$/react-components/UIProviders'
import invariant from 'tiny-invariant'

import '#/tailwind.css'
Expand Down
6 changes: 3 additions & 3 deletions app/gui/env.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -172,11 +172,11 @@ declare global {
}
}

// Add additional types for svg imports from `#/assets/*.svg`
// Add additional types for svg imports from `$/assets/*.svg`
declare module 'vite/client' {
declare module '#/assets/*.svg' {
declare module '$/assets/*.svg' {
/**
* @deprecated Prefer defined keys over importing from `#/assets/*.svg
* @deprecated Prefer defined keys over importing from `$/assets/*.svg
*/
const src: string
export default src
Expand Down
20 changes: 10 additions & 10 deletions app/gui/integration-test/dashboard/actions/api.ts
Original file line number Diff line number Diff line change
@@ -1,23 +1,23 @@
/** @file The mock API. */
import * as test from '@playwright/test'

import * as backend from '#/services/Backend'
import type * as remoteBackend from '#/services/RemoteBackend'
import * as remoteBackendPaths from '#/services/remoteBackendPaths'
import * as backend from '$/services/Backend'
import type * as remoteBackend from '$/services/RemoteBackend'
import * as remoteBackendPaths from '$/services/remoteBackendPaths'

import * as object from '#/utilities/object'
import * as permissions from '#/utilities/permissions'
import * as dateTime from 'enso-common/src/utilities/data/dateTime'
import * as uniqueString from 'enso-common/src/utilities/uniqueString'

import * as actions from '.'

import type { FeatureFlags } from '#/providers/FeatureFlagsProvider'
import { PermissionAction } from '#/utilities/permissions'
import type { FeatureFlags } from '$/providers/featureFlags'
import {
organizationIdToDirectoryId,
userGroupIdToDirectoryId,
userIdToDirectoryId,
} from '#/services/RemoteBackend'
} from '$/services/RemoteBackend'
import { readFileSync } from 'node:fs'
import { dirname, join } from 'node:path'
import { fileURLToPath } from 'node:url'
Expand Down Expand Up @@ -393,7 +393,7 @@ async function mockApiInternal({ page, setupAPI }: MockParams) {

const createUserPermission = (
user: backend.User,
permission: permissions.PermissionAction = permissions.PermissionAction.own,
permission: PermissionAction = PermissionAction.own,
rest: Partial<backend.UserPermission> = {},
): backend.UserPermission =>
object.merge(
Expand All @@ -406,7 +406,7 @@ async function mockApiInternal({ page, setupAPI }: MockParams) {

const createUserGroupPermission = (
userGroup: backend.UserGroupInfo,
permission: permissions.PermissionAction = permissions.PermissionAction.own,
permission: PermissionAction = PermissionAction.own,
rest: Partial<backend.UserGroupPermission> = {},
): backend.UserGroupPermission => object.merge({ userGroup, permission }, rest)

Expand All @@ -423,7 +423,7 @@ async function mockApiInternal({ page, setupAPI }: MockParams) {
description: rest.description ?? '',
labels: [],
parentId: defaultDirectoryId,
permissions: [createUserPermission(defaultUser, permissions.PermissionAction.own)],
permissions: [createUserPermission(defaultUser, PermissionAction.own)],
get parentsPath() {
return getParentPath(this.parentId)
},
Expand Down Expand Up @@ -1269,7 +1269,7 @@ async function mockApiInternal({ page, setupAPI }: MockParams) {
name: defaultUsername,
email: defaultEmail,
},
permission: permissions.PermissionAction.own,
permission: PermissionAction.own,
},
],
projectState: state,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
/**
* @file Global setup for dashboard tests.
*/

/** @file Global setup for dashboard tests. */
import * as matchers from '@testing-library/jest-dom/matchers'
import { cleanup } from '@testing-library/react'
import { MotionGlobalConfig } from 'framer-motion'
Expand Down
2 changes: 1 addition & 1 deletion app/gui/src/App.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<script setup lang="ts">
import LoadingScreenReact from '#/pages/authentication/LoadingScreen'
import LoadingScreenReact from '$/authentication/ui/LoadingScreen'
import RightPanel from '$/components/AppContainer/RightPanel.vue'
import { provideOpenedProjects } from '$/providers/openedProjects'
import { ContextsForReactProvider } from '$/providers/react/globalProvider'
Expand Down
12 changes: 6 additions & 6 deletions app/gui/src/ReactRoot.tsx
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
/** @file A file containing setup for React part of application. */

import App from '#/App.tsx'
import { ReactQueryDevtools } from '#/components/Devtools'
import { ErrorBoundary } from '#/components/ErrorBoundary'
import { OfflineNotificationManager } from '#/components/OfflineNotificationManager'
import { Suspense } from '#/components/Suspense'
import UIProviders from '#/components/UIProviders'
import { useMount } from '#/hooks/mountHooks'
import LoadingScreen from '#/pages/authentication/LoadingScreen'
import LoggerProvider from '#/providers/LoggerProvider'
import LoadingScreen from '$/authentication/ui/LoadingScreen'
import { ReactQueryDevtools } from '$/devtools'
import { useBackends } from '$/providers/backends'
import { useSetFeatureFlag } from '$/providers/react/featureFlags'
import { ErrorBoundary } from '$/react-components/ErrorBoundary'
import { OfflineNotificationManager } from '$/react-components/OfflineNotificationManager'
import { Suspense } from '$/react-components/Suspense'
import UIProviders from '$/react-components/UIProviders'
import { QueryClientProvider } from '@tanstack/react-query'
import { QueryClient } from '@tanstack/vue-query'
import { PropsWithChildren, StrictMode } from 'react'
Expand Down
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,11 @@ import { z } from 'zod'

/** A schema for validating passwords. */
export function passwordSchema(getText: GetText) {
return (
z
.string()
.trim()
// eslint-disable-next-line @typescript-eslint/no-magic-numbers
.min(6, { message: getText('passwordLengthError') })
// eslint-disable-next-line @typescript-eslint/no-magic-numbers
.max(256, { message: getText('passwordLengthError') })
)
return z
.string()
.trim()
.min(6, { message: getText('passwordLengthError') })
.max(256, { message: getText('passwordLengthError') })
}

/** A schema for validating passwords that match the required pattern. */
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
/** @file Modal for accepting the terms of service. */
import { Button } from '#/components/Button'
import { Checkbox } from '#/components/Checkbox'
import { Dialog } from '#/components/Dialog'
import { Form } from '#/components/Form'
import { Text } from '#/components/Text'
import { useLocalStorageState } from '#/hooks/localStoreState'
import LocalStorage from '#/utilities/LocalStorage'
import { useText } from '$/providers/react'
import { Button } from '$/react-components/Button'
import { Checkbox } from '$/react-components/Checkbox'
import { Dialog } from '$/react-components/Dialog'
import { Form } from '$/react-components/Form'
import { Text } from '$/react-components/Text'
import { queryOptions, useSuspenseQuery } from '@tanstack/react-query'
import * as React from 'react'
import { memo } from 'react'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@
* This is a component, NOT a page, but it is here because it is related to the authentication pages
* and nothing else.
*/
import { DIALOG_BACKGROUND } from '#/components/Dialog'
import { Form, type FormProps, type TSchema } from '#/components/Form'
import Page from '#/components/Page'
import { Text } from '#/components/Text'
import { useOffline } from '#/hooks/offlineHooks'
import { useText } from '$/providers/react'
import { DIALOG_BACKGROUND } from '$/react-components/Dialog'
import { Form, type FormProps, type TSchema } from '$/react-components/Form'
import Page from '$/react-components/Page'
import { Text } from '$/react-components/Text'
import type { ReactNode } from 'react'
import invariant from 'tiny-invariant'

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@
* @file Registration confirmation page for when a user clicks the confirmation link set to their
* email address.
*/
import { Button } from '#/components/Button'
import { Result } from '#/components/Result'
import { useMounted } from '#/hooks/mountHooks'
import { useTimeoutAPI } from '#/hooks/timeoutHooks'
import { noop } from '#/utilities/functions'
Expand All @@ -12,6 +10,8 @@ import * as appUtils from '$/appUtils'
import { useRouter, useSession, useText } from '$/providers/react'
import { useVueValue } from '$/providers/react/common'
import { useQueryParam } from '$/providers/react/queryParams'
import { Button } from '$/react-components/Button'
import { Result } from '$/react-components/Result'
import { useMutation } from '@tanstack/react-query'
import * as react from 'react'
import { stringifyQuery } from 'vue-router'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@
* @file Container responsible for rendering and interactions in first half of forgot password
* flow.
*/
import AtIcon from '#/assets/at.svg'
import GoBackIcon from '#/assets/go_back.svg'
import { Form } from '#/components/Form'
import { Input } from '#/components/Inputs/Input'
import Link from '#/components/Link'
import AuthenticationPage from '#/pages/authentication/AuthenticationPage'
import { LOGIN_PATH } from '$/appUtils'
import AtIcon from '$/assets/at.svg'
import GoBackIcon from '$/assets/go_back.svg'
import AuthenticationPage from '$/authentication/ui/AuthenticationPage'
import { useBackends, useRouter, useSession, useText } from '$/providers/react'
import { useQueryParam } from '$/providers/react/queryParams'
import { Form } from '$/react-components/Form'
import { Input } from '$/react-components/Inputs/Input'
import Link from '$/react-components/Link'
import { useState } from 'react'
import { toast } from 'react-toastify'

Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
/** @file A modal with inputs for user email and permission level. */
import { Form } from '#/components/Form'
import { ResizableContentEditableInput } from '#/components/Inputs/ResizableInput'
import * as paywallComponents from '#/components/Paywall'
import { backendMutationOptions } from '#/hooks/backendHooks'
import * as billingHooks from '#/hooks/billing'
import * as eventCallbackHooks from '#/hooks/eventCallbackHooks'
import type * as backendModule from '#/services/Backend'
import * as parserUserEmails from '#/utilities/parseUserEmails'
import { backendMutationOptions } from '$/data-catalog/hooks/backendHooks'
import * as authProvider from '$/providers/react'
import { useBackends, useText } from '$/providers/react'
import { Form } from '$/react-components/Form'
import { ResizableContentEditableInput } from '$/react-components/Inputs/ResizableInput'
import * as paywallComponents from '$/react-components/Paywall'
import type * as backendModule from '$/services/Backend'
import { useMutation, useSuspenseQuery } from '@tanstack/react-query'
import * as React from 'react'
import isEmail from 'validator/es/lib/isEmail'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
/** @file A modal with inputs for user email and permission level. */
import { Dialog, Popover } from '#/components/Dialog'
import { Stepper } from '#/components/Stepper'
import { useEventCallback } from '#/hooks/eventCallbackHooks'
import * as inviteUsersForm from '#/modals/InviteUsersModal/InviteUsersForm'
import * as inviteUsersSuccess from '#/modals/InviteUsersModal/InviteUsersSuccess'
import type * as backendModule from '#/services/Backend'
import * as authProvider from '$/providers/react'
import { useText } from '$/providers/react'
import { Dialog, Popover } from '$/react-components/Dialog'
import { Stepper } from '$/react-components/Stepper'
import type * as backendModule from '$/services/Backend'
import * as React from 'react'
import * as inviteUsersForm from './InviteUsersForm'
import * as inviteUsersSuccess from './InviteUsersSuccess'

/** Props for an {@link InviteUsersModal}. */
export interface InviteUsersModalProps {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
/** @file Success screen for the "invite users" modal. */
import { Button } from '#/components/Button'
import { CopyBlock } from '#/components/CopyBlock'
import * as result from '#/components/Result'
import { useRouter, useText } from '$/providers/react'
import { Button } from '$/react-components/Button'
import { CopyBlock } from '$/react-components/CopyBlock'
import * as result from '$/react-components/Result'
import * as React from 'react'

/**
Expand Down
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
/** @file Modal for accepting or rejecting an invite to an organization. */
import { Alert } from '#/components/Alert'
import { Button } from '#/components/Button'
import { Dialog } from '#/components/Dialog'
import { Form } from '#/components/Form'
import { Text } from '#/components/Text'
import { backendMutationOptions } from '#/hooks/backendHooks'
import { SUPPORT_EMAIL, SUPPORT_EMAIL_URL } from '$/appUtils'
import { backendMutationOptions } from '$/data-catalog/hooks/backendHooks'
import { useBackends, useFullUserSession, useText } from '$/providers/react'
import { Alert } from '$/react-components/Alert'
import { Button } from '$/react-components/Button'
import { Dialog } from '$/react-components/Dialog'
import { Form } from '$/react-components/Form'
import { Text } from '$/react-components/Text'
import { useMutation } from '@tanstack/react-query'
import * as React from 'react'
import * as z from 'zod'

/** Modal for accepting the terms of service. */
/** Modal for accepting or rejecting an invite to an organization. */
export function InvitedToOrganizationModal({ children }: React.PropsWithChildren) {
const { getText } = useText()
const { remoteBackend: backend } = useBackends()
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/** @file A loading screen, displayed while the user is logging in. */
import { StatelessSpinner } from '#/components/StatelessSpinner'
import { Text } from '#/components/Text'
import { useText } from '$/providers/react'
import { StatelessSpinner } from '$/react-components/StatelessSpinner'
import { Text } from '$/react-components/Text'

/** The diameter of the spinner. */
const SPINNER_SIZE_PX = 64
Expand Down
Original file line number Diff line number Diff line change
@@ -1,23 +1,23 @@
/** @file Login component responsible for rendering and interactions in sign in flow. */

import AtIcon from '#/assets/at.svg'
import CreateAccountIcon from '#/assets/create_account.svg'
import LockIcon from '#/assets/lock.svg'
import { Button } from '#/components/Button'
import { Form } from '#/components/Form'
import { Input } from '#/components/Inputs/Input'
import { OTPInput } from '#/components/Inputs/OTPInput'
import { Password } from '#/components/Inputs/Password'
import Link from '#/components/Link'
import { Stepper } from '#/components/Stepper'
import { Text } from '#/components/Text'
import { useEventCallback } from '#/hooks/eventCallbackHooks'
import AuthenticationPage from '#/pages/authentication/AuthenticationPage'
import { passwordSchema } from '#/pages/authentication/schemas'
import { DASHBOARD_PATH, FORGOT_PASSWORD_PATH, REGISTRATION_PATH } from '$/appUtils'
import AtIcon from '$/assets/at.svg'
import CreateAccountIcon from '$/assets/create_account.svg'
import LockIcon from '$/assets/lock.svg'
import type { CognitoUser } from '$/authentication/cognito'
import { passwordSchema } from '$/authentication/schemas'
import AuthenticationPage from '$/authentication/ui/AuthenticationPage'
import { useRouter, useSession, useText } from '$/providers/react'
import { useQueryParam } from '$/providers/react/queryParams'
import { Button } from '$/react-components/Button'
import { Form } from '$/react-components/Form'
import { Input } from '$/react-components/Inputs/Input'
import { OTPInput } from '$/react-components/Inputs/OTPInput'
import { Password } from '$/react-components/Inputs/Password'
import Link from '$/react-components/Link'
import { Stepper } from '$/react-components/Stepper'
import { Text } from '$/react-components/Text'
import { isOnElectron } from 'enso-common/src/detect'
import { useState } from 'react'

Expand Down
Loading
Loading