Skip to content

Commit

Permalink
updated well_tags to self alphabetize
Browse files Browse the repository at this point in the history
  • Loading branch information
LocalNewsTV committed Nov 28, 2023
1 parent 9e5e855 commit f2df7c9
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
8 changes: 6 additions & 2 deletions app/frontend/src/common/constants.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,11 @@ export const WELL_TAGS_PUBLIC = [
{ text: "Well Decommission Report", value: "Well Decommission" },
{ text: "Well Pump Installation Report", value: "Well Pump Installation" },
{ text: "Other", value: "Additional Details" },
]
].sort((a,b) => {
if(a.text === 'Other') return 1;
if(b.text === 'Other') return -1;
a.text.toLowerCase().localeCompare(b.text.toLowerCase())
})

export const WELL_TAGS_PRIVATE = [
{ text: "Alternative Specifications", value: "Alternative Specs" },
Expand All @@ -26,7 +30,7 @@ export const WELL_TAGS_PRIVATE = [
{ text: "Signed Sharing Agreement", value: "Sharing Agreement" },
{ text: "Water Quality Report", value: "Water Quality" },
{ text: "Well Inspection Report", value: "Well Inspection" },
]
].sort((a,b) => a.text.toLowerCase().localeCompare(b.text.toLowerCase()))

export const WELL_TAGS = [
{
Expand Down
6 changes: 5 additions & 1 deletion app/frontend/src/wells/components/mixins/filters.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,11 @@ const SEARCH_FIELDS = {
param: "well_document_type",
label: "Contains document type",
type: "select",
options: [...WELL_TAGS_PUBLIC, ...WELL_TAGS_PRIVATE].sort((a,b) => a.text.toLowerCase()-b.text.toLowerCase())
options: [...WELL_TAGS_PUBLIC, ...WELL_TAGS_PRIVATE].sort((a,b) => {
if(a.text === 'Other') return 1;
if(b.text === 'Other') return -1;
return a.text.toLowerCase().localeCompare(b.text.toLowerCase())
})
},
streetOrCity: {
param: 'street_address_or_city',
Expand Down

0 comments on commit f2df7c9

Please sign in to comment.