Skip to content

Commit b56f876

Browse files
author
Yang Zhen
committed
Update workstation version
1 parent 3741c5a commit b56f876

File tree

12 files changed

+80
-61
lines changed

12 files changed

+80
-61
lines changed

app/components/Menu/MenuItem.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ class MenuItem extends Component {
103103
disabled: isDisabled,
104104
})}
105105
onMouseEnter={this.onMouseEnter}
106-
onClick={!isDisabled && this.execCommand}
106+
onClick={!isDisabled ? this.execCommand : undefined}
107107
id={item.id}
108108
>
109109
{(item.icon || item.iconElement) && (

app/components/MenuBar/menuBarItems.jsx

Lines changed: 26 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -12,160 +12,160 @@ const menuBarItems = observable([
1212
items: [
1313
{
1414
key: 'settings',
15-
name: i18n`menuBarItems.meta.main`,
15+
name: i18n.get('menuBarItems.meta.main'),
1616
icon: 'octicon octicon-gear',
1717
command: 'global:show_settings',
1818
canopen: true
1919
}
2020
]
2121
}, {
2222
key: 'file',
23-
name: i18n`menuBarItems.file.main`,
23+
name: i18n.get('menuBarItems.file.main'),
2424
items: [
2525
{
2626
key: 'newFile',
27-
name: i18n`menuBarItems.file.newFile`,
27+
name: i18n.get('menuBarItems.file.newFile'),
2828
icon: 'fa fa-file-text-o',
2929
command: 'file:new_file',
3030
showMore: true
3131
}, {
3232
key: 'newFolder',
33-
name: i18n`menuBarItems.file.newFolder`,
33+
name: i18n.get('menuBarItems.file.newFolder'),
3434
icon: 'fa fa-folder-o',
3535
command: 'file:new_folder',
3636
showMore: true
3737
}, {
3838
key: 'save',
39-
name: i18n`menuBarItems.file.save`,
39+
name: i18n.get('menuBarItems.file.save'),
4040
icon: 'fa fa-floppy-o',
4141
command: 'file:save'
4242
}
4343
]
4444
}, {
4545
key: 'edit',
46-
name: i18n`menuBarItems.edit.main`,
46+
name: i18n.get('menuBarItems.edit.main'),
4747
items: [
4848
{
4949
key: 'format',
50-
name: i18n`menuBarItems.edit.format`,
50+
name: i18n.get('menuBarItems.edit.format'),
5151
icon: '',
5252
command: 'edit:toggle_format',
5353
}, {
5454
key: 'comment',
55-
name: i18n`menuBarItems.edit.comment`,
55+
name: i18n.get('menuBarItems.edit.comment'),
5656
icon: '',
5757
command: 'edit:toggle_comment',
5858
}
5959
]
6060
}, {
6161
key: 'git',
62-
name: i18n`menuBarItems.git.main`,
62+
name: i18n.get('menuBarItems.git.main'),
6363
onOpen: onGitMenuOpen,
6464
items: [
6565
{
6666
key: 'commit',
67-
name: i18n`menuBarItems.git.commit`,
67+
name: i18n.get('menuBarItems.git.commit'),
6868
icon: 'octicon octicon-git-commit',
6969
command: 'git:commit',
7070
showMore: true,
7171
}, {
7272
key: 'pull',
73-
name: i18n`menuBarItems.git.pull`,
73+
name: i18n.get('menuBarItems.git.pull'),
7474
icon: 'octicon octicon-repo-pull',
7575
command: 'git:pull'
7676
}, {
7777
key: 'push',
78-
name: i18n`menuBarItems.git.push`,
78+
name: i18n.get('menuBarItems.git.push'),
7979
icon: 'octicon octicon-repo-push',
8080
command: 'git:push'
8181
},
8282
divider,
8383
{
8484
key: 'resolveConflicts',
8585
group: 'conflicts',
86-
name: i18n`menuBarItems.git.resolveConflicts`,
86+
name: i18n.get('menuBarItems.git.resolveConflicts'),
8787
command: 'git:resolve_conflicts',
8888
showMore: true
8989
},
9090
divider,
9191
{
9292
key: 'stash',
93-
name: i18n`menuBarItems.git.stashChanges`,
93+
name: i18n.get('menuBarItems.git.stashChanges'),
9494
command: 'git:stash',
9595
showMore: true,
9696
},
9797
{
9898
key: 'unstash',
99-
name: i18n`menuBarItems.git.unstashChanges`,
99+
name: i18n.get('menuBarItems.git.unstashChanges'),
100100
command: 'git:unstash',
101101
showMore: true
102102
},
103103
{
104104
key: 'reset',
105-
name: i18n`menuBarItems.git.resetHead`,
105+
name: i18n.get('menuBarItems.git.resetHead'),
106106
command: 'git:reset_head',
107107
showMore: true
108108
},
109109
divider,
110110
{
111111
key: 'branches',
112-
name: i18n`menuBarItems.git.branches`,
112+
name: i18n.get('menuBarItems.git.branches'),
113113
icon: 'octicon octicon-git-branch',
114114
command: 'global:show_branches',
115115
showMore: true
116116
},
117117
{
118118
key: 'merge',
119-
name: i18n`menuBarItems.git.mergeBranch`,
119+
name: i18n.get('menuBarItems.git.mergeBranch'),
120120
icon: 'octicon octicon-git-merge',
121121
command: 'git:merge',
122122
showMore: true
123123
},
124124
{
125125
key: 'tag',
126-
name: i18n`menuBarItems.git.tag`,
126+
name: i18n.get('menuBarItems.git.tag'),
127127
command: 'git:tag',
128128
showMore: true
129129
},
130130
divider,
131131
{
132132
key: 'rebase',
133-
name: i18n`menuBarItems.git.rebase`,
133+
name: i18n.get('menuBarItems.git.rebase'),
134134
command: 'git:rebase:start',
135135
showMore: true
136136
},
137137
{
138138
key: 'abort',
139-
name: i18n`menuBarItems.git.abortRebase`,
139+
name: i18n.get('menuBarItems.git.abortRebase'),
140140
command: 'git:rebase:abort',
141141
getIsDisabled,
142142
},
143143
{
144144
key: 'continue',
145-
name: i18n`menuBarItems.git.continueRebase`,
145+
name: i18n.get('menuBarItems.git.continueRebase'),
146146
command: 'git:rebase:continue',
147147
getIsDisabled,
148148
},
149149
{
150150
key: 'skipCommit',
151-
name: i18n`menuBarItems.git.skipCommit`,
151+
name: i18n.get('menuBarItems.git.skipCommit'),
152152
command: 'git:rebase:skip_commit',
153153
showMore: true,
154154
getIsDisabled,
155155
}
156156
]
157157
}, {
158158
key: 'tools',
159-
name: i18n`menuBarItems.tools.main`,
159+
name: i18n.get('menuBarItems.tools.main'),
160160
items: [
161161
{
162162
key: 'terminal',
163-
name: i18n`menuBarItems.tools.terminal`,
163+
name: i18n.get('menuBarItems.tools.terminal'),
164164

165165
icon: 'octicon octicon-terminal',
166166
items: [
167167
{
168-
name: i18n`menuBarItems.tools.newTerminal`,
168+
name: i18n.get('menuBarItems.tools.newTerminal'),
169169
icon: 'octicon octicon-terminal',
170170
command: 'tools:terminal:new_terminal'
171171
}

app/components/Notification/index.jsx

Lines changed: 16 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import React from 'react'
1+
import React, { Component } from 'react'
22
import { inject } from 'mobx-react'
33
import { NotificationStack } from 'react-notification'
44
import * as actions from './actions'
@@ -22,15 +22,21 @@ const activeBarStyleFactory = (index, style) => {
2222
})
2323
}
2424

25-
const Notification = ({ notifications }) => {
26-
return (
27-
<NotificationStack
28-
notifications={notifications}
29-
onDismiss={notification => actions.removeNotification(notification.key)}
30-
barStyleFactory={barStyleFactory}
31-
activeBarStyleFactory={activeBarStyleFactory}
32-
/>
33-
)
25+
class Notification extends Component {
26+
constructor (props) {
27+
super()
28+
}
29+
render () {
30+
const { notifications } = this.props
31+
return (
32+
<NotificationStack
33+
notifications={notifications}
34+
onDismiss={notification => actions.removeNotification(notification.key)}
35+
barStyleFactory={barStyleFactory}
36+
activeBarStyleFactory={activeBarStyleFactory}
37+
/>
38+
)
39+
}
3440
}
3541

3642
export default inject(() => {

app/config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ const config = observable({
1818
preventAccidentalClose: false,
1919
hasRehydrated: getCookie('skipRehydrate') || false,
2020
estimatedMap: observable.map({}),
21-
nodeEnv: __NODE_ENV__,
21+
nodeEnv: __NODE_ENV__ || null,
2222
get previewURL () {
2323
if (config.staticServingToken && config.spaceKey && config.staticServingURL) {
2424
return config.staticServingURL.replace(

app/workstation/initialize.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,6 @@ async function initialize () {
6464
}
6565
return goto(state.keys()[0])*/
6666
for (const value of state.values()) {
67-
console.log('== value ==', value.desc)
6867
if (checkEnable(value.enable)) {
6968
await step(`[${stepNum++}] ${value.desc}`, value.func)
7069
}

dist/workstation.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "coding-web-ide",
3-
"version": "0.1.1",
3+
"version": "0.1.2",
44
"description": "Coding WebIDE",
55
"main": "dist/workstation",
66
"private": true,
@@ -59,6 +59,7 @@
5959
"eslint-plugin-jsx-a11y": "^4.0.0",
6060
"eslint-plugin-react": "^6.9.0",
6161
"eslint-stats": "^1.0.0",
62+
"extract-text-webpack-plugin": "2.1.2",
6263
"file-loader": "^1.1.5",
6364
"git-revision-webpack-plugin": "^2.4.1",
6465
"html-webpack-plugin": "^2.28.0",

webpack_configs/stylesheet.lib.config.js

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,12 @@ module.exports = function (paths) {
77
rules: [
88
{
99
test: /\.woff2?\??([a-f\d]+)?(v=\d+\.\d+\.\d+)?$/,
10-
use: ['file-loader']
10+
use: {
11+
loader: 'url-loader',
12+
options: {
13+
limit: 100000
14+
}
15+
}
1116
// loader: "url?limit=10000&mimetype=application/font-woff"
1217
}, {
1318
test: /\.ttf\??([a-f\d]+)?(v=\d+\.\d+\.\d+)?$/,
@@ -18,7 +23,12 @@ module.exports = function (paths) {
1823
use: ['file-loader']
1924
}, {
2025
test: /\.svg\??([a-f\d]+)?(v=\d+\.\d+\.\d+)?$/,
21-
use: ['file-loader']
26+
use: {
27+
loader: 'url-loader',
28+
options: {
29+
limit: 100000
30+
}
31+
}
2232
// loader: "url?limit=10000&mimetype=image/svg+xml"
2333
}, {
2434
test: /\.styl$/,

webpack_configs/webpack.dev.config.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,8 @@ const config = merge(
6464
__STATIC_SERVING_URL__: str(process.env.STATIC_SERVING_URL || ''),
6565
__PACKAGE_DEV__: process.env.PACKAGE_DEV,
6666
__PACKAGE_SERVER__: str(process.env.PACKAGE_SERVER || process.env.HTML_BASE_URL || ''),
67-
__PACKAGE_PORTS__: str(getPluginsPorts)
67+
__PACKAGE_PORTS__: str(getPluginsPorts),
68+
__NODE_ENV__: str(process.env.NODE_ENV || ''),
6869
}),
6970
]
7071
},

webpack_configs/webpack.prod.config.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ module.exports = merge(
2323
__STATIC_SERVING_URL__: str(process.env.STATIC_SERVING_URL || ''),
2424
__PACKAGE_DEV__: false,
2525
__PACKAGE_SERVER__: str(process.env.PACKAGE_SERVER || process.env.HTML_BASE_URL || ''),
26+
__NODE_ENV__: str(process.env.NODE_ENV || ''),
2627
}),
2728
]
2829
}

0 commit comments

Comments
 (0)