Skip to content

Commit

Permalink
Removed custom icons in favor of ThemeIcon references
Browse files Browse the repository at this point in the history
Signed-off-by: Owen Farrell <[email protected]>
  • Loading branch information
owenfarrell committed Aug 24, 2020
1 parent dcaa12c commit 9357c08
Show file tree
Hide file tree
Showing 27 changed files with 19 additions and 117 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ JSON data (or complex data structures, such as a map) is presented through the U

## Requirements

Running this extension requires VisualStuido Code version 1.30.0 (November 2018) or later.
Running this extension requires VisualStuido Code version 1.42.0 (January 2020) or later.

## Extension Settings

Expand Down
6 changes: 3 additions & 3 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

34 changes: 8 additions & 26 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"version": "2.2.3",
"publisher": "owenfarrell",
"engines": {
"vscode": "^1.30.0"
"vscode": "^1.42.0"
},
"license": "MIT",
"displayName": "HashiCorp Vault",
Expand Down Expand Up @@ -58,19 +58,13 @@
"command": "vault.browse",
"title": "Browse Path",
"category": "Vault",
"icon": {
"light": "resources/light/command/browse.svg",
"dark": "resources/dark/command/browse.svg"
}
"icon": "$(search)"
},
{
"command": "vault.connect",
"title": "Connect to Server",
"category": "Vault",
"icon": {
"light": "resources/light/command/connect.svg",
"dark": "resources/dark/command/connect.svg"
}
"icon": "$(plus)"
},
{
"command": "vault.disconnect",
Expand All @@ -85,28 +79,19 @@
"command": "vault.delete",
"title": "Delete Secret",
"category": "Vault",
"icon": {
"light": "resources/light/command/delete.svg",
"dark": "resources/dark/command/delete.svg"
}
"icon": "$(close)"
},
{
"command": "vault.list",
"title": "Refresh",
"category": "Vault",
"icon": {
"light": "resources/light/command/refresh.svg",
"dark": "resources/dark/command/refresh.svg"
}
"icon": "$(refresh)"
},
{
"command": "vault.read",
"title": "Read Secret",
"category": "Vault",
"icon": {
"light": "resources/light/command/read.svg",
"dark": "resources/dark/command/read.svg"
}
"icon": "$(link-external)"
},
{
"command": "vault.reconnect",
Expand All @@ -130,10 +115,7 @@
"command": "vault.write",
"title": "Write Secret",
"category": "Vault",
"icon": {
"light": "resources/light/command/edit.svg",
"dark": "resources/dark/command/edit.svg"
}
"icon": "$(edit)"
}
],
"menus": {
Expand Down Expand Up @@ -265,7 +247,7 @@
"@types/request": "^2.48.5",
"@types/uuid": "^8.0.0",
"@types/validator": "^13.0.0",
"@types/vscode": "1.30.0",
"@types/vscode": "1.42.0",
"@typescript-eslint/eslint-plugin": "^2.34.0",
"@typescript-eslint/parser": "^2.34.0",
"ajv": "^6.12.4",
Expand Down
3 changes: 0 additions & 3 deletions resources/dark/command/browse.svg

This file was deleted.

3 changes: 0 additions & 3 deletions resources/dark/command/connect.svg

This file was deleted.

3 changes: 0 additions & 3 deletions resources/dark/command/delete.svg

This file was deleted.

3 changes: 0 additions & 3 deletions resources/dark/command/edit.svg

This file was deleted.

4 changes: 0 additions & 4 deletions resources/dark/command/read.svg

This file was deleted.

4 changes: 0 additions & 4 deletions resources/dark/command/refresh.svg

This file was deleted.

3 changes: 0 additions & 3 deletions resources/dark/tree/folder.svg

This file was deleted.

3 changes: 0 additions & 3 deletions resources/dark/tree/secret.svg

This file was deleted.

3 changes: 0 additions & 3 deletions resources/dark/tree/server.svg

This file was deleted.

3 changes: 0 additions & 3 deletions resources/dark/tree/warning.svg

This file was deleted.

3 changes: 0 additions & 3 deletions resources/light/command/browse.svg

This file was deleted.

3 changes: 0 additions & 3 deletions resources/light/command/connect.svg

This file was deleted.

3 changes: 0 additions & 3 deletions resources/light/command/delete.svg

This file was deleted.

3 changes: 0 additions & 3 deletions resources/light/command/edit.svg

This file was deleted.

4 changes: 0 additions & 4 deletions resources/light/command/read.svg

This file was deleted.

4 changes: 0 additions & 4 deletions resources/light/command/refresh.svg

This file was deleted.

3 changes: 0 additions & 3 deletions resources/light/tree/folder.svg

This file was deleted.

3 changes: 0 additions & 3 deletions resources/light/tree/secret.svg

This file was deleted.

3 changes: 0 additions & 3 deletions resources/light/tree/server.svg

This file was deleted.

3 changes: 0 additions & 3 deletions resources/light/tree/warning.svg

This file was deleted.

6 changes: 1 addition & 5 deletions src/view/secret.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
'use strict';

import * as commands from 'src/commands';
import * as path from 'path';
import * as vscode from 'vscode';

import { VaultTreeItem } from './treeitem';
Expand All @@ -12,10 +11,7 @@ export class VaultSecretTreeItem extends VaultTreeItem {
//#region Constructors
constructor(label: string, parent: VaultTreeItem) {
super(label, parent, vscode.TreeItemCollapsibleState.None);
this.iconPath = this._defaultIconPath = {
light: path.join(__dirname, '..', 'resources', 'light', 'tree', 'secret.svg'),
dark: path.join(__dirname, '..', 'resources', 'dark', 'tree', 'secret.svg')
};
this.iconPath = this._defaultIcon = vscode.ThemeIcon.File;
this.path = parent.path + label;
}
//#endregion
Expand Down
6 changes: 1 addition & 5 deletions src/view/server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
import * as adaptors from 'src/adaptors';
import * as model from 'src/model';
import * as nv from 'node-vault';
import * as path from 'path';
import * as vscode from 'vscode';

import { formatPath, OPTIONAL_TRAILING_SLASH, PATH_SEPARATOR, splitPath } from 'src/util';
Expand All @@ -22,10 +21,7 @@ export class VaultServerTreeItem extends VaultTreeItem {
super(session.name);
this.children = [];
this.contextValue = VaultServerTreeItem.DISCONNECTED_CONTEXT;
this.iconPath = this._defaultIconPath = {
light: path.join(__dirname, '..', 'resources', 'light', 'tree', 'server.svg'),
dark: path.join(__dirname, '..', 'resources', 'dark', 'tree', 'server.svg')
};
this.iconPath = this._defaultIcon = new vscode.ThemeIcon('server');
this.id = this.id.replace(OPTIONAL_TRAILING_SLASH, PATH_SEPARATOR);
this.session = session;
// TODO Re-add support for custom options
Expand Down
7 changes: 2 additions & 5 deletions src/view/shell.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
'use strict';

import * as path from 'path';
import * as vscode from 'vscode';

import { VaultTreeItem } from './treeitem';

Expand All @@ -10,10 +10,7 @@ export class VaultShellTreeItem extends VaultTreeItem {
//#region Constructors
constructor(label: string, parent: VaultTreeItem) {
super(label, parent);
this.iconPath = this._defaultIconPath = {
light: path.join(__dirname, '..', 'resources', 'light', 'tree', 'folder.svg'),
dark: path.join(__dirname, '..', 'resources', 'dark', 'tree', 'folder.svg')
};
this.iconPath = this._defaultIcon = new vscode.ThemeIcon('folder-opened');
this.path = parent.path + label;
}
//#endregion
Expand Down
11 changes: 3 additions & 8 deletions src/view/treeitem.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
'use strict';

import * as nv from 'node-vault';
import * as path from 'path';
import * as vscode from 'vscode';

import { PATH_SEPARATOR } from 'src/util';
Expand All @@ -12,14 +11,10 @@ export interface TreeItemIconPath {
}

export abstract class VaultTreeItem extends vscode.TreeItem {
protected static readonly WARNING_ICON: TreeItemIconPath = {
light: path.join(__dirname, '..', 'resources', 'light', 'tree', 'warning.svg'),
dark: path.join(__dirname, '..', 'resources', 'dark', 'tree', 'warning.svg')
};

protected static readonly WARNING_ICON = new vscode.ThemeIcon('warning');
//#region Attributes
private _children: VaultTreeItem[];
protected _defaultIconPath : TreeItemIconPath;
protected _defaultIcon : vscode.ThemeIcon;
readonly parent: VaultTreeItem;
path: string = '';
//#endregion
Expand Down Expand Up @@ -82,7 +77,7 @@ export abstract class VaultTreeItem extends vscode.TreeItem {
}
else {
// Update the icon to use the default icon
this.iconPath = this._defaultIconPath;
this.iconPath = this._defaultIcon;
// If the specified value is empty
if (this._children.length === 0) {
// Update the collapsable state
Expand Down

0 comments on commit 9357c08

Please sign in to comment.