Skip to content

Commit

Permalink
Merge pull request apache#4 from lxzhangchao/ch_react_page
Browse files Browse the repository at this point in the history
Ch react page
  • Loading branch information
lxzhangchao authored Jul 11, 2017
2 parents c173f1a + 6935759 commit 26436d2
Show file tree
Hide file tree
Showing 6 changed files with 30 additions and 2,845 deletions.
38 changes: 18 additions & 20 deletions superset/assets/javascripts/explore/components/SaveModal.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@ import { Modal, Alert, Button, Radio } from 'react-bootstrap';
import Select from 'react-select';
import { connect } from 'react-redux';
import intl from 'react-intl-universal';
import zh_CN from "../stores/zh_CN.js";
import en_US from "../stores/en_US.js";
import { getLanguage } from '../stores/language.js';
import { getLanguage } from '../stores/language';
import enUS from '../stores/en_US';
import zhCN from '../stores/zh_CN';

const locales = {
"en_US": en_US,
"zh_CN": zh_CN
"en_US": enUS,
"zh_CN": zhCN,
};

const propTypes = {
Expand All @@ -27,10 +27,7 @@ const propTypes = {
datasource: PropTypes.object,
};



class SaveModal extends React.Component {

constructor(props) {
super(props);
this.state = {
Expand All @@ -48,16 +45,6 @@ class SaveModal extends React.Component {
this.props.actions.fetchDashboards(this.props.user_id);
}

loadLocales() {
intl.init({
currentLocale: getLanguage(),
locales,
})
.then(() => {
this.setState({initDone: true});
});
}

onChange(name, event) {
switch (name) {
case 'newSliceName':
Expand All @@ -74,6 +61,17 @@ class SaveModal extends React.Component {
break;
}
}

loadLocales() {
intl.init({
currentLocale: getLanguage(),
locales,
})
.then(() => {
this.setState({initDone: true});
});
}

changeAction(action) {
this.setState({ action });
}
Expand Down Expand Up @@ -184,8 +182,7 @@ class SaveModal extends React.Component {
inline
checked={this.state.action === 'saveas'}
onChange={this.changeAction.bind(this, 'saveas')}
>
{intl.formatMessage({id:'save_as', defaultMessage: `Save as`})}  
> {intl.formatMessage({id:'save_as', defaultMessage: `Save as`})}  
</Radio>
<input
name="new_slice_name"
Expand All @@ -194,6 +191,7 @@ class SaveModal extends React.Component {
onFocus={this.changeAction.bind(this, 'saveas')}
/>


<br />
<hr />

Expand Down
Loading

0 comments on commit 26436d2

Please sign in to comment.