Skip to content

Commit

Permalink
chore: add icons
Browse files Browse the repository at this point in the history
  • Loading branch information
Scott Dover authored and Scott Dover committed Sep 27, 2024
1 parent b39d6a4 commit bf70043
Show file tree
Hide file tree
Showing 7 changed files with 40 additions and 9 deletions.
9 changes: 9 additions & 0 deletions client/src/components/ContentNavigator/ContentDataProvider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,8 @@ import {
FAVORITES_FOLDER_TYPE,
Messages,
ROOT_FOLDER_TYPE,
SERVER_HOME_FOLDER_TYPE,
SERVER_ROOT_FOLDER_TYPE,
TRASH_FOLDER_TYPE,
} from "./const";
import {
Expand Down Expand Up @@ -642,6 +644,12 @@ class ContentDataProvider
case FAVORITES_FOLDER_TYPE:
icon = "favoritesFolder";
break;
case SERVER_HOME_FOLDER_TYPE:
icon = "userWorkspace";
break;
case SERVER_ROOT_FOLDER_TYPE:
icon = "server";
break;
default:
icon = "folder";
break;
Expand All @@ -652,6 +660,7 @@ class ContentDataProvider
icon = "sasProgramFile";
}
}

return icon !== ""
? {
dark: Uri.joinPath(this.extensionUri, `icons/dark/${icon}Dark.svg`),
Expand Down
4 changes: 3 additions & 1 deletion client/src/components/ContentNavigator/const.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,12 @@ export const ROOT_FOLDER = createStaticFolder(
);

export const SERVER_FOLDER_ID = "SERVER_FOLDER_ID";
export const SERVER_ROOT_FOLDER_TYPE = "ServerRootFolder";
export const SERVER_HOME_FOLDER_TYPE = "ServerHomeFolder";
export const SAS_SERVER_ROOT_FOLDER = createStaticFolder(
SERVER_FOLDER_ID,
"SAS Server",
ROOT_FOLDER_TYPE,
SERVER_ROOT_FOLDER_TYPE,
"/",
"getDirectoryMembers",
);
Expand Down
12 changes: 4 additions & 8 deletions client/src/connection/rest/RestSASServerAdapter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import {
SAS_SERVER_ROOT_FOLDER,
SAS_SERVER_ROOT_FOLDERS,
SERVER_FOLDER_ID,
SERVER_HOME_FOLDER_TYPE,
} from "../../components/ContentNavigator/const";
import {
AddChildItemProperties,
Expand Down Expand Up @@ -169,7 +170,7 @@ class RestSASServerAdapter implements ContentAdapter {
createStaticFolder(
SAS_SERVER_HOME_DIRECTORY,
"Home",
"userRoot",
SERVER_HOME_FOLDER_TYPE,
`/compute/sessions/${this.sessionId}/files/~fs~/members`,
"getDirectoryMembers",
),
Expand Down Expand Up @@ -278,8 +279,6 @@ class RestSASServerAdapter implements ContentAdapter {
}

public getRootFolder(): ContentItem | undefined {
// TODO (sas-server) Re-implement this if SAS server supports
// recycle bin
return undefined;
}

Expand Down Expand Up @@ -394,7 +393,7 @@ class RestSASServerAdapter implements ContentAdapter {
}

private filePropertiesToContentItem(
fileProperties: FileProperties,
fileProperties: FileProperties & { type?: string },
flags?: ContentItem["flags"],
): ContentItem {
const links = fileProperties.links.map((link) => ({
Expand All @@ -405,10 +404,6 @@ class RestSASServerAdapter implements ContentAdapter {
uri: link.uri,
}));

if (!getLink(links, "GET", "self")) {
console.log("OH NBO");
}

const id = getLink(links, "GET", "self").uri;
const isRootFolder = [SERVER_FOLDER_ID, SAS_SERVER_HOME_DIRECTORY].includes(
id,
Expand All @@ -428,6 +423,7 @@ class RestSASServerAdapter implements ContentAdapter {
!!getLink(links, "POST", "createFile"),
},
flags,
type: fileProperties.type || "",
};

const typeName = getTypeName(item);
Expand Down
8 changes: 8 additions & 0 deletions icons/dark/serverDark.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 4 additions & 0 deletions icons/dark/userWorkspaceDark.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
8 changes: 8 additions & 0 deletions icons/light/serverLight.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 4 additions & 0 deletions icons/light/userWorkspaceLight.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit bf70043

Please sign in to comment.