Skip to content
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

Only disable move to file dir when path equals #7269

Merged
merged 3 commits into from
Dec 30, 2020
Merged

Conversation

Siedlerchr
Copy link
Member

@Siedlerchr Siedlerchr commented Dec 29, 2020

Fix equals in path method
Fixes #7194

The dialog is now only disable when the file is already in the file directory

  • Change in CHANGELOG.md described (if applicable)
  • Tests created for changes (if applicable)
  • Manually tested changed features in running JabRef (always required)
  • Screenshots added in PR description (for UI changes)
  • Checked documentation: Is the information available and up to date? If not created an issue at https://github.com/JabRef/user-documentation/issues or, even better, submitted a pull request to the documentation repository.

@Siedlerchr Siedlerchr added the status: ready-for-review Pull Requests that are ready to be reviewed by the maintainers label Dec 29, 2020
void isNotSamePath() {
linkedFile = new LinkedFile("desc", tempFile, "pdf");
databaseContext = mock(BibDatabaseContext.class);
when(filePreferences.getFileNamePattern()).thenReturn("[citationkey]"); // use this variant, as we cannot mock the linkedFileHandler cause it's initialized inside the viewModel
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If it's hard to write tests, then it's a good indication that some refactoring should be done. Indeed, we use the mvvm pattern to make testing easy. Could you thus please add a constructor in the viewmodel that accepts a linkedFileHandler .

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually, it's just the comment which is obsolete here, as the linkedFilesHandler is not required and can be tested separately (and already is). Would need the same mocking, so no difference.

@tobiasdiez tobiasdiez added the status: changes required Pull requests that are not yet complete label Dec 29, 2020
@Siedlerchr Siedlerchr removed the status: changes required Pull requests that are not yet complete label Dec 29, 2020
@Siedlerchr Siedlerchr merged commit afdb194 into master Dec 30, 2020
@Siedlerchr Siedlerchr deleted the fixContextmenu branch December 30, 2020 12:43
Siedlerchr added a commit that referenced this pull request Dec 30, 2020
* upstream/master: (201 commits)
  Only disable  move to file dir when path equals (#7269)
  Improved detection of long DOI's within text (#7260)
  Add missing author and fix name
  Fix style of highlighted checkboxes while searching in preferences (#7258)
  Updates to institution citation keys (#7210)
  Bump xmlunit-core from 2.8.1 to 2.8.2 (#7251)
  Bump classgraph from 4.8.97 to 4.8.98 (#7250)
  Bump bcprov-jdk15on from 1.67 to 1.68 (#7249)
  Bump xmlunit-matchers from 2.8.1 to 2.8.2 (#7252)
  Bump unirest-java from 3.11.06 to 3.11.09 (#7254)
  Bump org.beryx.jlink from 2.23.0 to 2.23.1 (#7253)
  Bump pascalgn/automerge-action from v0.12.0 to v0.13.0 (#7255)
  Added a check to integrate with the flatpak package (#7248)
  New translations JabRef_en.properties (Chinese Traditional) (#7247)
  Update code-howtos.md
  GitBook: [master] 5 pages and 25 assets modified
  New Crowdin updates (#7246)
  add language mapping for chinese
  remove chinese content
  fix hamcrest link
  ...

# Conflicts:
#	src/main/java/org/jabref/gui/JabRefFrame.java
#	src/main/java/org/jabref/gui/dialogs/AutosaveUiManager.java
#	src/main/java/org/jabref/gui/exporter/SaveAction.java
#	src/main/java/org/jabref/gui/exporter/SaveDatabaseAction.java
#	src/main/java/org/jabref/logic/autosaveandbackup/BackupManager.java
#	src/test/java/org/jabref/gui/exporter/SaveDatabaseActionTest.java
Siedlerchr added a commit that referenced this pull request Jan 1, 2021
* updateGradle7: (39 commits)
  try upgrading gradle
  Only disable  move to file dir when path equals (#7269)
  Improved detection of long DOI's within text (#7260)
  Add missing author and fix name
  Fix style of highlighted checkboxes while searching in preferences (#7258)
  Updates to institution citation keys (#7210)
  Bump xmlunit-core from 2.8.1 to 2.8.2 (#7251)
  Bump classgraph from 4.8.97 to 4.8.98 (#7250)
  Bump bcprov-jdk15on from 1.67 to 1.68 (#7249)
  Bump xmlunit-matchers from 2.8.1 to 2.8.2 (#7252)
  Bump unirest-java from 3.11.06 to 3.11.09 (#7254)
  Bump org.beryx.jlink from 2.23.0 to 2.23.1 (#7253)
  Bump pascalgn/automerge-action from v0.12.0 to v0.13.0 (#7255)
  Added a check to integrate with the flatpak package (#7248)
  New translations JabRef_en.properties (Chinese Traditional) (#7247)
  Update code-howtos.md
  GitBook: [master] 5 pages and 25 assets modified
  New Crowdin updates (#7246)
  add language mapping for chinese
  remove chinese content
  ...
Siedlerchr added a commit that referenced this pull request Jan 3, 2021
* upstream/master:
  fix checsktyle
  Fix for application dialogs opening in wrong displays (#7273)
  Only disable  move to file dir when path equals (#7269)
  Improved detection of long DOI's within text (#7260)
  Add missing author and fix name
  Fix style of highlighted checkboxes while searching in preferences (#7258)
  Updates to institution citation keys (#7210)
  Bump xmlunit-core from 2.8.1 to 2.8.2 (#7251)
  Bump classgraph from 4.8.97 to 4.8.98 (#7250)
  Bump bcprov-jdk15on from 1.67 to 1.68 (#7249)
  Bump xmlunit-matchers from 2.8.1 to 2.8.2 (#7252)
  Bump unirest-java from 3.11.06 to 3.11.09 (#7254)
  Bump org.beryx.jlink from 2.23.0 to 2.23.1 (#7253)
  Bump pascalgn/automerge-action from v0.12.0 to v0.13.0 (#7255)

# Conflicts:
#	src/main/java/org/jabref/gui/openoffice/OpenOfficePanel.java
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: ready-for-review Pull Requests that are ready to be reviewed by the maintainers
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Move file to file directory ceased working
2 participants