|
1 | 1 | import * as vscode from "vscode"; |
2 | 2 | import {GitHubRepoContext} from "../../git/repository"; |
3 | | -import {Environment, EnvironmentVariable, RepoVariable} from "../../model"; |
| 3 | +import {Environment, EnvironmentVariable, OrgVariable, RepoVariable} from "../../model"; |
4 | 4 |
|
5 | 5 | export type VariableCommandArgs = Pick<VariableNode, "gitHubRepoContext" | "variable" | "environment">; |
6 | 6 |
|
7 | 7 | export class VariableNode extends vscode.TreeItem { |
| 8 | + constructor(gitHubRepoContext: GitHubRepoContext, variable: RepoVariable); |
| 9 | + constructor(gitHubRepoContext: GitHubRepoContext, variable: EnvironmentVariable, environment: Environment); |
| 10 | + constructor(githubRepoContext: GitHubRepoContext, variable: OrgVariable, environment: undefined, org: true); |
8 | 11 | constructor( |
9 | 12 | public readonly gitHubRepoContext: GitHubRepoContext, |
10 | | - public readonly variable: EnvironmentVariable | RepoVariable, |
11 | | - public readonly environment?: Environment |
| 13 | + public readonly variable: EnvironmentVariable | RepoVariable | OrgVariable, |
| 14 | + public readonly environment?: Environment, |
| 15 | + public readonly org?: boolean |
12 | 16 | ) { |
13 | 17 | super(variable.name); |
14 | 18 | this.description = variable.value; |
15 | 19 |
|
16 | | - this.contextValue = environment ? "env-variable" : "repo-variable"; |
| 20 | + this.contextValue = environment ? "env-variable" : org ? "org-variable" : "repo-variable"; |
17 | 21 | } |
18 | 22 | } |
0 commit comments