Skip to content

Commit 35d0187

Browse files
authored
Merge pull request #284 from terminusdb/add-change-request-optional
Add change request optional
2 parents beb1f4a + 4cca077 commit 35d0187

File tree

21 files changed

+201
-137
lines changed

21 files changed

+201
-137
lines changed

package-lock.json

Lines changed: 36 additions & 22 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/tdb-access-control-component/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@
4444
"repository": {},
4545
"author": "terminusdb group",
4646
"dependencies": {
47-
"@terminusdb/terminusdb-client": "^10.0.29",
47+
"@terminusdb/terminusdb-client": "^10.0.31",
4848
"classnames": "^2.2.5",
4949
"react-bootstrap": "^2.7.0",
5050
"react-icons": "^4.3.1"

packages/tdb-dashboard/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@
5555
"@graphiql/toolkit": "^0.8.0",
5656
"@stripe/react-stripe-js": "^1.16.4",
5757
"@stripe/stripe-js": "^1.46.0",
58-
"@terminusdb/terminusdb-client": "^10.0.29",
58+
"@terminusdb/terminusdb-client": "^10.0.31",
5959
"allotment": "^1.19.0",
6060
"axios": "^0.21.1",
6161
"classnames": "^2.2.5",

packages/tdb-dashboard/src/App.js

Lines changed: 28 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,11 @@ import {PLANS} from "./routing/constants";
3232
import {GraphqlHandlerbarsPage} from "./pages/GraphqlHandlerbarsPage"
3333
import {FreeTextSearch} from "./pages/FreeTextSearch"
3434
import { IndexingActionMonitor } from "./pages/IndexingActionMonitor"
35+
import {ProductHomePage} from "./pages/ProductHomePage"
3536

3637
export function App (props){
3738
let navigate = useNavigate();
38-
const {connectionError,loadingServer,clientUser,accessControlDashboard,woqlClient} = WOQLClientObj()
39+
const {connectionError,loadingServer,clientUser,accessControlDashboard,useChangeRequest} = WOQLClientObj()
3940
if(!clientUser) return ""
4041
// we have this loading only in terminusX, it is auth0 information/login loading
4142
const {loading} = clientUser
@@ -69,28 +70,12 @@ export function App (props){
6970

7071
return <div className="container-fluid container-background h-100">
7172
<Routes>
72-
{getRoutes(clientUser,isAdmin, woqlClient)}
73+
{getRoutes(clientUser,isAdmin, useChangeRequest)}
7374
</Routes>
7475
</div>
7576
}
76-
/*
77-
<React.Fragment>
78-
<Route index element={<Home/>} />
79-
{ clientUser.user === "admin" && <Route path="administrator" element={<UserManagement/>}/>}
80-
{ clientUser.user !== "admin" && <Route path="administrator" element={<div><PageNotFound/></div >}/>}
81-
<Route path=":organization" >
82-
<Route index element={<OrganizationHome/>}/>
83-
<Route path="members" element={<UserManagement/>}/>
84-
<Route path=":dataProduct" >
85-
<Route index element={<DataProductsHome/>} />
86-
<Route path={PATH.DOCUMENT_EXPLORER} element={<DocumentExplorer/>} />
87-
</Route>
88-
</Route>
89-
<Route path="*" element={<div><PageNotFound/></div >} />
90-
</React.Fragment>*/
9177

92-
function getRoutes(clientUser, isAdmin, woqlClient){
93-
//const client = createApolloClient()
78+
function getRoutes(clientUser, isAdmin, useChangeRequest){
9479

9580
if(localSettings.connection_type==="LOCAL"){
9681
return <React.Fragment>
@@ -102,20 +87,20 @@ function getRoutes(clientUser, isAdmin, woqlClient){
10287
{/*<Route path = {PATH.PROFILE} element = {<PrivateRoute component={Profile}/>} /> */}
10388
{clientUser.user === "admin" && <Route path="administrator" element={<UserManagement/>}/>}
10489
{clientUser.user !== "admin" && <Route path="administrator" element={<div><PageNotFound/></div >}/>}
105-
10690
<Route path=":dataProduct" >
107-
<Route index element={<DataProductsHome/>}/>
91+
<Route index element={<ProductHomePage/>}/>
10892
<Route path={PATH.GRAPHIQL} element={<GraphIqlEditor/>} />
109-
110-
<Route path={PATH.OPENAI_CONF} element={<GraphqlHandlerbarsPage/>} />
111-
<Route path={PATH.SEARCH} element={<FreeTextSearch/>} />
112-
<Route path={PATH.ACTIONS} element={<IndexingActionMonitor/>} />
113-
114-
115-
<Route path={PATH.CHANGE_REQUESTS} >
116-
<Route index element={<ChangeRequestsPage/>} />
117-
<Route path=":changeid" element={<ChangeDiff/>} />
118-
</Route>
93+
{useChangeRequest &&
94+
<>
95+
<Route path={PATH.OPENAI_CONF} element={<GraphqlHandlerbarsPage/>} />
96+
<Route path={PATH.SEARCH} element={<FreeTextSearch/>} />
97+
<Route path={PATH.ACTIONS} element={<IndexingActionMonitor/>} />
98+
<Route path={PATH.CHANGE_REQUESTS} >
99+
<Route index element={<ChangeRequestsPage/>} />
100+
<Route path=":changeid" element={<ChangeDiff/>} />
101+
</Route>
102+
</>
103+
}
119104
<Route path={PATH.DOCUMENT_EXPLORER} element={<DocumentTemplate/>}>
120105
<Route index element={<Documents/>} />
121106
<Route path=":type">
@@ -149,16 +134,20 @@ function getRoutes(clientUser, isAdmin, woqlClient){
149134
<Route path={PATH.MEMBERS} element={<PrivateRoute component={UserManagement}/>}/>
150135

151136
<Route path=":dataProduct" >
152-
<Route path={PATH.OPENAI_CONF} element={<PrivateRoute component={GraphqlHandlerbarsPage}/>} />
153-
<Route path={PATH.SEARCH} element={<PrivateRoute component={FreeTextSearch}/>} />
154137
<Route index element={<PrivateRoute component={DataProductsHome}/>} />
155138
<Route path={PATH.GRAPHIQL} element={<PrivateRoute component={GraphIqlEditor}/>} />
156-
<Route path={PATH.ACTIONS} element={<PrivateRoute component={IndexingActionMonitor}/>} />
157-
158-
<Route path={PATH.CHANGE_REQUESTS} >
159-
<Route index element={<PrivateRoute component={ChangeRequestsPage}/>} />
160-
<Route path=":changeid" element={<PrivateRoute component={ChangeDiff}/>} />
161-
</Route>
139+
{useChangeRequest &&
140+
<>
141+
<Route path={PATH.OPENAI_CONF} element={<PrivateRoute component={GraphqlHandlerbarsPage}/>} />
142+
<Route path={PATH.SEARCH} element={<PrivateRoute component={FreeTextSearch}/>} />
143+
<Route path={PATH.ACTIONS} element={<PrivateRoute component={IndexingActionMonitor}/>} />
144+
<Route path={PATH.CHANGE_REQUESTS} >
145+
<Route index element={<PrivateRoute component={ChangeRequestsPage}/>} />
146+
<Route path=":changeid" element={<PrivateRoute component={ChangeDiff}/>} />
147+
</Route>
148+
</>
149+
}
150+
162151
<Route path={PATH.DOCUMENT_EXPLORER} element={<DocumentTemplate/>}>
163152
<Route index element={<PrivateRoute component={Documents}/>} />
164153
<Route path=":type">

packages/tdb-dashboard/src/components/DocumentsWoqlTable.js

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -39,14 +39,6 @@ export const DocumentWoqlTable = () => {
3939
setControlledRefresh,
4040
controlledRefresh
4141
} = useTDBDocumentQuery(woqlClient, type, 10)
42-
43-
/*useEffect(() => { // get documents on click of document types
44-
setBarLoading(true)
45-
setTableConfig(false)
46-
setDocumentResults(false)
47-
setControlledRefresh(controlledRefresh+1)
48-
}, [type])*/
49-
5042

5143
function extractDocuments(documentResults) {
5244
var extractedResults=[]
@@ -104,8 +96,8 @@ export const DocumentWoqlTable = () => {
10496

10597
return <React.Fragment>
10698
<Row className="mt-5 w-100">
107-
{extractedResults.length === 0 && <h3>NO RESULT</h3>}
108-
{extractedResults.length>0 && tableConfig && rowCount &&
99+
{(extractedResults.length === 0 || rowCount===0) && <h3>NO RESULT</h3>}
100+
{extractedResults.length>0 && tableConfig && rowCount!==0 &&
109101
<main className="content mr-3 ml-5 w-100 ">
110102
<Row className="w-100 mb-5">
111103
<Col md={11}>

0 commit comments

Comments
 (0)