Skip to content
Open
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
51 changes: 29 additions & 22 deletions ecosystem.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,25 +18,32 @@
*/

module.exports = {
apps: [{
name: "ag-viewer",
namespace: "ag-viewer",
script: "cd backend && node ./build/bin/www",
watch: false,
env: {
name: "ag-viewer-develop",
PORT: 3001,
NODE_ENV: "develop",
},
env_release: {
name: "ag-viewer-release",
PORT: 4000,
NODE_ENV: "release",
}
}],
deploy: {
staging: {
'post-deploy': 'npm install && npm run setup && npm run build-front && pm2 reload ecosystem.config.js'
}
}
}

apps: [
{
name: "ag-viewer",
namespace: "ag-viewer",
script: "cd backend && node ./build/bin/www",
watch: false,
env: {
name: "ag-viewer-develop",
PORT: 3001,
NODE_ENV: "develop",
},
env_release: {
name: "ag-viewer-release",
PORT: 4000,
NODE_ENV: "release",
},
},
],
deploy: {
staging: {
"post-deploy":
"npm install && npm run setup && npm run build-front && pm2 reload ecosystem.config.js",
},
},



};
13 changes: 5 additions & 8 deletions frontend/.eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,24 +18,21 @@
*/

module.exports = {

env: {
browser: true,
es2021: true,
},
extends: [
'eslint:recommended',
'plugin:react/recommended',
'airbnb',
],
extends: ["eslint:recommended", "plugin:react/recommended", "airbnb"],
parserOptions: {
ecmaFeatures: {
jsx: true,
},
ecmaVersion: 12,
sourceType: 'module',
sourceType: "module",
},
plugins: ['babel', 'react', 'import', 'react-hooks'],
plugins: ["babel", "react", "import", "react-hooks"],
rules: {
'linebreak-style': 0, // fow winodw user
"linebreak-style": 0, // fow winodw user
},
};
2 changes: 2 additions & 0 deletions frontend/src/App.css
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@


/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
Expand Down
14 changes: 8 additions & 6 deletions frontend/src/App.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,17 @@

import React from 'react';
import 'bootstrap/dist/css/bootstrap.min.css';
import 'antd/dist/antd.css';
import 'antd/dist/antd-with-locales';
import './static/style.css';
import './static/navbar-fixed-left.css';
import MainPage from './pages/Main/MainPage';

const App = () => (
<React.StrictMode>
<MainPage />
</React.StrictMode>
);
function App() {
return (
<React.StrictMode>
<MainPage />
</React.StrictMode>
);
}

export default App;
1 change: 0 additions & 1 deletion frontend/src/components/alert/presentations/Alert.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ import PropTypes from 'prop-types';
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
import { faPlayCircle } from '@fortawesome/free-regular-svg-icons';
import { Alert } from 'antd';

const SingleAlert = ({
alertKey,
alertName,
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/components/contents/presentations/Editor.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

import React, { useEffect, useState } from 'react';
import { useDispatch } from 'react-redux';
import uuid from 'react-uuid';
import { v4 as uuidv4 } from 'uuid';
import PropTypes from 'prop-types';
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
import { faTimesCircle, faToggleOff, faToggleOn } from '@fortawesome/free-solid-svg-icons';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import {
import PropTypes from 'prop-types';
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
import { faMinus, faPlus } from '@fortawesome/free-solid-svg-icons';
import uuid from 'react-uuid';
import { v4 as uuidv4 } from 'uuid';

const generateNewFilterObject = () => ({
key: uuid(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@
*/

import { connect } from 'react-redux';
import CypherResultCytoscape from '../presentations/CypherResultCytoscape';
import { setLabels } from '../../../features/cypher/CypherSlice';
import { openModal, addGraphHistory, addElementHistory } from '../../../features/modal/ModalSlice';
import { generateCytoscapeElement } from '../../../features/cypher/CypherUtil';
import CypherResultCytoscapeContainer from "../../cypherresult/containers/CypherResultCytoscapeContainer";

const mapStateToProps = (state, ownProps) => {
const { refKey } = ownProps;
Expand Down Expand Up @@ -67,4 +67,4 @@ export default connect(
mapDispatchToProps,
null,
{ forwardRef: true },
)(CypherResultCytoscape);
)(CypherResultCytoscapeCounter);
Original file line number Diff line number Diff line change
Expand Up @@ -50,4 +50,7 @@ const mapStateToProps = (state, ownProps) => {

const mapDispatchToProps = { };

export default connect(mapStateToProps, mapDispatchToProps)(CypherResultTable);
export default connect(
mapStateToProps,
mapDispatchToProps
)(CypherResultTableContainer);
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ import {
} from '../../../features/cypher/CypherUtil';
import CypherResultCytoscapeChart from '../../cytoscape/CypherResultCytoscapeChart';
import CypherResultCytoscapeLegend from '../../cytoscape/CypherResultCytoscapeLegend';
import CypherResultCytoscapeFooter from '../../cytoscape/CypherResultCytoscapeFooter';
import {CypherResultCytoscapeFooter} from '../../cytoscape/CypherResultCytoscapeFooter';
import CypherResultTab from '../../cytoscape/CypherResultTab';

const CypherResultCytoscape = forwardRef((props, ref) => {
Expand Down Expand Up @@ -434,4 +434,4 @@ CypherResultCytoscape.propTypes = {
setIsTable: PropTypes.func.isRequired,
};

export default CypherResultCytoscape;
export {CypherResultCytoscape};
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ import {
faProjectDiagram,
faTrash,
} from '@fortawesome/free-solid-svg-icons';
import uuid from 'react-uuid';
import { v4 as uuidv4 } from 'uuid';
import cxtmenu from '../../lib/cytoscape-cxtmenu';
import { initLocation, seletableLayouts } from './CytoscapeLayouts';
import { stylesheet } from './CytoscapeStyleSheet';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
import React, { useState } from 'react';
import PropTypes from 'prop-types';
import { Badge } from 'react-bootstrap';
import uuid from 'react-uuid';
import { v4 as uuidv4 } from 'uuid';
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
import { faAngleDown, faAngleUp } from '@fortawesome/free-solid-svg-icons';
import {
Expand Down Expand Up @@ -399,4 +399,4 @@ CypherResultCytoscapeFooter.propTypes = {
captions: PropTypes.arrayOf(PropTypes.string).isRequired,
};

export default CypherResultCytoscapeFooter;
export {CypherResultCytoscapeFooter};
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
import React, { Component } from 'react';
import PropTypes from 'prop-types';
import { Badge } from 'react-bootstrap';
import uuid from 'react-uuid';
import { v4 as uuidv4 } from 'uuid';
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
import { faAngleDown, faAngleUp } from '@fortawesome/free-solid-svg-icons';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,7 @@

import React, { useRef, useState } from 'react';
import CodeMirror from '@uiw/react-codemirror';
import 'codemirror/keymap/sublime';
import 'codemirror/addon/display/placeholder';
import 'codemirror/theme/ambiance-mobile.css';
import './CodeMirror.scss';

import PropTypes from 'prop-types';

const CodeMirrorWrapper = ({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
*/

import React, { createRef, useEffect, useState } from 'react';
import uuid from 'react-uuid';
import { v4 as uuidv4 } from 'uuid';
import { saveAs } from 'file-saver';
import { Parser } from 'json2csv';
import PropTypes from 'prop-types';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import {
} from 'react-bootstrap';
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
import { faMinusCircle } from '@fortawesome/free-solid-svg-icons';
import uuid from 'react-uuid';
import { v4 as uuidv4 } from 'uuid';
import PropTypes from 'prop-types';
import './GraphInit.scss';
import { Divider, Checkbox, Input } from 'antd';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import React, { useEffect } from 'react';
import PropTypes from 'prop-types';

import { Modal } from 'antd';
import uuid from 'react-uuid';
import { v4 as uuidv4 } from 'uuid';
import { connect, useDispatch } from 'react-redux';
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
import { faRedo, faTimes } from '@fortawesome/free-solid-svg-icons';
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/features/alert/AlertSlice.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
*/

import { createSlice } from '@reduxjs/toolkit';
import uuid from 'react-uuid';
import { v4 as uuidv4 } from "uuid";

const AlertSlice = createSlice({
name: 'alerts',
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/features/database/MetadataSlice.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
*/

import { createAsyncThunk, createSlice } from '@reduxjs/toolkit';
import uuid from 'react-uuid';
import { v4 as uuidv4 } from "uuid";

export const getMetaData = createAsyncThunk(
'database/getMetaData',
Expand Down
42 changes: 27 additions & 15 deletions frontend/src/features/frame/FrameSlice.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,45 +18,59 @@
*/

/* eslint-disable no-param-reassign */
import { createSlice } from '@reduxjs/toolkit';
import uuid from 'react-uuid';
import { createSlice } from "@reduxjs/toolkit";
import { v4 as uuidv4 } from "uuid";

const FrameSlice = createSlice({
name: 'frames',
name: "frames",
initialState: [],
reducers: {
addFrame: {
reducer: (state, action) => {
const reqString = action.payload.reqString.trim();
const firstNotPinnedIndex = state.findIndex((frame) => (frame.isPinned === false));
const firstNotPinnedIndex = state.findIndex(
(frame) => frame.isPinned === false
);
const { frameName } = action.payload;

const frameProps = {
reqString,
key: action.payload.refKey ? action.payload.refKey : uuid(),
};

if (reqString.startsWith(':play')) {
if (reqString.startsWith(":play")) {
frameProps.playTarget = reqString.split(/\s+/).pop();
}

state.splice(firstNotPinnedIndex, 0, { frameName, frameProps, isPinned: false });
state.map((frame) => { if (frame.orgIndex) { frame.orgIndex += 1; } return frame; });
state.splice(firstNotPinnedIndex, 0, {
frameName,
frameProps,
isPinned: false,
});
state.map((frame) => {
if (frame.orgIndex) {
frame.orgIndex += 1;
}
return frame;
});
},
prepare: (reqString, frameName, refKey) => ({ payload: { reqString, frameName, refKey } }),
prepare: (reqString, frameName, refKey) => ({
payload: { reqString, frameName, refKey },
}),
},
removeFrame: {
reducer: (state, action) => {
const frameKey = action.payload.refKey;
return state.filter((frame) => frame.frameProps.key !== frameKey);
},
prepare: (refKey) => ({ payload: { refKey } }),

},
pinFrame: {
reducer: (state, action) => {
const frameKey = action.payload.refKey;
const frameIndex = state.findIndex((frame) => (frame.frameProps.key === frameKey));
const frameIndex = state.findIndex(
(frame) => frame.frameProps.key === frameKey
);
if (!state[frameIndex].isPinned) {
state[frameIndex].isPinned = true;
state[frameIndex].orgIndex = frameIndex;
Expand All @@ -72,16 +86,14 @@ const FrameSlice = createSlice({
trimFrame: {
reducer: (state, action) => {
const { frameName } = action.payload;
return state.filter((frame) => (frame.frameName !== frameName));
return state.filter((frame) => frame.frameName !== frameName);
},
prepare: (frameName) => ({ payload: { frameName } }),

},
},
});

export const {
addFrame, removeFrame, pinFrame, trimFrame,
} = FrameSlice.actions;
export const { addFrame, removeFrame, pinFrame, trimFrame } =
FrameSlice.actions;

export default FrameSlice.reducer;
Loading