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

Well Driller/Pump Installer Registry - Qualified to Drill auto selection broken #1839

Open
carmenriddel opened this issue Jun 23, 2022 · 2 comments
Labels

Comments

@carmenriddel
Copy link

The auto selected "qualified to drill" section is not being auto populated when a classification is added to an existing driller/pump installer. It appears to work fine when a new one is added.

WHEN WAS IT IDENTIFIED?
January 2021

WHAT IS THE IMPACT?
Applications for registration as drillers or well pump installers are missing information required under the Act.

NOTES:
Identified during testing of OpenShift4 migration; however, issue exists in PROD.

https://apps.nrs.gov.bc.ca/int/jira/browse/WATER-1607

image-2021-03-31-11-59-16-211.png

@carmenriddel
Copy link
Author

Goulet, Dan [X] (Inactive) added a comment - 01/Apr/21 11:42 AM
Hi Macfarlane, Lindsay ENV:EX,

I've reviewed this and attempted to fix it.

I'd imagine this is larger than a 3, could be an 8.

I've provided more technical bits, where the issues are, and likely the things that need to be completed, in hopes of helping in the future:

Code:

Using current release branch

What is this?

The frontend component at registry/components/people/ApplicationAddEdit.vue supports viewing, adding and editing of Classification & Qualifications
The adding feature does not work
How to Reproduce:

get code, docker-compose up
http://localhost:8080/gwells/registries/people/d660ccb1-46d1-4e7a-93f3-0e77f71ecf24
you should see an existing well driller registration, click "add classification" button.
notice that you cannot select one of the select classification radio buttons and have the qualified to drill checkboxes automatically selected for you
select the existing driller, edit it, notice that you can select a classification and the applicable checkboxes automatically get selected for you (this should work on add, but it does not)
this is used in another location too when editing a registration (Lindsay showed me this)
Backend:

stack traces on attempting to save new classifications, regardless of whether or not the frontend code allows selection of classification/qualified to drill.
it appears the backend has an endpoint for this but this feature doesn't work, several errors (registries/serializers.py ApplicationAdminSerializer.create), register_guid violates not-null constraint, likely the value isn't being retrieved or set correctly in to_internal_value. registries/urls.py (url(api_path_prefix() + r'/applications/(?P<application_guid>[-\w]+)$',
never_cache(views.ApplicationDetailView.as_view()),
name='application-detail')), -> registries/views.py/ApplicationDetailView -> registries/serializers.py/ApplicationAdminSerializer.to_internal_value & create
did this work? seems like this entire feature is broken
Frontend:

issues with copying values around in registry/components/people/ApplicationAddEdit.vue in the copyFormData (notice that the copyFormData method is only consumed by the data () { return qualificationForm: this.copyFormData(this.value) } there's a watch named qualificationForm that has a handler, this watch (observable/reactivity) is broken when you use the Add feature. Putting a console.log in watch qualificationForm handler will demonstrate this (try the different scenarios such as view/edit/add and you'll notice the watch is broken only when registration occurs)
I found that a simple fix for the frontend in Add mode can be done by finding the line "if (input) {" in copyFormData (line 201 I believe) and changing it to "if (input && !input.registration) {" will make the selection boxes work as expected. Much to my dismay the backend didn't work either which adds further complexity to this fix and increases the risk/coverage/story points.

@QSu-2023 QSu-2023 added the bug label Jul 30, 2024
@QSu-2023
Copy link
Collaborator

This bug still persist:

Describe the Bug
When the Data Specialist is trying to edit the profile of an existing registry (well driller or well pump installer) with "Add classification", the auto select of "Qualified to drill" (Well Driller Registration) or "Qualified" (Pump Installer Registration) is not working after the Classification was selected.

This auto select works fine when creating a new registry.

Expected Behaviour
In the editing page of the existing driller/pump installer profile (Registry/Person Profile), when "add a classification", the "Qualified to drill"/"Qualified" will be auto selected according to the classification type I choose (Pump Installer, Water Well Driller, Geotechnical/Enviromental Driller, or Geoexchange Driller).

Actual Behaviour
In the editing page of the existing driller/pump installer profile (Registry/Person Profile), when "add a classification", nothing was auto selected in the "Qualified to drill"/"Qualified" after I select a classification type (Pump Installer, Water Well Driller, Geotechnical/Environmental Driller, or Geoexchange Driller). This auto select only works well when I am creating a new profile/registry.

** Steps To Reproduce**
Steps to reproduce the behaviour:

  1. Go to Registry' page, choose Well Driller(default) or Well Pump Installer, and then click the "Search" button to have the registries listed in the Results table
  2. Click on any of the registry's name to open the Registry/Person Profile page
  3. Scroll down and click the button "Add classification" under Well Driller Registration or Pump Installer Registration, then click to "Select classification".
  4. See error: Nothing was auto selected in the list of "Qualified to drill"/"Qualified"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants