Skip to content

Commit

Permalink
Merge branch 'JabRef:main' into Ignore-initial-unprotected-uppercase
Browse files Browse the repository at this point in the history
  • Loading branch information
michalfarago committed Oct 17, 2023
2 parents 6070647 + 8ede31a commit 8c8deba
Show file tree
Hide file tree
Showing 20 changed files with 164 additions and 340 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: GreetingFirstTimeCodeContribution
name: Add greeting to issues for first time contributors

on:
issues:
Expand Down
39 changes: 39 additions & 0 deletions .github/workflows/add-to-projects.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: Add to Project on Label

on:
issues:
types: [labeled]

jobs:
add-to-project:
runs-on: ubuntu-latest

steps:
- name: "good first issue"
if: "${{ github.event.label.name == 'good first issue' }}"
env:
GH_TOKEN: ${{ secrets.PROJECT_TOKEN }}
run: |
ISSUE_URL=$(jq --raw-output .issue.html_url "$GITHUB_EVENT_PATH")
gh project item-add 5 --owner jabref --url $ISSUE_URL
- name: needs-refinement
if: github.event.label.name == 'needs-refinement'
env:
GH_TOKEN: ${{ secrets.PROJECT_TOKEN }}
run: |
ISSUE_URL=$(jq --raw-output .issue.html_url "$GITHUB_EVENT_PATH")
gh project item-add 15 --owner jabref --url $ISSUE_URL
- name: "status: freeze"
if: "${{ github.event.label.name == 'status: freeze' }}"
env:
GH_TOKEN: ${{ secrets.PROJECT_TOKEN }}
run: |
ISSUE_URL=$(jq --raw-output .issue.html_url "$GITHUB_EVENT_PATH")
gh project item-add 9 --owner jabref --url $ISSUE_URL
- name: ui
if: "${{ github.event.label.name == 'ui' }}"
env:
GH_TOKEN: ${{ secrets.PROJECT_TOKEN }}
run: |
ISSUE_URL=$(jq --raw-output .issue.html_url "$GITHUB_EVENT_PATH")
gh project item-add 8 --owner jabref --url $ISSUE_URL
2 changes: 1 addition & 1 deletion .github/workflows/automerge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
PR_URL: ${{github.event.pull_request.html_url}}
GITHUB_TOKEN: ${{secrets.GH_TOKEN_JABREF_MACHINE_PR_APPROVE}}
- name: Merge PR
run: gh pr merge --auto "$PR_URL"
run: gh pr merge --auto --squash "$PR_URL"
env:
PR_URL: ${{github.event.pull_request.html_url}}
GITHUB_TOKEN: ${{secrets.GH_TOKEN_UPDATE_GRADLE_WRAPPER}}
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,9 @@ Note that this project **does not** adhere to [Semantic Versioning](https://semv
- We fixed an issue where the "Enabled" column in the "Protected terms files" tab in the preferences could not be resized [#10285](https://github.com/JabRef/jabref/issues/10285)
- We fixed an issue where after creation of a new library, the new library was not focused. [koppor#592](https://github.com/koppor/jabref/issues/592)
- We fixed an issue where double clicking on an url in the file field would trigger an exception instead of opening the browser [#10480](https://github.com/JabRef/jabref/pull/10480)
- We fixed an issue where scrolling was impossible on dragging a citation on the groups panel. [#9754](https://github.com/JabRef/jabref/issues/9754)
- We fixed an issue where exporting "Embedded BibTeX pdf" without selecting an existing document would produce an exception. [#10101](https://github.com/JabRef/jabref/issues/10101)
- We fixed an issue where it was not possible to connect to a shared database once a group with entries was added or other metadata modified [#10336](https://github.com/JabRef/jabref/issues/10336)

### Removed

Expand Down
13 changes: 5 additions & 8 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ plugins {

// nicer test outputs during running and completion
// Homepage: https://github.com/radarsh/gradle-test-logger-plugin
id 'com.adarshr.test-logger' version '3.2.0'
id 'com.adarshr.test-logger' version '4.0.0'

id 'jacoco'

Expand Down Expand Up @@ -142,7 +142,7 @@ dependencies {

implementation group: 'org.eclipse.jgit', name: 'org.eclipse.jgit', version: '6.7.0.202309050840-r'

implementation group: 'com.fasterxml.jackson.dataformat', name: 'jackson-dataformat-yaml', version: '2.15.2'
implementation group: 'com.fasterxml.jackson.dataformat', name: 'jackson-dataformat-yaml', version: '2.15.3'
implementation group: 'com.fasterxml.jackson.datatype', name: 'jackson-datatype-jsr310', version: '2.15.2'

implementation group: 'org.mariadb.jdbc', name: 'mariadb-java-client', version: '2.7.9'
Expand All @@ -154,7 +154,7 @@ dependencies {
exclude module: 'oraclepki'
}

implementation ('com.google.guava:guava:32.1.2-jre') {
implementation ('com.google.guava:guava:32.1.3-jre') {
// TODO: Remove this as soon as https://github.com/google/guava/issues/2960 is fixed
exclude module: "jsr305"
}
Expand Down Expand Up @@ -187,6 +187,8 @@ dependencies {

// route all requests to java.util.logging to SLF4J (which in turn routes to tinylog)
implementation 'org.slf4j:jul-to-slf4j:2.0.9'
// route all requests to log4j to SLF4J
implementation 'org.apache.logging.log4j:log4j-to-slf4j:2.20.0'

implementation('de.undercouch:citeproc-java:3.0.0-beta.2') {
exclude group: 'org.antlr'
Expand All @@ -205,11 +207,6 @@ dependencies {
exclude group: "org.apache.xmlgraphics"
}

implementation group: 'com.microsoft.azure', name: 'applicationinsights-core', version: '2.4.1'
implementation (group: 'com.microsoft.azure', name: 'applicationinsights-logging-log4j2', version: '2.4.1') {
exclude module: "log4j-core"
}

implementation 'com.vladsch.flexmark:flexmark:0.64.8'

implementation group: 'net.harawata', name: 'appdirs', version: '1.2.2'
Expand Down
8 changes: 2 additions & 6 deletions src/main/java/module-info.java
Original file line number Diff line number Diff line change
Expand Up @@ -42,13 +42,13 @@
// Logging
requires org.slf4j;
requires jul.to.slf4j;
requires org.apache.logging.slf4j;
requires org.tinylog.api;
requires org.tinylog.api.slf4j;
requires org.tinylog.impl;

provides org.tinylog.writers.Writer
with org.jabref.gui.logging.GuiWriter,
org.jabref.gui.logging.ApplicationInsightsWriter;
with org.jabref.gui.logging.GuiWriter;

// Preferences and XML
requires java.prefs;
Expand All @@ -75,10 +75,6 @@
// dependency injection using HK2
requires org.glassfish.hk2.api;

// Microsoft application insights
requires applicationinsights.core;
requires applicationinsights.logging.log4j2;

// http clients
requires unirest.java;
requires org.apache.httpcomponents.httpclient;
Expand Down
30 changes: 1 addition & 29 deletions src/main/java/org/jabref/gui/Telemetry.java
Original file line number Diff line number Diff line change
@@ -1,51 +1,23 @@
package org.jabref.gui;

import java.util.Optional;
import java.util.UUID;

import javafx.stage.Screen;

import org.jabref.logic.util.BuildInfo;
import org.jabref.model.strings.StringUtil;
import org.jabref.preferences.TelemetryPreferences;

import com.google.common.base.StandardSystemProperty;
import com.microsoft.applicationinsights.TelemetryClient;
import com.microsoft.applicationinsights.TelemetryConfiguration;
import com.microsoft.applicationinsights.telemetry.SessionState;

public class Telemetry {
private static TelemetryClient telemetryClient;

private Telemetry() {
}

public static Optional<TelemetryClient> getTelemetryClient() {
return Optional.ofNullable(telemetryClient);
return Optional.empty();
}

private static void start(TelemetryPreferences telemetryPreferences, BuildInfo buildInfo) {
TelemetryConfiguration telemetryConfiguration = TelemetryConfiguration.getActive();
if (!StringUtil.isNullOrEmpty(buildInfo.azureInstrumentationKey)) {
telemetryConfiguration.setInstrumentationKey(buildInfo.azureInstrumentationKey);
}
telemetryConfiguration.setTrackingIsDisabled(!telemetryPreferences.shouldCollectTelemetry());
telemetryClient = new TelemetryClient(telemetryConfiguration);
telemetryClient.getContext().getProperties().put("JabRef version", buildInfo.version.toString());
telemetryClient.getContext().getProperties().put("Java version", StandardSystemProperty.JAVA_VERSION.value());
telemetryClient.getContext().getUser().setId(telemetryPreferences.getUserId());
telemetryClient.getContext().getSession().setId(UUID.randomUUID().toString());
telemetryClient.getContext().getDevice().setOperatingSystem(StandardSystemProperty.OS_NAME.value());
telemetryClient.getContext().getDevice().setOperatingSystemVersion(StandardSystemProperty.OS_VERSION.value());
telemetryClient.getContext().getDevice().setScreenResolution(Screen.getPrimary().getVisualBounds().toString());

telemetryClient.trackSessionState(SessionState.Start);
}

public static void shutdown() {
getTelemetryClient().ifPresent(client -> {
client.trackSessionState(SessionState.End);
client.flush();
});
}
}
11 changes: 11 additions & 0 deletions src/main/java/org/jabref/gui/TelemetryClient.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
package org.jabref.gui;

import java.util.Map;

public class TelemetryClient {
public void trackEvent(String actionName) {
}

public <K, V> void trackEvent(String actionName, Map<K, V> source, Map<K, V> of) {
}
}
28 changes: 16 additions & 12 deletions src/main/java/org/jabref/gui/groups/GroupTreeView.java
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,8 @@ public class GroupTreeView extends BorderPane {
private static final PseudoClass PSEUDOCLASS_ROOTELEMENT = PseudoClass.getPseudoClass("root");
private static final PseudoClass PSEUDOCLASS_SUBELEMENT = PseudoClass.getPseudoClass("sub"); // > 1 deep

private static final double SCROLL_SPEED = 50;
private static final double SCROLL_SPEED = 2000.0; // larger is slower
private static final double SCROLL_LIMITS = 40.0;

private TreeTableView<GroupNodeViewModel> groupTree;
private TreeTableColumn<GroupNodeViewModel, GroupNodeViewModel> mainColumn;
Expand Down Expand Up @@ -144,7 +145,7 @@ private void createNodes() {

groupTree = new TreeTableView<>();
groupTree.setId("groupTree");
groupTree.setColumnResizePolicy(TreeTableView.CONSTRAINED_RESIZE_POLICY);
groupTree.setColumnResizePolicy(TreeTableView.CONSTRAINED_RESIZE_POLICY_FLEX_LAST_COLUMN);
groupTree.getColumns().addAll(List.of(mainColumn, numberColumn, expansionNodeColumn));
this.setCenter(groupTree);

Expand Down Expand Up @@ -389,7 +390,6 @@ private void handleOnDragOver(TreeTableRow<GroupNodeViewModel> row, GroupNodeVie
ControlHelper.setDroppingPseudoClasses(row, event);
}
}
event.consume();
}

private void updateSelection(List<TreeItem<GroupNodeViewModel>> newSelectedGroups) {
Expand Down Expand Up @@ -456,16 +456,20 @@ private void setupDragScrolling() {

groupTree.setOnScroll(event -> scrollTimer.stop());
groupTree.setOnDragDone(event -> scrollTimer.stop());
groupTree.setOnDragEntered(event -> scrollTimer.stop());
groupTree.setOnDragDropped(event -> scrollTimer.stop());
groupTree.setOnDragExited(event -> {
if (event.getY() > 0) {
scrollVelocity = 1.0 / SCROLL_SPEED;
} else {
scrollVelocity = -1.0 / SCROLL_SPEED;
}
scrollTimer.restart();
});
groupTree.setOnDragExited(event -> scrollTimer.stop());

groupTree.setOnDragEntered(event -> scrollTimer.restart());

groupTree.setOnDragOver(event -> {
if (event.getY() > groupTree.getHeight() - SCROLL_LIMITS) {
scrollVelocity = 1.0 / SCROLL_SPEED;
} else if (event.getY() < SCROLL_LIMITS) {
scrollVelocity = -1.0 / SCROLL_SPEED;
} else {
scrollVelocity = 0;
}
});
}

private Optional<ScrollBar> getVerticalScrollbar() {
Expand Down
116 changes: 0 additions & 116 deletions src/main/java/org/jabref/gui/logging/ApplicationInsightsLogEvent.java

This file was deleted.

Loading

0 comments on commit 8c8deba

Please sign in to comment.