Merge branch 'master' into permission-vertical

This commit is contained in:
Steffen Schäfer committed 2018-11-14 08:29:48 +01:00
commit 9550694fee
6 files changed
+61 -62

No files matched your search

@@ -2,21 +2,18 @@
<ui:UiBinder xmlns:ui="urn:ui:com.google.gwt.uibinder"
xmlns:g="urn:import:com.google.gwt.user.client.ui" xmlns:s="urn:import:com.sap.sailing.gwt.home.client.shared"
xmlns:sse="urn:import:com.sap.sse.gwt.client.controls">
<ui:with field="i18n"
type="com.sap.sailing.gwt.ui.client.StringMessages" />
<ui:with field="res"
type="com.sap.sailing.gwt.common.client.SharedResources" />
<ui:with field="local_res"
type="com.sap.sailing.gwt.home.mobile.partials.stage.StageResources" />
<ui:with field="i18n" type="com.sap.sailing.gwt.ui.client.StringMessages" />
<ui:with field="res" type="com.sap.sailing.gwt.common.client.SharedResources" />
<ui:with field="local_res" type="com.sap.sailing.gwt.home.mobile.partials.stage.StageResources" />
<g:HTMLPanel>
<!-- The main stage -->
<div class="{local_res.css.stage}">
<div class="{local_res.css.stage_teasers} {local_res.css.swipercontainer}" ui:field="stageContainer">
<sse:carousel.WidgetCarousel ui:field="widgetCarousel" />
</div>
<div class="{local_res.css.stage_progress}">
<div class="{local_res.css.stage_progress_bar}"></div>
</div>
<!-- <div class="{local_res.css.stage_progress}"> -->
<!-- <div class="{local_res.css.stage_progress_bar}"></div> -->
<!-- </div> -->
</div>
</g:HTMLPanel>
</ui:UiBinder>
@@ -2,11 +2,11 @@
left: 50% !important;
top: 50% !important;
position: absolute !important;
background-color: #f2f2f2;
background-color: #ffffff;
padding: 1em;
border: 1px solid #ccc;
border-radius: 3px;
width: 25%;
width: 30em;
-webkit-transform: translate(-50%, -50%);
-moz-transform: translate(-50%, -50%);
-ms-transform: translate(-50%, -50%);
@@ -15,8 +15,7 @@
}
.buttonAdjustments {
margin-left: .5em;
margin-top: .5em;
margin: .5em .25em 0;
min-width: 11em;
}
@@ -39,6 +38,7 @@
.buttonPanel {
text-align: center;
font-size: 0;
}
.backgroundPanel {
@@ -48,6 +48,7 @@
top: 0;
left: 0;
background-color: rgba(0, 0, 0, .33333333);
z-index: 9999;
}
.title {
@@ -57,20 +58,13 @@
margin-bottom: .75em;
}
@media ( max-width: 400px) {
@media (max-width: 425px) {
.dialog {
width: 90%;
width: calc(100% - 1em);
}
.buttonAdjustments {
min-width: 100%;
margin: .5em 0 0;
}
}
@media ( min-width: 400px) {
.dialog {
width: 50%;
}
}
@media ( min-width: 600px) {
.dialog {
width: 40%;
}
}
@@ -36,29 +36,24 @@ public class TwoOptionsDialogPanel extends Composite {
DivElement titleField;
private final DialogCallback<Void> callback;
private final PopupPanel parent;
public TwoOptionsDialogPanel() {
this("", "", null, null);
}
public TwoOptionsDialogPanel(String message, String title, DialogCallback<Void> callback, PopupPanel parent) {
TwoOptionsDialogPanel(String message, String title, DialogCallback<Void> callback, PopupPanel parent) {
initWidget(uiBinder.createAndBindUi(this));
this.callback = callback;
this.parent = parent;
messageField.setInnerText(message);
titleField.setInnerText(title);
this.messageField.setInnerText(message);
this.titleField.setInnerText(title);
}
/** Sets the labels of the {@link #firstButton} and {@link #secondButton}. */
public void setButtonLabels(String firstButtonText, String secondButtonText) {
void setButtonLabels(String firstButtonText, String secondButtonText) {
firstButton.setText(firstButtonText);
secondButton.setText(secondButtonText);
}
/** Changes the color of the {@link #firstButton} to red. */
public void setFirstButtonDestructive() {
void setFirstButtonDestructive() {
firstButton.addStyleName(DialogResources.INSTANCE.css().destructiveButton());
}
@@ -24,6 +24,8 @@ public final class WhatsNewDialogFactory {
private static final long THRESHOLD_WHATS_NEW = 10;
private static final Logger LOG = Logger.getLogger(WhatsNewDialogFactory.class.getName());
private static boolean isUserNotified = false;
private WhatsNewDialogFactory() {
}
@@ -38,10 +40,10 @@ public final class WhatsNewDialogFactory {
/** Shows a What's New Dialog. */
private static void showWhatsNewDialog(PlaceController placeController, DialogCallback<Void> dialogCallback) {
PopupPanel dialog = DialogFactory.createDialog(StringMessages.INSTANCE.whatsNewDialogMessage(),
final PopupPanel dialog = DialogFactory.createDialog(StringMessages.INSTANCE.whatsNewDialogMessage(),
StringMessages.INSTANCE.whatsNewDialogTitle(), false, StringMessages.INSTANCE.showChangelog(),
StringMessages.INSTANCE.cancel(), dialogCallback);
isUserNotified = true;
dialog.show();
}
@@ -51,6 +53,9 @@ public final class WhatsNewDialogFactory {
*/
private static void showWhatsNewDialogIfNecessaryAndUpdatePreference(UserService userService,
PlaceController placeController) {
if (isUserNotified) {
return;
}
final long charactersInWhatsChangedDocument = WhatsNewResources.INSTANCE.getSailingAnalyticsNotesHtml()
.getText().length();
userService.getPreference(WhatsNewSettings.PREF_NAME, new AsyncCallback<String>() {
@@ -7,6 +7,7 @@ import java.util.Map;
import java.util.Set;
import com.google.gwt.core.shared.GWT;
import com.google.gwt.dom.client.BrowserEvents;
import com.google.gwt.user.cellview.client.CellList;
import com.google.gwt.user.cellview.client.HasKeyboardSelectionPolicy.KeyboardSelectionPolicy;
import com.google.gwt.user.client.rpc.AsyncCallback;
@@ -16,6 +17,8 @@ import com.google.gwt.user.client.ui.HeaderPanel;
import com.google.gwt.user.client.ui.Label;
import com.google.gwt.user.client.ui.Panel;
import com.google.gwt.user.client.ui.Widget;
import com.google.gwt.view.client.CellPreviewEvent;
import com.google.gwt.view.client.CellPreviewEvent.Handler;
import com.google.gwt.view.client.NoSelectionModel;
import com.google.gwt.view.client.SingleSelectionModel;
import com.sap.sailing.domain.common.RegattaAndRaceIdentifier;
@@ -115,8 +118,8 @@ public class TaggingPanel extends ComponentWithoutSettings
* 3) another user adds/deletes/changes any tag between the latest received tag and the current timer position<br/>
* consecutively, the timer would jump to this new tag as the selection would change automatically as the latest tag
* changed. This selection change would also trigger the timer to jump to the latest tag, which is not intended in
* this case. Therefor any received changes on any tags will set this boolen to true which will ignore the time jump
* at the selection change event and prevent this wrong behaviour.
* this case. Therefor any received changes on any tags will set this boolean to true which will ignore the time jump
* at the selection change event and prevent this wrong behavior.
*
* @see #raceTimesInfosReceived(Map, long, Date, long)
*/
@@ -180,26 +183,31 @@ public class TaggingPanel extends ComponentWithoutSettings
tagCellList.setEmptyListWidget(new Label(stringMessages.tagNoTagsFound()));
tagCellList.setKeyboardSelectionPolicy(KeyboardSelectionPolicy.DISABLED);
tagCellList.setSelectionModel(tagSelectionModel);
tagSelectionModel.addSelectionChangeHandler(event -> {
// set time slider to corresponding position
TagDTO selectedTag = tagSelectionModel.getSelectedObject();
if (selectedTag != null) {
/**
* Do not set time of timer when {@link #preventTimeJumpAtSelectionChangeForOnce} is set to
* <code>true</code>. In this case set {@link #preventTimeJumpAtSelectionChangeForOnce} to
* <code>false</code> as selection change is ignored once.
*
* @see #preventTimeJumpAtSelectionChangeForOnce
*/
if (preventTimeJumpAtSelectionChangeForOnce) {
preventTimeJumpAtSelectionChangeForOnce = false;
} else {
// remove time change listener when manual selecting tag cells as this could end in an infinite loop
// of timer change -> automatic selection change -> timer change -> ...
timer.removeTimeListener(this);
timer.setTime(selectedTag.getRaceTimepoint().asMillis());
// adding time change listener again
timer.addTimeListener(this);
tagCellList.addCellPreviewHandler(new Handler<TagDTO>() {
@Override
public void onCellPreview(CellPreviewEvent<TagDTO> event) {
if (BrowserEvents.CLICK.equals(event.getNativeEvent().getType())) {
// set time slider to corresponding position
TagDTO selectedTag = event.getValue();
if (selectedTag != null) {
/**
* Do not set time of timer when {@link #preventTimeJumpAtSelectionChangeForOnce} is set to
* <code>true</code>. In this case set {@link #preventTimeJumpAtSelectionChangeForOnce} to
* <code>false</code> as selection change is ignored once.
*
* @see #preventTimeJumpAtSelectionChangeForOnce
*/
if (preventTimeJumpAtSelectionChangeForOnce) {
preventTimeJumpAtSelectionChangeForOnce = false;
} else {
// remove time change listener when manually selecting tag cells as this could end in an infinite loop
// of timer change -> automatic selection change -> timer change -> ...
timer.removeTimeListener(TaggingPanel.this);
timer.setTime(selectedTag.getRaceTimepoint().asMillis());
// adding time change listener again
timer.addTimeListener(TaggingPanel.this);
}
}
}
}
});
@@ -209,7 +217,6 @@ public class TaggingPanel extends ComponentWithoutSettings
createTagsButton.addClickHandler(event -> {
setCurrentState(State.CREATE_TAG);
});
taggingPanel.setContentWidget(contentPanel);
updateContent();
}
@@ -87,6 +87,7 @@
padding: 5px 5px 0;
border: 1px solid lightgrey;
border-radius: 3px;
cursor: pointer;
}
.tagCellHeading {