Fix setting file count description to be for user selected files

Signed-off-by: Sanjula Ganepola <sanjulagane@gmail.com>
This commit is contained in:
Sanjula Ganepola
2024-11-21 22:24:58 -05:00
parent c10f7109ac
commit 9079f014c9
3 changed files with 6 additions and 3 deletions

View File

@@ -12,8 +12,9 @@ export default class InputsTreeItem extends TreeItem implements GithubLocalActio
constructor(public workspaceFolder: WorkspaceFolder, inputs: Setting[], inputFiles: SettingFile[]) {
super('Inputs', TreeItemCollapsibleState.Collapsed);
const selectedInputFiles = inputFiles.filter(inputFile => inputFile.selected);
this.description = `${inputs.filter(input => input.selected).length}/${inputs.length}` +
(inputFiles.length > 0 ? ` + ${inputFiles.length} input file(s)` : ``);
(selectedInputFiles.length > 0 ? ` + ${selectedInputFiles.length} input file(s)` : ``);
this.contextValue = InputsTreeItem.contextValue;
this.iconPath = new ThemeIcon('record-keys');
}

View File

@@ -12,8 +12,9 @@ export default class SecretsTreeItem extends TreeItem implements GithubLocalActi
constructor(public workspaceFolder: WorkspaceFolder, secrets: Setting[], secretFiles: SettingFile[]) {
super('Secrets', TreeItemCollapsibleState.Collapsed);
const selectedSecretFiles = secretFiles.filter(secretFile => secretFile.selected);
this.description = `${secrets.filter(secret => secret.selected).length}/${secrets.length}` +
(secretFiles.length > 0 ? ` + ${secretFiles.length} secret file(s)` : ``);
(selectedSecretFiles.length > 0 ? ` + ${selectedSecretFiles.length} secret file(s)` : ``);
this.contextValue = SecretsTreeItem.contextValue;
this.iconPath = new ThemeIcon('lock');
}

View File

@@ -12,8 +12,9 @@ export default class VariablesTreeItem extends TreeItem implements GithubLocalAc
constructor(public workspaceFolder: WorkspaceFolder, variables: Setting[], variableFiles: SettingFile[]) {
super('Variables', TreeItemCollapsibleState.Collapsed);
const selectedVariableFiles = variableFiles.filter(variableFile => variableFile.selected);
this.description = `${variables.filter(variable => variable.selected).length}/${variables.length}` +
(variableFiles.length > 0 ? ` + ${variableFiles.length} variable file(s)` : ``);
(selectedVariableFiles.length > 0 ? ` + ${selectedVariableFiles.length} variable file(s)` : ``);
this.contextValue = VariablesTreeItem.contextValue;
this.iconPath = new ThemeIcon('symbol-key');
}