70 | `;
71 |
--------------------------------------------------------------------------------
/test_utils/__mocks__/styleMock.js:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2018-2020 "Graph Foundation"
3 | * Graph Foundation, Inc. [https://graphfoundation.org]
4 | *
5 | * This file is part of ONgDB.
6 | *
7 | * ONgDB is free software: you can redistribute it and/or modify
8 | * it under the terms of the GNU General Public License as published by
9 | * the Free Software Foundation, either version 3 of the License, or
10 | * (at your option) any later version.
11 | *
12 | * This program is distributed in the hope that it will be useful,
13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 | * GNU General Public License for more details.
16 | *
17 | * You should have received a copy of the GNU General Public License
18 | * along with this program. If not, see .
19 | */
20 | /*
21 | * Copyright (c) 2002-2020 "Neo4j,"
22 | * Neo4j Sweden AB [http://neo4j.com]
23 | *
24 | * This file is part of Neo4j.
25 | *
26 | * Neo4j is free software: you can redistribute it and/or modify
27 | * it under the terms of the GNU General Public License as published by
28 | * the Free Software Foundation, either version 3 of the License, or
29 | * (at your option) any later version.
30 | *
31 | * This program is distributed in the hope that it will be useful,
32 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
33 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
34 | * GNU General Public License for more details.
35 | *
36 | * You should have received a copy of the GNU General Public License
37 | * along with this program. If not, see .
38 | */
39 |
40 | module.exports = {}
41 |
--------------------------------------------------------------------------------
/test_utils/__mocks__/workerLoaderMock.js:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2018-2020 "Graph Foundation"
3 | * Graph Foundation, Inc. [https://graphfoundation.org]
4 | *
5 | * This file is part of ONgDB.
6 | *
7 | * ONgDB is free software: you can redistribute it and/or modify
8 | * it under the terms of the GNU General Public License as published by
9 | * the Free Software Foundation, either version 3 of the License, or
10 | * (at your option) any later version.
11 | *
12 | * This program is distributed in the hope that it will be useful,
13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 | * GNU General Public License for more details.
16 | *
17 | * You should have received a copy of the GNU General Public License
18 | * along with this program. If not, see .
19 | */
20 | /*
21 | * Copyright (c) 2002-2020 "Neo4j,"
22 | * Neo4j Sweden AB [http://neo4j.com]
23 | *
24 | * This file is part of Neo4j.
25 | *
26 | * Neo4j is free software: you can redistribute it and/or modify
27 | * it under the terms of the GNU General Public License as published by
28 | * the Free Software Foundation, either version 3 of the License, or
29 | * (at your option) any later version.
30 | *
31 | * This program is distributed in the hope that it will be useful,
32 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
33 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
34 | * GNU General Public License for more details.
35 | *
36 | * You should have received a copy of the GNU General Public License
37 | * along with this program. If not, see .
38 | */
39 |
40 | module.exports = {}
41 |
--------------------------------------------------------------------------------
/src/browser/components/InputEnterStepping/InputEnterStepping.jsx:
--------------------------------------------------------------------------------
1 | import { Component } from 'react'
2 |
3 | export default class InputEnterStepping extends Component {
4 | state = {
5 | initial: true
6 | }
7 |
8 | steps = []
9 | getSubmitProps = () => {
10 | return {
11 | onClick: this.props.submitAction
12 | }
13 | }
14 |
15 | getInputPropsForIndex = (i, props = {}) => {
16 | this.steps[i] = this.steps[i] || {}
17 | const { initialFocus, ...cleanProps } = props
18 | const out = {
19 | ...cleanProps,
20 | onKeyDown: e => {
21 | // merge with users onKeyDown
22 | this.onKeyDown(e, i)
23 | props.onKeyDown && props.onKeyDown(e)
24 | }
25 | }
26 | if (initialFocus) {
27 | this.steps[i].focusOnRef = true
28 | }
29 | return out
30 | }
31 |
32 | onKeyDown = (e, i) => {
33 | if (e.keyCode === 13) {
34 | e.preventDefault()
35 | if (i !== this.steps.length - 1) {
36 | this.steps[i + 1].focusFn && this.steps[i + 1].focusFn()
37 | } else {
38 | this.props.submitAction && this.props.submitAction(e)
39 | }
40 | }
41 | }
42 |
43 | setRefForIndex = (i, ref) => {
44 | this.steps[i] = this.steps[i] || {}
45 | this.steps[i].focusFn = () => ref.focus()
46 | if (this.state.initial && this.steps[i].focusOnRef) {
47 | delete this.steps[i].focusOnRef
48 | this.setState({ initial: false }, () => {
49 | setTimeout(this.steps[i].focusFn, 0)
50 | })
51 | }
52 | }
53 |
54 | render() {
55 | return this.props.render({
56 | getInputPropsForIndex: this.getInputPropsForIndex,
57 | getSubmitProps: this.getSubmitProps,
58 | setRefForIndex: this.setRefForIndex
59 | })
60 | }
61 | }
62 |
--------------------------------------------------------------------------------
/src/browser/modules/D3Visualization/lib/visualization/index.js:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2018-2020 "Graph Foundation"
3 | * Graph Foundation, Inc. [https://graphfoundation.org]
4 | *
5 | * This file is part of ONgDB.
6 | *
7 | * ONgDB is free software: you can redistribute it and/or modify
8 | * it under the terms of the GNU General Public License as published by
9 | * the Free Software Foundation, either version 3 of the License, or
10 | * (at your option) any later version.
11 | *
12 | * This program is distributed in the hope that it will be useful,
13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 | * GNU General Public License for more details.
16 | *
17 | * You should have received a copy of the GNU General Public License
18 | * along with this program. If not, see .
19 | */
20 | /*
21 | * Copyright (c) 2002-2020 "Neo4j,"
22 | * Neo4j Sweden AB [http://neo4j.com]
23 | *
24 | * This file is part of Neo4j.
25 | *
26 | * Neo4j is free software: you can redistribute it and/or modify
27 | * it under the terms of the GNU General Public License as published by
28 | * the Free Software Foundation, either version 3 of the License, or
29 | * (at your option) any later version.
30 | *
31 | * This program is distributed in the hope that it will be useful,
32 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
33 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
34 | * GNU General Public License for more details.
35 | *
36 | * You should have received a copy of the GNU General Public License
37 | * along with this program. If not, see .
38 | */
39 |
40 | import './d3-appendSvg.js'
41 |
--------------------------------------------------------------------------------
/src/browser/modules/Stream/Extras/index.js:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2018-2020 "Graph Foundation"
3 | * Graph Foundation, Inc. [https://graphfoundation.org]
4 | *
5 | * This file is part of ONgDB.
6 | *
7 | * ONgDB is free software: you can redistribute it and/or modify
8 | * it under the terms of the GNU General Public License as published by
9 | * the Free Software Foundation, either version 3 of the License, or
10 | * (at your option) any later version.
11 | *
12 | * This program is distributed in the hope that it will be useful,
13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 | * GNU General Public License for more details.
16 | *
17 | * You should have received a copy of the GNU General Public License
18 | * along with this program. If not, see .
19 | */
20 | /*
21 | * Copyright (c) 2002-2020 "Neo4j,"
22 | * Neo4j Sweden AB [http://neo4j.com]
23 | *
24 | * This file is part of Neo4j.
25 | *
26 | * Neo4j is free software: you can redistribute it and/or modify
27 | * it under the terms of the GNU General Public License as published by
28 | * the Free Software Foundation, either version 3 of the License, or
29 | * (at your option) any later version.
30 | *
31 | * This program is distributed in the hope that it will be useful,
32 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
33 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
34 | * GNU General Public License for more details.
35 | *
36 | * You should have received a copy of the GNU General Public License
37 | * along with this program. If not, see .
38 | */
39 |
40 | export { default as SnakeFrame } from './SnakeFrame'
41 |
--------------------------------------------------------------------------------
/src/shared/modules/cypher/procedureFactory.js:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2018-2020 "Graph Foundation"
3 | * Graph Foundation, Inc. [https://graphfoundation.org]
4 | *
5 | * This file is part of ONgDB.
6 | *
7 | * ONgDB is free software: you can redistribute it and/or modify
8 | * it under the terms of the GNU General Public License as published by
9 | * the Free Software Foundation, either version 3 of the License, or
10 | * (at your option) any later version.
11 | *
12 | * This program is distributed in the hope that it will be useful,
13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 | * GNU General Public License for more details.
16 | *
17 | * You should have received a copy of the GNU General Public License
18 | * along with this program. If not, see .
19 | */
20 | /*
21 | * Copyright (c) 2002-2020 "Neo4j,"
22 | * Neo4j Sweden AB [http://neo4j.com]
23 | *
24 | * This file is part of Neo4j.
25 | *
26 | * Neo4j is free software: you can redistribute it and/or modify
27 | * it under the terms of the GNU General Public License as published by
28 | * the Free Software Foundation, either version 3 of the License, or
29 | * (at your option) any later version.
30 | *
31 | * This program is distributed in the hope that it will be useful,
32 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
33 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
34 | * GNU General Public License for more details.
35 | *
36 | * You should have received a copy of the GNU General Public License
37 | * along with this program. If not, see .
38 | */
39 |
40 | export const listAvailableProcedures = 'CALL dbms.procedures()'
41 |
--------------------------------------------------------------------------------
/test_utils/__mocks__/fileMock.js:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2018-2020 "Graph Foundation"
3 | * Graph Foundation, Inc. [https://graphfoundation.org]
4 | *
5 | * This file is part of ONgDB.
6 | *
7 | * ONgDB is free software: you can redistribute it and/or modify
8 | * it under the terms of the GNU General Public License as published by
9 | * the Free Software Foundation, either version 3 of the License, or
10 | * (at your option) any later version.
11 | *
12 | * This program is distributed in the hope that it will be useful,
13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 | * GNU General Public License for more details.
16 | *
17 | * You should have received a copy of the GNU General Public License
18 | * along with this program. If not, see .
19 | */
20 | /*
21 | * Copyright (c) 2002-2020 "Neo4j,"
22 | * Neo4j Sweden AB [http://neo4j.com]
23 | *
24 | * This file is part of Neo4j.
25 | *
26 | * Neo4j is free software: you can redistribute it and/or modify
27 | * it under the terms of the GNU General Public License as published by
28 | * the Free Software Foundation, either version 3 of the License, or
29 | * (at your option) any later version.
30 | *
31 | * This program is distributed in the hope that it will be useful,
32 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
33 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
34 | * GNU General Public License for more details.
35 | *
36 | * You should have received a copy of the GNU General Public License
37 | * along with this program. If not, see .
38 | */
39 |
40 | module.exports = '' // To have the component not throwing
41 |
--------------------------------------------------------------------------------
/src/browser/modules/D3Visualization/index.js:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2018-2020 "Graph Foundation"
3 | * Graph Foundation, Inc. [https://graphfoundation.org]
4 | *
5 | * This file is part of ONgDB.
6 | *
7 | * ONgDB is free software: you can redistribute it and/or modify
8 | * it under the terms of the GNU General Public License as published by
9 | * the Free Software Foundation, either version 3 of the License, or
10 | * (at your option) any later version.
11 | *
12 | * This program is distributed in the hope that it will be useful,
13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 | * GNU General Public License for more details.
16 | *
17 | * You should have received a copy of the GNU General Public License
18 | * along with this program. If not, see .
19 | */
20 | /*
21 | * Copyright (c) 2002-2020 "Neo4j,"
22 | * Neo4j Sweden AB [http://neo4j.com]
23 | *
24 | * This file is part of Neo4j.
25 | *
26 | * Neo4j is free software: you can redistribute it and/or modify
27 | * it under the terms of the GNU General Public License as published by
28 | * the Free Software Foundation, either version 3 of the License, or
29 | * (at your option) any later version.
30 | *
31 | * This program is distributed in the hope that it will be useful,
32 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
33 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
34 | * GNU General Public License for more details.
35 | *
36 | * You should have received a copy of the GNU General Public License
37 | * along with this program. If not, see .
38 | */
39 |
40 | import components from './components'
41 |
42 | export default { components }
43 |
--------------------------------------------------------------------------------
/src/browser/components/headers/index.js:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2018-2020 "Graph Foundation"
3 | * Graph Foundation, Inc. [https://graphfoundation.org]
4 | *
5 | * This file is part of ONgDB.
6 | *
7 | * ONgDB is free software: you can redistribute it and/or modify
8 | * it under the terms of the GNU General Public License as published by
9 | * the Free Software Foundation, either version 3 of the License, or
10 | * (at your option) any later version.
11 | *
12 | * This program is distributed in the hope that it will be useful,
13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 | * GNU General Public License for more details.
16 | *
17 | * You should have received a copy of the GNU General Public License
18 | * along with this program. If not, see .
19 | */
20 | /*
21 | * Copyright (c) 2002-2020 "Neo4j,"
22 | * Neo4j Sweden AB [http://neo4j.com]
23 | *
24 | * This file is part of Neo4j.
25 | *
26 | * Neo4j is free software: you can redistribute it and/or modify
27 | * it under the terms of the GNU General Public License as published by
28 | * the Free Software Foundation, either version 3 of the License, or
29 | * (at your option) any later version.
30 | *
31 | * This program is distributed in the hope that it will be useful,
32 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
33 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
34 | * GNU General Public License for more details.
35 | *
36 | * You should have received a copy of the GNU General Public License
37 | * along with this program. If not, see .
38 | */
39 |
40 | import { H1, H2, H3, H4, H5 } from './Headers'
41 |
42 | export { H1, H2, H3, H4, H5 }
43 |
--------------------------------------------------------------------------------
/src/browser/modules/D3Visualization/components/index.js:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2018-2020 "Graph Foundation"
3 | * Graph Foundation, Inc. [https://graphfoundation.org]
4 | *
5 | * This file is part of ONgDB.
6 | *
7 | * ONgDB is free software: you can redistribute it and/or modify
8 | * it under the terms of the GNU General Public License as published by
9 | * the Free Software Foundation, either version 3 of the License, or
10 | * (at your option) any later version.
11 | *
12 | * This program is distributed in the hope that it will be useful,
13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 | * GNU General Public License for more details.
16 | *
17 | * You should have received a copy of the GNU General Public License
18 | * along with this program. If not, see .
19 | */
20 | /*
21 | * Copyright (c) 2002-2020 "Neo4j,"
22 | * Neo4j Sweden AB [http://neo4j.com]
23 | *
24 | * This file is part of Neo4j.
25 | *
26 | * Neo4j is free software: you can redistribute it and/or modify
27 | * it under the terms of the GNU General Public License as published by
28 | * the Free Software Foundation, either version 3 of the License, or
29 | * (at your option) any later version.
30 | *
31 | * This program is distributed in the hope that it will be useful,
32 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
33 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
34 | * GNU General Public License for more details.
35 | *
36 | * You should have received a copy of the GNU General Public License
37 | * along with this program. If not, see .
38 | */
39 |
40 | import { Explorer } from './Explorer'
41 |
42 | export default { Explorer }
43 |
--------------------------------------------------------------------------------
/src/shared/utils/array-has-items.js:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2018-2020 "Graph Foundation"
3 | * Graph Foundation, Inc. [https://graphfoundation.org]
4 | *
5 | * This file is part of ONgDB.
6 | *
7 | * ONgDB is free software: you can redistribute it and/or modify
8 | * it under the terms of the GNU General Public License as published by
9 | * the Free Software Foundation, either version 3 of the License, or
10 | * (at your option) any later version.
11 | *
12 | * This program is distributed in the hope that it will be useful,
13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 | * GNU General Public License for more details.
16 | *
17 | * You should have received a copy of the GNU General Public License
18 | * along with this program. If not, see .
19 | */
20 | /*
21 | * Copyright (c) 2002-2020 "Neo4j,"
22 | * Neo4j Sweden AB [http://neo4j.com]
23 | *
24 | * This file is part of Neo4j.
25 | *
26 | * Neo4j is free software: you can redistribute it and/or modify
27 | * it under the terms of the GNU General Public License as published by
28 | * the Free Software Foundation, either version 3 of the License, or
29 | * (at your option) any later version.
30 | *
31 | * This program is distributed in the hope that it will be useful,
32 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
33 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
34 | * GNU General Public License for more details.
35 | *
36 | * You should have received a copy of the GNU General Public License
37 | * along with this program. If not, see .
38 | */
39 |
40 | export default function arrayHasItems(arr) {
41 | return Array.isArray(arr) && arr.length > 0
42 | }
43 |
--------------------------------------------------------------------------------
/src/browser/components/desktop-api/desktop-api.handlers.js:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2002-2019 "Neo4j,"
3 | * Neo4j Sweden AB [http://neo4j.com]
4 | *
5 | * This file is part of Neo4j.
6 | *
7 | * Neo4j is free software: you can redistribute it and/or modify
8 | * it under the terms of the GNU General Public License as published by
9 | * the Free Software Foundation, either version 3 of the License, or
10 | * (at your option) any later version.
11 | *
12 | * This program is distributed in the hope that it will be useful,
13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 | * GNU General Public License for more details.
16 | *
17 | * You should have received a copy of the GNU General Public License
18 | * along with this program. If not, see .
19 | */
20 |
21 | import {
22 | getActiveGraph,
23 | createConnectionCredentialsObject
24 | } from './desktop-api.utils'
25 |
26 | export const buildConnectionCreds = async (
27 | _event,
28 | context,
29 | _oldContext,
30 | getKerberosTicket,
31 | extra = {}
32 | ) => {
33 | const activeGraph = getActiveGraph(context) || {}
34 | const connectionsCredentialsObject = await createConnectionCredentialsObject(
35 | activeGraph,
36 | extra.defaultConnectionData,
37 | getKerberosTicket
38 | )
39 | // No connection. Probably no graph active.
40 | if (!connectionsCredentialsObject) {
41 | throw new Error('No connection creds found')
42 | }
43 | return connectionsCredentialsObject
44 | }
45 |
46 | export const getDesktopTheme = (_, newContext) => {
47 | if (newContext.global.prefersColorScheme) {
48 | return Promise.resolve(newContext.global.prefersColorScheme)
49 | }
50 | return Promise.reject(new Error('No theme detected'))
51 | }
52 |
--------------------------------------------------------------------------------
/src/browser/components/Render/index.jsx:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2018-2020 "Graph Foundation"
3 | * Graph Foundation, Inc. [https://graphfoundation.org]
4 | *
5 | * This file is part of ONgDB.
6 | *
7 | * ONgDB is free software: you can redistribute it and/or modify
8 | * it under the terms of the GNU General Public License as published by
9 | * the Free Software Foundation, either version 3 of the License, or
10 | * (at your option) any later version.
11 | *
12 | * This program is distributed in the hope that it will be useful,
13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 | * GNU General Public License for more details.
16 | *
17 | * You should have received a copy of the GNU General Public License
18 | * along with this program. If not, see .
19 | */
20 | /*
21 | * Copyright (c) 2002-2020 "Neo4j,"
22 | * Neo4j Sweden AB [http://neo4j.com]
23 | *
24 | * This file is part of Neo4j.
25 | *
26 | * Neo4j is free software: you can redistribute it and/or modify
27 | * it under the terms of the GNU General Public License as published by
28 | * the Free Software Foundation, either version 3 of the License, or
29 | * (at your option) any later version.
30 | *
31 | * This program is distributed in the hope that it will be useful,
32 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
33 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
34 | * GNU General Public License for more details.
35 | *
36 | * You should have received a copy of the GNU General Public License
37 | * along with this program. If not, see .
38 | */
39 |
40 | const Render = ({ if: cond, children }) => {
41 | return cond ? children : null
42 | }
43 | export default Render
44 |
--------------------------------------------------------------------------------
/src/shared/utils/number-to-US-locale.js:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2018-2020 "Graph Foundation"
3 | * Graph Foundation, Inc. [https://graphfoundation.org]
4 | *
5 | * This file is part of ONgDB.
6 | *
7 | * ONgDB is free software: you can redistribute it and/or modify
8 | * it under the terms of the GNU General Public License as published by
9 | * the Free Software Foundation, either version 3 of the License, or
10 | * (at your option) any later version.
11 | *
12 | * This program is distributed in the hope that it will be useful,
13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 | * GNU General Public License for more details.
16 | *
17 | * You should have received a copy of the GNU General Public License
18 | * along with this program. If not, see .
19 | */
20 | /*
21 | * Copyright (c) 2002-2020 "Neo4j,"
22 | * Neo4j Sweden AB [http://neo4j.com]
23 | *
24 | * This file is part of Neo4j.
25 | *
26 | * Neo4j is free software: you can redistribute it and/or modify
27 | * it under the terms of the GNU General Public License as published by
28 | * the Free Software Foundation, either version 3 of the License, or
29 | * (at your option) any later version.
30 | *
31 | * This program is distributed in the hope that it will be useful,
32 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
33 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
34 | * GNU General Public License for more details.
35 | *
36 | * You should have received a copy of the GNU General Public License
37 | * along with this program. If not, see .
38 | */
39 |
40 | export default value =>
41 | (parseInt(value, 10) >= 0 && parseInt(value, 10).toLocaleString('en-US')) ||
42 | value
43 |
--------------------------------------------------------------------------------
/src/browser/modules/Stream/CypherFrame/PlanView.styled.jsx:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2018-2020 "Graph Foundation"
3 | * Graph Foundation, Inc. [https://graphfoundation.org]
4 | *
5 | * This file is part of ONgDB.
6 | *
7 | * ONgDB is free software: you can redistribute it and/or modify
8 | * it under the terms of the GNU General Public License as published by
9 | * the Free Software Foundation, either version 3 of the License, or
10 | * (at your option) any later version.
11 | *
12 | * This program is distributed in the hope that it will be useful,
13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 | * GNU General Public License for more details.
16 | *
17 | * You should have received a copy of the GNU General Public License
18 | * along with this program. If not, see .
19 | */
20 | /*
21 | * Copyright (c) 2002-2020 "Neo4j,"
22 | * Neo4j Sweden AB [http://neo4j.com]
23 | *
24 | * This file is part of Neo4j.
25 | *
26 | * Neo4j is free software: you can redistribute it and/or modify
27 | * it under the terms of the GNU General Public License as published by
28 | * the Free Software Foundation, either version 3 of the License, or
29 | * (at your option) any later version.
30 | *
31 | * This program is distributed in the hope that it will be useful,
32 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
33 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
34 | * GNU General Public License for more details.
35 | *
36 | * You should have received a copy of the GNU General Public License
37 | * along with this program. If not, see .
38 | */
39 |
40 | import styled from 'styled-components'
41 |
42 | export const PlanSVG = styled.svg`
43 | width: 100%;
44 | `
45 |
--------------------------------------------------------------------------------
/postcss.config.js:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2018-2020 "Graph Foundation"
3 | * Graph Foundation, Inc. [https://graphfoundation.org]
4 | *
5 | * This file is part of ONgDB.
6 | *
7 | * ONgDB is free software: you can redistribute it and/or modify
8 | * it under the terms of the GNU General Public License as published by
9 | * the Free Software Foundation, either version 3 of the License, or
10 | * (at your option) any later version.
11 | *
12 | * This program is distributed in the hope that it will be useful,
13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 | * GNU General Public License for more details.
16 | *
17 | * You should have received a copy of the GNU General Public License
18 | * along with this program. If not, see .
19 | */
20 | /*
21 | * Copyright (c) 2002-2020 "Neo4j,"
22 | * Neo4j Sweden AB [http://neo4j.com]
23 | *
24 | * This file is part of Neo4j.
25 | *
26 | * Neo4j is free software: you can redistribute it and/or modify
27 | * it under the terms of the GNU General Public License as published by
28 | * the Free Software Foundation, either version 3 of the License, or
29 | * (at your option) any later version.
30 | *
31 | * This program is distributed in the hope that it will be useful,
32 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
33 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
34 | * GNU General Public License for more details.
35 | *
36 | * You should have received a copy of the GNU General Public License
37 | * along with this program. If not, see .
38 | */
39 |
40 | module.exports = {
41 | plugins: {
42 | precss: {},
43 | autoprefixer: {
44 | browsers: ['last 3 version', 'ie >= 10']
45 | }
46 | }
47 | }
48 |
--------------------------------------------------------------------------------
/src/browser/modules/DocTitle/index.jsx:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2018-2020 "Graph Foundation"
3 | * Graph Foundation, Inc. [https://graphfoundation.org]
4 | *
5 | * This file is part of ONgDB.
6 | *
7 | * ONgDB is free software: you can redistribute it and/or modify
8 | * it under the terms of the GNU General Public License as published by
9 | * the Free Software Foundation, either version 3 of the License, or
10 | * (at your option) any later version.
11 | *
12 | * This program is distributed in the hope that it will be useful,
13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 | * GNU General Public License for more details.
16 | *
17 | * You should have received a copy of the GNU General Public License
18 | * along with this program. If not, see .
19 | */
20 | /*
21 | * Copyright (c) 2002-2020 "Neo4j,"
22 | * Neo4j Sweden AB [http://neo4j.com]
23 | *
24 | * This file is part of Neo4j.
25 | *
26 | * Neo4j is free software: you can redistribute it and/or modify
27 | * it under the terms of the GNU General Public License as published by
28 | * the Free Software Foundation, either version 3 of the License, or
29 | * (at your option) any later version.
30 | *
31 | * This program is distributed in the hope that it will be useful,
32 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
33 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
34 | * GNU General Public License for more details.
35 | *
36 | * You should have received a copy of the GNU General Public License
37 | * along with this program. If not, see .
38 | */
39 |
40 | const DocTitle = ({ titleString }) => {
41 | document.title = titleString
42 | return null
43 | }
44 |
45 | export default DocTitle
46 |
--------------------------------------------------------------------------------
/src/shared/modules/userInteraction/userInteractionDuck.js:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2018-2020 "Graph Foundation"
3 | * Graph Foundation, Inc. [https://graphfoundation.org]
4 | *
5 | * This file is part of ONgDB.
6 | *
7 | * ONgDB is free software: you can redistribute it and/or modify
8 | * it under the terms of the GNU General Public License as published by
9 | * the Free Software Foundation, either version 3 of the License, or
10 | * (at your option) any later version.
11 | *
12 | * This program is distributed in the hope that it will be useful,
13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 | * GNU General Public License for more details.
16 | *
17 | * You should have received a copy of the GNU General Public License
18 | * along with this program. If not, see .
19 | */
20 | /*
21 | * Copyright (c) 2002-2020 "Neo4j,"
22 | * Neo4j Sweden AB [http://neo4j.com]
23 | *
24 | * This file is part of Neo4j.
25 | *
26 | * Neo4j is free software: you can redistribute it and/or modify
27 | * it under the terms of the GNU General Public License as published by
28 | * the Free Software Foundation, either version 3 of the License, or
29 | * (at your option) any later version.
30 | *
31 | * This program is distributed in the hope that it will be useful,
32 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
33 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
34 | * GNU General Public License for more details.
35 | *
36 | * You should have received a copy of the GNU General Public License
37 | * along with this program. If not, see .
38 | */
39 |
40 | // Constants
41 | export const NAME = 'userInteraction'
42 | export const USER_INTERACTION = `${NAME}/USER_INTERACTION`
43 |
--------------------------------------------------------------------------------
/src/shared/services/bolt/cypherTypesFormatting.js:
--------------------------------------------------------------------------------
1 | import neo4j from 'neo4j-driver'
2 |
3 | export const csvFormat = anything => {
4 | if (typeof anything === 'number') {
5 | return numberFormat(anything)
6 | }
7 | if (neo4j.isInt(anything)) {
8 | return anything.toString()
9 | }
10 | if (anything instanceof neo4j.types.Point) {
11 | return spacialFormat(anything)
12 | }
13 | if (isTemporalType(anything)) {
14 | return `"${anything.toString()}"`
15 | }
16 | if (typeof anything === 'string') {
17 | return anything
18 | }
19 | return undefined
20 | }
21 |
22 | export const stringModifier = anything => {
23 | if (typeof anything === 'number') {
24 | return numberFormat(anything)
25 | }
26 | if (neo4j.isInt(anything)) {
27 | return anything.toString()
28 | }
29 | if (anything instanceof neo4j.types.Point) {
30 | return spacialFormat(anything)
31 | }
32 | if (isTemporalType(anything)) {
33 | return `"${anything.toString()}"`
34 | }
35 | return undefined
36 | }
37 |
38 | const numberFormat = anything => {
39 | // Exclude false positives and return early
40 | if ([Infinity, -Infinity, NaN].includes(anything)) {
41 | return `${anything}`
42 | }
43 | if (Math.floor(anything) === anything) {
44 | return `${anything}.0`
45 | }
46 | return undefined
47 | }
48 | const spacialFormat = anything => {
49 | const zString = anything.z ? `, z:${anything.z}` : ''
50 | return `point({srid:${anything.srid}, x:${anything.x}, y:${anything.y}${zString}})`
51 | }
52 |
53 | const isTemporalType = anything =>
54 | anything instanceof neo4j.types.Date ||
55 | anything instanceof neo4j.types.DateTime ||
56 | anything instanceof neo4j.types.Duration ||
57 | anything instanceof neo4j.types.LocalDateTime ||
58 | anything instanceof neo4j.types.LocalTime ||
59 | anything instanceof neo4j.types.Time
60 |
--------------------------------------------------------------------------------
/src/browser/modules/Stream/stream.utils.js:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2018-2020 "Graph Foundation"
3 | * Graph Foundation, Inc. [https://graphfoundation.org]
4 | *
5 | * This file is part of ONgDB.
6 | *
7 | * ONgDB is free software: you can redistribute it and/or modify
8 | * it under the terms of the GNU General Public License as published by
9 | * the Free Software Foundation, either version 3 of the License, or
10 | * (at your option) any later version.
11 | *
12 | * This program is distributed in the hope that it will be useful,
13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 | * GNU General Public License for more details.
16 | *
17 | * You should have received a copy of the GNU General Public License
18 | * along with this program. If not, see .
19 | */
20 | /*
21 | * Copyright (c) 2002-2020 "Neo4j,"
22 | * Neo4j Sweden AB [http://neo4j.com]
23 | *
24 | * This file is part of Neo4j.
25 | *
26 | * Neo4j is free software: you can redistribute it and/or modify
27 | * it under the terms of the GNU General Public License as published by
28 | * the Free Software Foundation, either version 3 of the License, or
29 | * (at your option) any later version.
30 | *
31 | * This program is distributed in the hope that it will be useful,
32 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
33 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
34 | * GNU General Public License for more details.
35 | *
36 | * You should have received a copy of the GNU General Public License
37 | * along with this program. If not, see .
38 | */
39 |
40 | export function getLatestFromFrameStack(frameObj) {
41 | if (!frameObj.stack) {
42 | return null
43 | }
44 | return frameObj.stack[0]
45 | }
46 |
--------------------------------------------------------------------------------
/src/browser/components/Centered.jsx:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2018-2020 "Graph Foundation"
3 | * Graph Foundation, Inc. [https://graphfoundation.org]
4 | *
5 | * This file is part of ONgDB.
6 | *
7 | * ONgDB is free software: you can redistribute it and/or modify
8 | * it under the terms of the GNU General Public License as published by
9 | * the Free Software Foundation, either version 3 of the License, or
10 | * (at your option) any later version.
11 | *
12 | * This program is distributed in the hope that it will be useful,
13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 | * GNU General Public License for more details.
16 | *
17 | * You should have received a copy of the GNU General Public License
18 | * along with this program. If not, see .
19 | */
20 | /*
21 | * Copyright (c) 2002-2020 "Neo4j,"
22 | * Neo4j Sweden AB [http://neo4j.com]
23 | *
24 | * This file is part of Neo4j.
25 | *
26 | * Neo4j is free software: you can redistribute it and/or modify
27 | * it under the terms of the GNU General Public License as published by
28 | * the Free Software Foundation, either version 3 of the License, or
29 | * (at your option) any later version.
30 | *
31 | * This program is distributed in the hope that it will be useful,
32 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
33 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
34 | * GNU General Public License for more details.
35 | *
36 | * You should have received a copy of the GNU General Public License
37 | * along with this program. If not, see .
38 | */
39 |
40 | import styled from 'styled-components'
41 |
42 | const Centered = styled.div`
43 | width: 100%;
44 | text-align: center;
45 | `
46 | export default Centered
47 |
--------------------------------------------------------------------------------
/src/browser/index.jsx:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2018-2020 "Graph Foundation"
3 | * Graph Foundation, Inc. [https://graphfoundation.org]
4 | *
5 | * This file is part of ONgDB.
6 | *
7 | * ONgDB is free software: you can redistribute it and/or modify
8 | * it under the terms of the GNU General Public License as published by
9 | * the Free Software Foundation, either version 3 of the License, or
10 | * (at your option) any later version.
11 | *
12 | * This program is distributed in the hope that it will be useful,
13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 | * GNU General Public License for more details.
16 | *
17 | * You should have received a copy of the GNU General Public License
18 | * along with this program. If not, see .
19 | */
20 | /*
21 | * Copyright (c) 2002-2020 "Neo4j,"
22 | * Neo4j Sweden AB [http://neo4j.com]
23 | *
24 | * This file is part of Neo4j.
25 | *
26 | * Neo4j is free software: you can redistribute it and/or modify
27 | * it under the terms of the GNU General Public License as published by
28 | * the Free Software Foundation, either version 3 of the License, or
29 | * (at your option) any later version.
30 | *
31 | * This program is distributed in the hope that it will be useful,
32 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
33 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
34 | * GNU General Public License for more details.
35 | *
36 | * You should have received a copy of the GNU General Public License
37 | * along with this program. If not, see .
38 | */
39 | import './init.js'
40 | import React from 'react'
41 | import ReactDOM from 'react-dom'
42 | import AppInit from './AppInit.jsx'
43 |
44 | ReactDOM.render(, document.getElementById('mount'))
45 |
--------------------------------------------------------------------------------
/src/shared/services/export-favorites/export-favorites.constants.js:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2018-2020 "Graph Foundation"
3 | * Graph Foundation, Inc. [https://graphfoundation.org]
4 | *
5 | * This file is part of ONgDB.
6 | *
7 | * ONgDB is free software: you can redistribute it and/or modify
8 | * it under the terms of the GNU General Public License as published by
9 | * the Free Software Foundation, either version 3 of the License, or
10 | * (at your option) any later version.
11 | *
12 | * This program is distributed in the hope that it will be useful,
13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 | * GNU General Public License for more details.
16 | *
17 | * You should have received a copy of the GNU General Public License
18 | * along with this program. If not, see .
19 | */
20 | /*
21 | * Copyright (c) 2002-2020 "Neo4j,"
22 | * Neo4j Sweden AB [http://neo4j.com]
23 | *
24 | * This file is part of Neo4j.
25 | *
26 | * Neo4j is free software: you can redistribute it and/or modify
27 | * it under the terms of the GNU General Public License as published by
28 | * the Free Software Foundation, either version 3 of the License, or
29 | * (at your option) any later version.
30 | *
31 | * This program is distributed in the hope that it will be useful,
32 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
33 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
34 | * GNU General Public License for more details.
35 | *
36 | * You should have received a copy of the GNU General Public License
37 | * along with this program. If not, see .
38 | */
39 |
40 | export const SLASH = '/'
41 | export const NEW_LINE = '\n'
42 | export const COMMENT_PREFIX = '//'
43 | export const CYPHER_FILE_EXTENSION = '.cypher'
44 |
--------------------------------------------------------------------------------
/src/browser/components/__snapshots__/Display.test.js.snap:
--------------------------------------------------------------------------------
1 | // Jest Snapshot v1, https://goo.gl/fbAQLP
2 |
3 | exports[` can lazy load if condition changes from false to true and has the lazy prop 1`] = ``;
4 |
5 | exports[` can lazy load if condition changes from false to true and has the lazy prop 2`] = `
6 |
7 |
10 |
11 | Hello
12 |
13 |
14 |
15 | `;
16 |
17 | exports[` does display if condition is true 1`] = `
18 |
19 |
22 |
23 | Hello
24 |
25 |
26 |
27 | `;
28 |
29 | exports[` hides if condition changes from true to false 1`] = `
30 |
31 |
34 |
35 | Hello
36 |
37 |
38 |
39 | `;
40 |
41 | exports[` hides if condition changes from true to false 2`] = `
42 |
43 |
46 |
47 | Hello
48 |
49 |
50 |
51 | `;
52 |
53 | exports[` hides if condition is false 1`] = `
54 |
55 |
58 |
59 | Hello
60 |
61 |
62 |
63 | `;
64 |
65 | exports[` shows if condition changes from false to true 1`] = `
66 |
67 |
70 |
71 | Hello
72 |
73 |
74 |
75 | `;
76 |
77 | exports[` shows if condition changes from false to true 2`] = `
78 |
79 |
82 |
83 | Hello
84 |
85 |
86 |
87 | `;
88 |
--------------------------------------------------------------------------------
/src/browser/styles/fira-code.css:
--------------------------------------------------------------------------------
1 | @font-face {
2 | font-family: 'Fira Code';
3 | src: url('fonts/FiraCode/eot/FiraCode-Light.eot');
4 | src: url('fonts/FiraCode/eot/FiraCode-Light.eot') format('embedded-opentype'),
5 | url('fonts/FiraCode/woff2/FiraCode-Light.woff2') format('woff2'),
6 | url('fonts/FiraCode/woff/FiraCode-Light.woff') format('woff'),
7 | url('fonts/FiraCode/ttf/FiraCode-Light.ttf') format('truetype');
8 | font-weight: 300;
9 | font-style: normal;
10 | }
11 |
12 | @font-face {
13 | font-family: 'Fira Code';
14 | src: url('fonts/FiraCode/eot/FiraCode-Regular.eot');
15 | src: url('fonts/FiraCode/eot/FiraCode-Regular.eot')
16 | format('embedded-opentype'),
17 | url('fonts/FiraCode/woff2/FiraCode-Regular.woff2') format('woff2'),
18 | url('fonts/FiraCode/woff/FiraCode-Regular.woff') format('woff'),
19 | url('fonts/FiraCode/ttf/FiraCode-Regular.ttf') format('truetype');
20 | font-weight: 400;
21 | font-style: normal;
22 | }
23 |
24 | @font-face {
25 | font-family: 'Fira Code';
26 | src: url('fonts/FiraCode/eot/FiraCode-Medium.eot');
27 | src: url('fonts/FiraCode/eot/FiraCode-Medium.eot') format('embedded-opentype'),
28 | url('fonts/FiraCode/woff2/FiraCode-Medium.woff2') format('woff2'),
29 | url('fonts/FiraCode/woff/FiraCode-Medium.woff') format('woff'),
30 | url('fonts/FiraCode/ttf/FiraCode-Medium.ttf') format('truetype');
31 | font-weight: 500;
32 | font-style: normal;
33 | }
34 |
35 | @font-face {
36 | font-family: 'Fira Code';
37 | src: url('fonts/FiraCode/eot/FiraCode-Bold.eot');
38 | src: url('fonts/FiraCode/eot/FiraCode-Bold.eot') format('embedded-opentype'),
39 | url('fonts/FiraCode/woff2/FiraCode-Bold.woff2') format('woff2'),
40 | url('fonts/FiraCode/woff/FiraCode-Bold.woff') format('woff'),
41 | url('fonts/FiraCode/ttf/FiraCode-Bold.ttf') format('truetype');
42 | font-weight: 700;
43 | font-style: normal;
44 | }
45 |
--------------------------------------------------------------------------------
/src/shared/services/export-favorites/index.js:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2018-2020 "Graph Foundation"
3 | * Graph Foundation, Inc. [https://graphfoundation.org]
4 | *
5 | * This file is part of ONgDB.
6 | *
7 | * ONgDB is free software: you can redistribute it and/or modify
8 | * it under the terms of the GNU General Public License as published by
9 | * the Free Software Foundation, either version 3 of the License, or
10 | * (at your option) any later version.
11 | *
12 | * This program is distributed in the hope that it will be useful,
13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 | * GNU General Public License for more details.
16 | *
17 | * You should have received a copy of the GNU General Public License
18 | * along with this program. If not, see .
19 | */
20 | /*
21 | * Copyright (c) 2002-2020 "Neo4j,"
22 | * Neo4j Sweden AB [http://neo4j.com]
23 | *
24 | * This file is part of Neo4j.
25 | *
26 | * Neo4j is free software: you can redistribute it and/or modify
27 | * it under the terms of the GNU General Public License as published by
28 | * the Free Software Foundation, either version 3 of the License, or
29 | * (at your option) any later version.
30 | *
31 | * This program is distributed in the hope that it will be useful,
32 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
33 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
34 | * GNU General Public License for more details.
35 | *
36 | * You should have received a copy of the GNU General Public License
37 | * along with this program. If not, see .
38 | */
39 |
40 | export {
41 | exportFavorites,
42 | mapOldFavoritesAndFolders
43 | } from './export-favorites.utils'
44 | export { SLASH, CYPHER_FILE_EXTENSION } from './export-favorites.constants'
45 |
--------------------------------------------------------------------------------
/src/browser/components/Ellipsis.jsx:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2018-2020 "Graph Foundation"
3 | * Graph Foundation, Inc. [https://graphfoundation.org]
4 | *
5 | * This file is part of ONgDB.
6 | *
7 | * ONgDB is free software: you can redistribute it and/or modify
8 | * it under the terms of the GNU General Public License as published by
9 | * the Free Software Foundation, either version 3 of the License, or
10 | * (at your option) any later version.
11 | *
12 | * This program is distributed in the hope that it will be useful,
13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 | * GNU General Public License for more details.
16 | *
17 | * You should have received a copy of the GNU General Public License
18 | * along with this program. If not, see .
19 | */
20 | /*
21 | * Copyright (c) 2002-2020 "Neo4j,"
22 | * Neo4j Sweden AB [http://neo4j.com]
23 | *
24 | * This file is part of Neo4j.
25 | *
26 | * Neo4j is free software: you can redistribute it and/or modify
27 | * it under the terms of the GNU General Public License as published by
28 | * the Free Software Foundation, either version 3 of the License, or
29 | * (at your option) any later version.
30 | *
31 | * This program is distributed in the hope that it will be useful,
32 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
33 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
34 | * GNU General Public License for more details.
35 | *
36 | * You should have received a copy of the GNU General Public License
37 | * along with this program. If not, see .
38 | */
39 |
40 | import styled from 'styled-components'
41 |
42 | const Ellipsis = styled.div`
43 | text-overflow: ellipsis;
44 | overflow: hidden;
45 | white-space: nowrap;
46 | `
47 | export default Ellipsis
48 |
--------------------------------------------------------------------------------
/src/browser/components/buttons/index.test.js:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2018-2020 "Graph Foundation"
3 | * Graph Foundation, Inc. [https://graphfoundation.org]
4 | *
5 | * This file is part of ONgDB.
6 | *
7 | * ONgDB is free software: you can redistribute it and/or modify
8 | * it under the terms of the GNU General Public License as published by
9 | * the Free Software Foundation, either version 3 of the License, or
10 | * (at your option) any later version.
11 | *
12 | * This program is distributed in the hope that it will be useful,
13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 | * GNU General Public License for more details.
16 | *
17 | * You should have received a copy of the GNU General Public License
18 | * along with this program. If not, see .
19 | */
20 | /*
21 | * Copyright (c) 2002-2020 "Neo4j,"
22 | * Neo4j Sweden AB [http://neo4j.com]
23 | *
24 | * This file is part of Neo4j.
25 | *
26 | * Neo4j is free software: you can redistribute it and/or modify
27 | * it under the terms of the GNU General Public License as published by
28 | * the Free Software Foundation, either version 3 of the License, or
29 | * (at your option) any later version.
30 | *
31 | * This program is distributed in the hope that it will be useful,
32 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
33 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
34 | * GNU General Public License for more details.
35 | *
36 | * You should have received a copy of the GNU General Public License
37 | * along with this program. If not, see .
38 | */
39 | import React from 'react'
40 | import { render } from '@testing-library/react'
41 |
42 | import { CloseButton } from './index'
43 |
44 | test('CloseButton renders', () => {
45 | render()
46 | })
47 |
--------------------------------------------------------------------------------
/src/browser/index.test.js:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2018-2020 "Graph Foundation"
3 | * Graph Foundation, Inc. [https://graphfoundation.org]
4 | *
5 | * This file is part of ONgDB.
6 | *
7 | * ONgDB is free software: you can redistribute it and/or modify
8 | * it under the terms of the GNU General Public License as published by
9 | * the Free Software Foundation, either version 3 of the License, or
10 | * (at your option) any later version.
11 | *
12 | * This program is distributed in the hope that it will be useful,
13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 | * GNU General Public License for more details.
16 | *
17 | * You should have received a copy of the GNU General Public License
18 | * along with this program. If not, see .
19 | */
20 | /*
21 | * Copyright (c) 2002-2020 "Neo4j,"
22 | * Neo4j Sweden AB [http://neo4j.com]
23 | *
24 | * This file is part of Neo4j.
25 | *
26 | * Neo4j is free software: you can redistribute it and/or modify
27 | * it under the terms of the GNU General Public License as published by
28 | * the Free Software Foundation, either version 3 of the License, or
29 | * (at your option) any later version.
30 | *
31 | * This program is distributed in the hope that it will be useful,
32 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
33 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
34 | * GNU General Public License for more details.
35 | *
36 | * You should have received a copy of the GNU General Public License
37 | * along with this program. If not, see .
38 | */
39 | import React from 'react'
40 | import { render } from '@testing-library/react'
41 | import AppInit from './AppInit'
42 |
43 | describe('browser entry', () => {
44 | it('renders', () => {
45 | render()
46 | })
47 | })
48 |
--------------------------------------------------------------------------------
/src/browser/modules/Frame/FrameSuccess.jsx:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2018-2020 "Graph Foundation"
3 | * Graph Foundation, Inc. [https://graphfoundation.org]
4 | *
5 | * This file is part of ONgDB.
6 | *
7 | * ONgDB is free software: you can redistribute it and/or modify
8 | * it under the terms of the GNU General Public License as published by
9 | * the Free Software Foundation, either version 3 of the License, or
10 | * (at your option) any later version.
11 | *
12 | * This program is distributed in the hope that it will be useful,
13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 | * GNU General Public License for more details.
16 | *
17 | * You should have received a copy of the GNU General Public License
18 | * along with this program. If not, see .
19 | */
20 | /*
21 | * Copyright (c) 2002-2020 "Neo4j,"
22 | * Neo4j Sweden AB [http://neo4j.com]
23 | *
24 | * This file is part of Neo4j.
25 | *
26 | * Neo4j is free software: you can redistribute it and/or modify
27 | * it under the terms of the GNU General Public License as published by
28 | * the Free Software Foundation, either version 3 of the License, or
29 | * (at your option) any later version.
30 | *
31 | * This program is distributed in the hope that it will be useful,
32 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
33 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
34 | * GNU General Public License for more details.
35 | *
36 | * You should have received a copy of the GNU General Public License
37 | * along with this program. If not, see .
38 | */
39 | import React from 'react'
40 | const FrameSuccess = props => {
41 | if (!props || !props.message) return null
42 | return {props.message}
43 | }
44 |
45 | export default FrameSuccess
46 |
--------------------------------------------------------------------------------
/src/shared/services/intercom.js:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2018-2020 "Graph Foundation"
3 | * Graph Foundation, Inc. [https://graphfoundation.org]
4 | *
5 | * This file is part of ONgDB.
6 | *
7 | * ONgDB is free software: you can redistribute it and/or modify
8 | * it under the terms of the GNU General Public License as published by
9 | * the Free Software Foundation, either version 3 of the License, or
10 | * (at your option) any later version.
11 | *
12 | * This program is distributed in the hope that it will be useful,
13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 | * GNU General Public License for more details.
16 | *
17 | * You should have received a copy of the GNU General Public License
18 | * along with this program. If not, see .
19 | */
20 | /*
21 | * Copyright (c) 2002-2020 "Neo4j,"
22 | * Neo4j Sweden AB [http://neo4j.com]
23 | *
24 | * This file is part of Neo4j.
25 | *
26 | * Neo4j is free software: you can redistribute it and/or modify
27 | * it under the terms of the GNU General Public License as published by
28 | * the Free Software Foundation, either version 3 of the License, or
29 | * (at your option) any later version.
30 | *
31 | * This program is distributed in the hope that it will be useful,
32 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
33 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
34 | * GNU General Public License for more details.
35 | *
36 | * You should have received a copy of the GNU General Public License
37 | * along with this program. If not, see .
38 | */
39 |
40 | import { canUseDOM } from 'services/utils'
41 |
42 | export const hasIntercom = () => canUseDOM() && window.Intercom
43 |
44 | export default function api(...args) {
45 | if (hasIntercom()) window.Intercom.apply(null, args)
46 | }
47 |
--------------------------------------------------------------------------------
/src/browser/styles/constants.js:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2018-2020 "Graph Foundation"
3 | * Graph Foundation, Inc. [https://graphfoundation.org]
4 | *
5 | * This file is part of ONgDB.
6 | *
7 | * ONgDB is free software: you can redistribute it and/or modify
8 | * it under the terms of the GNU General Public License as published by
9 | * the Free Software Foundation, either version 3 of the License, or
10 | * (at your option) any later version.
11 | *
12 | * This program is distributed in the hope that it will be useful,
13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 | * GNU General Public License for more details.
16 | *
17 | * You should have received a copy of the GNU General Public License
18 | * along with this program. If not, see .
19 | */
20 | /*
21 | * Copyright (c) 2002-2020 "Neo4j,"
22 | * Neo4j Sweden AB [http://neo4j.com]
23 | *
24 | * This file is part of Neo4j.
25 | *
26 | * Neo4j is free software: you can redistribute it and/or modify
27 | * it under the terms of the GNU General Public License as published by
28 | * the Free Software Foundation, either version 3 of the License, or
29 | * (at your option) any later version.
30 | *
31 | * This program is distributed in the hope that it will be useful,
32 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
33 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
34 | * GNU General Public License for more details.
35 | *
36 | * You should have received a copy of the GNU General Public License
37 | * along with this program. If not, see .
38 | */
39 |
40 | export const font = {}
41 |
42 | export const dim = {
43 | // Editor bar
44 | editorbarHeight: 71,
45 | // Frame
46 | frameBodyHeight: 550,
47 | frameTitlebarHeight: 39,
48 | frameStatusbarHeight: 39,
49 | frameBodyPadding: 20
50 | }
51 |
--------------------------------------------------------------------------------
/src/browser/modules/ClickToCode/styled.jsx:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2018-2020 "Graph Foundation"
3 | * Graph Foundation, Inc. [https://graphfoundation.org]
4 | *
5 | * This file is part of ONgDB.
6 | *
7 | * ONgDB is free software: you can redistribute it and/or modify
8 | * it under the terms of the GNU General Public License as published by
9 | * the Free Software Foundation, either version 3 of the License, or
10 | * (at your option) any later version.
11 | *
12 | * This program is distributed in the hope that it will be useful,
13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 | * GNU General Public License for more details.
16 | *
17 | * You should have received a copy of the GNU General Public License
18 | * along with this program. If not, see .
19 | */
20 | /*
21 | * Copyright (c) 2002-2020 "Neo4j,"
22 | * Neo4j Sweden AB [http://neo4j.com]
23 | *
24 | * This file is part of Neo4j.
25 | *
26 | * Neo4j is free software: you can redistribute it and/or modify
27 | * it under the terms of the GNU General Public License as published by
28 | * the Free Software Foundation, either version 3 of the License, or
29 | * (at your option) any later version.
30 | *
31 | * This program is distributed in the hope that it will be useful,
32 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
33 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
34 | * GNU General Public License for more details.
35 | *
36 | * You should have received a copy of the GNU General Public License
37 | * along with this program. If not, see .
38 | */
39 | import styled from 'styled-components'
40 |
41 | export const StyledCodeBlock = styled.code`
42 | background-color: black;
43 | color: white;
44 | cursor: pointer;
45 | border: none;
46 | border-radius: 4px;
47 | padding: 2px 4px;
48 | `
49 |
--------------------------------------------------------------------------------
/src/browser/components/Text.jsx:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2018-2020 "Graph Foundation"
3 | * Graph Foundation, Inc. [https://graphfoundation.org]
4 | *
5 | * This file is part of ONgDB.
6 | *
7 | * ONgDB is free software: you can redistribute it and/or modify
8 | * it under the terms of the GNU General Public License as published by
9 | * the Free Software Foundation, either version 3 of the License, or
10 | * (at your option) any later version.
11 | *
12 | * This program is distributed in the hope that it will be useful,
13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 | * GNU General Public License for more details.
16 | *
17 | * You should have received a copy of the GNU General Public License
18 | * along with this program. If not, see .
19 | */
20 | /*
21 | * Copyright (c) 2002-2020 "Neo4j,"
22 | * Neo4j Sweden AB [http://neo4j.com]
23 | *
24 | * This file is part of Neo4j.
25 | *
26 | * Neo4j is free software: you can redistribute it and/or modify
27 | * it under the terms of the GNU General Public License as published by
28 | * the Free Software Foundation, either version 3 of the License, or
29 | * (at your option) any later version.
30 | *
31 | * This program is distributed in the hope that it will be useful,
32 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
33 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
34 | * GNU General Public License for more details.
35 | *
36 | * You should have received a copy of the GNU General Public License
37 | * along with this program. If not, see .
38 | */
39 |
40 | import styled from 'styled-components'
41 |
42 | export const Lead = styled.p`
43 | font-weight: 300;
44 | font-size: 15px;
45 | line-height: 22px;
46 | font-family: ${props => props.theme.primaryFontFamily};
47 | color: ${props => props.theme.headerText};
48 | `
49 |
--------------------------------------------------------------------------------
/test_utils/setupTests.js:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2018-2020 "Graph Foundation"
3 | * Graph Foundation, Inc. [https://graphfoundation.org]
4 | *
5 | * This file is part of ONgDB.
6 | *
7 | * ONgDB is free software: you can redistribute it and/or modify
8 | * it under the terms of the GNU General Public License as published by
9 | * the Free Software Foundation, either version 3 of the License, or
10 | * (at your option) any later version.
11 | *
12 | * This program is distributed in the hope that it will be useful,
13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 | * GNU General Public License for more details.
16 | *
17 | * You should have received a copy of the GNU General Public License
18 | * along with this program. If not, see .
19 | */
20 | /*
21 | * Copyright (c) 2002-2020 "Neo4j,"
22 | * Neo4j Sweden AB [http://neo4j.com]
23 | *
24 | * This file is part of Neo4j.
25 | *
26 | * Neo4j is free software: you can redistribute it and/or modify
27 | * it under the terms of the GNU General Public License as published by
28 | * the Free Software Foundation, either version 3 of the License, or
29 | * (at your option) any later version.
30 | *
31 | * This program is distributed in the hope that it will be useful,
32 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
33 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
34 | * GNU General Public License for more details.
35 | *
36 | * You should have received a copy of the GNU General Public License
37 | * along with this program. If not, see .
38 | */
39 |
40 | // polyfill for jsdom (for tests only)
41 | // tests with codemirror breaks without it
42 | global.document.createRange = () => {
43 | return {
44 | setEnd: () => {},
45 | setStart: () => {},
46 | getBoundingClientRect: () => {},
47 | getClientRects: () => []
48 | }
49 | }
50 |
--------------------------------------------------------------------------------
/src/browser/components/buttons/__snapshots__/ConfirmationButton.test.js.snap:
--------------------------------------------------------------------------------
1 | // Jest Snapshot v1, https://goo.gl/fbAQLP
2 |
3 | exports[`ConfirmationButton renders changes state on clicks and finally calls the onConfirmed prop 1`] = `
4 |
5 |
13 |
14 | `;
15 |
16 | exports[`ConfirmationButton renders changes state on clicks and finally calls the onConfirmed prop 2`] = `
17 |
18 |
19 |
27 |
35 |
36 |
37 | `;
38 |
39 | exports[`ConfirmationButton renders changes state on clicks and finally calls the onConfirmed prop 3`] = `
40 |
41 |
49 |
50 | `;
51 |
52 | exports[`ConfirmationButton renders changes state on clicks and finally calls the onConfirmed prop 4`] = `
53 |
54 |
62 |
63 | `;
64 |
--------------------------------------------------------------------------------
/src/browser/modules/D3Visualization/lib/visualization/utils/arrays.js:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2018-2020 "Graph Foundation"
3 | * Graph Foundation, Inc. [https://graphfoundation.org]
4 | *
5 | * This file is part of ONgDB.
6 | *
7 | * ONgDB is free software: you can redistribute it and/or modify
8 | * it under the terms of the GNU General Public License as published by
9 | * the Free Software Foundation, either version 3 of the License, or
10 | * (at your option) any later version.
11 | *
12 | * This program is distributed in the hope that it will be useful,
13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 | * GNU General Public License for more details.
16 | *
17 | * You should have received a copy of the GNU General Public License
18 | * along with this program. If not, see .
19 | */
20 | /*
21 | * Copyright (c) 2002-2020 "Neo4j,"
22 | * Neo4j Sweden AB [http://neo4j.com]
23 | *
24 | * This file is part of Neo4j.
25 | *
26 | * Neo4j is free software: you can redistribute it and/or modify
27 | * it under the terms of the GNU General Public License as published by
28 | * the Free Software Foundation, either version 3 of the License, or
29 | * (at your option) any later version.
30 | *
31 | * This program is distributed in the hope that it will be useful,
32 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
33 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
34 | * GNU General Public License for more details.
35 | *
36 | * You should have received a copy of the GNU General Public License
37 | * along with this program. If not, see .
38 | */
39 |
40 | export default function cloneArray(original) {
41 | const clone = new Array(original.length)
42 | for (let idx = 0; idx < original.length; idx++) {
43 | const node = original[idx]
44 | clone[idx] = node
45 | }
46 | return clone
47 | }
48 |
--------------------------------------------------------------------------------
/src/browser/modules/Frame/FrameSidebar.jsx:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2018-2020 "Graph Foundation"
3 | * Graph Foundation, Inc. [https://graphfoundation.org]
4 | *
5 | * This file is part of ONgDB.
6 | *
7 | * ONgDB is free software: you can redistribute it and/or modify
8 | * it under the terms of the GNU General Public License as published by
9 | * the Free Software Foundation, either version 3 of the License, or
10 | * (at your option) any later version.
11 | *
12 | * This program is distributed in the hope that it will be useful,
13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 | * GNU General Public License for more details.
16 | *
17 | * You should have received a copy of the GNU General Public License
18 | * along with this program. If not, see .
19 | */
20 | /*
21 | * Copyright (c) 2002-2020 "Neo4j,"
22 | * Neo4j Sweden AB [http://neo4j.com]
23 | *
24 | * This file is part of Neo4j.
25 | *
26 | * Neo4j is free software: you can redistribute it and/or modify
27 | * it under the terms of the GNU General Public License as published by
28 | * the Free Software Foundation, either version 3 of the License, or
29 | * (at your option) any later version.
30 | *
31 | * This program is distributed in the hope that it will be useful,
32 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
33 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
34 | * GNU General Public License for more details.
35 | *
36 | * You should have received a copy of the GNU General Public License
37 | * along with this program. If not, see .
38 | */
39 | import React from 'react'
40 | import { StyledFrameSidebar } from './styled'
41 |
42 | const FrameSidebar = props => {
43 | if (!props || !props.children) return null
44 | return {props.children}
45 | }
46 |
47 | export default FrameSidebar
48 |
--------------------------------------------------------------------------------
/src/shared/modules/stream/frameViewTypes.js:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2018-2020 "Graph Foundation"
3 | * Graph Foundation, Inc. [https://graphfoundation.org]
4 | *
5 | * This file is part of ONgDB.
6 | *
7 | * ONgDB is free software: you can redistribute it and/or modify
8 | * it under the terms of the GNU General Public License as published by
9 | * the Free Software Foundation, either version 3 of the License, or
10 | * (at your option) any later version.
11 | *
12 | * This program is distributed in the hope that it will be useful,
13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 | * GNU General Public License for more details.
16 | *
17 | * You should have received a copy of the GNU General Public License
18 | * along with this program. If not, see .
19 | */
20 | /*
21 | * Copyright (c) 2002-2020 "Neo4j,"
22 | * Neo4j Sweden AB [http://neo4j.com]
23 | *
24 | * This file is part of Neo4j.
25 | *
26 | * Neo4j is free software: you can redistribute it and/or modify
27 | * it under the terms of the GNU General Public License as published by
28 | * the Free Software Foundation, either version 3 of the License, or
29 | * (at your option) any later version.
30 | *
31 | * This program is distributed in the hope that it will be useful,
32 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
33 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
34 | * GNU General Public License for more details.
35 | *
36 | * You should have received a copy of the GNU General Public License
37 | * along with this program. If not, see .
38 | */
39 |
40 | export const VISUALIZATION = 'VISUALIZATION'
41 | export const PLAN = 'PLAN'
42 | export const WARNINGS = 'WARNINGS'
43 | export const ERRORS = 'ERRORS'
44 | export const TABLE = 'TABLE'
45 | export const CODE = 'CODE'
46 | export const ERROR = 'ERROR'
47 | export const TEXT = 'TEXT'
48 |
--------------------------------------------------------------------------------
/src/browser/hooks/useTimer.js:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2018-2020 "Graph Foundation"
3 | * Graph Foundation, Inc. [https://graphfoundation.org]
4 | *
5 | * This file is part of ONgDB.
6 | *
7 | * ONgDB is free software: you can redistribute it and/or modify
8 | * it under the terms of the GNU General Public License as published by
9 | * the Free Software Foundation, either version 3 of the License, or
10 | * (at your option) any later version.
11 | *
12 | * This program is distributed in the hope that it will be useful,
13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 | * GNU General Public License for more details.
16 | *
17 | * You should have received a copy of the GNU General Public License
18 | * along with this program. If not, see .
19 | */
20 | /*
21 | * Copyright (c) 2002-2020 "Neo4j,"
22 | * Neo4j Sweden AB [http://neo4j.com]
23 | *
24 | * This file is part of Neo4j.
25 | *
26 | * Neo4j is free software: you can redistribute it and/or modify
27 | * it under the terms of the GNU General Public License as published by
28 | * the Free Software Foundation, either version 3 of the License, or
29 | * (at your option) any later version.
30 | *
31 | * This program is distributed in the hope that it will be useful,
32 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
33 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
34 | * GNU General Public License for more details.
35 | *
36 | * You should have received a copy of the GNU General Public License
37 | * along with this program. If not, see .
38 | */
39 |
40 | import { useState, useEffect } from 'react'
41 |
42 | export default function useTimer(ms) {
43 | const [didPling, pling] = useState(false)
44 | useEffect(() => {
45 | const timer = setTimeout(() => pling(true), ms)
46 | return () => clearTimeout(timer)
47 | }, [])
48 | return didPling
49 | }
50 |
--------------------------------------------------------------------------------
/src/shared/services/duckUtils.js:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2018-2020 "Graph Foundation"
3 | * Graph Foundation, Inc. [https://graphfoundation.org]
4 | *
5 | * This file is part of ONgDB.
6 | *
7 | * ONgDB is free software: you can redistribute it and/or modify
8 | * it under the terms of the GNU General Public License as published by
9 | * the Free Software Foundation, either version 3 of the License, or
10 | * (at your option) any later version.
11 | *
12 | * This program is distributed in the hope that it will be useful,
13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 | * GNU General Public License for more details.
16 | *
17 | * You should have received a copy of the GNU General Public License
18 | * along with this program. If not, see .
19 | */
20 | /*
21 | * Copyright (c) 2002-2020 "Neo4j,"
22 | * Neo4j Sweden AB [http://neo4j.com]
23 | *
24 | * This file is part of Neo4j.
25 | *
26 | * Neo4j is free software: you can redistribute it and/or modify
27 | * it under the terms of the GNU General Public License as published by
28 | * the Free Software Foundation, either version 3 of the License, or
29 | * (at your option) any later version.
30 | *
31 | * This program is distributed in the hope that it will be useful,
32 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
33 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
34 | * GNU General Public License for more details.
35 | *
36 | * You should have received a copy of the GNU General Public License
37 | * along with this program. If not, see .
38 | */
39 |
40 | export const hydrate = (initialState, state) => {
41 | if (!state) return state
42 | return state.hydrated ? state : { ...initialState, ...state, hydrated: true }
43 | }
44 |
45 | export const dehydrate = state => {
46 | if (state) {
47 | delete state.hydrated
48 | }
49 | return state
50 | }
51 |
--------------------------------------------------------------------------------
/src/browser/modules/Stream/HistoryRow.jsx:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2018-2020 "Graph Foundation"
3 | * Graph Foundation, Inc. [https://graphfoundation.org]
4 | *
5 | * This file is part of ONgDB.
6 | *
7 | * ONgDB is free software: you can redistribute it and/or modify
8 | * it under the terms of the GNU General Public License as published by
9 | * the Free Software Foundation, either version 3 of the License, or
10 | * (at your option) any later version.
11 | *
12 | * This program is distributed in the hope that it will be useful,
13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 | * GNU General Public License for more details.
16 | *
17 | * You should have received a copy of the GNU General Public License
18 | * along with this program. If not, see .
19 | */
20 | /*
21 | * Copyright (c) 2002-2020 "Neo4j,"
22 | * Neo4j Sweden AB [http://neo4j.com]
23 | *
24 | * This file is part of Neo4j.
25 | *
26 | * Neo4j is free software: you can redistribute it and/or modify
27 | * it under the terms of the GNU General Public License as published by
28 | * the Free Software Foundation, either version 3 of the License, or
29 | * (at your option) any later version.
30 | *
31 | * This program is distributed in the hope that it will be useful,
32 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
33 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
34 | * GNU General Public License for more details.
35 | *
36 | * You should have received a copy of the GNU General Public License
37 | * along with this program. If not, see .
38 | */
39 | import React from 'react'
40 | import { StyledHistoryRow } from './styled'
41 |
42 | const HistoryRow = ({ entry, handleEntryClick }) => {
43 | return (
44 | handleEntryClick(entry)}>
45 | {entry}
46 |
47 | )
48 | }
49 | export default HistoryRow
50 |
--------------------------------------------------------------------------------
/src/shared/services/santize.utils.js:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2018-2020 "Graph Foundation"
3 | * Graph Foundation, Inc. [https://graphfoundation.org]
4 | *
5 | * This file is part of ONgDB.
6 | *
7 | * ONgDB is free software: you can redistribute it and/or modify
8 | * it under the terms of the GNU General Public License as published by
9 | * the Free Software Foundation, either version 3 of the License, or
10 | * (at your option) any later version.
11 | *
12 | * This program is distributed in the hope that it will be useful,
13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 | * GNU General Public License for more details.
16 | *
17 | * You should have received a copy of the GNU General Public License
18 | * along with this program. If not, see .
19 | */
20 | /*
21 | * Copyright (c) 2002-2020 "Neo4j,"
22 | * Neo4j Sweden AB [http://neo4j.com]
23 | *
24 | * This file is part of Neo4j.
25 | *
26 | * Neo4j is free software: you can redistribute it and/or modify
27 | * it under the terms of the GNU General Public License as published by
28 | * the Free Software Foundation, either version 3 of the License, or
29 | * (at your option) any later version.
30 | *
31 | * This program is distributed in the hope that it will be useful,
32 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
33 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
34 | * GNU General Public License for more details.
35 | *
36 | * You should have received a copy of the GNU General Public License
37 | * along with this program. If not, see .
38 | */
39 | import sanitizeHTML from 'sanitize-html'
40 | export const PRINT_ENTITIES = {
41 | allowedTags: [],
42 | allowedAttributes: { '*': ['*'] },
43 | disallowedTagsMode: 'escape'
44 | }
45 |
46 | export const sanitize = config => str => sanitizeHTML(str, config)
47 | export const HTMLEntities = sanitize(PRINT_ENTITIES)
48 |
--------------------------------------------------------------------------------
/src/shared/modules/cypher/queriesProcedureHelper.js:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2018-2020 "Graph Foundation"
3 | * Graph Foundation, Inc. [https://graphfoundation.org]
4 | *
5 | * This file is part of ONgDB.
6 | *
7 | * ONgDB is free software: you can redistribute it and/or modify
8 | * it under the terms of the GNU General Public License as published by
9 | * the Free Software Foundation, either version 3 of the License, or
10 | * (at your option) any later version.
11 | *
12 | * This program is distributed in the hope that it will be useful,
13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 | * GNU General Public License for more details.
16 | *
17 | * You should have received a copy of the GNU General Public License
18 | * along with this program. If not, see .
19 | */
20 | /*
21 | * Copyright (c) 2002-2020 "Neo4j,"
22 | * Neo4j Sweden AB [http://neo4j.com]
23 | *
24 | * This file is part of Neo4j.
25 | *
26 | * Neo4j is free software: you can redistribute it and/or modify
27 | * it under the terms of the GNU General Public License as published by
28 | * the Free Software Foundation, either version 3 of the License, or
29 | * (at your option) any later version.
30 | *
31 | * This program is distributed in the hope that it will be useful,
32 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
33 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
34 | * GNU General Public License for more details.
35 | *
36 | * You should have received a copy of the GNU General Public License
37 | * along with this program. If not, see .
38 | */
39 |
40 | export const getCausalClusterAddresses =
41 | 'CALL dbms.cluster.overview YIELD addresses'
42 |
43 | export function listQueriesProcedure() {
44 | return 'CALL dbms.listQueries'
45 | }
46 |
47 | export function killQueriesProcedure(queryIdList) {
48 | return `CALL dbms.killQueries([${queryIdList.map(q => `"${q}"`).join()}])`
49 | }
50 |
--------------------------------------------------------------------------------
/src/browser/modules/Stream/CypherFrame/relatable-view.styled.js:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2002-2019 "Neo4j,"
3 | * Neo4j Sweden AB [http://neo4j.com]
4 | * This file is part of Neo4j.
5 | * Neo4j is free software: you can redistribute it and/or modify
6 | * it under the terms of the GNU General Public License as published by
7 | * the Free Software Foundation, either version 3 of the License, or
8 | * (at your option) any later version.
9 | * This program is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | * GNU General Public License for more details.
13 | * You should have received a copy of the GNU General Public License
14 | * along with this program. If not, see .
15 | *
16 | */
17 |
18 | import styled from 'styled-components'
19 |
20 | export const RelatableStyleWrapper = styled.div`
21 | width: 100%;
22 | /* semantic ui specificity... */
23 | .relatable__table-row,
24 | .relatable__table-row.relatable__table-header-row
25 | .relatable__table-header-cell {
26 | background-color: ${props => props.theme.secondaryBackground};
27 | color: ${props => props.theme.secondaryText};
28 | }
29 | .relatable__table-row-number {
30 | color: ${props => props.theme.preText};
31 | background-color: ${props => props.theme.preBackground};
32 | }
33 | .relatable__table-header-row .relatable__table-cell {
34 | border-bottom: ${props => props.theme.inFrameBorder};
35 | }
36 | .relatable__table-body-row .relatable__table-cell {
37 | border-top: ${props => props.theme.inFrameBorder};
38 | }
39 | `
40 |
41 | export const StyledJsonPre = styled.pre`
42 | background-color: ${props => props.theme.preBackground};
43 | -webkit-border-radius: 5px;
44 | border-radius: 5px;
45 | margin: 20px 10px;
46 | border-bottom: none;
47 | color: ${props => props.theme.preText};
48 | line-height: 26px;
49 | padding: 2px 10px;
50 | max-width: 320px;
51 | white-space: pre-wrap;
52 | `
53 |
--------------------------------------------------------------------------------
/src/browser/modules/D3Visualization/lib/visualization/components/renderer.js:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2018-2020 "Graph Foundation"
3 | * Graph Foundation, Inc. [https://graphfoundation.org]
4 | *
5 | * This file is part of ONgDB.
6 | *
7 | * ONgDB is free software: you can redistribute it and/or modify
8 | * it under the terms of the GNU General Public License as published by
9 | * the Free Software Foundation, either version 3 of the License, or
10 | * (at your option) any later version.
11 | *
12 | * This program is distributed in the hope that it will be useful,
13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 | * GNU General Public License for more details.
16 | *
17 | * You should have received a copy of the GNU General Public License
18 | * along with this program. If not, see .
19 | */
20 | /*
21 | * Copyright (c) 2002-2020 "Neo4j,"
22 | * Neo4j Sweden AB [http://neo4j.com]
23 | *
24 | * This file is part of Neo4j.
25 | *
26 | * Neo4j is free software: you can redistribute it and/or modify
27 | * it under the terms of the GNU General Public License as published by
28 | * the Free Software Foundation, either version 3 of the License, or
29 | * (at your option) any later version.
30 | *
31 | * This program is distributed in the hope that it will be useful,
32 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
33 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
34 | * GNU General Public License for more details.
35 | *
36 | * You should have received a copy of the GNU General Public License
37 | * along with this program. If not, see .
38 | */
39 | export default class Renderer {
40 | onGraphChange = null
41 | onTick = null
42 | constructor(opts) {
43 | Object.assign(this, opts == null ? {} : opts)
44 | if (this.onGraphChange === null) {
45 | this.onGraphChange = function() {}
46 | }
47 | if (this.onTick === null) {
48 | this.onTick = function() {}
49 | }
50 | }
51 | }
52 |
--------------------------------------------------------------------------------
/src/browser/components/drawer/index.js:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2018-2020 "Graph Foundation"
3 | * Graph Foundation, Inc. [https://graphfoundation.org]
4 | *
5 | * This file is part of ONgDB.
6 | *
7 | * ONgDB is free software: you can redistribute it and/or modify
8 | * it under the terms of the GNU General Public License as published by
9 | * the Free Software Foundation, either version 3 of the License, or
10 | * (at your option) any later version.
11 | *
12 | * This program is distributed in the hope that it will be useful,
13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 | * GNU General Public License for more details.
16 | *
17 | * You should have received a copy of the GNU General Public License
18 | * along with this program. If not, see .
19 | */
20 | /*
21 | * Copyright (c) 2002-2020 "Neo4j,"
22 | * Neo4j Sweden AB [http://neo4j.com]
23 | *
24 | * This file is part of Neo4j.
25 | *
26 | * Neo4j is free software: you can redistribute it and/or modify
27 | * it under the terms of the GNU General Public License as published by
28 | * the Free Software Foundation, either version 3 of the License, or
29 | * (at your option) any later version.
30 | *
31 | * This program is distributed in the hope that it will be useful,
32 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
33 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
34 | * GNU General Public License for more details.
35 | *
36 | * You should have received a copy of the GNU General Public License
37 | * along with this program. If not, see .
38 | */
39 |
40 | import {
41 | Drawer,
42 | DrawerBody,
43 | DrawerHeader,
44 | DrawerSubHeader,
45 | DrawerSection,
46 | DrawerSectionBody,
47 | DrawerToppedHeader,
48 | DrawerFooter
49 | } from './Drawer'
50 |
51 | export {
52 | Drawer,
53 | DrawerBody,
54 | DrawerHeader,
55 | DrawerSubHeader,
56 | DrawerSection,
57 | DrawerSectionBody,
58 | DrawerToppedHeader,
59 | DrawerFooter
60 | }
61 |
--------------------------------------------------------------------------------
/src/shared/modules/dbMeta/__snapshots__/dbMetaDuck.test.js.snap:
--------------------------------------------------------------------------------
1 | // Jest Snapshot v1, https://goo.gl/fbAQLP
2 |
3 | exports[`hydrating state should merge inital state and state on load 1`] = `
4 | Object {
5 | "databases": Array [],
6 | "foo": "bar",
7 | "functions": Array [],
8 | "labels": Array [],
9 | "nodes": 0,
10 | "procedures": Array [],
11 | "properties": Array [],
12 | "relationshipTypes": Array [],
13 | "relationships": 0,
14 | "role": null,
15 | "server": Object {
16 | "edition": null,
17 | "storeSize": null,
18 | "version": null,
19 | },
20 | "settings": Object {
21 | "browser.allow_outgoing_connections": false,
22 | "browser.remote_content_hostname_whitelist": "cdn.graphfoundation.org, localhost",
23 | "browser.retain_connection_credentials": true,
24 | },
25 | }
26 | `;
27 |
28 | exports[`updating metadata can CLEAR to reset state 1`] = `
29 | Object {
30 | "databases": Array [],
31 | "functions": Array [],
32 | "labels": Array [],
33 | "nodes": 0,
34 | "procedures": Array [],
35 | "properties": Array [],
36 | "relationshipTypes": Array [],
37 | "relationships": 0,
38 | "role": null,
39 | "server": Object {
40 | "edition": null,
41 | "storeSize": null,
42 | "version": null,
43 | },
44 | "settings": Object {
45 | "browser.allow_outgoing_connections": false,
46 | "browser.remote_content_hostname_whitelist": "cdn.graphfoundation.org, localhost",
47 | "browser.retain_connection_credentials": true,
48 | },
49 | }
50 | `;
51 |
52 | exports[`updating metadata can update meta values with UPDATE 1`] = `
53 | Object {
54 | "myKey": "yo",
55 | "noKey": true,
56 | "secondKey": true,
57 | }
58 | `;
59 |
60 | exports[`updating metadata can update server info 1`] = `
61 | Object {
62 | "server": Object {
63 | "edition": "enterprise",
64 | "storeId": "xxxx",
65 | "version": "3.2.0-RC2",
66 | },
67 | "shouldKeep": true,
68 | }
69 | `;
70 |
71 | exports[`updating metadata can update server settings 1`] = `
72 | Object {
73 | "settings": Object {
74 | "browser.test": 1,
75 | },
76 | "shouldKeep": true,
77 | }
78 | `;
79 |
--------------------------------------------------------------------------------
/src/shared/modules/udc/udcHelpers.js:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2018-2020 "Graph Foundation"
3 | * Graph Foundation, Inc. [https://graphfoundation.org]
4 | *
5 | * This file is part of ONgDB.
6 | *
7 | * ONgDB is free software: you can redistribute it and/or modify
8 | * it under the terms of the GNU General Public License as published by
9 | * the Free Software Foundation, either version 3 of the License, or
10 | * (at your option) any later version.
11 | *
12 | * This program is distributed in the hope that it will be useful,
13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 | * GNU General Public License for more details.
16 | *
17 | * You should have received a copy of the GNU General Public License
18 | * along with this program. If not, see .
19 | */
20 | /*
21 | * Copyright (c) 2002-2020 "Neo4j,"
22 | * Neo4j Sweden AB [http://neo4j.com]
23 | *
24 | * This file is part of Neo4j.
25 | *
26 | * Neo4j is free software: you can redistribute it and/or modify
27 | * it under the terms of the GNU General Public License as published by
28 | * the Free Software Foundation, either version 3 of the License, or
29 | * (at your option) any later version.
30 | *
31 | * This program is distributed in the hope that it will be useful,
32 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
33 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
34 | * GNU General Public License for more details.
35 | *
36 | * You should have received a copy of the GNU General Public License
37 | * along with this program. If not, see .
38 | */
39 |
40 | export const shouldTriggerConnectEvent = (state, todayDate = null) => {
41 | const pingDate = new Date(state.pingTime || 0)
42 | const localTodayDate = todayDate || getTodayDate()
43 | if (pingDate < localTodayDate) return true
44 | return false
45 | }
46 |
47 | export const getTodayDate = () => {
48 | const today = new Date()
49 | return new Date(today.getFullYear(), today.getMonth(), today.getDate())
50 | }
51 |
--------------------------------------------------------------------------------
/src/browser/modules/Stream/PreFrame.jsx:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2018-2020 "Graph Foundation"
3 | * Graph Foundation, Inc. [https://graphfoundation.org]
4 | *
5 | * This file is part of ONgDB.
6 | *
7 | * ONgDB is free software: you can redistribute it and/or modify
8 | * it under the terms of the GNU General Public License as published by
9 | * the Free Software Foundation, either version 3 of the License, or
10 | * (at your option) any later version.
11 | *
12 | * This program is distributed in the hope that it will be useful,
13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 | * GNU General Public License for more details.
16 | *
17 | * You should have received a copy of the GNU General Public License
18 | * along with this program. If not, see .
19 | */
20 | /*
21 | * Copyright (c) 2002-2020 "Neo4j,"
22 | * Neo4j Sweden AB [http://neo4j.com]
23 | *
24 | * This file is part of Neo4j.
25 | *
26 | * Neo4j is free software: you can redistribute it and/or modify
27 | * it under the terms of the GNU General Public License as published by
28 | * the Free Software Foundation, either version 3 of the License, or
29 | * (at your option) any later version.
30 | *
31 | * This program is distributed in the hope that it will be useful,
32 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
33 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
34 | * GNU General Public License for more details.
35 | *
36 | * You should have received a copy of the GNU General Public License
37 | * along with this program. If not, see .
38 | */
39 | import React from 'react'
40 | import FrameTemplate from '../Frame/FrameTemplate'
41 | import { PaddedDiv } from './styled'
42 |
43 | const PreFrame = ({ frame }) => {
44 | return (
45 |
49 |
{frame.result || frame.contents}
50 |
51 | }
52 | />
53 | )
54 | }
55 | export default PreFrame
56 |
--------------------------------------------------------------------------------
/src/browser/modules/D3Visualization/lib/visualization/d3-appendSvg.js:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2018-2020 "Graph Foundation"
3 | * Graph Foundation, Inc. [https://graphfoundation.org]
4 | *
5 | * This file is part of ONgDB.
6 | *
7 | * ONgDB is free software: you can redistribute it and/or modify
8 | * it under the terms of the GNU General Public License as published by
9 | * the Free Software Foundation, either version 3 of the License, or
10 | * (at your option) any later version.
11 | *
12 | * This program is distributed in the hope that it will be useful,
13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 | * GNU General Public License for more details.
16 | *
17 | * You should have received a copy of the GNU General Public License
18 | * along with this program. If not, see .
19 | */
20 | /*
21 | * Copyright (c) 2002-2020 "Neo4j,"
22 | * Neo4j Sweden AB [http://neo4j.com]
23 | *
24 | * This file is part of Neo4j.
25 | *
26 | * Neo4j is free software: you can redistribute it and/or modify
27 | * it under the terms of the GNU General Public License as published by
28 | * the Free Software Foundation, either version 3 of the License, or
29 | * (at your option) any later version.
30 | *
31 | * This program is distributed in the hope that it will be useful,
32 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
33 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
34 | * GNU General Public License for more details.
35 | *
36 | * You should have received a copy of the GNU General Public License
37 | * along with this program. If not, see .
38 | */
39 |
40 | /* global DOMParser */
41 |
42 | import d3 from 'd3'
43 |
44 | d3.selection.enter.prototype.appendSVG = function(SVGString) {
45 | return this.select(function() {
46 | return this.appendChild(
47 | document.importNode(
48 | new DOMParser().parseFromString(SVGString, 'application/xml')
49 | .documentElement.firstChild,
50 | true
51 | )
52 | )
53 | })
54 | }
55 |
--------------------------------------------------------------------------------
/src/browser/components/EditionView.jsx:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2018-2020 "Graph Foundation"
3 | * Graph Foundation, Inc. [https://graphfoundation.org]
4 | *
5 | * This file is part of ONgDB.
6 | *
7 | * ONgDB is free software: you can redistribute it and/or modify
8 | * it under the terms of the GNU General Public License as published by
9 | * the Free Software Foundation, either version 3 of the License, or
10 | * (at your option) any later version.
11 | *
12 | * This program is distributed in the hope that it will be useful,
13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 | * GNU General Public License for more details.
16 | *
17 | * You should have received a copy of the GNU General Public License
18 | * along with this program. If not, see .
19 | */
20 | /*
21 | * Copyright (c) 2002-2020 "Neo4j,"
22 | * Neo4j Sweden AB [http://neo4j.com]
23 | *
24 | * This file is part of Neo4j.
25 | *
26 | * Neo4j is free software: you can redistribute it and/or modify
27 | * it under the terms of the GNU General Public License as published by
28 | * the Free Software Foundation, either version 3 of the License, or
29 | * (at your option) any later version.
30 | *
31 | * This program is distributed in the hope that it will be useful,
32 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
33 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
34 | * GNU General Public License for more details.
35 | *
36 | * You should have received a copy of the GNU General Public License
37 | * along with this program. If not, see .
38 | */
39 | import React from 'react'
40 | import { Code } from '../modules/Stream/Queries/styled'
41 |
42 | export const EnterpriseOnlyFrame = ({ command }) => {
43 | return (
44 |
45 |
46 | Unable to display {command} because the procedures required
47 | to run this frame are missing. These procedures are usually found in
48 | ONgDB Enterprise Edition.
49 |
50 |
51 | )
52 | }
53 |
--------------------------------------------------------------------------------
/src/browser/modules/Stream/Extras/SnakeFrame/Snake.test.js:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2018-2020 "Graph Foundation"
3 | * Graph Foundation, Inc. [https://graphfoundation.org]
4 | *
5 | * This file is part of ONgDB.
6 | *
7 | * ONgDB is free software: you can redistribute it and/or modify
8 | * it under the terms of the GNU General Public License as published by
9 | * the Free Software Foundation, either version 3 of the License, or
10 | * (at your option) any later version.
11 | *
12 | * This program is distributed in the hope that it will be useful,
13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 | * GNU General Public License for more details.
16 | *
17 | * You should have received a copy of the GNU General Public License
18 | * along with this program. If not, see .
19 | */
20 | /*
21 | * Copyright (c) 2002-2020 "Neo4j,"
22 | * Neo4j Sweden AB [http://neo4j.com]
23 | *
24 | * This file is part of Neo4j.
25 | *
26 | * Neo4j is free software: you can redistribute it and/or modify
27 | * it under the terms of the GNU General Public License as published by
28 | * the Free Software Foundation, either version 3 of the License, or
29 | * (at your option) any later version.
30 | *
31 | * This program is distributed in the hope that it will be useful,
32 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
33 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
34 | * GNU General Public License for more details.
35 | *
36 | * You should have received a copy of the GNU General Public License
37 | * along with this program. If not, see .
38 | */
39 |
40 | import React from 'react'
41 | import { render, fireEvent } from '@testing-library/react'
42 |
43 | import Snake from './Snake'
44 | import { SnakeFrame } from './index'
45 |
46 | test('Frame renders', () => {
47 | const { getByText } = render()
48 | const startBtn = getByText(/start the game!/i)
49 | fireEvent.click(startBtn)
50 | })
51 | test('Extras renders', () => {
52 | render()
53 | })
54 |
--------------------------------------------------------------------------------
/src/browser/documentation/help/partials/params-on-systemdb.jsx:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2018-2020 "Graph Foundation"
3 | * Graph Foundation, Inc. [https://graphfoundation.org]
4 | *
5 | * This file is part of ONgDB.
6 | *
7 | * ONgDB is free software: you can redistribute it and/or modify
8 | * it under the terms of the GNU General Public License as published by
9 | * the Free Software Foundation, either version 3 of the License, or
10 | * (at your option) any later version.
11 | *
12 | * This program is distributed in the hope that it will be useful,
13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 | * GNU General Public License for more details.
16 | *
17 | * You should have received a copy of the GNU General Public License
18 | * along with this program. If not, see .
19 | */
20 | /*
21 | * Copyright (c) 2002-2020 "Neo4j,"
22 | * Neo4j Sweden AB [http://neo4j.com]
23 | *
24 | * This file is part of Neo4j.
25 | *
26 | * Neo4j is free software: you can redistribute it and/or modify
27 | * it under the terms of the GNU General Public License as published by
28 | * the Free Software Foundation, either version 3 of the License, or
29 | * (at your option) any later version.
30 | *
31 | * This program is distributed in the hope that it will be useful,
32 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
33 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
34 | * GNU General Public License for more details.
35 | *
36 | * You should have received a copy of the GNU General Public License
37 | * along with this program. If not, see .
38 | */
39 | import React from 'react'
40 | export default function ParamsOnSystemDb() {
41 | return (
42 |
43 | A note on system database
44 |
45 | If you are using a multi-database DBMS, parameters cannot be declared when
46 | using the system database. Switch to a different database and declare,
47 | then switch back to system database and use them.
48 |
49 | )
50 | }
51 |
--------------------------------------------------------------------------------
/src/shared/services/bolt/driverFactory.js:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2018-2020 "Graph Foundation"
3 | * Graph Foundation, Inc. [https://graphfoundation.org]
4 | *
5 | * This file is part of ONgDB.
6 | *
7 | * ONgDB is free software: you can redistribute it and/or modify
8 | * it under the terms of the GNU General Public License as published by
9 | * the Free Software Foundation, either version 3 of the License, or
10 | * (at your option) any later version.
11 | *
12 | * This program is distributed in the hope that it will be useful,
13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 | * GNU General Public License for more details.
16 | *
17 | * You should have received a copy of the GNU General Public License
18 | * along with this program. If not, see .
19 | */
20 | /*
21 | * Copyright (c) 2002-2020 "Neo4j,"
22 | * Neo4j Sweden AB [http://neo4j.com]
23 | *
24 | * This file is part of Neo4j.
25 | *
26 | * Neo4j is free software: you can redistribute it and/or modify
27 | * it under the terms of the GNU General Public License as published by
28 | * the Free Software Foundation, either version 3 of the License, or
29 | * (at your option) any later version.
30 | *
31 | * This program is distributed in the hope that it will be useful,
32 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
33 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
34 | * GNU General Public License for more details.
35 | *
36 | * You should have received a copy of the GNU General Public License
37 | * along with this program. If not, see .
38 | */
39 |
40 | import neo4j from 'neo4j-driver'
41 |
42 | export const createDriverOrFailFn = (url, auth, opts, failFn = () => {}) => {
43 | // This is needed, I haven't figured out why. I don't find any mutations to
44 | // the object, so not sure what's going on.
45 | const spreadOpts = { ...opts }
46 | try {
47 | const res = neo4j.driver(url, auth, spreadOpts)
48 | return res
49 | } catch (e) {
50 | failFn(e)
51 | return null
52 | }
53 | }
54 |
--------------------------------------------------------------------------------
/src/browser/modules/Stream/errorMessageFormater.js:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2018-2020 "Graph Foundation"
3 | * Graph Foundation, Inc. [https://graphfoundation.org]
4 | *
5 | * This file is part of ONgDB.
6 | *
7 | * ONgDB is free software: you can redistribute it and/or modify
8 | * it under the terms of the GNU General Public License as published by
9 | * the Free Software Foundation, either version 3 of the License, or
10 | * (at your option) any later version.
11 | *
12 | * This program is distributed in the hope that it will be useful,
13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 | * GNU General Public License for more details.
16 | *
17 | * You should have received a copy of the GNU General Public License
18 | * along with this program. If not, see .
19 | */
20 | /*
21 | * Copyright (c) 2002-2020 "Neo4j,"
22 | * Neo4j Sweden AB [http://neo4j.com]
23 | *
24 | * This file is part of Neo4j.
25 | *
26 | * Neo4j is free software: you can redistribute it and/or modify
27 | * it under the terms of the GNU General Public License as published by
28 | * the Free Software Foundation, either version 3 of the License, or
29 | * (at your option) any later version.
30 | *
31 | * This program is distributed in the hope that it will be useful,
32 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
33 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
34 | * GNU General Public License for more details.
35 | *
36 | * You should have received a copy of the GNU General Public License
37 | * along with this program. If not, see .
38 | */
39 |
40 | import { IESecurityError18 } from './Errors/IESecurityErrors'
41 |
42 | const error = (title, message) => ({
43 | title,
44 | message: message || title
45 | })
46 |
47 | const knownErrors = {
48 | 18: IESecurityError18
49 | }
50 |
51 | export const errorMessageFormater = (code, message) => {
52 | const title = `${code || code === 0 ? code : ''}${
53 | code && message ? ': ' : ''
54 | }${message || ''}`
55 | return error(title, knownErrors[code])
56 | }
57 |
--------------------------------------------------------------------------------
/src/shared/modules/features/featureDuck.utils.js:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2018-2020 "Graph Foundation"
3 | * Graph Foundation, Inc. [https://graphfoundation.org]
4 | *
5 | * This file is part of ONgDB.
6 | *
7 | * ONgDB is free software: you can redistribute it and/or modify
8 | * it under the terms of the GNU General Public License as published by
9 | * the Free Software Foundation, either version 3 of the License, or
10 | * (at your option) any later version.
11 | *
12 | * This program is distributed in the hope that it will be useful,
13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 | * GNU General Public License for more details.
16 | *
17 | * You should have received a copy of the GNU General Public License
18 | * along with this program. If not, see .
19 | */
20 | /*
21 | * Copyright (c) 2002-2020 "Neo4j,"
22 | * Neo4j Sweden AB [http://neo4j.com]
23 | *
24 | * This file is part of Neo4j.
25 | *
26 | * Neo4j is free software: you can redistribute it and/or modify
27 | * it under the terms of the GNU General Public License as published by
28 | * the Free Software Foundation, either version 3 of the License, or
29 | * (at your option) any later version.
30 | *
31 | * This program is distributed in the hope that it will be useful,
32 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
33 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
34 | * GNU General Public License for more details.
35 | *
36 | * You should have received a copy of the GNU General Public License
37 | * along with this program. If not, see .
38 | */
39 |
40 | import semver from 'semver'
41 |
42 | export const guessSemverVersion = versionString => {
43 | if (!versionString) {
44 | return null
45 | }
46 | if (semver.valid(versionString)) {
47 | return versionString
48 | }
49 |
50 | const coerceVersion = semver.coerce(versionString)
51 | if (coerceVersion && coerceVersion.version) {
52 | return coerceVersion.version
53 | }
54 |
55 | // Could not get a version from the string
56 | return null
57 | }
58 |
--------------------------------------------------------------------------------
/src/shared/modules/experimentalFeatures/experimentalFeaturesDuck.js:
--------------------------------------------------------------------------------
1 | import { APP_START, USER_CLEAR } from 'shared/modules/app/appDuck'
2 |
3 | export const NAME = 'experimentalFeatures'
4 | const FEATURE_ON = `${NAME}/FEATURE_ON`
5 | const FEATURE_OFF = `${NAME}/FEATURE_OFF`
6 |
7 | export const getExperimentalFeatures = state => state[NAME]
8 | export const showFeature = (state, name) => !!(state[NAME][name] || {}).on
9 |
10 | export const experimentalFeatureSelfName = 'showSelf'
11 |
12 | export const initialState = {
13 | [experimentalFeatureSelfName]: {
14 | name: experimentalFeatureSelfName,
15 | on: true,
16 | displayName: 'Show experimental features',
17 | tooltip: 'Show feature section in settings drawer'
18 | }
19 | }
20 |
21 | // Helpers
22 | const cherrypickAndMergeStates = (base, stored) => {
23 | if (!stored) {
24 | return { ...base }
25 | }
26 | const existingFeatures = Object.keys(base)
27 | return existingFeatures.reduce((all, name) => {
28 | if (!stored.hasOwnProperty(name) || stored[name].on === undefined) {
29 | all[name] = base[name]
30 | return all
31 | }
32 | all[name] = { ...base[name], on: stored[name].on }
33 | return all
34 | }, {})
35 | }
36 |
37 | // Reducer
38 | export default function experimentalFeatures(state = initialState, action) {
39 | switch (action.type) {
40 | case APP_START:
41 | return cherrypickAndMergeStates(initialState, state)
42 | case FEATURE_ON:
43 | if (!state.hasOwnProperty(action.name)) {
44 | return state
45 | }
46 | return { ...state, [action.name]: { ...state[action.name], on: true } }
47 | case FEATURE_OFF:
48 | if (!state.hasOwnProperty(action.name)) {
49 | return state
50 | }
51 | return { ...state, [action.name]: { ...state[action.name], on: false } }
52 | case USER_CLEAR:
53 | return initialState
54 | default:
55 | return state
56 | }
57 | }
58 |
59 | export const enableExperimentalFeature = name => {
60 | return {
61 | type: FEATURE_ON,
62 | name
63 | }
64 | }
65 |
66 | export const disableExperimentalFeature = name => {
67 | return {
68 | type: FEATURE_OFF,
69 | name
70 | }
71 | }
72 |
--------------------------------------------------------------------------------
/src/browser/documentation/help/partials/admin-on-systemdb.jsx:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2018-2020 "Graph Foundation"
3 | * Graph Foundation, Inc. [https://graphfoundation.org]
4 | *
5 | * This file is part of ONgDB.
6 | *
7 | * ONgDB is free software: you can redistribute it and/or modify
8 | * it under the terms of the GNU General Public License as published by
9 | * the Free Software Foundation, either version 3 of the License, or
10 | * (at your option) any later version.
11 | *
12 | * This program is distributed in the hope that it will be useful,
13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 | * GNU General Public License for more details.
16 | *
17 | * You should have received a copy of the GNU General Public License
18 | * along with this program. If not, see .
19 | */
20 | /*
21 | * Copyright (c) 2002-2020 "Neo4j,"
22 | * Neo4j Sweden AB [http://neo4j.com]
23 | *
24 | * This file is part of Neo4j.
25 | *
26 | * Neo4j is free software: you can redistribute it and/or modify
27 | * it under the terms of the GNU General Public License as published by
28 | * the Free Software Foundation, either version 3 of the License, or
29 | * (at your option) any later version.
30 | *
31 | * This program is distributed in the hope that it will be useful,
32 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
33 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
34 | * GNU General Public License for more details.
35 | *
36 | * You should have received a copy of the GNU General Public License
37 | * along with this program. If not, see .
38 | */
39 | import React from 'react'
40 | export default function AdminOnSystemDb() {
41 | return (
42 |
43 | A note on system database
44 |
45 | ONgDB has a complex security model stored in the system graph, maintained
46 | in a special database called the system database. All
47 | administrative commands need to be executed against the{' '}
48 | system database.
49 |
50 | )
51 | }
52 |
--------------------------------------------------------------------------------
/src/browser/documentation/help/queries.jsx:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2018-2020 "Graph Foundation"
3 | * Graph Foundation, Inc. [https://graphfoundation.org]
4 | *
5 | * This file is part of ONgDB.
6 | *
7 | * ONgDB is free software: you can redistribute it and/or modify
8 | * it under the terms of the GNU General Public License as published by
9 | * the Free Software Foundation, either version 3 of the License, or
10 | * (at your option) any later version.
11 | *
12 | * This program is distributed in the hope that it will be useful,
13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 | * GNU General Public License for more details.
16 | *
17 | * You should have received a copy of the GNU General Public License
18 | * along with this program. If not, see .
19 | */
20 | /*
21 | * Copyright (c) 2002-2020 "Neo4j,"
22 | * Neo4j Sweden AB [http://neo4j.com]
23 | *
24 | * This file is part of Neo4j.
25 | *
26 | * Neo4j is free software: you can redistribute it and/or modify
27 | * it under the terms of the GNU General Public License as published by
28 | * the Free Software Foundation, either version 3 of the License, or
29 | * (at your option) any later version.
30 | *
31 | * This program is distributed in the hope that it will be useful,
32 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
33 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
34 | * GNU General Public License for more details.
35 | *
36 | * You should have received a copy of the GNU General Public License
37 | * along with this program. If not, see .
38 | */
39 |
40 | import React from 'react'
41 | const title = 'Query Status'
42 | const subtitle = 'Show query status.'
43 | const category = 'browserUiCommands'
44 | const content = (
45 | <>
46 |
47 | The :queries command will list your servers
48 | and clusters running queries.
49 |
50 | From that list you have the ability to kill unwanted queries.
51 |
52 | >
53 | )
54 |
55 | export default { title, subtitle, category, content }
56 |
--------------------------------------------------------------------------------
/src/browser/components/headers/Headers.test.js:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2018-2020 "Graph Foundation"
3 | * Graph Foundation, Inc. [https://graphfoundation.org]
4 | *
5 | * This file is part of ONgDB.
6 | *
7 | * ONgDB is free software: you can redistribute it and/or modify
8 | * it under the terms of the GNU General Public License as published by
9 | * the Free Software Foundation, either version 3 of the License, or
10 | * (at your option) any later version.
11 | *
12 | * This program is distributed in the hope that it will be useful,
13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 | * GNU General Public License for more details.
16 | *
17 | * You should have received a copy of the GNU General Public License
18 | * along with this program. If not, see .
19 | */
20 | /*
21 | * Copyright (c) 2002-2020 "Neo4j,"
22 | * Neo4j Sweden AB [http://neo4j.com]
23 | *
24 | * This file is part of Neo4j.
25 | *
26 | * Neo4j is free software: you can redistribute it and/or modify
27 | * it under the terms of the GNU General Public License as published by
28 | * the Free Software Foundation, either version 3 of the License, or
29 | * (at your option) any later version.
30 | *
31 | * This program is distributed in the hope that it will be useful,
32 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
33 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
34 | * GNU General Public License for more details.
35 | *
36 | * You should have received a copy of the GNU General Public License
37 | * along with this program. If not, see .
38 | */
39 | import React from 'react'
40 | import { render } from '@testing-library/react'
41 | import { H1, H2, H3, H4, H5 } from './Headers'
42 |
43 | describe('headers', () => {
44 | test('H1 renders', () => {
45 | render()
46 | })
47 | test('H2 renders', () => {
48 | render()
49 | })
50 | test('H3 renders', () => {
51 | render()
52 | })
53 | test('H4 renders', () => {
54 | render()
55 | })
56 | test('H5 renders', () => {
57 | render()
58 | })
59 | })
60 |
--------------------------------------------------------------------------------
/src/shared/modules/commands/helpers/grass.js:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2018-2020 "Graph Foundation"
3 | * Graph Foundation, Inc. [https://graphfoundation.org]
4 | *
5 | * This file is part of ONgDB.
6 | *
7 | * ONgDB is free software: you can redistribute it and/or modify
8 | * it under the terms of the GNU General Public License as published by
9 | * the Free Software Foundation, either version 3 of the License, or
10 | * (at your option) any later version.
11 | *
12 | * This program is distributed in the hope that it will be useful,
13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 | * GNU General Public License for more details.
16 | *
17 | * You should have received a copy of the GNU General Public License
18 | * along with this program. If not, see .
19 | */
20 | /*
21 | * Copyright (c) 2002-2020 "Neo4j,"
22 | * Neo4j Sweden AB [http://neo4j.com]
23 | *
24 | * This file is part of Neo4j.
25 | *
26 | * Neo4j is free software: you can redistribute it and/or modify
27 | * it under the terms of the GNU General Public License as published by
28 | * the Free Software Foundation, either version 3 of the License, or
29 | * (at your option) any later version.
30 | *
31 | * This program is distributed in the hope that it will be useful,
32 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
33 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
34 | * GNU General Public License for more details.
35 | *
36 | * You should have received a copy of the GNU General Public License
37 | * along with this program. If not, see .
38 | */
39 |
40 | import { hostIsAllowed } from 'services/utils'
41 | import remote from 'services/remote'
42 |
43 | export const fetchRemoteGrass = (url, whitelist = null) => {
44 | return new Promise((resolve, reject) => {
45 | if (!hostIsAllowed(url, whitelist)) {
46 | return reject(
47 | new Error('Hostname is not allowed according to server whitelist')
48 | )
49 | }
50 | resolve()
51 | }).then(() => {
52 | return remote.get(url).then(r => {
53 | return r
54 | })
55 | })
56 | }
57 |
--------------------------------------------------------------------------------