Skip to content

Commit 70202e4

Browse files
authored
Merge branch 'dashboard' into textmate-tokenizer
2 parents 7a2fa71 + 0b194d3 commit 70202e4

Some content is hidden

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

69 files changed

+576
-689
lines changed

.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: 28 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -183,6 +183,7 @@
183183
}
184184
.intro-pc-head .sub {
185185
display: flex;
186+
justify-content: space-between;
186187
align-items: center;
187188
height: 40px;
188189
padding: 0 30px;
@@ -192,6 +193,10 @@
192193
.intro-pc-head .sub a {
193194
color: #e3e6e8;
194195
}
196+
.intro-pc-head .sub .left {
197+
display: flex;
198+
align-items: center;
199+
}
195200
.intro-pc-head .sub-menu {
196201
margin-right: 30px;
197202
position: relative;
@@ -337,7 +342,7 @@
337342
transition: height .2s ease;
338343
}
339344
.intro-mobile-head .dropdown .cs.on .cs-dropdown {
340-
height: 250px;
345+
height: 300px;
341346
}
342347
.intro-mobile-head .dropdown .cs-menu {
343348
display: flex;
@@ -616,21 +621,26 @@
616621
</div>
617622
</div>
618623
<div class="sub">
619-
<div class="sub-menu">
620-
<a class="post-message" href="https://studio.dev.tencent.com/intro">产品介绍</a>
621-
</div>
622-
<div class="sub-menu">
623-
<a href="https://studio.dev.tencent.com/dashboard/workspace" target="_blank" rel="noopener">工作空间</a>
624-
</div>
625-
<div class="sub-menu">
626-
<a class="post-message" href="https://studio.dev.tencent.com/plugins">插件市场</a>
627-
</div>
628-
<div class="sub-menu on">
629-
<a class="post-message" href="https://studio.dev.tencent.com/changelog">更新日志</a>
624+
<div class="left">
625+
<div class="sub-menu">
626+
<a class="post-message" href="https://studio.dev.tencent.com/intro">产品介绍</a>
627+
</div>
628+
<div class="sub-menu">
629+
<a href="https://studio.dev.tencent.com/dashboard/workspace" target="_blank" rel="noopener">工作空间</a>
630+
</div>
631+
<div class="sub-menu">
632+
<a class="post-message" href="https://studio.dev.tencent.com/plugins">插件市场</a>
633+
</div>
634+
<div class="sub-menu on">
635+
<a class="post-message" href="https://studio.dev.tencent.com/changelog">更新日志</a>
636+
</div>
637+
<div class="sub-menu">
638+
<a href="https://studio.qcloud.coding.net/campaign/favorite-plugins/" target="_blank" rel="noopener">插件大赛</a>
639+
<div class="new">NEW</div>
640+
</div>
630641
</div>
631-
<div class="sub-menu">
632-
<a href="https://studio.qcloud.coding.net/campaign/favorite-plugins/" target="_blank" rel="noopener">插件大赛</a>
633-
<div class="new">NEW</div>
642+
<div class="right">
643+
<a href="https://studio.dev.tencent.com/plugins-docs/" target="_blank" rel="noopener noreferrer">插件开发文档</a>
634644
</div>
635645
</div>
636646
</div>
@@ -665,6 +675,9 @@
665675
<div class="cs-menu">
666676
<a class="post-message" href="https://studio.dev.tencent.com/plugins">插件市场</a>
667677
</div>
678+
<div class="cs-menu">
679+
<a href="https://studio.dev.tencent.com/plugins-docs/" target="_blank" rel="noopener noreferrer">插件开发文档</a>
680+
</div>
668681
<div class="cs-menu on">
669682
<a class="post-message" href="https://studio.dev.tencent.com/changelog">更新日志</a>
670683
</div>

app/commons/File/actions.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +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 { action, when } from 'mobx'
65
import api from 'backendAPI'
76
import config from 'config'
87
import { showModal } from 'components/Modal/actions'

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/state.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,16 @@ class Editor {
8080
// }
8181
// })
8282

83+
autorun(() => {
84+
const tab = this.tab;
85+
if (tab && tab.isActive && tab.editor && tab.editor.cm) {
86+
setTimeout(() => {
87+
tab.editor.cm.refresh();
88+
tab.editor.cm.focus();
89+
}, 0);
90+
}
91+
})
92+
8393
if (!this.file) {
8494
cm.setCursor(cm.posFromIndex(this.content.length))
8595
}

app/components/Git/GitCommitView.jsx

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,7 @@ var GitCommitView = ({isWorkingDirClean, ...actionProps}) => {
1818
: (<div>
1919
<GitFileTree
2020
statusFiles={statusFiles}
21-
handleClick={(path) => {
22-
diffFile({
23-
path, newRef: 'HEAD', oldRef: '~~unstaged~~'
24-
})
25-
}}
21+
handleClick={path => diffFile({ path, newRef: 'HEAD', oldRef: '~~unstaged~~' })}
2622
/>
2723
<hr />
2824
<div className='git-commit-message-container'>

app/components/Git/GitFileTree.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ class _GitFileTreeNode extends Component {
5959
return (
6060
<div className='filetree-node-container'>
6161
{ node.isRoot ?
62-
(<div className='filetree-node' ref={r => this.nodeDOM = r} >
62+
(<div className='filetree-node' ref={r => this.nodeDOM = r}>
6363
{ displayOnly ? null
6464
: <span className='filetree-node-checkbox'
6565
style={{marginRight: 0}}

app/components/Git/actions.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -357,6 +357,9 @@ export const selectNode = createAction(GIT_STATUS_SELECT_NODE, node => node)
357357
export const GIT_STATUS_STAGE_NODE = 'GIT_STATUS_STAGE_NODE'
358358
export const toggleStaging = createAction(GIT_STATUS_STAGE_NODE, node => node)
359359

360+
export const GIT_STATUS_STAGE_ALL = 'GIT_STATUS_STAGE_ALL';
361+
export const toggleStagingAll = createAction(GIT_STATUS_STAGE_ALL);
362+
360363
export const GIT_MERGE = 'GIT_MERGE'
361364
export const gitMerge = createAction(GIT_MERGE)
362365
export function mergeFile (path) {

app/components/Git/reducer.js

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import {
66
GIT_STATUS_FOLD_NODE,
77
GIT_STATUS_SELECT_NODE,
88
GIT_STATUS_STAGE_NODE,
9+
GIT_STATUS_STAGE_ALL,
910
GIT_BRANCH,
1011
GIT_CHECKOUT,
1112
GIT_CHECKOUT_FAILED,
@@ -187,9 +188,10 @@ export default handleActions({
187188
const node = action.payload
188189
let statusFiles = state.statusFiles
189190
if (!node.isDir) {
190-
statusFiles = state.statusFiles.set(node.path,
191-
node.set('isStaged', !node.isStaged)
192-
)
191+
statusFiles = state.statusFiles.set(
192+
node.path,
193+
node.set('isStaged', !node.isStaged),
194+
);
193195
} else {
194196
const stagedLeafNodes = node.leafNodes.filter(leafNodePath =>
195197
state.statusFiles.get(leafNodePath).get('isStaged')
@@ -207,6 +209,17 @@ export default handleActions({
207209
return { ...state, statusFiles }
208210
},
209211

212+
[GIT_STATUS_STAGE_ALL]: (state, action) => {
213+
let statusFiles = state.statusFiles;
214+
const allStaged = statusFiles.toArray().filter(v => !v.isDir).every(node => node.isStaged);
215+
statusFiles = statusFiles.withMutations(statusFiles => {
216+
statusFiles.filter(v => !v.isDir).toArray().forEach(node => {
217+
statusFiles.set(node.path, node.set('isStaged', !allStaged));
218+
});
219+
return statusFiles;
220+
});
221+
return { ...state, statusFiles };
222+
},
210223

211224
[GIT_UPDATE_COMMIT_MESSAGE]: (state, action) => ({ ...state, commitMessage: action.payload }),
212225

app/components/Modal/GitCommitView/CommitFileList.js

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import React, { PureComponent } from 'react'
22
import PropTypes from 'prop-types'
33
import cx from 'classnames'
44
import styled from 'styled-components'
5+
import i18n from 'utils/createI18n'
56

67
const Label = styled.span`
78
height: 100%;
@@ -13,19 +14,13 @@ const Label = styled.span`
1314
const SingleFileNode = ({ item, toggleStaging, handleClick, active }) => (
1415
<div className={cx('filetree-node filetree-node-container', { active: !!active })}>
1516
<span className='filetree-node-checkbox' onClick={e => toggleStaging(item)}>
16-
<i
17-
className={cx('fa', {
18-
'fa-check-square': !item.isDir && item.isStaged,
19-
'fa-square-o': !item.isDir && !item.isStaged
20-
})}
21-
/>
17+
<i className={`fa ${!item.isStaged ? 'fa-square-o' : 'fa-check-square'}`}></i>
2218
</span>
2319
<span className='filetree-node-icon'>
2420
<i
25-
className={cx('fa file-status-indicator', item.status.toLowerCase(), {
21+
className={cx('file-status-indicator fa', item.status.toLowerCase(), {
2622
'fa-folder-o': item.isDir,
27-
'fa-pencil-square':
28-
item.status === 'MODIFIED' || item.status === 'CHANGED' || item.status === 'MODIFY',
23+
'fa-pencil-square': item.status === 'MODIFIED' || item.status === 'CHANGED' || item.status === 'MODIFY',
2924
'fa-plus-square': item.status === 'UNTRACKED' || item.status === 'ADD',
3025
'fa-minus-square': item.status === 'MISSING',
3126
'fa-exclamation-circle': item.status === 'CONFLICTION'
@@ -46,17 +41,24 @@ SingleFileNode.propTypes = {
4641
class CommitFileList extends PureComponent {
4742
static propTypes = {
4843
statusFiles: PropTypes.object,
44+
toggleStagingAll: PropTypes.func,
4945
toggleStaging: PropTypes.func,
5046
handleClick: PropTypes.func,
5147
active: PropTypes.string
5248
}
5349

5450
render () {
55-
const { statusFiles, toggleStaging, handleClick, active } = this.props
56-
const unStagedFiles = statusFiles.filter(v => !v.isDir).toArray()
57-
51+
const { statusFiles, toggleStagingAll, toggleStaging, handleClick, active } = this.props
52+
const unStagedFiles = statusFiles.filter(v => !v.isDir).toArray();
53+
const allStaged = unStagedFiles.every(v => v.isStaged);
5854
return (
5955
<div className='git-commit-files git-filetree-container'>
56+
{unStagedFiles.length > 1 && (
57+
<div className="checkbox-all" onClick={toggleStagingAll}>
58+
<i className={`fa ${!allStaged ? 'fa-square-o' : 'fa-check-square'}`}></i>
59+
<span className="label">{i18n`git.commitView.all`}</span>
60+
</div>
61+
)}
6062
{unStagedFiles.map(item => (
6163
<SingleFileNode
6264
item={item}

0 commit comments

Comments
 (0)