зеркало из https://github.com/mozilla/treeherder.git
Bug 1473166 - Fix 'Pin all Showing' in Filter menu (#3756)
This commit is contained in:
Родитель
b06c4b1319
Коммит
42de1f930b
|
@ -293,6 +293,7 @@ export const thEvents = {
|
|||
saveClassification: 'save-classification-EVT',
|
||||
deleteClassification: 'delete-classification-EVT',
|
||||
clearPinboard: 'clear-pinboard-EVT',
|
||||
pinJobs: 'pin-jobs-EVT',
|
||||
selectJob: 'select-job-EVT',
|
||||
applyNewJobs: 'apply-new-jobs-EVT',
|
||||
openLogviewer: 'open-logviewer-EVT',
|
||||
|
|
|
@ -554,6 +554,10 @@ treeherderApp.controller('MainCtrl', [
|
|||
return filters;
|
||||
};
|
||||
|
||||
$scope.pinJobs = function () {
|
||||
$rootScope.$emit(thEvents.pinJobs, ThResultSetStore.getAllShownJobs());
|
||||
};
|
||||
|
||||
$scope.clearFilterBox = function () {
|
||||
thJobFilters.removeFilter('searchStr');
|
||||
};
|
||||
|
|
|
@ -272,11 +272,14 @@ treeherder.factory('ThResultSetStore', [
|
|||
}
|
||||
};
|
||||
|
||||
const getAllShownJobs = pushId => (
|
||||
Object.values(getJobMap())
|
||||
.map(jobEl => jobEl.job_obj)
|
||||
.filter(job => job.result_set_id === pushId && job.visible)
|
||||
);
|
||||
const getAllShownJobs = (pushId) => {
|
||||
const shownJobs = Object.values(getJobMap()).map(jobEl => jobEl.job_obj);
|
||||
|
||||
if (pushId) {
|
||||
return shownJobs.filter(job => job.result_set_id === pushId && job.visible);
|
||||
}
|
||||
return shownJobs.filter(job => job.visible);
|
||||
};
|
||||
|
||||
var getSelectedJob = function () {
|
||||
return {
|
||||
|
|
Загрузка…
Ссылка в новой задаче