Merge branch 'bug4104' of ssh://trac@sapsailing.com/home/trac/git into bug4104

This commit is contained in:
D067890 committed 2018-09-10 15:52:15 +02:00
commit 58ec125945
11 files changed
+66 -27

No files matched your search

@@ -2105,6 +2105,7 @@ public interface StringMessages extends com.sap.sse.gwt.client.StringMessages,
String tagNoTagsFound();
String tagAddTag();
String tagEditTag();
String tagDeleteTag();
String tagAddTags();
String tagSavedSuccessfully();
String tagNotSaved();
@@ -2100,6 +2100,7 @@ tagCreated=(created by {0} at {1})
tagNoTagsFound=No tags found!
tagAddTag=Add Tag
tagEditTag=Edit Tag
tagDeleteTag=Delete Tag
tagAddTags=Add Tags
tagSavedSuccessfully=Saved tag successfully
tagNotSaved=Could not save new tag!
@@ -2094,17 +2094,18 @@ tagPanel=Tags
tagCreated=(erstellt von {0} am {1})
tagNoTagsFound=Keine Tags gefunden!
tagAddTag=Tag hinzufügen
tagEditTag= Tag bearbeiten
tagEditTag=Tag bearbeiten
tagDeleteTag=Tag löschen
tagAddTags=Tags hinzufügen
tagSavedSuccessfully=Tag erfolgreich gespeichert
tagNotSaved=Tag konnte nicht gespeichert werden!
tagNotSavedReason=Tag konnte nicht gespeichert werden! Grund: {0}
tagAlreadyExists=Tag existiert bereits
tagNotLoaded=Tags konnten nicht geladen werden!
tagNotLoggedIn=Bitte loggen Sie sich ein um einem Rennen Tags hinzuzufügen!
tagNotLoggedIn=Bitte logge dich ein, um einem Rennen Tags hinzufügen zu können!
tagNotRemoved=Tag konnte nicht entfernt werden!
tagRemovedSuccessfully=Tag erfolgreich entfernt
tagFilterExplanation=Der Filter filtert alle Tags, welche die nachfolgenden Kriterien erfüllen. Groß- und Kleinschreibung werden beachtet!
tagFilterExplanation=Der Filter zeigt alle Tags an, welche die nachfolgenden Kriterien erfüllen. Groß- und Kleinschreibung werden beachtet!
tagSelectedTags=Ausgewählte Tags
tagsFilter=Tag Filter
tagSearchTags=Suchen
@@ -2123,7 +2124,7 @@ tagPreview=Tag Vorschau:
tagVisibleForPublicCheckBox=Für alle sichtbar
tagVisibility=Sichtbarkeit
tagConfirmDeletionHeading=Tag löschen
tagConfirmDeletion=Dies wird den Tag "{0}" endgütltig löschen. Willst du wirklich fortfahren?
tagConfirmDeletion=Dies wird den Tag "{0}" endgültig löschen. Willst du wirklich fortfahren?
tagButtonConfirmDeletionHeading=Tag-Button löschen
tagButtonConfirmDeletion=Dies wird den Tag-Button "{0}" endgütltig löschen. Willst du wirklich fortfahren?
tagDiscardChangesHeading=Änderungen verwerfen
@@ -848,13 +848,8 @@ public class TouchSplitLayoutPanel extends DockLayoutPanel {
}
splitter.setAssociatedWidgetSize(0, /* defer */false);
// need to ensure visibility of dragger and style of toggle button
// need to ensure visibility of dragger, do NOT use setVisible() as south/north splitter should be shown always
splitter.setDraggerVisible(!hidden);
splitter.setVisible(!hidden);
splitter.getToggleButton().addStyleDependentName("Closed");
splitter.getToggleButton().addStyleDependentName("Closed-"+associatedComponentToWidget.getDependentCssClassName());
splitter.getToggleButton().removeStyleDependentName("Open");
splitter.getToggleButton().removeStyleDependentName("Open-"+associatedComponentToWidget.getDependentCssClassName());
} else {
widget.setVisible(true);
if (associatedComponentToWidget != null) {
@@ -321,15 +321,31 @@ public class TagButtonDialog extends DialogBox {
cancelButton.setStyleName(style.tagDialogButton());
cancelButton.addStyleName("gwt-Button");
cancelButton.addClickHandler(event -> {
inputPanel.clearAllValues();
tagPreviewPanel.renderPreview(inputPanel);
tagButtonTable.setVisible(true);
saveButton.setVisible(false);
cancelButton.setVisible(false);
closeButton.setVisible(true);
addTagButtonButton.setVisible(true);
center();
// ask user for confirmation to discard changes if values of input fields changed
if (!inputPanel.compareFieldsToTagButton(selectedTagButton)) {
new ConfirmationDialog(stringMessages, stringMessages.tagDiscardChangesHeading(),
stringMessages.tagDiscardChanges(), confirmed -> {
if (confirmed) {
inputPanel.clearAllValues();
tagPreviewPanel.renderPreview(inputPanel);
tagButtonTable.setVisible(true);
saveButton.setVisible(false);
cancelButton.setVisible(false);
closeButton.setVisible(true);
addTagButtonButton.setVisible(true);
center();
}
});
} else {
inputPanel.clearAllValues();
tagPreviewPanel.renderPreview(inputPanel);
tagButtonTable.setVisible(true);
saveButton.setVisible(false);
cancelButton.setVisible(false);
closeButton.setVisible(true);
addTagButtonButton.setVisible(true);
center();
}
});
}
@@ -116,12 +116,14 @@ public class TagCell extends AbstractCell<TagDTO> {
/**
* Renders button with given content.
*
* @param title
* will be shown as tooltip of button
* @param content
* content of button
* @return {@link SafeHtml HTML template}
*/
@Template("<button class='{0}'>{1}</button>")
SafeHtml button(String classButton, SafeHtml content);
@Template("<button class='{0}' title='{1}'>{2}</button>")
SafeHtml button(String classButton, String title, SafeHtml content);
}
private final TagCellTemplate tagCellTemplate = GWT.create(TagCellTemplate.class);
@@ -193,9 +195,9 @@ public class TagCell extends AbstractCell<TagDTO> {
if (userService.getCurrentUser() != null) {
// create buttons with icons
SafeHtml deleteButton = tagCellTemplate.button(style.tagActionButton() + " " + style.tagDeleteButton(),
tagCellTemplate.icon(resources.deleteIcon().getSafeUri()));
stringMessages.tagDeleteTag(), tagCellTemplate.icon(resources.deleteIcon().getSafeUri()));
SafeHtml editButton = tagCellTemplate.button(style.tagActionButton() + " " + style.tagEditButton(),
tagCellTemplate.icon(resources.editIcon().getSafeUri()));
stringMessages.tagEditTag(), tagCellTemplate.icon(resources.editIcon().getSafeUri()));
if (tag.getUsername().equals(userService.getCurrentUser().getName())) {
headingButtons = tagCellTemplate.headerButtonsDeletableAndModifyable(style.tagCellHeadingButtons(),
editButton, deleteButton);
@@ -206,7 +208,11 @@ public class TagCell extends AbstractCell<TagDTO> {
}
}
SafeHtml cell = tagCellTemplate.cell(style.tagCell(), style.tagCellHeading(), style.tagCellCreated(), icon,
String cellStyle = style.tagCell();
if (tag.equals(taggingPanel.getSelectedTag())) {
cellStyle = style.tagCell() + " " + style.tagCellActive();
}
SafeHtml cell = tagCellTemplate.cell(cellStyle, style.tagCellHeading(), style.tagCellCreated(), icon,
headingButtons, safeTag, safeCreated, content);
htmlBuilder.append(cell);
}
@@ -75,7 +75,7 @@ public class TagInputPanel extends FlowPanel {
* Returns whether values of given <code>tag</code> are different from input fields.
*
* @param tag
* tag to compare to input fields
* {@link TagDTO} to compare to input fields
* @return <code>true</code> if title, comment, imageURL and visibility are equal to input fields, otherwise
* <code>false</code>
*/
@@ -84,6 +84,20 @@ public class TagInputPanel extends FlowPanel {
&& getImageURL().equals(tag.getImageURL()) && isVisibleForPublic() == tag.isVisibleForPublic();
}
/**
* Returns whether values of given <code>tagButton</code> are different from input fields.
*
* @param tagButton
* {@link TagButton} to compare to input fields
* @return <code>true</code> if title, comment, imageURL and visibility are equal to input fields, otherwise
* <code>false</code>
*/
protected boolean compareFieldsToTagButton(TagButton tagButton) {
return getTag().equals(tagButton.getTag()) && getComment().equals(tagButton.getComment())
&& getImageURL().equals(tagButton.getImageURL())
&& isVisibleForPublic() == tagButton.isVisibleForPublic();
}
/**
* Returns whether input fields are equal to default values.
*
@@ -56,6 +56,7 @@ public interface TagPanelResources extends ClientBundle {
// tag cells
String tagCell();
String tagCellActive();
String tagCellHeading();
String tagCellHeadingButtons();
String tagActionButton();
@@ -674,7 +674,7 @@ public class TaggingPanel extends ComponentWithoutSettings
// Setting footerPanel.setVisible(false) is not sufficient as panel would still be
// rendered as 20px high white space instead of being hidden.
// Fix: remove panel completely from footer.
if (userService.getCurrentUser() != null) {
if (!currentState.equals(State.VIEW) || (currentState.equals(State.VIEW) && !getTagButtons().isEmpty())) {
taggingPanel.setFooterWidget(footerPanel);
footerPanel.setCurrentState(currentState);
} else {
@@ -7,6 +7,6 @@
.cellListSelectedItem,
.cellListKeyboardSelectedItem {
background-color: #e5f2f9 !important;
background-color: #e5f2f9;
border-radius: 3px;
}
@@ -381,6 +381,10 @@
cursor: context-menu;
}
.taggingPanelDisabled .tagCell.tagCellActive {
background-color: #e5f2f9;
}
.taggingPanelDisabled .tagCellHeadingButtons,
.taggingPanelDisabled .tagCellHeadingButtons .tagEditButton,
.taggingPanelDisabled .tagCellHeadingButtons .tagEditButton:hover,