Skip to content

Commit a795d43

Browse files
author
春秋一语
authored
Merge pull request #478 from chunqiuyiyu/dashboard-dev-search
Dashboard dev search
2 parents 4ae3146 + 4d25ba5 commit a795d43

File tree

974 files changed

+425831
-1917
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

974 files changed

+425831
-1917
lines changed

.babelrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
"moduleName": "@babel/runtime"
1313
}],
1414
"@babel/plugin-syntax-export-default-from",
15+
"@babel/plugin-syntax-dynamic-import",
1516
["@babel/plugin-proposal-decorators", { "legacy": true }],
1617
["@babel/plugin-proposal-class-properties", { "loose": true }]
1718
],

.travis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
dist: trusty
22
language: node_js
33
node_js:
4-
- '7'
4+
- '10.14.1'
55

66
cache: yarn
77

app/changelog.html

Lines changed: 175 additions & 57 deletions
Large diffs are not rendered by default.

app/commands/commandBindings/misc.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import * as Panel from 'components/Panel/actions'
33
import * as SideBar from 'components/Panel/SideBar/actions'
44
import terminalState from 'components/Terminal/state'
55
import * as Terminal from 'components/Terminal/actions'
6+
import * as searchState from 'commons/Search/state'
67

78
const getComponentByName = name => window.refs[name].getWrappedInstance()
89
export default {
@@ -23,6 +24,9 @@ export default {
2324
'global:show_env': () => {
2425
SideBar.toggleSidePanelView('SIDEBAR.RIGHT.env')
2526
},
27+
'global:show_search': () => {
28+
SideBar.toggleSidePanelView('SIDEBAR.LEFT.find')
29+
},
2630
'modal:dismiss': (c) => {
2731
Modal.dismissModal()
2832
},

app/commands/keymaps.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,12 @@ const keymapStore = observable({
9393
mac: 'cmd+f11',
9494
win: 'ctrl+f11',
9595
label: i18n`settings.keymap.into_zenmode`
96+
},
97+
{
98+
command: 'global:show_search',
99+
mac: 'cmd+shift+f',
100+
win: 'ctrl+shift+f',
101+
label: i18n`settings.keymap.search`
96102
}
97103
],
98104
pluginsKeymaps: [],

app/commons/File/actions.js

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@ import flattenDeep from 'lodash/flattenDeep'
22
import { registerAction } from 'utils/actions'
33
import settings from 'settings'
44
import is from 'utils/is'
5-
import { capitalize } from 'lodash'
6-
import { action, when } from 'mobx'
75
import api from 'backendAPI'
86
import config from 'config'
97
import { showModal } from 'components/Modal/actions'
@@ -70,8 +68,8 @@ const setLanguageSetting = (data) => {
7068
showModal({ type: 'ProjectTypeSelector', position: 'center', data })
7169
} else if (data.length === 1) {
7270
const { type, srcPath } = data[0]
73-
config.mainLanguage = capitalize(type)
74-
settings.languageserver.projectType.value = capitalize(type)
71+
config.mainLanguage = type
72+
settings.languageserver.projectType.value = type
7573
settings.languageserver.sourcePath.value = srcPath
7674
}
7775
}
@@ -96,7 +94,7 @@ export const fetchProjectRoot = registerAction('fs:init', () =>
9694
}
9795
fetchLanguageServerSetting(config.spaceKey).then((res) => {
9896
if (res.code === 0 && res.data) {
99-
setLanguageSetting(res.data.default)
97+
setLanguageSetting([res.data])
10098
} else {
10199
tryIdentificationWorkSpaceType(data)
102100
.then(setLanguageSetting)

app/commons/Search/state.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
1-
import { observable } from 'mobx'
1+
import { observable, map } from 'mobx'
22

33
export const ws = observable({
44
name: '',
55
status: false,
66
first: true
77
})
88

9-
export const searching = observable({
9+
export const searching = map({
1010
pattern: '',
1111
path: '',
1212
caseSensitive: false,
1313
word: false,
1414
isPattern: false,
15-
singleFork: false
15+
singleFork: false,
1616
})
1717

1818
export const searched = observable({

app/commons/Tab/TabBar.jsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import React, { Component } from 'react'
22
import PropTypes from 'prop-types'
3-
import cx from 'classnames'
43
import { observer } from 'mobx-react'
54
import { dnd } from 'utils'
65
import { defaultProps } from 'utils/decorators'

app/components/Editor/components/EditorWidgets/ModeWidget.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import React, { Component } from 'react'
22
import { observer } from 'mobx-react'
3-
import * as monaco from 'monaco-editor'
3+
44
import config from 'config'
55
import cx from 'classnames'
66
import modeInfos from 'components/Editor/components/CodeEditor/addons/mode/modeInfos'

app/components/Editor/state.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -81,10 +81,11 @@ class Editor {
8181
// })
8282

8383
autorun(() => {
84-
if (this.tab && this.tab.isActive && this.tab.editor && this.tab.editor.cm) {
84+
const tab = this.tab;
85+
if (tab && tab.isActive && tab.editor && tab.editor.cm) {
8586
setTimeout(() => {
86-
this.tab.editor.cm.refresh();
87-
this.tab.editor.cm.focus();
87+
tab.editor.cm.refresh();
88+
tab.editor.cm.focus();
8889
}, 0);
8990
}
9091
})

0 commit comments

Comments
 (0)