Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
74 commits
Select commit Hold shift + click to select a range
019bffd
Merge pull request #156 from doubleSlashde/release/v1.3
Death111 Feb 14, 2023
8241426
#165: Include REST API
mairKi Jul 28, 2023
f567ddd
#165_REST-API: Include Swagger
mairKi Jul 31, 2023
d2416da
#165_Zwischen Commit auslagerung in module
mairKi Aug 4, 2023
f04c9df
#165: Swagger v3 not working
mairKi Aug 7, 2023
19ad014
Revert "#165: Swagger v3 not working"
mairKi Aug 7, 2023
128be9c
Revert "#165_Zwischen Commit auslagerung in module"
mairKi Aug 7, 2023
930e4f8
Revert "#165_REST-API: Include Swagger"
mairKi Aug 7, 2023
9439929
#165: include GetMappig
mairKi Aug 7, 2023
5964cae
#165: include post ang get Mapping
mairKi Aug 8, 2023
58107d5
#165: Include PutMapping and code Refactoring
mairKi Aug 9, 2023
871cb7a
#165: include updateWork and Refactoring
mairKi Aug 9, 2023
05b369c
#165: Refactoring
mairKi Aug 17, 2023
672bfad
#165: Include REST API Authentication
mairKi Sep 13, 2023
96b3a16
#165: include authentication Flyway
mairKi Sep 14, 2023
cd8adbc
#165: Add UserRepository
mairKi Sep 14, 2023
350b384
#165: Add AuthoritiesRepository
mairKi Sep 14, 2023
ba6e6e4
#165: Get all Works with api
mairKi Sep 14, 2023
5621f1c
#165: Include authentikation with GUI
mairKi Sep 27, 2023
26d46d0
#165: ON and OFF but OFF not Correct
mairKi Sep 29, 2023
b2d0e51
#165: include API AuthTest
mairKi Sep 29, 2023
cbe6a9f
#165: API Auth
mairKi Sep 29, 2023
0d42f3c
#165: include Auth on Gui
mairKi Sep 29, 2023
6d57a4a
#165: Zwischen Speicher
mairKi Sep 29, 2023
c7e18ad
IPTE-165: Authentikation freigabe für Post, PUT, ...
mairKi Nov 2, 2023
76ccb87
IPTE-165: Include Deletmapping for Work ,Project and edit Work
mairKi Nov 3, 2023
fff79d1
IPTE-156: Get Curret Project ID and Delete Mapping with default query
mairKi Nov 8, 2023
ed4b4ca
IPTE-165: Include Change API Port
mairKi Nov 13, 2023
0bfa224
IPTE-165: in clude Rest API Port, Current
mairKi Nov 16, 2023
2b06ec8
IPTE-156: ON OFF
mairKi Nov 19, 2023
584f2df
IPTE-165: Code Refactoring
mairKi Nov 20, 2023
2e83a1d
IPTE-165: include DTO
mairKi Nov 22, 2023
bed209c
IPTE-165: Include ColorDTO
mairKi Nov 23, 2023
6a99f80
IPTE-165: Refactoring Transfer to own packages
mairKi Nov 23, 2023
8562439
IPTE-165: Clean Code
mairKi Nov 23, 2023
36b93e7
IPTE-165: Refactoring WorksController
mairKi Nov 23, 2023
bb4ba0b
IPTE-165: Refactoring ProjectController and Transfer ProjectColorDTO …
mairKi Nov 24, 2023
49a3db6
IPTE-165: Remove Button in GUI
mairKi Nov 24, 2023
3fcb8aa
IPTE-165: Port Default OFF
mairKi Nov 24, 2023
bea1723
IPTE-165: Code Refactoring
mairKi Nov 27, 2023
49428b1
IPTE-165: Code Refactoring
mairKi Nov 27, 2023
f94c978
IPTE-165: Pull Request
mairKi Dec 6, 2023
4480dc8
IPTE-165: Test Refactoring
mairKi Dec 6, 2023
49630a3
IPTE-165: ON-OFF API Status
mairKi Dec 7, 2023
2555d54
Revert "IPTE-165: ON-OFF API Status"
mairKi Dec 7, 2023
1dcf40d
IPTE-165: Code Refactoring ON OFF Username
mairKi Dec 14, 2023
e875ab4
IPTE-165: Code Refatoring include getUser
mairKi Dec 11, 2023
007a337
IPTE-165: Clean pom.xml
mairKi Dec 11, 2023
fb2535f
IPTE-165: Clean Code
mairKi Dec 14, 2023
8a51e63
Merge branch 'feature/update_dependencies' into feature/#165_Rest-API…
mairKi Feb 5, 2024
e0ac484
#165Rest-API-New: Fix User Bug
mairKi Feb 5, 2024
0c80e5c
#165Rest-API-New: Include license header
mairKi Feb 5, 2024
ed66096
#165Rest-API-New: Clean Code
mairKi Feb 5, 2024
0e340ac
#165_Rest-API-New: Merge Request
mairKi Feb 5, 2024
4afbc5e
IPTE-165: Clean Code
mairKi Feb 15, 2024
4fa51be
#165: Zwischen Kommit mit funktionality Login
mairKi Apr 2, 2024
07df243
#165: Clean Code
mairKi Apr 3, 2024
8a6a6e4
#165: Code Refactoring
mairKi Apr 8, 2024
d2c9b19
Include a new Class LoginController and LoginControllerTest
mairKi Apr 10, 2024
284b278
#165: Code Refactoring
mairKi Apr 11, 2024
6f752e0
#165 Pull Request
mairKi Jun 11, 2024
484bc3b
#165: Pull Request
mairKi Jul 2, 2024
498047f
Merge branch 'develop' into feature/#165_Rest-API-New
mairKi Jul 2, 2024
75b2bf9
Merge branch 'master' into feature/#165_Rest-API-New
mairKi Jul 2, 2024
820e5f6
Merge branch 'develop' into feature/#165_Rest-API-New
Death111 Jan 9, 2025
310bffc
#165: fix test. use string to transfer color instead of double rgba v…
Death111 Jan 9, 2025
884c060
#165: add openapi + swagger ui
Death111 Jan 9, 2025
20b8444
#165: switched some if statements to be easier redable. started to ma…
Death111 Jan 9, 2025
f8c9dac
#165: fix issue where all application.properties were persisted in se…
Death111 Jan 9, 2025
0a67fb3
#165: wrapping writting calls from api in a wrapper. adapted rest calls
Death111 Jan 19, 2025
1fd80c2
#165: migrate SecurityConfiguration
Death111 Jan 19, 2025
d747c50
#165: format code
Death111 Jan 19, 2025
eee8ff7
#165: using close instead of stop to properly close application with …
Death111 Jan 30, 2025
ec823f7
#165: added filter options for get work
Death111 Mar 8, 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
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -30,3 +30,4 @@ logs/

config.xml
/db/
application.properties
48 changes: 47 additions & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,17 @@
</properties>

<dependencies>
<dependency>
<groupId>org.mapstruct</groupId>
<artifactId>mapstruct</artifactId>
<version>1.5.5.Final</version>
</dependency>
<dependency>
<groupId>org.mapstruct</groupId>
<artifactId>mapstruct-processor</artifactId>
<version>1.5.5.Final</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.openjfx</groupId>
<artifactId>javafx-controls</artifactId>
Expand Down Expand Up @@ -85,6 +96,27 @@
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-jpa</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>org.springdoc</groupId>
<artifactId>springdoc-openapi-starter-webmvc-ui</artifactId>
<version>2.5.0</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>


<dependency>
<groupId>org.glassfish.jaxb</groupId>
<artifactId>jaxb-runtime</artifactId>
Expand Down Expand Up @@ -226,10 +258,24 @@
<id>coverage</id>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.11.0</version>
<configuration>
<annotationProcessorPaths>
<path>
<groupId>org.mapstruct</groupId>
<artifactId>mapstruct-processor</artifactId>
<version>1.5.5.Final</version>
</path>
</annotationProcessorPaths>
</configuration>
</plugin>
<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<version>0.8.7</version>
<version>0.8.10</version>
<executions>
<execution>
<id>prepare-agent</id>
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/de/doubleslash/keeptime/App.java
Original file line number Diff line number Diff line change
Expand Up @@ -305,7 +305,7 @@ private void registerMaximizeEventlistener(final Scene mainScene, final Stage pr

@Override
public void stop() throws Exception {
springContext.stop();
springContext.close();
}

}
16 changes: 6 additions & 10 deletions src/main/java/de/doubleslash/keeptime/controller/Controller.java
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@
import de.doubleslash.keeptime.model.Settings;
import de.doubleslash.keeptime.model.Work;
import jakarta.annotation.PreDestroy;
import javafx.collections.ObservableList;

@Service
public class Controller {
Expand Down Expand Up @@ -84,9 +83,7 @@ public void changeProject(final Project newProject, final long minusSeconds) {
final Work newWork = new Work(workEnd, workEnd.plusSeconds(minusSeconds), newProject, "");

model.getPastWorkItems().add(newWork);

model.activeWorkItem.set(newWork);

}

public Work saveCurrentWork(final LocalDateTime workEnd) {
Expand All @@ -98,19 +95,19 @@ public Work saveCurrentWork(final LocalDateTime workEnd) {

currentWork.setEndTime(workEnd);

final String time = DateFormatter
.secondsToHHMMSS(Duration.between(currentWork.getStartTime(), currentWork.getEndTime()).getSeconds());
final String time = DateFormatter.secondsToHHMMSS(
Duration.between(currentWork.getStartTime(), currentWork.getEndTime()).getSeconds());

LOG.info("Saving Work from '{}' to '{}' ({}) on project '{}' with notes '{}'", currentWork.getStartTime(),
currentWork.getEndTime(), time, currentWork.getProject().getName(), currentWork.getNotes());

// Save in db
return model.getWorkRepository().save(currentWork);

}

public void addNewProject(final Project project) {
LOG.info("Creating new project '{}'.", project);

model.getAllProjects().add(project);
model.getAvailableProjects().add(project);

Expand Down Expand Up @@ -190,7 +187,7 @@ public void deleteProject(final Project p) {

final int indexToRemove = p.getIndex();
p.setEnabled(false); // we don't delete it because of the referenced work
// items
// items
p.setIndex(-1);

model.getAvailableProjects().remove(p);
Expand Down Expand Up @@ -253,7 +250,7 @@ public void deleteWork(final Work workToBeDeleted) {

/**
* Changes the indexes of the originalList parameter to have a consistent order.
*
*
* @param originalList
* list of all projects to adapt the indexes for
* @param changedProject
Expand Down Expand Up @@ -296,7 +293,7 @@ List<Project> resortProjectIndexes(final List<Project> originalList, final Proje

/**
* Decreases all indexes by one, after the removed index
*
*
* @param originalList
* list of all projects to adapt the indexes for
* @param removedIndex
Expand Down Expand Up @@ -361,5 +358,4 @@ public long calcSeconds(final List<Work> workItems) {

return seconds;
}

}
3 changes: 2 additions & 1 deletion src/main/java/de/doubleslash/keeptime/model/Model.java
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
import javafx.collections.ObservableList;
import javafx.collections.transformation.SortedList;
import javafx.scene.paint.Color;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.ConfigurableApplicationContext;
import org.springframework.stereotype.Component;

Expand All @@ -35,7 +36,7 @@ public class Model {
private ProjectRepository projectRepository;
private WorkRepository workRepository;
private SettingsRepository settingsRepository;

@Autowired
public Model(final ProjectRepository projectRepository, final WorkRepository workRepository,
final SettingsRepository settingsRepository) {
super();
Expand Down
27 changes: 10 additions & 17 deletions src/main/java/de/doubleslash/keeptime/model/Project.java
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ public class Project {
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Column(name = "id", updatable = false, nullable = false)
private long id;

private String name;

@Lob
Expand All @@ -39,9 +38,7 @@ public class Project {
private Color color;

private boolean isWork;

private boolean isDefault;

private boolean isEnabled;

private int index;
Expand All @@ -50,9 +47,7 @@ public Project() {
// Needed for jpa
}

public Project(final String name, final String description, final Color color, final boolean isWork, final int index,
final boolean isDefault) {
super();
public Project(String name, String description, Color color, boolean isWork, int index, boolean isDefault) {
this.name = name;
this.description = description;
this.color = color;
Expand All @@ -62,48 +57,47 @@ public Project(final String name, final String description, final Color color, f
this.index = index;
}

public Project(final String name, final String description, final Color color, final boolean isWork,
final int index) {
public Project(String name, String description, Color color, boolean isWork, int index) {
this(name, description, color, isWork, index, false);
}

public String getName() {
return name;
}

public void setName(final String name) {
public void setName(String name) {
this.name = name;
}

public Color getColor() {
return color;
}

public void setColor(final Color color) {
public void setColor(Color color) {
this.color = color;
}

public boolean isWork() {
return isWork;
}

public void setWork(final boolean isWork) {
public void setWork(boolean isWork) {
this.isWork = isWork;
}

public boolean isDefault() {
return isDefault;
}

public void setDefault(final boolean isDefault) {
public void setDefault(boolean isDefault) {
this.isDefault = isDefault;
}

public boolean isEnabled() {
return isEnabled;
}

public void setEnabled(final boolean isEnabled) {
public void setEnabled(boolean isEnabled) {
this.isEnabled = isEnabled;
}

Expand All @@ -115,15 +109,15 @@ public int getIndex() {
return index;
}

public void setIndex(final int index) {
public void setIndex(int index) {
this.index = index;
}

public String getDescription() {
return description;
}

public void setDescription(final String description) {
public void setDescription(String description) {
this.description = description;
}

Expand All @@ -132,5 +126,4 @@ public String toString() {
return "Project [id=" + id + ", name=" + name + ", description=" + description + ", color=" + color + ", isWork="
+ isWork + ", isDefault=" + isDefault + ", isEnabled=" + isEnabled + ", index=" + index + "]";
}

}
}
16 changes: 16 additions & 0 deletions src/main/java/de/doubleslash/keeptime/model/ScreenSettings.java
Original file line number Diff line number Diff line change
@@ -1,3 +1,19 @@
// Copyright 2024 doubleSlash Net Business GmbH
//
// This file is part of KeepTime.
// KeepTime is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.

package de.doubleslash.keeptime.model;

import javafx.beans.property.ObjectProperty;
Expand Down
7 changes: 3 additions & 4 deletions src/main/java/de/doubleslash/keeptime/model/Settings.java
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@

/**
* Object holding settings
*
*
* @author nmutter
*/
@Entity
Expand Down Expand Up @@ -73,7 +73,8 @@ public class Settings {

private boolean confirmClose;

public Settings() {}
public Settings() {
}

public Settings(final Color hoverBackgroundColor, final Color hoverFontColor, final Color defaultBackgroundColor,
final Color defaultFontColor, final Color taskBarColor, final boolean useHotkey,
Expand All @@ -96,7 +97,6 @@ public Settings(final Color hoverBackgroundColor, final Color hoverFontColor, fi
this.remindIfNotesAreEmpty = remindIfNotesAreEmpty;
this.remindIfNotesAreEmptyOnlyForWorkEntry = remindIfNotesAreEmptyOnlyForWorkEntry;
this.confirmClose = confirmClose;

}

public boolean isRemindIfNotesAreEmptyOnlyForWorkEntry() {
Expand Down Expand Up @@ -222,5 +222,4 @@ public boolean isRemindIfNotesAreEmpty() {
public void setRemindIfNotesAreEmpty(final boolean emptyNoteReminder) {
this.remindIfNotesAreEmpty = emptyNoteReminder;
}

}
14 changes: 9 additions & 5 deletions src/main/java/de/doubleslash/keeptime/model/Work.java
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,14 @@

import java.time.LocalDateTime;

import jakarta.persistence.*;
import jakarta.persistence.Column;
import jakarta.persistence.Entity;
import jakarta.persistence.GeneratedValue;
import jakarta.persistence.GenerationType;
import jakarta.persistence.Id;
import jakarta.persistence.Lob;
import jakarta.persistence.ManyToOne;
import jakarta.persistence.Table;

@Entity
@Table(name = "Work")
Expand All @@ -30,14 +37,12 @@ public class Work {

private LocalDateTime startTime;
private LocalDateTime endTime;

@ManyToOne
private Project project;
@Lob
private String notes;

public Work() {
}
public Work() {}

public Work(final LocalDateTime startTime, final LocalDateTime endTime, final Project project, final String notes) {
super();
Expand Down Expand Up @@ -88,5 +93,4 @@ public String toString() {
return "Work [id=" + id + ", startTime=" + startTime + ", endTime=" + endTime + ", projectName="
+ project.getName() + ", notes=" + notes + "]";
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
import javafx.scene.paint.Color;

public class ColorConverter implements AttributeConverter<Color, String> {

@Override
public Color convertToEntityAttribute(final String arg0) {
try {
Expand All @@ -34,5 +33,4 @@ public Color convertToEntityAttribute(final String arg0) {
public String convertToDatabaseColumn(final Color arg0) {
return arg0.toString();
}

}
Loading
Loading