diff --git a/atd-vzd/migrations/default/1712941514048_delete_no_data_option/down.sql b/atd-vzd/migrations/default/1712941514048_delete_no_data_option/down.sql new file mode 100644 index 000000000..77cd5693e --- /dev/null +++ b/atd-vzd/migrations/default/1712941514048_delete_no_data_option/down.sql @@ -0,0 +1 @@ +INSERT INTO public.atd_txdot__veh_body_styl_lkp(veh_body_styl_id, veh_body_styl_desc) VALUES (-1, 'NO DATA'); diff --git a/atd-vzd/migrations/default/1712941514048_delete_no_data_option/up.sql b/atd-vzd/migrations/default/1712941514048_delete_no_data_option/up.sql new file mode 100644 index 000000000..135b299d6 --- /dev/null +++ b/atd-vzd/migrations/default/1712941514048_delete_no_data_option/up.sql @@ -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; diff --git a/atd-vze/src/views/Crashes/RelatedRecordsTable.js b/atd-vze/src/views/Crashes/RelatedRecordsTable.js index d374448f7..2dcc7cc47 100644 --- a/atd-vze/src/views/Crashes/RelatedRecordsTable.js +++ b/atd-vze/src/views/Crashes/RelatedRecordsTable.js @@ -208,10 +208,7 @@ const RelatedRecordsTable = ({ } type="select" > - {/* Show a NO DATA option only when formatValue is displayed. */} - {formatValue(row, field) === "NO DATA" && ( - - )} + {lookupOptions[ fieldConfig.fields[field].lookupOptions ].map(option => { @@ -271,7 +268,8 @@ const RelatedRecordsTable = ({ )} {!isEditing && - (fieldConfig.fields[field].badge ? ( + (fieldConfig.fields[field].badge && + formatValue(row, field) !== "NO DATA" ? (