Skip to content

Commit

Permalink
Merge pull request #2047 from bcgov/bug/aquifer-search-and-registry-a…
Browse files Browse the repository at this point in the history
…ttachment

[HOTFIX][NRPTI-2038/2043]** Bug fix for aquifer search link and registry attachments
  • Loading branch information
davidclaveau authored Nov 11, 2023
2 parents f68d110 + 8688794 commit 117717f
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 9 deletions.
6 changes: 3 additions & 3 deletions app/backend/gwells/documents.py
Original file line number Diff line number Diff line change
Expand Up @@ -135,19 +135,19 @@ def create_url_list(self, objects, host, bucket_name, private=False):
def extract_well_number(self, object_name):
try:
return re.findall(r'\d+', unquote_plus(object_name).rsplit('/', 1)[-1].split("_")[0])[0]
except IndexError:
except Exception:
return "Unknown"

def extract_date_of_upload(self, object_name):
try:
return int(unquote_plus(object_name).rsplit('/', 1)[-1].split("_")[2].split(".")[0].strip())
except IndexError:
except Exception:
return -1

def extract_well_label(self, object_name):
try:
return unquote_plus(object_name).rsplit('/', 1)[-1].split("_")[1]
except IndexError:
except Exception:
return ""

def get_bucket_folder(self, document_id, resource='well'):
Expand Down
6 changes: 3 additions & 3 deletions app/frontend/src/aquifers/components/Search.vue
Original file line number Diff line number Diff line change
Expand Up @@ -140,13 +140,13 @@
v-if="searchPerformed"
:tbody-tr-class="searchResultsRowClass"
responsive>
<template slot="id" slot-scope="row">
<template v-slot:cell(id)="row">
<router-link :to="{ name: 'aquifers-view', params: {id: row.item.aquifer_id} }">{{ row.item.aquifer_id }}</router-link>
</template>
<template slot="name" slot-scope="row">
<template v-slot:cell(name)="row">
{{row.item.name}}
</template>
<template slot="retire_date" slot-scope="row">
<template v-slot:cell(retire_date)="row">
<span :title="row.item.retire_date">{{ row.item.retire_date | moment("MMMM Do YYYY [at] LT") }}</span>
</template>
<template v-slot:table-busy>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -486,19 +486,33 @@ exports[`Search Component Matches the snapshot 1`] = `
aria-colindex="1"
class=""
role="cell"
/>
>
<router-link-stub
to="[object Object]"
>
4
</router-link-stub>
</td>
<td
aria-colindex="2"
class=""
role="cell"
>
2020-01-01
<span
title="2020-01-01"
>
January 1st 2020 at 12:00 AM
</span>
</td>
<td
aria-colindex="3"
class=""
role="cell"
/>
>
</td>
<td
aria-colindex="4"
class=""
Expand Down

0 comments on commit 117717f

Please sign in to comment.