diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index 858c4b5563..ceccea996b 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -47,5 +47,5 @@ Cargo.toml # Dashboard, Cloud & Authentication /app/ide-desktop/ @PabloBuchu @indiv0 @somebody1234 @MrFlashAccount # The data-link schema is owned by the libraries team -/app/ide-desktop/lib/dashboard/src/data/dataLinkSchema.json @radeusgd @jdunkerley @GregoryTravis @AdRiley +/app/ide-desktop/lib/dashboard/src/data/datalinkSchema.json @radeusgd @jdunkerley @GregoryTravis @AdRiley /app/ide-desktop/lib/dashboard/src/data/__tests__ @radeusgd @jdunkerley @GregoryTravis @AdRiley @PabloBuchu @indiv0 @somebody1234 diff --git a/app/ide-desktop/lib/assets/add_connector.svg b/app/ide-desktop/lib/assets/add_datalink.svg similarity index 100% rename from app/ide-desktop/lib/assets/add_connector.svg rename to app/ide-desktop/lib/assets/add_datalink.svg diff --git a/app/ide-desktop/lib/assets/connector.svg b/app/ide-desktop/lib/assets/datalink.svg similarity index 100% rename from app/ide-desktop/lib/assets/connector.svg rename to app/ide-desktop/lib/assets/datalink.svg diff --git a/app/ide-desktop/lib/dashboard/e2e/actions.ts b/app/ide-desktop/lib/dashboard/e2e/actions.ts index c089d27635..1b6ec39642 100644 --- a/app/ide-desktop/lib/dashboard/e2e/actions.ts +++ b/app/ide-desktop/lib/dashboard/e2e/actions.ts @@ -83,7 +83,7 @@ export function locateSecretValueInput(page: test.Page) { /** Find a search bar input (if any) on the current page. */ export function locateSearchBarInput(page: test.Page) { return locateSearchBar(page).getByPlaceholder( - 'Type to search for projects, Data Links, users, and more.' + 'Type to search for projects, Datalinks, users, and more.' ) } diff --git a/app/ide-desktop/lib/dashboard/src/components/JSONSchemaInput.tsx b/app/ide-desktop/lib/dashboard/src/components/JSONSchemaInput.tsx index b887821bad..3d3ef937e7 100644 --- a/app/ide-desktop/lib/dashboard/src/components/JSONSchemaInput.tsx +++ b/app/ide-desktop/lib/dashboard/src/components/JSONSchemaInput.tsx @@ -1,4 +1,4 @@ -/** @file A dynamic wizard for creating an arbitrary type of Data Link. */ +/** @file A dynamic wizard for creating an arbitrary type of Datalink. */ import * as React from 'react' import * as backendProvider from '#/providers/BackendProvider' @@ -31,7 +31,7 @@ export interface JSONSchemaInputProps { readonly setValue: React.Dispatch | null>> } -/** A dynamic wizard for creating an arbitrary type of Data Link. */ +/** A dynamic wizard for creating an arbitrary type of Datalink. */ export default function JSONSchemaInput(props: JSONSchemaInputProps) { const { dropdownTitle, readOnly = false, defs, schema, path, getValidator } = props const { value: valueRaw, setValue: setValueRaw } = props diff --git a/app/ide-desktop/lib/dashboard/src/components/MenuEntry.tsx b/app/ide-desktop/lib/dashboard/src/components/MenuEntry.tsx index 112848c724..32c9cf2950 100644 --- a/app/ide-desktop/lib/dashboard/src/components/MenuEntry.tsx +++ b/app/ide-desktop/lib/dashboard/src/components/MenuEntry.tsx @@ -43,7 +43,7 @@ const ACTION_TO_TEXT_ID: Readonly } - case backend.AssetType.dataLink: { - return + case backend.AssetType.datalink: { + return } case backend.AssetType.secret: { return diff --git a/app/ide-desktop/lib/dashboard/src/components/dashboard/AssetRow.tsx b/app/ide-desktop/lib/dashboard/src/components/dashboard/AssetRow.tsx index c0df4e96e9..914bd4b762 100644 --- a/app/ide-desktop/lib/dashboard/src/components/dashboard/AssetRow.tsx +++ b/app/ide-desktop/lib/dashboard/src/components/dashboard/AssetRow.tsx @@ -230,7 +230,7 @@ export default function AssetRow(props: AssetRowProps) { } case backendModule.AssetType.project: case backendModule.AssetType.secret: - case backendModule.AssetType.dataLink: + case backendModule.AssetType.datalink: case backendModule.AssetType.specialLoading: case backendModule.AssetType.specialEmpty: { // Ignored. @@ -422,7 +422,7 @@ export default function AssetRow(props: AssetRowProps) { case AssetEventType.newProject: case AssetEventType.newFolder: case AssetEventType.uploadFiles: - case AssetEventType.newDataLink: + case AssetEventType.newDatalink: case AssetEventType.newSecret: case AssetEventType.updateFiles: case AssetEventType.openProject: @@ -509,9 +509,9 @@ export default function AssetRow(props: AssetRowProps) { } break } - case backendModule.AssetType.dataLink: { + case backendModule.AssetType.datalink: { try { - const value = await backend.getConnector(asset.id, asset.title) + const value = await backend.getDatalink(asset.id, asset.title) const fileName = `${asset.title}.datalink` download.download( URL.createObjectURL( @@ -522,7 +522,7 @@ export default function AssetRow(props: AssetRowProps) { fileName ) } catch (error) { - toastAndLog('downloadDataLinkError', error, asset.title) + toastAndLog('downloadDatalinkError', error, asset.title) } break } @@ -687,7 +687,7 @@ export default function AssetRow(props: AssetRowProps) { case backendModule.AssetType.directory: case backendModule.AssetType.project: case backendModule.AssetType.file: - case backendModule.AssetType.dataLink: + case backendModule.AssetType.datalink: case backendModule.AssetType.secret: { const innerProps: AssetRowInnerProps = { key, diff --git a/app/ide-desktop/lib/dashboard/src/components/dashboard/DataLinkInput.tsx b/app/ide-desktop/lib/dashboard/src/components/dashboard/DatalinkInput.tsx similarity index 71% rename from app/ide-desktop/lib/dashboard/src/components/dashboard/DataLinkInput.tsx rename to app/ide-desktop/lib/dashboard/src/components/dashboard/DatalinkInput.tsx index 5d23ec28f7..44c7a86950 100644 --- a/app/ide-desktop/lib/dashboard/src/components/dashboard/DataLinkInput.tsx +++ b/app/ide-desktop/lib/dashboard/src/components/dashboard/DatalinkInput.tsx @@ -1,8 +1,8 @@ -/** @file A dynamic wizard for creating an arbitrary type of Data Link. */ +/** @file A dynamic wizard for creating an arbitrary type of Datalink. */ import * as React from 'react' -import SCHEMA from '#/data/dataLinkSchema.json' assert { type: 'json' } -import * as dataLinkValidator from '#/data/dataLinkValidator' +import SCHEMA from '#/data/datalinkSchema.json' assert { type: 'json' } +import * as datalinkValidator from '#/data/datalinkValidator' import type * as jsonSchemaInput from '#/components/JSONSchemaInput' import JSONSchemaInput from '#/components/JSONSchemaInput' @@ -22,19 +22,19 @@ const DEFS: Record = SCHEMA.$defs /** Get a known schema using a path. * @throws {Error} when there is no schema present at the given path. */ function getValidator(path: string) { - return error.assert<(value: unknown) => boolean>(() => dataLinkValidator.AJV.getSchema(path)) + return error.assert<(value: unknown) => boolean>(() => datalinkValidator.AJV.getSchema(path)) } // ===================== // === DataLinkInput === // ===================== -/** Props for a {@link DataLinkInput}. */ -export interface DataLinkInputProps +/** Props for a {@link DatalinkInput}. */ +export interface DatalinkInputProps extends Omit {} -/** A dynamic wizard for creating an arbitrary type of Data Link. */ -export default function DataLinkInput(props: DataLinkInputProps) { +/** A dynamic wizard for creating an arbitrary type of Datalink. */ +export default function DatalinkInput(props: DatalinkInputProps) { return ( - + { diff --git a/app/ide-desktop/lib/dashboard/src/components/dashboard/DirectoryNameColumn.tsx b/app/ide-desktop/lib/dashboard/src/components/dashboard/DirectoryNameColumn.tsx index a4ec1eec91..c741739630 100644 --- a/app/ide-desktop/lib/dashboard/src/components/dashboard/DirectoryNameColumn.tsx +++ b/app/ide-desktop/lib/dashboard/src/components/dashboard/DirectoryNameColumn.tsx @@ -83,7 +83,7 @@ export default function DirectoryNameColumn(props: DirectoryNameColumnProps) { switch (event.type) { case AssetEventType.newProject: case AssetEventType.uploadFiles: - case AssetEventType.newDataLink: + case AssetEventType.newDatalink: case AssetEventType.newSecret: case AssetEventType.openProject: case AssetEventType.updateFiles: diff --git a/app/ide-desktop/lib/dashboard/src/components/dashboard/FileNameColumn.tsx b/app/ide-desktop/lib/dashboard/src/components/dashboard/FileNameColumn.tsx index 09d95080ec..a326b37971 100644 --- a/app/ide-desktop/lib/dashboard/src/components/dashboard/FileNameColumn.tsx +++ b/app/ide-desktop/lib/dashboard/src/components/dashboard/FileNameColumn.tsx @@ -81,7 +81,7 @@ export default function FileNameColumn(props: FileNameColumnProps) { switch (event.type) { case AssetEventType.newProject: case AssetEventType.newFolder: - case AssetEventType.newDataLink: + case AssetEventType.newDatalink: case AssetEventType.newSecret: case AssetEventType.openProject: case AssetEventType.closeProject: diff --git a/app/ide-desktop/lib/dashboard/src/components/dashboard/Permission.tsx b/app/ide-desktop/lib/dashboard/src/components/dashboard/Permission.tsx index d382dcb911..d3cfa29385 100644 --- a/app/ide-desktop/lib/dashboard/src/components/dashboard/Permission.tsx +++ b/app/ide-desktop/lib/dashboard/src/components/dashboard/Permission.tsx @@ -25,9 +25,9 @@ const ASSET_TYPE_TO_TEXT_ID: Readonly> = { [backend.AssetType.directory]: 'Folder', [backend.AssetType.project]: 'Project', [backend.AssetType.file]: 'File', - [backend.AssetType.dataLink]: 'Data Link', + [backend.AssetType.datalink]: 'Datalink', [backend.AssetType.secret]: 'Secret', // These assets should never be visible, since they don't have columns. [backend.AssetType.specialEmpty]: 'Empty asset', diff --git a/app/ide-desktop/lib/dashboard/src/components/dashboard/ProjectIcon.tsx b/app/ide-desktop/lib/dashboard/src/components/dashboard/ProjectIcon.tsx index 41f3a18c46..1220cecc5f 100644 --- a/app/ide-desktop/lib/dashboard/src/components/dashboard/ProjectIcon.tsx +++ b/app/ide-desktop/lib/dashboard/src/components/dashboard/ProjectIcon.tsx @@ -236,7 +236,7 @@ export default function ProjectIcon(props: ProjectIconProps) { switch (event.type) { case AssetEventType.newFolder: case AssetEventType.uploadFiles: - case AssetEventType.newDataLink: + case AssetEventType.newDatalink: case AssetEventType.newSecret: case AssetEventType.copy: case AssetEventType.updateFiles: diff --git a/app/ide-desktop/lib/dashboard/src/components/dashboard/ProjectNameColumn.tsx b/app/ide-desktop/lib/dashboard/src/components/dashboard/ProjectNameColumn.tsx index 2e1d38a99c..421d6fab26 100644 --- a/app/ide-desktop/lib/dashboard/src/components/dashboard/ProjectNameColumn.tsx +++ b/app/ide-desktop/lib/dashboard/src/components/dashboard/ProjectNameColumn.tsx @@ -110,7 +110,7 @@ export default function ProjectNameColumn(props: ProjectNameColumnProps) { async event => { switch (event.type) { case AssetEventType.newFolder: - case AssetEventType.newDataLink: + case AssetEventType.newDatalink: case AssetEventType.newSecret: case AssetEventType.openProject: case AssetEventType.closeProject: diff --git a/app/ide-desktop/lib/dashboard/src/components/dashboard/SecretNameColumn.tsx b/app/ide-desktop/lib/dashboard/src/components/dashboard/SecretNameColumn.tsx index 1fba444647..afaeac59ad 100644 --- a/app/ide-desktop/lib/dashboard/src/components/dashboard/SecretNameColumn.tsx +++ b/app/ide-desktop/lib/dashboard/src/components/dashboard/SecretNameColumn.tsx @@ -65,7 +65,7 @@ export default function SecretNameColumn(props: SecretNameColumnProps) { case AssetEventType.newProject: case AssetEventType.newFolder: case AssetEventType.uploadFiles: - case AssetEventType.newDataLink: + case AssetEventType.newDatalink: case AssetEventType.openProject: case AssetEventType.updateFiles: case AssetEventType.closeProject: diff --git a/app/ide-desktop/lib/dashboard/src/components/dashboard/column/NameColumn.tsx b/app/ide-desktop/lib/dashboard/src/components/dashboard/column/NameColumn.tsx index d84d1cccef..f19a9e4b7d 100644 --- a/app/ide-desktop/lib/dashboard/src/components/dashboard/column/NameColumn.tsx +++ b/app/ide-desktop/lib/dashboard/src/components/dashboard/column/NameColumn.tsx @@ -2,7 +2,7 @@ import * as React from 'react' import type * as column from '#/components/dashboard/column' -import DataLinkNameColumn from '#/components/dashboard/DataLinkNameColumn' +import DatalinkNameColumn from '#/components/dashboard/DatalinkNameColumn' import DirectoryNameColumn from '#/components/dashboard/DirectoryNameColumn' import FileNameColumn from '#/components/dashboard/FileNameColumn' import ProjectNameColumn from '#/components/dashboard/ProjectNameColumn' @@ -30,8 +30,8 @@ export default function AssetNameColumn(props: AssetNameColumnProps) { case backendModule.AssetType.file: { return } - case backendModule.AssetType.dataLink: { - return + case backendModule.AssetType.datalink: { + return } case backendModule.AssetType.secret: { return diff --git a/app/ide-desktop/lib/dashboard/src/configurations/inputBindings.ts b/app/ide-desktop/lib/dashboard/src/configurations/inputBindings.ts index b2e0e8fa97..9a031a0d84 100644 --- a/app/ide-desktop/lib/dashboard/src/configurations/inputBindings.ts +++ b/app/ide-desktop/lib/dashboard/src/configurations/inputBindings.ts @@ -1,6 +1,6 @@ /** @file Shortcuts for the dashboard application. */ -import AddConnectorIcon from 'enso-assets/add_connector.svg' +import AddDatalinkIcon from 'enso-assets/add_datalink.svg' import AddFolderIcon from 'enso-assets/add_folder.svg' import AddKeyIcon from 'enso-assets/add_key.svg' import AddNetworkIcon from 'enso-assets/add_network.svg' @@ -81,10 +81,10 @@ export const BINDINGS = inputBindings.defineBindings({ bindings: !detect.isOnMacOS() ? ['Mod+Alt+N'] : ['Mod+Alt+N', 'Mod+Alt+~'], icon: AddKeyIcon, }, - newDataLink: { - name: 'New Data Link', + newDatalink: { + name: 'New Datalink', bindings: !detect.isOnMacOS() ? ['Mod+Alt+Shift+N'] : ['Mod+Alt+Shift+N', 'Mod+Alt+Shift+~'], - icon: AddConnectorIcon, + icon: AddDatalinkIcon, }, useInNewProject: { name: 'Use In New Project', diff --git a/app/ide-desktop/lib/dashboard/src/data/__tests__/dataLinkSchema.test.ts b/app/ide-desktop/lib/dashboard/src/data/__tests__/dataLinkSchema.test.ts index 58662ece48..f48124d46b 100644 --- a/app/ide-desktop/lib/dashboard/src/data/__tests__/dataLinkSchema.test.ts +++ b/app/ide-desktop/lib/dashboard/src/data/__tests__/dataLinkSchema.test.ts @@ -6,23 +6,23 @@ import * as url from 'node:url' import * as v from 'vitest' -import * as dataLinkValidator from '#/data/dataLinkValidator' +import * as datalinkValidator from '#/data/datalinkValidator' v.test('correctly rejects invalid values as not matching the schema', () => { - v.expect(dataLinkValidator.validateDataLink({})).toBe(false) - v.expect(dataLinkValidator.validateDataLink('foobar')).toBe(false) - v.expect(dataLinkValidator.validateDataLink({ foo: 'BAR' })).toBe(false) + v.expect(datalinkValidator.validateDatalink({})).toBe(false) + v.expect(datalinkValidator.validateDatalink('foobar')).toBe(false) + v.expect(datalinkValidator.validateDatalink({ foo: 'BAR' })).toBe(false) }) /** Load and parse a data-link description. */ -function loadDataLinkFile(dataLinkPath: string): unknown { - const text: string = fs.readFileSync(dataLinkPath, { encoding: 'utf-8' }) +function loadDataLinkFile(datalinkPath: string): unknown { + const text: string = fs.readFileSync(datalinkPath, { encoding: 'utf-8' }) return JSON.parse(text) } /** Check if the given data-link description matches the schema, reporting any errors. */ function testSchema(json: unknown, fileName: string): void { - const validate = dataLinkValidator.validateDataLink + const validate = datalinkValidator.validateDatalink if (!validate(json)) { v.assert.fail(`Failed to validate ${fileName}:\n${JSON.stringify(validate.errors, null, 2)}`) } @@ -60,7 +60,7 @@ v.test('rejects invalid schemas (Base)', () => { const invalidSchemas = ['example-http-format-invalid.datalink'] for (const schema of invalidSchemas) { const json = loadDataLinkFile(path.resolve(BASE_DATA_LINKS_ROOT, schema)) - v.expect(dataLinkValidator.validateDataLink(json)).toBe(false) + v.expect(datalinkValidator.validateDatalink(json)).toBe(false) } }) diff --git a/app/ide-desktop/lib/dashboard/src/data/dataLinkSchema.json b/app/ide-desktop/lib/dashboard/src/data/datalinkSchema.json similarity index 100% rename from app/ide-desktop/lib/dashboard/src/data/dataLinkSchema.json rename to app/ide-desktop/lib/dashboard/src/data/datalinkSchema.json diff --git a/app/ide-desktop/lib/dashboard/src/data/dataLinkValidator.ts b/app/ide-desktop/lib/dashboard/src/data/datalinkValidator.ts similarity index 72% rename from app/ide-desktop/lib/dashboard/src/data/dataLinkValidator.ts rename to app/ide-desktop/lib/dashboard/src/data/datalinkValidator.ts index 615a7d0d54..7976e6eeff 100644 --- a/app/ide-desktop/lib/dashboard/src/data/dataLinkValidator.ts +++ b/app/ide-desktop/lib/dashboard/src/data/datalinkValidator.ts @@ -1,8 +1,8 @@ -/** @file AJV instance configured for data links. */ +/** @file AJV instance configured for datalinks. */ import type * as ajv from 'ajv/dist/2020' import Ajv from 'ajv/dist/2020' -import SCHEMA from '#/data/dataLinkSchema.json' assert { type: 'json' } +import SCHEMA from '#/data/datalinkSchema.json' assert { type: 'json' } import * as error from '#/utilities/error' @@ -12,6 +12,6 @@ AJV.addSchema(SCHEMA) // This is a function, even though it does not contain function syntax. // eslint-disable-next-line no-restricted-syntax -export const validateDataLink = error.assert(() => +export const validateDatalink = error.assert(() => AJV.getSchema('#/$defs/DataLink') ) diff --git a/app/ide-desktop/lib/dashboard/src/events/AssetEventType.ts b/app/ide-desktop/lib/dashboard/src/events/AssetEventType.ts index 7f22c93a1c..2883d30798 100644 --- a/app/ide-desktop/lib/dashboard/src/events/AssetEventType.ts +++ b/app/ide-desktop/lib/dashboard/src/events/AssetEventType.ts @@ -10,7 +10,7 @@ enum AssetEventType { newFolder = 'new-folder', uploadFiles = 'upload-files', updateFiles = 'update-files', - newDataLink = 'new-data-link', + newDatalink = 'new-datalink', newSecret = 'new-secret', openProject = 'open-project', closeProject = 'close-project', diff --git a/app/ide-desktop/lib/dashboard/src/events/AssetListEventType.ts b/app/ide-desktop/lib/dashboard/src/events/AssetListEventType.ts index e9d0f874ab..4a91c52cde 100644 --- a/app/ide-desktop/lib/dashboard/src/events/AssetListEventType.ts +++ b/app/ide-desktop/lib/dashboard/src/events/AssetListEventType.ts @@ -5,7 +5,7 @@ enum AssetListEventType { newFolder = 'new-folder', newProject = 'new-project', uploadFiles = 'upload-files', - newDataLink = 'new-data-link', + newDatalink = 'new-datalink', newSecret = 'new-secret', insertAssets = 'insert-assets', closeFolder = 'close-folder', diff --git a/app/ide-desktop/lib/dashboard/src/events/assetEvent.ts b/app/ide-desktop/lib/dashboard/src/events/assetEvent.ts index 2324f14598..2f1e9a7aae 100644 --- a/app/ide-desktop/lib/dashboard/src/events/assetEvent.ts +++ b/app/ide-desktop/lib/dashboard/src/events/assetEvent.ts @@ -29,7 +29,7 @@ interface AssetEvents { readonly newFolder: AssetNewFolderEvent readonly uploadFiles: AssetUploadFilesEvent readonly updateFiles: AssetUpdateFilesEvent - readonly newDataLink: AssetNewDataLinkEvent + readonly newDatalink: AssetNewDatalinkEvent readonly newSecret: AssetNewSecretEvent readonly openProject: AssetOpenProjectEvent readonly closeProject: AssetCloseProjectEvent @@ -63,7 +63,7 @@ type SanityCheck< export interface AssetNewProjectEvent extends AssetBaseEvent { readonly placeholderId: backend.ProjectId readonly templateId: string | null - readonly datalinkId: backend.ConnectorId | null + readonly datalinkId: backend.DatalinkId | null readonly onSpinnerStateChange: ((state: spinner.SpinnerState) => void) | null } @@ -82,9 +82,9 @@ export interface AssetUpdateFilesEvent extends AssetBaseEvent } -/** A signal to create a Data Link. */ -export interface AssetNewDataLinkEvent extends AssetBaseEvent { - readonly placeholderId: backend.ConnectorId +/** A signal to create a Datalink. */ +export interface AssetNewDatalinkEvent extends AssetBaseEvent { + readonly placeholderId: backend.DatalinkId readonly value: unknown } diff --git a/app/ide-desktop/lib/dashboard/src/events/assetListEvent.ts b/app/ide-desktop/lib/dashboard/src/events/assetListEvent.ts index 54a3abfe3b..d5d957fed1 100644 --- a/app/ide-desktop/lib/dashboard/src/events/assetListEvent.ts +++ b/app/ide-desktop/lib/dashboard/src/events/assetListEvent.ts @@ -29,7 +29,7 @@ interface AssetListEvents { readonly newProject: AssetListNewProjectEvent readonly uploadFiles: AssetListUploadFilesEvent readonly newSecret: AssetListNewSecretEvent - readonly newDataLink: AssetListNewDataLinkEvent + readonly newDatalink: AssetListNewDatalinkEvent readonly insertAssets: AssetListInsertAssetsEvent readonly closeFolder: AssetListCloseFolderEvent readonly copy: AssetListCopyEvent @@ -62,7 +62,7 @@ interface AssetListNewProjectEvent extends AssetListBaseEvent void) | null } @@ -75,7 +75,7 @@ interface AssetListUploadFilesEvent extends AssetListBaseEvent { +interface AssetListNewDatalinkEvent extends AssetListBaseEvent { readonly parentKey: backend.DirectoryId readonly parentId: backend.DirectoryId readonly name: string diff --git a/app/ide-desktop/lib/dashboard/src/layouts/AssetContextMenu.tsx b/app/ide-desktop/lib/dashboard/src/layouts/AssetContextMenu.tsx index 922a00738a..676f25c5cf 100644 --- a/app/ide-desktop/lib/dashboard/src/layouts/AssetContextMenu.tsx +++ b/app/ide-desktop/lib/dashboard/src/layouts/AssetContextMenu.tsx @@ -129,7 +129,7 @@ export default function AssetContextMenu(props: AssetContextMenuProps) { ) : (