Skip to content

Commit 05098f3

Browse files
zhangtengjinwewoor
authored andcommitted
fix: delete some test code
delete some test code
1 parent 519a651 commit 05098f3

File tree

3 files changed

+14
-56
lines changed

3 files changed

+14
-56
lines changed

src/components/tree/index.tsx

+10-10
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,12 @@ import { Icon } from 'mo/components/icon';
1111
import { prefixClaName, classNames } from 'mo/common/className';
1212

1313
// TODO: 提出来
14-
export const FileTypes = {
15-
FILE: 'file',
16-
FOLDER: 'folder',
17-
ROOT: 'rootFolder',
14+
export enum FileTypes {
15+
FILE = 'file',
16+
FOLDER = 'folder',
17+
ROOT = 'rootFolder',
1818
};
19-
export type FileType = 'file' | 'folder' | 'rootFolder';
19+
export type FileType = keyof typeof FileTypes;
2020

2121
export interface ITreeNodeItem {
2222
name?: string;
@@ -51,11 +51,11 @@ export interface ITreeProps {
5151
expandedKeys?: Key[];
5252
defaultCheckedKeys?: Key[];
5353
checkedKeys?:
54-
| Key[]
55-
| {
56-
checked: Key[];
57-
halfChecked: Key[];
58-
};
54+
| Key[]
55+
| {
56+
checked: Key[];
57+
halfChecked: Key[];
58+
};
5959
defaultSelectedKeys?: Key[];
6060
selectedKeys?: Key[];
6161
titleRender?: (node: DataNode) => React.ReactNode;

src/controller/explorer/folderTree.tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ export class FolderTreeController
3333
this.initView();
3434
}
3535

36-
private initView() {}
36+
private initView() { }
3737

3838
public readonly onSelectFile = (file: ITreeNodeItem) => {
3939
const tabData = {
@@ -75,7 +75,7 @@ export class FolderTreeController
7575
content: 'This action is irreversible!',
7676
onOk() {
7777
explorerService.delete(nodeId, () => {
78-
new EditorController().onCloseTab(nodeId);
78+
new EditorController().onCloseTab(`${nodeId}`, editorService.getState()?.current?.id);
7979
});
8080
},
8181
});

src/extensions/search/searchPane.tsx

+2-44
Original file line numberDiff line numberDiff line change
@@ -3,18 +3,14 @@ import Toolbar from 'mo/components/toolbar';
33
import { prefixClaName } from 'mo/common/className';
44
import { Header, Content } from 'mo/workbench/sidebar';
55
import {
6-
activityBarService,
76
colorThemeService,
87
explorerService,
9-
editorService,
108
} from 'mo';
11-
import { Button } from 'mo/components/button';
129
import { Select, Option } from 'mo/components/select';
1310
import { IColorTheme } from 'mo/model/colorTheme';
1411
import SearchTree from './searchTree';
15-
import { IEditorTab } from 'mo/model';
1612

17-
interface ISearchPaneToolBar {}
13+
interface ISearchPaneToolBar { }
1814

1915
const initialState = {
2016
input: '',
@@ -46,7 +42,7 @@ type State = typeof initialState;
4642
export default class SearchPane extends React.Component<
4743
ISearchPaneToolBar,
4844
State
49-
> {
45+
> {
5046
state: State;
5147

5248
constructor(props) {
@@ -106,34 +102,6 @@ export default class SearchPane extends React.Component<
106102

107103
render() {
108104
const { toolbar } = this.state;
109-
110-
const addABar = function () {
111-
const id = Math.random() * 10 + 1;
112-
activityBarService.addBar({
113-
id: id + '',
114-
name: 'folder' + id,
115-
iconName: 'codicon-edit',
116-
});
117-
};
118-
119-
const newEditor = function () {
120-
const key = Math.random() * 10 + 1;
121-
const tabData: IEditorTab = {
122-
id: `${key}`,
123-
name: `editor.js`,
124-
modified: false,
125-
data: {
126-
value: `hello javascript ${key}`,
127-
path: 'desktop/molecule/editor1',
128-
language: 'javascript',
129-
},
130-
breadcrumb: [{ id: `${key}`, name: 'editor.js' }],
131-
};
132-
console.log('open editor:', tabData);
133-
editorService.open(tabData);
134-
};
135-
136-
const openCommand = function () {};
137105
const { input } = this.state;
138106
return (
139107
<div className={prefixClaName('search-pane', 'sidebar')}>
@@ -151,16 +119,6 @@ export default class SearchPane extends React.Component<
151119
searchValue={input}
152120
/>
153121
)}
154-
<hr></hr>
155-
<div>
156-
<Button onClick={addABar}>Add Bar</Button>
157-
<Button onClick={newEditor}>New Editor</Button>
158-
<Button onClick={openCommand}>Command Palette</Button>
159-
</div>
160-
<div style={{ margin: '50px 20px' }}>
161-
ColorThemes:
162-
{this.renderColorThemes()}
163-
</div>
164122
</Content>
165123
</div>
166124
);

0 commit comments

Comments
 (0)