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:
Akshay Joshi 2024-07-24 12:54:20 +05:30
parent 026292f07b
commit 0511554db9
3 changed files with 13 additions and 4 deletions

View File

@ -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);

View File

@ -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.

View File

@ -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)=>{