Skip to content
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

Feature request - Test Run - Comments section - Automatically expand Comments History if there are comments present #349

Closed
Prome88 opened this issue May 22, 2018 · 4 comments

Comments

@Prome88
Copy link
Contributor

@Prome88 Prome88 commented May 22, 2018

Current behavior:
When user adds comment to test case the comment is hidden on test run view until user clicks on button Show all under comments history.

image

Desired behavior:
Adding comments to test case results is very common and should be visible to user without the need for an additional click.

image

@okainov

This comment has been minimized.

Copy link
Contributor

@okainov okainov commented May 30, 2018

+, would be nice to have

@ohporter

This comment has been minimized.

Copy link

@ohporter ohporter commented May 31, 2018

Since deploying kiwi for a project here, I've also noticed this would be great to have. I find I refer to a test run case by link in our team irc channel and comments on a failure or otherwise would be handier if autoexpanded. I might try looking into adding this...

@atodorov

This comment has been minimized.

Copy link
Member

@atodorov atodorov commented Jun 1, 2018

@ohporter,
probably the easiest way will be to attach the function that expands the comments to the onclick event for the result row, however I haven't looked at that part of the code in details.

Be warned there's some hairy JavaScript in there which needs some love.

@ohporter

This comment has been minimized.

Copy link

@ohporter ohporter commented Jun 4, 2018

@atodorov another approach is to default to show all in the template. I'm using this atm:

diff --git a/tcms/templates/case/get_details_case_run.html b/tcms/templates/case/get_details_case_run.html
index dcba9b8..fbed087 100644
--- a/tcms/templates/case/get_details_case_run.html
+++ b/tcms/templates/case/get_details_case_run.html
@@ -46,11 +46,13 @@
                                <h4 class="borderB">Comments History ({{ comments_count }}):
                                {% ifequal comments_count 0 %}
                                        <span>[ <a id="showText" href="javascript:void(0);">Show All</a> ]</span>
-                               {% else %}
-                                       <span>[ <a id="showText" class="js-show-comments" data-param="comment{{ test_case_run.pk }}" href="javascript:void(0);">Show All</a> ]</span>
-                               {% endifequal %}
                                </h4>
                                <ul class="comment" id="comment{{ test_case_run.pk }}" style="display:none;">
+                               {% else %}
+                                       <span>[ <a id="showText" class="js-show-comments" data-param="comment{{ test_case_run.pk }}" href="javascript:void(0);">Hide All</a> ]</span>
+                               </h4>
+                               <ul class="comment" id="comment{{ test_case_run.pk }}">
+                               {% endifequal %}
                                        {% for comment in caserun_comments %}
                                        <li>
                                                <span>#{{ forloop.counter }}</span>
atodorov added a commit that referenced this issue Nov 24, 2019
original solution proposed by @ohporter
atodorov added a commit that referenced this issue Nov 24, 2019
original solution proposed by @ohporter
@atodorov atodorov closed this in 5c54e4b Nov 24, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants
You can’t perform that action at this time.