datajunction-ui 0.0.1-rc.19 → 0.0.1-rc.20
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +6 -5
- package/src/__tests__/reportWebVitals.test.jsx +44 -0
- package/src/app/components/DeleteNode.jsx +79 -0
- package/src/app/components/ListGroupItem.jsx +8 -1
- package/src/app/components/QueryInfo.jsx +4 -4
- package/src/app/components/Tab.jsx +9 -1
- package/src/app/components/ToggleSwitch.jsx +3 -0
- package/src/app/components/__tests__/QueryInfo.test.jsx +55 -0
- package/src/app/components/__tests__/Tab.test.jsx +27 -0
- package/src/app/components/__tests__/ToggleSwitch.test.jsx +43 -0
- package/src/app/components/__tests__/__snapshots__/ListGroupItem.test.tsx.snap +3 -0
- package/src/app/components/djgraph/DJNodeColumns.jsx +4 -1
- package/src/app/components/djgraph/DJNodeDimensions.jsx +9 -2
- package/src/app/components/djgraph/__tests__/Collapse.test.jsx +51 -0
- package/src/app/components/djgraph/__tests__/DJNodeColumns.test.jsx +83 -0
- package/src/app/components/djgraph/__tests__/DJNodeDimensions.test.jsx +118 -0
- package/src/app/index.tsx +6 -0
- package/src/app/pages/AddEditNodePage/FormikSelect.jsx +15 -2
- package/src/app/pages/AddEditNodePage/FullNameField.jsx +2 -1
- package/src/app/pages/AddEditNodePage/__tests__/AddEditNodePageFormFailed.test.jsx +77 -0
- package/src/app/pages/AddEditNodePage/__tests__/AddEditNodePageFormSuccess.test.jsx +93 -0
- package/src/app/pages/AddEditNodePage/__tests__/FormikSelect.test.jsx +34 -3
- package/src/app/pages/AddEditNodePage/__tests__/FullNameField.test.jsx +4 -2
- package/src/app/pages/AddEditNodePage/__tests__/__snapshots__/AddEditNodePageFormFailed.test.jsx.snap +53 -0
- package/src/app/pages/AddEditNodePage/__tests__/__snapshots__/AddEditNodePageFormSuccess.test.jsx.snap +53 -0
- package/src/app/pages/AddEditNodePage/__tests__/__snapshots__/index.test.jsx.snap +0 -81
- package/src/app/pages/AddEditNodePage/__tests__/index.test.jsx +82 -257
- package/src/app/pages/AddEditNodePage/index.jsx +13 -5
- package/src/app/pages/LoginPage/__tests__/index.test.jsx +70 -0
- package/src/app/pages/NamespacePage/__tests__/index.test.jsx +95 -0
- package/src/app/pages/NamespacePage/index.jsx +8 -5
- package/src/app/pages/NodePage/ClientCodePopover.jsx +3 -1
- package/src/app/pages/NodePage/EditColumnPopover.jsx +102 -0
- package/src/app/pages/NodePage/LinkDimensionPopover.jsx +135 -0
- package/src/app/pages/NodePage/NodeColumnTab.jsx +80 -17
- package/src/app/pages/NodePage/NodeHistory.jsx +63 -30
- package/src/app/pages/NodePage/NodeInfoTab.jsx +52 -7
- package/src/app/pages/NodePage/NodeMaterializationTab.jsx +50 -27
- package/src/app/pages/NodePage/NodeSQLTab.jsx +0 -10
- package/src/app/pages/NodePage/NodesWithDimension.jsx +4 -2
- package/src/app/pages/NodePage/__tests__/ClientCodePopover.test.jsx +49 -0
- package/src/app/pages/NodePage/__tests__/EditColumnPopover.test.jsx +148 -0
- package/src/app/pages/NodePage/__tests__/LinkDimensionPopover.test.jsx +165 -0
- package/src/app/pages/NodePage/__tests__/NodeGraphTab.test.jsx +591 -0
- package/src/app/pages/NodePage/__tests__/NodeLineageTab.test.jsx +57 -0
- package/src/app/pages/NodePage/__tests__/NodePage.test.jsx +725 -0
- package/src/app/pages/NodePage/__tests__/NodeWithDimension.test.jsx +175 -0
- package/src/app/pages/NodePage/__tests__/__snapshots__/NodePage.test.jsx.snap +402 -0
- package/src/app/pages/NodePage/index.jsx +22 -6
- package/src/app/pages/NotFoundPage/__tests__/index.test.jsx +16 -0
- package/src/app/pages/RegisterTablePage/Loadable.jsx +16 -0
- package/src/app/pages/RegisterTablePage/index.jsx +163 -0
- package/src/app/pages/Root/__tests__/index.test.jsx +77 -0
- package/src/app/pages/SQLBuilderPage/__tests__/index.test.jsx +173 -0
- package/src/app/pages/SQLBuilderPage/index.jsx +61 -43
- package/src/app/services/DJService.js +125 -54
- package/src/app/services/__tests__/DJService.test.jsx +609 -0
- package/src/mocks/mockNodes.jsx +1397 -0
- package/src/setupTests.ts +30 -0
- package/src/styles/index.css +43 -0
- package/src/styles/node-creation.scss +7 -0
- package/src/utils/form.jsx +23 -0
- package/.github/pull_request_template.md +0 -11
- package/.github/workflows/ci.yml +0 -33
- package/src/app/pages/NamespacePage/__tests__/__snapshots__/index.test.tsx.snap +0 -118
- package/src/app/pages/NamespacePage/__tests__/index.test.tsx +0 -14
package/src/setupTests.ts
CHANGED
|
@@ -4,3 +4,33 @@ import '@testing-library/jest-dom';
|
|
|
4
4
|
|
|
5
5
|
import 'react-app-polyfill/ie11';
|
|
6
6
|
import 'react-app-polyfill/stable';
|
|
7
|
+
import { JSDOM } from 'jsdom';
|
|
8
|
+
import { render as originalRender } from '@testing-library/react';
|
|
9
|
+
|
|
10
|
+
global.ResizeObserver = require('resize-observer-polyfill');
|
|
11
|
+
global.fetch = require('jest-fetch-mock');
|
|
12
|
+
|
|
13
|
+
const setDom = () => {
|
|
14
|
+
const dom = new JSDOM('<!doctype html><html><body></body></html>', {});
|
|
15
|
+
|
|
16
|
+
global.window = dom.window;
|
|
17
|
+
global.document = dom.window.document;
|
|
18
|
+
document.createRange = () => {
|
|
19
|
+
const range = new Range();
|
|
20
|
+
range.getBoundingClientRect = jest.fn();
|
|
21
|
+
range.getClientRects = () => {
|
|
22
|
+
return {
|
|
23
|
+
item: () => null,
|
|
24
|
+
length: 0,
|
|
25
|
+
[Symbol.iterator]: jest.fn(),
|
|
26
|
+
};
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
return range;
|
|
30
|
+
};
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
export const render = ui => {
|
|
34
|
+
setDom();
|
|
35
|
+
return originalRender(ui);
|
|
36
|
+
};
|
package/src/styles/index.css
CHANGED
|
@@ -398,6 +398,7 @@ tbody th {
|
|
|
398
398
|
border-radius: 0.375rem;
|
|
399
399
|
word-wrap: break-word;
|
|
400
400
|
white-space: break-spaces;
|
|
401
|
+
margin-right: 0.5rem;
|
|
401
402
|
}
|
|
402
403
|
|
|
403
404
|
/* Nodes */
|
|
@@ -881,6 +882,19 @@ pre {
|
|
|
881
882
|
z-index: 1;
|
|
882
883
|
}
|
|
883
884
|
|
|
885
|
+
.popover {
|
|
886
|
+
padding: 1rem 1rem 0.6rem 1rem !important;
|
|
887
|
+
margin-top: 1rem;
|
|
888
|
+
background-color: #ffffff;
|
|
889
|
+
border: 1px solid #c5c5c5;
|
|
890
|
+
border-radius: 10px;
|
|
891
|
+
text-align: left;
|
|
892
|
+
position: absolute;
|
|
893
|
+
min-width: 200px;
|
|
894
|
+
max-width: 100%;
|
|
895
|
+
z-index: 1;
|
|
896
|
+
}
|
|
897
|
+
|
|
884
898
|
.select-name {
|
|
885
899
|
margin-top: 5px;
|
|
886
900
|
padding: 7px 7px;
|
|
@@ -950,3 +964,32 @@ pre {
|
|
|
950
964
|
word-wrap: break-word;
|
|
951
965
|
white-space: break-spaces;
|
|
952
966
|
}
|
|
967
|
+
|
|
968
|
+
.add_button {
|
|
969
|
+
background-color: #f0f8ff !important;
|
|
970
|
+
color: #24518f;
|
|
971
|
+
text-transform: uppercase;
|
|
972
|
+
vertical-align: middle;
|
|
973
|
+
padding: 0.2rem 0.5rem 0.1rem 0.5rem;
|
|
974
|
+
border: 1px solid #819bc0;
|
|
975
|
+
font-size: 1.2rem;
|
|
976
|
+
border-radius: 0.5rem;
|
|
977
|
+
word-wrap: break-word;
|
|
978
|
+
white-space: break-spaces;
|
|
979
|
+
margin-left: 1rem;
|
|
980
|
+
}
|
|
981
|
+
|
|
982
|
+
.edit_button {
|
|
983
|
+
background: none;
|
|
984
|
+
color: inherit;
|
|
985
|
+
border: none;
|
|
986
|
+
padding: 0;
|
|
987
|
+
font: inherit;
|
|
988
|
+
cursor: pointer;
|
|
989
|
+
outline: inherit;
|
|
990
|
+
margin-left: 1rem;
|
|
991
|
+
}
|
|
992
|
+
|
|
993
|
+
.deleteNode {
|
|
994
|
+
display: inline-block;
|
|
995
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import ValidIcon from '../app/icons/ValidIcon';
|
|
2
|
+
import AlertIcon from '../app/icons/AlertIcon';
|
|
3
|
+
import * as React from 'react';
|
|
4
|
+
|
|
5
|
+
export const displayMessageAfterSubmit = status => {
|
|
6
|
+
return status?.success !== undefined ? (
|
|
7
|
+
<div className="message success">
|
|
8
|
+
<ValidIcon />
|
|
9
|
+
{status?.success}
|
|
10
|
+
</div>
|
|
11
|
+
) : status?.failure !== undefined ? (
|
|
12
|
+
<div className="message alert">
|
|
13
|
+
<AlertIcon />
|
|
14
|
+
{status?.failure}
|
|
15
|
+
</div>
|
|
16
|
+
) : (
|
|
17
|
+
''
|
|
18
|
+
);
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
export const labelize = name => {
|
|
22
|
+
return name.replace(/_/g, ' ').replace(/\b(\w)/g, char => char.toUpperCase());
|
|
23
|
+
};
|
package/.github/workflows/ci.yml
DELETED
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
name: CI/CD
|
|
2
|
-
|
|
3
|
-
on:
|
|
4
|
-
push:
|
|
5
|
-
branches: [main]
|
|
6
|
-
pull_request:
|
|
7
|
-
branches: [main]
|
|
8
|
-
|
|
9
|
-
jobs:
|
|
10
|
-
build:
|
|
11
|
-
runs-on: ubuntu-latest
|
|
12
|
-
|
|
13
|
-
strategy:
|
|
14
|
-
matrix:
|
|
15
|
-
node-version: [19.x]
|
|
16
|
-
|
|
17
|
-
steps:
|
|
18
|
-
- name: Checkout repository
|
|
19
|
-
uses: actions/checkout@v2
|
|
20
|
-
|
|
21
|
-
- name: Set up Node.js ${{ matrix.node-version }}
|
|
22
|
-
uses: actions/setup-node@v3
|
|
23
|
-
with:
|
|
24
|
-
node-version: ${{ matrix.node-version }}
|
|
25
|
-
|
|
26
|
-
- name: Install Dependencies
|
|
27
|
-
run: yarn install
|
|
28
|
-
|
|
29
|
-
- name: Run Unit Tests
|
|
30
|
-
run: yarn test
|
|
31
|
-
|
|
32
|
-
- name: Build Project
|
|
33
|
-
run: yarn build
|
|
@@ -1,118 +0,0 @@
|
|
|
1
|
-
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
2
|
-
|
|
3
|
-
exports[`<NamespacePage /> should render and match the snapshot 1`] = `
|
|
4
|
-
<div
|
|
5
|
-
className="mid"
|
|
6
|
-
>
|
|
7
|
-
<div
|
|
8
|
-
className="card"
|
|
9
|
-
>
|
|
10
|
-
<div
|
|
11
|
-
className="card-header"
|
|
12
|
-
>
|
|
13
|
-
<h2>
|
|
14
|
-
Explore
|
|
15
|
-
</h2>
|
|
16
|
-
<span
|
|
17
|
-
className="menu-link"
|
|
18
|
-
>
|
|
19
|
-
<span
|
|
20
|
-
className="menu-title"
|
|
21
|
-
>
|
|
22
|
-
<div
|
|
23
|
-
className="dropdown"
|
|
24
|
-
>
|
|
25
|
-
<span
|
|
26
|
-
className="add_node"
|
|
27
|
-
>
|
|
28
|
-
+ Add Node
|
|
29
|
-
</span>
|
|
30
|
-
<div
|
|
31
|
-
className="dropdown-content"
|
|
32
|
-
>
|
|
33
|
-
<a
|
|
34
|
-
href="/create/transform/undefined"
|
|
35
|
-
>
|
|
36
|
-
<div
|
|
37
|
-
className="node_type__transform node_type_creation_heading"
|
|
38
|
-
>
|
|
39
|
-
Transform
|
|
40
|
-
</div>
|
|
41
|
-
</a>
|
|
42
|
-
<a
|
|
43
|
-
href="/create/metric/undefined"
|
|
44
|
-
>
|
|
45
|
-
<div
|
|
46
|
-
className="node_type__metric node_type_creation_heading"
|
|
47
|
-
>
|
|
48
|
-
Metric
|
|
49
|
-
</div>
|
|
50
|
-
</a>
|
|
51
|
-
<a
|
|
52
|
-
href="/create/dimension/undefined"
|
|
53
|
-
>
|
|
54
|
-
<div
|
|
55
|
-
className="node_type__dimension node_type_creation_heading"
|
|
56
|
-
>
|
|
57
|
-
Dimension
|
|
58
|
-
</div>
|
|
59
|
-
</a>
|
|
60
|
-
</div>
|
|
61
|
-
</div>
|
|
62
|
-
</span>
|
|
63
|
-
</span>
|
|
64
|
-
<div
|
|
65
|
-
className="table-responsive"
|
|
66
|
-
>
|
|
67
|
-
<div
|
|
68
|
-
className="sidebar"
|
|
69
|
-
>
|
|
70
|
-
<span
|
|
71
|
-
style={
|
|
72
|
-
Object {
|
|
73
|
-
"color": "#95aac9",
|
|
74
|
-
"fontSize": "0.8125rem",
|
|
75
|
-
"fontWeight": "600",
|
|
76
|
-
"padding": "1rem 1rem 1rem 0",
|
|
77
|
-
"textTransform": "uppercase",
|
|
78
|
-
}
|
|
79
|
-
}
|
|
80
|
-
>
|
|
81
|
-
Namespaces
|
|
82
|
-
</span>
|
|
83
|
-
</div>
|
|
84
|
-
<table
|
|
85
|
-
className="card-table table"
|
|
86
|
-
>
|
|
87
|
-
<thead>
|
|
88
|
-
<tr>
|
|
89
|
-
<th>
|
|
90
|
-
Name
|
|
91
|
-
</th>
|
|
92
|
-
<th>
|
|
93
|
-
Display Name
|
|
94
|
-
</th>
|
|
95
|
-
<th>
|
|
96
|
-
Type
|
|
97
|
-
</th>
|
|
98
|
-
<th>
|
|
99
|
-
Status
|
|
100
|
-
</th>
|
|
101
|
-
<th>
|
|
102
|
-
Mode
|
|
103
|
-
</th>
|
|
104
|
-
<th>
|
|
105
|
-
Last Updated
|
|
106
|
-
</th>
|
|
107
|
-
<th>
|
|
108
|
-
Actions
|
|
109
|
-
</th>
|
|
110
|
-
</tr>
|
|
111
|
-
</thead>
|
|
112
|
-
<tbody />
|
|
113
|
-
</table>
|
|
114
|
-
</div>
|
|
115
|
-
</div>
|
|
116
|
-
</div>
|
|
117
|
-
</div>
|
|
118
|
-
`;
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
import { createRenderer } from 'react-test-renderer/shallow';
|
|
3
|
-
|
|
4
|
-
import { NamespacePage } from '../index';
|
|
5
|
-
|
|
6
|
-
const renderer = createRenderer();
|
|
7
|
-
|
|
8
|
-
describe('<NamespacePage />', () => {
|
|
9
|
-
it('should render and match the snapshot', () => {
|
|
10
|
-
renderer.render(<NamespacePage />);
|
|
11
|
-
const renderedOutput = renderer.getRenderOutput();
|
|
12
|
-
expect(renderedOutput).toMatchSnapshot();
|
|
13
|
-
});
|
|
14
|
-
});
|