Skip to content

Development #70

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
May 6, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
60 changes: 60 additions & 0 deletions src/components/xxxSnackbars.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
// import React from 'react';
// import PropTypes from 'prop-types';
// import Button from '@material-ui/core/Button';
// import Snackbar from '@material-ui/core/Snackbar';
// import SnackbarContentWrapper from './SnackbarContentWrapper.jsx';

// const Snackbars = (props) => {
// const {
// successOpen, errorOpen, handleNotificationClose, msg, viewAppDir,
// } = props;
// const successMsg = <div>Your files were successfully created. <Button
// variant='fab'
// mini
// aria-label='View app directory'
// onClick={viewAppDir}
// >View</Button></div>;
// const errMsg = `There was an error while creating your files. ${msg}`;
// return (
// <div>
// <Snackbar
// anchorOrigin={{
// vertical: 'bottom',
// horizontal: 'left',
// }}
// open={successOpen}
// autoHideDuration={5000}
// >
// <SnackbarContentWrapper
// onClose={handleNotificationClose}
// variant="success"
// message={successMsg}
// />
// </Snackbar>
// <Snackbar
// anchorOrigin={{
// vertical: 'bottom',
// horizontal: 'left',
// }}
// open={errorOpen}
// autoHideDuration={5000}
// >
// <SnackbarContentWrapper
// onClose={handleNotificationClose}
// variant="error"
// message={errMsg}
// />
// </Snackbar>
// </div>
// );
// };

// Snackbars.propTypes = {
// successOpen: PropTypes.bool.isRequired,
// errorOpen: PropTypes.bool.isRequired,
// msg: PropTypes.string.isRequired,
// viewAppDir: PropTypes.func.isRequired,
// handleNotificationClose: PropTypes.func.isRequired,
// };

// export default Snackbars;
14 changes: 7 additions & 7 deletions src/containers/AppContainer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import LinearProgress from '@material-ui/core/LinearProgress';
import LeftContainer from './LeftContainer.jsx';
import MainContainer from './MainContainer.jsx';
// import RightContainer from './RightContainer.jsx';
import convertIdsToObjs from '../utils/convertIdsToObjs.util';
// import convertIdsToObjs from '../utils/convertIdsToObjs.util';
import theme from '../components/theme.ts';
import { loadInitData } from '../actions/components';

Expand Down Expand Up @@ -46,28 +46,28 @@ class AppContainer extends Component {

render() {
const {
components, totalComponents, focusComponent, loading, selectableChildren,
components, focusComponent, loading, selectableChildren,
} = this.props;
const { width, rightColumnOpen } = this.state;

// uses component childIds and parentIds arrays (numbers) to build component-filled children and parents arrays
const updatedComponents = convertIdsToObjs(components);
//const updatedComponents = convertIdsToObjs(components);

return (
<MuiThemeProvider theme={theme}>
<div className="app-container">
<LeftContainer
components={updatedComponents}
totalComponents={totalComponents}
components={components}
// totalComponents={totalComponents}
focusComponent={focusComponent}
selectableChildren={selectableChildren}
/>
<MainContainer
components={updatedComponents}
components={components}
collapseColumn={this.collapseColumn}
width={width}
rightColumnOpen={rightColumnOpen}
totalComponents={totalComponents}
// totalComponents={totalComponents}
/>
{/* <RightContainer
width={width}
Expand Down
2 changes: 0 additions & 2 deletions src/containers/LeftContainer.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -60,10 +60,8 @@ class LeftContainer extends Component {
render() {
const {
components,
updateComponent,
deleteComponent,
focusComponent,
totalComponents,
classes,
addChild,
changeFocusComponent,
Expand Down
2 changes: 1 addition & 1 deletion src/containers/MainContainer.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ const mapDispatchToProps = dispatch => ({
});

const mapStateToProps = store => ({
totalComponents: store.workspace.totalComponents,
// totalComponents: store.workspace.totalComponents,
focusComponent: store.workspace.focusComponent,
focusChild: store.workspace.focusChild,
stateComponents: store.workspace.components,
Expand Down
8 changes: 4 additions & 4 deletions src/reducers/componentReducer.js
Original file line number Diff line number Diff line change
Expand Up @@ -169,10 +169,10 @@ const componentReducer = (state = initialApplicationState, action) => {
case HANDLE_TRANSFORM:
return handleTransform(state, action.payload);

case MOVE_TO_BOTTOM:
return moveToBottom(state, action.payload);
case MOVE_TO_TOP:
return moveToTop(state, action.payload);
// case MOVE_TO_BOTTOM:
// return moveToBottom(state, action.payload);
// case MOVE_TO_TOP:
// return moveToTop(state, action.payload);
case OPEN_EXPANSION_PANEL:
return openExpansionPanel(state, action.payload);
case DELETE_ALL_DATA:
Expand Down
6 changes: 3 additions & 3 deletions src/utils/findComponentById.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,9 @@ interface Component {
parentIds: number[];
color: string;
draggable: boolean;
childrenIds: number[];
selectableParents?: any[]; // unused
expanded?: boolean; // unused
// childrenIds: number[];
// selectableParents?: any[]; // unused
// expanded?: boolean; // unused
props: Prop[];
nextPropId: number;
position: Position;
Expand Down