Skip to content

Commit

Permalink
Merge branch 'release' into feat/gwells-2094
Browse files Browse the repository at this point in the history
  • Loading branch information
sanjaytkbabu committed Jan 24, 2024
2 parents 67dcb0e + 5fdf690 commit f310685
Show file tree
Hide file tree
Showing 10 changed files with 22 additions and 95 deletions.
6 changes: 1 addition & 5 deletions app/backend/wells/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,9 +114,5 @@

# Well Licensing status endpoint from e-Licensing.
url(api_path_prefix() + r'/wells/licensing$',
views.well_licensing, name='well-licensing'),

# get geocoder address
url(api_path_prefix() + r'/wells/geocoder$',
views.AddressGeocoder.as_view(), name='address-geocoder'),
views.well_licensing, name='well-licensing')
]
12 changes: 0 additions & 12 deletions app/backend/wells/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -893,15 +893,3 @@ def get_queryset(self):
qs = qs.filter(well_tag_number__in=wells)

return qs
class AddressGeocoder(APIView):
def get(self, request,**kwargs):
GEOCODER_ADDRESS_URL = get_env_variable('GEOCODER_ADDRESS_API_BASE') + self.request.query_params.get('searchTag')
response = requests.get(GEOCODER_ADDRESS_URL)
# Check if the request was successful (status code 200)
if response.status_code == 200:
data = response.json()
# Create a Django JsonResponse object and return it
return JsonResponse(data)
else:
# If the request was not successful, return an appropriate HTTP response
return JsonResponse({'error': f"Error: {response.status_code} - {response.text}"}, status=500)
5 changes: 3 additions & 2 deletions app/frontend/src/aquifers/components/View.vue
Original file line number Diff line number Diff line change
Expand Up @@ -505,8 +505,9 @@
<i id="aquiferNotations" tabindex="0" class="fa fa-question-circle color-info fa-xs pt-0 mt-0 d-print-none"></i>
<b-popover
target="aquiferNotations"
triggers="hover focus"
content="Water allocation notations are a water management tool that indicates a potential lack of water availability/quality in a source."/>
triggers="hover focus">
<p>Water allocation notations are a water management tool that indicates a potential lack of water availability/quality in a source. For details click <a href="https://www2.gov.bc.ca/gov/content/environment/air-land-water/water/water-licensing-rights/water-allocation-notations">here</a>.</p>
</b-popover>
</dt>
<dd class="m-0">{{ aquiferNotations || 'No notation currently assigned.' }}</dd>
</dl>
Expand Down
3 changes: 0 additions & 3 deletions app/frontend/src/common/services/ApiService.js
Original file line number Diff line number Diff line change
Expand Up @@ -94,9 +94,6 @@ const ApiService = {
incrementFileCount(resource, documentType){
return axios.get(`${resource}/sum`, {params: { inc: true, documentType}})
},
getAddresses(searchTag){
return axios.get(`wells/geocoder`, {params: { searchTag: searchTag }})
},
}

export default ApiService
Original file line number Diff line number Diff line change
Expand Up @@ -38,23 +38,10 @@ Licensed under the Apache License, Version 2.0 (the "License");
id="wellStreetAddress"
type="text"
label="Street address"
@input="fetchAddressSuggestions"
v-on:focus="showList(true)"
v-on:blur="showList(false)"
:errors="errors['street_address']"
:loaded="fieldsLoaded['street_address']"
:disabled="sameAsOwnerAddress"
></form-input>
<!-- Display the address suggestions -->
<div v-if="addressSuggestions.length > 0" class="address-suggestions list-group list-group-flush border" id="location-address-suggestions-list">
<div v-for="(suggestion, index) in addressSuggestions" :key="index">
<button @mousedown="selectAddressSuggestion(suggestion)" class="list-group-item list-group-item-action border-0">{{ suggestion }}</button>
</div>
</div>
<!-- Display a loading indicator while fetching suggestions -->
<div v-if="isLoadingSuggestions" class="loading-indicator">
Loading...
</div>
</b-col>
</b-row>
<b-row>
Expand Down Expand Up @@ -215,9 +202,10 @@ Licensed under the Apache License, Version 2.0 (the "License");
</template>
<script>
import { mapGetters } from 'vuex'
import inputBindingsMixin from '@/common/inputBindingsMixin.js'
import BackToTopLink from '@/common/components/BackToTopLink.vue'
import ApiService from '../../../common/services/ApiService'
export default {
name: 'Location',
Expand Down Expand Up @@ -384,9 +372,4 @@ export default {
.dropdown-error-border {
border-radius: 5px;
}
.address-suggestions {
list-style-type: none;
position: absolute;
z-index: 10;
}
</style>
38 changes: 5 additions & 33 deletions app/frontend/src/submissions/components/SubmissionForm/Owner.vue
Original file line number Diff line number Diff line change
Expand Up @@ -27,35 +27,10 @@ Licensed under the Apache License, Version 2.0 (the "License");

<b-row>
<b-col cols="12" md="6">
<form-input
id="ownerFullName"
label="Well Owner Name"
v-model="ownerFullNameInput"
:errors="errors['owner_full_name']"
:loaded="fieldsLoaded['owner_full_name']"
></form-input>
<form-input id="ownerFullName" label="Well Owner Name" v-model="ownerFullNameInput" :errors="errors['owner_full_name']" :loaded="fieldsLoaded['owner_full_name']"></form-input>
</b-col>
<b-col cols="12" md="6">
<form-input
id="ownerMailingAddress"
label="Owner Mailing Address"
v-model="ownerAddressInput"
@input="fetchAddressSuggestions"
v-on:focus="showList(true)"
v-on:blur="showList(false)"
:errors="errors['owner_mailing_address']"
:loaded="fieldsLoaded['owner_mailing_address']">
</form-input>
<!-- Display the address suggestions -->
<div v-if="addressSuggestions.length > 0" class="address-suggestions list-group list-group-flush border" id="owner-address-suggestions-list">
<div v-for="(suggestion, index) in addressSuggestions" :key="index">
<button @mousedown="selectAddressSuggestion(suggestion)" class="list-group-item list-group-item-action border-0">{{ suggestion }}</button>
</div>
</div>
<!-- Display a loading indicator while fetching suggestions -->
<div v-if="isLoadingSuggestions" class="loading-indicator">
Loading...
</div>
<form-input id="ownerMailingAddress" label="Owner Mailing Address" v-model="ownerAddressInput" :errors="errors['owner_mailing_address']" :loaded="fieldsLoaded['owner_mailing_address']"></form-input>
</b-col>
</b-row>
<b-row>
Expand Down Expand Up @@ -110,10 +85,11 @@ Licensed under the Apache License, Version 2.0 (the "License");

<script>
import { mapGetters } from 'vuex'
import inputBindingsMixin from '@/common/inputBindingsMixin.js'
import inputFormatMixin from '@/common/inputFormatMixin.js'
import BackToTopLink from '@/common/components/BackToTopLink.vue'
import ApiService from '../../../common/services/ApiService'
export default {
mixins: [inputBindingsMixin, inputFormatMixin],
Expand Down Expand Up @@ -259,9 +235,5 @@ export default {
</script>

<style>
.address-suggestions {
list-style-type: none;
position: absolute;
z-index: 10;
}
</style>
Original file line number Diff line number Diff line change
Expand Up @@ -1249,10 +1249,19 @@ exports[`View Component View mode matches the snapshot 1`] = `
/>
<b-popover-stub
content="Water allocation notations are a water management tool that indicates a potential lack of water availability/quality in a source."
target="aquiferNotations"
triggers="hover focus"
/>
>
<p>
Water allocation notations are a water management tool that indicates a potential lack of water availability/quality in a source. For details click
<a
href="https://www2.gov.bc.ca/gov/content/environment/air-land-water/water/water-licensing-rights/water-allocation-notations"
>
here
</a>
.
</p>
</b-popover-stub>
</dt>
<dd
Expand Down
1 change: 0 additions & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,6 @@ services:
S3_WELL_EXPORT_BUCKET: gwells
S3_USE_SECURE: 0
EMAIL_NOTIFICATION_RECIPIENT: [email protected]
GEOCODER_ADDRESS_API_BASE: https://geocoder.api.gov.bc.ca/addresses.json?
command: /bin/bash -c "
sleep 3 &&
set -x &&
Expand Down
9 changes: 0 additions & 9 deletions openshift/backend.dc.json
Original file line number Diff line number Diff line change
Expand Up @@ -733,15 +733,6 @@
{
"name": "ENFORCE_ENV_VARIABLES",
"value": "False"
},
{
"name": "GEOCODER_ADDRESS_API_BASE",
"valueFrom": {
"configMapKeyRef": {
"key": "GEOCODER_ADDRESS_API_BASE",
"name": "gwells-global-config${NAME_SUFFIX}"
}
}
}
],
"resources": {
Expand Down
9 changes: 0 additions & 9 deletions openshift/ocp4/backend.dc.json
Original file line number Diff line number Diff line change
Expand Up @@ -742,15 +742,6 @@
"name": "gwells-global-config${NAME_SUFFIX}"
}
}
},
{
"name": "GEOCODER_ADDRESS_API_BASE",
"valueFrom": {
"configMapKeyRef": {
"key": "GEOCODER_ADDRESS_API_BASE",
"name": "gwells-global-config${NAME_SUFFIX}"
}
}
}
],
"resources": {
Expand Down

0 comments on commit f310685

Please sign in to comment.