From 92035eee9afbfc3c5d913b39f62271967c30ccee Mon Sep 17 00:00:00 2001 From: kaklakariada Date: Mon, 31 May 2021 20:22:17 +0200 Subject: [PATCH 1/3] Set placeholder label for empty activities table --- .../whiterabbit/jfxui/table/activities/ActivitiesTable.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/jfxui/src/main/java/org/itsallcode/whiterabbit/jfxui/table/activities/ActivitiesTable.java b/jfxui/src/main/java/org/itsallcode/whiterabbit/jfxui/table/activities/ActivitiesTable.java index 832984f1..fb834521 100644 --- a/jfxui/src/main/java/org/itsallcode/whiterabbit/jfxui/table/activities/ActivitiesTable.java +++ b/jfxui/src/main/java/org/itsallcode/whiterabbit/jfxui/table/activities/ActivitiesTable.java @@ -27,6 +27,7 @@ import javafx.beans.property.SimpleObjectProperty; import javafx.collections.FXCollections; import javafx.collections.ObservableList; +import javafx.scene.control.Label; import javafx.scene.control.TableCell; import javafx.scene.control.TableColumn; import javafx.scene.control.TableView; @@ -110,6 +111,7 @@ public TableView initTable() table.setEditable(true); table.getColumns().addAll(createColumns()); table.setId("activities-table"); + table.setPlaceholder(new Label("No activities for selected day")); table.getSelectionModel().selectedItemProperty() .addListener((observable, oldValue, newValue) -> selectedActivity .set(newValue != null ? newValue.getRecord() : null)); From ecd19226828c15dbdddd6bc9e20c11a6606d3cca Mon Sep 17 00:00:00 2001 From: kaklakariada Date: Mon, 31 May 2021 20:25:32 +0200 Subject: [PATCH 2/3] Improve label, add changelog --- CHANGELOG.md | 4 ++++ .../whiterabbit/jfxui/table/activities/ActivitiesTable.java | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 67f42081..8c31993f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 See [Release](https://github.com/itsallcode/white-rabbit/releases/tag/v1.7.0) / [Milestone](https://github.com/itsallcode/white-rabbit/milestone/9?closed=1) +### Added + +* [#164](https://github.com/itsallcode/white-rabbit/pull/164): Improve label of empty activities table. + ## [1.6.0] - 2021-05-30 See [Release](https://github.com/itsallcode/white-rabbit/releases/tag/v1.6.0) / [Milestone](https://github.com/itsallcode/white-rabbit/milestone/8?closed=1) diff --git a/jfxui/src/main/java/org/itsallcode/whiterabbit/jfxui/table/activities/ActivitiesTable.java b/jfxui/src/main/java/org/itsallcode/whiterabbit/jfxui/table/activities/ActivitiesTable.java index fb834521..4bbf002a 100644 --- a/jfxui/src/main/java/org/itsallcode/whiterabbit/jfxui/table/activities/ActivitiesTable.java +++ b/jfxui/src/main/java/org/itsallcode/whiterabbit/jfxui/table/activities/ActivitiesTable.java @@ -111,7 +111,7 @@ public TableView initTable() table.setEditable(true); table.getColumns().addAll(createColumns()); table.setId("activities-table"); - table.setPlaceholder(new Label("No activities for selected day")); + table.setPlaceholder(new Label("No activities for selected day. Click the + button to add an activity.")); table.getSelectionModel().selectedItemProperty() .addListener((observable, oldValue, newValue) -> selectedActivity .set(newValue != null ? newValue.getRecord() : null)); From 8d417f6ac872601854b8a709c8ad862664e07196 Mon Sep 17 00:00:00 2001 From: kaklakariada Date: Mon, 31 May 2021 21:25:47 +0200 Subject: [PATCH 3/3] Improve test stability DayTableTest > beginAndEndDeletedWhenChangingDayTypeToSick() FAILED org.opentest4j.MultipleFailuresError at DayTableTest.java:112 Caused by: org.opentest4j.AssertionFailedError at DayTableTest.java:112 DayTableTest.beginAndEndDeletedWhenChangingDayTypeToSick() org.opentest4j.MultipleFailuresError: Multiple Failures (1 failure) org.opentest4j.AssertionFailedError: [begin] expected: null but was : 11:16 --- .../java/org/itsallcode/whiterabbit/jfxui/DayTableTest.java | 1 + 1 file changed, 1 insertion(+) diff --git a/jfxui/src/uiTest/java/org/itsallcode/whiterabbit/jfxui/DayTableTest.java b/jfxui/src/uiTest/java/org/itsallcode/whiterabbit/jfxui/DayTableTest.java index c68cd570..3c722326 100644 --- a/jfxui/src/uiTest/java/org/itsallcode/whiterabbit/jfxui/DayTableTest.java +++ b/jfxui/src/uiTest/java/org/itsallcode/whiterabbit/jfxui/DayTableTest.java @@ -108,6 +108,7 @@ void beginAndEndDeletedWhenChangingDayTypeToSick() dayTable.assertBeginAndEnd(currentDayRowIndex, now, now); dayTable.selectDayType(currentDayRowIndex, DayType.SICK); + TestUtil.sleepShort(); dayTable.assertBeginAndEnd(currentDayRowIndex, null, null); }