feature(ui) - fixes
This commit is contained in:
parent
3d8dcefd29
commit
bedcf9dd08
3 changed files with 11 additions and 9 deletions
|
|
@ -1,7 +1,7 @@
|
|||
import { connect } from 'react-redux';
|
||||
import { Input, Button, Label } from 'UI';
|
||||
import { save, edit, update , fetchList } from 'Duck/site';
|
||||
import { pushNewSite } from 'Duck/user';
|
||||
import { pushNewSite, setSiteId } from 'Duck/user';
|
||||
import styles from './siteForm.css';
|
||||
|
||||
@connect(state => ({
|
||||
|
|
@ -14,7 +14,8 @@ import styles from './siteForm.css';
|
|||
edit,
|
||||
update,
|
||||
pushNewSite,
|
||||
fetchList
|
||||
fetchList,
|
||||
setSiteId
|
||||
})
|
||||
export default class NewSiteForm extends React.PureComponent {
|
||||
state = {
|
||||
|
|
@ -34,8 +35,12 @@ export default class NewSiteForm extends React.PureComponent {
|
|||
})
|
||||
} else {
|
||||
this.props.save(this.props.site).then(() => {
|
||||
const { sites } = this.props;
|
||||
this.props.onClose(null, sites.last())
|
||||
const { sites } = this.props;
|
||||
const site = sites.last();
|
||||
|
||||
this.props.pushNewSite(site)
|
||||
this.props.setSiteId(site.id)
|
||||
this.props.onClose(null, site)
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -23,11 +23,7 @@ export default class SiteDropdown extends React.PureComponent {
|
|||
state = { showProductModal: false }
|
||||
|
||||
closeModal = (e, newSite) => {
|
||||
this.setState({ showProductModal: false })
|
||||
if (newSite) {
|
||||
this.props.pushNewSite(newSite)
|
||||
this.props.setSiteId(newSite.id)
|
||||
}
|
||||
this.setState({ showProductModal: false })
|
||||
};
|
||||
|
||||
newSite = () => {
|
||||
|
|
|
|||
|
|
@ -15,6 +15,7 @@
|
|||
"baseUrl": ".",
|
||||
"paths": { // TODO: one-source truth
|
||||
"App": ["./app"],
|
||||
"App/*": ["./app/*"],
|
||||
"Types": ["./app/types" ],
|
||||
"Types/*": ["./app/types/*"], // Sublime hack
|
||||
"UI": ["./app/components/ui"],
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue