Skip to content

Commit

Permalink
Rename tentative to ghost reviews.
Browse files Browse the repository at this point in the history
  • Loading branch information
kohler committed Feb 9, 2024
1 parent f630d43 commit 4ba3302
Show file tree
Hide file tree
Showing 12 changed files with 28 additions and 28 deletions.
4 changes: 2 additions & 2 deletions scripts/script.js
Original file line number Diff line number Diff line change
Expand Up @@ -6140,8 +6140,8 @@ function append_review_id(rrow, eheader) {
e.innerHTML = rrow.blind ? "[" + rrow.reviewer + "]" : rrow.reviewer;
}
if (rrow.rtype) {
if (rrow.tentative) {
xc = " rttentative"
if (rrow.ghost) {
xc = " rtghost"
} else {
xc = rrow.subreview ? " rtsubrev" : "";
if (!rrow.submitted && !rrow.approved) {
Expand Down
16 changes: 7 additions & 9 deletions src/contact.php
Original file line number Diff line number Diff line change
Expand Up @@ -3311,7 +3311,7 @@ function act_author_view_sql($table, $only_if_complex = false) {
function act_reviewer_sql($table) {
$m = [];
if ($this->contactId > 0) {
$m[] = "({$table}.contactId={$this->contactId} and {$table}.reviewType>0)";
$m[] = "{$table}.contactId={$this->contactId}";
}
if (($rev_tokens = $this->review_tokens())) {
$m[] = "{$table}.reviewToken in (" . join(",", $rev_tokens) . ")";
Expand All @@ -3326,11 +3326,9 @@ function act_reviewer_sql($table) {
}
if (empty($m)) {
return "false";
} else if (count($m) === 1) {
return $m[0];
} else {
return "(" . join(" or ", $m) . ")";
}
$mx = count($m) === 1 ? $m[0] : "(" . join(" or ", $m) . ")";
return "({$mx} and ({$table}.rflags&1)!=0)"; // ReviewInfo::RF_LIVE
}

/** @param bool $allow_no_email
Expand Down Expand Up @@ -3936,7 +3934,7 @@ function can_view_review_assignment(PaperInfo $prow, $rrow) {
if (!$rrow || $rrow->reviewType > 0) {
$rights = $this->rights($prow);
return $rights->allow_administer
|| ((!$rrow || !$rrow->is_tentative())
|| ((!$rrow || !$rrow->is_ghost())
&& ($rights->allow_pc
|| $rights->review_status > 0
|| $this->can_view_review($prow, $rrow)));
Expand Down Expand Up @@ -4013,8 +4011,8 @@ function can_view_review(PaperInfo $prow, $rrow, $viewscore = null,
&& ($flags & self::CAN_VIEW_REVIEW_NO_ADMINISTER) === 0) {
return true;
}
// cannot view tentative reviews unless admin
if ($rrow && $rrow->is_tentative()) {
// cannot view ghost reviews unless admin
if ($rrow && $rrow->is_ghost()) {
return false;
}
// can view if is metareviewer, own review
Expand Down Expand Up @@ -4127,7 +4125,7 @@ function can_view_review_identity(PaperInfo $prow, $rbase = null) {
if ($this->_can_administer_for_track($prow, $rights, Track::VIEWREVID)) {
return true;
}
if ($rbase && $rbase->is_tentative()) {
if ($rbase && $rbase->is_ghost()) {
return false;
}
if (($rights->reviewType === REVIEW_META
Expand Down
2 changes: 1 addition & 1 deletion src/papercolumn.php
Original file line number Diff line number Diff line change
Expand Up @@ -648,7 +648,7 @@ private function analysis(PaperList $pl, PaperInfo $row) {
if ($rrow
&& ($this->not_me
? $pl->user->can_view_review_identity($row, $rrow)
: !$rrow->is_tentative())) {
: !$rrow->is_ghost())) {
$ranal = $pl->make_review_analysis($rrow, $row);
} else {
$ranal = null;
Expand Down
3 changes: 2 additions & 1 deletion src/paperinfo.php
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,8 @@ private function mark_review_type($conf, $rflags,
if (($rflags & ReviewInfo::RF_SUBMITTED) !== 0
|| $reviewNeedsSubmit === 0) {
$this->review_status = self::CIRS_SUBMITTED;
} else if ($this->review_status === 0) {
} else if ($this->review_status === 0
&& ($rflags & ReviewInfo::RF_LIVE) !== 0) {
$this->review_status = self::CIRS_UNSUBMITTED;
}
}
Expand Down
4 changes: 2 additions & 2 deletions src/papertable.php
Original file line number Diff line number Diff line change
Expand Up @@ -2528,7 +2528,7 @@ function review_table() {

// skip unsubmitted reviews;
// assign page lists actionable reviews separately
if (!$canView && $rr->is_tentative()) {
if (!$canView && $rr->is_ghost()) {
continue;
}
if (!$canView && $hideUnviewable) {
Expand All @@ -2551,7 +2551,7 @@ function review_table() {
$id .= " #" . $rr->unparse_ordinal_id();
}
if ($rr->reviewStatus < ReviewInfo::RS_ADOPTED
&& !$rr->is_tentative()) {
&& !$rr->is_ghost()) {
$d = $rr->status_description();
if ($d === "draft") {
$id = "Draft " . $id;
Expand Down
4 changes: 2 additions & 2 deletions src/reviewform.php
Original file line number Diff line number Diff line change
Expand Up @@ -651,8 +651,8 @@ function unparse_review_json(Contact $viewer, PaperInfo $prow,
if ($rrow->reviewStatus >= ReviewInfo::RS_COMPLETED) {
$rj["submitted"] = true;
} else {
if ($rrow->is_tentative()) {
$rj["tentative"] = true;
if ($rrow->is_ghost()) {
$rj["ghost"] = true;
}
if ($rrow->is_subreview()) {
$rj["subreview"] = true;
Expand Down
14 changes: 7 additions & 7 deletions src/reviewinfo.php
Original file line number Diff line number Diff line change
Expand Up @@ -380,8 +380,8 @@ function set_prow(PaperInfo $prow) {


/** @return bool */
function is_tentative() {
return false;
function is_ghost() {
return ($this->rflags & self::RF_LIVE) === 0;
}

/** @return int */
Expand Down Expand Up @@ -466,8 +466,8 @@ function icon_classes($classes = null) {
$k = Ht::add_tokens($k, $classes);
}
if ($this->reviewStatus < ReviewInfo::RS_COMPLETED) {
if ($this->is_tentative()) {
$k .= " rttentative";
if ($this->is_ghost()) {
$k .= " rtghost";
} else if ($this->timeApprovalRequested < 0) {
$k .= " rtsubrev";
} else {
Expand All @@ -486,7 +486,7 @@ function icon_h($classes = null) {
$title = ReviewForm::$revtype_names_full[$this->reviewType];
}
if ($this->reviewStatus < ReviewInfo::RS_COMPLETED
&& !$this->is_tentative()
&& !$this->is_ghost()
&& ($title !== "Subreview" || $this->timeApprovalRequested >= 0)) {
$title .= " (" . $this->status_description() . ")";
}
Expand Down Expand Up @@ -518,7 +518,7 @@ function status_title($ucfirst = false) {
return $ucfirst ? "Request" : "request";
} else if ($this->subject_to_approval()) {
return $ucfirst ? "Subreview" : "subreview";
} else if ($this->is_tentative()) {
} else if ($this->is_ghost()) {
return $ucfirst ? "Tentative review" : "tentative review";
} else {
return $ucfirst ? "Review" : "review";
Expand All @@ -543,7 +543,7 @@ function status_description() {
return "accepted";
} else if ($this->reviewType < REVIEW_PC) {
return "outstanding";
} else if ($this->is_tentative()) {
} else if ($this->is_ghost()) {
return "tentative";
} else {
return "not started";
Expand Down
2 changes: 1 addition & 1 deletion src/reviewrefusalinfo.php
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ static function fetch($result, Conf $conf) {
}

/** @return bool */
function is_tentative() {
function is_ghost() {
return false;
}

Expand Down
2 changes: 1 addition & 1 deletion src/reviewrequestinfo.php
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ static function fetch($result, Conf $conf) {
}

/** @return bool */
function is_tentative() {
function is_ghost() {
return false;
}

Expand Down
2 changes: 1 addition & 1 deletion src/searchterm.php
Original file line number Diff line number Diff line change
Expand Up @@ -1237,7 +1237,7 @@ function test(PaperInfo $row, $xinfo) {
return $row->has_active_reviewer($user);
case "rout":
foreach ($row->reviews_by_user($user, $user->review_tokens()) as $rrow) {
if ($rrow->reviewNeedsSubmit != 0 && !$rrow->is_tentative())
if ($rrow->reviewNeedsSubmit != 0 && !$rrow->is_ghost())
return true;
}
return false;
Expand Down
2 changes: 1 addition & 1 deletion stylesheets/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -2882,7 +2882,7 @@ del .rto {
color: red;
border-color: red;
}
.rttentative {
.rtghost {
opacity: 0.4;
border-style: dotted;
}
Expand Down
1 change: 1 addition & 0 deletions test/t_reviews.php
Original file line number Diff line number Diff line change
Expand Up @@ -1440,5 +1440,6 @@ function test_rflags_type() {
for ($i = 0; $i <= REVIEW_META; ++$i) {
xassert_eqq(ReviewInfo::rflags_type(1 << $i), $i);
}
xassert_eqq(ReviewInfo::RF_LIVE, 1);
}
}

0 comments on commit 4ba3302

Please sign in to comment.