Skip to content

Commit

Permalink
implemented editing for existing servers and improved getting a list …
Browse files Browse the repository at this point in the history
…of existing repos for a user (fixes #4)
  • Loading branch information
maximtrp committed Dec 20, 2023
1 parent c54a9fe commit fa39cf2
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 9 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# Change Log

## 2.0.1 - 2023-12-20

- Editing server details is now possible.
- Replaced `getRepos` API call with `selfRepos`. This should fix the extension behavior with restricted Drone CI setups.

## 2.0.0 - 2023-11-10

- Refactored server operations (add, edit, delete, select).
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "drone-ci",
"displayName": "Drone CI",
"description": "Manage your Drone CI servers easily",
"version": "2.0.0",
"version": "2.0.1",
"publisher": "maximtrp",
"author": {
"name": "Maksim Terpilovskii",
Expand Down
2 changes: 1 addition & 1 deletion src/repos.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ export class ReposProvider implements vscode.TreeDataProvider<Repo> {
let repos: RepoInfo[] = [];

try {
repos = (await this.client.getRepos()) || [];
repos = (await this.client.selfRepos()) || [];
if (repos.length > 0) {
const sortField: string =
vscode.workspace.getConfiguration("drone-ci.sortRepos").get("by") || "Name";
Expand Down
8 changes: 1 addition & 7 deletions src/servers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -83,12 +83,6 @@ export class ServersProvider implements vscode.TreeDataProvider<Server> {
if (!url) {
vscode.window.showWarningMessage(`You have not entered Drone CI server address`);
return;
} else {
const serverExists = this.servers.find((server) => server.url === url);
if (serverExists) {
vscode.window.showErrorMessage("Server with this URL already exists");
return;
}
}

const label = await vscode.window.showInputBox({
Expand All @@ -106,7 +100,7 @@ export class ServersProvider implements vscode.TreeDataProvider<Server> {
})) || server.token;

const serverNew: ServerInfo = {
id: this.servers.length.toString(),
id: server.id,
url: url,
token: token,
label: label || url.replace("https://", ""),
Expand Down

0 comments on commit fa39cf2

Please sign in to comment.