Skip to content

Commit 771208c

Browse files
committed
Merge branch 'main' into openAI
2 parents 0472a3e + e96c229 commit 771208c

File tree

18 files changed

+19470
-6485
lines changed

18 files changed

+19470
-6485
lines changed

package-lock.json

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

packages/tdb-dashboard/src/App.css

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@ img.user-avatar {
6868
left: 4rem;
6969
position: fixed;
7070
transition: left 0.3s ease-in-out;
71+
width: 97% !important;
7172
}
7273

7374

@@ -141,6 +142,11 @@ div.SplitPane .horizontal {
141142
border-left: 0 !important;
142143
border-right: 0 !important;
143144
}
145+
146+
.pro-sidebar-content {
147+
border-right: 1px solid #303030;
148+
background: #000000;
149+
}
144150
/* ---------- Split Pane resizing css ---------- */
145151

146152

@@ -1321,6 +1327,8 @@ button.graphiql-tab-add>svg
13211327
.h-view{
13221328
height: calc(100% - 65px);
13231329
overflow-y: auto;
1330+
margin: 2rem;
1331+
margin-left: 5rem;
13241332
}
13251333

13261334
.alert_expand_icons {
Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
import React from "react"
2+
import Button from "react-bootstrap/Button"
3+
import { HiChevronDoubleLeft, HiChevronDoubleRight } from "react-icons/hi"
4+
5+
export const CollpaseButton = ({ setCollapseSideBar, collapseSideBar }) => {
6+
7+
const style = {
8+
userSelect: "none",
9+
zIndex: 99999,
10+
boxSizing: "border-box",
11+
appearance: "none",
12+
position: "absolute",
13+
display: "inline-flex",
14+
webkitBoxAlign: "center",
15+
alignItems: "center",
16+
textAlign: "center",
17+
verticalAlign: "middle",
18+
alignSelf: "center",
19+
textDecoration: "none",
20+
fontWeight: 500,
21+
/* margin: 0px; */
22+
top: "50%",
23+
borderRadius: "9999px",
24+
webkitBoxPack: "center",
25+
justifyContent: "center",
26+
boxShadow:"rgba(0, 0, 0, 0.05) 0px 2px 4px",
27+
/* top: 80px; */
28+
left: "19.5rem",
29+
fontSize: "12px",
30+
lineHeight: "16px",
31+
height: "24px",
32+
minWidth: "24px",
33+
color: "rgb(195 196 201)",
34+
backgroundColor: "rgb(100 100 100)",
35+
border: "1px solid rgb(208, 213, 231) !important",
36+
padding: "0px !important"
37+
}
38+
39+
const hiddenStyle = {
40+
display: "block",
41+
zIndex: 99999,
42+
borderLeft: "1px solid #484848",
43+
borderRight: "1px solid #484848"
44+
}
45+
46+
function handleCollapse() {
47+
setCollapseSideBar(!collapseSideBar)
48+
localStorage.setItem(`Terminusdb-SideBar-Collapsed`, !collapseSideBar)
49+
}
50+
51+
return <Button //className="btn-btn-lg bg-transparent border border-0 ml-3"
52+
variant="dark"
53+
style={collapseSideBar ? hiddenStyle : style}
54+
title={collapseSideBar ? "Show Sidebar" : "Hide Sidebar" }
55+
onClick={handleCollapse}>
56+
{collapseSideBar && <HiChevronDoubleRight size={20}/>}
57+
{!collapseSideBar && <HiChevronDoubleLeft size={20}/>}
58+
</Button>
59+
}

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

Lines changed: 18 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import {PRODUCT_EXPLORER, DOCUMENT_EXPLORER} from "../routing/constants"
66
import {DataProductItems} from "../components/DatabaseList"
77
//import {ConnectedDataProduct} from "../components/CurrentDataProductState"
88
import {DataProductDocuments, DocumentExplorerDocuments} from "../components/DataProductDocuments"
9+
import { CollpaseButton } from "../components/CollapseButton"
910

1011
export const LeftSideBar = (props) => {
1112
const {
@@ -23,17 +24,22 @@ export const LeftSideBar = (props) => {
2324
return ``
2425
}
2526

26-
return <div className={`${getSideNavClassName(collapseSideBar)}`}>
27-
<ProSidebar>
28-
<SidebarContent>
29-
<Menu>
30-
<DataProductItems/>
31-
{/*dataProduct && <ConnectedDataProduct/>*/}
32-
{dataProduct && page==DOCUMENT_EXPLORER && <DocumentExplorerDocuments/>}
33-
{dataProduct && page==PRODUCT_EXPLORER && <DataProductDocuments/>}
34-
{/* dataProduct && getLocation()==PRODUCT_EXPLORER && <SampleQueries/> */}
35-
</Menu>
36-
</SidebarContent>
37-
</ProSidebar>
27+
return <div className="d-flex">
28+
<div className={`${getSideNavClassName(collapseSideBar)}`}>
29+
30+
<ProSidebar>
31+
<SidebarContent>
32+
<Menu>
33+
<DataProductItems/>
34+
{/*dataProduct && <ConnectedDataProduct/>*/}
35+
{dataProduct && page==DOCUMENT_EXPLORER && <DocumentExplorerDocuments/>}
36+
{dataProduct && page==PRODUCT_EXPLORER && <DataProductDocuments/>}
37+
{/* dataProduct && getLocation()==PRODUCT_EXPLORER && <SampleQueries/> */}
38+
</Menu>
39+
</SidebarContent>
40+
</ProSidebar>
41+
42+
</div>
43+
<CollpaseButton setCollapseSideBar={setCollapseSideBar} collapseSideBar={collapseSideBar}/>
3844
</div>
3945
}

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

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -8,16 +8,8 @@ import {DATA_PRODUCTS} from "../routing/constants"
88
import { UserMenu } from "./UserMenu";
99
import { sortAlphabetically } from "./utils";
1010
import {useNavigate,useParams,useLocation} from "react-router-dom"
11-
import { SlArrowLeft, SlArrowRight } from "react-icons/sl"
11+
import { BlockPicker } from "react-color";
1212

13-
const CollpaseButton = ({ setCollapseSideBar, collapseSideBar }) => {
14-
return <Button className="btn-btn-lg bg-transparent border border-0 ml-3"
15-
title={collapseSideBar ? "Show Sidebar" : "Hide Sidebar" }
16-
onClick={(e) => setCollapseSideBar(!collapseSideBar)}>
17-
{collapseSideBar && <SlArrowRight size={24}/>}
18-
{!collapseSideBar && <SlArrowLeft size={24}/>}
19-
</Button>
20-
}
2113

2214
export const MainNavBar = ({setShowTimeTravel, changeRequestHolder, showLeftSideBar}) => {
2315

@@ -38,7 +30,6 @@ export const MainNavBar = ({setShowTimeTravel, changeRequestHolder, showLeftSide
3830
const teamList = sortAlphabetically (woqlClient ? woqlClient.userOrganizations() : [])
3931

4032
return <Navbar className="navbar-dark bg-dark p-0 sticky-top main-navbar-shadow">
41-
{showLeftSideBar && <CollpaseButton setCollapseSideBar={setCollapseSideBar} collapseSideBar={collapseSideBar}/>}
4233
<div className="d-flex flex-grow-1 ">
4334
{dataProduct && currentPage!==`/${organization}/${dataProduct}` &&
4435
<React.Fragment>

packages/tdb-dashboard/src/init-woql-client.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ export const WOQLClientProvider = ({children, params}) => {
3939
const [currentCRStartBranch,setCurrentCRStartBranch] = useState(false)
4040

4141
// constants to control sidebar collapse
42-
const [collapseSideBar, setCollapseSideBar] = useState(false)
42+
const [collapseSideBar, setCollapseSideBar] = useState(localStorage.getItem(`Terminusdb-SideBar-Collapsed`) === "true" ? true : false)
4343

4444
// set left side bar open close state
4545
const sidebarStateObj = {sidebarDataProductListState:true,
@@ -69,7 +69,7 @@ export const WOQLClientProvider = ({children, params}) => {
6969

7070
useEffect(() => {
7171
const initWoqlClient = async(credentials,accessCredential )=>{
72-
try{
72+
try{
7373
//the last organization viewed organization
7474
//this is for woql client
7575
const dbClient = new TerminusClient.WOQLClient(opts.server,credentials)

packages/tdb-dashboard/src/pages/Layout.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ export const Layout = (props) => {
7272

7373
const headerElement = dataProduct ? changeRequestHolder() : ""
7474

75-
75+
7676
function getMainNavClassName(collapseSideBar) {
7777
if(collapseSideBar) return `expanded__main__content`
7878
return ``

packages/tdb-documents-ui/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
"lint": "eslint src",
2525
"autofix": "eslint src --fix",
2626
"cypress": "npx cypress open",
27-
"test": "react-scripts test"
27+
"test": "jest"
2828
},
2929
"jest": {
3030
"transformIgnorePatterns": [

packages/tdb-documents-ui/src/constants.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
//FEATURE
2+
// map icon component
3+
import L from "leaflet";
4+
15
// constants
26
export const TYPE="@type"
37
export const CLASS="@class"
@@ -139,9 +143,7 @@ export const GEOMETRY_ARRAY=[
139143
POINT,
140144
POLYGON
141145
]
142-
//FEATURE
143-
// map icon component
144-
import L from "leaflet";
146+
145147

146148
export default L.icon({
147149
iconSize: [25, 41],

packages/tdb-documents-ui/src/css/terminusdb__styles.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/*@import "https://bootswatch.com/5/darkly/bootstrap.css";*/
22
@import "//cdnjs.cloudflare.com/ajax/libs/leaflet/0.7.7/leaflet.css";
33

4-
4+
55
:root {
66
/*--input-color: #fff;
77
--required-color: #6c757d;

0 commit comments

Comments
 (0)