Fix an issue in search objects where objects were unable to locate occasionally. #5916

This commit is contained in:
Aditya Toshniwal 2023-04-04 18:29:54 +05:30 committed by GitHub
parent fdf7a459eb
commit a18d469c90
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 4 additions and 3 deletions

View File

@ -348,7 +348,7 @@ export class Tree {
let onCorrectPath = function (matchPath) { let onCorrectPath = function (matchPath) {
return (matchPath !== undefined && path !== undefined return (matchPath !== undefined && path !== undefined
&& (basepath.startsWith(matchPath) || path === matchPath)); && (basepath.startsWith(`${matchPath}/`) || path === matchPath));
}; };
return (function findInNode(currentNode) { return (function findInNode(currentNode) {

View File

@ -973,7 +973,7 @@ class ERDTool extends React.Component {
<ERDCanvasSettings.Provider value={{ <ERDCanvasSettings.Provider value={{
cardinality_notation: this.state.cardinality_notation cardinality_notation: this.state.cardinality_notation
}}> }}>
{this.diagram.getEngine() && <CanvasWidget className={this.props.classes.diagramCanvas} ref={(ele)=>{this.canvasEle = ele?.ref?.current;}} engine={this.diagram.getEngine()} />} {!this.props.inTest && <CanvasWidget className={this.props.classes.diagramCanvas} ref={(ele)=>{this.canvasEle = ele?.ref?.current;}} engine={this.diagram.getEngine()} />}
</ERDCanvasSettings.Provider> </ERDCanvasSettings.Provider>
</div> </div>
</Box> </Box>
@ -1001,6 +1001,7 @@ ERDTool.propTypes = {
pgAdmin: PropTypes.object.isRequired, pgAdmin: PropTypes.object.isRequired,
panel: PropTypes.object, panel: PropTypes.object,
classes: PropTypes.object, classes: PropTypes.object,
inTest: PropTypes.bool,
}; };
export const ERDCanvasSettings = React.createContext({}); export const ERDCanvasSettings = React.createContext({});

View File

@ -125,7 +125,7 @@ describe('ERDTool', ()=>{
erd = mount( erd = mount(
<Theme> <Theme>
<ModalProvider> <ModalProvider>
<ERDTool params={params} pgAdmin={pgAdmin} pgWindow={pgWindow} /> <ERDTool params={params} pgAdmin={pgAdmin} pgWindow={pgWindow} isTest={true} />
</ModalProvider> </ModalProvider>
</Theme> </Theme>
); );