Select the types of activity you want to include in your feed.
@recaptime-dev's working patches + fork for Phorge, a community fork of Phabricator. (Upstream dev and stable branches are at upstream/main and upstream/stable respectively.)
hq.recaptime.dev/wiki/Phorge
···218218 }
219219220220 public function renderWarningBoxForRevisionAccept() {
221221- $diff = $this->getDiff();
222222- $lint_warning = null;
223223- if ($diff->getLintStatus() >= DifferentialLintStatus::LINT_WARN) {
224224- $titles =
225225- array(
226226- DifferentialLintStatus::LINT_WARN => 'Lint Warning',
227227- DifferentialLintStatus::LINT_FAIL => 'Lint Failure',
228228- DifferentialLintStatus::LINT_SKIP => 'Lint Skipped'
229229- );
230230- if ($diff->getLintStatus() == DifferentialLintStatus::LINT_SKIP) {
231231- $content =
232232- "<p>This diff was created without running lint. Make sure you are ".
233233- "OK with that before you accept this diff.</p>";
234234- } else {
235235- $content =
236236- "<p>This diff has Lint Problems. Make sure you are OK with them ".
237237- "before you accept this diff.</p>";
238238- }
239239- $lint_warning = id(new AphrontErrorView())
240240- ->setSeverity(AphrontErrorView::SEVERITY_ERROR)
241241- ->appendChild($content)
242242- ->setTitle(idx($titles, $diff->getLintStatus(), 'Warning'));
221221+ $status = $this->getDiff()->getLintStatus();
222222+ if ($status < DifferentialLintStatus::LINT_WARN) {
223223+ return null;
243224 }
244244- return $lint_warning;
225225+226226+ $severity = AphrontErrorView::SEVERITY_ERROR;
227227+ $titles = array(
228228+ DifferentialLintStatus::LINT_WARN => 'Lint Warning',
229229+ DifferentialLintStatus::LINT_FAIL => 'Lint Failure',
230230+ DifferentialLintStatus::LINT_SKIP => 'Lint Skipped',
231231+ DifferentialLintStatus::LINT_POSTPONED => 'Lint Postponed',
232232+ );
233233+234234+ if ($status == DifferentialLintStatus::LINT_SKIP) {
235235+ $content =
236236+ "<p>This diff was created without running lint. Make sure you are ".
237237+ "OK with that before you accept this diff.</p>";
238238+239239+ } else if ($status == DifferentialLintStatus::LINT_POSTPONED) {
240240+ $severity = AphrontErrorView::SEVERITY_WARNING;
241241+ $content =
242242+ "<p>Postponed linters didn't finish yet. Make sure you are OK with ".
243243+ "that before you accept this diff.</p>";
244244+245245+ } else {
246246+ $content =
247247+ "<p>This diff has Lint Problems. Make sure you are OK with them ".
248248+ "before you accept this diff.</p>";
249249+ }
250250+251251+ return id(new AphrontErrorView())
252252+ ->setSeverity($severity)
253253+ ->appendChild($content)
254254+ ->setTitle(idx($titles, $status, 'Warning'));
245255 }
246256247257}