Skip to content

Commit

Permalink
update history and editor-list, #156
Browse files Browse the repository at this point in the history
  • Loading branch information
jljsj33 committed Nov 20, 2019
1 parent 074c1a4 commit 259a074
Show file tree
Hide file tree
Showing 7 changed files with 23 additions and 21 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "landing",
"version": "3.0.0",
"version": "3.0.1",
"title": "Landing Pages",
"description": "site of Landing Pages",
"homepage": "http://landing.ant.design/",
Expand Down
4 changes: 2 additions & 2 deletions site/edit/en-US.js
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ module.exports = {
'app.login.title': 'This page is locked. Please enter your password.',
'app.login.noPassword': 'If you don\'t know the password, please delete current page or create a new page',
'app.login.new': 'New Page',
'app.layout.notification.title': '3.0 Release Notes',
'app.layout.notification.content': '3.0 has been officially released. As we have made some adjustments to some templates, if your previously edited templates can not be displayed, please re-edit the new page.',
'app.layout.notification.title': 'Editor update description',
'app.layout.notification.content': 'In order to improve the performance and experience of editing, the style editing is currently triggered by pressing enter or leaving the input box.',
},
};
3 changes: 2 additions & 1 deletion site/edit/template/components/ListComponents/EditorComp.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ let funcData = {};
const { ClassName, State, Layout, Font, BackGround, Border, Interface, Margin, Shadow, Transition } = EditorList;
class EditorComp extends React.Component {
onChange = (cb) => {
const { cssName, currentEditCssString } = cb;
const { cssName, currentEditCssString, isDrag } = cb;
const { currentEditData, dispatch, templateData } = this.props;
const { id } = currentEditData;
const ids = id.split('-');
Expand All @@ -43,6 +43,7 @@ class EditorComp extends React.Component {
};
newTemplateData.data.style = (newTemplateData.data.style || []).filter(c => c.id !== cb.id);
newTemplateData.data.style.push(data);
newTemplateData.noHistory = isDrag;
dispatch(actions.setTemplateData(newTemplateData));
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,6 @@ class HistoryButton extends React.Component {
const redoClassName = classnames('redo', {
disabled: !currentHistory,
});
console.log(this.props);
return (
<ul className="history-button-wrapper">
<li className={undoClassName}>
Expand Down
26 changes: 15 additions & 11 deletions site/edit/template/layout.jsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React from 'react';
import { Icon, message, Button, Input, Form } from 'antd';
import { Icon, message, Button, Input, Form, notification } from 'antd';
import { connect } from 'react-redux';
import { FormattedMessage, injectIntl } from 'react-intl';

Expand Down Expand Up @@ -31,16 +31,20 @@ class Layout extends React.PureComponent {
}

componentDidMount() {
/* notification.open({
placement: 'bottomRight',
duration: null,
message: this.props.intl.formatMessage({ id: 'app.layout.notification.title' }),
description: (
<div>
{this.props.intl.formatMessage({ id: 'app.layout.notification.content' })}
</div>
),
}); */
const date = new Date();
const endDate = new Date('2019/11/29 23:59:59');
if (endDate.getTime() - date.getTime() > 0) {
notification.open({
placement: 'bottomRight',
duration: 10000,
message: this.props.intl.formatMessage({ id: 'app.layout.notification.title' }),
description: (
<div>
{this.props.intl.formatMessage({ id: 'app.layout.notification.content' })}
</div>
),
});
}
}

componentDidUpdate() {
Expand Down
4 changes: 2 additions & 2 deletions site/edit/zh-CN.js
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ module.exports = {
'app.login.title': '此页面已加锁,请输入密码。',
'app.login.noPassword': '不知道密码请删除当前面页或新建',
'app.login.new': '新建页面',
'app.layout.notification.title': '3.0 发布说明',
'app.layout.notification.content': '3.0 已正式发布,由于我们对有些模板做了调整,如果你以前编辑的模板不能显示,请新建页面重新编辑。',
'app.layout.notification.title': '编辑器功能更新说明',
'app.layout.notification.content': '为提高编辑时的性能与体验,目前将样式编辑调整为按回车或离开输入框才触发。',
},
};
4 changes: 1 addition & 3 deletions site/shared/redux/saga.js
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,6 @@ function* handleSetTemplateData(action) {
const { data: { uid: id, data: attributes, noHistory } } = action;
const data = { id, attributes, noHistory };
saveTemplateToLocalStorage(DEFAULT_USER_NAME, data);
console.log(noHistory);
yield put({
type: UPDATE_HISTORY,
data,
Expand Down Expand Up @@ -182,8 +181,7 @@ function* handleSetUserAndTemplateData(action) {
});
}

function* handleUpdateHistory(action, state) {
console.log(action, state);
function* handleUpdateHistory(action) {
const { data: template } = action;
const { noHistory } = template;
if (!noHistory) {
Expand Down

0 comments on commit 259a074

Please sign in to comment.