Skip to content

Commit 995cbc8

Browse files
authored
Merge pull request #296 from jeff-phillips-18/fixes
Use Patternfly styling for toast, toast list, and notifications drawer
2 parents 23eccf7 + 9e11a12 commit 995cbc8

File tree

5 files changed

+8
-51
lines changed

5 files changed

+8
-51
lines changed

src/notification/notification-drawer.directive.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@
9797
<span class="time">{{notification.timeStamp | date:'h:mm:ss a'}}</span>
9898
</div>
9999
</div>
100-
<div ng-if="drawerExpanded" class="container-fluid expanded-notification">
100+
<div ng-if="drawerExpanded" class="container-fluid">
101101
<div class="row">
102102
<div class="col-sm-6">
103103
<span class="pull-left {{customScope.getNotficationStatusIconClass(notification)}}"></span>

src/notification/notification-drawer.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ <h4 class="panel-title">
1515
</div>
1616
<div class="panel-collapse collapse" ng-class="{in: notificationGroup.open}">
1717
<div class="panel-body">
18-
<div class="drawer-pf-notification" ng-class="{unread: notification.unread}"
18+
<div class="drawer-pf-notification" ng-class="{unread: notification.unread, 'expanded-notification': drawerExpanded}"
1919
ng-repeat="notification in notificationGroup.notifications" ng-include src="notificationBodyInclude">
2020
</div>
2121
<div ng-if="notificationGroup.isLoading" class="drawer-pf-loading text-center">

src/notification/toast-notification-list.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<div class="toast-notification-list-pf" data-ng-show="notifications.length > 0">
1+
<div class="toast-notifications-list-pf" data-ng-show="notifications.length > 0">
22
<div ng-repeat="notification in notifications">
33
<div pf-toast-notification notification-type="{{notification.type}}"
44
header="{{notification.header}}"

styles/angular-patternfly.css

Lines changed: 0 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -420,49 +420,6 @@ accordion > .panel-group .panel-open .panel-title > a:before {
420420
line-height: 34px;
421421
}
422422

423-
.drawer-pf-toggle-expand {
424-
color: inherit;
425-
cursor: pointer;
426-
left: 0;
427-
padding: 2px 5px;
428-
position: absolute;
429-
}
430-
.drawer-pf-toggle-expand:before {
431-
content: "\f100";
432-
font-family: "FontAwesome";
433-
}
434-
.drawer-pf-toggle-expand:hover, .drawer-pf-toggle-expand:focus {
435-
text-decoration: none;
436-
outline: none;
437-
}
438-
439-
.drawer-pf.drawer-pf-expanded {
440-
left: 270px;
441-
width: inherit;
442-
}
443-
.drawer-pf.drawer-pf-expanded .drawer-pf-title a.drawer-pf-toggle-expand:before {
444-
content: "\f101";
445-
}
446-
.drawer-pf-notification .expanded-notification .date {
447-
border-right: none;
448-
padding-right: 0;
449-
}
450-
.drawer-pf-notification .expanded-notification .drawer-pf-notification-info {
451-
display: inline-block;
452-
}
453-
.drawer-pf-notification .expanded-notification .drawer-pf-notification-message {
454-
display: inline-block;
455-
}
456-
457-
.toast-notification-list-pf {
458-
position: fixed;
459-
right: 15px;
460-
top: 15px;
461-
z-index: 1050;
462-
}
463-
.toast-notification-list-pf .toast-pf.alert {
464-
float: right;
465-
}
466423
.toast-pf-action > a {
467424
cursor: pointer;
468425
}

test/notification/toast-notification-list.spec.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ describe('Directive: pfToastNotificationList', function () {
121121
});
122122

123123
it('should have the correct number of toast notifications', function () {
124-
var toasts = element.find('.toast-notification-list-pf .toast-pf');
124+
var toasts = element.find('.toast-notifications-list-pf .toast-pf');
125125
expect(toasts.length).toBe(4);
126126

127127
var okIcon = element.find('.pficon.pficon-ok');
@@ -136,7 +136,7 @@ describe('Directive: pfToastNotificationList', function () {
136136
$scope.notifications.splice(2, 1);
137137
$scope.$digest();
138138

139-
toasts = element.find('.toast-notification-list-pf .toast-pf');
139+
toasts = element.find('.toast-notifications-list-pf .toast-pf');
140140
expect(toasts.length).toBe(3);
141141

142142
okIcon = element.find('.pficon.pficon-ok');
@@ -151,7 +151,7 @@ describe('Directive: pfToastNotificationList', function () {
151151

152152
it('should get the close callback invoked when an item is closed', function () {
153153
// No close buttons when there are menu actions
154-
var closeButton = element.find('.toast-notification-list-pf .toast-pf button.close');
154+
var closeButton = element.find('.toast-notifications-list-pf .toast-pf button.close');
155155
expect(closeButton.length).toBe(0);
156156

157157
// No Menu Actions
@@ -162,7 +162,7 @@ describe('Directive: pfToastNotificationList', function () {
162162

163163
compileHTML(htmlTmp, $scope);
164164

165-
var closeButton = element.find('.toast-notification-list-pf .toast-pf button.close');
165+
var closeButton = element.find('.toast-notifications-list-pf .toast-pf button.close');
166166
expect(closeButton.length).toBe(3);
167167

168168
expect($scope.closeData).toBeUndefined();
@@ -176,7 +176,7 @@ describe('Directive: pfToastNotificationList', function () {
176176

177177
it('should get the action callback invoked when an action button is closed', function () {
178178
// No close buttons when there are menu actions
179-
var closeButton = element.find('.toast-notification-list-pf .toast-pf .toast-pf-action > a');
179+
var closeButton = element.find('.toast-notifications-list-pf .toast-pf .toast-pf-action > a');
180180
expect(closeButton.length).toBe(4);
181181

182182
expect($scope.actionData).toBeUndefined();

0 commit comments

Comments
 (0)