Skip to content

Commit 1d05c84

Browse files
committed
Merge branch 'newDoc' of https://github.com/terminusdb/terminusdb-dashboard into newDoc
2 parents f25a977 + 7cd4215 commit 1d05c84

File tree

7 files changed

+19
-12
lines changed

7 files changed

+19
-12
lines changed

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import {DocumentsGraphqlTable} from "@terminusdb/terminusdb-documents-ui-templat
33
import {gql} from "@apollo/client"
44
import {useTDBDocuments} from "@terminusdb/terminusdb-documents-ui-template"
55
import {WOQLClientObj} from '../init-woql-client'
6+
import { Loading } from "./Loading"
67
/**
78
*
89
* @param {*} setSelected function to get selected document link by user
@@ -22,7 +23,7 @@ export const DocumentSearchComponent = ({setSelected, doctype}) => {
2223
},[doctype]);
2324
const querystr = documentTablesConfig && documentTablesConfig.objQuery ? documentTablesConfig.objQuery[doctype].query : null
2425
const gqlQuery = querystr ? gql`${querystr}` : null
25-
if(!gqlQuery) return <div/>
26+
if(!gqlQuery) return <Loading message={`Loading the .... ${doctype} documents`} type={'PROGRESS_BAR_COMPONENT'}/>
2627

2728
return <DocumentsGraphqlTable tableConfig={documentTablesConfig}
2829
type={doctype}

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ export function GraphIqlEditor({}) {
2626
<Layout mainClassName={layoutClass} showLeftSideBar={false}>
2727
<GraphiQL
2828
editorTheme="shadowfox"
29-
defaultQuery={'{}'}
29+
defaultQuery={'query{}'}
3030
fetcher={fetcher}
3131

3232
/>

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ export const Layout = (props) => {
7070
return <ConnectedDataProduct/>
7171
}
7272

73-
const headerElement = changeRequestHolder()
73+
const headerElement = dataProduct ? changeRequestHolder() : ""
7474

7575
//defaultSize={340}
7676
return <Container fluid className="p-0 flex-row">

packages/tdb-documents-ui-template/docs/useTDBDocuments.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
- `state.frame:Object|Bool`
1818
- this is the current documents frames object, the starting value is false, you need to call the `getDocumentFrames`function to fill this property status
1919
- `state.documentTablesConfig:Object|Bool`
20-
- this is the current document tables template, this property status store the graphQL query for every documents and the configuration for the tables and the advanced search components, the starting value is false, you need to call the `getGraphqlTablesConfig`function to fill this property status
20+
- this is the current document tables template, this property status store the graphQL query for every documents and the configuration for the tables and the advanced search components, the starting value is null, you need to call the `getGraphqlTablesConfig`function to fill this property status, after the call the status will be the table config Object or false if the call failed
2121
- `setError: Function(value:Object|Bool)`
2222
- this function set the error property status.
2323
- `getDocumentClasses: Function()`

packages/tdb-documents-ui-template/src/components/DocumentsGraphqlTable.js

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -56,21 +56,24 @@ export const DocumentsGraphqlTable = ({gqlQuery,apolloClient,tableConfig, type,
5656
}
5757
}
5858

59-
const deleteAction =(row)=>{
59+
const deleteAction =(evt,row)=>{
60+
evt.stopPropagation()
6061
if (onDeleteButtonClick) {
6162
const rowTmp = row && row.original ? {label:row.original.name, id:row.original.fullID}: {}
6263
onDeleteButtonClick(rowTmp)
6364
}
6465
}
6566

66-
const viewAction =(row)=>{
67+
const viewAction =(evt,row)=>{
68+
evt.stopPropagation()
6769
if (onViewButtonClick) {
6870
const rowTmp = row && row.original ? {label:row.original.name, id:row.original.fullID}: {}
6971
onViewButtonClick(rowTmp)
7072
}
7173
}
7274

73-
const editAction =(row)=>{
75+
const editAction =(evt,row)=>{
76+
evt.stopPropagation()
7477
if (onEditButtonClick) {
7578
const rowTmp = row && row.original ? {label:row.original.name, id:row.original.fullID}: {}
7679
onEditButtonClick(rowTmp)
@@ -83,13 +86,13 @@ export const DocumentsGraphqlTable = ({gqlQuery,apolloClient,tableConfig, type,
8386
//const name = cell.row.original['name']
8487
return <React.Fragment>
8588
<span className="d-flex justify-content-end mr-4">
86-
{onViewButtonClick && <Button variant="success" size="sm" className="ml-3" title={`view document`} onClick={() => viewAction(invFullId)}>
89+
{onViewButtonClick && <Button variant="success" size="sm" className="ml-3" title={`view document`} onClick={(evt) => viewAction(evt,invFullId)}>
8790
<HiOutlineDocument/>
8891
</Button>}
89-
{onEditButtonClick && <Button variant="success" size="sm" className="ml-3" title={`edit document`} onClick={() => editAction(invFullId)}>
92+
{onEditButtonClick && <Button variant="success" size="sm" className="ml-3" title={`edit document`} onClick={(evt) => editAction(evt,invFullId)}>
9093
<RiEdit2Fill/>
9194
</Button>}
92-
{onDeleteButtonClick && <Button variant="danger" size="sm" className="ml-3" title={`delete document`} onClick={() => deleteAction(invFullId)}>
95+
{onDeleteButtonClick && <Button variant="danger" size="sm" className="ml-3" title={`delete document`} onClick={(evt) => deleteAction(evt,invFullId)}>
9396
<RiDeleteBin7Line/>
9497
</Button>}
9598
</span>

packages/tdb-documents-ui-template/src/hook/useTDBDocuments.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,10 @@ export const useTDBDocuments = (woqlClient) => {
1515
const [totalDocumentCount, setTotalDocumentCount]=useState(false)
1616

1717
// bool|Object
18-
const [documentTablesConfig,setDocumentTablesConfig]=useState(false)
18+
//the default value is null and false if it will be failed
19+
//start status null
20+
//after the call can be an object or false
21+
const [documentTablesConfig,setDocumentTablesConfig]=useState(null)
1922

2023
// bool|Object
2124
const [selectedDocument, setSelectedDocument] = useState(false)

packages/tdb-react-table/src/AdvancedSearch.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import '@react-awesome-query-builder/ui/css/styles.css';
77
//import '@react-awesome-query-builder/ui/css/styles.css';
88
//import {Query, Builder, BasicConfig, Utils as QbUtils} from 'react-awesome-query-builder';
99
import {Button} from 'react-bootstrap'
10-
import './style.css';
10+
//import './style.css';
1111

1212

1313
// Choose your skin (ant/material/vanilla):

0 commit comments

Comments
 (0)