Skip to content

Commit 5da4b76

Browse files
Use sync icon for sync destination and make it green (#1054)
## Changes <!-- Summary of your changes that are easy to understand --> ## Tests <!-- How is this tested? -->
1 parent 847ce72 commit 5da4b76

File tree

4 files changed

+4
-58
lines changed

4 files changed

+4
-58
lines changed

packages/databricks-vscode/src/bundle/BundleInitWizard.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,7 @@ export class BundleInitWizard {
214214
return Uri.file(choice.label);
215215
}
216216
const choices = await window.showOpenDialog({
217-
title: "Chose a folder where you would want your new project to be",
217+
title: "Choose a folder where you would want your new project to be",
218218
openLabel: "Select folder",
219219
defaultUri: workspaceUri,
220220
canSelectFolders: true,

packages/databricks-vscode/src/configuration/ui/ConfigurationDataProvider.ts

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ import {BundleTargetComponent} from "./BundleTargetComponent";
1414
import {AuthTypeComponent} from "./AuthTypeComponent";
1515
import {ClusterComponent} from "./ClusterComponent";
1616
import {SyncDestinationComponent} from "./SyncDestinationComponent";
17-
import {CodeSynchronizer} from "../../sync";
1817
import {BundleProjectManager} from "../../bundle/BundleProjectManager";
1918

2019
/**
@@ -35,16 +34,11 @@ export class ConfigurationDataProvider
3534
new BundleTargetComponent(this.configModel),
3635
new AuthTypeComponent(this.connectionManager, this.configModel),
3736
new ClusterComponent(this.connectionManager, this.configModel),
38-
new SyncDestinationComponent(
39-
this.codeSynchronizer,
40-
this.connectionManager,
41-
this.configModel
42-
),
37+
new SyncDestinationComponent(this.connectionManager, this.configModel),
4338
];
4439
constructor(
4540
private readonly connectionManager: ConnectionManager,
4641
private readonly bundleProjectManager: BundleProjectManager,
47-
private readonly codeSynchronizer: CodeSynchronizer,
4842
private readonly configModel: ConfigModel
4943
) {
5044
this.disposables.push(

packages/databricks-vscode/src/configuration/ui/SyncDestinationComponent.ts

Lines changed: 2 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import {posix} from "path/posix";
2-
import {CodeSynchronizer} from "../../sync";
32
import {ConfigModel} from "../models/ConfigModel";
43
import {ConnectionManager} from "../ConnectionManager";
54
import {BaseComponent} from "./BaseComponent";
@@ -8,56 +7,13 @@ import {TreeItemCollapsibleState, ThemeIcon, ThemeColor} from "vscode";
87
import {DecorationUtils} from "../../ui/bundle-resource-explorer/utils";
98

109
const TREE_ICON_ID = "WORKSPACE";
11-
function getContextValue(key: string) {
12-
return `databricks.configuration.sync.${key}`;
13-
}
14-
15-
function getTreeItemsForSyncState(codeSynchroniser: CodeSynchronizer) {
16-
let icon, contextValue;
17-
switch (codeSynchroniser.state) {
18-
case "IN_PROGRESS":
19-
icon = new ThemeIcon(
20-
"sync~spin",
21-
new ThemeColor("debugIcon.startForeground")
22-
);
23-
contextValue = getContextValue("running");
24-
break;
25-
26-
case "STOPPED":
27-
icon = new ThemeIcon(
28-
"stop-circle",
29-
new ThemeColor("notificationsErrorIcon.foreground")
30-
);
31-
contextValue = getContextValue("stopped");
32-
break;
33-
34-
case "WATCHING_FOR_CHANGES":
35-
icon = new ThemeIcon(
36-
"eye",
37-
new ThemeColor("debugIcon.startForeground")
38-
);
39-
contextValue = getContextValue("watching");
40-
break;
41-
42-
default:
43-
icon = new ThemeIcon(
44-
"testing-error-icon",
45-
new ThemeColor("notificationsErrorIcon.foreground")
46-
);
47-
contextValue = getContextValue("error");
48-
break;
49-
}
50-
51-
return {icon, contextValue};
52-
}
5310

5411
/**
5512
* Component for displaying sync destination details. Sync destination is
5613
* always pulled from the bundle.
5714
*/
5815
export class SyncDestinationComponent extends BaseComponent {
5916
constructor(
60-
private readonly codeSynchronizer: CodeSynchronizer,
6117
private readonly connectionManager: ConnectionManager,
6218
private readonly configModel: ConfigModel
6319
) {
@@ -93,10 +49,7 @@ export class SyncDestinationComponent extends BaseComponent {
9349
return [];
9450
}
9551

96-
const {icon, contextValue} = getTreeItemsForSyncState(
97-
this.codeSynchronizer
98-
);
99-
52+
const contextValue = "databricks.configuration.sync";
10053
const url = await this.getUrl();
10154

10255
return [
@@ -106,7 +59,7 @@ export class SyncDestinationComponent extends BaseComponent {
10659
description: posix.basename(posix.dirname(config)),
10760
collapsibleState: TreeItemCollapsibleState.Expanded,
10861
contextValue: url ? `${contextValue}.has-url` : contextValue,
109-
iconPath: icon,
62+
iconPath: new ThemeIcon("sync", new ThemeColor("charts.green")),
11063
resourceUri: url
11164
? undefined
11265
: DecorationUtils.getModifiedStatusDecoration(

packages/databricks-vscode/src/extension.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -430,7 +430,6 @@ export async function activate(
430430
const configurationDataProvider = new ConfigurationDataProvider(
431431
connectionManager,
432432
bundleProjectManager,
433-
synchronizer,
434433
configModel
435434
);
436435

0 commit comments

Comments
 (0)