Skip to content

Commit

Permalink
Only show imported/rejected candidate_records with a status_date (hid…
Browse files Browse the repository at this point in the history
…es the records from the last version) #1669
  • Loading branch information
verheyenkoen committed Sep 16, 2024
1 parent ce6658e commit 0d0d0e4
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 21 deletions.
4 changes: 2 additions & 2 deletions db/query.sql
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,15 @@ RETURNING id;
-- name: GetCandidateRecords :many
SELECT *, count(*) OVER () AS total
FROM candidate_records
WHERE (status = 'new' OR EXTRACT(DAY FROM (current_timestamp - status_date)) <= 90)
WHERE (status = 'new' OR (status_date IS NOT NULL AND EXTRACT(DAY FROM (current_timestamp - status_date)) <= 90))
ORDER BY date_created ASC
LIMIT sqlc.arg('limit')
OFFSET sqlc.arg('offset');

-- name: GetCandidateRecordsByPersonID :many
SELECT *, count(*) OVER () AS total
FROM candidate_records
WHERE (status = 'new' OR (sqlc.arg('new_only')::bool = 0::bool AND EXTRACT(DAY FROM (current_timestamp - status_date)) <= 90))
WHERE (status = 'new' OR (status_date IS NOT NULL AND sqlc.arg('new_only')::bool = 0::bool AND EXTRACT(DAY FROM (current_timestamp - status_date)) <= 90))
AND (metadata->'author' @> sqlc.arg(query)::jsonb OR metadata->'supervisor' @> sqlc.arg(query)::jsonb)
ORDER BY date_created ASC
LIMIT sqlc.arg('limit')
Expand Down
4 changes: 2 additions & 2 deletions db/query.sql.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 3 additions & 1 deletion views/candidaterecord/summary.templ
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,9 @@ templ importedInfo(c *ctx.Ctx, rec *models.CandidateRecord) {
} else {
[missing].
}
<a class="c-link c-link-muted" type="button" href={ templ.URL(c.PathTo("publication", "id", *rec.ImportedID).String()) }>View</a>
if rec.ImportedID != nil && *rec.ImportedID != "" {
<a class="c-link c-link-muted" type="button" href={ templ.URL(c.PathTo("publication", "id", *rec.ImportedID).String()) }>View</a>
}
</span>
<br/>
if rec.StatusDate != nil {
Expand Down
38 changes: 22 additions & 16 deletions views/candidaterecord/summary_templ.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 0d0d0e4

Please sign in to comment.