Skip to content

Commit 34046ac

Browse files
committed
fix after release bug
1 parent 75bd620 commit 34046ac

File tree

4 files changed

+11
-6
lines changed

4 files changed

+11
-6
lines changed

packages/tdb-documents-ui-template/src/ListDocumentsComponent.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import Stack from 'react-bootstrap/Stack'
44
import {HiPlusSm} from "react-icons/hi"
55
import { DocumentsGraphqlTable } from "./components/DocumentsGraphqlTable";
66

7-
export const ListDocumentsComponent = ({type, apolloClient, tableConfig , advancedSearchConfig, onRowClick,
7+
export const ListDocumentsComponent = ({commit,type, apolloClient, tableConfig , advancedSearchConfig, onRowClick,
88
onDeleteButtonClick,
99
onViewButtonClick,
1010
onEditButtonClick,
@@ -26,6 +26,7 @@ export const ListDocumentsComponent = ({type, apolloClient, tableConfig , advanc
2626
</Card.Header>
2727
<Card.Body className="text-break">
2828
<DocumentsGraphqlTable tableConfig={tableConfig}
29+
commit={commit}
2930
type={type}
3031
advancedSearchConfig={advancedSearchConfig}
3132
gqlQuery={gqlQuery}

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import {RiDeleteBin7Line, RiEdit2Fill} from "react-icons/ri"
99
import {HiOutlineDocument} from "react-icons/hi"
1010

1111
//to be review
12-
export const DocumentsGraphqlTable = ({gqlQuery,apolloClient,tableConfig, advancedSearchConfig, type, onRowClick, onViewButtonClick, onEditButtonClick, onDeleteButtonClick, showGraphqlTab=true}) => {
12+
export const DocumentsGraphqlTable = ({commit,gqlQuery,apolloClient,tableConfig, advancedSearchConfig, type, onRowClick, onViewButtonClick, onEditButtonClick, onDeleteButtonClick, showGraphqlTab=true}) => {
1313
if(!tableConfig || !gqlQuery) return ''
1414
const query = gqlQuery//gql`${querystr}`
1515
// const [advSearchFields,setAdvFields] = useState(false)
@@ -46,7 +46,7 @@ export const DocumentsGraphqlTable = ({gqlQuery,apolloClient,tableConfig, advanc
4646
setQueryTodisplay(format(queryStr))
4747

4848
}
49-
},[type]);
49+
},[type,commit]);
5050

5151
function onRowClickCall(row){
5252
if (onRowClick) {

packages/tdb-react-components/src/queryeditor/Editor.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import React,{useState} from "react";
1+
import React,{useEffect, useState} from "react";
22

33
import CodeMirror from "@uiw/react-codemirror"
44
import { vscodeDark } from '@uiw/codemirror-theme-vscode';
@@ -25,6 +25,10 @@ export const CodeViewer = ({text, language, theme}) => {
2525
export const CodeEditor = ({text, language, onChange, onBlur, theme}) => {
2626
const [value,setValue] = useState(text || "")
2727

28+
useEffect(() => {
29+
setValue(text)
30+
}, [language])
31+
2832
const onChangeHandler = React.useCallback((value, viewUpdate) => {
2933
setValue(value)
3034
}, []);

packages/tdb-react-components/src/queryeditor/WOQLEditor.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import {makeWOQLFromString} from "./queryPaneUtils"
55
/**
66
* Controls the display of query viewer and editor
77
*/
8-
export const WOQLEditor = ({editorObject, editable, setEditorContent, setMainError, setWOQLQuery, theme}) => {
8+
export const WOQLEditor = ({language, editorObject, editable, setEditorContent, setMainError, setWOQLQuery, theme}) => {
99

1010
const [syntaxError, setSyntaxError] = useState(false)
1111
WOQLEditor.propTypes = {
@@ -52,7 +52,7 @@ export const WOQLEditor = ({editorObject, editable, setEditorContent, setMainErr
5252

5353
return <React.Fragment>
5454
{syntaxError && <h4 className="text-danger">{syntaxError}</h4>}
55-
<CodeEditor onBlur={onBlur} text={editorObject.text} theme={theme}/>
55+
<CodeEditor language={language} onBlur={onBlur} text={editorObject.text} theme={theme}/>
5656
</React.Fragment>
5757

5858
return(

0 commit comments

Comments
 (0)