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

Redesign TestPlan page UI #2029

Merged
merged 114 commits into from
Nov 5, 2020
Merged

Redesign TestPlan page UI #2029

merged 114 commits into from
Nov 5, 2020

Conversation

atodorov
Copy link
Member

Opening so we can see the overview of changes and test results in preparation for merging all of these changes.

@atodorov atodorov added the DO NOT MERGE Do not merge until this label is removed label Oct 22, 2020
@atodorov atodorov force-pushed the refactor_testplan_ui branch from 7fb7a32 to dd4d118 Compare October 23, 2020 21:18
@atodorov atodorov force-pushed the refactor_testplan_ui branch from 9cf025a to e05e2e0 Compare October 31, 2020 13:09
RMadjev and others added 26 commits November 6, 2020 00:13
also adds a TODO comment for misaligned titles

cc @RMadjev
- for now keep constructTagZone() b/c it is called in other JS
  functions which are obsolete but may still be useful when
  debugging on the current branch. Will be removed later with
  everything else related to plan/get.html template
- make pylint happier
TODO: the clone view needs refactoring b/c it doesn't accept GET
requests
this will be implemented similarly to #1402 for the easier case
(adding TC by ID and Summary). For advanced search & add we should
reuse the existing test case search functionality.

This commit removes all functionality related to these deprecated
pages which is not used anywhere else.
- removes testplan_actions.js
- lib/tablednd.js
- lots of helper & unused functions removed

The following views are also removed:

- /plan/update-parent/
- /ajax/update/cases-actor/
- /cases/load-more/
- /case/<pk>/readonly-pane/
- testcases.views.list_all()
this should probably be implemented via JSON-RPC API because we've
got a request to add the opposite method - reading the sortkey, see

In case API isn't feasible this commit can easily be reverted.
not needed anymore b/c the new pages can be styled for print
using CSS
- calculate_stats_for_testplans
  - get_number_of_plans_cases
  - get_number_of_plans_runs
instead of another conditional
this should ultimately happen for all of the <template> tags
so we can visually connect them with the rest of the page. Makes
the code easier to look at and doesn't require scrolling up and down.
atodorov and others added 22 commits November 6, 2020 00:13
b/c expansions are cached and we want the UI to be refreshed
b/c status controls how/if comment editors are shown
- constructTagZone()
- addTag()
- removeTag()
- json_failure()
- html_failure()
- splitString()
- previewPlan()
- clearDialog()
- clickedSelectAll()
- constructForm()
- Nitrate.TestCases.CasesSelection()
- toggleAllCases()
- serializeCaseFromInputList2()
- serializeCaseFromInputList()
- serialzeCaseForm()
b/c the textarea element is statically rendered it will have
the same non-unique ID whenever we render each row. This leads
to a bug where you can have multiple editors loaded when the
first row is an unconfirmed test case b/c their IDs would change
only after expanding.

Miving the ID change before each row is drawn fixes this problem.
the edit already supports that via ~~text~~ syntax but the
Python renderer didn't know about it!
b/c we're not using xml.etree.ElementTree to parse data but to
create a new node and insert it into the resulting HTML.
when rendering Markdown into HTML unescape the input b/c it
may be coming from another API call and could be preescaped.
This is the case for example when adding comments!

The BE rendering functionality will take care to remove any
characters that are deemed unsafe!

If we don't do this then some inputs already contain escaped
sequences, e.g. quotes in code blocks which don't appear well
when rendered as HTML.
without this commit all internal API calls are executed which
isn't necessary
because these are rendered from a <template> tag they end up
with the same IDs
also pass the number of disabled test cases to the HTML template. fixes #718
- instead make use of NewRunForm class
- swap the order in which form fields are filtered internally
  inside .populate() so it can work with an int ID parameter
  instead of an object (for both API and views).
instead of passing each individual value around.

Also make sure that the product_version field gets automatically
updated based on the value of the chosen test plan!
NOTE: the previous implementation seems to work fine for views
and with API calls when executed live. However it causes one test
to fail b/c it can't find the 'CONFIRMED' status!

This implementation is not the best one but is functionally
equivalent and seems to work. Also all of this will be refactored
as part of #1932 very soon.
@atodorov atodorov force-pushed the refactor_testplan_ui branch from 528c4a9 to 4d019fd Compare November 5, 2020 22:14
@atodorov atodorov changed the title WIP: Redesign TestPlan page UI Redesign TestPlan page UI Nov 5, 2020
@atodorov atodorov removed the DO NOT MERGE Do not merge until this label is removed label Nov 5, 2020
@atodorov atodorov marked this pull request as ready for review November 5, 2020 22:15
@atodorov atodorov merged commit 3c5d829 into master Nov 5, 2020
@atodorov atodorov deleted the refactor_testplan_ui branch November 5, 2020 22:41
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.

2 participants