Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Notification panel transitions and visual enhancements #1997

Merged
merged 1 commit into from
Sep 6, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion app/styles/_navbar-vertical.less
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,8 @@
.badge {
margin: 0 !important;
position: absolute;
top: 9px;
right: 13px;
top: 9px;
@media(min-width: @screen-sm-min) {
top: 20px;
}
Expand Down
62 changes: 54 additions & 8 deletions app/styles/_notifications.less
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,11 @@
notification-drawer-wrapper {
.drawer-pf {
height: calc(100vh ~"-" (@navbar-os-header-height-mobile + @project-bar-height-mobile));
opacity: 1;
position: fixed;
right: 0;
top: (@navbar-os-header-height-mobile + @project-bar-height-mobile);
transition: top 150ms ease-in-out, opacity 150ms;
z-index: @zindex-navbar-fixed - 2; // two less than navbar, one less than project-bar
@media(max-width: 350px) {
left: 0;
Expand All @@ -22,6 +25,14 @@ notification-drawer-wrapper {
left: 270px;
}
}
&.hide {
opacity: 0;
top: 38px;
}
&.hide-add,
&.hide-remove {
display: block !important;
}
.tech-preview & {
height: calc(100vh ~"-" (@navbar-os-header-height-mobile + @project-bar-height-mobile + @tech-preview-banner-height));
top: (@navbar-os-header-height-mobile + @project-bar-height-mobile + @tech-preview-banner-height);
Expand All @@ -48,34 +59,69 @@ notification-drawer-wrapper {
}
}
}
.drawer-pf-notification-info {
font-size: @font-size-small;
}
.drawer-pf-notification-inner {
padding: 15px;
.pficon-close {
color: @color-pf-black;
color: @color-pf-black-400;
&:hover,&:focus,&:active {
color: @color-pf-black-700;
}
}
}
.expanded-notification .drawer-pf-notification-message {
max-width: 35%; // keeps flex in check in case of a really long message
.drawer-pf-title h3 {
font-size: @font-size-base - 1;
}
.expanded-notification {
.drawer-pf-notification-info {
.text-muted;
}
.drawer-pf-notification-message-expanded {
font-size: @font-size-base - 1;
padding: 10px 10px 10px 42px;
.text-muted;
}
&.unread {
.drawer-pf-notification-info {
color: inherit;
}
.drawer-pf-notification-message-expanded {
color: inherit;
font-weight: normal;
.word-break();
}
}
}
}

.panel-heading {
.panel-title {
color: @color-pf-black-700;
font-size: @font-size-h4;
font-weight: bold;
line-height: normal;
// TODO: hack to eliminate side-to-side wobble
// There is a hard-coded <h4> that wraps the header:
// - https://github.com/patternfly/angular-patternfly/issues/539
// I'm putting quite a bit of markup inside the header,
// need to tinker to eliminate this rule.
overflow: hidden;
overflow:hidden;
.container-fluid {
margin-left: 0;
margin-right: 0;
padding-left: 0;
padding-right: 0;
}
}
.small {
.small();
color: @color-pf-black;
.panel-counter {
font-size: @font-size-small;
font-weight: normal;
padding: 0;
a {
display: inline-block;
font-style: normal;
}
}
}
}
14 changes: 6 additions & 8 deletions app/views/directives/notifications/header.html
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
<div class="container-fluid">
<div class="row">
<div class="truncate">
{{notificationGroup.heading}}
</div>
<div class="row mar-top-md panel-counter">
<div class="col-xs-6">
<strong>{{notificationGroup.heading}}</strong>
{{notificationGroup.totalUnread}} Unread
</div>
<div class="col-xs-6 text-right small">
<div class="col-xs-6 text-right">
<a
title="All Events"
ng-href="project/{{$ctrl.customScope.projectName}}/browse/events"
Expand All @@ -12,9 +15,4 @@
</a>
</div>
</div>
<div class="row mar-top-md">
<div class="col-xs-12">
<em>{{notificationGroup.totalUnread}} Unread</em>
</div>
</div>
</div>
6 changes: 3 additions & 3 deletions app/views/directives/notifications/notification-body.html
Original file line number Diff line number Diff line change
Expand Up @@ -78,12 +78,12 @@
</div>
</div>

<span ng-if="$ctrl.drawerExpanded" class="drawer-pf-notification-message text-muted small word-break">
{{notification.event.message}}
</span>
<div class="drawer-pf-notification-info">
<span class="date">{{notification.event.lastTimestamp | date:'shortDate'}}</span>
<span class="time">{{notification.event.lastTimestamp | date:'mediumTime'}}</span>
</div>
</div>
<div ng-if="$ctrl.drawerExpanded" class="drawer-pf-notification-message drawer-pf-notification-message-expanded">
{{notification.event.message}}
</div>
</div>
2 changes: 1 addition & 1 deletion bower.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
"uri.js": "1.18.12",
"moment": "2.14.2",
"moment-timezone": "0.5.3",
"patternfly": "3.26.6",
"patternfly": "3.27.1",
"hawtio-core": "2.0.37",
"hawtio-extension-service": "2.0.2",
"jquery": "3.2.1",
Expand Down
20 changes: 9 additions & 11 deletions dist/scripts/templates.js
Original file line number Diff line number Diff line change
Expand Up @@ -7455,21 +7455,19 @@ angular.module('openshiftConsoleTemplates', []).run(['$templateCache', function(

$templateCache.put('views/directives/notifications/header.html',
"<div class=\"container-fluid\">\n" +
"<div class=\"row\">\n" +
"<div class=\"truncate\">\n" +
"{{notificationGroup.heading}}\n" +
"</div>\n" +
"<div class=\"row mar-top-md panel-counter\">\n" +
"<div class=\"col-xs-6\">\n" +
"<strong>{{notificationGroup.heading}}</strong>\n" +
"{{notificationGroup.totalUnread}} Unread\n" +
"</div>\n" +
"<div class=\"col-xs-6 text-right small\">\n" +
"<div class=\"col-xs-6 text-right\">\n" +
"<a title=\"All Events\" ng-href=\"project/{{$ctrl.customScope.projectName}}/browse/events\" ng-click=\"$ctrl.customScope.close()\">\n" +
"View All Events\n" +
"</a>\n" +
"</div>\n" +
"</div>\n" +
"<div class=\"row mar-top-md\">\n" +
"<div class=\"col-xs-12\">\n" +
"<em>{{notificationGroup.totalUnread}} Unread</em>\n" +
"</div>\n" +
"</div>\n" +
"</div>"
);

Expand Down Expand Up @@ -7512,14 +7510,14 @@ angular.module('openshiftConsoleTemplates', []).run(['$templateCache', function(
"<duration-until-now timestamp=\"notification.event.firstTimestamp\" omit-single=\"true\" precision=\"1\"></duration-until-now>\n" +
"</div>\n" +
"</div>\n" +
"<span ng-if=\"$ctrl.drawerExpanded\" class=\"drawer-pf-notification-message text-muted small word-break\">\n" +
"{{notification.event.message}}\n" +
"</span>\n" +
"<div class=\"drawer-pf-notification-info\">\n" +
"<span class=\"date\">{{notification.event.lastTimestamp | date:'shortDate'}}</span>\n" +
"<span class=\"time\">{{notification.event.lastTimestamp | date:'mediumTime'}}</span>\n" +
"</div>\n" +
"</div>\n" +
"<div ng-if=\"$ctrl.drawerExpanded\" class=\"drawer-pf-notification-message drawer-pf-notification-message-expanded\">\n" +
"{{notification.event.message}}\n" +
"</div>\n" +
"</div>"
);

Expand Down
27 changes: 18 additions & 9 deletions dist/styles/main.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.