Repository navigation
Make Query Tool SQL file drop replace, merge, or ask. #10272 #10763
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
dpage
merged 5 commits into
pgadmin-org:master
from
lkmatsumura:fix/query-tool-sql-file-drop
Nov 16, 2026
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
5d37479
Make Query Tool SQL file drop replace, merge, or ask. #10272
2e00685
Keep the SQL file-drop merge caret accurate after edits and cancelled…
9089525
Enhance SQL file drop handling to maintain editor state when no text …
9fdcb2a
Implement SQL file drop preferences in Query Tool editor
077de45
Ignore stale and non-editable OS SQL file drops in the Query Tool edi…
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,46 @@ | ||
| ///////////////////////////////////////////////////////////// | ||
| // | ||
| // pgAdmin 4 - PostgreSQL Tools | ||
| // | ||
| // Copyright (C) 2013 - 2026, The pgAdmin Development Team | ||
| // This software is released under the PostgreSQL Licence | ||
| // | ||
| ////////////////////////////////////////////////////////////// | ||
|
|
||
| import { ModalContent, ModalFooter } from '../components/ModalContent'; | ||
| import gettext from 'sources/gettext'; | ||
| import { Box } from '@mui/material'; | ||
| import { DefaultButton, PrimaryButton } from '../components/Buttons'; | ||
| import CloseIcon from '@mui/icons-material/CloseRounded'; | ||
| import MergeTypeRoundedIcon from '@mui/icons-material/MergeTypeRounded'; | ||
| import FindReplaceRoundedIcon from '@mui/icons-material/FindReplaceRounded'; | ||
| import PropTypes from 'prop-types'; | ||
|
|
||
| export default function ConfirmFileDropContent({closeModal, onMerge, onReplace}) { | ||
| return ( | ||
| <ModalContent> | ||
| <Box flexGrow="1" p={2}> | ||
| {gettext('The editor already has content. Do you want to replace it with the dropped file, or merge the file content at the current cursor position?')} | ||
| </Box> | ||
| <ModalFooter> | ||
| <DefaultButton data-test="close" startIcon={<CloseIcon />} onClick={()=>{ | ||
| closeModal(); | ||
| }} >{gettext('Cancel')}</DefaultButton> | ||
| <DefaultButton data-test="merge" startIcon={<MergeTypeRoundedIcon />} onClick={()=>{ | ||
| onMerge?.(); | ||
| closeModal(); | ||
| }} >{gettext('Merge')}</DefaultButton> | ||
| <PrimaryButton data-test="replace" startIcon={<FindReplaceRoundedIcon />} onClick={()=>{ | ||
| onReplace?.(); | ||
| closeModal(); | ||
| }} autoFocus={true} >{gettext('Replace')}</PrimaryButton> | ||
| </ModalFooter> | ||
| </ModalContent> | ||
| ); | ||
| } | ||
|
|
||
| ConfirmFileDropContent.propTypes = { | ||
| closeModal: PropTypes.func, | ||
| onMerge: PropTypes.func, | ||
| onReplace: PropTypes.func, | ||
| }; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.