Skip to content

Commit 9792edf

Browse files
authored
Merge pull request #119 from terminusdb/starWars
Star wars
2 parents be2fd95 + 8593c4c commit 9792edf

32 files changed

+198
-113
lines changed

packages/tdb-dashboard/src/App.css

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1101,8 +1101,8 @@ pre.CodeMirror-line > span > span.cm-string {
11011101
}
11021102

11031103
.group {
1104-
background: transparent;
1105-
border: 0px solid #DCC896;
1104+
background: transparent !important;
1105+
border: 1px solid #dee2e6 !important;
11061106
}
11071107

11081108
.rule_group{
@@ -1194,3 +1194,10 @@ pre.CodeMirror-line > span > span.cm-string {
11941194
height: 100px;
11951195
}
11961196

1197+
.payment_select{
1198+
background-color: transparent !important;
1199+
color: #adb5bd !important;
1200+
border-color: #adb5bd!important;
1201+
/* line-height: 1.5 !important; */
1202+
min-height: 49px!important;
1203+
}

packages/tdb-dashboard/src/App.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ import {DocumentNew} from "./pages/DocumentNew"
2222
import {DocumentEdit} from "./pages/DocumentEdit"
2323
import {DocumentView} from "./pages/DocumentView"
2424
import {Home} from "./pages/Home"
25-
import {ChangeRequests} from "./pages/ChangeRequests"
25+
import {ChangeRequestsPage} from "./pages/ChangeRequestsPage"
2626
import {ChangeDiff} from "./pages/ChangeDiff"
2727
import {DocumentTemplate} from "./pages/DocumentTemplate"
2828
import {GraphIqlEditor} from "./pages/GraphIqlEditor"
@@ -109,7 +109,7 @@ function getRoutes(clientUser, isAdmin, woqlClient){
109109
<Route path={PATH.GRAPHIQL} element={<PrivateRoute component={GraphIqlEditor}/>} />
110110

111111
<Route path={PATH.CHANGE_REQUESTS} >
112-
<Route index element={<PrivateRoute component={ChangeRequests}/>} />
112+
<Route index element={<PrivateRoute component={ChangeRequestsPage}/>} />
113113
<Route path=":id" element={<PrivateRoute component={ChangeDiff}/>} />
114114
</Route>
115115
<Route path={PATH.DOCUMENT_EXPLORER} element={<DocumentTemplate/>}>

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ const SQUASH_FORM = 'squashForm'
99
const RESET_FORM = 'resetForm'
1010
const DELETE_FORM = 'deleteForm'
1111

12-
export const BranchActions = ({branch, handleClose, setRefresh, showDefaultForm}) =>{
12+
export const BranchActions = ({branch, handleClose, setRefresh, showDefaultForm,updateTable}) =>{
1313
const [showForm, setShowForm] = useState(showDefaultForm || false)
1414
const [commit, setCommit] = useState(false)
1515
const [branchName,setBranchName] = useState(false)
@@ -24,7 +24,7 @@ export const BranchActions = ({branch, handleClose, setRefresh, showDefaultForm}
2424
handleOptimize,
2525
handleReset,
2626
handleSquash
27-
} = BranchControl()
27+
} = BranchControl(updateTable)
2828

2929
const squashDescription = useRef(null);
3030

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import {BranchActions} from "./BranchActions"
55
import {CommitLogs, CommitView} from "./CommitLogs"
66
import {WOQLClientObj} from '../init-woql-client'
77

8-
export const BranchInfoModal = ({showDefault, handleClose, handleSwitch, setSelectedCommit, selectedCommit,showDefaultForm}) => {
8+
export const BranchInfoModal = ({showDefault, handleClose, handleSwitch, setSelectedCommit, selectedCommit,showDefaultForm, updateTable}) => {
99
const {woqlClient, branch, branchNeedReload} = WOQLClientObj()
1010
const [refresh, setRefresh] = useState(0)
1111

@@ -25,7 +25,7 @@ export const BranchInfoModal = ({showDefault, handleClose, handleSwitch, setSele
2525
<Button variant="close" aria-label="Close" onClick={handleClose} />
2626
</Modal.Header>
2727
<Modal.Body className="p-5">
28-
<BranchActions branchNeedReload={branchNeedReload} showDefaultForm={showDefaultForm} branch={branch} handleClose={handleClose} woqlClient={woqlClient} setRefresh={setRefresh}/>
28+
<BranchActions updateTable={updateTable} branchNeedReload={branchNeedReload} showDefaultForm={showDefaultForm} branch={branch} handleClose={handleClose} woqlClient={woqlClient} setRefresh={setRefresh}/>
2929
<hr className="my-3 border-indigo dropdown-divider" role="separator"></hr>
3030
<CommitInfo/>
3131

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

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ import {BiGitBranch} from "react-icons/bi"
99
import Tab from 'react-bootstrap/Tab'
1010
import Tabs from 'react-bootstrap/Tabs'
1111
import Stack from 'react-bootstrap/Stack'
12-
import {ChangeRequest} from "../hooks/ChangeRequest"
1312
import {Loading} from "../components/Loading"
1413
import Alert from 'react-bootstrap/Alert'
1514
import {

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

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,15 @@ import React, {useRef, useState} from "react"
22
import {Alert, Modal, Button, Form} from "react-bootstrap"
33
import {ChangeRequest} from "../hooks/ChangeRequest"
44
import {useNavigate} from "react-router-dom"
5-
5+
import {WOQLClientObj} from '../init-woql-client'
66

77
export const CreateChangeRequestModal = ({showModal, setShowModal , updateViewMode, type}) => {
8+
const {
9+
woqlClient
10+
} = WOQLClientObj()
811
const nameRef = useRef(null);
912
const messageRef = useRef(null);
10-
const {loading,errorMessage,setError,createChangeRequest} = ChangeRequest()
13+
const {loading,errorMessage,setError,createChangeRequest} = ChangeRequest(woqlClient)
1114
const navigate = useNavigate()
1215

1316
const closeModal = () => {

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

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ import ProgressBar from 'react-bootstrap/ProgressBar'
1515
import {BsPlus} from "react-icons/bs"
1616
import {BiMinusCircle} from "react-icons/bi"
1717
import {extractID} from "../components/utils"
18-
import {ChangeRequest} from "../hooks/ChangeRequest"
1918
import {Loading} from "./Loading"
2019

2120
/**

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

Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ export const DocumentsGraphqlTable = ({type,onRowClick,showGraphqlTab=true}) =>
4949

5050
function onRowClickCall(row){
5151
if (onRowClick) {
52-
const rowTmp = row && row.original ? {label:row.original.name, id:row.original._id}: {}
52+
const rowTmp = row && row.original ? {label:row.original.name, id:row.original.fullID}: {}
5353
onRowClick(rowTmp)
5454
}
5555
}
@@ -60,6 +60,18 @@ export const DocumentsGraphqlTable = ({type,onRowClick,showGraphqlTab=true}) =>
6060

6161
let extractedResults = documentResults ? extractDocuments(documentResults[type]) : []
6262

63+
function cleanIdValue(keyName, keyValue){
64+
if(keyValue === "null") return ""
65+
if(keyName!=="_id") return keyValue
66+
try{
67+
const regexp =/(?:\/+.*?\/)(.*$)/g
68+
const array01 = [...keyValue.matchAll(regexp)];
69+
return array01[0][1]
70+
}catch(err){
71+
return keyValue
72+
}
73+
}
74+
6375
function extractDocuments(documentResultsArr) {
6476
if(!documentResultsArr) {
6577
//alert(JSON.stringify(documentResultsArr))
@@ -80,11 +92,15 @@ export const DocumentsGraphqlTable = ({type,onRowClick,showGraphqlTab=true}) =>
8092
//key
8193
const objectKey = Object.keys(item[key])
8294
objectKey.forEach(element => {
83-
newJson[`${key}---${element}`] = `${item[key][element]}`
95+
const columnName = element === "_id" ? `${key}---id` : `${key}---${element}`
96+
newJson[columnName] = cleanIdValue(element, item[key][element])
8497
});
8598
}
8699
else {
87-
newJson[key] = `${item[key]}`
100+
if(key==="_id"){
101+
newJson["fullID"] = `${item[key]}`
102+
}
103+
newJson[key] = cleanIdValue(key, `${item[key]}`)
88104
}
89105
}
90106
extractedResults.push(newJson)

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import {getDocumentTools, getDeleteTool, getCopyIDTool} from "./DocumentActions"
88
import {getColumnsFromResults, displayIDOfLinkedDocuments, isArray} from "./utils"
99
import {Loading} from "./Loading"
1010
import { useParams,useNavigate } from "react-router-dom"
11+
import {UTILS} from '@terminusdb/terminusdb-client'
1112

1213
export const DocumentWoqlTable = () => {
1314
const {
@@ -94,9 +95,8 @@ export const DocumentWoqlTable = () => {
9495

9596
// on click document table row
9697
function onRowClick (row) {
97-
const idFull = row.original["@id"]
98-
const id = idFull.substring(idFull.indexOf("/")+1)
99-
navigate(id)
98+
const fullId = row["id"]
99+
navigate(`${UTILS.encodeURISegment(fullId)}`)
100100
}
101101

102102

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ export const ManageProducts = ({setDataProductSettings , branches , updateTable}
2020
loading,
2121
reportAlert,
2222
handleSwitch,
23-
handleDelete,
2423
handleBranchClick,
2524
setSelectedBranch
2625
} = BranchControl(updateTable)
@@ -79,7 +78,8 @@ export const ManageProducts = ({setDataProductSettings , branches , updateTable}
7978
handleSwitch={handleSwitch}
8079
setSelectedCommit={setSelectedCommit}
8180
showDefaultForm={showDefaultForm}
82-
selectedCommit={selectedCommit}/>}
81+
selectedCommit={selectedCommit}
82+
updateTable={updateTable}/>}
8383

8484
<div className="float-right text-right d-flex">
8585
{/*<Button variant="light" className="mr-3" title={VIEW_HISTORY.title} onClick={(e) => setHistory(true)}>

0 commit comments

Comments
 (0)