Skip to content

views: checks requests tab templates #29

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Mar 26, 2025

Conversation

ptamarit
Copy link
Member

❤️ Thank you for your contribution!

Checklist

Ticks in all boxes and 🟢 on all GitHub actions status checks are required to merge:

Frontend

Reminder

By using GitHub, you have already agreed to the GitHub’s Terms of Service including that:

  1. You license your contribution under the same terms as the current repository’s license.
  2. You agree that you have the right to license your contribution under the current repository’s license.

@ptamarit ptamarit force-pushed the 1133-request-check-tab branch from daecbac to 310426b Compare March 24, 2025 17:24
@ptamarit ptamarit changed the title 1133 request check tab views: checks requests tab templates Mar 24, 2025
@ptamarit ptamarit force-pushed the 1133-request-check-tab branch 2 times, most recently from 819c390 to f97823a Compare March 24, 2025 17:27
Comment on lines 47 to 51
{#
Rule descriptions can contain HTML to link to a page with more details about the rule.
This field is sanitized in the backend with SanitizedHTML.
#}
<div class="pt-5 text-muted">{{ rule_result.rule_description | safe }}</div>
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The backend sanitization and the React conterpart in the form are implemented in zenodo/zenodo-rdm#1135

Comment on lines 33 to 40
{%if rule_result.success %}
{% set ns.rule_severity_level = "success" %}
{% elif rule_result.level == "info" %}
{% set ns.rule_severity_level = "warning" %}
{% elif rule_result.level == "error" %}
{% set ns.rule_severity_level = "error" %}
{% else %}
{% set ns.rule_severity_level = "unknown" %}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why not use it directly?

Suggested change
{%if rule_result.success %}
{% set ns.rule_severity_level = "success" %}
{% elif rule_result.level == "info" %}
{% set ns.rule_severity_level = "warning" %}
{% elif rule_result.level == "error" %}
{% set ns.rule_severity_level = "error" %}
{% else %}
{% set ns.rule_severity_level = "unknown" %}
{% set ns.rule_severity_level = rule_result.level %}

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's not super obvious, this is why I'm explaining it in the comment above:

    This code depends on 2 fields of each `rule_results` : `success` and `level`.
    If the boolean `success` field is true, it means that the check was successful.
    Otherwise, it means that the check failed, and we display the severity `level` of the check.


{% set ns = namespace(overall_severity_level="success") %}

{% for error in checks.result.errors %}
Copy link
Contributor

@kpsherva kpsherva Mar 25, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this part should be computed on the backend in the CheckRun

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm running out of time, so I added a FIXME for now :(

@ptamarit ptamarit force-pushed the 1133-request-check-tab branch 2 times, most recently from a1de56e to d2df185 Compare March 26, 2025 11:37
@ptamarit
Copy link
Member Author

Just auto-squashed before merging.

@ptamarit ptamarit force-pushed the 1133-request-check-tab branch from d2df185 to 7375da6 Compare March 26, 2025 11:38
@ptamarit ptamarit merged commit 9291dfa into inveniosoftware:master Mar 26, 2025
2 checks passed
@ptamarit ptamarit deleted the 1133-request-check-tab branch March 26, 2025 12:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

checks: add checks tab (community curator can't easily see in a request if there are failing checks)
2 participants