From 75dd9fdd81a2b1a9bcb30408b606ab4e305e7660 Mon Sep 17 00:00:00 2001 From: Oliver Date: Thu, 25 Nov 2021 17:33:15 +0100 Subject: [PATCH] Fixing broken search field. (#255) Extended manual for bug report workflow. --- HISTORY.rst | 4 + docs_manual/bug_reports.rst | 155 ++++++++++++++++++ docs_manual/index.rst | 1 + variants/templates/variants/_search_item.html | 4 +- variants/tests/test_ui.py | 25 ++- 5 files changed, 180 insertions(+), 9 deletions(-) create mode 100644 docs_manual/bug_reports.rst diff --git a/HISTORY.rst b/HISTORY.rst index 8bf5414d0..e103becde 100644 --- a/HISTORY.rst +++ b/HISTORY.rst @@ -12,6 +12,8 @@ End-User Summary - Fixing Kiosk mode of VarFish. - Fixing displaying of beacon information in results table. - Fixing broken flags & comments popup for structural variants. +- Fixing broken search field. +- Extended manual for bug report workflow. Full Change List ================ @@ -23,6 +25,8 @@ Full Change List - Mapping kiosk jobs to import queue. - Fixing displaying of beacon information in results table. - Fixing broken flags & comments popup for structural variants. +- Fixing broken search field. +- Extended manual for bug report workflow. ------- v0.23.9 diff --git a/docs_manual/bug_reports.rst b/docs_manual/bug_reports.rst new file mode 100644 index 000000000..86d64d66d --- /dev/null +++ b/docs_manual/bug_reports.rst @@ -0,0 +1,155 @@ +.. _bug_reports: + +================================ +Bug Reports and Feature Requests +================================ + +We do organize bug reports and feature request in the +`Github issue tracker `_. +Please choose the template that fits best what you want to report and fill out +the questions to help us decide on how to approach the task. + +----------- +Bug Reports +----------- + +The template for bug reports has the following form (an up-to-date form is located in the Github issue tracker):: + + **Describe the bug** + A clear and concise description of what the bug is. + + **To Reproduce** + Steps to reproduce the behavior: + 1. Go to '...' + 2. Click on '....' + 3. Scroll down to '....' + 4. See error + + **Expected behavior** + A clear and concise description of what you expected to happen. + + **Screenshots** + If applicable, add screenshots to help explain your problem. + + **Desktop (please complete the following information):** + - OS: [e.g. iOS] + - Browser [e.g. chrome, safari] + - Version [e.g. 22] + + **Smartphone (please complete the following information):** + - Device: [e.g. iPhone6] + - OS: [e.g. iOS8.1] + - Browser [e.g. stock browser, safari] + - Version [e.g. 22] + + **Additional context** + Add any other context about the problem here. + +^^^^^^^^^^^^^^^^^^^ +Root Cause Analysis +^^^^^^^^^^^^^^^^^^^ + +In the following, a root cause analysis (RCA) needs to be done. The ticket will get an answer with the title +**Root Cause Analysis** and a thorough description of what might cause the bug. + +^^^^^^^^^^^^^^^^^^^ +Resolution Proposal +^^^^^^^^^^^^^^^^^^^ + +When the root cause is determined, a solution needs to be proposed, following this form:: + + **Resolution Proposal** + + e.g. The component X needs to be changed to Y so Z is not executed when M occurs. + + **Affected Components** + + e.g. VarFish server + + **Affected Modules/Files** + + e.g. variants module or queries.py + + **Required Architectural Changes** + + e.g. Function F needs to be moved to X. + + **Resolution Sketch** + + e.g. Change X in F. Then do Y. + + +^^^^^^^^^^^^^^^^^^ +Fix & Pull Request +^^^^^^^^^^^^^^^^^^ + +1. Create new branch (name starts with issue number), e.g. ``123-fix-for-issue`` +2. Create pull request in "Draft" state +3. Fix problem, ideally in a test-driven way, remove "Draft" state + +^^^^^^^^^^^^^^ +Review & Merge +^^^^^^^^^^^^^^ + +1. Perform code review +2. Ensure fix is documented in changelog (link to bug and PR #ids) + +---------------- +Feature Requests +---------------- + +A feature request follows the same workflow as a bug request (an up-to-date form is located in the Github issue tracker):: + + **Is your feature request related to a problem? Please describe.** + A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] + + **Describe the solution you'd like** + A clear and concise description of what you want to happen. + + **Describe alternatives you've considered** + A clear and concise description of any alternative solutions or features you've considered. + + **Additional context** + Add any other context or screenshots about the feature request here. + + +^^^^^^ +Design +^^^^^^ + +In the following, the design of the feature needs to be specified:: + + **Implementation Proposal** + + e.g. The component X needs to be changed to Y so Z is not executed when M occurs. + + **Affected Components** + + e.g. VarFish server + + **Affected Modules/Files** + + e.g. variants module or queries.py + + **Required Architectural Changes** + + e.g. Function F needs to be moved to X. + + **Implementation Sketch** + + e.g. Change X in F. Then do Y. + +^^^^^^^^^^^^^^^^ +Implement & Test +^^^^^^^^^^^^^^^^ + +1. Create feature branch, named starting with issue ID +2. Perform implementation, ideally in a test-driven way +3. Tests and documentation must be augmented/updated as well + +^^^^^^^^^^^^^^ +Review & Merge +^^^^^^^^^^^^^^ + +1. Perform code review +2. Ensure change is documented in changelog (link to feature issue and PR #ids) diff --git a/docs_manual/index.rst b/docs_manual/index.rst index c9bdaa3cd..2a12c7d49 100644 --- a/docs_manual/index.rst +++ b/docs_manual/index.rst @@ -143,6 +143,7 @@ Currently, the main focus is on small/sequence variants called from high-througp :titlesonly: contributors + bug_reports history glossary dev_docker diff --git a/variants/templates/variants/_search_item.html b/variants/templates/variants/_search_item.html index 7848dbd61..1bc6c3387 100644 --- a/variants/templates/variants/_search_item.html +++ b/variants/templates/variants/_search_item.html @@ -8,7 +8,7 @@ {# Name & link column #}
- {% highlight_search_term item.name search_term as item_display_name %} + {% highlight_search_term item.name search_terms as item_display_name %} {% autoescape off %}{{ item_display_name }}{% endautoescape %} @@ -29,7 +29,7 @@ {% autoescape off %} {% for entry in item.pedigree %} - {% highlight_search_term entry.patient|only_source_name search_term %}{% if not forloop.last %}, {% endif %} + {% highlight_search_term entry.patient|only_source_name search_terms %}{% if not forloop.last %}, {% endif %} {% endfor %} {% endautoescape %} diff --git a/variants/tests/test_ui.py b/variants/tests/test_ui.py index 9d4d1ba89..d6693a96b 100644 --- a/variants/tests/test_ui.py +++ b/variants/tests/test_ui.py @@ -472,9 +472,12 @@ def test_variant_filter_case_display_loading(self): self.compile_url_and_login( {"project": self.case.project.sodar_uuid, "case": self.case.sodar_uuid} ) - # find & hit button + # Wait until button is a submit button. + WebDriverWait(self.selenium, self.wait_time).until( + wait_for_the_attribute_value((By.ID, "submitFilter"), "data-event-type", "submit") + ) + # Click button. button = self.selenium.find_element_by_id("submitFilter") - self.assertEqual(button.get_attribute("data-event-type"), "submit") button.click() WebDriverWait(self.selenium, self.wait_time).until( ec.presence_of_element_located((By.ID, "logger")) @@ -490,10 +493,12 @@ def test_variant_filter_case_display_cancel(self): self.compile_url_and_login( {"project": self.case.project.sodar_uuid, "case": self.case.sodar_uuid} ) - # find & hit button - time.sleep(5) + # Wait until button is a submit button. + WebDriverWait(self.selenium, self.wait_time).until( + wait_for_the_attribute_value((By.ID, "submitFilter"), "data-event-type", "submit") + ) + # Find & hit button. button = self.selenium.find_element_by_id("submitFilter") - self.assertEqual(button.get_attribute("data-event-type"), "submit") button.click() WebDriverWait(self.selenium, self.wait_time).until( ec.presence_of_element_located((By.ID, "logger")) @@ -751,9 +756,12 @@ def test_variant_joint_filter_display_loading(self): """Test if submitting the filter initiates the loading response.""" # login self.compile_url_and_login({"project": self.project.sodar_uuid}) + # Wait until button is a submit button. + WebDriverWait(self.selenium, self.wait_time).until( + wait_for_the_attribute_value((By.ID, "submitFilter"), "data-event-type", "submit") + ) # find & hit button button = self.selenium.find_element_by_id("submitFilter") - self.assertEqual(button.get_attribute("data-event-type"), "submit") button.click() WebDriverWait(self.selenium, self.wait_time).until( ec.presence_of_element_located((By.ID, "logger")) @@ -767,9 +775,12 @@ def test_variant_joint_filter_display_cancel(self): """Test if submitting the filter can be canceled.""" # login self.compile_url_and_login({"project": self.project.sodar_uuid}) + # Wait until button is a submit button. + WebDriverWait(self.selenium, self.wait_time).until( + wait_for_the_attribute_value((By.ID, "submitFilter"), "data-event-type", "submit") + ) # find & hit button button = self.selenium.find_element_by_id("submitFilter") - self.assertEqual(button.get_attribute("data-event-type"), "submit") button.click() WebDriverWait(self.selenium, self.wait_time).until( ec.presence_of_element_located((By.ID, "logger"))