mirror of
https://github.com/pgadmin-org/pgadmin4.git
synced 2024-12-28 01:41:13 -06:00
More fixes related to rc-dock changes. #6479
This commit is contained in:
parent
d8bcc11a95
commit
19cbe8c39f
@ -79,7 +79,7 @@ function SQL({nodeData, node, treeNodeInfo, isActive, isStale, setIsStale}) {
|
||||
gettext(e.response.data.errormsg)
|
||||
);
|
||||
// show failed message.
|
||||
setNodeSQL([gettext('Failed to retrieve data from the server.'), true]);
|
||||
setNodeSQL(gettext('Failed to retrieve data from the server.'));
|
||||
setLoaderText('');
|
||||
}).then(()=>{
|
||||
setLoaderText('');
|
||||
|
@ -33,19 +33,16 @@ function TabTitle({id, closable, defaultInternal}) {
|
||||
}, []);
|
||||
|
||||
useEffect(()=>{
|
||||
let deregister;
|
||||
if(internal.renamable) {
|
||||
deregister = layoutDocker.eventBus.registerListener(LAYOUT_EVENTS.REFRESH_TITLE, _.debounce((panelId)=>{
|
||||
if(panelId == id) {
|
||||
const internal = layoutDocker?.find(id)?.internal??{};
|
||||
setAttrs({
|
||||
icon: internal.icon,
|
||||
title: internal.title,
|
||||
tooltip: internal.tooltip ?? internal.title,
|
||||
});
|
||||
}
|
||||
}, 100));
|
||||
}
|
||||
const deregister = layoutDocker.eventBus.registerListener(LAYOUT_EVENTS.REFRESH_TITLE, _.debounce((panelId)=>{
|
||||
if(panelId == id) {
|
||||
const internal = layoutDocker?.find(id)?.internal??{};
|
||||
setAttrs({
|
||||
icon: internal.icon,
|
||||
title: internal.title,
|
||||
tooltip: internal.tooltip ?? internal.title,
|
||||
});
|
||||
}
|
||||
}, 100));
|
||||
|
||||
return ()=>deregister?.();
|
||||
}, []);
|
||||
|
@ -11,6 +11,7 @@ import React, { useContext, useEffect, useState } from 'react';
|
||||
import PropTypes from 'prop-types';
|
||||
import { LayoutDockerContext, LAYOUT_EVENTS } from './Layout';
|
||||
import { usePgAdmin } from '../../../static/js/BrowserComponent';
|
||||
import ErrorBoundary from './ErrorBoundary';
|
||||
|
||||
export default function withStandardTabInfo(Component, tabId) {
|
||||
// eslint-disable-next-line react/display-name
|
||||
@ -63,16 +64,18 @@ export default function withStandardTabInfo(Component, tabId) {
|
||||
}, []);
|
||||
|
||||
return (
|
||||
<Component
|
||||
{...props}
|
||||
nodeItem={nodeItem}
|
||||
nodeData={nodeData}
|
||||
node={node}
|
||||
treeNodeInfo={treeNodeInfo}
|
||||
isActive={isActive}
|
||||
isStale={isStale}
|
||||
setIsStale={(v)=>setNodeInfo((prev)=>[v, prev[1], prev[2]])}
|
||||
/>
|
||||
<ErrorBoundary>
|
||||
<Component
|
||||
{...props}
|
||||
nodeItem={nodeItem}
|
||||
nodeData={nodeData}
|
||||
node={node}
|
||||
treeNodeInfo={treeNodeInfo}
|
||||
isActive={isActive}
|
||||
isStale={isStale}
|
||||
setIsStale={(v)=>setNodeInfo((prev)=>[v, prev[1], prev[2]])}
|
||||
/>
|
||||
</ErrorBoundary>
|
||||
);
|
||||
};
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user