-
-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
12565 refine file exists warning #12625
base: main
Are you sure you want to change the base?
Conversation
enhancement: Changed error box dialog to Taget file already exists #3
Suggested filename is generated for displaying when hovering over "Keep both" button. The action of the button has been implemented.
The content of the message box is no longer editable. The look has also been changed for the better.
Triggers the functionality "Rename file to a given name" from context menu. Placeholder triggers action.
Add keep both functionality
…le-name Refactor functionality to the button Refactor name of the button from alternativeFileNameButton to provideAltFileNameButton
After merging, the function performRenameWithConflictCheck() was changed to use a different helper function, thereby making the textbox editable once again. This had to be updated.
1. make use of the passed AlertType instead of hardcoding 2. fix bug where pressing the red 'x' button on the textbox does nothing
Make textbox content un-editable
Fix message box display issue for long file names ( #4 )
Add functionality for button "Provide alternative file name"
…ltip-for-keep-both-button
…th-button 13 add hover tooltip for keep both button closes #13
…ot using it anymore
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Your code currently does not meet JabRef's code guidelines. We use Checkstyle to identify issues. Please carefully follow the setup guide for the codestyle. Afterwards, please run checkstyle locally and fix the issues.
In case of issues with the import order, double check that you activated Auto Import. You can trigger fixing imports by pressing Ctrl+Alt+O to trigger Optimize Imports.
12565 refine file exists warning
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
JUnit tests are failing. In the area "Some checks were not successful", locate "Tests / Unit tests (pull_request)" and click on "Details". This brings you to the test output.
You can then run these tests in IntelliJ to reproduce the failing tests locally. We offer a quick test running howto in the section Final build system checks in our setup guide.
Make tests for performRenameWithConflictCheck()
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Your code currently does not meet JabRef's code guidelines. We use Checkstyle to identify issues. Please carefully follow the setup guide for the codestyle. Afterwards, please run checkstyle locally and fix the issues.
In case of issues with the import order, double check that you activated Auto Import. You can trigger fixing imports by pressing Ctrl+Alt+O to trigger Optimize Imports.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Your code currently does not meet JabRef's code guidelines. We use OpenRewrite to ensure "modern" Java coding practices. The issues found can be automatically fixed. Please execute the gradle task rewriteRun
, check the results, commit, and push.
You can check the detailed error output by navigating to your pull request, selecting the tab "Checks", section "Tests" (on the left), subsection "OpenRewrite".
@trag-bot didn't find any issues in the code! ✅✨ |
Pull request summary
|
dialogPane.setPrefSize(700, 200); | ||
dialogPane.setContent(contentLabel); | ||
|
||
ButtonType overrideButton = new ButtonType("Override", ButtonBar.ButtonData.OTHER); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add proper Localization for these button types to all buttons as well using Localization.lang
if (btnKeepBoth != null) { | ||
Tooltip tooltip = new Tooltip(Localization.lang("New name: %0", suggestedFileName)); | ||
tooltip.setShowDelay(Duration.millis(100)); | ||
tooltip.setStyle("-fx-max-width: 20px; -fx-wrap-text: true; -fx-background-color: #FFFFE0;"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
px values dont scale. use em
dont manually set colors. use constants from base.css
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
put the whole style into base.css and only set a style class for this tooltip
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Undo
|
||
@BeforeEach | ||
void setUp() { | ||
MockitoAnnotations.openMocks(this); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if there is no mock annotation, this line has no effect.
@AfterEach | ||
void tearDown() throws IOException { | ||
// Clean up any real files after each test | ||
Files.walk(tempDir) | ||
.map(Path::toFile) | ||
.forEach(file -> { | ||
if (!file.isDirectory()) { | ||
file.delete(); | ||
} | ||
}); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Doesn't this do JUnit automatically with TempDirs?
You can simplify the title as and clarify the prompt with "Override" is an incorrect term probably meant as "Overwrite", but most examples use If the last button is important, consider using |
Refines the "File exists" warning

Adds "Keep both" button with tooltip
Adds "Provide alternative file name" button that triggers a renaming box
Improves title and context message
Closes #12565
Mandatory checks
CHANGELOG.md
described in a way that is understandable for the average user (if change is visible to the user)