11import { posix } from "path/posix" ;
2- import { CodeSynchronizer } from "../../sync" ;
32import { ConfigModel } from "../models/ConfigModel" ;
43import { ConnectionManager } from "../ConnectionManager" ;
54import { BaseComponent } from "./BaseComponent" ;
@@ -8,56 +7,13 @@ import {TreeItemCollapsibleState, ThemeIcon, ThemeColor} from "vscode";
87import { DecorationUtils } from "../../ui/bundle-resource-explorer/utils" ;
98
109const 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 */
5815export 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 (
0 commit comments