1) Change the cursor to a pointer for JSON editor toolbar buttons.

2) Remove the extra scrollbar in JSON editor.
3) Set the focus on the PSQL tool.
This commit is contained in:
Akshay Joshi 2024-06-18 16:42:17 +05:30
parent 007c4840c2
commit 0452828cc7
4 changed files with 15 additions and 11 deletions

View File

@ -402,7 +402,7 @@ define('pgadmin.node.table', [
handle_cache: function() {
// Clear Table's cache as column's type is dependent on two node
// 1) Type node 2) Domain node
this.clear_cache(...null);
this.clear_cache(null);
},
});
}

View File

@ -65,6 +65,7 @@ export default function jsonEditorOverride(theme) {
backgroundColor: theme.palette.default.main + ' !important',
color: theme.palette.text.primary + ' !important',
fontWeight: 'normal !important',
cursor:'pointer',
/* Over rides icons */
'&.jsoneditor-format::before': {
@ -134,6 +135,7 @@ export default function jsonEditorOverride(theme) {
backgroundColor: theme.palette.default.main + ' !important',
color: theme.palette.text.primary + ' !important',
fontWeight: 'normal !important',
cursor:'pointer',
},
'.jsoneditor-contextmenu': {

View File

@ -141,16 +141,16 @@ export default function PsqlComponent({ params, pgAdmin }) {
});
/* Addon for fitAddon, webLinkAddon, SearchAddon */
const fitAddon = psql_Addon(term);
term.open(containerRef.current);
/* Socket */
const socket = psql_socket();
psql_socket_io(socket, params.is_enable, params.sid, params.db, params.server_type, fitAddon, term, params.role);
psql_terminal_io(term, socket, params.platform, pgAdmin);
/* Set terminal size */
setTimeout(function(){
socket.emit('resize', {'cols': term.cols, 'rows': term.rows});
@ -160,11 +160,13 @@ export default function PsqlComponent({ params, pgAdmin }) {
useEffect(()=>{
const [term, socket] = initializePsqlTool(params);
termRef.current = term;
termRef.current = term;
termRef.current?.setOption('theme', {
background: '#ff0000'});
termRef.current.focus();
return () => {
term.dispose();
socket.disconnect();
@ -192,7 +194,7 @@ export default function PsqlComponent({ params, pgAdmin }) {
PsqlComponent.propTypes = {
params:PropTypes.shape({
is_enable: PropTypes.Boolean,
is_enable: PropTypes.bool,
sid: PropTypes.oneOfType([PropTypes.number, PropTypes.string]).isRequired,
db: PropTypes.oneOfType([PropTypes.number, PropTypes.string]).isRequired,
server_type: PropTypes.string,
@ -200,4 +202,4 @@ PsqlComponent.propTypes = {
platform: PropTypes.string
}),
pgAdmin: PropTypes.object.isRequired,
};
};

View File

@ -94,7 +94,7 @@ const StyledEditorDiv = styled(Box)(({ theme }) => ({
...theme.mixins.panelBorder.all,
outline: 0,
resize: 'both',
overflow: 'auto',
overflow: 'hidden',
},
'& .jsoneditor': {
height: 'abc',
@ -130,9 +130,9 @@ const ResizableDiv = ({columnIndex, children, ...otherProps}) => {
}
if (box.right > innerWidth) {
editorRef.current.firstChild.style.width = `${currentWidth - widthDiff - 20}px`;
}
}
};
editorRef.current.addEventListener('mousedown', () => {
document.addEventListener('mouseup', resizeEditor, {once: true});
});