Skip to content
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

Crud feature #7

Open
wants to merge 35 commits into
base: graph-editor
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
4d3a5b0
Get all class for add node selector
Jul 18, 2018
90f833a
AddNode button -select date time to DB
Jul 18, 2018
ff2443b
Send nodeID from DB
meen41813 Jul 18, 2018
aeeb76e
Fix addnode button duplicate node bugs
Jul 19, 2018
37cb766
Fix data of edge duplicate
meen41813 Jul 19, 2018
664ad4d
Incoming function
Jul 19, 2018
6113c83
Outgoing function
Jul 20, 2018
d7f51c9
Create prevNodeID and fix add node duplicate
meen41813 Jul 20, 2018
c0665a2
editnode-button
Jul 20, 2018
3771069
Test group node and fix code structure
meen41813 Jul 23, 2018
db03a4d
Add comment to other understand
meen41813 Jul 23, 2018
df9ba63
Delete unused file
meen41813 Jul 24, 2018
02e8190
Add color in Node
meen41813 Jul 24, 2018
9be74f8
Fix add node button bug
meen41813 Jul 24, 2018
5a4b300
Add change color and size node
meen41813 Jul 24, 2018
d7490ad
Prettify
meen41813 Jul 24, 2018
4942297
Combined code Trying to update but failed still need more works
Jul 24, 2018
7035fc4
Fix edit node
meen41813 Jul 25, 2018
54102f9
Fix bug edit node
meen41813 Jul 25, 2018
328a180
Add edit node console
meen41813 Jul 25, 2018
efbf826
Fix incoming outgoing bug
meen41813 Jul 25, 2018
7b94554
editRelation
Jul 25, 2018
fbfa819
Prettify
meen41813 Jul 26, 2018
84fdf45
Fix EditEdge render bugs
Jul 26, 2018
f0e0b9e
Fix EditEdge render bugs
Jul 26, 2018
b8eba39
Merge edit node edge and Mean'scode
Jul 26, 2018
c94c71a
Add create edit delete node console
meen41813 Jul 26, 2018
9b41baa
Create update delete node console
meen41813 Jul 31, 2018
20133de
Merge console and command button codes
Jul 31, 2018
4e7a7a3
Fix editEdge bug hide unfuctional function
Jul 31, 2018
ef94d68
Delete comment, prettify, fix eslint
Jul 31, 2018
7e8846e
Fix app.test path
Jul 31, 2018
1796f63
Fix App cannot find store in App.test.js
Jul 31, 2018
8ad1015
Fix bind of undefined in canvas
Jul 31, 2018
cf49f5a
Temp comment app.test.js
Jul 31, 2018
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
Binary file added graph-editor/nogdbReadMe.pages
Binary file not shown.
23 changes: 23 additions & 0 deletions graph-editor/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 5 additions & 4 deletions graph-editor/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
"jquery": "^3.3.1",
"react": "^16.4.1",
"react-d3-graph": "^1.2.2",
"react-datetime": "^2.14.0",
"react-dom": "^16.4.1",
"react-graph-vis": "^1.0.2",
"react-modal": "^3.4.5",
Expand All @@ -31,19 +32,19 @@
},
"proxy": {
"/SQL": {
"target": "http://192.168.182.212:8090",
"target": "http://127.0.0.1:8090",
"secure": false
},
"/Vertex": {
"target": "http://192.168.182.212:8090",
"target": "http://127.0.0.1:8090",
"secure": false
},
"/Edge": {
"target": "http://192.168.182.212:8090",
"target": "http://127.0.0.1:8090",
"secure": false
},
"/Db": {
"target": "http://192.168.182.212:8090",
"target": "http://127.0.0.1:8090",
"secure": false
}
}
Expand Down
28 changes: 0 additions & 28 deletions graph-editor/src/App.css

This file was deleted.

21 changes: 0 additions & 21 deletions graph-editor/src/App.js

This file was deleted.

21 changes: 14 additions & 7 deletions graph-editor/src/App.test.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,16 @@
import React from 'react';
import ReactDOM from 'react-dom';
import App from './App';
// import React from "react";
// import ReactDOM from "react-dom";
// import App from "./containers/App";
// import store from "./stores/store";
// import { Provider } from "react-redux";

it('renders without crashing', () => {
const div = document.createElement('div');
ReactDOM.render(<App />, div);
ReactDOM.unmountComponentAtNode(div);
it("renders without crashing", () => {
// const div = document.createElement("div");
// ReactDOM.render(
// <Provider store={store}>
// <App />
// </Provider>,
// div
// );
// ReactDOM.unmountComponentAtNode(div);
});
46 changes: 45 additions & 1 deletion graph-editor/src/actions/dataAction.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@ const getNodeID = eventNodeID => ({
type: "GET_NODE_ID",
payload: eventNodeID
});
const getNodeID2 = eventNodeID => ({
type: "GET_NODE_ID_2",
payload: eventNodeID
});
const getEdgeID = edgeID => ({
type: "GET_EDGE_ID",
payload: edgeID
Expand Down Expand Up @@ -41,9 +45,42 @@ const deleteEdgeFromDatabase = edgeID => ({
type: "DELETE_EDGE_FROM_DATABASE",
payload: edgeID
});
const storeEditName = name => ({
type: "STORE_EDIT_NODENAME_VALUE",
name: name
});
const storeEditNodeDateTime = dateTime => ({
type: "STORE_NODE_DATE_VALUE",
dateTime: dateTime
});

const storeEditInRelation = inRelation => ({
type: "STORE_EDGE_INRELATION",
payload: inRelation
});

const storeEditOutRelation = outRelation => ({
type: "STORE_EDGE_OUTRELATION",
payload: outRelation
});

const storeEditMessage = Message => ({
type: "STORE_EDGE_MESSAGE",
payload: Message
});

const storeEdgeNewName = EdgeName => ({
type: "STORE_EDGE_NAME",
payload: EdgeName
});
const storeEditRelationName = editEdgeName => ({
type: "STORE_EDIT_EDGE_NAME",
payload: editEdgeName
});

export {
getNodeID,
getNodeID2,
getNodeClass,
getEdgeID,
getNodename,
Expand All @@ -52,5 +89,12 @@ export {
getOutRelation,
updateGraph,
dedeteNodeInDatabase,
deleteEdgeFromDatabase
deleteEdgeFromDatabase,
storeEditName,
storeEditNodeDateTime,
storeEditInRelation,
storeEditOutRelation,
storeEditMessage,
storeEdgeNewName,
storeEditRelationName
};
105 changes: 104 additions & 1 deletion graph-editor/src/actions/databaseAction.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,12 @@ const getAllClassFromDatabase = selectID => ({
type: "GET_ALL_CLASS_FROM_DATABASE",
payload: selectID
});
const getAllNodeClassForAddNodeButton = () => ({
type: "GET_ALL_CLASS_FOR_ADDNODE_BUTTON"
});
const getAllEdgeClassForAddNodeButton = () => ({
type: "GET_ALL_EDGE_CLASS_FOR_CREATE_RELATION_BUTTON"
});

const sendAllClassFromDatabaseToState = allClass => ({
type: "SEND_ALL_CLASS_FROM_DATABASE_TO_STATE",
Expand All @@ -25,11 +31,108 @@ const getSrcDstEdge = edgeID => ({
payload: edgeID
});

const sendAllNodeClassToGraphCanvasReducer = allClass => ({
type: "GET_ALL_CLASS",
payload: allClass
});

const sendAllEdgeClassToGraphCanvasReducer = edgeClass => ({
type: "SEND_EDGE_CLASS",
payload: edgeClass
});

const deleteNodeFromDB = NodeID => ({
type: "DELETE_NODE_TO_DB",
payload: NodeID
});
const sendNodeIDToCanvas = nodeID => ({
type: "SEND_NODE_ID_TO_CANVAS",
payload: nodeID
});

const addNodeRender = data => ({
type: "ADD_NODE_RENDER",
payload: data
});

const addEdgeRender = newEdge => ({
type: "ADD_EDGE_RENDER",
payload: newEdge
});
const getNodeInEdge = selectNodeID => ({
type: "GET_IN_EDGE_FOR_NODE",
payload: selectNodeID
});
const addIncomingNodeEdge = (nodes, edges) => ({
type: "ADD_INCOMING_NODE_EDGE",
payloadNode: nodes,
payloadEdge: edges
});
const getNodeOutEdge = selectNodeID => ({
type: "GET_OUT_EDGE_FOR_NODE",
payload: selectNodeID
});
const addOutgoingNodeEdge = (nodes, edges) => ({
type: "ADD_OUTGOING_NODE_EDGE",
payloadNode: nodes,
payloadEdge: edges
});
const addUpdateNodeToDatabase = updateNode => ({
type: "ADD_UPDATE_NODE_TO_DB",
payload: updateNode
});
const getAllNodeProperties = nodeID => ({
type: "GET_NODE_PROPERTY",
payload: nodeID
});

const getAllEdgeProperties = edgeID => ({
type: "GET_EDGE_PROPERTY",
payload: edgeID
});
const sendAllNodePropertyToDataReducer = nodeProperty => ({
type: "SEND_NODE_PERPERTY_TO_DATA_REDUCER",
payload: nodeProperty
});

const sendAllEdgePropertyToDataReducer = edgeProperty => ({
type: "SEND_EDGE_PROPERTY_TO_DATA_REDUCER",
payload: edgeProperty
});
const addUpdateEdgeToDatabase = updateEdgeDB => ({
type: "ADD_UPDATE_EDGE_TO_DB",
payload: updateEdgeDB
});

const createNewEdgeToDatabase = newEdge => ({
type: "ADD_EDGE_TO_DB",
payload: newEdge
});

export {
executeConsole,
addVertexConsole,
getAllClassFromDatabase,
sendAllClassFromDatabaseToState,
addEdgeConsole,
getSrcDstEdge
getSrcDstEdge,
sendAllNodeClassToGraphCanvasReducer,
sendAllEdgeClassToGraphCanvasReducer,
getAllNodeClassForAddNodeButton,
deleteNodeFromDB,
sendNodeIDToCanvas,
getNodeInEdge,
addIncomingNodeEdge,
getNodeOutEdge,
addOutgoingNodeEdge,
addUpdateNodeToDatabase,
addNodeRender,
getAllNodeProperties,
sendAllNodePropertyToDataReducer,
getAllEdgeProperties,
sendAllEdgePropertyToDataReducer,
addUpdateEdgeToDatabase,
getAllEdgeClassForAddNodeButton,
createNewEdgeToDatabase,
addEdgeRender
};
10 changes: 7 additions & 3 deletions graph-editor/src/actions/mainButtonAction.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,12 @@ const addNodeToCanvas = newNode => ({
type: "ADD_NODE_ACTION",
payload: newNode
});

const addEdgeToCanvas = newEdge => ({
type: "ADD_EDGE_CANVAS",
payload: newEdge
});
const addNodeToDatabase = newNode => ({
type: "ADD_NODE_DB",
type: "ADD_NODE_TO_DB",
payload: newNode
});
const clearCanvas = nullCanvas => ({
Expand All @@ -27,5 +30,6 @@ export {
clearCanvas,
fullscreen,
exitFullscreen,
addNodeToDBError
addNodeToDBError,
addEdgeToCanvas
};
10 changes: 9 additions & 1 deletion graph-editor/src/actions/nodeEdgesMenu.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,20 @@ const changeColorNode = (nodeID, color) => ({
nodeID: nodeID,
color: color
});
const setEditNodeAlertTrue = () => ({
type: "ALERT_EDIT_MESSAGE_TRUE"
});
const setEditNodeAlertFalse = () => ({
type: "ALERT_EDIT_MESSAGE_FALSE"
});

export {
showNodeMenu,
hideNodeMenu,
showEdgeMenu,
hideEdgeMenu,
changeSizes,
changeColorNode
changeColorNode,
setEditNodeAlertTrue,
setEditNodeAlertFalse
};
Loading