Skip to content

Commit 5b016a7

Browse files
committed
PTBAS-742: Refactor Heimat name and update README
1 parent 8d0cd21 commit 5b016a7

File tree

10 files changed

+46
-51
lines changed

10 files changed

+46
-51
lines changed

README.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,23 @@ Create projects and choose if they are counted as 'work time'. Select the projec
2828
+ Ask for notes when switching project (if empty): Pops up a dialog to add notes if no notes are given and you try to switch projects
2929
+ Export: export database for backup and later import (import currently not yet implemented)
3030

31+
#### Heimat Integration
32+
33+
KeepTime can be integrated with Heimat, allowing you to map and import your Heimat projects directly into KeepTime.
34+
35+
To enable Heimat integration:
36+
37+
1. In the Settings, switch to the "Heimat" section.
38+
![Settings Heimat](readme/images/settingsHeimat.png?raw=true "Settings Heimat")
39+
2. Enter the following details:
40+
- **URL:** `https://doubleslash.heimat.software`
41+
- **Access Token:** Retrieve your access token from Heimat and paste it here.
42+
![Heimat Website](readme/images/heimatWebsite.png?raw=true "Heimat Website")
43+
3. Click on **"Validate connection"**. If the connection is valid, you can proceed.
44+
45+
Once the connection is validated, you can use the **"Map projects"** feature to map your Heimat projects to KeepTime projects or import Heimat projects directly into KeepTime.
46+
47+
3148
### Reports:
3249
![Report Screen](readme/images/reportDescription.png?raw=true "Report")
3350

readme/images/heimatWebsite.png

87.4 KB
Loading

readme/images/settingsHeimat.png

20 KB
Loading

src/main/java/de/doubleslash/keeptime/controller/HeimatController.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ public void tryLogin() {
8585
try {
8686
heimatAPI.isLoginValid();
8787
} catch (Exception e) {
88-
throw new SecurityException("Could not connect to HEIMAT API. Maybe wrong configuration?", e);
88+
throw new SecurityException("Could not connect to Heimat API. Maybe wrong configuration?", e);
8989
}
9090
}
9191

@@ -222,7 +222,7 @@ public List<Mapping> getTableRows(final LocalDate currentReportDate, final List<
222222
long heimatTimeSeconds = addHeimatTimes(times);
223223

224224
final Mapping mapping2 = new Mapping(id, true, false,
225-
"Present in HEIMAT but not KeepTime\n\nSync to " + externalProjectMapping.getExternalTaskName() + "\n("
225+
"Present in Heimat but not KeepTime\n\nSync to " + externalProjectMapping.getExternalTaskName() + "\n("
226226
+ externalProjectMapping.getExternalProjectName() + ")", times, mappedProjects.stream()
227227
.filter(
228228
mp -> mp.getExternalTaskId()
@@ -390,7 +390,7 @@ public ExistingAndInvalidMappings getExistingProjectMappings(List<HeimatTask> ex
390390
.filter(ep -> ep.id() == mapping.get().getExternalTaskId())
391391
.findAny();
392392
if (any.isEmpty()) {
393-
LOG.warn("A mapping exists but task does not exist anymore in HEIMAT! '{}'->'{}'.",
393+
LOG.warn("A mapping exists but task does not exist anymore in Heimat! '{}'->'{}'.",
394394
mapping.get().getProject(), mapping.get().getExternalTaskId());
395395
invalidExternalMappings.add(mapping.get());
396396
return new ProjectMapping(p, null);

src/main/java/de/doubleslash/keeptime/view/ExternalProjectsMapController.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ private void initialize() {
108108
externalProjects);
109109
externalProjectsObservableList.add(0, null); // option to clear selection
110110

111-
TableColumn<HeimatController.ProjectMapping, HeimatTask> externalColumn = new TableColumn<>("HEIMAT project");
111+
TableColumn<HeimatController.ProjectMapping, HeimatTask> externalColumn = new TableColumn<>("Heimat project");
112112
externalColumn.setCellValueFactory(data -> new SimpleObjectProperty<>(data.getValue().getHeimatTask()));
113113
externalColumn.setCellFactory(col -> new TableCell<>() {
114114
// TODO search in box would be nice
@@ -199,7 +199,7 @@ protected void updateItem(HeimatTask item, boolean empty) {
199199
private List<HeimatTask> showMultiSelectDialog(final List<HeimatTask> externalProjects,
200200
List<HeimatTask> unmappedHeimatTasks) {
201201
Dialog<List<HeimatTask>> dialog = new Dialog<>();
202-
dialog.setTitle("Import HEIMAT projects");
202+
dialog.setTitle("Import Heimat projects");
203203
dialog.setHeaderText("You can select mutliple items");
204204
dialog.initOwner(this.thisStage);
205205
dialog.setWidth(600);
@@ -211,7 +211,7 @@ private List<HeimatTask> showMultiSelectDialog(final List<HeimatTask> externalPr
211211
dialog.getDialogPane().getButtonTypes().addAll(okButtonType, cancelButtonType);
212212

213213
TableView<HeimatTask> tableView = new TableView<>();
214-
TableColumn<HeimatTask, HeimatTask> nameColumn = new TableColumn<>("HEIMAT project");
214+
TableColumn<HeimatTask, HeimatTask> nameColumn = new TableColumn<>("Heimat project");
215215
nameColumn.setCellValueFactory(data -> new SimpleObjectProperty<>(data.getValue()));
216216
nameColumn.setCellFactory(param -> new TableCell<>() {
217217
@Override

src/main/java/de/doubleslash/keeptime/view/ExternalProjectsSyncController.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -320,7 +320,7 @@ protected void updateItem(TableRow item, boolean empty) {
320320
} else {
321321
keeptimeLabel.setText("KeepTime: " + localTimeStringConverter.toString(
322322
LocalTime.ofSecondOfDay(item.keeptimeTimeSeconds.get())));
323-
heimatLabel.setText("HEIMAT: " + localTimeStringConverter.toString(
323+
heimatLabel.setText("Heimat: " + localTimeStringConverter.toString(
324324
LocalTime.ofSecondOfDay(item.heimatTimeSeconds.get())));
325325
timeSpinner.setDisable(!item.mapping.canBeSynced());
326326
timeSpinner.getValueFactory().setValue(LocalTime.ofSecondOfDay(0));
@@ -379,7 +379,7 @@ protected void updateItem(TableRow item, boolean empty) {
379379
final Label keeptimeLabel = new Label("KeepTime:");
380380
keeptimeLabel.setMinWidth(60);
381381
hbox.getChildren().addAll(copyKeepTimeNotes, keeptimeLabel, keepTimeNotesLabel);
382-
final Label heimatLabel = new Label("HEIMAT:");
382+
final Label heimatLabel = new Label("Heimat:");
383383
heimatLabel.setMinWidth(60);
384384
hbox2.getChildren().addAll(copyHeimatNotes, heimatLabel, heimatNotesLabel);
385385
container.getChildren().addAll(textArea, hbox, hbox2);

src/main/java/de/doubleslash/keeptime/view/ReportController.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ private void initHeimatIntegration() {
143143
heimatSyncButton.setMinSize(25, 25);
144144
heimatSyncButton.setGraphic(svgNodeWithScale);
145145
heimatSyncButton.setContentDisplay(ContentDisplay.GRAPHIC_ONLY);
146-
heimatSyncButton.setTooltip(new Tooltip("Synchronize to HEIMAT..."));
146+
heimatSyncButton.setTooltip(new Tooltip("Synchronize to Heimat..."));
147147
heimatSyncButton.setOnAction(ae-> {
148148
try {
149149
showSyncStage();

src/main/resources/layouts/externalProjectSync.fxml

Lines changed: 8 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,15 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22

3-
<?import javafx.scene.control.Button?>
4-
<?import javafx.scene.control.ComboBox?>
5-
<?import javafx.scene.control.Hyperlink?>
6-
<?import javafx.scene.control.Label?>
7-
<?import javafx.scene.control.TableView?>
8-
<?import javafx.scene.layout.AnchorPane?>
9-
<?import javafx.scene.layout.HBox?>
10-
<?import javafx.scene.layout.Region?>
11-
<?import javafx.scene.layout.StackPane?>
12-
<?import javafx.scene.layout.VBox?>
13-
<?import javafx.scene.text.Font?>
3+
<?import javafx.scene.control.*?>
4+
<?import javafx.scene.layout.*?>
5+
<?import javafx.scene.text.*?>
146

15-
<StackPane style="-fx-background-color: white;" stylesheets="@../css/dsStyles.css" xmlns="http://javafx.com/javafx/8.0.171" xmlns:fx="http://javafx.com/fxml/1" fx:controller="de.doubleslash.keeptime.view.ExternalProjectsSyncController">
7+
<StackPane style="-fx-background-color: white;" stylesheets="@../css/dsStyles.css" xmlns="http://javafx.com/javafx/17.0.12" xmlns:fx="http://javafx.com/fxml/1" fx:controller="de.doubleslash.keeptime.view.ExternalProjectsSyncController">
168
<children>
179
<AnchorPane fx:id="pane" prefHeight="600.0" prefWidth="1000.0">
1810
<children>
1911
<TableView fx:id="mappingTableView" layoutY="50.0" prefHeight="603.0" prefWidth="1112.0" AnchorPane.bottomAnchor="80.0" AnchorPane.leftAnchor="5.0" AnchorPane.rightAnchor="5.0" AnchorPane.topAnchor="35.0" />
20-
<Hyperlink fx:id="externalSystemLink" layoutX="29.0" layoutY="723.0" text="Open day in HEIMAT" AnchorPane.rightAnchor="5.0" AnchorPane.topAnchor="5.0" />
12+
<Hyperlink fx:id="externalSystemLink" layoutX="29.0" layoutY="723.0" text="Open day in Heimat" AnchorPane.rightAnchor="5.0" AnchorPane.topAnchor="5.0" />
2113
<HBox spacing="5.0" AnchorPane.leftAnchor="5.0" AnchorPane.topAnchor="5.0">
2214
<children>
2315
<Label text="Day to sync" />
@@ -30,13 +22,13 @@
3022
<children>
3123
<HBox spacing="5.0">
3224
<children>
33-
<Label text="New HEIMAT time:" />
25+
<Label text="New Heimat time:" />
3426
<Label fx:id="sumTimeLabel" alignment="CENTER_RIGHT" contentDisplay="RIGHT" text="00:00" />
3527
</children>
3628
</HBox>
3729
<HBox spacing="5.0">
3830
<children>
39-
<Label text="Current HEIMAT time:" />
31+
<Label text="Current Heimat time:" />
4032
<Label fx:id="heimatTimeLabel" text="00:00" />
4133
</children>
4234
</HBox>
@@ -76,7 +68,7 @@
7668
<Font size="18.0" />
7769
</font>
7870
</Label>
79-
<Hyperlink fx:id="externalSystemLinkLoadingScreen" text="Open day in HEIMAT" />
71+
<Hyperlink fx:id="externalSystemLinkLoadingScreen" text="Open day in Heimat" />
8072
<Label fx:id="loadingClosingMessage" alignment="CENTER" contentDisplay="CENTER" layoutX="473.0" layoutY="307.0" text="Closing in..." textAlignment="CENTER">
8173
<font>
8274
<Font size="18.0" />

src/main/resources/layouts/settings.fxml

Lines changed: 11 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -16,29 +16,15 @@
1616
You should have received a copy of the GNU General Public License
1717
along with this program. If not, see <http://www.gnu.org/licenses/>. -->
1818

19-
<?import java.lang.String?>
20-
<?import javafx.geometry.Insets?>
21-
<?import javafx.scene.Group?>
22-
<?import javafx.scene.control.Button?>
23-
<?import javafx.scene.control.CheckBox?>
24-
<?import javafx.scene.control.ColorPicker?>
25-
<?import javafx.scene.control.Hyperlink?>
26-
<?import javafx.scene.control.Label?>
27-
<?import javafx.scene.control.PasswordField?>
28-
<?import javafx.scene.control.Tab?>
29-
<?import javafx.scene.control.TabPane?>
30-
<?import javafx.scene.control.TableView?>
31-
<?import javafx.scene.control.TextField?>
32-
<?import javafx.scene.layout.AnchorPane?>
33-
<?import javafx.scene.layout.HBox?>
34-
<?import javafx.scene.layout.Pane?>
35-
<?import javafx.scene.layout.Region?>
36-
<?import javafx.scene.layout.VBox?>
37-
<?import javafx.scene.shape.Line?>
38-
<?import javafx.scene.text.Font?>
39-
<?import javafx.scene.text.Text?>
19+
<?import java.lang.*?>
20+
<?import javafx.geometry.*?>
21+
<?import javafx.scene.*?>
22+
<?import javafx.scene.control.*?>
23+
<?import javafx.scene.layout.*?>
24+
<?import javafx.scene.shape.*?>
25+
<?import javafx.scene.text.*?>
4026

41-
<AnchorPane fx:id="settingsRoot" focusTraversable="true" prefHeight="285.0" prefWidth="514.0" style="-fx-background-color: white;" stylesheets="@../css/dsStyles.css" xmlns="http://javafx.com/javafx/8.0.171" xmlns:fx="http://javafx.com/fxml/1" fx:controller="de.doubleslash.keeptime.view.SettingsController">
27+
<AnchorPane fx:id="settingsRoot" focusTraversable="true" prefHeight="285.0" prefWidth="514.0" style="-fx-background-color: white;" stylesheets="@../css/dsStyles.css" xmlns="http://javafx.com/javafx/17.0.12" xmlns:fx="http://javafx.com/fxml/1" fx:controller="de.doubleslash.keeptime.view.SettingsController">
4228
<children>
4329
<TabPane layoutX="-50.0" layoutY="3.0" prefHeight="383.0" prefWidth="608.0" rotateGraphic="true" side="LEFT" stylesheets="@../css/settingsv2.css" tabClosingPolicy="UNAVAILABLE">
4430
<tabs>
@@ -456,15 +442,15 @@
456442
<Region fx:id="restAPIIcon" prefHeight="15.0" prefWidth="15.0" rotate="-90.0" />
457443
</graphic>
458444
</Tab>
459-
<Tab text="HEIMAT">
445+
<Tab text="Heimat">
460446
<content>
461447
<AnchorPane minHeight="0.0" minWidth="0.0" prefHeight="420.0" prefWidth="407.0">
462448
<children>
463449
<VBox layoutX="14.0" layoutY="14.0" spacing="5.0">
464450
<children>
465451
<VBox styleClass="settingsBorder" stylesheets="@../css/settingsv2.css">
466452
<children>
467-
<Label prefHeight="28.0" prefWidth="279.0" text="HEIMAT Integration">
453+
<Label prefHeight="28.0" prefWidth="279.0" text="Heimat Integration">
468454
<font>
469455
<Font name="System Bold" size="13.0" />
470456
</font>
@@ -488,7 +474,7 @@
488474
<children>
489475
<VBox styleClass="settingsBorder" stylesheets="@../css/settingsv2.css">
490476
<children>
491-
<CheckBox fx:id="heimatActivationCheckbox" mnemonicParsing="false" text="Use HEIMAT">
477+
<CheckBox fx:id="heimatActivationCheckbox" mnemonicParsing="false" text="Use Heimat">
492478
<font>
493479
<Font name="Open Sans Regular" size="12.0" />
494480
</font>

src/test/java/de/doubleslash/keeptime/controller/HeimatControllerTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -384,7 +384,7 @@ void shouldShowHeimatTimeWhenProjectIsMappedInKeeptimeButNoWorkAtThatDay() {
384384
// ASSERT
385385
assertAll(() -> assertThat(tableRows.size(), Matchers.is(1)), () -> assertTrue(mapping.canBeSynced()),
386386
() -> assertTrue(mapping.canBeSynced()), () -> assertFalse(mapping.shouldBeSynced()),
387-
() -> assertThat(mapping.syncMessage(), Matchers.containsString("Present in HEIMAT but not KeepTime")),
387+
() -> assertThat(mapping.syncMessage(), Matchers.containsString("Present in Heimat but not KeepTime")),
388388
() -> assertThat(mapping.syncMessage(), Matchers.containsString(project1To1Mapping.getExternalTaskName())),
389389
() -> assertThat(mapping.keeptimeSeconds(), Matchers.is(0L)),
390390
() -> assertThat(mapping.keeptimeNotes(), Matchers.is("")),

0 commit comments

Comments
 (0)