Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
O
origin-web-common
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Java-于龙
origin-web-common
Commits
d5ae6b45
Commit
d5ae6b45
authored
Sep 05, 2017
by
Sam Padgett
Committed by
GitHub
Sep 05, 2017
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #170 from benjaminapetersen/bpeterse/notification-update
Update notifications with id and timestamp
parents
722e481c
284898a5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
53 additions
and
9 deletions
+53
-9
origin-web-common-ui.js
dist/origin-web-common-ui.js
+14
-2
origin-web-common.js
dist/origin-web-common.js
+14
-2
origin-web-common.min.js
dist/origin-web-common.min.js
+11
-3
alerts.js
src/filters/alerts.js
+12
-2
notificationsService.js
src/ui-services/notificationsService.js
+2
-0
No files found.
dist/origin-web-common-ui.js
View file @
d5ae6b45
...
...
@@ -1250,7 +1250,9 @@ angular.module('openshiftCommonUI')
return
function
(
type
)
{
var
status
;
switch
(
type
)
{
// API events have just two types: Normal, Warning
// our notifications have four: info, success, error, and warning
switch
(
type
.
toLowerCase
())
{
case
'error'
:
status
=
'alert-danger'
;
break
;
...
...
@@ -1260,6 +1262,9 @@ angular.module('openshiftCommonUI')
case
'success'
:
status
=
'alert-success'
;
break
;
case
'normal'
:
status
=
'alert-info'
;
break
;
default
:
status
=
'alert-info'
;
}
...
...
@@ -1271,7 +1276,9 @@ angular.module('openshiftCommonUI')
return
function
(
type
)
{
var
icon
;
switch
(
type
)
{
// API events have just two types: Normal, Warning
// our notifications have four: info, success, error, and warning
switch
(
type
.
toLowerCase
())
{
case
'error'
:
icon
=
'pficon pficon-error-circle-o'
;
break
;
...
...
@@ -1281,6 +1288,9 @@ angular.module('openshiftCommonUI')
case
'success'
:
icon
=
'pficon pficon-ok'
;
break
;
case
'normal'
:
icon
=
'pficon pficon-info'
;
break
;
default
:
icon
=
'pficon pficon-info'
;
}
...
...
@@ -2139,6 +2149,8 @@ angular.module('openshiftCommonUI').provider('NotificationsService', function()
};
var
addNotification
=
function
(
notification
)
{
notification
.
id
=
notification
.
id
||
_
.
uniqueId
(
'notification-'
);
notification
.
timestamp
=
new
Date
().
toISOString
();
if
(
isNotificationPermanentlyHidden
(
notification
)
||
isNotificationVisible
(
notification
))
{
return
;
}
...
...
dist/origin-web-common.js
View file @
d5ae6b45
...
...
@@ -1421,7 +1421,9 @@ angular.module('openshiftCommonUI')
return
function
(
type
)
{
var
status
;
switch
(
type
)
{
// API events have just two types: Normal, Warning
// our notifications have four: info, success, error, and warning
switch
(
type
.
toLowerCase
())
{
case
'error'
:
status
=
'alert-danger'
;
break
;
...
...
@@ -1431,6 +1433,9 @@ angular.module('openshiftCommonUI')
case
'success'
:
status
=
'alert-success'
;
break
;
case
'normal'
:
status
=
'alert-info'
;
break
;
default
:
status
=
'alert-info'
;
}
...
...
@@ -1442,7 +1447,9 @@ angular.module('openshiftCommonUI')
return
function
(
type
)
{
var
icon
;
switch
(
type
)
{
// API events have just two types: Normal, Warning
// our notifications have four: info, success, error, and warning
switch
(
type
.
toLowerCase
())
{
case
'error'
:
icon
=
'pficon pficon-error-circle-o'
;
break
;
...
...
@@ -1452,6 +1459,9 @@ angular.module('openshiftCommonUI')
case
'success'
:
icon
=
'pficon pficon-ok'
;
break
;
case
'normal'
:
icon
=
'pficon pficon-info'
;
break
;
default
:
icon
=
'pficon pficon-info'
;
}
...
...
@@ -5660,6 +5670,8 @@ angular.module('openshiftCommonUI').provider('NotificationsService', function()
};
var
addNotification
=
function
(
notification
)
{
notification
.
id
=
notification
.
id
||
_
.
uniqueId
(
'notification-'
);
notification
.
timestamp
=
new
Date
().
toISOString
();
if
(
isNotificationPermanentlyHidden
(
notification
)
||
isNotificationVisible
(
notification
))
{
return
;
}
...
...
dist/origin-web-common.min.js
View file @
d5ae6b45
...
...
@@ -488,7 +488,7 @@ content ? (scope.truncatedContent = truncateFilter(content, scope.limit, scope.u
}
]),
angular
.
module
(
"openshiftCommonUI"
).
filter
(
"alertStatus"
,
function
()
{
return
function
(
type
)
{
var
status
;
switch
(
type
)
{
switch
(
type
.
toLowerCase
()
)
{
case
"error"
:
status
=
"alert-danger"
;
break
;
...
...
@@ -501,6 +501,10 @@ case "success":
status
=
"alert-success"
;
break
;
case
"normal"
:
status
=
"alert-info"
;
break
;
default
:
status
=
"alert-info"
;
}
...
...
@@ -509,7 +513,7 @@ return status;
}).
filter
(
"alertIcon"
,
function
()
{
return
function
(
type
)
{
var
icon
;
switch
(
type
)
{
switch
(
type
.
toLowerCase
()
)
{
case
"error"
:
icon
=
"pficon pficon-error-circle-o"
;
break
;
...
...
@@ -522,6 +526,10 @@ case "success":
icon
=
"pficon pficon-ok"
;
break
;
case
"normal"
:
icon
=
"pficon pficon-info"
;
break
;
default
:
icon
=
"pficon pficon-info"
;
}
...
...
@@ -2378,7 +2386,7 @@ this.dismissDelay = 8e3, this.autoDismissTypes = [ "info", "success" ], this.$ge
var
notifications
=
[],
dismissDelay
=
this
.
dismissDelay
,
autoDismissTypes
=
this
.
autoDismissTypes
,
notificationHiddenKey
=
function
(
notificationID
,
namespace
)
{
return
namespace
?
"hide/notification/"
+
namespace
+
"/"
+
notificationID
:
"hide/notification/"
+
notificationID
;
},
addNotification
=
function
(
notification
)
{
isNotificationPermanentlyHidden
(
notification
)
||
isNotificationVisible
(
notification
)
||
(
notifications
.
push
(
notification
),
$rootScope
.
$emit
(
"NotificationsService.onNotificationAdded"
,
notification
));
notification
.
id
=
notification
.
id
||
_
.
uniqueId
(
"notification-"
),
notification
.
timestamp
=
new
Date
().
toISOString
(),
isNotificationPermanentlyHidden
(
notification
)
||
isNotificationVisible
(
notification
)
||
(
notifications
.
push
(
notification
),
$rootScope
.
$emit
(
"NotificationsService.onNotificationAdded"
,
notification
));
},
hideNotification
=
function
(
notificationID
)
{
notificationID
&&
_
.
each
(
notifications
,
function
(
notification
)
{
notification
.
id
===
notificationID
&&
(
notification
.
hidden
=
!
0
);
...
...
src/filters/alerts.js
View file @
d5ae6b45
...
...
@@ -5,7 +5,9 @@ angular.module('openshiftCommonUI')
return
function
(
type
)
{
var
status
;
switch
(
type
)
{
// API events have just two types: Normal, Warning
// our notifications have four: info, success, error, and warning
switch
(
type
.
toLowerCase
())
{
case
'error'
:
status
=
'alert-danger'
;
break
;
...
...
@@ -15,6 +17,9 @@ angular.module('openshiftCommonUI')
case
'success'
:
status
=
'alert-success'
;
break
;
case
'normal'
:
status
=
'alert-info'
;
break
;
default
:
status
=
'alert-info'
;
}
...
...
@@ -26,7 +31,9 @@ angular.module('openshiftCommonUI')
return
function
(
type
)
{
var
icon
;
switch
(
type
)
{
// API events have just two types: Normal, Warning
// our notifications have four: info, success, error, and warning
switch
(
type
.
toLowerCase
())
{
case
'error'
:
icon
=
'pficon pficon-error-circle-o'
;
break
;
...
...
@@ -36,6 +43,9 @@ angular.module('openshiftCommonUI')
case
'success'
:
icon
=
'pficon pficon-ok'
;
break
;
case
'normal'
:
icon
=
'pficon pficon-info'
;
break
;
default
:
icon
=
'pficon pficon-info'
;
}
...
...
src/ui-services/notificationsService.js
View file @
d5ae6b45
...
...
@@ -18,6 +18,8 @@ angular.module('openshiftCommonUI').provider('NotificationsService', function()
};
var
addNotification
=
function
(
notification
)
{
notification
.
id
=
notification
.
id
||
_
.
uniqueId
(
'notification-'
);
notification
.
timestamp
=
new
Date
().
toISOString
();
if
(
isNotificationPermanentlyHidden
(
notification
)
||
isNotificationVisible
(
notification
))
{
return
;
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment