Skip to content

Commit

Permalink
Merge pull request #1435 from cityofaustin/13602_multiple_nodata_options
Browse files Browse the repository at this point in the history
Multiple NO DATA options in Body Style edit drop down
  • Loading branch information
roseeichelmann authored May 1, 2024
2 parents a450e47 + ce3ad1a commit afa505a
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 5 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
INSERT INTO public.atd_txdot__veh_body_styl_lkp(veh_body_styl_id, veh_body_styl_desc) VALUES (-1, 'NO DATA');
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
-- Remove the custom "NO DATA" lookup option, instead we should just use null to mean null
DELETE FROM public.atd_txdot__veh_body_styl_lkp WHERE veh_body_styl_id = -1;

UPDATE public.atd_txdot_units SET veh_body_styl_id = null WHERE veh_body_styl_id = -1;
8 changes: 3 additions & 5 deletions atd-vze/src/views/Crashes/RelatedRecordsTable.js
Original file line number Diff line number Diff line change
Expand Up @@ -208,10 +208,7 @@ const RelatedRecordsTable = ({
}
type="select"
>
{/* Show a NO DATA option only when formatValue is displayed. */}
{formatValue(row, field) === "NO DATA" && (
<option value={null}>NO DATA</option>
)}
<option value={""}>NO DATA</option>
{lookupOptions[
fieldConfig.fields[field].lookupOptions
].map(option => {
Expand Down Expand Up @@ -271,7 +268,8 @@ const RelatedRecordsTable = ({
)}

{!isEditing &&
(fieldConfig.fields[field].badge ? (
(fieldConfig.fields[field].badge &&
formatValue(row, field) !== "NO DATA" ? (
<Badge
color={fieldConfig.fields[field].badgeColor(
row
Expand Down

0 comments on commit afa505a

Please sign in to comment.