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

Update notifications with id and timestamp #170

Merged

Conversation

benjaminapetersen
Copy link
Contributor

Per this comment in PR 2001 in origin-web-console.

@spadgett @jeff-phillips-18

@@ -18,6 +18,9 @@ angular.module('openshiftCommonUI').provider('NotificationsService', function()
};

var addNotification = function (notification) {
notification.id = notification.id || _.uniqueId('notification-');
// This format matches timestamp of API objects
notification.timestamp = moment.parseZone(new Date()).utc().format();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think just

new Date().toISOString();

does what we want, then we don't need to add moment.js to common

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And it's simpler :)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

True. lets do that.

@benjaminapetersen benjaminapetersen force-pushed the bpeterse/notification-update branch 3 times, most recently from 42844a8 to bc2c28b Compare September 5, 2017 20:52
@benjaminapetersen
Copy link
Contributor Author

Just updated the filters as well to take the api object type (Normal, Warning).

@@ -18,6 +18,10 @@ angular.module('openshiftCommonUI').provider('NotificationsService', function()
};

var addNotification = function (notification) {
notification.id = notification.id || _.uniqueId('notification-');
// This format matches timestamp of API objects
//notification.timestamp = moment.parseZone(new Date()).utc().format();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove commented out code

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

got it

@spadgett spadgett merged commit d5ae6b4 into openshift:master Sep 6, 2017
@benjaminapetersen benjaminapetersen deleted the bpeterse/notification-update branch September 6, 2017 00:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants