Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
75 commits
Select commit Hold shift + click to select a range
e62878b
#178: update spring dependency
Death111 Jan 25, 2025
e18e3bb
#178: start of api client
Death111 Jan 25, 2025
0abf2de
#178: transform settings table to key-value table for easier extesion…
Death111 Jan 25, 2025
c8ec6ff
#178: add heimat settings in settings layout. add heimat settings to …
Death111 Jan 25, 2025
71cf0ea
#178: fix/restore settings handling
Death111 Jan 26, 2025
ce597b4
#178: remove VARCHAR limit - check how it looks in db
Death111 Jan 26, 2025
03610d9
#178: allow to map projects in settings view
Death111 Jan 26, 2025
f8bef51
#178: start sync to heimat dialog
Death111 Jan 28, 2025
71e5ffb
#178: show times from heimat in sync view for conflict resolution. ad…
Death111 Jan 29, 2025
9152072
#178: show color of project
Death111 Jan 29, 2025
e73b6dc
#178: add initial sync functionality
Death111 Jan 30, 2025
9185624
#178: add red border if not a valid time or note
Death111 Feb 16, 2025
f0bd7af
Merge branch 'feature/#165_Rest-API-New' into feature/#178_heimatInte…
Death111 Feb 24, 2025
9283c66
#178: refactor logic and add tests for conversion for UI. improve ui.
Death111 Mar 2, 2025
84fb254
#178: close map projects dialog on button. allow project creation in …
Death111 Mar 6, 2025
276632d
#178: show sync loading screen success/failure message
Death111 Mar 6, 2025
336a2f8
#178: show error dialog if something goes wrong when opening stages
Death111 Mar 7, 2025
bf62fa9
#178: implement shouldShowHeimatTimeWhenProjectIsNotMappedInKeeptime
Death111 Mar 7, 2025
3461ce2
#178: show current heimat + keeptime times. add copy button. add hype…
Death111 Mar 7, 2025
96ecef5
#178: show project of heimat for not mapped keeptime project
Death111 Mar 8, 2025
4c3817e
#178: improve layouts
Death111 Mar 8, 2025
19d794e
Merge branch 'feature/#165_Rest-API-New' into feature/#178_heimatInte…
Death111 Mar 8, 2025
f3f10e6
#178: move keeptime work time to bottom
Death111 Mar 8, 2025
87778f7
#178: rename projectName to taskHolderName. show warnings to the user.
Death111 Mar 9, 2025
36b5443
#178: only save changed mappings
Death111 Mar 9, 2025
3920b06
#178: add icons for restapi+heimat. move heimat tab up
Death111 Mar 9, 2025
010976d
#178: cleanup static code analysis
Death111 Mar 9, 2025
c96c09b
#178: in 'new heimat time' consider "shouldBeSynced" status
Death111 Mar 10, 2025
37c6fa0
#178: update dependencies
Death111 Mar 10, 2025
6005b6a
#178: adapt param name
Death111 Mar 10, 2025
ab010d0
#178: update migration steps
Death111 Mar 10, 2025
27235ed
#178: adapt report background color to white
Death111 Mar 10, 2025
7319ecd
#178: handle edge case where project was mapped but no work exist for…
Death111 Mar 10, 2025
6724b38
Merge branch 'develop' into feature/#178_heimatIntegration
Death111 Mar 10, 2025
58c27d5
#178: sort by projectName + taskName
Death111 Mar 11, 2025
bb121b3
#178: refresh heimatapi connection (to use latest credentials) when v…
Death111 Mar 11, 2025
0bd2583
Merge branch 'feature/#178_heimatIntegration' of https://github.com/d…
Death111 Mar 11, 2025
44366e2
#178: show project name which had sync errors (if present). shorter d…
Death111 Mar 11, 2025
01557cf
#178: remove mappings of deleted keeptime projects. add tests. move u…
Death111 Mar 11, 2025
5e2e79a
#178: make heimat controller handle all 'database' object logic.
Death111 Mar 11, 2025
2a496db
#178: use random color when importing projects
Death111 Mar 11, 2025
bf4478b
#178: fix tests
Death111 Mar 11, 2025
b741010
#178: fix heimat button not visible in report without restart
Death111 Mar 12, 2025
c5e3863
#178: add "random" button in project dialog
Death111 Mar 12, 2025
0e6a284
#178: disable save button when invalid projects exist
Death111 Mar 15, 2025
c2034f0
#178: add tests for save times
Death111 Mar 15, 2025
6711ac8
#178: add dialog to import multiple projects at once. change project …
Death111 Mar 16, 2025
dcd2e94
#178: save metadata as json
Death111 Mar 16, 2025
8062049
#178: add icon to sync button in report
Death111 Mar 16, 2025
692983d
#178: make validation logic consistent
Death111 Mar 16, 2025
85eb0ba
#178: add option to add unmapped tasks to sync
Death111 Mar 17, 2025
887fa97
#178: use styling for buttons
Death111 Mar 17, 2025
c001e94
#178: add hint to rest api port
Death111 Mar 17, 2025
4332f61
#178: adapt more styles
Death111 Mar 18, 2025
f90b9e2
#178: set icon color. change button text for sync
Death111 Mar 18, 2025
9078865
#178: use tableview instead of listview for import dialog. to show ma…
Death111 Mar 18, 2025
ed5eb29
#178: add combobox-styling
Death111 Mar 19, 2025
66aaf9c
#178: uncheck sync when already present. fix issue that present heima…
Death111 Mar 21, 2025
ddf735a
#178: improve syncing dialog while syncing. show link to heimat to co…
Death111 Mar 21, 2025
1d788ba
#178: style tableView. tertiary-buttons
Death111 Mar 21, 2025
632b926
#178: fix treetableview selected style
Death111 Mar 22, 2025
58366d7
#178: layouts. add invalid mappings again to list
Death111 Mar 22, 2025
a0b1c79
#178: add license header to new files
Death111 Mar 22, 2025
772e63f
#178: rename controller to be consistent
Death111 Mar 22, 2025
7c5cb40
#178: update spring patch version
Death111 Mar 22, 2025
8def475
#178: report fix selected arrow disappear
Death111 Mar 24, 2025
d986d51
#178: fix spelling
Death111 Mar 25, 2025
1b6761c
#178: add quick fix for #170
Death111 Mar 25, 2025
04b6fed
#178: fix issue where stoping loading spinner rotation did not reset …
Death111 Mar 25, 2025
849fbbf
#178: check for time diff >= 15minutes instead of > to also sync when…
Death111 Mar 26, 2025
58aefe3
#178: rename variables
Death111 Mar 26, 2025
f675c1a
#178: fix bug where manually added row was creating inconsistent vali…
Death111 Mar 27, 2025
3c9ff46
#178: center sync checkbox horiztonal
Death111 Mar 27, 2025
2a07293
#178: add hint for unexpected exception to be reported to a developer
Death111 Mar 27, 2025
e755888
#178: adding "Sync to" prefix now consistently. scrolling to newly ad…
Death111 Mar 30, 2025
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
48 changes: 32 additions & 16 deletions .github/workflows/mavenCi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ on:
jobs:

build-analyze:

runs-on: ubuntu-latest

env:
Expand Down Expand Up @@ -55,18 +54,35 @@ jobs:
uses: github/codeql-action/analyze@v3

dependency-check:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4

- name: Set up JDK 17
uses: actions/setup-java@v4
with:
java-version: '17'
distribution: 'corretto'
cache: maven

- name: dependencyCheck
run: mvn dependency-check:check
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up JDK 17
uses: actions/setup-java@v4
with:
java-version: '17'
distribution: 'corretto'
cache: maven
- name: Build
run: mvn -V -B clean package
- name: Depcheck
uses: dependency-check/Dependency-Check_Action@main
id: Depcheck
env:
# actions/setup-java@v1 changes JAVA_HOME so it needs to be reset to match the depcheck image
JAVA_HOME: /opt/jdk
with:
project: 'KeepTime'
path: '.'
format: 'HTML'
out: 'reports' # this is the default, no need to specify unless you wish to override it
args: >
--failOnCVSS 8.9
--enableRetired
- name: Upload Test results
if: always()
uses: actions/upload-artifact@v4
with:
name: Depcheck report
path: ${{github.workspace}}/reports
33 changes: 20 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ Create projects and choose if they are counted as 'work time'. Select the projec

## Install

* Download keeptime-<version>.zip (see [releases](https://github.com/doubleSlashde/KeepTime/releases))
* Download keeptime-\<version\>.zip (see [releases](https://github.com/doubleSlashde/KeepTime/releases))
* Extract the downloaded .zip
* Try starting the application by executing the *keeptime.bat* file. The start may take up to one minute.

Expand All @@ -45,27 +45,34 @@ It is recommended to run the application at computer start, so you do not forget

You should put the .jar in an extra folder as a *logs* and a *db* folder will be created next to it.\

### Migrate from older version than v1.2.0
## Update KeepTime
1. Start your current version of KeepTime
1. Open `Settings` -> `Import/Export` -> `Export` to export your data to an .sql file (Backup data)
1. Stop KeepTime
1. Download new version of KeepTime and extract it
1. Start new version of KeepTime
1. If your projects are available you are already done. But most likely your projects are missing. In this case follow the [Migrate](#Migrate) chapter
- Missing data is expected behavior with most updates as updates often include database version update which require an import of data

### Migrate data
1. Notice that your old data is not available after an update
1. Open the new version of KeepTime
1. Open `Settings` -> `Import/Export` -> `Import` and import the previously exported .sql file
1. After the import KeepTime closes automatically
1. Start KeepTime
1. Your data is restored in the new version now

### Migrate from version older than v1.2.0

1. Download new version and replace the .jar file.
2. Start new version of KeepTime. Notice that your old data is not available.
3. Stop KeepTime
4. Copy the files (not directories) of directory `db` (next to the .jar file) into `db/1.4.197/` (path now includes the database version).
5. Start KeepTime again. Notice that your data is available again.

### Migrate from KeepTime v1.2.0

1. Start your current version of KeepTime (v1.2.0)
2. Go to the settings and export your KeepTime data
3. Download new version and replace the .jar file.
4. Start new version of KeepTime. Notice that your old data is not available.
5. Open the new version and import the exported sql script
6. After the import KeepTime closes automatically
7. To see the changes just start the new KeepTime again

## Requirements
* Operating System
* Windows 7, 10, 11
* Linux (tested on Ubuntu 18.04)
* Mac (tested on MacBook M2 Pro (ARM based CPU))
* Java 17
* Java >= 17
20 changes: 13 additions & 7 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>3.1.10</version>
<version>3.4.4</version>
<relativePath />
<!-- lookup parent from repository -->
</parent>
Expand Down Expand Up @@ -39,7 +39,7 @@
<java.version>17</java.version>
<javafx.version>22</javafx.version>

<maven-dependency-check.version>9.1.0</maven-dependency-check.version>
<maven-dependency-check.version>12.0.1</maven-dependency-check.version>
<!-- USING HTML,XML (comma-separated list) did not work with plugin version 5.1.0 -->
<maven-dependency-check.format>ALL</maven-dependency-check.format>
<maven-dependency-check.failOnError>true</maven-dependency-check.failOnError>
Expand All @@ -51,12 +51,12 @@
<dependency>
<groupId>org.mapstruct</groupId>
<artifactId>mapstruct</artifactId>
<version>1.5.5.Final</version>
<version>1.6.3</version>
</dependency>
<dependency>
<groupId>org.mapstruct</groupId>
<artifactId>mapstruct-processor</artifactId>
<version>1.5.5.Final</version>
<version>1.6.3</version>
<scope>provided</scope>
</dependency>
<dependency>
Expand Down Expand Up @@ -103,17 +103,15 @@
<dependency>
<groupId>org.springdoc</groupId>
<artifactId>springdoc-openapi-starter-webmvc-ui</artifactId>
<version>2.5.0</version>
<version>2.8.5</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-validation</artifactId>
</dependency>
<!-- https://mvnrepository.com/artifact/org.springframework.boot/spring-boot-starter-security -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-security</artifactId>
<version>3.1.3</version>
</dependency>


Expand Down Expand Up @@ -162,6 +160,14 @@
<artifactId>hamcrest-library</artifactId>
<scope>test</scope>
</dependency>

<!-- for HeimatTime LocalDate (de)serializiation -->
<dependency>
<groupId>com.fasterxml.jackson.datatype</groupId>
<artifactId>jackson-datatype-jsr310</artifactId>
<version>2.18.2</version>
</dependency>

</dependencies>
<build>
<finalName>keeptime-${project.version}</finalName>
Expand Down
79 changes: 34 additions & 45 deletions src/main/java/de/doubleslash/keeptime/App.java
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
import java.util.Optional;
import java.util.stream.Collectors;

import javafx.stage.Window;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.boot.SpringApplication;
Expand Down Expand Up @@ -78,6 +79,7 @@ public class App extends Application {
private ViewController viewController;

private GlobalScreenListener globalScreenListener;
private Settings settings;

@Override
public void init() throws Exception {
Expand All @@ -95,6 +97,7 @@ public void init() throws Exception {

model = springContext.getBean(Model.class);
controller = springContext.getBean(Controller.class);
settings = springContext.getBean(Settings.class);
controller.enableAutoSave();
model.setSpringContext(springContext);
}
Expand All @@ -108,36 +111,43 @@ public void start(final Stage primaryStage) {
} catch (final Exception e) {
LOG.error("There was an error while initialising the UI", e);

final Alert alert = new Alert(AlertType.ERROR);
alert.setTitle("Error");
alert.setHeaderText("Could not start application");
alert.setContentText("Please send the error with your logs folder to a developer");
showErrorDialogAndWait("Error", "Could not start application",
"Please send the error with your logs folder to a developer", e, null);
System.exit(1);
}
}

final StringWriter sw = new StringWriter();
final PrintWriter pw = new PrintWriter(sw);
e.printStackTrace(pw);
final String exceptionText = sw.toString();
public static void showErrorDialogAndWait(String title, String header, String content, final Exception e, Window window) {
final Alert alert = new Alert(AlertType.ERROR);
alert.setTitle(title);
alert.setHeaderText(header);
alert.setContentText(content);
if(window != null) {
alert.initOwner(window);
}
final StringWriter sw = new StringWriter();
final PrintWriter pw = new PrintWriter(sw);
e.printStackTrace(pw);
final String exceptionText = sw.toString();

final Label label = new Label("The exception stacktrace was:");
final Label label = new Label("The exception stacktrace was:");

final TextArea textArea = new TextArea(exceptionText);
textArea.setEditable(false);
textArea.setWrapText(true);
final TextArea textArea = new TextArea(exceptionText);
textArea.setEditable(false);
textArea.setWrapText(true);

textArea.setMaxWidth(Double.MAX_VALUE);
textArea.setMaxHeight(Double.MAX_VALUE);
GridPane.setVgrow(textArea, Priority.ALWAYS);
GridPane.setHgrow(textArea, Priority.ALWAYS);
textArea.setMaxWidth(Double.MAX_VALUE);
textArea.setMaxHeight(Double.MAX_VALUE);
GridPane.setVgrow(textArea, Priority.ALWAYS);
GridPane.setHgrow(textArea, Priority.ALWAYS);

final GridPane expContent = new GridPane();
expContent.setMaxWidth(Double.MAX_VALUE);
expContent.add(label, 0, 0);
expContent.add(textArea, 0, 1);
final GridPane expContent = new GridPane();
expContent.setMaxWidth(Double.MAX_VALUE);
expContent.add(label, 0, 0);
expContent.add(textArea, 0, 1);

alert.getDialogPane().setExpandableContent(expContent);
alert.showAndWait();
System.exit(1);
}
alert.getDialogPane().setExpandableContent(expContent);
alert.showAndWait();
}

private void initialiseApplication(final Stage primaryStage) throws Exception {
Expand Down Expand Up @@ -183,27 +193,6 @@ private void initialiseApplication(final Stage primaryStage) throws Exception {
private void readSettings() {
LOG.debug("Reading configuration");

final List<Settings> settingsList = model.getSettingsRepository().findAll();
final Settings settings;
if (settingsList.isEmpty()) {
LOG.info("Empty settings. Set default");
settings = new Settings();
settings.setTaskBarColor(model.taskBarColor.get());

settings.setDefaultBackgroundColor(Model.ORIGINAL_DEFAULT_BACKGROUND_COLOR);
settings.setDefaultFontColor(Model.ORIGINAL_DEFAULT_FONT_COLOR);

settings.setHoverBackgroundColor(Model.ORIGINAL_HOVER_BACKGROUND_COLOR);
settings.setHoverFontColor(Model.ORIGINAL_HOVER_Font_COLOR);
settings.setUseHotkey(false);
settings.setDisplayProjectsRight(false);
settings.setHideProjectsOnMouseExit(false);
model.getSettingsRepository().save(settings);
} else {
LOG.info("Got settings from database");
settings = settingsList.get(0);
}

model.defaultBackgroundColor.set(settings.getDefaultBackgroundColor());
model.defaultFontColor.set(settings.getDefaultFontColor());
model.hoverBackgroundColor.set(settings.getHoverBackgroundColor());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,21 @@

import javafx.scene.paint.Color;

import java.util.Random;

public class ColorHelper {

private static final Random random = new Random();

private ColorHelper() {
throw new IllegalStateException("Utility class: ColorHelper");
}

public static Color randomColor() {
return Color.BLACK;
double hue = random.nextDouble() * 360;
double saturation = 0.7 + random.nextDouble() * 0.3; // High saturation
double brightness = 0.8 + random.nextDouble() * 0.2; // High brightness
return Color.hsb(hue, saturation, brightness);
}

public static String colorToCssRgba(final Color color) {
Expand Down
16 changes: 15 additions & 1 deletion src/main/java/de/doubleslash/keeptime/common/Resources.java
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@ public enum RESOURCE {

FXML_MANAGE_PROJECT("/layouts/manage-project.fxml"),
FXML_MANAGE_WORK("/layouts/manage-work.fxml"),
FXML_EXT_PROJECT_MAPPING("/layouts/externalProjectMapping.fxml"),
FXML_EXT_PROJECT_SYNC("/layouts/externalProjectSync.fxml"),

SVG_CALENDAR_DAYS_ICON("/svgs/calendar-days.svg"),

Expand Down Expand Up @@ -69,8 +71,20 @@ public enum RESOURCE {

SVG_MULTIPLE_CLIPBOARD_ICON("/svgs/copy.svg"),

ICON_MAIN("/icons/icon.png")
SVG_SPINNER_SOLID("/svgs/spinner-solid.svg"),

SVG_XMARK_SOLID("/svgs/xmark-solid.svg"),

SVG_THUMBS_UP_SOLID("/svgs/thumbs-up-solid.svg"),

SVG_GLOBE_ICON("/svgs/globe-solid.svg"),

SVG_ROTATE_ICON("/svgs/rotate-solid.svg"),

ICON_MAIN("/icons/icon.png"),

/** CSS **/
CSS_DS_STYLE("/css/dsStyles.css")
;

String resourceLocation;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ public static String getSvgPathWithXMl(Resources.RESOURCE resource){
return svgPath;
}

public static SVGPath getSvgNodeWithScale(Resources.RESOURCE resource, Double scaleX, Double scaleY) {
public static SVGPath getSvgNodeWithScale(Resources.RESOURCE resource, double scaleX, double scaleY) {
SVGPath iconSvg = new SVGPath();
iconSvg.setContent(getSvgPathWithXMl(resource));
iconSvg.setScaleX(scaleX);
Expand Down
Loading