@@ -32,10 +32,11 @@ import {PLANS} from "./routing/constants";
32
32
import { GraphqlHandlerbarsPage } from "./pages/GraphqlHandlerbarsPage"
33
33
import { FreeTextSearch } from "./pages/FreeTextSearch"
34
34
import { IndexingActionMonitor } from "./pages/IndexingActionMonitor"
35
+ import { ProductHomePage } from "./pages/ProductHomePage"
35
36
36
37
export function App ( props ) {
37
38
let navigate = useNavigate ( ) ;
38
- const { connectionError, loadingServer, clientUser, accessControlDashboard, woqlClient } = WOQLClientObj ( )
39
+ const { connectionError, loadingServer, clientUser, accessControlDashboard, useChangeRequest } = WOQLClientObj ( )
39
40
if ( ! clientUser ) return ""
40
41
// we have this loading only in terminusX, it is auth0 information/login loading
41
42
const { loading} = clientUser
@@ -69,28 +70,12 @@ export function App (props){
69
70
70
71
return < div className = "container-fluid container-background h-100" >
71
72
< Routes >
72
- { getRoutes ( clientUser , isAdmin , woqlClient ) }
73
+ { getRoutes ( clientUser , isAdmin , useChangeRequest ) }
73
74
</ Routes >
74
75
</ div >
75
76
}
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>*/
91
77
92
- function getRoutes ( clientUser , isAdmin , woqlClient ) {
93
- //const client = createApolloClient()
78
+ function getRoutes ( clientUser , isAdmin , useChangeRequest ) {
94
79
95
80
if ( localSettings . connection_type === "LOCAL" ) {
96
81
return < React . Fragment >
@@ -102,20 +87,20 @@ function getRoutes(clientUser, isAdmin, woqlClient){
102
87
{ /*<Route path = {PATH.PROFILE} element = {<PrivateRoute component={Profile}/>} /> */ }
103
88
{ clientUser . user === "admin" && < Route path = "administrator" element = { < UserManagement /> } /> }
104
89
{ clientUser . user !== "admin" && < Route path = "administrator" element = { < div > < PageNotFound /> </ div > } /> }
105
-
106
90
< Route path = ":dataProduct" >
107
- < Route index element = { < DataProductsHome /> } />
91
+ < Route index element = { < ProductHomePage /> } />
108
92
< 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
+ }
119
104
< Route path = { PATH . DOCUMENT_EXPLORER } element = { < DocumentTemplate /> } >
120
105
< Route index element = { < Documents /> } />
121
106
< Route path = ":type" >
@@ -149,16 +134,20 @@ function getRoutes(clientUser, isAdmin, woqlClient){
149
134
< Route path = { PATH . MEMBERS } element = { < PrivateRoute component = { UserManagement } /> } />
150
135
151
136
< Route path = ":dataProduct" >
152
- < Route path = { PATH . OPENAI_CONF } element = { < PrivateRoute component = { GraphqlHandlerbarsPage } /> } />
153
- < Route path = { PATH . SEARCH } element = { < PrivateRoute component = { FreeTextSearch } /> } />
154
137
< Route index element = { < PrivateRoute component = { DataProductsHome } /> } />
155
138
< 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
+
162
151
< Route path = { PATH . DOCUMENT_EXPLORER } element = { < DocumentTemplate /> } >
163
152
< Route index element = { < PrivateRoute component = { Documents } /> } />
164
153
< Route path = ":type" >
0 commit comments