From 96fae54c2f25fb865f6f52e2e63cf2cfe4e2f57b Mon Sep 17 00:00:00 2001 From: Scott Dover Date: Fri, 4 Oct 2024 11:30:51 -0400 Subject: [PATCH] chore: adjust todos/comments --- .../ContentNavigator/ContentAdapterFactory.ts | 2 +- .../ContentNavigator/ContentModel.ts | 1 - .../src/components/ContentNavigator/const.ts | 6 +--- .../connection/rest/RestSASServerAdapter.ts | 28 ++++++++++--------- server/src/sas/utils.ts | 2 +- 5 files changed, 18 insertions(+), 21 deletions(-) diff --git a/client/src/components/ContentNavigator/ContentAdapterFactory.ts b/client/src/components/ContentNavigator/ContentAdapterFactory.ts index 3a3c207b7..d115067e9 100644 --- a/client/src/components/ContentNavigator/ContentAdapterFactory.ts +++ b/client/src/components/ContentNavigator/ContentAdapterFactory.ts @@ -10,7 +10,7 @@ import { } from "./types"; class ContentAdapterFactory { - // TODO #889 Update this to return RestSASServerAdapter & ITCSASServerAdapter + // TODO #889 Update this to return ITCSASServerAdapter public create( connectionType: ConnectionType, sourceType: ContentNavigatorConfig["sourceType"], diff --git a/client/src/components/ContentNavigator/ContentModel.ts b/client/src/components/ContentNavigator/ContentModel.ts index 594d713f9..667217f02 100644 --- a/client/src/components/ContentNavigator/ContentModel.ts +++ b/client/src/components/ContentNavigator/ContentModel.ts @@ -34,7 +34,6 @@ export class ContentModel { return Object.entries(await this.contentAdapter.getRootItems()) .sort( // sort the delegate folders as the order in the supportedDelegateFolders - // TODO MEEEE! (a, b) => ALL_ROOT_FOLDERS.indexOf(a[0]) - ALL_ROOT_FOLDERS.indexOf(b[0]), ) diff --git a/client/src/components/ContentNavigator/const.ts b/client/src/components/ContentNavigator/const.ts index fa5030a40..dcc9a977a 100644 --- a/client/src/components/ContentNavigator/const.ts +++ b/client/src/components/ContentNavigator/const.ts @@ -50,11 +50,7 @@ export const SAS_CONTENT_ROOT_FOLDERS = [ "@myRecycleBin", ]; -export const SAS_SERVER_ROOT_FOLDERS = [ - // "@myFavorites", - "@sasServerRoot", - // "@myRecycleBin", -]; +export const SAS_SERVER_ROOT_FOLDERS = ["@sasServerRoot"]; export const ALL_ROOT_FOLDERS = [ ...SAS_CONTENT_ROOT_FOLDERS, diff --git a/client/src/connection/rest/RestSASServerAdapter.ts b/client/src/connection/rest/RestSASServerAdapter.ts index 52f33f9bd..4e7cedc12 100644 --- a/client/src/connection/rest/RestSASServerAdapter.ts +++ b/client/src/connection/rest/RestSASServerAdapter.ts @@ -49,6 +49,13 @@ class RestSASServerAdapter implements ContentAdapter { this.rootFolders = {}; this.fileMetadataMap = {}; } + addChildItem: ( + childItemUri: string | undefined, + parentItemUri: string | undefined, + properties: AddChildItemProperties, + ) => Promise; + recycleItem?: (item: ContentItem) => Promise<{ newUri?: Uri; oldUri?: Uri }>; + restoreItem?: (item: ContentItem) => Promise; public async connect(): Promise { const session = getSession(); @@ -86,8 +93,7 @@ class RestSASServerAdapter implements ContentAdapter { } public connected(): boolean { - // TODO (sas-server) - return true; + return !!this.sessionId; } public async setup(): Promise { @@ -98,16 +104,14 @@ class RestSASServerAdapter implements ContentAdapter { await this.connect(); } - public async addChildItem( - childItemUri: string | undefined, - parentItemUri: string | undefined, - properties: AddChildItemProperties, - ): Promise { + // TODO #417 Implement favorites + public async addItemToFavorites(): Promise { throw new Error("Method not implemented."); } - public async addItemToFavorites(item: ContentItem): Promise { - throw new Error("fds Method not implemented."); + // TODO #417 Implement favorites + public async removeItemFromFavorites(): Promise { + throw new Error("Method not implemented."); } public async createNewFolder( @@ -278,6 +282,7 @@ class RestSASServerAdapter implements ContentAdapter { return this.filePropertiesToContentItem(response.data); } + // TODO #417 Implement as part of favorites public getRootFolder(): ContentItem | undefined { return undefined; } @@ -308,6 +313,7 @@ class RestSASServerAdapter implements ContentAdapter { } return item.vscUri; + // TODO #417 Implement favorites // // If we're attempting to open a favorite, open the underlying file instead. // try { // return (await this.getItemOfId(item.uri)).vscUri; @@ -341,10 +347,6 @@ class RestSASServerAdapter implements ContentAdapter { return !!this.filePropertiesToContentItem(response.data); } - public async removeItemFromFavorites(item: ContentItem): Promise { - throw new Error("Method not implemented."); - } - public async renameItem( item: ContentItem, newName: string, diff --git a/server/src/sas/utils.ts b/server/src/sas/utils.ts index 0c0b09d07..085810d55 100644 --- a/server/src/sas/utils.ts +++ b/server/src/sas/utils.ts @@ -28,7 +28,7 @@ let bundle: Record; const locale: string = typeof process !== "undefined" && process.env.VSCODE_NLS_CONFIG ? JSON.parse(process.env.VSCODE_NLS_CONFIG).locale - : (global.navigator?.language ?? "en"); + : global.navigator?.language ?? "en"; const supportedLanguages = [ "ar", "cs",