File tree Expand file tree Collapse file tree
test/unit-tests/databases Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -87,37 +87,6 @@ export interface LocalDatabase {
8787 storagePath : string ;
8888}
8989
90- export type ExpandedDbItem =
91- | RootLocalExpandedDbItem
92- | LocalUserDefinedListExpandedDbItem
93- | RootRemoteExpandedDbItem
94- | RemoteUserDefinedListExpandedDbItem ;
95-
96- export enum ExpandedDbItemKind {
97- RootLocal = "rootLocal" ,
98- LocalUserDefinedList = "localUserDefinedList" ,
99- RootRemote = "rootRemote" ,
100- RemoteUserDefinedList = "remoteUserDefinedList" ,
101- }
102-
103- export interface RootLocalExpandedDbItem {
104- kind : ExpandedDbItemKind . RootLocal ;
105- }
106-
107- export interface LocalUserDefinedListExpandedDbItem {
108- kind : ExpandedDbItemKind . LocalUserDefinedList ;
109- listName : string ;
110- }
111-
112- export interface RootRemoteExpandedDbItem {
113- kind : ExpandedDbItemKind . RootRemote ;
114- }
115-
116- export interface RemoteUserDefinedListExpandedDbItem {
117- kind : ExpandedDbItemKind . RemoteUserDefinedList ;
118- listName : string ;
119- }
120-
12190export function cloneDbConfig ( config : DbConfig ) : DbConfig {
12291 return {
12392 databases : {
Original file line number Diff line number Diff line change 1- import { ExpandedDbItem , ExpandedDbItemKind } from "./config/db-config" ;
21import { DbItem , DbItemKind } from "./db-item" ;
32
3+ export type ExpandedDbItem =
4+ | RootLocalExpandedDbItem
5+ | LocalUserDefinedListExpandedDbItem
6+ | RootRemoteExpandedDbItem
7+ | RemoteUserDefinedListExpandedDbItem ;
8+
9+ export enum ExpandedDbItemKind {
10+ RootLocal = "rootLocal" ,
11+ LocalUserDefinedList = "localUserDefinedList" ,
12+ RootRemote = "rootRemote" ,
13+ RemoteUserDefinedList = "remoteUserDefinedList" ,
14+ }
15+
16+ export interface RootLocalExpandedDbItem {
17+ kind : ExpandedDbItemKind . RootLocal ;
18+ }
19+
20+ export interface LocalUserDefinedListExpandedDbItem {
21+ kind : ExpandedDbItemKind . LocalUserDefinedList ;
22+ listName : string ;
23+ }
24+
25+ export interface RootRemoteExpandedDbItem {
26+ kind : ExpandedDbItemKind . RootRemote ;
27+ }
28+
29+ export interface RemoteUserDefinedListExpandedDbItem {
30+ kind : ExpandedDbItemKind . RemoteUserDefinedList ;
31+ listName : string ;
32+ }
33+
434export function calculateNewExpandedState (
535 currentExpandedItems : ExpandedDbItem [ ] ,
636 dbItem : DbItem ,
Original file line number Diff line number Diff line change 11import { App } from "../common/app" ;
22import { AppEvent , AppEventEmitter } from "../common/events" ;
33import { ValueResult } from "../common/value-result" ;
4- import { ExpandedDbItem } from "./config/db-config" ;
54import { DbConfigStore } from "./config/db-config-store" ;
65import { DbItem , DbListKind } from "./db-item" ;
7- import { calculateNewExpandedState } from "./db-item-expansion" ;
6+ import { calculateNewExpandedState , ExpandedDbItem } from "./db-item-expansion" ;
87import {
98 getSelectedDbItem ,
109 mapDbItemToSelectedDbItem ,
Original file line number Diff line number Diff line change 11import {
22 DbConfig ,
3- ExpandedDbItem ,
4- ExpandedDbItemKind ,
53 LocalDatabase ,
64 LocalList ,
75 RemoteRepositoryList ,
@@ -18,6 +16,7 @@ import {
1816 RootLocalDbItem ,
1917 RootRemoteDbItem ,
2018} from "./db-item" ;
19+ import { ExpandedDbItem , ExpandedDbItemKind } from "./db-item-expansion" ;
2120
2221export function createRemoteTree (
2322 dbConfig : DbConfig ,
Original file line number Diff line number Diff line change 1- import {
2- ExpandedDbItem ,
3- ExpandedDbItemKind ,
4- } from "../../../src/databases/config/db-config" ;
51import {
62 RemoteUserDefinedListDbItem ,
73 RootRemoteDbItem ,
84} from "../../../src/databases/db-item" ;
9- import { calculateNewExpandedState } from "../../../src/databases/db-item-expansion" ;
5+ import {
6+ calculateNewExpandedState ,
7+ ExpandedDbItem ,
8+ ExpandedDbItemKind ,
9+ } from "../../../src/databases/db-item-expansion" ;
1010import {
1111 createRemoteUserDefinedListDbItem ,
1212 createRootRemoteDbItem ,
Original file line number Diff line number Diff line change 11import {
22 DbConfig ,
3- ExpandedDbItem ,
4- ExpandedDbItemKind ,
53 SelectedDbItemKind ,
64} from "../../../src/databases/config/db-config" ;
75import {
@@ -10,6 +8,10 @@ import {
108 isRemoteRepoDbItem ,
119 isRemoteUserDefinedListDbItem ,
1210} from "../../../src/databases/db-item" ;
11+ import {
12+ ExpandedDbItem ,
13+ ExpandedDbItemKind ,
14+ } from "../../../src/databases/db-item-expansion" ;
1315import {
1416 createLocalTree ,
1517 createRemoteTree ,
You can’t perform that action at this time.
0 commit comments