Small improvements for Cycle Analytics
- Restores legend text for the events column
- Ensures event objects definition
- Prevents errors related to undefined objects that should have been present on the JSON response. Ref: https://gitlab.com/gitlab-org/gitlab-ce/issues/27622#note_23104139
Merge request reports
Activity
@jschatz1 please review
assigned to @jschatz1
61 setStageEvents(events) { 62 this.state.events = this.decorateEvents(events); 66 setStageEvents(events, stage) { 67 this.state.events = this.decorateEvents(events, stage); 63 68 }, 64 decorateEvents(events) { 69 decorateEvents(events, stage) { 65 70 const newEvents = []; 66 71 67 72 events.forEach((item) => { 68 73 if (!item) return; 69 74 70 item.totalTime = item.total_time; 71 item.author.webUrl = item.author.web_url; 72 item.author.avatarUrl = item.author.avatar_url; 75 const eventItem = Object.assign({}, DEFAULT_EVENT_OBJECTS[stage.slug], item); Do we have an
Object.assign
polyfill for IE11?Edited by Jacob Schatz
79 eventItem.author.avatarUrl = eventItem.author.avatar_url; 73 80 74 if (item.created_at) item.createdAt = item.created_at; 75 if (item.short_sha) item.shortSha = item.short_sha; 76 if (item.commit_url) item.commitUrl = item.commit_url; 81 if (eventItem.created_at) eventItem.createdAt = eventItem.created_at; 82 if (eventItem.short_sha) eventItem.shortSha = eventItem.short_sha; 83 if (eventItem.commit_url) eventItem.commitUrl = eventItem.commit_url; 77 84 78 delete item.author.web_url; 79 delete item.author.avatar_url; 80 delete item.total_time; 81 delete item.created_at; 82 delete item.short_sha; 83 delete item.commit_url; 85 delete eventItem.author.web_url; Makes me think you should just have a camelCase method https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/9153/diffs#499c349ef3bbccea372d996dd2080c294170b553_84_85. I think underscore has that which you could have just converted it all in one fell swoop right? This way is very error prone.
Something like: http://stackoverflow.com/a/26215431/974407
Edited by Jacob Schatz
@jameslopez looks like this wasnt picked into
8.17
Also this seems to be a clone of https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/9126/commits
Can we close both, has it been picked into stable?
For the record, we closed !9126 (merged) as a duplicate. We picked this one, as the changes weren't on
8.17.3
stable.mentioned in commit 5343a65b