-
Notifications
You must be signed in to change notification settings - Fork 230
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
Add track by to notification drawer #1988
Add track by to notification drawer #1988
Conversation
Working on getting patternfly/angular-patternfly#602 available to you in console. |
Did you have issue upgrading the angular patternfly version? I got bower install issues: `Please note that, bower ECONFLICT Unable to find suitable version for angular-patternfly I am trying to update origin-web-catalog first. |
@benjaminapetersen You don't necessarily need a high volume. You just need one event that updates ("seen 23 times in the last 2 hours") like a crash looping pod. |
if(EventsService.isImportantEvent(event) && !EventsService.isCleared(event)) { | ||
ensureProjectGroupExists(filtered, event.metadata.namespace); | ||
filtered[event.metadata.namespace].notifications.push({ | ||
unread: !EventsService.isRead(event), | ||
uid: eventId, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd prefer event.metadata.uid
here so it doesn't matter how the map is keyed. uid seems safest since it's globally unique.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agree, updating this.
@jeff-phillips-18 yup, i did. Prob need to update catalog & all too 😕 "angular-patternfly": ">4.3.0", # at least this, but later is fine!
"angular-patternfly": "~4.3.0", # current form, tilde limits us to patches only... This would still allow the |
ce48f65
to
8bfd50b
Compare
@@ -154,11 +154,12 @@ | |||
var formatAndFilterEvents = function(eventMap) { | |||
var filtered = {}; | |||
ensureProjectGroupExists(filtered, $routeParams.project); | |||
_.each(eventMap, function(event) { | |||
_.each(eventMap, function(event, eventUID) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd still rather just use event.metadata.uid
below instead of relying on the map being keyed by UID. Then if it ever changes later in eventWatchCallback
, this function won't be affected.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think the changes to the notification drawer allow for a nested field. @jeff-phillips-18
Code here looks like it has to be top level on the object:
ng-repeat="notification in notificationGroup.notifications track by $ctrl.notificationTrackField ? notification[$ctrl.notificationTrackField] || $index : $index"
If I'm following what you are saying.
8bfd50b
to
94d3de8
Compare
@@ -159,6 +159,7 @@ | |||
ensureProjectGroupExists(filtered, event.metadata.namespace); | |||
filtered[event.metadata.namespace].notifications.push({ | |||
unread: !EventsService.isRead(event), | |||
uid: event.metadata.uid, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@spadgett fixed
eventsByNameData = eventData.by('metadata.name'); | ||
eventsMap = formatAndFilterEvents(eventsByNameData); | ||
eventsByUID = eventData.by('metadata.uid'); | ||
eventsMap = formatAndFilterEvents(eventsByUID); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's better to leave this as eventsByName
unless we need it mapped by UID because data.by('metadata.name')
is a no-op. data.by('metadata.uid')
forces the map to be re-keyed.
Being a bit nit picky here because I'm afraid this might get called frequently.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd make it a local var to this function if it's not used outside the function.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can swap it back here (though I think I'm going to turn it right back to uid in my next PR adding the other kind of notifications, but will see if I can leave it .name
😄 )
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK that's fine then as long as it's needed
94d3de8
to
a7f96ff
Compare
[test] |
@benjaminapetersen You also need to bump origin-web-catalog that @jeff-phillips-18 released to avoid the bower conflict |
a7f96ff
to
8dc5fca
Compare
bumped [test] again |
[merge][severity: bug] |
Origin Web Console Test Results: Waiting: Determining build queue position |
[merge][severity: bug] |
@benjaminapetersen We have a conflict in bower.json now :( |
Heh, resolving.... |
8dc5fca
to
9b6611a
Compare
[test] |
Welp, lets see... |
Already fixed this:
[test] again? |
😐 😒 |
@benjaminapetersen Make sure you bower install again if you haven't. A couple bower updates went in today. |
@spadgett yup, I'm rebased on master, |
@benjaminapetersen Make sure you've rebased on latest master, too, even if there aren't merge conflicts. Sometimes the uglified output changes. |
9b6611a
to
362717c
Compare
Pretty sure this is a flake: FAIL
Error: cannot generate registry resources
Caused By:
Error: Docker exec error
Details:
Container: origin
Command: [oc adm registry --dry-run --output=json --images=openshift/origin-${component}:latest --mount-host=/var/lib/origin/openshift.local.pv/registry]
Result Code: 137
++ export status=FAILURE
++ status=FAILURE
+ set +o xtrace
########## FINISHED STAGE: FAILURE: START OPENSHIFT SERVER [00h 04m 16s] ##########
Build step 'Execute shell' marked build as failure
[PostBuildScript] - Execution post build scripts. [test] |
Tests will probably fail until #2003 merges |
Evaluated for origin web console test up to 362717c |
Origin Web Console Test Results: FAILURE (https://ci.openshift.redhat.com/jenkins/job/test_pull_request_origin_web_console/128/) (Base Commit: 5709d8a) (PR Branch Commit: 362717c) |
[merge][severity: blocker] |
Evaluated for origin web console merge up to 362717c |
Origin Web Console Merge Results: SUCCESS (https://ci.openshift.redhat.com/jenkins/job/merge_pull_request_origin_web_console/112/) (Base Commit: 6ff495e) (PR Branch Commit: 362717c) (Extended Tests: blocker, bug) |
re issue #1981
Working on testing with a high volume of events to ensure it performs as expected.
@spadgett @jeff-phillips-18