mirror of
https://github.com/pgadmin-org/pgadmin4.git
synced 2024-11-24 09:40:21 -06:00
The following issues have been fixed:
1) White screen issue after closing the Macro dialog. 2) Schema Diff database and schema selection issue. 3) CSV download issue.
This commit is contained in:
parent
026292f07b
commit
0511554db9
@ -8,7 +8,7 @@
|
|||||||
//////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////
|
||||||
import PropTypes from 'prop-types';
|
import PropTypes from 'prop-types';
|
||||||
|
|
||||||
import React, { useContext, useState } from 'react';
|
import React, { useContext, useState, useEffect } from 'react';
|
||||||
|
|
||||||
import { Box, Grid, Typography } from '@mui/material';
|
import { Box, Grid, Typography } from '@mui/material';
|
||||||
|
|
||||||
@ -18,13 +18,18 @@ import { SCHEMA_DIFF_EVENT } from '../SchemaDiffConstants';
|
|||||||
|
|
||||||
|
|
||||||
export function InputComponent({ label, serverList, databaseList, schemaList, diff_type, selectedSid = null, selectedDid=null, selectedScid=null, onServerSchemaChange }) {
|
export function InputComponent({ label, serverList, databaseList, schemaList, diff_type, selectedSid = null, selectedDid=null, selectedScid=null, onServerSchemaChange }) {
|
||||||
|
|
||||||
const [selectedServer, setSelectedServer] = useState(selectedSid);
|
const [selectedServer, setSelectedServer] = useState(selectedSid);
|
||||||
const [selectedDatabase, setSelectedDatabase] = useState(selectedDid);
|
const [selectedDatabase, setSelectedDatabase] = useState(selectedDid);
|
||||||
const [selectedSchema, setSelectedSchema] = useState(selectedScid);
|
const [selectedSchema, setSelectedSchema] = useState(selectedScid);
|
||||||
const eventBus = useContext(SchemaDiffEventsContext);
|
const eventBus = useContext(SchemaDiffEventsContext);
|
||||||
const [disableDBSelection, setDisableDBSelection] = useState(selectedSid == null);
|
const [disableDBSelection, setDisableDBSelection] = useState(selectedSid == null);
|
||||||
const [disableSchemaSelection, setDisableSchemaSelection] = useState(selectedDid == null);
|
const [disableSchemaSelection, setDisableSchemaSelection] = useState(selectedDid == null);
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
setSelectedDatabase(selectedDid)
|
||||||
|
if (selectedDid) setDisableSchemaSelection(false);
|
||||||
|
}, [selectedSid, selectedDid, selectedScid]);
|
||||||
|
|
||||||
const changeServer = (selectedOption) => {
|
const changeServer = (selectedOption) => {
|
||||||
setDisableDBSelection(false);
|
setDisableDBSelection(false);
|
||||||
setSelectedServer(selectedOption);
|
setSelectedServer(selectedOption);
|
||||||
|
@ -2110,7 +2110,7 @@ def start_query_download_tool(trans_id):
|
|||||||
)
|
)
|
||||||
if not sql:
|
if not sql:
|
||||||
sql = trans_obj.get_sql(sync_conn)
|
sql = trans_obj.get_sql(sync_conn)
|
||||||
if query_commited:
|
if sql and query_commited:
|
||||||
# Re-execute the query to ensure the latest data is included
|
# Re-execute the query to ensure the latest data is included
|
||||||
sync_conn.execute_async(sql)
|
sync_conn.execute_async(sql)
|
||||||
# This returns generator of records.
|
# This returns generator of records.
|
||||||
|
@ -139,7 +139,7 @@ export default function MacrosDialog({onClose, onSave}) {
|
|||||||
const [userMacrosData, setUserMacrosData] = React.useState([]);
|
const [userMacrosData, setUserMacrosData] = React.useState([]);
|
||||||
const [macrosErr, setMacrosErr] = React.useState(null);
|
const [macrosErr, setMacrosErr] = React.useState(null);
|
||||||
|
|
||||||
React.useEffect(async ()=>{
|
const fetchMacrosData = async ()=>{
|
||||||
try {
|
try {
|
||||||
// Fetch user macros data
|
// Fetch user macros data
|
||||||
let { data: userMacroRespData } = await queryToolCtx.api.get(url_for('sqleditor.get_user_macros'));
|
let { data: userMacroRespData } = await queryToolCtx.api.get(url_for('sqleditor.get_user_macros'));
|
||||||
@ -155,6 +155,10 @@ export default function MacrosDialog({onClose, onSave}) {
|
|||||||
} catch (error) {
|
} catch (error) {
|
||||||
setMacrosErr(error);
|
setMacrosErr(error);
|
||||||
}
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
React.useEffect(()=>{
|
||||||
|
fetchMacrosData();
|
||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
const onSaveClick = (_isNew, changeData)=>{
|
const onSaveClick = (_isNew, changeData)=>{
|
||||||
|
Loading…
Reference in New Issue
Block a user