Skip to content

Commit ed3fdcd

Browse files
Merge pull request #174 from terminusdb/fix_bug
fix bug #173 #168
2 parents 22596d9 + e96f000 commit ed3fdcd

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

64 files changed

+2769
-5607
lines changed

package-lock.json

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

packages/tdb-dashboard/package.json

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -43,11 +43,6 @@
4343
"@apollo/client": "^3.7.1",
4444
"@auth0/auth0-spa-js": "^1.19.3",
4545
"@graphiql/toolkit": "^0.8.0",
46-
"@material-ui/core": "^4.12.4",
47-
"@material-ui/icons": "^4.11.3",
48-
"@material-ui/lab": "^4.0.0-alpha.61",
49-
"@material-ui/pickers": "^3.3.10",
50-
"@mui/material": "^5.11.1",
5146
"@stripe/react-stripe-js": "^1.16.4",
5247
"@stripe/stripe-js": "^1.46.0",
5348
"@terminusdb/terminusdb-client": "^10.0.25",

packages/tdb-dashboard/src/App.css

Lines changed: 39 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1146,7 +1146,7 @@ button.graphiql-tab-add>svg
11461146
color: #343a40!important;
11471147
}
11481148

1149-
.MuiButton-contained {
1149+
/*.MuiButton-contained {
11501150
background-color: #a9a7a5;
11511151
}
11521152
.MuiButton-containedPrimary {
@@ -1173,7 +1173,7 @@ button.graphiql-tab-add>svg
11731173
}
11741174
.MuiInputBase-input{
11751175
min-height: 20px !important;
1176-
}
1176+
}*/
11771177

11781178
/*.qb-lite .group--drag-handler, .qb-lite .group--actions {
11791179
transition: opacity 0.2s;
@@ -1281,4 +1281,41 @@ button.graphiql-tab-add>svg
12811281

12821282
.alert_expand_icons {
12831283
margin-top: -20px;
1284+
}
1285+
1286+
.group {
1287+
background: transparent !important;
1288+
border: 1px solid #dee2e6;
1289+
}
1290+
1291+
.rule {
1292+
background: transparent !important;
1293+
border: 1px solid #dee2e6;
1294+
padding: 10px;
1295+
}
1296+
1297+
.rule--field > .dropdown > .form-select {
1298+
min-width: 200px;
1299+
line-height: 1.5 !important;
1300+
min-height: 40px !important;
1301+
/* background: transparent !important; */
1302+
color: black;
1303+
}
1304+
1305+
.rule--operator > .dropdown > .form-select {
1306+
min-width: 100px;
1307+
line-height: 1.5 !important;
1308+
min-height: 40px !important;
1309+
/* background: transparent !important; */
1310+
color: black;
1311+
}
1312+
1313+
.widget--widget > .form-control{
1314+
min-width: 250px;
1315+
line-height: 1.5 !important;
1316+
min-height: 40px !important;
1317+
}
1318+
1319+
.accordion{
1320+
--bs-accordion-bg: #303030 !important;
12841321
}

packages/tdb-dashboard/src/App.js

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ import {PageNotFound} from "./pages/PageNotFound"
3030
import {DocumentsPageList} from "./pages/DocumentsListPage"
3131
import {PLANS} from "./routing/constants";
3232
import { DocumentControlMain } from "./pages/DocumentControlMain"
33+
import TestApp from "./TestApp"
3334

3435
export function App (props){
3536
let navigate = useNavigate();
@@ -86,15 +87,15 @@ function getRoutes(clientUser, isAdmin, woqlClient){
8687
<Route path=":dataProduct" >
8788
<Route index element={<DataProductsHome/>} />
8889
<Route path={PATH.DOCUMENT_EXPLORER} element={<DocumentExplorer/>} />
89-
<Route path={PATH.PRODUCT_EXPLORER} element={<ProductsExplorer/>} />
90-
<Route path={PATH.PRODUCT_MODELS} element={<ModelProductPage/>} />
90+
9191
</Route>
9292
</Route>
9393
<Route path="*" element={<div><PageNotFound/></div >} />
9494
</React.Fragment>
9595
}
9696
return <React.Fragment>
97-
<Route path="/verify" element={<VerifyEmail/>}/>
97+
{/*<Route path="/verify" element={<VerifyEmail/>}/>*/}
98+
<Route path="/verify" element={<TestApp/>} />
9899
<Route path = {PATH.INVITE_PAGE} element = {<PrivateRoute component={InvitePage}/>} />
99100
<Route path={PATH.PLANS} element={<PrivateRoute component={PlansPage}/>}/>
100101
<Route index element={<PrivateRoute component={Home}/>} />
@@ -125,12 +126,15 @@ function getRoutes(clientUser, isAdmin, woqlClient){
125126
</Route>
126127
</Route>
127128
</Route>
128-
129129
<Route path={PATH.PRODUCT_EXPLORER} element={<PrivateRoute component={ProductsExplorer}/>} />
130-
<Route path={PATH.PRODUCT_MODELS} element={<PrivateRoute component={ModelProductPage}/>} />
130+
<Route path={PATH.PRODUCT_MODELS} element={<PrivateRoute component={ModelProductPage}/>} />
131+
131132
</Route>
132133
</Route>
133134

134135
<Route path="*" element={<PageNotFound/>} />
135136
</React.Fragment>
136137
}
138+
139+
// <Route path={PATH.PRODUCT_EXPLORER} element={<PrivateRoute component={ProductsExplorer}/>} />
140+
//<Route path={PATH.PRODUCT_MODELS} element={<PrivateRoute component={ModelProductPage}/>} />
Lines changed: 92 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,92 @@
1+
import React from "react"
2+
import {Routes,Route,useNavigate, BrowserRouter} from "react-router-dom"
3+
import {Loading} from "./components/Loading"
4+
import {SERVER_LOADING_MESSAGE} from "./components/constants"
5+
import {PlansPage} from "./pages/PlansPage"
6+
import PrivateRoute from "./routing/PrivateRoute"
7+
import {WOQLClientObj} from './init-woql-client'
8+
import {ServerError} from './components/ServerError'
9+
import {InvitePage} from './pages/InvitePage'
10+
import {localSettings} from "../localSettings"
11+
import * as PATH from "./routing/constants"
12+
13+
import {Home} from "./pages/Home"
14+
import {PageNotFound} from "./pages/PageNotFound"
15+
import {PLANS} from "./routing/constants";
16+
import TestApp from "./TestApp"
17+
18+
import {OrganizationHome } from "./pages/OrganizationHome"
19+
import {Profile} from "./pages/Profile"
20+
import { DocumentControlMain } from "./pages/DocumentControlMain"
21+
import {DataProductsHome} from "./pages/DataProductsHome"
22+
import { ProductsExplorer } from "./pages/ProductsExplorer"
23+
import { ModelProductPage } from "./pages/ModelProductPage"
24+
25+
export function App (props){
26+
let navigate = useNavigate();
27+
const {connectionError,loadingServer,clientUser,accessControlDashboard,woqlClient} = WOQLClientObj()
28+
if(!clientUser) return ""
29+
// we have this loading only in terminusX, it is auth0 information/login loading
30+
const {loading} = clientUser
31+
32+
if (clientUser.firstLogin === true && window.location.pathname.indexOf("/invite/") === -1) {
33+
clientUser.firstLogin = false
34+
//only if the user is not invited in a team
35+
window.location.replace(`/${PLANS}`)
36+
37+
}
38+
39+
// this happen after confirm you password linking in the email url
40+
if (window.location.search.includes("supportSignUp=true")) {
41+
window.location.replace('/')
42+
}
43+
44+
if(connectionError) {
45+
return <ServerError message={connectionError}/>
46+
}
47+
48+
if(loading || loadingServer) {
49+
return <main role="main" className="loading-parent content mr-3 ml-5">
50+
<Loading message={SERVER_LOADING_MESSAGE}/>
51+
</main>
52+
}
53+
//the accessControlDashboard in terminusX is created only after the login
54+
// so he can be undefined at the start
55+
const isAdmin = accessControlDashboard ? accessControlDashboard.isAdmin() : false
56+
57+
const basename = process.env.BASE_URL ? {basename:process.env.BASE_URL} : {}
58+
59+
return <div className="container-fluid container-background h-100">
60+
<Routes>
61+
{getRoutes(clientUser,isAdmin, woqlClient)}
62+
</Routes>
63+
</div>
64+
}
65+
66+
function getRoutes(clientUser, isAdmin, woqlClient){
67+
//const client = createApolloClient()
68+
69+
if(localSettings.connection_type==="LOCAL"){
70+
return <React.Fragment>
71+
<Route index element={<Home/>} />
72+
</React.Fragment>
73+
}
74+
return <React.Fragment>
75+
{/*<Route path="/verify" element={<VerifyEmail/>}/>*/}
76+
<Route path="/verify" element={<TestApp/>} />
77+
<Route path = {PATH.INVITE_PAGE} element = {<PrivateRoute component={InvitePage}/>} />
78+
<Route path={PATH.PLANS} element={<PrivateRoute component={PlansPage}/>}/>
79+
<Route path="*" element={<PageNotFound/>} />
80+
<Route index element={<PrivateRoute component={Home}/>} />
81+
<Route path=":organization" >
82+
<Route index element={<PrivateRoute component={OrganizationHome}></PrivateRoute>}/>
83+
<Route path = {PATH.PROFILE} element = {<PrivateRoute component={Profile}/>} />
84+
85+
<Route path=":dataProduct" element={<DocumentControlMain/>} >
86+
<Route index element={<PrivateRoute component={DataProductsHome}/>} />
87+
<Route path={PATH.PRODUCT_MODELS} element={<PrivateRoute component={ModelProductPage}/>} />
88+
89+
</Route>
90+
</Route>
91+
</React.Fragment>
92+
}

packages/tdb-dashboard/src/App_test.js

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,14 @@
11
import React from "react"
22
import {Routes,Route,useNavigate, BrowserRouter} from "react-router-dom"
3-
import {VerifyEmail} from "./pages/VerifyEmail"
4-
import PrivateRoute from "./routing/PrivateRoute"
5-
3+
//import {VerifyEmail} from "./pages/VerifyEmail"
4+
//import PrivateRoute from "./routing/PrivateRoute"
5+
import TestApp from "./TestApp"
66
export function App_test (props){
7-
let navigate = useNavigate();
7+
// let navigate = useNavigate();
88

9-
if (window.location.search.includes("error=unauthorized")) {
10-
navigate(`/verify`)
11-
}
129

1310
return <Routes>
14-
<Route path="/verify" element={<VerifyEmail/>}/>
15-
<Route index element={<PrivateRoute component={<div>HELLO</div>}/>} />
11+
<Route path="/verify" element={<TestApp/>}/>
1612
</Routes>
1713

1814
}
Lines changed: 141 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,141 @@
1+
import React , {useEffect,useState} from 'react';
2+
import TerminusClient from '@terminusdb/terminusdb-client'
3+
import { AdvancedSearch } from '@terminusdb/terminusdb-react-table';
4+
import {
5+
Dropdown,
6+
DropdownMenu,
7+
DropdownToggle,
8+
DropdownItem,
9+
} from "reactstrap";
10+
//import {WOQLResult} from "@terminusdb/terminusdb-client";
11+
12+
const TestApp = (props) =>{
13+
const claimCaseAdvancedSearch = {
14+
"death_certificate_for_claim":{
15+
"label":"death_certificate_for_claim",
16+
"type":"!group",
17+
"subfields":{
18+
"country_of_death":{
19+
"typevalue":"Country"
20+
},
21+
"date_of_birth":{
22+
"label":"date_of_birth",
23+
"type":"datetime",
24+
"valueSources":[
25+
"value"
26+
],
27+
"typevalue":"DateTime"
28+
},
29+
"date_of_death":{
30+
"label":"date_of_death",
31+
"type":"datetime",
32+
"valueSources":[
33+
"value"
34+
],
35+
"typevalue":"DateTime"
36+
},
37+
"name":{
38+
"label":"name",
39+
"type":"text",
40+
"valueSources":[
41+
"value"
42+
],
43+
"typevalue":"String"
44+
}
45+
}
46+
},
47+
"incur":{
48+
"label":"incur",
49+
"valueSources":[
50+
"value"
51+
],
52+
"operators":[
53+
"select_equals",
54+
"select_not_equals"
55+
],
56+
"defaultOperator":"select_equals",
57+
"type":"select",
58+
"fieldSettings":{
59+
"listValues":[
60+
"SumAssured",
61+
"Premium"
62+
]
63+
},
64+
"typevalue":"Refund"
65+
},
66+
"policy_of_claim":{
67+
"label":"policy_of_claim",
68+
"type":"!group",
69+
"subfields":{
70+
"beneficiary":{
71+
"typevalue":"Beneficiary"
72+
},
73+
"country_of_issue":{
74+
"typevalue":"Country"
75+
},
76+
"life_assured_date_of_birth":{
77+
"label":"life_assured_date_of_birth",
78+
"type":"datetime",
79+
"valueSources":[
80+
"value"
81+
],
82+
"typevalue":"DateTime"
83+
},
84+
"life_assured_name":{
85+
"label":"life_assured_name",
86+
"type":"text",
87+
"valueSources":[
88+
"value"
89+
],
90+
"typevalue":"String"
91+
},
92+
"premium_paid_to_date":{
93+
"label":"premium_paid_to_date",
94+
"type":"number",
95+
"valueSources":[
96+
"value"
97+
],
98+
"typevalue":"Float"
99+
},
100+
"sum_assured":{
101+
"label":"sum_assured",
102+
"type":"number",
103+
"valueSources":[
104+
"value"
105+
],
106+
"typevalue":"Float"
107+
}
108+
}
109+
}
110+
}
111+
112+
const claimCaseAdvancedFilter = (filter) =>{
113+
114+
}
115+
116+
117+
const [dropdownOpen, setDropdownOpen] = useState(false);
118+
119+
const toggle = () => setDropdownOpen((prevState) => !prevState);
120+
121+
return <div style={{marginLeft:"500px"}} >
122+
<div className="d-flex p-5">
123+
COMPLETE APP NO ModelProductPage
124+
<Dropdown isOpen={dropdownOpen} toggle={toggle} >
125+
<DropdownToggle caret>Dropdown</DropdownToggle>
126+
<DropdownMenu container="body">
127+
<DropdownItem header>Header</DropdownItem>
128+
<DropdownItem>Some Action</DropdownItem>
129+
<DropdownItem text>Dropdown Item Text</DropdownItem>
130+
<DropdownItem disabled>Action (disabled)</DropdownItem>
131+
<DropdownItem divider />
132+
<DropdownItem>Foo Action</DropdownItem>
133+
<DropdownItem>Bar Action</DropdownItem>
134+
<DropdownItem>Quo Action</DropdownItem>
135+
</DropdownMenu>
136+
</Dropdown>
137+
</div>
138+
<AdvancedSearch fields={claimCaseAdvancedSearch} setFilter={claimCaseAdvancedFilter}/>
139+
</div>
140+
}
141+
export default TestApp;

0 commit comments

Comments
 (0)