-
Notifications
You must be signed in to change notification settings - Fork 371
FXP-4047 Implement functionality to filter by all sheriffed frameworks in Alerts View #8810
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
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -148,6 +148,11 @@ class AlertsView extends React.Component { | |||||
const frameworkOptions = cloneDeep(frameworks); | ||||||
const ignoreFrameworks = { id: -1, name: 'all frameworks' }; | ||||||
frameworkOptions.unshift(ignoreFrameworks); | ||||||
const ignoreNonSheriffedFrameworks = { | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. A better naming might be
Suggested change
which aligns better with our approach here to filter by sheriffed frameworks instead of excluding the non-sheriffed ones |
||||||
id: -2, | ||||||
name: 'all sheriffed frameworks', | ||||||
}; | ||||||
frameworkOptions.unshift(ignoreNonSheriffedFrameworks); | ||||||
return frameworkOptions; | ||||||
}; | ||||||
|
||||||
|
@@ -207,6 +212,9 @@ class AlertsView extends React.Component { | |||||
if (listMode && params.framework === doNotFilter) { | ||||||
delete params.framework; | ||||||
} | ||||||
if (listMode && params.framework === -2) { | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Add a new constant for the -2 value, similar to the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Further you can merge the if statements for the framework check since both do the same action - removing the framework url parameter |
||||||
delete params.framework; | ||||||
} | ||||||
|
||||||
return params; | ||||||
}; | ||||||
|
@@ -271,6 +279,9 @@ class AlertsView extends React.Component { | |||||
if (hideAssignedToOthers) { | ||||||
params.with_assignee = user.username; | ||||||
} | ||||||
if (framework.id === -2) { | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Use the new constant for the -2 value instead of hardcoding it |
||||||
params.show_sheriffed_frameworks = true; | ||||||
} | ||||||
} | ||||||
|
||||||
const url = getApiUrl( | ||||||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -138,14 +138,14 @@ export default class AlertsViewControls extends React.Component { | |
|
||
let sortedFrameworks = sortData(frameworkOptions, 'name', false); | ||
const allFrameworks = 'all frameworks'; | ||
const mozperftest = 'mozperftest'; | ||
const allSheriffedFrameworks = 'all sheriffed frameworks'; | ||
const platformMicrobench = 'platform_microbench'; | ||
|
||
sortedFrameworks = sortedFrameworks.filter( | ||
(framework) => | ||
framework.name !== mozperftest && | ||
framework.name !== platformMicrobench && | ||
framework.name !== allFrameworks, | ||
framework.name !== allFrameworks && | ||
framework.name !== allSheriffedFrameworks, | ||
); | ||
|
||
const frameworkNames = | ||
|
@@ -165,8 +165,8 @@ export default class AlertsViewControls extends React.Component { | |
selectedItem: framework.name, | ||
updateData: this.updateFramework, | ||
namespace: 'framework', | ||
pinned: [allFrameworks], | ||
otherPinned: [mozperftest, platformMicrobench], | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Could maybe add telemetry to the otherPinned list since it's a framework that we don't sheriff. |
||
pinned: [allFrameworks, allSheriffedFrameworks], | ||
otherPinned: [platformMicrobench], | ||
}, | ||
]; | ||
|
||
|
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.
Create a new constant and import it
in ui/perfherder/perf-helpers/constants.js