зеркало из https://github.com/mozilla/treeherder.git
Bug 1615365 - Redirecting to correct url on changing the status or framework filter (#6180)
* fixed bug Redirecting to correct url on changing the status or framework filter * Changed the updated filter logic from status and frameworks to not pages in AlertsView.js * Kyles recommended changes
This commit is contained in:
Родитель
5f41c24e7f
Коммит
db76065cf4
|
@ -144,27 +144,26 @@ class AlertsView extends React.Component {
|
|||
};
|
||||
|
||||
getParamsFromFilters = filters => {
|
||||
const params = {};
|
||||
for (const [filterName, filterValue] of Object.entries(filters)) {
|
||||
Object.assign(params, this.mapParamFromFilter(filterName, filterValue));
|
||||
}
|
||||
return params;
|
||||
};
|
||||
|
||||
mapParamFromFilter = (filterName, filterValue) => {
|
||||
return {
|
||||
page: 1, // default value
|
||||
...Object.fromEntries(
|
||||
Object.entries(filters).map(([filterName, filterValue]) => {
|
||||
switch (filterName) {
|
||||
case 'framework':
|
||||
return { [filterName]: filterValue.id };
|
||||
return [filterName, filterValue.id];
|
||||
case 'status':
|
||||
return { [filterName]: summaryStatusMap[filterValue] };
|
||||
return [filterName, summaryStatusMap[filterValue]];
|
||||
case 'hideDownstream':
|
||||
return { hideDwnToInv: +filterValue };
|
||||
return ['hideDwnToInv', +filterValue];
|
||||
case 'hideImprovements':
|
||||
case 'hideAssignedToOthers':
|
||||
return { [filterName]: +filterValue };
|
||||
return [filterName, +filterValue];
|
||||
default:
|
||||
return { [filterName]: filterValue };
|
||||
return [filterName, filterValue];
|
||||
}
|
||||
}),
|
||||
),
|
||||
};
|
||||
};
|
||||
|
||||
getCurrentPages = () => {
|
||||
|
|
Загрузка…
Ссылка в новой задаче