Skip to content

Commit 5304395

Browse files
authored
Merge pull request #204 from doubleSlashde/develop
Develop to master
2 parents 7e2841a + 4f72a54 commit 5304395

29 files changed

Lines changed: 1420 additions & 378 deletions

.github/workflows/mavenCi.yml

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -44,12 +44,6 @@ jobs:
4444
name: KeepTime-${{ env.version }}
4545
path: /home/runner/work/KeepTime/KeepTime/target/*-bin.zip
4646

47-
- name: Analyze
48-
env:
49-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
50-
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
51-
run: mvn -V -B sonar:sonar -Dsonar.host.url=${{ secrets.HOST_URL }} -Dsonar.organization=${{ secrets.ORGANIZATION_NAME }} -Dsonar.projectKey=${{ secrets.PROJECT_KEY }} -Dsonar.java.binaries=. -Dsonar.qualitygate.wait=false
52-
5347
- name: Perform CodeQL Analysis
5448
uses: github/codeql-action/analyze@v3
5549

README.md

Lines changed: 21 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ Application to track your time spent on different projects each day. Aim was to
44

55
Create projects and choose if they are counted as 'work time'. Select the project you work on. Before you switch the project, write a comment on what u did. Change the project. Repeat.
66

7+
KeepTime can connect to [Heimat](https://heimat-software.com/) so you can import Heimat projects and sync your tracked time back to Heimat. Details: [heimat.md](readme/heimat.md).
8+
79
## Usage
810

911
### Main view:
@@ -29,9 +31,25 @@ Create projects and choose if they are counted as 'work time'. Select the projec
2931
+ Export: export database for backup and later import (import currently not yet implemented)
3032

3133
### Reports:
32-
![Report Screen](readme/images/reportDescription.png?raw=true "Report")
3334

34-
+ the report screen gives you a summary for every day
35+
KeepTime’s reporting workflow works by tracking daily work and synchronizing project activities with external task management. Here’s how you use it:
36+
37+
1. **Track Your Work**
38+
Throughout your workday, log activities and assign them to projects. Each entry includes a timeslot, duration, and optional notes.
39+
40+
2. **Review Your Daily Report**
41+
At any time, open the report view to see an overview of your day, including all logged activities, their durations, and project associations.
42+
43+
3. **Edit and Manage Entries**
44+
Use the controls in the report to copy, edit, or delete individual work entries as needed. You can also copy notes or summaries for external use.
45+
46+
4. **Select the Day to View**
47+
Use the calendar widget to select which day’s report you want to review. Only days with recorded work are available.
48+
49+
5. **Synchronize Projects with Heimat**
50+
If you want you can syncronize the current date with Heimat. See [heimat.md](readme/heimat.md)
51+
52+
![Report Dialog](readme/images/reportDescription.png)
3553

3654
## Install
3755

@@ -73,6 +91,6 @@ You should put the .jar in an extra folder as a *logs* and a *db* folder will be
7391
## Requirements
7492
* Operating System
7593
* Windows 7, 10, 11
76-
* Linux (tested on Ubuntu 18.04)
94+
* Linux (tested on Ubuntu 18.04, Fedora Workstation 43)
7795
* Mac (tested on MacBook M2 Pro (ARM based CPU))
7896
* Java >= 17

keeptime.bat

Lines changed: 27 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,27 @@
1-
start "" "javaw" -Dprism.order=sw -jar keeptime.jar
1+
@echo off
2+
setlocal
3+
4+
cd /d "%~dp0"
5+
6+
where javaw >nul 2>&1
7+
if errorlevel 1 (
8+
echo ERROR: Java was not found.
9+
echo.
10+
echo Please install Java.
11+
echo See installation requirements: https://github.com/doubleSlashde/KeepTime#requirements
12+
echo.
13+
pause
14+
exit /b 1
15+
)
16+
17+
if not exist "keeptime.jar" (
18+
echo ERROR: keeptime.jar was not found in this folder.
19+
echo.
20+
echo Please download and extract KeepTime from the releases page.
21+
echo See installation instructions: https://github.com/doubleSlashde/KeepTime#install
22+
echo.
23+
pause
24+
exit /b 1
25+
)
26+
27+
start "" "javaw" -Dprism.order=sw -jar keeptime.jar

pom.xml

Lines changed: 20 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
<parent>
77
<groupId>org.springframework.boot</groupId>
88
<artifactId>spring-boot-starter-parent</artifactId>
9-
<version>3.4.4</version>
9+
<version>3.5.14</version>
1010
<relativePath />
1111
<!-- lookup parent from repository -->
1212
</parent>
@@ -39,7 +39,7 @@
3939
<java.version>17</java.version>
4040
<javafx.version>22</javafx.version>
4141

42-
<maven-dependency-check.version>12.0.1</maven-dependency-check.version>
42+
<maven-dependency-check.version>12.2.2</maven-dependency-check.version>
4343
<!-- USING HTML,XML (comma-separated list) did not work with plugin version 5.1.0 -->
4444
<maven-dependency-check.format>ALL</maven-dependency-check.format>
4545
<maven-dependency-check.failOnError>true</maven-dependency-check.failOnError>
@@ -103,7 +103,18 @@
103103
<dependency>
104104
<groupId>org.springdoc</groupId>
105105
<artifactId>springdoc-openapi-starter-webmvc-ui</artifactId>
106-
<version>2.8.5</version>
106+
<version>2.8.17</version>
107+
</dependency>
108+
<!-- Overwrite tomcat version due to security vulnerability. remove when possible -->
109+
<dependency>
110+
<groupId>org.apache.tomcat.embed</groupId>
111+
<artifactId>tomcat-embed-core</artifactId>
112+
<version>10.1.55</version>
113+
</dependency>
114+
<dependency>
115+
<groupId>org.apache.tomcat.embed</groupId>
116+
<artifactId>tomcat-embed-websocket</artifactId>
117+
<version>10.1.55</version>
107118
</dependency>
108119
<dependency>
109120
<groupId>org.springframework.boot</groupId>
@@ -147,14 +158,9 @@
147158
<dependency>
148159
<groupId>org.apache.maven.plugins</groupId>
149160
<artifactId>maven-assembly-plugin</artifactId>
150-
<version>3.7.1</version>
161+
<version>3.8.0</version>
151162
<type>maven-plugin</type>
152163
</dependency>
153-
<dependency>
154-
<groupId>org.sonarsource.scanner.maven</groupId>
155-
<artifactId>sonar-maven-plugin</artifactId>
156-
<version>3.11.0.3922</version>
157-
</dependency>
158164
<dependency>
159165
<groupId>org.hamcrest</groupId>
160166
<artifactId>hamcrest-library</artifactId>
@@ -165,7 +171,7 @@
165171
<dependency>
166172
<groupId>com.fasterxml.jackson.datatype</groupId>
167173
<artifactId>jackson-datatype-jsr310</artifactId>
168-
<version>2.18.2</version>
174+
<version>2.22.0</version>
169175
</dependency>
170176

171177
</dependencies>
@@ -208,7 +214,7 @@
208214
<plugin>
209215
<groupId>org.apache.maven.plugins</groupId>
210216
<artifactId>maven-site-plugin</artifactId>
211-
<version>3.12.1</version>
217+
<version>3.22.0</version>
212218
</plugin>
213219

214220
<!-- https://mvnrepository.com/artifact/org.owasp/dependency-check-maven (run with mvn dependency-check:check ) -->
@@ -267,21 +273,21 @@
267273
<plugin>
268274
<groupId>org.apache.maven.plugins</groupId>
269275
<artifactId>maven-compiler-plugin</artifactId>
270-
<version>3.11.0</version>
276+
<version>3.15.0</version>
271277
<configuration>
272278
<annotationProcessorPaths>
273279
<path>
274280
<groupId>org.mapstruct</groupId>
275281
<artifactId>mapstruct-processor</artifactId>
276-
<version>1.5.5.Final</version>
282+
<version>1.6.3</version>
277283
</path>
278284
</annotationProcessorPaths>
279285
</configuration>
280286
</plugin>
281287
<plugin>
282288
<groupId>org.jacoco</groupId>
283289
<artifactId>jacoco-maven-plugin</artifactId>
284-
<version>0.8.10</version>
290+
<version>0.8.14</version>
285291
<executions>
286292
<execution>
287293
<id>prepare-agent</id>

readme/heimat.md

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
# Heimat integration
2+
3+
[Heimat](https://heimat-software.com/) is external project and time-tracking software. KeepTime can connect to it so you can:
4+
5+
- **Import** projects from Heimat into KeepTime, or **link** Heimat projects to projects you already have in KeepTime.
6+
- **Push** the time you logged in KeepTime for a given day into Heimat when you choose to sync.
7+
8+
**Important:** KeepTime never writes to Heimat on its own. Data is sent to Heimat only when you run the sync from the report view.
9+
10+
---
11+
12+
## 1. Connect KeepTime to Heimat
13+
14+
1. Open **Settings** and go to the **HEIMAT** section.
15+
16+
![Settings Heimat](images/settingsHeimat.png "Settings Heimat")
17+
18+
2. Fill in:
19+
20+
| Field | What to enter |
21+
| ---------------- | -------------------------------------------------------------------------------------------------------------------- |
22+
| **URL** | Your Heimat instance URL (the same base URL you use in the browser), for example `https://your-company.example.com`. |
23+
| **Access token** | Create or copy a token in Heimat (under your account or API settings) and paste it here. |
24+
25+
![Heimat Website](images/heimatWebsite.png "Heimat Website")
26+
27+
3. Click **Validate connection**. If it succeeds, the integration is ready to use.
28+
29+
---
30+
31+
## 2. Match Heimat projects to KeepTime
32+
33+
After a successful connection, use **Map projects** (button in Heimat settings dialog) to either:
34+
35+
- Map each Heimat project to an existing KeepTime project, or
36+
- Import Heimat projects as new KeepTime projects.
37+
38+
Do this once (or whenever your project lists change) so KeepTime knows where each Heimat project should go.
39+
40+
---
41+
42+
## 3. Sync a day’s work to Heimat
43+
44+
When you want to upload time for the **currently selected day** in the report:
45+
46+
1. Open the **report** view for that day.
47+
2. Click the **sync** button (Heimat / external sync).
48+
3. In the dialog, choose which projects to include and add any **note** you want stored with the sync.
49+
4. Click **Sync** to send that day’s tracked time to Heimat.
50+
51+
![External Project Dialog](images/externalProjectDialog.png)
52+
53+
Until you complete step 4, nothing is written to Heimat.
357 KB
Loading

readme/images/heimatWebsite.png

87.4 KB
Loading
228 KB
Loading

readme/images/settingsHeimat.png

20 KB
Loading

src/main/java/de/doubleslash/keeptime/App.java

Lines changed: 23 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
import java.io.StringWriter;
2222
import java.time.LocalDate;
2323
import java.util.List;
24+
import java.util.Locale;
2425
import java.util.Optional;
2526
import java.util.stream.Collectors;
2627

@@ -84,6 +85,9 @@ public class App extends Application {
8485
@Override
8586
public void init() throws Exception {
8687
LOG.info("Starting KeepTime.");
88+
89+
setLocaleToEnglish();
90+
8791
final DefaultExceptionHandler defaultExceptionHandler = new DefaultExceptionHandler();
8892
defaultExceptionHandler.register();
8993

@@ -102,6 +106,22 @@ public void init() throws Exception {
102106
model.setSpringContext(springContext);
103107
}
104108

109+
private void setLocaleToEnglish() {
110+
final Locale systemDefaultLocale = Locale.getDefault();
111+
final Locale wantedApplicationLocale = Locale.ENGLISH;
112+
113+
if (systemDefaultLocale.getLanguage().equals(wantedApplicationLocale.getLanguage())) {
114+
LOG.debug("Application locale already is '{}'. Nothing to do.", wantedApplicationLocale);
115+
return;
116+
}
117+
118+
LOG.info("Setting application locale to '{}', was '{}'.", wantedApplicationLocale, systemDefaultLocale);
119+
Locale.setDefault(wantedApplicationLocale);
120+
Locale.setDefault(Locale.Category.DISPLAY, wantedApplicationLocale);
121+
// keep system locale for format conversions (date, currency, numbers)
122+
Locale.setDefault(Locale.Category.FORMAT, systemDefaultLocale);
123+
}
124+
105125
@Override
106126
public void start(final Stage primaryStage) {
107127
LOG.info("Initialising the UI");
@@ -117,12 +137,13 @@ public void start(final Stage primaryStage) {
117137
}
118138
}
119139

120-
public static void showErrorDialogAndWait(String title, String header, String content, final Exception e, Window window) {
140+
public static void showErrorDialogAndWait(String title, String header, String content, final Exception e,
141+
Window window) {
121142
final Alert alert = new Alert(AlertType.ERROR);
122143
alert.setTitle(title);
123144
alert.setHeaderText(header);
124145
alert.setContentText(content);
125-
if(window != null) {
146+
if (window != null) {
126147
alert.initOwner(window);
127148
}
128149
final StringWriter sw = new StringWriter();

0 commit comments

Comments
 (0)