Skip to content
This repository was archived by the owner on May 5, 2021. It is now read-only.

Commit 16a77d7

Browse files
author
barnabartha
committed
SORMAS-Foundation#3253 - apply UI suggestions and label updates
1 parent f5b3079 commit 16a77d7

6 files changed

Lines changed: 44 additions & 18 deletions

File tree

sormas-api/src/main/java/de/symeda/sormas/api/i18n/Strings.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -771,13 +771,13 @@ public interface Strings {
771771
String notificationTaskStartSpecific = "notificationTaskStartSpecific";
772772
String notificationVisitCompleted = "notificationVisitCompleted";
773773
String notSpecified = "notSpecified";
774-
String nrOfCharactersLeft = "nrOfCharactersLeft";
775774
String number = "number";
776775
String numberEight = "numberEight";
777776
String numberEleven = "numberEleven";
778777
String numberFive = "numberFive";
779778
String numberFour = "numberFour";
780779
String numberNine = "numberNine";
780+
String numberOfMessages = "numberOfMessages";
781781
String numberOfMissingPhoneNumbers = "numberOfMissingPhoneNumbers";
782782
String numberOne = "numberOne";
783783
String numberSeven = "numberSeven";

sormas-api/src/main/java/de/symeda/sormas/api/user/UserReferenceDto.java

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -26,22 +26,21 @@ public class UserReferenceDto extends ReferenceDto {
2626

2727
private static final long serialVersionUID = -8558187171374254398L;
2828

29-
public UserReferenceDto() {
29+
private String firstName;
30+
private String lastName;
3031

32+
public UserReferenceDto() {
3133
}
3234

3335
public UserReferenceDto(String uuid) {
3436
setUuid(uuid);
3537
}
3638

37-
public UserReferenceDto(String uuid, String caption) {
38-
setUuid(uuid);
39-
setCaption(caption);
40-
}
41-
4239
public UserReferenceDto(String uuid, String firstName, String lastName, Set<UserRole> userRoles) {
4340
setUuid(uuid);
4441
setCaption(buildCaption(firstName, lastName, userRoles));
42+
this.firstName = firstName;
43+
this.lastName = lastName;
4544
}
4645

4746
public static String buildCaption(String firstName, String lastName, Set<UserRole> userRoles) {
@@ -62,4 +61,12 @@ public static String buildCaption(String firstName, String lastName, Set<UserRol
6261
}
6362
return result.toString();
6463
}
64+
65+
public String getFirstName() {
66+
return firstName;
67+
}
68+
69+
public String getLastName() {
70+
return lastName;
71+
}
6572
}

sormas-api/src/main/resources/strings.properties

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -918,7 +918,7 @@ email = Email
918918
send = Send
919919
cancel = Cancel
920920
sendingSms = Send new SMS
921-
numberOfMissingPhoneNumbers = %s of the selected cases does not have a valid phone number
921+
numberOfMissingPhoneNumbers = Number of selected cases without phone number: %s
922922
enterSMS = Please enter your SMS message here:
923923
characters = Characters:
924-
nrOfCharactersLeft = / 160 => Nr. of messages::
924+
numberOfMessages = Nr. of messages:

sormas-backend/src/main/java/de/symeda/sormas/backend/user/UserFacadeEjb.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -327,7 +327,7 @@ public static UserReferenceDto toReferenceDto(User entity) {
327327
return null;
328328
}
329329

330-
UserReferenceDto dto = new UserReferenceDto(entity.getUuid(), entity.toString());
330+
UserReferenceDto dto = new UserReferenceDto(entity.getUuid(), entity.getFirstName(), entity.getLastName(), entity.getUserRoles());
331331
return dto;
332332
}
333333

sormas-ui/src/main/java/de/symeda/sormas/ui/caze/messaging/SmsComponent.java

Lines changed: 21 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
package de.symeda.sormas.ui.caze.messaging;
22

3+
import com.vaadin.icons.VaadinIcons;
4+
import com.vaadin.shared.ui.ContentMode;
35
import com.vaadin.ui.Alignment;
46
import com.vaadin.ui.Component;
57
import com.vaadin.ui.HorizontalLayout;
@@ -29,7 +31,12 @@ protected Component initContent() {
2931
mainLayout.setWidth(100, Unit.PERCENTAGE);
3032

3133
if (missingPhoneNumbers > 0) {
32-
mainLayout.addComponent(new Label(String.format(I18nProperties.getString(Strings.numberOfMissingPhoneNumbers), missingPhoneNumbers)));
34+
mainLayout.addComponent(
35+
new Label(
36+
VaadinIcons.INFO_CIRCLE.getHtml() + " "
37+
+ String.format(I18nProperties.getString(Strings.numberOfMissingPhoneNumbers), missingPhoneNumbers),
38+
ContentMode.HTML));
39+
mainLayout.addComponent(new Label());
3340
}
3441

3542
mainLayout.addComponent(new Label(I18nProperties.getString(Strings.enterSMS)));
@@ -42,15 +49,24 @@ protected Component initContent() {
4249
final HorizontalLayout charactersLayout = new HorizontalLayout();
4350
charactersLayout.setSpacing(false);
4451
charactersLayout.addComponent(new Label(I18nProperties.getString(Strings.characters)));
52+
charactersLayout.addComponent(new Label(" "));
4553
final Label characterLeftLabel = new Label("0");
4654
charactersLayout.addComponent(characterLeftLabel);
47-
charactersLayout.addComponent(new Label(I18nProperties.getString(Strings.nrOfCharactersLeft)));
48-
final Label nrOfMessagesLabel = new Label("1");
49-
charactersLayout.addComponent(nrOfMessagesLabel);
50-
55+
charactersLayout.addComponent(new Label("/160"));
5156
mainLayout.addComponent(charactersLayout);
5257
mainLayout.setComponentAlignment(charactersLayout, Alignment.BOTTOM_RIGHT);
5358

59+
final HorizontalLayout nrOfMessagesLayout = new HorizontalLayout();
60+
nrOfMessagesLayout.setSpacing(false);
61+
nrOfMessagesLayout.setMargin(false);
62+
nrOfMessagesLayout.addComponent(new Label(I18nProperties.getString(Strings.numberOfMessages)));
63+
nrOfMessagesLayout.addComponent(new Label(" "));
64+
final Label nrOfMessagesLabel = new Label("1");
65+
nrOfMessagesLayout.addComponent(nrOfMessagesLabel);
66+
67+
mainLayout.addComponent(nrOfMessagesLayout);
68+
mainLayout.setComponentAlignment(nrOfMessagesLayout, Alignment.BOTTOM_RIGHT);
69+
5470
smsTextArea.addValueChangeListener(e -> {
5571
final int nrOfCharacters = e.getValue().length();
5672
characterLeftLabel.setValue(String.valueOf(nrOfCharacters));

sormas-ui/src/main/java/de/symeda/sormas/ui/caze/messaging/SmsListEntry.java

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,9 @@
77
import de.symeda.sormas.api.i18n.Captions;
88
import de.symeda.sormas.api.i18n.I18nProperties;
99
import de.symeda.sormas.api.messaging.ManualMessageLogDto;
10+
import de.symeda.sormas.api.user.UserReferenceDto;
1011
import de.symeda.sormas.ui.utils.CssStyles;
12+
import de.symeda.sormas.ui.utils.DateFormatHelper;
1113

1214
public class SmsListEntry extends HorizontalLayout {
1315

@@ -35,9 +37,10 @@ public SmsListEntry(ManualMessageLogDto manualMessageLogDto) {
3537
{
3638
topLeftLayout.setMargin(false);
3739
topLeftLayout.setSpacing(false);
38-
Label sendingInfo = new Label(
39-
I18nProperties.getCaption(Captions.sentBy) + ": " + manualMessageLogDto.getSendingUser().getCaption() + " "
40-
+ manualMessageLogDto.getSentDate());
40+
final UserReferenceDto sendingUser = manualMessageLogDto.getSendingUser();
41+
final Label sendingInfo = new Label(
42+
I18nProperties.getCaption(Captions.sentBy) + ": " + sendingUser.getFirstName() + " " + sendingUser.getLastName() + " "
43+
+ DateFormatHelper.formatLocalDateTime(manualMessageLogDto.getSentDate()));
4144
topLeftLayout.addComponent(sendingInfo);
4245
}
4346
topLayout.addComponent(topLeftLayout);

0 commit comments

Comments
 (0)