datajunction-ui 0.0.1-rc.9 → 0.0.3
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/.env +2 -0
- package/.prettierignore +3 -1
- package/Makefile +9 -0
- package/dj-logo.svg +10 -0
- package/package.json +53 -14
- package/public/favicon.ico +0 -0
- package/public/index.html +1 -1
- package/src/__tests__/reportWebVitals.test.jsx +44 -0
- package/src/app/__tests__/__snapshots__/index.test.tsx.snap +5 -109
- package/src/app/components/AddNodeDropdown.jsx +44 -0
- package/src/app/components/ListGroupItem.jsx +9 -1
- package/src/app/components/NamespaceHeader.jsx +4 -13
- package/src/app/components/NodeListActions.jsx +69 -0
- package/src/app/components/NodeMaterializationDelete.jsx +90 -0
- package/src/app/components/QueryInfo.jsx +172 -0
- package/src/app/components/Search.jsx +94 -0
- package/src/app/components/Tab.jsx +8 -1
- package/src/app/components/ToggleSwitch.jsx +20 -0
- package/src/app/components/__tests__/NodeListActions.test.jsx +94 -0
- package/src/app/components/__tests__/QueryInfo.test.jsx +55 -0
- package/src/app/components/__tests__/Search.test.jsx +63 -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 +8 -3
- package/src/app/components/__tests__/__snapshots__/NamespaceHeader.test.jsx.snap +2 -18
- package/src/app/components/djgraph/Collapse.jsx +47 -0
- package/src/app/components/djgraph/DJNode.jsx +61 -83
- package/src/app/components/djgraph/DJNodeColumns.jsx +75 -0
- package/src/app/components/djgraph/DJNodeDimensions.jsx +75 -0
- package/src/app/components/djgraph/LayoutFlow.jsx +106 -0
- 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/components/djgraph/__tests__/__snapshots__/DJNode.test.tsx.snap +84 -40
- package/src/app/components/forms/Action.jsx +8 -0
- package/src/app/components/forms/NodeNameField.jsx +64 -0
- package/src/app/components/search.css +17 -0
- package/src/app/constants.js +2 -0
- package/src/app/icons/AddItemIcon.jsx +16 -0
- package/src/app/icons/AlertIcon.jsx +33 -0
- package/src/app/icons/CollapsedIcon.jsx +15 -0
- package/src/app/icons/CommitIcon.jsx +45 -0
- package/src/app/icons/DJLogo.jsx +36 -0
- package/src/app/icons/DeleteIcon.jsx +21 -0
- package/src/app/icons/DiffIcon.jsx +63 -0
- package/src/app/icons/EditIcon.jsx +18 -0
- package/src/app/icons/ExpandedIcon.jsx +15 -0
- package/src/app/icons/EyeIcon.jsx +20 -0
- package/src/app/icons/FilterIcon.jsx +7 -0
- package/src/app/icons/HorizontalHierarchyIcon.jsx +15 -0
- package/src/app/icons/InvalidIcon.jsx +16 -0
- package/src/app/icons/JupyterExportIcon.jsx +25 -0
- package/src/app/icons/LoadingIcon.jsx +14 -0
- package/src/app/icons/NodeIcon.jsx +49 -0
- package/src/app/icons/PythonIcon.jsx +14 -0
- package/src/app/icons/TableIcon.jsx +14 -0
- package/src/app/icons/ValidIcon.jsx +16 -0
- package/src/app/index.tsx +118 -37
- package/src/app/pages/AddEditNodePage/AlertMessage.jsx +10 -0
- package/src/app/pages/AddEditNodePage/ColumnsSelect.jsx +84 -0
- package/src/app/pages/AddEditNodePage/DescriptionField.jsx +17 -0
- package/src/app/pages/AddEditNodePage/DisplayNameField.jsx +16 -0
- package/src/app/pages/AddEditNodePage/FormikSelect.jsx +51 -0
- package/src/app/pages/AddEditNodePage/FullNameField.jsx +38 -0
- package/src/app/pages/AddEditNodePage/Loadable.jsx +20 -0
- package/src/app/pages/AddEditNodePage/MetricMetadataFields.jsx +75 -0
- package/src/app/pages/AddEditNodePage/MetricQueryField.jsx +71 -0
- package/src/app/pages/AddEditNodePage/NamespaceField.jsx +40 -0
- package/src/app/pages/AddEditNodePage/NodeModeField.jsx +14 -0
- package/src/app/pages/AddEditNodePage/NodeQueryField.jsx +94 -0
- package/src/app/pages/AddEditNodePage/OwnersField.jsx +54 -0
- package/src/app/pages/AddEditNodePage/RequiredDimensionsSelect.jsx +54 -0
- package/src/app/pages/AddEditNodePage/TagsField.jsx +47 -0
- package/src/app/pages/AddEditNodePage/UpstreamNodeField.jsx +49 -0
- package/src/app/pages/AddEditNodePage/__tests__/AddEditNodePageFormFailed.test.jsx +109 -0
- package/src/app/pages/AddEditNodePage/__tests__/AddEditNodePageFormSuccess.test.jsx +287 -0
- package/src/app/pages/AddEditNodePage/__tests__/FormikSelect.test.jsx +75 -0
- package/src/app/pages/AddEditNodePage/__tests__/FullNameField.test.jsx +31 -0
- package/src/app/pages/AddEditNodePage/__tests__/NodeQueryField.test.jsx +30 -0
- package/src/app/pages/AddEditNodePage/__tests__/__snapshots__/AddEditNodePageFormFailed.test.jsx.snap +54 -0
- package/src/app/pages/AddEditNodePage/__tests__/__snapshots__/AddEditNodePageFormSuccess.test.jsx.snap +3 -0
- package/src/app/pages/AddEditNodePage/__tests__/__snapshots__/index.test.jsx.snap +3 -0
- package/src/app/pages/AddEditNodePage/__tests__/index.test.jsx +224 -0
- package/src/app/pages/AddEditNodePage/index.jsx +506 -0
- package/src/app/pages/AddEditTagPage/Loadable.jsx +16 -0
- package/src/app/pages/AddEditTagPage/__tests__/AddEditTagPage.test.jsx +107 -0
- package/src/app/pages/AddEditTagPage/index.jsx +132 -0
- package/src/app/pages/CubeBuilderPage/DimensionsSelect.jsx +152 -0
- package/src/app/pages/CubeBuilderPage/Loadable.jsx +16 -0
- package/src/app/pages/CubeBuilderPage/MetricsSelect.jsx +75 -0
- package/src/app/pages/CubeBuilderPage/__tests__/index.test.jsx +373 -0
- package/src/app/pages/CubeBuilderPage/index.jsx +291 -0
- package/src/app/pages/LoginPage/LoginForm.jsx +124 -0
- package/src/app/pages/LoginPage/SignupForm.jsx +156 -0
- package/src/app/pages/LoginPage/__tests__/index.test.jsx +97 -0
- package/src/app/pages/LoginPage/assets/sign-in-with-github.png +0 -0
- package/src/app/pages/LoginPage/assets/sign-in-with-google.png +0 -0
- package/src/app/pages/LoginPage/index.jsx +17 -0
- package/src/app/pages/NamespacePage/AddNamespacePopover.jsx +85 -0
- package/src/app/pages/NamespacePage/Explorer.jsx +61 -0
- package/src/app/pages/NamespacePage/FieldControl.jsx +21 -0
- package/src/app/pages/NamespacePage/NodeTypeSelect.jsx +30 -0
- package/src/app/pages/NamespacePage/TagSelect.jsx +44 -0
- package/src/app/pages/NamespacePage/UserSelect.jsx +47 -0
- package/src/app/pages/NamespacePage/__tests__/index.test.jsx +297 -0
- package/src/app/pages/NamespacePage/index.jsx +319 -42
- package/src/app/pages/NodePage/AddBackfillPopover.jsx +165 -0
- package/src/app/pages/NodePage/AddMaterializationPopover.jsx +222 -0
- package/src/app/pages/NodePage/AvailabilityStateBlock.jsx +67 -0
- package/src/app/pages/NodePage/ClientCodePopover.jsx +94 -0
- package/src/app/pages/NodePage/DimensionFilter.jsx +86 -0
- package/src/app/pages/NodePage/EditColumnDescriptionPopover.jsx +116 -0
- package/src/app/pages/NodePage/EditColumnPopover.jsx +116 -0
- package/src/app/pages/NodePage/LinkDimensionPopover.jsx +164 -0
- package/src/app/pages/NodePage/MaterializationConfigField.jsx +60 -0
- package/src/app/pages/NodePage/NodeColumnTab.jsx +256 -30
- package/src/app/pages/NodePage/NodeDependenciesTab.jsx +153 -0
- package/src/app/pages/NodePage/NodeGraphTab.jsx +119 -148
- package/src/app/pages/NodePage/NodeHistory.jsx +236 -0
- package/src/app/pages/NodePage/NodeInfoTab.jsx +325 -49
- package/src/app/pages/NodePage/NodeLineageTab.jsx +84 -0
- package/src/app/pages/NodePage/NodeMaterializationTab.jsx +585 -0
- package/src/app/pages/NodePage/NodeRevisionMaterializationTab.jsx +58 -0
- package/src/app/pages/NodePage/NodeStatus.jsx +100 -31
- package/src/app/pages/NodePage/NodeValidateTab.jsx +367 -0
- package/src/app/pages/NodePage/NodesWithDimension.jsx +42 -0
- package/src/app/pages/NodePage/NotebookDownload.jsx +36 -0
- package/src/app/pages/NodePage/PartitionColumnPopover.jsx +151 -0
- package/src/app/pages/NodePage/PartitionValueForm.jsx +60 -0
- package/src/app/pages/NodePage/RevisionDiff.jsx +209 -0
- package/src/app/pages/NodePage/WatchNodeButton.jsx +226 -0
- package/src/app/pages/NodePage/__tests__/AddBackfillPopover.test.jsx +56 -0
- package/src/app/pages/NodePage/__tests__/AddMaterializationPopover.test.jsx +87 -0
- package/src/app/pages/NodePage/__tests__/DimensionFilter.test.jsx +74 -0
- package/src/app/pages/NodePage/__tests__/EditColumnDescriptionPopover.test.jsx +149 -0
- package/src/app/pages/NodePage/__tests__/EditColumnPopover.test.jsx +148 -0
- package/src/app/pages/NodePage/__tests__/LinkDimensionPopover.test.jsx +161 -0
- package/src/app/pages/NodePage/__tests__/NodeColumnTab.test.jsx +166 -0
- package/src/app/pages/NodePage/__tests__/NodeDependenciesTab.test.jsx +151 -0
- package/src/app/pages/NodePage/__tests__/NodeGraphTab.test.jsx +595 -0
- package/src/app/pages/NodePage/__tests__/NodeLineageTab.test.jsx +58 -0
- package/src/app/pages/NodePage/__tests__/NodeMaterializationTab.test.jsx +190 -0
- package/src/app/pages/NodePage/__tests__/NodePage.test.jsx +872 -0
- package/src/app/pages/NodePage/__tests__/NodeWithDimension.test.jsx +175 -0
- package/src/app/pages/NodePage/__tests__/RevisionDiff.test.jsx +164 -0
- package/src/app/pages/NodePage/__tests__/__snapshots__/NodePage.test.jsx.snap +19 -0
- package/src/app/pages/NodePage/index.jsx +190 -44
- package/src/app/pages/NotFoundPage/__tests__/index.test.jsx +16 -0
- package/src/app/pages/OverviewPage/ByStatusPanel.jsx +69 -0
- package/src/app/pages/OverviewPage/DimensionNodeUsagePanel.jsx +48 -0
- package/src/app/pages/OverviewPage/GovernanceWarningsPanel.jsx +107 -0
- package/src/app/pages/OverviewPage/Loadable.jsx +16 -0
- package/src/app/pages/OverviewPage/NodesByTypePanel.jsx +63 -0
- package/src/app/pages/OverviewPage/OverviewPanel.jsx +94 -0
- package/src/app/pages/OverviewPage/TrendsPanel.jsx +66 -0
- package/src/app/pages/OverviewPage/__tests__/ByStatusPanel.test.jsx +36 -0
- package/src/app/pages/OverviewPage/__tests__/DimensionNodeUsagePanel.test.jsx +76 -0
- package/src/app/pages/OverviewPage/__tests__/GovernanceWarningsPanel.test.jsx +77 -0
- package/src/app/pages/OverviewPage/__tests__/NodesByTypePanel.test.jsx +86 -0
- package/src/app/pages/OverviewPage/__tests__/OverviewPanel.test.jsx +78 -0
- package/src/app/pages/OverviewPage/__tests__/TrendsPanel.test.jsx +120 -0
- package/src/app/pages/OverviewPage/__tests__/index.test.jsx +54 -0
- package/src/app/pages/OverviewPage/index.jsx +22 -0
- package/src/app/pages/RegisterTablePage/Loadable.jsx +16 -0
- package/src/app/pages/RegisterTablePage/__tests__/RegisterTablePage.test.jsx +110 -0
- package/src/app/pages/RegisterTablePage/__tests__/__snapshots__/RegisterTablePage.test.jsx.snap +38 -0
- package/src/app/pages/RegisterTablePage/index.jsx +142 -0
- package/src/app/pages/Root/__tests__/index.test.jsx +79 -0
- package/src/app/pages/Root/index.tsx +84 -6
- package/src/app/pages/SQLBuilderPage/Loadable.jsx +16 -0
- package/src/app/pages/SQLBuilderPage/__tests__/index.test.jsx +173 -0
- package/src/app/pages/SQLBuilderPage/index.jsx +390 -0
- package/src/app/pages/TagPage/Loadable.jsx +16 -0
- package/src/app/pages/TagPage/__tests__/TagPage.test.jsx +70 -0
- package/src/app/pages/TagPage/index.jsx +79 -0
- package/src/app/services/DJService.js +1314 -21
- package/src/app/services/__tests__/DJService.test.jsx +1559 -0
- package/src/index.tsx +1 -0
- package/src/mocks/mockNodes.jsx +1474 -0
- package/src/setupTests.ts +31 -1
- package/src/styles/dag.css +117 -5
- package/src/styles/index.css +1027 -30
- package/src/styles/loading.css +34 -0
- package/src/styles/login.css +81 -0
- package/src/styles/node-creation.scss +276 -0
- package/src/styles/node-list.css +4 -0
- package/src/styles/overview.css +72 -0
- package/src/styles/sorted-table.css +15 -0
- package/src/styles/styles.scss +44 -0
- package/src/styles/styles.scss.d.ts +9 -0
- package/src/utils/form.jsx +23 -0
- package/webpack.config.js +16 -6
- package/.babelrc +0 -4
- package/.env.local +0 -4
- package/.env.production +0 -1
- package/.github/pull_request_template.md +0 -11
- package/.github/workflows/ci.yml +0 -33
- package/.vscode/extensions.json +0 -7
- package/.vscode/launch.json +0 -15
- package/.vscode/settings.json +0 -25
- package/Dockerfile +0 -7
- package/src/app/pages/ListNamespacesPage/Loadable.jsx +0 -14
- package/src/app/pages/ListNamespacesPage/index.jsx +0 -62
- package/src/app/pages/NamespacePage/__tests__/__snapshots__/index.test.tsx.snap +0 -45
- package/src/app/pages/NamespacePage/__tests__/index.test.tsx +0 -14
|
@@ -0,0 +1,172 @@
|
|
|
1
|
+
import { Light as SyntaxHighlighter } from 'react-syntax-highlighter';
|
|
2
|
+
import { solarizedDark } from 'react-syntax-highlighter/src/styles/hljs';
|
|
3
|
+
import React from 'react';
|
|
4
|
+
|
|
5
|
+
export default function QueryInfo({
|
|
6
|
+
id,
|
|
7
|
+
state,
|
|
8
|
+
engine_name,
|
|
9
|
+
engine_version,
|
|
10
|
+
errors,
|
|
11
|
+
links,
|
|
12
|
+
output_table,
|
|
13
|
+
scheduled,
|
|
14
|
+
started,
|
|
15
|
+
finished,
|
|
16
|
+
numRows,
|
|
17
|
+
isList = false,
|
|
18
|
+
}) {
|
|
19
|
+
return isList === false ? (
|
|
20
|
+
<div className="table-responsive">
|
|
21
|
+
<table className="card-inner-table table">
|
|
22
|
+
<thead className="fs-7 fw-bold text-gray-400 border-bottom-0">
|
|
23
|
+
<tr>
|
|
24
|
+
<th>Query ID</th>
|
|
25
|
+
<th>Engine</th>
|
|
26
|
+
<th>State</th>
|
|
27
|
+
<th>Scheduled</th>
|
|
28
|
+
<th>Started</th>
|
|
29
|
+
<th>Errors</th>
|
|
30
|
+
<th>Links</th>
|
|
31
|
+
<th>Output Table</th>
|
|
32
|
+
<th>Number of Rows</th>
|
|
33
|
+
</tr>
|
|
34
|
+
</thead>
|
|
35
|
+
<tbody>
|
|
36
|
+
<tr>
|
|
37
|
+
<td>
|
|
38
|
+
<span className="rounded-pill badge bg-secondary-soft">{id}</span>
|
|
39
|
+
</td>
|
|
40
|
+
<td>
|
|
41
|
+
<span className="rounded-pill badge bg-secondary-soft">
|
|
42
|
+
{engine_name}
|
|
43
|
+
{' - '}
|
|
44
|
+
{engine_version}
|
|
45
|
+
</span>
|
|
46
|
+
</td>
|
|
47
|
+
<td>{state}</td>
|
|
48
|
+
<td>{scheduled}</td>
|
|
49
|
+
<td>{started}</td>
|
|
50
|
+
<td>
|
|
51
|
+
{errors?.length ? (
|
|
52
|
+
errors.map((e, idx) => (
|
|
53
|
+
<p key={`error-${idx}`}>
|
|
54
|
+
<span className="rounded-pill badge bg-secondary-error">
|
|
55
|
+
{e}
|
|
56
|
+
</span>
|
|
57
|
+
</p>
|
|
58
|
+
))
|
|
59
|
+
) : (
|
|
60
|
+
<></>
|
|
61
|
+
)}
|
|
62
|
+
</td>
|
|
63
|
+
<td>
|
|
64
|
+
{links?.length ? (
|
|
65
|
+
links.map((link, idx) => (
|
|
66
|
+
<p key={idx}>
|
|
67
|
+
<a href={link} target="_blank" rel="noreferrer">
|
|
68
|
+
{link}
|
|
69
|
+
</a>
|
|
70
|
+
</p>
|
|
71
|
+
))
|
|
72
|
+
) : (
|
|
73
|
+
<></>
|
|
74
|
+
)}
|
|
75
|
+
</td>
|
|
76
|
+
<td>{output_table}</td>
|
|
77
|
+
<td>{numRows}</td>
|
|
78
|
+
</tr>
|
|
79
|
+
</tbody>
|
|
80
|
+
</table>
|
|
81
|
+
</div>
|
|
82
|
+
) : (
|
|
83
|
+
<div className="rightbottom">
|
|
84
|
+
<ul style={{ padding: '20px' }}>
|
|
85
|
+
<li className={'query-info'}>
|
|
86
|
+
<label>Query ID</label>{' '}
|
|
87
|
+
<span className="tag_value rounded-pill badge">
|
|
88
|
+
{links?.length ? (
|
|
89
|
+
<a
|
|
90
|
+
href={links[links.length - 1]}
|
|
91
|
+
target={'_blank'}
|
|
92
|
+
rel="noreferrer"
|
|
93
|
+
>
|
|
94
|
+
{id}
|
|
95
|
+
</a>
|
|
96
|
+
) : (
|
|
97
|
+
id
|
|
98
|
+
)}
|
|
99
|
+
</span>
|
|
100
|
+
</li>
|
|
101
|
+
<li className={'query-info'}>
|
|
102
|
+
<label>State</label>
|
|
103
|
+
<span className="tag_value rounded-pill badge">{state}</span>
|
|
104
|
+
</li>
|
|
105
|
+
<li className={'query-info'}>
|
|
106
|
+
<label>Engine</label>{' '}
|
|
107
|
+
<span className="tag_value rounded-pill badge">
|
|
108
|
+
{engine_name}
|
|
109
|
+
{' - '}
|
|
110
|
+
{engine_version}
|
|
111
|
+
</span>
|
|
112
|
+
</li>
|
|
113
|
+
<li className={'query-info'}>
|
|
114
|
+
<label>Scheduled</label> {scheduled}
|
|
115
|
+
</li>
|
|
116
|
+
<li className={'query-info'}>
|
|
117
|
+
<label>Started</label> {started}
|
|
118
|
+
</li>
|
|
119
|
+
<li className={'query-info'}>
|
|
120
|
+
<label>Finished</label> {finished}
|
|
121
|
+
</li>
|
|
122
|
+
<li className={'query-info'}>
|
|
123
|
+
<label>Logs</label>{' '}
|
|
124
|
+
{errors?.length ? (
|
|
125
|
+
errors.map(error => (
|
|
126
|
+
<div
|
|
127
|
+
style={{
|
|
128
|
+
height: '800px',
|
|
129
|
+
width: '80%',
|
|
130
|
+
overflow: 'scroll',
|
|
131
|
+
borderRadius: '0',
|
|
132
|
+
border: '1px solid #ccc',
|
|
133
|
+
}}
|
|
134
|
+
className="queryrunner-query"
|
|
135
|
+
>
|
|
136
|
+
<SyntaxHighlighter
|
|
137
|
+
language="javascript"
|
|
138
|
+
style={solarizedDark}
|
|
139
|
+
wrapLines={true}
|
|
140
|
+
>
|
|
141
|
+
{error}
|
|
142
|
+
</SyntaxHighlighter>
|
|
143
|
+
</div>
|
|
144
|
+
))
|
|
145
|
+
) : (
|
|
146
|
+
<></>
|
|
147
|
+
)}
|
|
148
|
+
</li>
|
|
149
|
+
<li className={'query-info'}>
|
|
150
|
+
<label>Links:</label>{' '}
|
|
151
|
+
{links?.length ? (
|
|
152
|
+
links.map((link, idx) => (
|
|
153
|
+
<p key={idx}>
|
|
154
|
+
<a href={link} target="_blank" rel="noreferrer">
|
|
155
|
+
{link}
|
|
156
|
+
</a>
|
|
157
|
+
</p>
|
|
158
|
+
))
|
|
159
|
+
) : (
|
|
160
|
+
<></>
|
|
161
|
+
)}
|
|
162
|
+
</li>
|
|
163
|
+
<li className={'query-info'}>
|
|
164
|
+
<label>Output Table:</label> {output_table}
|
|
165
|
+
</li>
|
|
166
|
+
<li className={'query-info'}>
|
|
167
|
+
<label>Rows:</label> {numRows}
|
|
168
|
+
</li>
|
|
169
|
+
</ul>
|
|
170
|
+
</div>
|
|
171
|
+
);
|
|
172
|
+
}
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
import { useState, useEffect, useContext } from 'react';
|
|
2
|
+
import DJClientContext from '../providers/djclient';
|
|
3
|
+
import Fuse from 'fuse.js';
|
|
4
|
+
|
|
5
|
+
import './search.css';
|
|
6
|
+
|
|
7
|
+
export default function Search() {
|
|
8
|
+
const [fuse, setFuse] = useState();
|
|
9
|
+
const [searchValue, setSearchValue] = useState('');
|
|
10
|
+
const [searchResults, setSearchResults] = useState([]);
|
|
11
|
+
|
|
12
|
+
const djClient = useContext(DJClientContext).DataJunctionAPI;
|
|
13
|
+
|
|
14
|
+
const truncate = str => {
|
|
15
|
+
if (str === null) {
|
|
16
|
+
return '';
|
|
17
|
+
}
|
|
18
|
+
return str.length > 100 ? str.substring(0, 90) + '...' : str;
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
useEffect(() => {
|
|
22
|
+
const fetchNodes = async () => {
|
|
23
|
+
try {
|
|
24
|
+
const [data, tags] = await Promise.all([
|
|
25
|
+
djClient.nodeDetails(),
|
|
26
|
+
djClient.listTags(),
|
|
27
|
+
]);
|
|
28
|
+
const allEntities = data.concat(
|
|
29
|
+
(tags || []).map(tag => {
|
|
30
|
+
tag.type = 'tag';
|
|
31
|
+
return tag;
|
|
32
|
+
}),
|
|
33
|
+
);
|
|
34
|
+
const fuse = new Fuse(allEntities || [], {
|
|
35
|
+
keys: [
|
|
36
|
+
'name', // will be assigned a `weight` of 1
|
|
37
|
+
{ name: 'description', weight: 2 },
|
|
38
|
+
{ name: 'display_name', weight: 3 },
|
|
39
|
+
{ name: 'type', weight: 4 },
|
|
40
|
+
{ name: 'tag_type', weight: 5 },
|
|
41
|
+
],
|
|
42
|
+
});
|
|
43
|
+
setFuse(fuse);
|
|
44
|
+
} catch (error) {
|
|
45
|
+
console.error('Error fetching nodes or tags:', error);
|
|
46
|
+
}
|
|
47
|
+
};
|
|
48
|
+
fetchNodes();
|
|
49
|
+
}, []);
|
|
50
|
+
|
|
51
|
+
const handleChange = e => {
|
|
52
|
+
setSearchValue(e.target.value);
|
|
53
|
+
if (fuse) {
|
|
54
|
+
setSearchResults(fuse.search(e.target.value).map(result => result.item));
|
|
55
|
+
}
|
|
56
|
+
};
|
|
57
|
+
|
|
58
|
+
return (
|
|
59
|
+
<div>
|
|
60
|
+
<form
|
|
61
|
+
className="search-box"
|
|
62
|
+
onSubmit={e => {
|
|
63
|
+
e.preventDefault();
|
|
64
|
+
}}
|
|
65
|
+
>
|
|
66
|
+
<input
|
|
67
|
+
type="text"
|
|
68
|
+
placeholder="Search"
|
|
69
|
+
name="search"
|
|
70
|
+
value={searchValue}
|
|
71
|
+
onChange={handleChange}
|
|
72
|
+
/>
|
|
73
|
+
</form>
|
|
74
|
+
<div className="search-results">
|
|
75
|
+
{searchResults.slice(0, 20).map(item => {
|
|
76
|
+
const itemUrl =
|
|
77
|
+
item.type !== 'tag' ? `/nodes/${item.name}` : `/tags/${item.name}`;
|
|
78
|
+
return (
|
|
79
|
+
<a href={itemUrl}>
|
|
80
|
+
<div key={item.name} className="search-result-item">
|
|
81
|
+
<span className={`node_type__${item.type} badge node_type`}>
|
|
82
|
+
{item.type}
|
|
83
|
+
</span>
|
|
84
|
+
{item.display_name} (<b>{item.name}</b>){' '}
|
|
85
|
+
{item.description ? '- ' : ' '}
|
|
86
|
+
{truncate(item.description || '')}
|
|
87
|
+
</div>
|
|
88
|
+
</a>
|
|
89
|
+
);
|
|
90
|
+
})}
|
|
91
|
+
</div>
|
|
92
|
+
</div>
|
|
93
|
+
);
|
|
94
|
+
}
|
|
@@ -7,7 +7,14 @@ export default class Tab extends Component {
|
|
|
7
7
|
<div className={selectedTab === id ? 'col active' : 'col'}>
|
|
8
8
|
<div className="header-tabs nav-overflow nav nav-tabs">
|
|
9
9
|
<div className="nav-item">
|
|
10
|
-
<button
|
|
10
|
+
<button
|
|
11
|
+
id={id}
|
|
12
|
+
className="nav-link"
|
|
13
|
+
tabIndex="0"
|
|
14
|
+
onClick={onClick}
|
|
15
|
+
aria-label={this.props.name}
|
|
16
|
+
aria-hidden="false"
|
|
17
|
+
>
|
|
11
18
|
{this.props.name}
|
|
12
19
|
</button>
|
|
13
20
|
</div>
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
|
|
3
|
+
const ToggleSwitch = ({ checked, onChange, toggleName }) => (
|
|
4
|
+
<>
|
|
5
|
+
<input
|
|
6
|
+
id="show-compiled-sql-toggle"
|
|
7
|
+
role="checkbox"
|
|
8
|
+
aria-label="ToggleSwitch"
|
|
9
|
+
aria-hidden="false"
|
|
10
|
+
type="checkbox"
|
|
11
|
+
className="checkbox"
|
|
12
|
+
checked={checked}
|
|
13
|
+
onChange={e => onChange(e.target.checked)}
|
|
14
|
+
/>
|
|
15
|
+
<label htmlFor="show-compiled-sql-toggle" className="switch"></label>{' '}
|
|
16
|
+
{toggleName}
|
|
17
|
+
</>
|
|
18
|
+
);
|
|
19
|
+
|
|
20
|
+
export default ToggleSwitch;
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { screen, waitFor } from '@testing-library/react';
|
|
3
|
+
import fetchMock from 'jest-fetch-mock';
|
|
4
|
+
import userEvent from '@testing-library/user-event';
|
|
5
|
+
import { render } from '../../../setupTests';
|
|
6
|
+
import DJClientContext from '../../providers/djclient';
|
|
7
|
+
import NodeListActions from '../NodeListActions';
|
|
8
|
+
|
|
9
|
+
describe('<NodeListActions />', () => {
|
|
10
|
+
beforeEach(() => {
|
|
11
|
+
fetchMock.resetMocks();
|
|
12
|
+
jest.clearAllMocks();
|
|
13
|
+
window.scrollTo = jest.fn();
|
|
14
|
+
});
|
|
15
|
+
|
|
16
|
+
const renderElement = djClient => {
|
|
17
|
+
return render(
|
|
18
|
+
<DJClientContext.Provider value={djClient}>
|
|
19
|
+
<NodeListActions nodeName="default.hard_hat" />
|
|
20
|
+
</DJClientContext.Provider>,
|
|
21
|
+
);
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
const initializeMockDJClient = () => {
|
|
25
|
+
return {
|
|
26
|
+
DataJunctionAPI: {
|
|
27
|
+
deactivate: jest.fn(),
|
|
28
|
+
},
|
|
29
|
+
};
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
it('deletes a node when clicked', async () => {
|
|
33
|
+
global.confirm = () => true;
|
|
34
|
+
const mockDjClient = initializeMockDJClient();
|
|
35
|
+
mockDjClient.DataJunctionAPI.deactivate.mockReturnValue({
|
|
36
|
+
status: 204,
|
|
37
|
+
json: { name: 'source.warehouse.schema.some_table' },
|
|
38
|
+
});
|
|
39
|
+
|
|
40
|
+
renderElement(mockDjClient);
|
|
41
|
+
|
|
42
|
+
await userEvent.click(screen.getByRole('button'));
|
|
43
|
+
|
|
44
|
+
await waitFor(() => {
|
|
45
|
+
expect(mockDjClient.DataJunctionAPI.deactivate).toBeCalled();
|
|
46
|
+
expect(mockDjClient.DataJunctionAPI.deactivate).toBeCalledWith(
|
|
47
|
+
'default.hard_hat',
|
|
48
|
+
);
|
|
49
|
+
});
|
|
50
|
+
expect(
|
|
51
|
+
screen.getByText('Successfully deleted node default.hard_hat'),
|
|
52
|
+
).toBeInTheDocument();
|
|
53
|
+
}, 60000);
|
|
54
|
+
|
|
55
|
+
it('skips a node deletion during confirm', async () => {
|
|
56
|
+
global.confirm = () => false;
|
|
57
|
+
const mockDjClient = initializeMockDJClient();
|
|
58
|
+
mockDjClient.DataJunctionAPI.deactivate.mockReturnValue({
|
|
59
|
+
status: 204,
|
|
60
|
+
json: { name: 'source.warehouse.schema.some_table' },
|
|
61
|
+
});
|
|
62
|
+
|
|
63
|
+
renderElement(mockDjClient);
|
|
64
|
+
|
|
65
|
+
await userEvent.click(screen.getByRole('button'));
|
|
66
|
+
|
|
67
|
+
await waitFor(() => {
|
|
68
|
+
expect(mockDjClient.DataJunctionAPI.deactivate).not.toBeCalled();
|
|
69
|
+
});
|
|
70
|
+
}, 60000);
|
|
71
|
+
|
|
72
|
+
it('fail deleting a node when clicked', async () => {
|
|
73
|
+
global.confirm = () => true;
|
|
74
|
+
const mockDjClient = initializeMockDJClient();
|
|
75
|
+
mockDjClient.DataJunctionAPI.deactivate.mockReturnValue({
|
|
76
|
+
status: 777,
|
|
77
|
+
json: { message: 'source.warehouse.schema.some_table' },
|
|
78
|
+
});
|
|
79
|
+
|
|
80
|
+
renderElement(mockDjClient);
|
|
81
|
+
|
|
82
|
+
await userEvent.click(screen.getByRole('button'));
|
|
83
|
+
|
|
84
|
+
await waitFor(() => {
|
|
85
|
+
expect(mockDjClient.DataJunctionAPI.deactivate).toBeCalled();
|
|
86
|
+
expect(mockDjClient.DataJunctionAPI.deactivate).toBeCalledWith(
|
|
87
|
+
'default.hard_hat',
|
|
88
|
+
);
|
|
89
|
+
});
|
|
90
|
+
expect(
|
|
91
|
+
screen.getByText('source.warehouse.schema.some_table'),
|
|
92
|
+
).toBeInTheDocument();
|
|
93
|
+
}, 60000);
|
|
94
|
+
});
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { render, screen } from '@testing-library/react';
|
|
3
|
+
import QueryInfo from '../QueryInfo';
|
|
4
|
+
|
|
5
|
+
describe('<QueryInfo />', () => {
|
|
6
|
+
const defaultProps = {
|
|
7
|
+
id: '123',
|
|
8
|
+
state: 'Running',
|
|
9
|
+
engine_name: 'Spark SQL',
|
|
10
|
+
engine_version: '1.0',
|
|
11
|
+
errors: ['Error 1', 'Error 2'],
|
|
12
|
+
links: ['http://example.com', 'http://example2.com'],
|
|
13
|
+
output_table: 'table1',
|
|
14
|
+
scheduled: '2023-09-06',
|
|
15
|
+
started: '2023-09-07',
|
|
16
|
+
numRows: 1000,
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
it('renders without crashing', () => {
|
|
20
|
+
render(<QueryInfo {...defaultProps} />);
|
|
21
|
+
});
|
|
22
|
+
|
|
23
|
+
it('displays correct query information', () => {
|
|
24
|
+
render(<QueryInfo {...defaultProps} />);
|
|
25
|
+
|
|
26
|
+
expect(screen.getByText(defaultProps.id)).toBeInTheDocument();
|
|
27
|
+
expect(
|
|
28
|
+
screen.getByText(
|
|
29
|
+
`${defaultProps.engine_name} - ${defaultProps.engine_version}`,
|
|
30
|
+
),
|
|
31
|
+
).toBeInTheDocument();
|
|
32
|
+
expect(screen.getByText(defaultProps.state)).toBeInTheDocument();
|
|
33
|
+
expect(screen.getByText(defaultProps.scheduled)).toBeInTheDocument();
|
|
34
|
+
expect(screen.getByText(defaultProps.started)).toBeInTheDocument();
|
|
35
|
+
expect(screen.getByText(defaultProps.output_table)).toBeInTheDocument();
|
|
36
|
+
expect(screen.getByText(String(defaultProps.numRows))).toBeInTheDocument();
|
|
37
|
+
defaultProps.errors.forEach(error => {
|
|
38
|
+
expect(screen.getByText(error)).toBeInTheDocument();
|
|
39
|
+
});
|
|
40
|
+
defaultProps.links.forEach(link => {
|
|
41
|
+
expect(screen.getByText(link)).toHaveAttribute('href', link);
|
|
42
|
+
});
|
|
43
|
+
});
|
|
44
|
+
|
|
45
|
+
it('does not render errors and links when they are not provided', () => {
|
|
46
|
+
render(<QueryInfo {...defaultProps} errors={[]} links={[]} />);
|
|
47
|
+
|
|
48
|
+
defaultProps.errors.forEach(error => {
|
|
49
|
+
expect(screen.queryByText(error)).not.toBeInTheDocument();
|
|
50
|
+
});
|
|
51
|
+
defaultProps.links.forEach(link => {
|
|
52
|
+
expect(screen.queryByText(link)).not.toBeInTheDocument();
|
|
53
|
+
});
|
|
54
|
+
});
|
|
55
|
+
});
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { render, screen, fireEvent } from '@testing-library/react';
|
|
3
|
+
import Search from '../Search';
|
|
4
|
+
import DJClientContext from '../../providers/djclient';
|
|
5
|
+
import { Root } from '../../pages/Root';
|
|
6
|
+
import { HelmetProvider } from 'react-helmet-async';
|
|
7
|
+
|
|
8
|
+
describe('<Search />', () => {
|
|
9
|
+
const mockDjClient = {
|
|
10
|
+
logout: jest.fn(),
|
|
11
|
+
nodeDetails: async () => [
|
|
12
|
+
{
|
|
13
|
+
name: 'default.repair_orders',
|
|
14
|
+
display_name: 'Default: Repair Orders',
|
|
15
|
+
description: 'Repair orders',
|
|
16
|
+
version: 'v1.0',
|
|
17
|
+
type: 'source',
|
|
18
|
+
status: 'valid',
|
|
19
|
+
mode: 'published',
|
|
20
|
+
updated_at: '2023-08-21T16:48:52.880498+00:00',
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
name: 'default.repair_order_details',
|
|
24
|
+
display_name: 'Default: Repair Order Details',
|
|
25
|
+
description: 'Details on repair orders',
|
|
26
|
+
version: 'v1.0',
|
|
27
|
+
type: 'source',
|
|
28
|
+
status: 'valid',
|
|
29
|
+
mode: 'published',
|
|
30
|
+
updated_at: '2023-08-21T16:48:52.981201+00:00',
|
|
31
|
+
},
|
|
32
|
+
],
|
|
33
|
+
listTags: async () => [
|
|
34
|
+
{
|
|
35
|
+
description: 'something',
|
|
36
|
+
display_name: 'Report A',
|
|
37
|
+
tag_metadata: {},
|
|
38
|
+
name: 'report.a',
|
|
39
|
+
tag_type: 'report',
|
|
40
|
+
},
|
|
41
|
+
{
|
|
42
|
+
description: 'report B',
|
|
43
|
+
display_name: 'Report B',
|
|
44
|
+
tag_metadata: {},
|
|
45
|
+
name: 'report.b',
|
|
46
|
+
tag_type: 'report',
|
|
47
|
+
},
|
|
48
|
+
],
|
|
49
|
+
};
|
|
50
|
+
|
|
51
|
+
it('displays search results correctly', () => {
|
|
52
|
+
render(
|
|
53
|
+
<HelmetProvider>
|
|
54
|
+
<DJClientContext.Provider value={{ DataJunctionAPI: mockDjClient }}>
|
|
55
|
+
<Root />
|
|
56
|
+
</DJClientContext.Provider>
|
|
57
|
+
</HelmetProvider>,
|
|
58
|
+
);
|
|
59
|
+
const searchInput = screen.queryByPlaceholderText('Search');
|
|
60
|
+
fireEvent.change(searchInput, { target: { value: 'Repair' } });
|
|
61
|
+
expect(searchInput.value).toBe('Repair');
|
|
62
|
+
});
|
|
63
|
+
});
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { render, fireEvent } from '@testing-library/react';
|
|
3
|
+
|
|
4
|
+
import Tab from '../Tab';
|
|
5
|
+
|
|
6
|
+
describe('<Tab />', () => {
|
|
7
|
+
it('renders without crashing', () => {
|
|
8
|
+
render(<Tab />);
|
|
9
|
+
});
|
|
10
|
+
|
|
11
|
+
it('has the active class when selectedTab matches id', () => {
|
|
12
|
+
const { container } = render(<Tab id="1" selectedTab="1" />);
|
|
13
|
+
expect(container.querySelector('.col')).toHaveClass('active');
|
|
14
|
+
});
|
|
15
|
+
|
|
16
|
+
it('does not have the active class when selectedTab does not match id', () => {
|
|
17
|
+
const { container } = render(<Tab id="1" selectedTab="2" />);
|
|
18
|
+
expect(container.querySelector('.col')).not.toHaveClass('active');
|
|
19
|
+
});
|
|
20
|
+
|
|
21
|
+
it('calls onClick when the button is clicked', () => {
|
|
22
|
+
const onClickMock = jest.fn();
|
|
23
|
+
const { getByRole } = render(<Tab id="1" onClick={onClickMock} />);
|
|
24
|
+
fireEvent.click(getByRole('button'));
|
|
25
|
+
expect(onClickMock).toHaveBeenCalledTimes(1);
|
|
26
|
+
});
|
|
27
|
+
});
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { render, fireEvent, screen } from '@testing-library/react';
|
|
3
|
+
import ToggleSwitch from '../ToggleSwitch';
|
|
4
|
+
|
|
5
|
+
describe('<ToggleSwitch />', () => {
|
|
6
|
+
const defaultProps = {
|
|
7
|
+
checked: false,
|
|
8
|
+
onChange: jest.fn(),
|
|
9
|
+
toggleName: 'Toggle Switch',
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
it('renders without crashing', () => {
|
|
13
|
+
render(<ToggleSwitch {...defaultProps} />);
|
|
14
|
+
});
|
|
15
|
+
|
|
16
|
+
it('displays the correct toggle name', () => {
|
|
17
|
+
render(<ToggleSwitch {...defaultProps} />);
|
|
18
|
+
expect(screen.getByText(defaultProps.toggleName)).toBeInTheDocument();
|
|
19
|
+
});
|
|
20
|
+
|
|
21
|
+
it('reflects the checked state correctly', () => {
|
|
22
|
+
render(<ToggleSwitch {...defaultProps} checked={true} />);
|
|
23
|
+
const checkbox = screen.getByRole('checkbox');
|
|
24
|
+
expect(checkbox).toBeChecked();
|
|
25
|
+
});
|
|
26
|
+
|
|
27
|
+
it('calls onChange with the correct value when toggled', () => {
|
|
28
|
+
render(<ToggleSwitch {...defaultProps} />);
|
|
29
|
+
const checkbox = screen.getByRole('checkbox');
|
|
30
|
+
|
|
31
|
+
fireEvent.click(checkbox);
|
|
32
|
+
expect(defaultProps.onChange).toHaveBeenCalledWith(true);
|
|
33
|
+
|
|
34
|
+
fireEvent.click(checkbox);
|
|
35
|
+
expect(checkbox).not.toBeChecked();
|
|
36
|
+
});
|
|
37
|
+
|
|
38
|
+
it('is unchecked by default if no checked prop is provided', () => {
|
|
39
|
+
render(<ToggleSwitch onChange={jest.fn()} toggleName="Test Toggle" />);
|
|
40
|
+
const checkbox = screen.getByRole('checkbox');
|
|
41
|
+
expect(checkbox).not.toBeChecked();
|
|
42
|
+
});
|
|
43
|
+
});
|
|
@@ -14,11 +14,16 @@ exports[`<ListGroupItem /> should render and match the snapshot 1`] = `
|
|
|
14
14
|
Name
|
|
15
15
|
</h6>
|
|
16
16
|
<p
|
|
17
|
+
aria-hidden="false"
|
|
18
|
+
aria-label="Name"
|
|
17
19
|
className="mb-0 opacity-75"
|
|
20
|
+
role="dialog"
|
|
18
21
|
>
|
|
19
|
-
<
|
|
20
|
-
|
|
21
|
-
|
|
22
|
+
<Markdown>
|
|
23
|
+
<span>
|
|
24
|
+
Something
|
|
25
|
+
</span>
|
|
26
|
+
</Markdown>
|
|
22
27
|
</p>
|
|
23
28
|
</div>
|
|
24
29
|
</div>
|
|
@@ -8,25 +8,9 @@ exports[`<NamespaceHeader /> should render and match the snapshot 1`] = `
|
|
|
8
8
|
className="breadcrumb-item"
|
|
9
9
|
>
|
|
10
10
|
<a
|
|
11
|
-
href="/
|
|
11
|
+
href="/"
|
|
12
12
|
>
|
|
13
|
-
<
|
|
14
|
-
className="bi bi-house-door-fill"
|
|
15
|
-
fill="currentColor"
|
|
16
|
-
height="16"
|
|
17
|
-
style={
|
|
18
|
-
Object {
|
|
19
|
-
"paddingBottom": "0.2rem",
|
|
20
|
-
}
|
|
21
|
-
}
|
|
22
|
-
viewBox="0 0 16 16"
|
|
23
|
-
width="16"
|
|
24
|
-
xmlns="http://www.w3.org/2000/svg"
|
|
25
|
-
>
|
|
26
|
-
<path
|
|
27
|
-
d="M6.5 14.5v-3.505c0-.245.25-.495.5-.495h2c.25 0 .5.25.5.5v3.5a.5.5 0 0 0 .5.5h4a.5.5 0 0 0 .5-.5v-7a.5.5 0 0 0-.146-.354L13 5.793V2.5a.5.5 0 0 0-.5-.5h-1a.5.5 0 0 0-.5.5v1.293L8.354 1.146a.5.5 0 0 0-.708 0l-6 6A.5.5 0 0 0 1.5 7.5v7a.5.5 0 0 0 .5.5h4a.5.5 0 0 0 .5-.5Z"
|
|
28
|
-
/>
|
|
29
|
-
</svg>
|
|
13
|
+
<HorizontalHierarchyIcon />
|
|
30
14
|
</a>
|
|
31
15
|
</li>
|
|
32
16
|
<li
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { DJNodeDimensions } from './DJNodeDimensions';
|
|
3
|
+
import { DJNodeColumns } from './DJNodeColumns';
|
|
4
|
+
|
|
5
|
+
export default function Collapse({ collapsed, text, data }) {
|
|
6
|
+
const [isCollapsed, setIsCollapsed] = React.useState(collapsed);
|
|
7
|
+
|
|
8
|
+
const limit = 5;
|
|
9
|
+
return (
|
|
10
|
+
<>
|
|
11
|
+
<div className="collapse">
|
|
12
|
+
{data.type === 'metric' ? (
|
|
13
|
+
<button
|
|
14
|
+
className="collapse-button"
|
|
15
|
+
onClick={() => setIsCollapsed(!isCollapsed)}
|
|
16
|
+
>
|
|
17
|
+
{isCollapsed ? '\u25B6 Show' : '\u25BC Hide'} {text}
|
|
18
|
+
</button>
|
|
19
|
+
) : (
|
|
20
|
+
''
|
|
21
|
+
)}
|
|
22
|
+
<div
|
|
23
|
+
className={`collapse-content ${
|
|
24
|
+
isCollapsed && data.type === 'metric' ? 'collapsed' : 'expanded'
|
|
25
|
+
}`}
|
|
26
|
+
aria-expanded={isCollapsed}
|
|
27
|
+
>
|
|
28
|
+
{data.type !== 'metric'
|
|
29
|
+
? isCollapsed
|
|
30
|
+
? DJNodeColumns({ data: data, limit: limit })
|
|
31
|
+
: DJNodeColumns({ data: data, limit: 100 })
|
|
32
|
+
: DJNodeDimensions(data)}
|
|
33
|
+
</div>
|
|
34
|
+
{data.type !== 'metric' && data.column_names.length > limit ? (
|
|
35
|
+
<button
|
|
36
|
+
className="collapse-button"
|
|
37
|
+
onClick={() => setIsCollapsed(!isCollapsed)}
|
|
38
|
+
>
|
|
39
|
+
{isCollapsed ? '\u25B6 More' : '\u25BC Less'} {text}
|
|
40
|
+
</button>
|
|
41
|
+
) : (
|
|
42
|
+
''
|
|
43
|
+
)}
|
|
44
|
+
</div>
|
|
45
|
+
</>
|
|
46
|
+
);
|
|
47
|
+
}
|