Skip to content

Commit bf70043

Browse files
Scott DoverScott Dover
Scott Dover
authored and
Scott Dover
committed
chore: add icons
1 parent b39d6a4 commit bf70043

File tree

7 files changed

+40
-9
lines changed

7 files changed

+40
-9
lines changed

client/src/components/ContentNavigator/ContentDataProvider.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,8 @@ import {
4545
FAVORITES_FOLDER_TYPE,
4646
Messages,
4747
ROOT_FOLDER_TYPE,
48+
SERVER_HOME_FOLDER_TYPE,
49+
SERVER_ROOT_FOLDER_TYPE,
4850
TRASH_FOLDER_TYPE,
4951
} from "./const";
5052
import {
@@ -642,6 +644,12 @@ class ContentDataProvider
642644
case FAVORITES_FOLDER_TYPE:
643645
icon = "favoritesFolder";
644646
break;
647+
case SERVER_HOME_FOLDER_TYPE:
648+
icon = "userWorkspace";
649+
break;
650+
case SERVER_ROOT_FOLDER_TYPE:
651+
icon = "server";
652+
break;
645653
default:
646654
icon = "folder";
647655
break;
@@ -652,6 +660,7 @@ class ContentDataProvider
652660
icon = "sasProgramFile";
653661
}
654662
}
663+
655664
return icon !== ""
656665
? {
657666
dark: Uri.joinPath(this.extensionUri, `icons/dark/${icon}Dark.svg`),

client/src/components/ContentNavigator/const.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,12 @@ export const ROOT_FOLDER = createStaticFolder(
1616
);
1717

1818
export const SERVER_FOLDER_ID = "SERVER_FOLDER_ID";
19+
export const SERVER_ROOT_FOLDER_TYPE = "ServerRootFolder";
20+
export const SERVER_HOME_FOLDER_TYPE = "ServerHomeFolder";
1921
export const SAS_SERVER_ROOT_FOLDER = createStaticFolder(
2022
SERVER_FOLDER_ID,
2123
"SAS Server",
22-
ROOT_FOLDER_TYPE,
24+
SERVER_ROOT_FOLDER_TYPE,
2325
"/",
2426
"getDirectoryMembers",
2527
);

client/src/connection/rest/RestSASServerAdapter.ts

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import {
1010
SAS_SERVER_ROOT_FOLDER,
1111
SAS_SERVER_ROOT_FOLDERS,
1212
SERVER_FOLDER_ID,
13+
SERVER_HOME_FOLDER_TYPE,
1314
} from "../../components/ContentNavigator/const";
1415
import {
1516
AddChildItemProperties,
@@ -169,7 +170,7 @@ class RestSASServerAdapter implements ContentAdapter {
169170
createStaticFolder(
170171
SAS_SERVER_HOME_DIRECTORY,
171172
"Home",
172-
"userRoot",
173+
SERVER_HOME_FOLDER_TYPE,
173174
`/compute/sessions/${this.sessionId}/files/~fs~/members`,
174175
"getDirectoryMembers",
175176
),
@@ -278,8 +279,6 @@ class RestSASServerAdapter implements ContentAdapter {
278279
}
279280

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

@@ -394,7 +393,7 @@ class RestSASServerAdapter implements ContentAdapter {
394393
}
395394

396395
private filePropertiesToContentItem(
397-
fileProperties: FileProperties,
396+
fileProperties: FileProperties & { type?: string },
398397
flags?: ContentItem["flags"],
399398
): ContentItem {
400399
const links = fileProperties.links.map((link) => ({
@@ -405,10 +404,6 @@ class RestSASServerAdapter implements ContentAdapter {
405404
uri: link.uri,
406405
}));
407406

408-
if (!getLink(links, "GET", "self")) {
409-
console.log("OH NBO");
410-
}
411-
412407
const id = getLink(links, "GET", "self").uri;
413408
const isRootFolder = [SERVER_FOLDER_ID, SAS_SERVER_HOME_DIRECTORY].includes(
414409
id,
@@ -428,6 +423,7 @@ class RestSASServerAdapter implements ContentAdapter {
428423
!!getLink(links, "POST", "createFile"),
429424
},
430425
flags,
426+
type: fileProperties.type || "",
431427
};
432428

433429
const typeName = getTypeName(item);

icons/dark/serverDark.svg

Lines changed: 8 additions & 0 deletions
Loading

icons/dark/userWorkspaceDark.svg

Lines changed: 4 additions & 0 deletions
Loading

icons/light/serverLight.svg

Lines changed: 8 additions & 0 deletions
Loading

icons/light/userWorkspaceLight.svg

Lines changed: 4 additions & 0 deletions
Loading

0 commit comments

Comments
 (0)