Skip to content

Version page should show build status + not being able to pick a non-built doc #5169

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

Closed
wants to merge 13 commits into from
Closed

Version page should show build status + not being able to pick a non-built doc #5169

wants to merge 13 commits into from

Conversation

dojutsu-user
Copy link
Member

Completes feature request 1 and 3 of issue #1253

Feature Request 1
screenshot from 2019-01-24 23-14-54

Feature Request 3
screenshot from 2019-01-24 23-15-12

Copy link
Member

@ericholscher ericholscher left a comment

Choose a reason for hiding this comment

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

Looks like a good start, but needs to use different logic.

@@ -41,6 +41,15 @@ <h3>{% trans "Versions" %}</h3>
{% if request.user|is_admin:project %}
<ul class="module-item-menu">
<li><a href="{% url "project_version_detail" project.slug version.slug %}">{% trans "Edit" %}</a></li>
<li>
<span class="right quiet" style="margin:10px 5px 0px 0px;">
{% if version.built %}
Copy link
Member

Choose a reason for hiding this comment

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

This isn't checking if the build is passing, but only that it has ever passed. We should properly check the last build for this version to get this data.

Copy link
Member Author

Choose a reason for hiding this comment

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

@ericholscher
I have implemented a custom template tag for this purpose.

@@ -41,6 +42,16 @@ <h3>{% trans "Versions" %}</h3>
{% if request.user|is_admin:project %}
<ul class="module-item-menu">
<li><a href="{% url "project_version_detail" project.slug version.slug %}">{% trans "Edit" %}</a></li>
<li>
<span class="right quiet" style="margin:10px 5px 0px 0px;">
Copy link
Member

Choose a reason for hiding this comment

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

We shouldn't have inline styles

is success else returns false. Returns None if no
build is found for the given version.
"""
res = version.builds.all().order_by('-date')
Copy link
Member

Choose a reason for hiding this comment

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

We can just fetch the success column from here, not the whole object

Copy link
Member Author

Choose a reason for hiding this comment

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

Thanks.
I have pushed the changes.

@dojutsu-user
Copy link
Member Author

@stsewd
Thank you.
I have pushed the changes as suggested by you.

@humitos humitos requested a review from stsewd May 9, 2019 11:28
@@ -41,6 +42,16 @@ <h3>{% trans "Versions" %}</h3>
{% if request.user|is_admin:project %}
<ul class="module-item-menu">
<li><a href="{% url "project_version_detail" project.slug version.slug %}">{% trans "Edit" %}</a></li>
<li>
<span class="right quiet status-middle">
{% is_latest_built_success version as is_success %}
Copy link
Member

Choose a reason for hiding this comment

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

This should use this model method: https://github.com/rtfd/readthedocs.org/blob/master/readthedocs/projects/models.py#L882 -- it's likely much more efficient.

Copy link
Member Author

Choose a reason for hiding this comment

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

get_latest_build returns the latest built of the project -- irrespective of the version.
We need the builds to be of specific version here.

@stale
Copy link

stale bot commented Jul 21, 2019

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the Status: stale Issue will be considered inactive soon label Jul 21, 2019
@ericholscher ericholscher requested a review from a team July 22, 2019 17:27
@stale stale bot removed the Status: stale Issue will be considered inactive soon label Jul 22, 2019
@ericholscher
Copy link
Member

We should probably fix these. Assigned core to review.

Copy link
Contributor

@agjohnson agjohnson left a comment

Choose a reason for hiding this comment

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

I'm generally against adding more metadata into columns in our views (which are already too cramped). Our design project is already planning on addressing this, and will add more metadata to the version listing without cramping the table view. I think this needs more work, and ultimately the solution will only be temporary, as the design overhaul is going to rethink this view. I'd probably vote to pass on this PR and focus elsewhere.

If we decide to try to aim for a short term fix with this PR, the issues I have with this design are:
image

@@ -720,6 +720,8 @@ p.build-missing { font-size: .8em; color: #9d9a55; margin: 0 0 3px; }
.hide { display: none; }
.left { float: left; }
.right { float: right; }
.status-middle { margin: 10px 5px 0px 0px; }
.status-failing { margin-left: 14px }
Copy link
Contributor

@agjohnson agjohnson Jul 23, 2019

Choose a reason for hiding this comment

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

You shouldn't use pixel margins like this, we can't guarantee the difference is 14px -- font differences, font size differences, and translated strings will all produce something other than 14px. the proper way to do this is to use a fixed block size as a parent element, which is independent of the text we're trying to separate. But there are still issues with translations in this case, so I'm generally against trying to fit more information into a coulmn format and that is why our design project is moving towards a multi-line row format for all tabular data like this.

Copy link
Contributor

Choose a reason for hiding this comment

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

Also, there are already styles for adding multiple elements in a single row like this, however you'll have to search for an example, I don't have one available. There are several dashboard forms that already use a three column approach.

@dojutsu-user
Copy link
Member Author

@agjohnson
I have updated the PR with the improvements.
It now looks something like this -
Screenshot from 2019-08-04 13-03-34

@dojutsu-user dojutsu-user requested review from agjohnson and a team August 4, 2019 07:43
@stale
Copy link

stale bot commented Sep 18, 2019

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the Status: stale Issue will be considered inactive soon label Sep 18, 2019
@stale stale bot closed this Sep 25, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: stale Issue will be considered inactive soon
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants