Skip to content

Commit

Permalink
Issue 3029 - Add a 'warning' state for the notifications (#3113)
Browse files Browse the repository at this point in the history
Using the `#F0AD4E` code for the darkish orange background, so the
font can remain white and be consistent with other types of notifications

Signed-off-by: Xavier Coulon <[email protected]>
  • Loading branch information
xcoulon authored and Stévan Le Meur committed Nov 18, 2016
1 parent 44b6e46 commit 13000b0
Show file tree
Hide file tree
Showing 9 changed files with 78 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ public class StatusNotification extends Notification {
public enum Status {
PROGRESS,
SUCCESS,
WARNING,
FAIL
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1493,7 +1493,6 @@ public interface Theme {
*/
String loaderProgressStatusColor();


/**
* The placeholder color for input fields.
*
Expand Down Expand Up @@ -1529,6 +1528,8 @@ public interface Theme {

String notificationPopupProgressBackground();

String notificationPopupWarningBackground();

String notificationPopupPanelShadow();

String notificationPopupIconSuccessFill();
Expand All @@ -1537,6 +1538,8 @@ public interface Theme {

String notificationPopupIconProgressFill();

String notificationPopupIconWarningFill();

String notificationPopupIconSvgFill();

String notificationPopupTextColor();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -228,6 +228,10 @@ private SVGImage getIconBaseOnStatus() {
icon = resources.fail();
status = "fail";
break;
case WARNING:
icon = resources.warning();
status = "warning";
break;
default:
throw new IllegalArgumentException("Can't determine notification icon");
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,10 @@ private SVGImage getIconBaseOnStatus() {
icon = resources.fail();
status = "fail";
break;
case WARNING:
icon = resources.warning();
status = "warning";
break;
default:
throw new IllegalArgumentException("Can't determine notification icon");
}
Expand Down Expand Up @@ -301,6 +305,7 @@ private void update() {
removeStyleName(resources.notificationCss().notificationStatusProgress());
removeStyleName(resources.notificationCss().notificationStatusSuccess());
removeStyleName(resources.notificationCss().notificationStatusFail());
removeStyleName(resources.notificationCss().notificationStatusWarning());

DisplayMode displayMode = notification.getDisplayMode();
Status status = notification.getStatus();
Expand All @@ -312,8 +317,11 @@ private void update() {
setStyleName(resources.notificationCss().notificationStatusSuccess(), true);
break;
case FAIL:
setStyleName(resources.notificationCss().notificationStatusFail(), true);
setStyleName(resources.notificationCss().notificationStatusFail(), true);
break;
case WARNING:
setStyleName(resources.notificationCss().notificationStatusWarning(), true);
break;
}

if (FLOAT_MODE == displayMode && PROGRESS == status) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,8 @@ interface NotificationCss extends CssResource {

String notificationStatusFail();

String notificationStatusWarning();

String notificationPopup();

String notificationPopupContentWrapper();
Expand Down Expand Up @@ -78,4 +80,7 @@ interface NotificationCss extends CssResource {

@Source("progress.svg")
SVGResource progress();

@Source("warning.svg")
SVGResource warning();
}
Original file line number Diff line number Diff line change
Expand Up @@ -1361,6 +1361,11 @@ public String notificationPopupProgressBackground() {
return "#9b9b9b";
}

@Override
public String notificationPopupWarningBackground() {
return "#F0AD4E";
}

@Override
public String notificationPopupPanelShadow() {
return "0 0 10px rgba(0,0,0,0.6)";
Expand All @@ -1381,6 +1386,11 @@ public String notificationPopupIconProgressFill() {
return "#9b9b9b";
}

@Override
public String notificationPopupIconWarningFill() {
return "#F0AD4E";
}

@Override
public String notificationPopupIconSvgFill() {
return "#FFFFFF";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1337,6 +1337,11 @@ public String notificationPopupProgressBackground() {
return "#9b9b9b";
}

@Override
public String notificationPopupWarningBackground() {
return "#F0AD4E";
}

@Override
public String notificationPopupPanelShadow() {
return "0 0 7px rgba(0,0,0,0.2)";
Expand All @@ -1356,7 +1361,12 @@ public String notificationPopupIconFailFill() {
public String notificationPopupIconProgressFill() {
return "#9b9b9b";
}


@Override
public String notificationPopupIconWarningFill() {
return "#F0AD4E";
}

@Override
public String notificationPopupIconSvgFill() {
return "#FFFFFF";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,12 @@
@eval notificationPopupSuccessBackground org.eclipse.che.ide.api.theme.Style.theme.notificationPopupSuccessBackground();
@eval notificationPopupFailBackground org.eclipse.che.ide.api.theme.Style.theme.notificationPopupFailBackground();
@eval notificationPopupProgressBackground org.eclipse.che.ide.api.theme.Style.theme.notificationPopupProgressBackground();
@eval notificationPopupWarningBackground org.eclipse.che.ide.api.theme.Style.theme.notificationPopupWarningBackground();
@eval notificationPopupPanelShadow org.eclipse.che.ide.api.theme.Style.theme.notificationPopupPanelShadow();
@eval notificationPopupIconSuccessFill org.eclipse.che.ide.api.theme.Style.theme.notificationPopupIconSuccessFill();
@eval notificationPopupIconFailFill org.eclipse.che.ide.api.theme.Style.theme.notificationPopupIconFailFill();
@eval notificationPopupIconProgressFill org.eclipse.che.ide.api.theme.Style.theme.notificationPopupIconProgressFill();
@eval notificationPopupIconWarningFill org.eclipse.che.ide.api.theme.Style.theme.notificationPopupIconWarningFill();
@eval notificationPopupIconSvgFill org.eclipse.che.ide.api.theme.Style.theme.notificationPopupIconSvgFill();
@eval notificationPopupTextColor org.eclipse.che.ide.api.theme.Style.theme.notificationPopupTextColor();
@eval closeNotificationButtonColor org.eclipse.che.ide.api.theme.Style.theme.closeNotificationButtonColor();
Expand Down Expand Up @@ -60,6 +62,10 @@
fill: notificationPopupIconProgressFill;
}

.notificationIconWrapper svg[name="warning"] {
fill: notificationPopupIconWarningFill;
}

.notificationContentWrapper{
display: inline-block;
width: literal("calc(100% - 75px)");
Expand Down Expand Up @@ -129,6 +135,10 @@
background-color: notificationPopupProgressBackground;
}

.notificationStatusWarning {
background-color: notificationPopupWarningBackground;
}

.notificationStatusSuccess {
background-color: notificationPopupSuccessBackground;
}
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 13000b0

Please sign in to comment.