Skip to content

Commit 37565cd

Browse files
committed
Disable selection for rollup never rows
1 parent 3b72704 commit 37565cd

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

src/database/mod.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -416,6 +416,12 @@ impl PullRequestModel {
416416
},
417417
}
418418
}
419+
420+
/// Determines if this PR can be included in a rollup.
421+
/// A PR is rollupable if it has been approved and rollup is not `RollupMode::Never`
422+
pub fn is_rollupable(&self) -> bool {
423+
self.is_approved() && !matches!(self.rollup, Some(RollupMode::Never))
424+
}
419425
}
420426

421427
/// Describes whether a workflow is a Github Actions workflow or if it's a job from some external

templates/queue.html

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ <h1>
109109

110110
<tbody>
111111
{% for pr in prs %}
112-
<tr>
112+
<tr data-rollupable="{{ pr.is_rollupable() }}">
113113
<td class="select-checkbox"></td>
114114
<td>
115115
<a href="{{ repo_url }}/pull/{{ pr.number }}">{{ pr.number.0 }}</a>
@@ -218,9 +218,7 @@ <h1>
218218
selector: "td.select-checkbox",
219219
headerCheckbox: true,
220220
selectable: (rowData, tr, index) => {
221-
let table = $("#table").DataTable();
222-
let approvedByIndex = table.column("approved_by:name").index();
223-
return !!(rowData && rowData[approvedByIndex] && rowData[approvedByIndex].trim() !== "");
221+
return tr && tr.dataset && tr.dataset.rollupable === "true";
224222
}
225223
}
226224
};

0 commit comments

Comments
 (0)