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

Commit 956a1e8

Browse files
SORMAS-Foundation#3005 - Caption change, layout adjustments
1 parent 7352dcc commit 956a1e8

3 files changed

Lines changed: 17 additions & 13 deletions

File tree

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -987,6 +987,7 @@ public interface Captions {
987987
String HealthConditions_otherConditions = "HealthConditions.otherConditions";
988988
String HealthConditions_sickleCellDisease = "HealthConditions.sickleCellDisease";
989989
String HealthConditions_tuberculosis = "HealthConditions.tuberculosis";
990+
String importCancelImport = "importCancelImport";
990991
String importDetailed = "importDetailed";
991992
String importDownloadCaseImportTemplate = "importDownloadCaseImportTemplate";
992993
String importDownloadDataDictionary = "importDownloadDataDictionary";

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1109,6 +1109,7 @@ importImports=%d Imported
11091109
importLineListing=Line Listing Import
11101110
importProcessed=%d/%d Processed
11111111
importSkips=%d Skipped
1112+
importCancelImport=Cancel import
11121113

11131114
#Lab Message
11141115
LabMessage=Lab Message

sormas-ui/src/main/java/de/symeda/sormas/ui/campaign/campaigndata/CampaignFormDataSelectionField.java

Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -82,12 +82,12 @@ private void addFormDataDetailsComponent() {
8282
Label newFormDataHeading = new Label(I18nProperties.getString(Strings.headingCampaignFormDataDuplicateNew));
8383
CssStyles.style(newFormDataHeading, CssStyles.H3);
8484
formDataDetailsLayout.addComponent(newFormDataHeading);
85-
formDataDetailsLayout.addComponent(buildFormDataDetailsComponent(newData));
85+
formDataDetailsLayout.addComponent(buildFormDataDetailsComponent(newData, false));
8686

8787
Label existingFormDataHeading = new Label(I18nProperties.getString(Strings.headingCampaignFormDataDuplicateExisting));
8888
CssStyles.style(existingFormDataHeading, CssStyles.H3);
8989
formDataDetailsLayout.addComponent(existingFormDataHeading);
90-
formDataDetailsLayout.addComponent(buildFormDataDetailsComponent(existingData));
90+
formDataDetailsLayout.addComponent(buildFormDataDetailsComponent(existingData, true));
9191

9292
addComponent(formDataDetailsLayout);
9393
}
@@ -97,7 +97,7 @@ private void addButtons() {
9797
HorizontalLayout buttonLayout = new HorizontalLayout();
9898
buttonLayout.setWidthUndefined();
9999

100-
Button btnCancel = new Button(I18nProperties.getCaption(Captions.actionCancel));
100+
Button btnCancel = new Button(I18nProperties.getCaption(Captions.importCancelImport));
101101
btnCancel.addClickListener(e -> cancelCallback.run());
102102
buttonLayout.addComponent(btnCancel);
103103

@@ -114,7 +114,7 @@ private void addButtons() {
114114
setComponentAlignment(buttonLayout, Alignment.MIDDLE_RIGHT);
115115
}
116116

117-
private HorizontalLayout buildFormDataDetailsComponent(CampaignFormDataDto formData) {
117+
private HorizontalLayout buildFormDataDetailsComponent(CampaignFormDataDto formData, boolean existingData) {
118118
HorizontalLayout formDataLayout = new HorizontalLayout();
119119
formDataLayout.setSpacing(true);
120120
{
@@ -138,15 +138,17 @@ private HorizontalLayout buildFormDataDetailsComponent(CampaignFormDataDto formD
138138
fdFormDate.setWidthUndefined();
139139
formDataLayout.addComponent(fdFormDate);
140140

141-
Label fdCreatingUser = new Label(formData.getCreatingUser() != null ? formData.getCreatingUser().toString() : "");
142-
fdCreatingUser.setCaption(I18nProperties.getPrefixCaption(CampaignFormDataDto.I18N_PREFIX, CampaignFormDataDto.CREATING_USER));
143-
fdCreatingUser.setWidthUndefined();
144-
formDataLayout.addComponent(fdCreatingUser);
145-
146-
Label fdCreationDate = new Label(DateFormatHelper.formatDate(formData.getCreationDate()));
147-
fdCreationDate.setCaption(I18nProperties.getPrefixCaption(CampaignFormDataDto.I18N_PREFIX, CampaignFormDataDto.CREATION_DATE));
148-
fdCreationDate.setWidthUndefined();
149-
formDataLayout.addComponent(fdCreationDate);
141+
if (existingData) {
142+
Label fdCreatingUser = new Label(formData.getCreatingUser() != null ? formData.getCreatingUser().toString() : "");
143+
fdCreatingUser.setCaption(I18nProperties.getPrefixCaption(CampaignFormDataDto.I18N_PREFIX, CampaignFormDataDto.CREATING_USER));
144+
fdCreatingUser.setWidthUndefined();
145+
formDataLayout.addComponent(fdCreatingUser);
146+
147+
Label fdCreationDate = new Label(DateFormatHelper.formatDate(formData.getCreationDate()));
148+
fdCreationDate.setCaption(I18nProperties.getPrefixCaption(CampaignFormDataDto.I18N_PREFIX, CampaignFormDataDto.CREATION_DATE));
149+
fdCreationDate.setWidthUndefined();
150+
formDataLayout.addComponent(fdCreationDate);
151+
}
150152
}
151153

152154
return formDataLayout;

0 commit comments

Comments
 (0)