Skip to content

Commit 32fbce9

Browse files
committed
Fix type errors
1 parent 73d0ef1 commit 32fbce9

File tree

8 files changed

+13
-15
lines changed

8 files changed

+13
-15
lines changed

app/gui/src/common/services/LocalBackend.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ export function extractTypeAndId<Id extends AssetId>(id: Id): AssetTypeAndId {
140140
* Class for sending requests to the Project Manager API endpoints.
141141
* This is used instead of the cloud backend API when managing local projects from the dashboard.
142142
*/
143-
export default class LocalBackend extends Backend {
143+
export class LocalBackend extends Backend {
144144
readonly type = BackendType.local
145145
/** All files that have been uploaded to the Project Manager. */
146146
uploadedFiles: Map<string, UploadedLargeAsset> = new Map()

app/gui/src/common/services/RemoteBackend.ts

+3-5
Original file line numberDiff line numberDiff line change
@@ -226,7 +226,7 @@ interface RemoteBackendPostOptions {
226226
}
227227

228228
/** Class for sending requests to the Cloud backend API endpoints. */
229-
export default class RemoteBackend extends Backend {
229+
export class RemoteBackend extends Backend {
230230
readonly type = BackendType.remote
231231
private user: Mutable<User> | null = null
232232

@@ -268,7 +268,6 @@ export default class RemoteBackend extends Backend {
268268
response == null || response.headers.get('Content-Type') !== 'application/json' ?
269269
{ message: 'unknown error' }
270270
// This is SAFE only when the response has been confirmed to have an erroring status code.
271-
// eslint-disable-next-line no-restricted-syntax
272271
: ((await response.json()) as RemoteBackendError)
273272
const message = `${this.getText(textId, ...replacements)}: ${error.message}.`
274273
this.logger.error(message)
@@ -436,7 +435,7 @@ export default class RemoteBackend extends Backend {
436435
/** Upload a new profile picture for the current user. */
437436
override async uploadUserPicture(params: UploadPictureRequestParams, file: Blob): Promise<User> {
438437
const paramsString = new URLSearchParams({
439-
// eslint-disable-next-line @typescript-eslint/naming-convention, camelcase
438+
// eslint-disable-next-line camelcase
440439
...(params.fileName != null ? { file_name: params.fileName } : {}),
441440
}).toString()
442441
const path = `${UPLOAD_USER_PICTURE_PATH}?${paramsString}`
@@ -504,7 +503,7 @@ export default class RemoteBackend extends Backend {
504503
file: Blob,
505504
): Promise<OrganizationInfo> {
506505
const paramsString = new URLSearchParams({
507-
// eslint-disable-next-line @typescript-eslint/naming-convention, camelcase
506+
// eslint-disable-next-line camelcase
508507
...(params.fileName != null ? { file_name: params.fileName } : {}),
509508
}).toString()
510509
const path = `${UPLOAD_ORGANIZATION_PICTURE_PATH}?${paramsString}`
@@ -594,7 +593,6 @@ export default class RemoteBackend extends Backend {
594593
const ret = (await response.json()).assets
595594
.map((asset) =>
596595
merge(asset, {
597-
// eslint-disable-next-line no-restricted-syntax
598596
type: asset.id.match(/^(.+?)-/)?.[1] as AssetType,
599597
// `Users` and `Teams` folders are virtual, so their children incorrectly have
600598
// the organization root id as their parent id.

app/gui/src/dashboard/App.tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -109,9 +109,9 @@ import { APP_BASE_URL } from '#/utilities/appBaseUrl'
109109
import { isElementPartOfMonaco, isElementTextInput } from '#/utilities/event'
110110
import LocalStorage from '#/utilities/LocalStorage'
111111
import { STATIC_QUERY_OPTIONS } from '#/utilities/reactQuery'
112-
import LocalBackend from '@common/services/LocalBackend'
112+
import { LocalBackend } from '@common/services/LocalBackend'
113113
import ProjectManager, * as projectManager from '@common/services/ProjectManager'
114-
import RemoteBackend from '@common/services/RemoteBackend'
114+
import { RemoteBackend } from '@common/services/RemoteBackend'
115115

116116
declare module '#/utilities/LocalStorage' {
117117
/** */

app/gui/src/dashboard/hooks/backendHooks.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ import { useSetModal } from '#/providers/ModalProvider'
7474
import { useText } from '#/providers/TextProvider'
7575
import { tryCreateOwnerPermission } from '#/utilities/permissions'
7676
import { usePreventNavigation } from '#/utilities/preventNavigation'
77-
import LocalBackend from '@common/services/LocalBackend'
77+
import { LocalBackend } from '@common/services/LocalBackend'
7878
import { TEAMS_DIRECTORY_ID, USERS_DIRECTORY_ID } from '@common/services/remoteBackendPaths'
7979

8080
// The number of bytes in 1 megabyte.

app/gui/src/dashboard/layouts/Settings/MembersSettingsSection.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import InviteUsersModal from '#/modals/InviteUsersModal'
1111
import { useFullUserSession } from '#/providers/AuthProvider'
1212
import { useRemoteBackend } from '#/providers/BackendProvider'
1313
import { useText } from '#/providers/TextProvider'
14-
import type RemoteBackend from '@common/services/RemoteBackend'
14+
import type { RemoteBackend } from '@common/services/RemoteBackend'
1515

1616
const LIST_USERS_STALE_TIME_MS = 60_000
1717

app/gui/src/dashboard/layouts/Settings/data.tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,8 @@ import type { ToastAndLogCallback } from '#/hooks/toastAndLogHooks'
3131
import { passwordWithPatternSchema } from '#/pages/authentication/schemas'
3232
import type { GetText } from '#/providers/TextProvider'
3333
import { PASSWORD_REGEX } from '#/utilities/validation'
34-
import type LocalBackend from '@common/services/LocalBackend'
35-
import type RemoteBackend from '@common/services/RemoteBackend'
34+
import type { LocalBackend } from '@common/services/LocalBackend'
35+
import type { RemoteBackend } from '@common/services/RemoteBackend'
3636
import ActivityLogSettingsSection from './ActivityLogSettingsSection'
3737
import DeleteUserAccountSettingsSection from './DeleteUserAccountSettingsSection'
3838
import KeyboardShortcutsSettingsSection from './KeyboardShortcutsSettingsSection'

app/gui/src/dashboard/providers/AuthProvider.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ import { useText } from '#/providers/TextProvider'
4747
import { Dialog } from '#/components/AriaComponents'
4848
import { Result } from '#/components/Result'
4949

50-
import type RemoteBackend from '@common/services/RemoteBackend'
50+
import type { RemoteBackend } from '@common/services/RemoteBackend'
5151

5252
import {
5353
CognitoErrorType,

app/gui/src/dashboard/providers/BackendProvider.tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@ import * as common from 'enso-common'
1212
import { type Category, isCloudCategory } from '#/layouts/CategorySwitcher/Category'
1313

1414
import { useEventCallback } from '#/hooks/eventCallbackHooks'
15-
import type LocalBackend from '@common/services/LocalBackend'
15+
import type { LocalBackend } from '@common/services/LocalBackend'
1616
import { ProjectManagerEvents } from '@common/services/ProjectManager'
17-
import type RemoteBackend from '@common/services/RemoteBackend'
17+
import type { RemoteBackend } from '@common/services/RemoteBackend'
1818

1919
/** State contained in a `BackendContext`. */
2020
export interface BackendContextType {

0 commit comments

Comments
 (0)