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

Git Integration and UI Improvements #12252

Open
wants to merge 93 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 87 commits
Commits
Show all changes
93 commits
Select commit Hold shift + click to select a range
094252c
l'ajout de la classe BackUpManagerJGit
nawalchahboune Oct 23, 2024
d0f6346
l'ajout de la classe BackUpManagerJGit
nawalchahboune Oct 23, 2024
7fd8f89
Merge remote-tracking branch 'origin/main'
nawalchahboune Oct 23, 2024
9ab37a2
l'ajout de la classe BackUpManagerJGit
nawalchahboune Oct 23, 2024
d8812ef
Add the class JGIT
Nov 6, 2024
af50c7c
first git implementation, not tested
Nov 6, 2024
e72d408
ajout de la methide backupGitDiffers
nawalchahboune Nov 6, 2024
d427e05
Added Pop up to choose backup
Nov 6, 2024
0737f48
adding methods 06/11
nawalchahboune Nov 6, 2024
f68236f
methods aded and changed : retrieveCommitDetails , retreiveCommits
nawalchahboune Nov 7, 2024
129d175
I start switching French comments to English
ilias-lwa3r Nov 11, 2024
b82682a
finish switching comments from French to English
ilias-lwa3r Nov 11, 2024
34a2889
Added table
Nov 12, 2024
b299e5f
Navigation through dialogs implemented
Nov 13, 2024
d2b3619
some modif
nawalchahboune Nov 19, 2024
d84fcab
some modif
nawalchahboune Nov 19, 2024
54fa60a
fix some issues
nawalchahboune Nov 19, 2024
9a8e615
adding date details
nawalchahboune Nov 19, 2024
62a8beb
Merge branch 'UI' into branch-1
Nov 19, 2024
df21a4d
Merge branch 'branch-1' of https://github.com/khola22/jabref into bra…
Nov 19, 2024
0f9fcb9
Revert "Merge branch 'branch-1' of https://github.com/khola22/jabref …
Nov 19, 2024
7b6ee3f
Reapply "Merge branch 'branch-1' of https://github.com/khola22/jabref…
Nov 19, 2024
b67b2d9
minor fixes
Nov 20, 2024
3f9584e
Minor Synthax fixes
Nov 20, 2024
76b6f92
supression de classe BackupManagerJGit
nawalchahboune Nov 20, 2024
fc94296
differenciation BackupManagerOld et BackupManager
nawalchahboune Nov 20, 2024
d6df47a
Corrected errors related to BackupManagerGit class
Nov 26, 2024
9a07077
Start tests
Nov 26, 2024
9c86a64
OpenDatabaseAction adapted
Nov 27, 2024
fa42e86
Start adapting SaveDatabaseAction.java and LibraryTab.java
Nov 27, 2024
be482cd
Classes adapted, except for UI
Nov 27, 2024
2797c01
UI update
Nov 27, 2024
27f7c47
Merge branch 'branch-1' of https://github.com/khola22/jabref into bra…
Nov 27, 2024
d070e67
Starting tests
Nov 27, 2024
528fe03
Starting tests
Nov 27, 2024
d40eadd
Merge remote-tracking branch 'origin/branch-1' into branch-1
Nov 27, 2024
11f65c7
first tests that are working
Nov 27, 2024
8ebb62a
All the tests for BackupManagerGit + Launcher working
Nov 28, 2024
562b285
Add some LOGGERS to BackupManagerGit.java
Nov 28, 2024
a2fa8b0
Adapted UI to BackupManagerGit for ChoiceDialog
Nov 29, 2024
1ad47a3
Adapted BackupUIManager to BackupManagerGit
Nov 29, 2024
a580032
Adapted Tests to UI adaptation
Nov 30, 2024
9a1c3a1
Added getter for name attribute of BackupEntry
Nov 30, 2024
1013c3c
Revert "Added getter for name attribute of BackupEntry"
Nov 30, 2024
4daf772
Final fix
Nov 30, 2024
ecad580
fixed the issue with detecting changes
Nov 30, 2024
c356375
Merge remote-tracking branch 'origin/branch-1' into branch-1
Nov 30, 2024
5d22a1a
editing the testRerieveCommitDetails test
nawalchahboune Nov 30, 2024
ae8583a
Fix the shutdown / usage of old BackupManager
Nov 30, 2024
44f4e17
correct path
Nov 30, 2024
19b0ef5
attempt to remove useless original path in some methods
nawalchahboune Dec 1, 2024
7f89d89
CORRECTING PATHS ! a clean launch (except for the 1st exception)
Dec 1, 2024
850e681
Merge remote-tracking branch 'origin/branch-1' into branch-1
Dec 1, 2024
119e5d0
Fixed the dialog of the 1st exception)
Dec 1, 2024
a7d271b
Fixed the infinite loops of commits
Dec 1, 2024
96c3239
Reversed backup list
Dec 1, 2024
5d0afe6
no more NULL for git initialization
Dec 1, 2024
7a48131
resolving prblm
nawalchahboune Dec 1, 2024
47d5238
Copying files to the backupdir logic
Dec 1, 2024
e881ce4
Add listeners
Dec 1, 2024
02fa1d1
Listeners detect changes but don't set needsBackup to true (I don't k…
Dec 1, 2024
c219a98
correct comment
Dec 2, 2024
5ae7407
Resolve the comment : Remove this here, we already have a newer versi…
Dec 2, 2024
ebe6f6b
Resolve the comment : delete this file (module-info.java), it's not n…
Dec 2, 2024
b0cc7f7
Adding BackupManagerGitTest class (with 5/5 passed tests)
nawalchahboune Dec 3, 2024
7085fc4
- Implement the unique file names in order to avoid conflicts when co…
Dec 4, 2024
3532d2e
The popup is available again
Dec 4, 2024
08b3c0c
Restore backup that functions
Dec 4, 2024
2c6da4b
Corrected retrieve commits / commits details
Dec 4, 2024
bca3558
Updated submodule abbrv.jabref.org
Dec 4, 2024
7e63aa2
Updated submodule csl-styles to latest commit
Dec 4, 2024
97caf34
Added support to review each change in a backup
Gillan0 Dec 4, 2024
b1c006e
Remove usage of BackupFileUtil in UI
Gillan0 Dec 4, 2024
aac4915
BackupResolverDialog.java doesn't use the old backup system anymore.
Dec 4, 2024
a292db3
change in CHANGELOG.md
Dec 5, 2024
7ae97d1
Updated submodule csl-locales to latest commit
Dec 5, 2024
5bbefcf
Merge branch 'main' into branch-1
khola22 Dec 5, 2024
70b123b
Update CHANGELOG.md
khola22 Dec 5, 2024
69ad0f3
CHANGELOG.md changes
Dec 5, 2024
a577ad9
Resolve comment on LibraryTab.java and BackupManagerGit.java
Dec 5, 2024
e55a831
Resolve comment on LibraryTab.java and BackupManagerGit.java
Dec 5, 2024
cf23e68
Resolve comment on BackupUIManager.java
Dec 5, 2024
61a1987
checkstyle
Dec 5, 2024
b515e51
Working Tests
Dec 5, 2024
8f06c80
Add missing submodule configuration
Dec 5, 2024
d3b6dd3
Apply OpenRewrite recipes
Dec 5, 2024
2a05da5
Correct Unit Tests
Dec 5, 2024
dbe6f2b
Added new UI text to JabRef_en.properties
Gillan0 Dec 6, 2024
3d13e22
Merge branch 'fix-localization-issues' into branch-1
Dec 6, 2024
e065399
Resolve comment on BackupManagerGitTest.java and
nawalchahboune Dec 7, 2024
01478c7
Resolve comments on insatantiation within mock
nawalchahboune Dec 13, 2024
e4ad25c
Merge branch 'main' into branch-1
khola22 Dec 13, 2024
da79d5d
Resolve comment about BackupUIManager.java
Dec 13, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,6 @@
url = https://github.com/citation-style-language/locales.git
ignore = all
shallow = true
[submodule "jabref"]
path = jabref
url = https://github.com/JabRef/jabref.git
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ Note that this project **does not** adhere to [Semantic Versioning](https://semv

### Added

- Enhanced backup and restore functionality. [#2961](https://github.com/JabRef/jabref/issues/2961)
- We added a Markdown export layout. [#12220](https://github.com/JabRef/jabref/pull/12220)
- We added a "view as BibTeX" option before importing an entry from the citation relation tab. [#11826](https://github.com/JabRef/jabref/issues/11826)
- We added support finding LaTeX-encoded special characters based on plain Unicode and vice versa. [#11542](https://github.com/JabRef/jabref/pull/11542)
Expand Down
1 change: 1 addition & 0 deletions jabref
Submodule jabref added at 470597
23 changes: 15 additions & 8 deletions src/main/java/org/jabref/gui/LibraryTab.java
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
import org.jabref.gui.autocompleter.SuggestionProvider;
import org.jabref.gui.autocompleter.SuggestionProviders;
import org.jabref.gui.autosaveandbackup.AutosaveManager;
import org.jabref.gui.autosaveandbackup.BackupManager;
import org.jabref.gui.autosaveandbackup.BackupManagerGit;
import org.jabref.gui.collab.DatabaseChangeMonitor;
import org.jabref.gui.dialogs.AutosaveUiManager;
import org.jabref.gui.entryeditor.EntryEditor;
Expand Down Expand Up @@ -105,6 +105,7 @@
import com.tobiasdiez.easybind.Subscription;
import org.controlsfx.control.NotificationPane;
import org.controlsfx.control.action.Action;
import org.eclipse.jgit.api.errors.GitAPIException;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

Expand Down Expand Up @@ -308,7 +309,7 @@ private void onDatabaseLoadingStarted() {
getMainTable().placeholderProperty().setValue(loadingLayout);
}

private void onDatabaseLoadingSucceed(ParserResult result) {
private void onDatabaseLoadingSucceed(ParserResult result) throws GitAPIException, IOException {
OpenDatabaseAction.performPostOpenActions(result, dialogService, preferences);
if (result.getChangedOnMigration()) {
this.markBaseChanged();
Expand Down Expand Up @@ -343,7 +344,7 @@ private void onDatabaseLoadingFailed(Exception ex) {
dialogService.showErrorDialogAndWait(title, content, ex);
}

private void setDatabaseContext(BibDatabaseContext bibDatabaseContext) {
private void setDatabaseContext(BibDatabaseContext bibDatabaseContext) throws GitAPIException, IOException {
TabPane tabPane = this.getTabPane();
if (tabPane == null) {
LOGGER.debug("User interrupted loading. Not showing any library.");
Expand All @@ -367,13 +368,13 @@ private void setDatabaseContext(BibDatabaseContext bibDatabaseContext) {
installAutosaveManagerAndBackupManager();
}

public void installAutosaveManagerAndBackupManager() {
public void installAutosaveManagerAndBackupManager() throws GitAPIException, IOException {
if (isDatabaseReadyForAutoSave(bibDatabaseContext)) {
AutosaveManager autosaveManager = AutosaveManager.start(bibDatabaseContext);
autosaveManager.registerListener(new AutosaveUiManager(this, dialogService, preferences, entryTypesManager));
}
if (isDatabaseReadyForBackup(bibDatabaseContext) && preferences.getFilePreferences().shouldCreateBackup()) {
BackupManager.start(this, bibDatabaseContext, Injector.instantiateModelOrService(BibEntryTypesManager.class), preferences);
BackupManagerGit.start(this, bibDatabaseContext, Injector.instantiateModelOrService(BibEntryTypesManager.class), preferences);
Copy link
Member

Choose a reason for hiding this comment

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

entryTypesManager is available as visible above. No need to inject.

}
}

Expand Down Expand Up @@ -750,7 +751,7 @@ private boolean confirmClose() {
}

if (buttonType.equals(discardChanges)) {
BackupManager.discardBackup(bibDatabaseContext, preferences.getFilePreferences().getBackupDirectory());
LOGGER.debug("Discarding changes");
return true;
}

Expand Down Expand Up @@ -798,7 +799,7 @@ private void onClosed(Event event) {
LOGGER.error("Problem when shutting down autosave manager", e);
}
try {
BackupManager.shutdown(bibDatabaseContext,
BackupManagerGit.shutdown(bibDatabaseContext,
preferences.getFilePreferences().getBackupDirectory(),
preferences.getFilePreferences().shouldCreateBackup());
} catch (RuntimeException e) {
Expand Down Expand Up @@ -1078,7 +1079,13 @@ public static LibraryTab createLibraryTab(BackgroundTask<ParserResult> dataLoadi

newTab.setDataLoadingTask(dataLoadingTask);
dataLoadingTask.onRunning(newTab::onDatabaseLoadingStarted)
.onSuccess(newTab::onDatabaseLoadingSucceed)
.onSuccess(result -> {
try {
newTab.onDatabaseLoadingSucceed(result);
} catch (Exception e) {
LOGGER.error("An error occurred while loading the database", e);
}
})
.onFailure(newTab::onDatabaseLoadingFailed)
.executeWith(taskExecutor);

Expand Down
Loading
Loading