Add selected and total count to settings description
Signed-off-by: Sanjula Ganepola <sanjulagane@gmail.com>
This commit is contained in:
10
package.json
10
package.json
@@ -347,7 +347,7 @@
|
|||||||
{
|
{
|
||||||
"command": "githubLocalActions.refreshComponents",
|
"command": "githubLocalActions.refreshComponents",
|
||||||
"when": "view == components",
|
"when": "view == components",
|
||||||
"group": "navigation@0"
|
"group": "navigation@99"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"command": "githubLocalActions.runAllWorkflows",
|
"command": "githubLocalActions.runAllWorkflows",
|
||||||
@@ -362,7 +362,7 @@
|
|||||||
{
|
{
|
||||||
"command": "githubLocalActions.refreshWorkflows",
|
"command": "githubLocalActions.refreshWorkflows",
|
||||||
"when": "view == workflows",
|
"when": "view == workflows",
|
||||||
"group": "navigation@2"
|
"group": "navigation@99"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"command": "githubLocalActions.clearAll",
|
"command": "githubLocalActions.clearAll",
|
||||||
@@ -372,17 +372,17 @@
|
|||||||
{
|
{
|
||||||
"command": "githubLocalActions.refreshHistory",
|
"command": "githubLocalActions.refreshHistory",
|
||||||
"when": "view == history",
|
"when": "view == history",
|
||||||
"group": "navigation@1"
|
"group": "navigation@99"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"command": "githubLocalActions.refreshSettings",
|
"command": "githubLocalActions.refreshSettings",
|
||||||
"when": "view == settings",
|
"when": "view == settings",
|
||||||
"group": "navigation@0"
|
"group": "navigation@99"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"submenu": "githubLocalActions.helpAndSupport",
|
"submenu": "githubLocalActions.helpAndSupport",
|
||||||
"when": "view =~ /^(components|workflows|history|settings)$/",
|
"when": "view =~ /^(components|workflows|history|settings)$/",
|
||||||
"group": "navigation@99"
|
"group": "navigation@98"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"githubLocalActions.helpAndSupport": [
|
"githubLocalActions.helpAndSupport": [
|
||||||
|
|||||||
@@ -17,7 +17,7 @@ export class DecorationProvider implements FileDecorationProvider {
|
|||||||
badge: '✅',
|
badge: '✅',
|
||||||
color: new ThemeColor('GitHubLocalActions.green')
|
color: new ThemeColor('GitHubLocalActions.green')
|
||||||
};
|
};
|
||||||
} else if (!required && (status === CliStatus.NotInstalled || status === CliStatus.NotRunning|| status === ExtensionStatus.NotActivated)) {
|
} else if (!required && (status === CliStatus.NotInstalled || status === CliStatus.NotRunning || status === ExtensionStatus.NotActivated)) {
|
||||||
return {
|
return {
|
||||||
badge: '⚠️',
|
badge: '⚠️',
|
||||||
color: new ThemeColor('GitHubLocalActions.yellow')
|
color: new ThemeColor('GitHubLocalActions.yellow')
|
||||||
@@ -38,5 +38,13 @@ export class DecorationProvider implements FileDecorationProvider {
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// else if (uri.scheme === SecretsTreeItem.contextValue || uri.scheme === VariablesTreeItem.contextValue || uri.scheme === InputsTreeItem.contextValue || uri.scheme === RunnersTreeItem.contextValue) {
|
||||||
|
// const selected = params.get('selected');
|
||||||
|
|
||||||
|
// return {
|
||||||
|
// badge: `${selected}`
|
||||||
|
// };
|
||||||
|
// }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
import { ThemeIcon, TreeItem, TreeItemCollapsibleState, WorkspaceFolder } from "vscode";
|
import { ThemeIcon, TreeItem, TreeItemCollapsibleState, WorkspaceFolder } from "vscode";
|
||||||
import { act } from "../../extension";
|
import { act } from "../../extension";
|
||||||
import { SettingsManager } from "../../settingsManager";
|
import { Setting, SettingsManager } from "../../settingsManager";
|
||||||
import { StorageKey } from "../../storageManager";
|
import { StorageKey } from "../../storageManager";
|
||||||
import { GithubLocalActionsTreeItem } from "../githubLocalActionsTreeItem";
|
import { GithubLocalActionsTreeItem } from "../githubLocalActionsTreeItem";
|
||||||
import SettingTreeItem from "./setting";
|
import SettingTreeItem from "./setting";
|
||||||
@@ -8,8 +8,9 @@ import SettingTreeItem from "./setting";
|
|||||||
export default class InputsTreeItem extends TreeItem implements GithubLocalActionsTreeItem {
|
export default class InputsTreeItem extends TreeItem implements GithubLocalActionsTreeItem {
|
||||||
static contextValue = 'githubLocalActions.inputs';
|
static contextValue = 'githubLocalActions.inputs';
|
||||||
|
|
||||||
constructor(public workspaceFolder: WorkspaceFolder) {
|
constructor(public workspaceFolder: WorkspaceFolder, inputs: Setting[]) {
|
||||||
super('Inputs', TreeItemCollapsibleState.Collapsed);
|
super('Inputs', TreeItemCollapsibleState.Collapsed);
|
||||||
|
this.description = `${inputs.filter(input => input.selected).length}/${inputs.length}`;
|
||||||
this.contextValue = InputsTreeItem.contextValue;
|
this.contextValue = InputsTreeItem.contextValue;
|
||||||
this.iconPath = new ThemeIcon('record-keys');
|
this.iconPath = new ThemeIcon('record-keys');
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import { ThemeIcon, TreeItem, TreeItemCollapsibleState, WorkspaceFolder } from "vscode";
|
import { ThemeIcon, TreeItem, TreeItemCollapsibleState, WorkspaceFolder } from "vscode";
|
||||||
import { act } from "../../extension";
|
import { act } from "../../extension";
|
||||||
import { SettingsManager } from "../../settingsManager";
|
import { Setting, SettingsManager } from "../../settingsManager";
|
||||||
import { StorageKey } from "../../storageManager";
|
import { StorageKey } from "../../storageManager";
|
||||||
import { GithubLocalActionsTreeItem } from "../githubLocalActionsTreeItem";
|
import { GithubLocalActionsTreeItem } from "../githubLocalActionsTreeItem";
|
||||||
import SettingTreeItem from "./setting";
|
import SettingTreeItem from "./setting";
|
||||||
@@ -8,8 +8,9 @@ import SettingTreeItem from "./setting";
|
|||||||
export default class RunnersTreeItem extends TreeItem implements GithubLocalActionsTreeItem {
|
export default class RunnersTreeItem extends TreeItem implements GithubLocalActionsTreeItem {
|
||||||
static contextValue = 'githubLocalActions.runners';
|
static contextValue = 'githubLocalActions.runners';
|
||||||
|
|
||||||
constructor(public workspaceFolder: WorkspaceFolder) {
|
constructor(public workspaceFolder: WorkspaceFolder, runners: Setting[]) {
|
||||||
super('Runners', TreeItemCollapsibleState.Collapsed);
|
super('Runners', TreeItemCollapsibleState.Collapsed);
|
||||||
|
this.description = `${runners.filter(runner => runner.selected).length}/${runners.length}`;
|
||||||
this.contextValue = RunnersTreeItem.contextValue;
|
this.contextValue = RunnersTreeItem.contextValue;
|
||||||
this.iconPath = new ThemeIcon('server-environment');
|
this.iconPath = new ThemeIcon('server-environment');
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import { ThemeIcon, TreeItem, TreeItemCollapsibleState, WorkspaceFolder } from "vscode";
|
import { ThemeIcon, TreeItem, TreeItemCollapsibleState, WorkspaceFolder } from "vscode";
|
||||||
import { act } from "../../extension";
|
import { act } from "../../extension";
|
||||||
import { SettingsManager } from "../../settingsManager";
|
import { Setting, SettingsManager } from "../../settingsManager";
|
||||||
import { StorageKey } from "../../storageManager";
|
import { StorageKey } from "../../storageManager";
|
||||||
import { GithubLocalActionsTreeItem } from "../githubLocalActionsTreeItem";
|
import { GithubLocalActionsTreeItem } from "../githubLocalActionsTreeItem";
|
||||||
import SettingTreeItem from "./setting";
|
import SettingTreeItem from "./setting";
|
||||||
@@ -8,8 +8,9 @@ import SettingTreeItem from "./setting";
|
|||||||
export default class SecretsTreeItem extends TreeItem implements GithubLocalActionsTreeItem {
|
export default class SecretsTreeItem extends TreeItem implements GithubLocalActionsTreeItem {
|
||||||
static contextValue = 'githubLocalActions.secrets';
|
static contextValue = 'githubLocalActions.secrets';
|
||||||
|
|
||||||
constructor(public workspaceFolder: WorkspaceFolder) {
|
constructor(public workspaceFolder: WorkspaceFolder, secrets: Setting[]) {
|
||||||
super('Secrets', TreeItemCollapsibleState.Collapsed);
|
super('Secrets', TreeItemCollapsibleState.Collapsed);
|
||||||
|
this.description = `${secrets.filter(secret => secret.selected).length}/${secrets.length}`;
|
||||||
this.contextValue = SecretsTreeItem.contextValue;
|
this.contextValue = SecretsTreeItem.contextValue;
|
||||||
this.iconPath = new ThemeIcon('lock');
|
this.iconPath = new ThemeIcon('lock');
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -50,6 +50,7 @@ export default class SettingsTreeDataProvider implements TreeDataProvider<Github
|
|||||||
for await (const [treeItem, state] of event.items) {
|
for await (const [treeItem, state] of event.items) {
|
||||||
await act.settingsManager.editSetting(treeItem.workspaceFolder, { key: treeItem.setting.key, value: treeItem.setting.value, selected: state === TreeItemCheckboxState.Checked, password: treeItem.setting.password }, treeItem.storageKey);
|
await act.settingsManager.editSetting(treeItem.workspaceFolder, { key: treeItem.setting.key, value: treeItem.setting.value, selected: state === TreeItemCheckboxState.Checked, password: treeItem.setting.password }, treeItem.storageKey);
|
||||||
}
|
}
|
||||||
|
this.refresh();
|
||||||
}
|
}
|
||||||
|
|
||||||
async getChildren(element?: GithubLocalActionsTreeItem): Promise<GithubLocalActionsTreeItem[]> {
|
async getChildren(element?: GithubLocalActionsTreeItem): Promise<GithubLocalActionsTreeItem[]> {
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import { ThemeIcon, TreeItem, TreeItemCollapsibleState, WorkspaceFolder } from "vscode";
|
import { ThemeIcon, TreeItem, TreeItemCollapsibleState, WorkspaceFolder } from "vscode";
|
||||||
import { act } from "../../extension";
|
import { act } from "../../extension";
|
||||||
import { SettingsManager } from "../../settingsManager";
|
import { Setting, SettingsManager } from "../../settingsManager";
|
||||||
import { StorageKey } from "../../storageManager";
|
import { StorageKey } from "../../storageManager";
|
||||||
import { GithubLocalActionsTreeItem } from "../githubLocalActionsTreeItem";
|
import { GithubLocalActionsTreeItem } from "../githubLocalActionsTreeItem";
|
||||||
import SettingTreeItem from "./setting";
|
import SettingTreeItem from "./setting";
|
||||||
@@ -8,8 +8,9 @@ import SettingTreeItem from "./setting";
|
|||||||
export default class VariablesTreeItem extends TreeItem implements GithubLocalActionsTreeItem {
|
export default class VariablesTreeItem extends TreeItem implements GithubLocalActionsTreeItem {
|
||||||
static contextValue = 'githubLocalActions.variables';
|
static contextValue = 'githubLocalActions.variables';
|
||||||
|
|
||||||
constructor(public workspaceFolder: WorkspaceFolder) {
|
constructor(public workspaceFolder: WorkspaceFolder, variables: Setting[]) {
|
||||||
super('Variables', TreeItemCollapsibleState.Collapsed);
|
super('Variables', TreeItemCollapsibleState.Collapsed);
|
||||||
|
this.description = `${variables.filter(variable => variable.selected).length}/${variables.length}`;
|
||||||
this.contextValue = VariablesTreeItem.contextValue;
|
this.contextValue = VariablesTreeItem.contextValue;
|
||||||
this.iconPath = new ThemeIcon('symbol-key');
|
this.iconPath = new ThemeIcon('symbol-key');
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,4 +1,7 @@
|
|||||||
import { ThemeIcon, TreeItem, TreeItemCollapsibleState, WorkspaceFolder } from "vscode";
|
import { ThemeIcon, TreeItem, TreeItemCollapsibleState, WorkspaceFolder } from "vscode";
|
||||||
|
import { act } from "../../extension";
|
||||||
|
import { SettingsManager } from "../../settingsManager";
|
||||||
|
import { StorageKey } from "../../storageManager";
|
||||||
import { GithubLocalActionsTreeItem } from "../githubLocalActionsTreeItem";
|
import { GithubLocalActionsTreeItem } from "../githubLocalActionsTreeItem";
|
||||||
import InputsTreeItem from "./inputs";
|
import InputsTreeItem from "./inputs";
|
||||||
import RunnersTreeItem from "./runners";
|
import RunnersTreeItem from "./runners";
|
||||||
@@ -17,11 +20,15 @@ export default class WorkspaceFolderSettingsTreeItem extends TreeItem implements
|
|||||||
async getChildren(): Promise<GithubLocalActionsTreeItem[]> {
|
async getChildren(): Promise<GithubLocalActionsTreeItem[]> {
|
||||||
const items: GithubLocalActionsTreeItem[] = [];
|
const items: GithubLocalActionsTreeItem[] = [];
|
||||||
|
|
||||||
|
const secrets = await act.settingsManager.getSetting(this.workspaceFolder, SettingsManager.secretsRegExp, StorageKey.Secrets, true);
|
||||||
|
const variables = await act.settingsManager.getSetting(this.workspaceFolder, SettingsManager.variablesRegExp, StorageKey.Variables, false);
|
||||||
|
const inputs = await act.settingsManager.getSetting(this.workspaceFolder, SettingsManager.inputsRegExp, StorageKey.Inputs, false);
|
||||||
|
const runners = await act.settingsManager.getSetting(this.workspaceFolder, SettingsManager.runnersRegExp, StorageKey.Runners, false);
|
||||||
items.push(...[
|
items.push(...[
|
||||||
new SecretsTreeItem(this.workspaceFolder),
|
new SecretsTreeItem(this.workspaceFolder, secrets),
|
||||||
new VariablesTreeItem(this.workspaceFolder),
|
new VariablesTreeItem(this.workspaceFolder, variables),
|
||||||
new InputsTreeItem(this.workspaceFolder),
|
new InputsTreeItem(this.workspaceFolder, inputs),
|
||||||
new RunnersTreeItem(this.workspaceFolder)
|
new RunnersTreeItem(this.workspaceFolder, runners)
|
||||||
]);
|
]);
|
||||||
|
|
||||||
return items;
|
return items;
|
||||||
|
|||||||
@@ -7,7 +7,7 @@
|
|||||||
],
|
],
|
||||||
"sourceMap": true,
|
"sourceMap": true,
|
||||||
"rootDir": "src",
|
"rootDir": "src",
|
||||||
"strict": true /* enable all strict type-checking options */
|
"strict": true /* enable all strict type-checking options */
|
||||||
/* Additional Checks */
|
/* Additional Checks */
|
||||||
// "noImplicitReturns": true, /* Report error when not all code paths in function return a value. */
|
// "noImplicitReturns": true, /* Report error when not all code paths in function return a value. */
|
||||||
// "noFallthroughCasesInSwitch": true, /* Report errors for fallthrough cases in switch statement. */
|
// "noFallthroughCasesInSwitch": true, /* Report errors for fallthrough cases in switch statement. */
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ const path = require('path');
|
|||||||
/** @type WebpackConfig */
|
/** @type WebpackConfig */
|
||||||
const extensionConfig = {
|
const extensionConfig = {
|
||||||
target: 'node', // VS Code extensions run in a Node.js-context 📖 -> https://webpack.js.org/configuration/node/
|
target: 'node', // VS Code extensions run in a Node.js-context 📖 -> https://webpack.js.org/configuration/node/
|
||||||
mode: 'none', // this leaves the source code as close as possible to the original (when packaging we set this to 'production')
|
mode: 'none', // this leaves the source code as close as possible to the original (when packaging we set this to 'production')
|
||||||
|
|
||||||
entry: './src/extension.ts', // the entry point of this extension, 📖 -> https://webpack.js.org/configuration/entry-context/
|
entry: './src/extension.ts', // the entry point of this extension, 📖 -> https://webpack.js.org/configuration/entry-context/
|
||||||
output: {
|
output: {
|
||||||
@@ -45,4 +45,4 @@ const extensionConfig = {
|
|||||||
level: "log", // enables logging required for problem matchers
|
level: "log", // enables logging required for problem matchers
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
module.exports = [ extensionConfig ];
|
module.exports = [extensionConfig];
|
||||||
Reference in New Issue
Block a user