Skip to content

Commit 264191c

Browse files
authored
Merge pull request #131 from doubleSlashde/feature/change_copy_notes_from_project_format
change format of project Notes on copy
2 parents 00beb73 + ea5d9ad commit 264191c

File tree

3 files changed

+10
-14
lines changed

3 files changed

+10
-14
lines changed

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

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -55,12 +55,8 @@ public int getNumberOfNotes() {
5555
return this.numberOfNotes;
5656
}
5757

58-
public String getNotes(final boolean addNumberOfNotes) {
59-
if (addNumberOfNotes) {
60-
return Integer.toString(this.numberOfNotes) + " Notes: " + this.sb.toString();
61-
} else {
62-
return this.sb.toString();
63-
}
58+
public String getNotes() {
59+
return this.sb.toString();
6460
}
6561

6662
}

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -408,7 +408,7 @@ private Button createCopyProjectButton(final List<Work> projectWork) {
408408
}
409409
final Clipboard clipboard = Clipboard.getSystemClipboard();
410410
final ClipboardContent content = new ClipboardContent();
411-
content.putString(pr.getNotes(true));
411+
content.putString(pr.getNotes());
412412
clipboard.setContent(content);
413413
};
414414

src/test/java/de/doubleslash/keeptime/view/ProjectReportTest.java

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -47,16 +47,16 @@ public void testAppendToWorkNotes() {
4747
this.uut.appendToWorkNotes(EMPTY_NOTE);
4848
this.uut.appendToWorkNotes("note 2 ");
4949
final String expected = "note 1; note 2";
50-
assertEquals(expected, this.uut.getNotes(false));
50+
assertEquals(expected, this.uut.getNotes());
5151
}
5252

5353
@Test
5454
public void testAppendToWorkNotesAddNumberOfNotes() {
5555
this.uut.appendToWorkNotes("note 1 ");
5656
this.uut.appendToWorkNotes(EMPTY_NOTE);
5757
this.uut.appendToWorkNotes("note 2 ");
58-
final String expected = "3 Notes: note 1; note 2";
59-
assertEquals(expected, this.uut.getNotes(true));
58+
final String expected = "note 1; note 2";
59+
assertEquals(expected, this.uut.getNotes());
6060
}
6161

6262
@Test
@@ -65,8 +65,8 @@ public void testAppendToWorkNotesAddNumberOfNotes_2() {
6565
this.uut.appendToWorkNotes("note 1");
6666
this.uut.appendToWorkNotes("note 2");
6767
this.uut.appendToWorkNotes("note 3");
68-
final String expected = "3 Notes: note 1; note 2; note 3";
69-
assertEquals(expected, this.uut.getNotes(true));
68+
final String expected = "note 1; note 2; note 3";
69+
assertEquals(expected, this.uut.getNotes());
7070
}
7171

7272
@Test
@@ -76,8 +76,8 @@ public void testAppendToWorkNotesAddNumberOfNotes_EmptyNotesAtTheEnd() {
7676
this.uut.appendToWorkNotes("note 2");
7777
this.uut.appendToWorkNotes(EMPTY_NOTE);
7878
this.uut.appendToWorkNotes(EMPTY_NOTE);
79-
final String expected = "4 Notes: note 1; note 2";
80-
assertEquals(expected, this.uut.getNotes(true));
79+
final String expected = "note 1; note 2";
80+
assertEquals(expected, this.uut.getNotes());
8181
}
8282

8383
}

0 commit comments

Comments
 (0)