Skip to content

Commit f15aa5d

Browse files
committed
add loading
1 parent e9cbe4f commit f15aa5d

File tree

4 files changed

+8
-4
lines changed

4 files changed

+8
-4
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/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)

0 commit comments

Comments
 (0)