From f7cb2c1267f5e6007e41d89fc45a92178e22672b Mon Sep 17 00:00:00 2001 From: jljsj Date: Wed, 21 Aug 2019 20:51:05 +0800 Subject: [PATCH] add release notes --- site/edit/en-US.js | 3 +++ site/edit/template/layout.jsx | 27 ++++++++++++++++++++++++--- site/edit/zh-CN.js | 4 +++- 3 files changed, 30 insertions(+), 4 deletions(-) diff --git a/site/edit/en-US.js b/site/edit/en-US.js index 9a5f2ec5..8c88994b 100644 --- a/site/edit/en-US.js +++ b/site/edit/en-US.js @@ -126,5 +126,8 @@ 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.content1': '3.0 It has been officially released. Since we have made some adjustments to some templates, if your previously edited templates can not be displayed, please go to ', + 'app.layout.notification.content2': 'submit your page ID and JSON data.', }, }; diff --git a/site/edit/template/layout.jsx b/site/edit/template/layout.jsx index 75672d15..6a400154 100644 --- a/site/edit/template/layout.jsx +++ b/site/edit/template/layout.jsx @@ -1,5 +1,6 @@ import React from 'react'; -import { Icon, message, Button, Input, Form } from 'antd'; +import PropTypes from 'prop-types'; +import { Icon, message, Button, Input, Form, notification } from 'antd'; import { connect } from 'react-redux'; import { FormattedMessage } from 'react-intl'; @@ -20,15 +21,35 @@ import EditListController from './components/EditListController'; const FormItem = Form.Item; class Layout extends React.PureComponent { + static contextTypes = { + intl: PropTypes.object.isRequired, + }; + state = { loading: false, } - componentWillMount() { - const { dispatch } = this.props; + constructor(props) { + super(props); + const { dispatch } = props; dispatch(actions.getUserData()); } + componentDidMount() { + notification.open({ + placement: 'bottomRight', + duration: null, + message: this.context.intl.formatMessage({ id: 'app.layout.notification.title' }), + description: ( +
+ {this.context.intl.formatMessage({ id: 'app.layout.notification.content1' })} + GitHub issues + {this.context.intl.formatMessage({ id: 'app.layout.notification.content2' })} +
+ ), + }); + } + componentDidUpdate() { if (!this.validateForm && this.props.templateData.data) { this.props.form.validateFields(); diff --git a/site/edit/zh-CN.js b/site/edit/zh-CN.js index 37e38685..e8c75c3e 100644 --- a/site/edit/zh-CN.js +++ b/site/edit/zh-CN.js @@ -127,6 +127,8 @@ module.exports = { 'app.login.title': '此页面已加锁,请输入密码。', 'app.login.noPassword': '不知道密码请删除当前面页或新建', 'app.login.new': '新建页面', - + 'app.layout.notification.title': '3.0 发布说明', + 'app.layout.notification.content1': '3.0 已正式发布,由于我们对有些模板做了调整,如果你以前编辑的模板不能显示,请到 ', + 'app.layout.notification.content2': '提交你的页面 id 与 JSON 数据。', }, };