@@ -32,10 +32,11 @@ import {PLANS} from "./routing/constants";
3232import { GraphqlHandlerbarsPage } from "./pages/GraphqlHandlerbarsPage"
3333import { FreeTextSearch } from "./pages/FreeTextSearch"
3434import { IndexingActionMonitor } from "./pages/IndexingActionMonitor"
35+ import { ProductHomePage } from "./pages/ProductHomePage"
3536
3637export 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" >
0 commit comments