Skip to content

MVP #67

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 65 commits into from
May 6, 2019
Merged

MVP #67

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
65 commits
Select commit Hold shift + click to select a range
d39635c
minor changes to the main container
spincycle01 May 2, 2019
fb017ac
Merge branch 'development' of https://github.com/team-reactype/ReacType
spincycle01 May 2, 2019
a35ae60
changed theme.js to theme.ts with interfaces
ChristianEdwardPadilla May 2, 2019
2daedb2
converted App to App.tsx and theme to theme.ts.
spincycle01 May 2, 2019
b0ea694
changed AppContainer from jsx to tsx, working on App.tsx. Applicatio…
spincycle01 May 2, 2019
00d7d2b
currently converted 3 files to TypeScript. Need to test on a differen…
spincycle01 May 3, 2019
59ce481
style changes
ChristianEdwardPadilla May 3, 2019
c12aa66
tolga breaking changes
ChristianEdwardPadilla May 3, 2019
c6fe306
rolled back main container, removed applicdation actions, and added b…
spincycle01 May 3, 2019
48143e6
Merge pull request #53 from spincycle01/master
spincycle01 May 3, 2019
aacd66c
nothing
ChristianEdwardPadilla May 3, 2019
2c7595f
merge conflicts resolved
ChristianEdwardPadilla May 3, 2019
8b4f168
Merge pull request #54 from ChristianEdwardPadilla/development
ChristianEdwardPadilla May 3, 2019
d419c48
breaking changes, commented out filter
spincycle01 May 3, 2019
5521ded
Merge branch 'development' of https://github.com/team-reactype/ReacType
spincycle01 May 3, 2019
ab5cfd2
fixed annoying export bug with multiple props
ChristianEdwardPadilla May 3, 2019
ddaa117
resolved export bug - now exporting multiple props at a time. Changed…
spincycle01 May 3, 2019
8a6faba
props are passed to constructor naively
ChristianEdwardPadilla May 3, 2019
749816c
Merge pull request #55 from spincycle01/master
ChristianEdwardPadilla May 3, 2019
5374439
extra exporting features, type switcher function
ChristianEdwardPadilla May 3, 2019
08b9c94
can pass user props
ChristianEdwardPadilla May 3, 2019
cbfa04c
Merge pull request #56 from ChristianEdwardPadilla/development
spincycle01 May 3, 2019
99f64d3
more thurough testing complete, fixed prop passing by ignoring html e…
ChristianEdwardPadilla May 4, 2019
1d24d3d
small stage change
ChristianEdwardPadilla May 4, 2019
b7293e0
Merge pull request #57 from ChristianEdwardPadilla/development
ChristianEdwardPadilla May 4, 2019
ffb11f3
html comp updates and styling improvements
tolgamizrakci May 4, 2019
509f9d9
html comp updates and styling improvements
tolgamizrakci May 4, 2019
683ec15
Merge pull request #58 from tolgamizrakci/development
tolgamizrakci May 4, 2019
c2d382d
testing git
tolgamizrakci May 4, 2019
5e772f2
currently commenting out application export features and removed dele…
spincycle01 May 4, 2019
7d96cfd
mainContainer cleanup
ChristianEdwardPadilla May 4, 2019
3a57f0e
merge with tolgas styling
ChristianEdwardPadilla May 4, 2019
e5dc62e
props destructured from props argument
ChristianEdwardPadilla May 4, 2019
4221b3a
formatting
ChristianEdwardPadilla May 4, 2019
9f73af3
Merge pull request #59 from ChristianEdwardPadilla/development
ChristianEdwardPadilla May 4, 2019
8401237
Node fs now set up to export components with or without baseline conf…
spincycle01 May 4, 2019
062ec2d
Export functionality works after the merge. Handled conflicts
spincycle01 May 4, 2019
d5c9597
formatting changes to render
ChristianEdwardPadilla May 4, 2019
2dafabc
Merge branch 'development' of https://github.com/team-reactype/ReacTy…
ChristianEdwardPadilla May 4, 2019
bc92e8d
Merge pull request #60 from spincycle01/master
ChristianEdwardPadilla May 4, 2019
50076fc
Merge branch 'development' of https://github.com/team-reactype/ReacTy…
ChristianEdwardPadilla May 4, 2019
db49d8c
app tree working
tolgamizrakci May 5, 2019
17bb341
merging tree changes
tolgamizrakci May 5, 2019
f0375c2
Merge pull request #61 from tolgamizrakci/development
tolgamizrakci May 5, 2019
9c1f4e6
new color scheme
ChristianEdwardPadilla May 5, 2019
5e24deb
Merge branch 'development' of https://github.com/team-reactype/ReacTy…
ChristianEdwardPadilla May 5, 2019
89c77b1
general cleanup
ChristianEdwardPadilla May 5, 2019
c15a2f1
Merge pull request #62 from ChristianEdwardPadilla/development
ChristianEdwardPadilla May 5, 2019
7d8a648
replaced JSON clone method with custom TS cloneDeep
ChristianEdwardPadilla May 5, 2019
934dcf3
cleanup
ChristianEdwardPadilla May 5, 2019
dc3d2d3
Tree styling
ChristianEdwardPadilla May 5, 2019
0612220
Merge pull request #63 from ChristianEdwardPadilla/development
ChristianEdwardPadilla May 5, 2019
6850537
small Tree changes
ChristianEdwardPadilla May 5, 2019
1dc209b
styling changes to props, export is broken
ChristianEdwardPadilla May 5, 2019
aa2f4c9
fixed export modal, also added pointer cursor for export modal exit
ChristianEdwardPadilla May 5, 2019
bd63fae
bad color removed
ChristianEdwardPadilla May 5, 2019
914366b
Merge pull request #64 from ChristianEdwardPadilla/development
ChristianEdwardPadilla May 5, 2019
29ff4ec
changed export modal close button to iconButton from icon, slightly d…
ChristianEdwardPadilla May 5, 2019
a77fb51
color of add html buttons changed to white
ChristianEdwardPadilla May 5, 2019
6e21d23
Merge pull request #65 from ChristianEdwardPadilla/development
ChristianEdwardPadilla May 5, 2019
27b00f7
component and children ids are all numbers now
ChristianEdwardPadilla May 5, 2019
a4decf2
added interfaces of major state objects to findComponentById and remo…
ChristianEdwardPadilla May 6, 2019
c43bdc8
small reducer changes
ChristianEdwardPadilla May 6, 2019
c532596
reducer cleanup, working version
ChristianEdwardPadilla May 6, 2019
5e9b75e
Merge pull request #66 from ChristianEdwardPadilla/development
ChristianEdwardPadilla May 6, 2019
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
1 change: 1 addition & 0 deletions main.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ function exportComponents() {
ipcMain.on('choose_app_dir', (event) => {
const directory = dialog.showOpenDialog(mainWindow, {
properties: ['openDirectory'],
buttonLabel: 'Export',
});

if (!directory) return;
Expand Down
5 changes: 4 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -75,15 +75,17 @@
]
},
"dependencies": {
"@material-ui/core": "^1.4.1",
"@material-ui/core": "^3.9.3",
"@material-ui/icons": "^2.0.0",
"@types/react": "^16.8.14",
"@types/react-dom": "^16.8.4",
"@types/react-redux": "^7.0.8",
"autoprefixer": "^9.0.1",
"babel-polyfill": "^6.26.0",
"classnames": "^2.2.6",
"cli-spinner": "^0.2.8",
"commander": "^2.17.1",
"d3": "^5.9.2",
"electron": "^2.0.7",
"electron-reload": "^1.4.0",
"enzyme": "^3.4.1",
Expand All @@ -93,6 +95,7 @@
"prettier": "^1.14.2",
"prop-types": "^15.6.2",
"react": "^16.4.1",
"react-d3-tree": "^1.12.3",
"react-dom": "^16.4.1",
"react-draggable": "^3.0.5",
"react-konva": "^1.7.12",
Expand Down
1 change: 1 addition & 0 deletions src/actionTypes/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,3 +25,4 @@ export const DELETE_PROP = 'DELETE_PROP';
export const ADD_PROP = 'ADD_PROP';
export const DELETE_ALL_DATA = 'DELETE_ALL_DATA';
export const CHANGE_IMAGE_PATH = 'CHANGE_IMAGE_PATH';
export const UPDATE_HTML_ATTR = 'UPDATE_HTML_ATTR';
50 changes: 37 additions & 13 deletions src/actions/components.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ import {
ADD_PROP,
DELETE_ALL_DATA,
CHANGE_IMAGE_PATH,
UPDATE_HTML_ATTR,
} from '../actionTypes/index';

import { loadState } from '../localStorage';
Expand Down Expand Up @@ -74,12 +75,9 @@ export const deleteChild = ({}) => (dispatch) => {
};

export const deleteComponent = ({ componentId, stateComponents }) => (dispatch) => {
console.log('Hello from component.js delete component.componentId= ', componentId);

// find all places where the "to be delted" is a child and do what u gotta do
stateComponents.forEach((parent) => {
parent.childrenArray.filter(child => child.childComponentId == componentId).forEach((child) => {
// console.log(`Should delete ${child.childId} from component id:${parent.id} ${parent.title}`)
parent.childrenArray.filter(child => child.childComponentId === componentId).forEach((child) => {
dispatch({
type: DELETE_CHILD,
payload: {
Expand Down Expand Up @@ -133,8 +131,8 @@ export const changeFocusComponent = ({ title }) => (dispatch) => {
};

// make sure childId is being sent in
export const changeFocusChild = ({ title, childId }) => (dispatch) => {
dispatch({ type: CHANGE_FOCUS_CHILD, payload: { title, childId } });
export const changeFocusChild = ({ childId }) => (dispatch) => {
dispatch({ type: CHANGE_FOCUS_CHILD, payload: { childId } });
};

export const changeComponentFocusChild = ({ componentId, childId }) => (dispatch) => {
Expand All @@ -144,12 +142,15 @@ export const changeComponentFocusChild = ({ componentId, childId }) => (dispatch
});
};

export const exportFiles = ({ components, path }) => (dispatch) => {
export const exportFiles = ({
components, path, appName, exportAppBool,
}) => (dispatch) => {
// this dispatch sets the global state property 'loading' to true until the createFiles call resolves below
dispatch({
type: EXPORT_FILES,
});

createFiles(components, path)
createFiles(components, path, appName, exportAppBool)
.then(dir => dispatch({
type: EXPORT_FILES_SUCCESS,
payload: { status: true, dir: dir[0] },
Expand Down Expand Up @@ -183,26 +184,42 @@ export const createApplication = ({
path,
components = [],
genOption,
appName = 'proto_app',
repoUrl,
appName = 'reactype_app',
exportAppBool,
}) => (dispatch) => {
if (genOption === 0) {
dispatch(exportFiles({ path, components }));
exportAppBool = false;
dispatch(
exportFiles({
appName,
path,
components,
exportAppBool,
}),
);
} else if (genOption) {
exportAppBool = true;
dispatch({
type: CREATE_APPLICATION,
});
createApplicationUtil({
path,
appName,
genOption,
repoUrl,
exportAppBool,
})
.then(() => {
dispatch({
type: CREATE_APPLICATION_SUCCESS,
});
dispatch(exportFiles({ path: `${path}/${appName}`, components }));
dispatch(
exportFiles({
appName,
path,
components,
exportAppBool,
}),
);
})
.catch(err => dispatch({
type: CREATE_APPLICATION_ERROR,
Expand All @@ -228,3 +245,10 @@ export const addProp = prop => ({
type: ADD_PROP,
payload: { ...prop },
});

export const updateHtmlAttr = ({ attr, value }) => (dispatch) => {
dispatch({
type: UPDATE_HTML_ATTR,
payload: { attr, value },
});
};
4 changes: 2 additions & 2 deletions src/components/App.jsx → src/components/App.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import React, { Component } from 'react';
import '../public/styles/style.css';
import { MuiThemeProvider } from '@material-ui/core/styles';
import theme from './theme';
import AppContainer from '../containers/AppContainer.jsx';
import theme from './theme.ts';
import AppContainer from '../containers/AppContainer.tsx';

class App extends Component {
render() {
Expand Down
29 changes: 13 additions & 16 deletions src/components/BottomPanel.jsx
Original file line number Diff line number Diff line change
@@ -1,26 +1,23 @@
import React, { Component } from "react";
import { connect } from "react-redux";
import {
handleClose,
deleteCompProp,
addCompProp
} from "../actions/components";
import RightTabs from "./RightTabs.jsx";
import { some } from "bluebird-lst";
import React, { Component } from 'react';
import { connect } from 'react-redux';
import { some } from 'bluebird-lst';
import { handleClose, deleteCompProp, addCompProp } from '../actions/components';
import RightTabs from './RightTabs.jsx';

const IPC = require("electron").ipcRenderer;
const IPC = require('electron').ipcRenderer;

const mapDispatchToProps = dispatch => ({
handleNotificationClose: () => dispatch(handleClose()),
deleteProp: ({ id, index }) => dispatch(deleteCompProp({ id, index })),
addProp: prop => dispatch(addCompProp(prop))
addProp: prop => dispatch(addCompProp(prop)),
});

const mapStateToProps = store => ({
// successOpen: store.workspace.successOpen,
// errorOpen: store.workspace.errorOpen,
// appDir: store.workspace.appDir,
focusChild: store.workspace.focusChild
focusChild: store.workspace.focusChild,
components: store.workspace.components,
});

class BottomPanel extends Component {
Expand All @@ -30,7 +27,7 @@ class BottomPanel extends Component {
// };

viewAppDir = () => {
IPC.send("view_app_dir", this.props.appDir);
IPC.send('view_app_dir', this.props.appDir);
};

render() {
Expand All @@ -43,12 +40,12 @@ class BottomPanel extends Component {
focusComponent,
deleteProp,
addProp,
focusChild
focusChild,
// rightColumnOpen
} = this.props;

return (
<div className="bottom-panel" style={{ width: "100%" }}>
<div className="bottom-panel" style={{ width: '100%' }}>
<RightTabs
components={components}
focusComponent={focusComponent}
Expand All @@ -71,5 +68,5 @@ class BottomPanel extends Component {

export default connect(
mapStateToProps,
mapDispatchToProps
mapDispatchToProps,
)(BottomPanel);
50 changes: 24 additions & 26 deletions src/components/DataTable.jsx
Original file line number Diff line number Diff line change
@@ -1,25 +1,25 @@
import React from "react";
import React from 'react';
// import PropTypes from 'prop-types';
import { withStyles } from "@material-ui/core/styles";
import Table from "@material-ui/core/Table";
import TableBody from "@material-ui/core/TableBody";
import TableCell from "@material-ui/core/TableCell";
import TableHead from "@material-ui/core/TableHead";
import TableRow from "@material-ui/core/TableRow";
import Paper from "@material-ui/core/Paper";
import Button from "@material-ui/core/Button";
import DeleteIcon from "@material-ui/icons/Delete";
import { IconButton } from "@material-ui/core";
import { withStyles } from '@material-ui/core/styles';
import Table from '@material-ui/core/Table';
import TableBody from '@material-ui/core/TableBody';
import TableCell from '@material-ui/core/TableCell';
import TableHead from '@material-ui/core/TableHead';
import TableRow from '@material-ui/core/TableRow';
import Paper from '@material-ui/core/Paper';
import Button from '@material-ui/core/Button';
import DeleteIcon from '@material-ui/icons/Delete';
import { IconButton } from '@material-ui/core';

const styles = theme => ({
root: {
width: "80%",
width: '80%',
marginTop: theme.spacing.unit * 3,
overflowX: "auto"
// overflowX: "auto"
},
table: {
minWidth: 500
}
minWidth: 500,
},
});

/** **************************
Expand All @@ -28,7 +28,9 @@ const styles = theme => ({
* ****************************** */

function dataTable(props) {
const { classes, rowData, rowHeader, deletePropHandler } = props;
const {
classes, rowData, rowHeader, deletePropHandler,
} = props;

const renderHeader = rowHeader.map((col, idx) => (
<TableCell key={`head_+${idx}`}>{col}</TableCell>
Expand All @@ -38,23 +40,19 @@ function dataTable(props) {
if (!row) return;
// for some reason we must put each value in a div.
return rowHeader.map((header, idx) => (
<TableCell align={"center"} key={`td_${idx}`}>
<TableCell align={'center'} key={`td_${idx}`}>
{/* <div align={'center'} padding = {'none'} >{typeof row[header] === 'string' ? row[header] : row[header].toString()}</div> */}
{/* {row[header]} */}
{typeof row[header] === "string" ? row[header] : row[header].toString()}
{typeof row[header] === 'string' ? row[header] : row[header].toString()}
</TableCell>
));
}
//style={{height: 30}}
// style={{height: 30}}
const renderRows = rowData.map(row => (
<TableRow key={`row-${row.id}`}>
{renderRowCells(row)}
<TableCell align={"center"} padding={"none"}>
<IconButton
color="default"
fontSize="small"
onClick={() => deletePropHandler(row.id)}
>
<TableCell align={'center'} padding={'none'}>
<IconButton color="default" fontSize="small" onClick={() => deletePropHandler(row.id)}>
<DeleteIcon />
</IconButton>
{/* <Button style={{height: 20}} onClick={() => deletePropHandler(row.id)}>Delete</Button> */}
Expand All @@ -64,7 +62,7 @@ function dataTable(props) {

return (
<Paper className={classes.root}>
<Table className={classes.table} selectable={"true"}>
<Table className={classes.table} selectable={'true'}>
<TableHead>
<TableRow>{renderHeader}</TableRow>
</TableHead>
Expand Down
Loading