Skip to content

Commit f2c8dc7

Browse files
committed
update dependencies, add publish state
1 parent 9cc4204 commit f2c8dc7

File tree

11 files changed

+127
-98
lines changed

11 files changed

+127
-98
lines changed

package.json

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
"autoresponsive-react": "^1.1.31",
1515
"enquire-js": "^0.2.1",
1616
"leancloud-storage": "^3.5.0",
17-
"raw-loader": "^1.0.0",
17+
"raw-loader": "^2.0.0",
1818
"rc-animate": "^2.4.4",
1919
"rc-banner-anim": "^2.1.0",
2020
"rc-drawer": "^1.5.0",
@@ -37,15 +37,15 @@
3737
"blueimp-md5": "^2.10.0",
3838
"classnames": "^2.2.5",
3939
"codemirror": "^5.36.0",
40-
"commander": "~2.19.0",
40+
"commander": "~2.20.0",
4141
"concurrently": "^4.0.1",
4242
"cross-env": "^5.1.1",
4343
"deep-eql": "^4.0.0",
4444
"dragula": "^3.7.2",
4545
"eslint": "^5.4.0",
4646
"eslint-config-airbnb": "^17.0.0",
4747
"eslint-plugin-babel": "^5.1.0",
48-
"eslint-plugin-compat": "^2.6.2",
48+
"eslint-plugin-compat": "^3.1.1",
4949
"eslint-plugin-import": "^2.14.0",
5050
"eslint-plugin-jsx-a11y": "^6.1.2",
5151
"eslint-plugin-markdown": "^1.0.0-beta.6",
@@ -58,15 +58,15 @@
5858
"medium-editor": "^5.23.3",
5959
"pre-commit": "1.x",
6060
"prop-types": "^15.6.1",
61-
"react": "^16.0.0",
61+
"react": "^16.6.0",
6262
"react-color": "^2.13.8",
6363
"react-dom": "^16.0.0",
6464
"react-intl": "^2.3.0",
65-
"react-redux": "^6.0.0",
65+
"react-redux": "^7.0.2",
6666
"redux": "^4.0.1",
6767
"redux-logger": "^3.0.6",
6868
"redux-thunk": "^2.2.0",
69-
"stylelint": "^9.7.1",
69+
"stylelint": "^10.0.1",
7070
"stylelint-config-standard": "^18.2.0"
7171
},
7272
"pre-commit": [

site/bisheng.common.config.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,10 +87,10 @@ module.exports = {
8787
};
8888
config.externals = config.externals || {};
8989
config.externals['react-router-dom'] = 'ReactRouterDOM';
90-
config.externals = Object.assign({}, config.externals, {
90+
/* config.externals = Object.assign({}, config.externals, {
9191
react: 'React',
9292
'react-dom': 'ReactDOM',
93-
});
93+
}); */
9494
if (isDev) {
9595
config.devtool = 'source-map';
9696
}

site/edit/en-US.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,13 @@ module.exports = {
2323
'app.header.publish-cloud.explain': 'Release Notes',
2424
'app.header.publish-cloud.remarks': 'We don\'t open the domain name binding function. If there is a requirement, we can leave a message on issues.',
2525
'app.header.publish-cloud.remarks2': 'It will take about 2 to 3 minutes for the release and deployment. Please wait patiently.',
26-
'app.header.publish-cloud.pageEdit': 'Page Meta Configuration',
26+
'app.header.publish-cloud.meta': 'Page Meta Configuration',
2727
'app.header.publish-cloud.favicon': 'The icon of the website only supports ico, PNG or jpg. It is recommended to use png.',
28+
'app.header.publish-cloud.build': 'Your website is being publish. Please wait a moment...',
29+
'app.header.publish-cloud.state': 'Current State:',
30+
'app.header.publish-cloud.success': 'Publish Succeeded',
31+
'app.header.publish-cloud.successRemarks': 'Your website has been publish succeeded, URL:',
32+
'app.header.publish-cloud.error': 'Publish Error!!!',
2833
'app.header.edit-data': 'Edit data',
2934
'app.header.edit-data.header': 'Current edit data',
3035
'app.header.edit-data.remarks': 'Paste the downloaded JSON here, please don\'t change the data. Please refresh if the data is wrong.',

site/edit/static/index.html

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -230,11 +230,7 @@
230230
gtag('config', 'UA-83857924-2');
231231
</script>
232232
</body>
233-
{% if isDev %}
234-
<script src="https://as.alipayobjects.com/g/component/??react/16.3.0/react.development.js,react/16.3.0/react-dom.development.js"></script>
235-
{% else %}
236-
<script src="https://as.alipayobjects.com/g/component/??react/16.3.0/react.production.min.js,react/16.3.0/react-dom.production.min.js"></script>
237-
{% endif %}
233+
238234
<!--script src="common.js"></script-->
239235
<script src="edit.js"></script>
240236

site/edit/template/components/NavController.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@ class NavController extends React.PureComponent {
186186
{
187187
name: <FormattedMessage id="app.header.publish-cloud" key="m" />,
188188
icon: publishLoad ? 'loading' : 'cloud-upload',
189-
onClick: publishLoad ? null : this.onUploadCloud,
189+
onClick: this.onUploadCloud,
190190
},
191191
{ name: <FormattedMessage id="app.header.edit-data" key="m" />, icon: 'tool', onClick: this.onChangeDataOpenModal },
192192
{

site/edit/template/components/PublishModal.jsx

Lines changed: 95 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -46,15 +46,24 @@ const remarks = {
4646
class PublishModal extends React.Component {
4747
state = {
4848
isLoad: false,
49+
explain: [
50+
<p key="0"><FormattedMessage id="app.header.publish-cloud.build" /></p>,
51+
<p key="1">
52+
<FormattedMessage id="app.header.publish-cloud.state" />
53+
{' BUILDING'}
54+
</p>,
55+
],
4956
};
5057

5158
componentDidMount() {
5259
// 监听有没有在发布
5360
const { templateData } = this.props;
5461
const currentBuild = JSON.parse(window.localStorage.getItem(buildId));
5562
if (currentBuild && currentBuild[templateData.uid]) {
56-
this.props.changePublishState(true);
57-
this.onMonitorPublishState(currentBuild[templateData.uid]);
63+
this.setState({ isLoad: true }, () => {
64+
this.props.changePublishState(true);
65+
this.onMonitorPublishState(currentBuild[templateData.uid]);
66+
});
5867
}
5968
}
6069

@@ -92,6 +101,7 @@ class PublishModal extends React.Component {
92101
}
93102

94103
onMonitorPublishState = (id) => {
104+
const { explain } = this.state;
95105
ticker.clear(this.getPublishState);
96106
this.getPublishState = ticker.interval(() => {
97107
fetch(`${nowURL}api/deploy/${id}`, {
@@ -100,15 +110,16 @@ class PublishModal extends React.Component {
100110
headers: {
101111
'Content-Type': 'application/json',
102112
},
103-
}).then(res => res.json()).then(({ url, lambdas: [item] }) => {
113+
}).then(res => res.json()).then((res) => {
114+
const { url, lambdas: [item] } = res;
104115
if (item) {
105116
switch (item.readyState) {
106117
case 'READY':
107118
notification.open({
108-
message: '发布成功',
119+
message: <FormattedMessage id="app.header.publish-cloud.success" />,
109120
description: (
110121
<p>
111-
你的网站已发布成功,URL地址:
122+
<FormattedMessage id="app.header.publish-cloud.successRemarks" />
112123
<a href={`https://${url}`} target="_blank">
113124
{url}
114125
</a>
@@ -119,10 +130,18 @@ class PublishModal extends React.Component {
119130
this.publishEnd();
120131
break;
121132
case 'ERROR':
122-
message.error('发布失败。');
133+
message.error(<FormattedMessage id="app.header.publish-cloud.error" />);
123134
this.publishEnd();
124135
break;
125136
default:
137+
explain.push((
138+
<p key={explain.length.toString()}>
139+
<FormattedMessage id="app.header.publish-cloud.state" />
140+
{' '}
141+
{item.readyState}
142+
</p>
143+
));
144+
this.setState({ explain });
126145
break;
127146
}
128147
}
@@ -176,66 +195,83 @@ class PublishModal extends React.Component {
176195
render() {
177196
const { templateData, location, onSave, changePublishState, form, ...props } = this.props;
178197
const { getFieldDecorator } = form;
179-
const { isLoad } = this.state;
198+
const { isLoad, explain } = this.state;
180199
const locale = isZhCN(location.pathname) ? 'zh-CN' : 'en-US';
181200
const page = templateData.data.page || {};
182201
return (
183202
<Modal
184203
{...props}
185204
>
186-
<h3 style={{ marginBottom: 16 }}>
187-
<FormattedMessage id="app.header.publish-cloud.explain" />
188-
</h3>
189-
<p>
190-
<Icon type="profile" />
191-
{' '}
192-
{remarks[locale]}
193-
</p>
194-
<p style={{ margin: '8px 0' }}>
195-
<Icon type="experiment" />
196-
{' '}
197-
<FormattedMessage id="app.header.publish-cloud.remarks" />
198-
</p>
199-
<p>
200-
<Icon type="exclamation-circle" />
201-
{' '}
202-
<FormattedMessage id="app.header.publish-cloud.remarks2" />
203-
</p>
204-
<h3 style={{ marginTop: 16 }}>
205-
<FormattedMessage id="app.header.publish-cloud.pageEdit" />
206-
</h3>
207-
<p />
208-
<Form onSubmit={this.onClick} className="modal-form">
209-
<Item label="Title">
210-
{getFieldDecorator('title', {
211-
initialValue: page.title,
212-
})(<Input />)}
213-
</Item>
214-
<Item label="Description">
215-
{getFieldDecorator('description', {
216-
initialValue: page.description,
217-
})(<TextArea />)}
218-
</Item>
219-
<Item
220-
label={(
221-
<span>
222-
Favicon (ico, png or jpg)
223-
<Tooltip title={<FormattedMessage id="app.header.publish-cloud.favicon" />}>
224-
<Icon type="question-circle" style={{ margin: '0 8px' }} />
225-
</Tooltip>
226-
</span>
227-
)}
205+
{isLoad ? (
206+
<div
207+
style={{
208+
color: '#E6E1DC',
209+
backgroundColor: '#202020',
210+
boxShadow: 'inset 0 0 10px black',
211+
height: 300,
212+
overflowY: 'auto',
213+
padding: 16,
214+
}}
228215
>
229-
{getFieldDecorator('favicon', {
230-
initialValue: page.favicon,
231-
})(<Input />)}
232-
</Item>
233-
<Item style={{ marginTop: 16 }}>
234-
<Button disabled={isLoad} type="primary" icon={isLoad ? 'loading' : 'cloud-upload'} htmlType="submit">
235-
<FormattedMessage id="app.header.publish-cloud.button" />
236-
</Button>
237-
</Item>
238-
</Form>
216+
{explain}
217+
</div>
218+
) : (
219+
<>
220+
<h3 style={{ marginBottom: 16 }}>
221+
<FormattedMessage id="app.header.publish-cloud.explain" />
222+
</h3>
223+
<p>
224+
<Icon type="profile" />
225+
{' '}
226+
{remarks[locale]}
227+
</p>
228+
<p style={{ margin: '8px 0' }}>
229+
<Icon type="experiment" />
230+
{' '}
231+
<FormattedMessage id="app.header.publish-cloud.remarks" />
232+
</p>
233+
<p>
234+
<Icon type="exclamation-circle" />
235+
{' '}
236+
<FormattedMessage id="app.header.publish-cloud.remarks2" />
237+
</p>
238+
<h3 style={{ marginTop: 16 }}>
239+
<FormattedMessage id="app.header.publish-cloud.meta" />
240+
</h3>
241+
<p />
242+
<Form onSubmit={this.onClick} className="modal-form">
243+
<Item label="Title">
244+
{getFieldDecorator('title', {
245+
initialValue: page.title,
246+
})(<Input />)}
247+
</Item>
248+
<Item label="Description">
249+
{getFieldDecorator('description', {
250+
initialValue: page.description,
251+
})(<TextArea />)}
252+
</Item>
253+
<Item
254+
label={(
255+
<span>
256+
Favicon (ico, png or jpg)
257+
<Tooltip title={<FormattedMessage id="app.header.publish-cloud.favicon" />}>
258+
<Icon type="question-circle" style={{ margin: '0 8px' }} />
259+
</Tooltip>
260+
</span>
261+
)}
262+
>
263+
{getFieldDecorator('favicon', {
264+
initialValue: page.favicon,
265+
})(<Input />)}
266+
</Item>
267+
<Item style={{ marginTop: 16 }}>
268+
<Button disabled={isLoad} type="primary" icon={isLoad ? 'loading' : 'cloud-upload'} htmlType="submit">
269+
<FormattedMessage id="app.header.publish-cloud.button" />
270+
</Button>
271+
</Item>
272+
</Form>
273+
</>
274+
)}
239275
</Modal>
240276
);
241277
}

site/edit/zh-CN.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,13 @@ module.exports = {
2323
'app.header.publish-cloud.explain': '发布说明',
2424
'app.header.publish-cloud.remarks': '域名绑定功能我们暂不开放,如果有需求同样可以在 issues 上给我们留言。',
2525
'app.header.publish-cloud.remarks2': '发布布署大约需要 2~3 分钟,请耐心等待。',
26-
'app.header.publish-cloud.pageEdit': '页面 META 参数配置',
26+
'app.header.publish-cloud.meta': '页面 META 参数配置',
2727
'app.header.publish-cloud.favicon': '网站的 icon, 只支持 ico, png 或 jpg, 推荐使用 png.',
28+
'app.header.publish-cloud.build': '你的网站站正在发布,请稍后...',
29+
'app.header.publish-cloud.state': '当前状态:',
30+
'app.header.publish-cloud.success': '发布成功',
31+
'app.header.publish-cloud.successRemarks': '你的网站已发布成功,URL地址:',
32+
'app.header.publish-cloud.error': '发布失败!!!',
2833
'app.header.edit-data': '编辑数据',
2934
'app.header.edit-data.header': '当前编辑数据',
3035
'app.header.edit-data.remarks': '将下载的 JSON 粘贴到此处,请不要随便改更数据。如果数据出错请刷新。',
@@ -117,5 +122,6 @@ module.exports = {
117122
'app.login.title': '此页面已加锁,请输入密码。',
118123
'app.login.noPassword': '不知道密码请删除当前面页或新建',
119124
'app.login.new': '新建页面',
125+
120126
},
121127
};

site/templates/static/index.html

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -171,11 +171,7 @@
171171
gtag('config', 'UA-83857924-2');
172172
</script>
173173
</body>
174-
{% if isDev %}
175-
<script src="https://as.alipayobjects.com/g/component/??react/16.3.0/react.development.js,react/16.3.0/react-dom.development.js"></script>
176-
{% else %}
177-
<script src="https://as.alipayobjects.com/g/component/??react/16.3.0/react.production.min.js,react/16.3.0/react-dom.production.min.js"></script>
178-
{% endif %}
174+
179175
<!--script src="common.js"></script-->
180176
<script src="templates.js"></script>
181177

site/templates/static/lessToString.jsx

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
11
/* eslin import/no-webpack-loader-syntax:[0] */
2-
const point = require('!raw-loader!./point.less');
3-
const common = require('!raw-loader!./common.less');
4-
5-
const custom = require('!raw-loader!./custom.less');
6-
const content = require('!raw-loader!./content.less');
2+
import point from '!raw-loader!./point.less';
3+
import common from '!raw-loader!./common.less';
4+
import custom from '!raw-loader!./custom.less';
5+
import content from '!raw-loader!./content.less';
76

87
export default {
98
common,
Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,9 @@
1-
const index = require('!raw-loader!../../../../index.text');
2-
3-
let point = require('!raw-loader!./Point.jsx');
4-
5-
point = point.replace('../static/point.less', './less/point.less');
6-
7-
const documentation = require('!raw-loader!../../../../documentation.md');
1+
import point from '!raw-loader!./Point.jsx';
2+
import index from '!raw-loader!../../../../index.text';
3+
import documentation from '!raw-loader!../../../../documentation.md';
84

95
export default {
106
index,
117
documentation,
12-
point,
8+
point: point.replace('../static/point.less', './less/point.less'),
139
};

0 commit comments

Comments
 (0)