diff --git a/atd-vzd/migrations/default/1699990226463_alter_table_public_atd_txdot_person_add_column_peh_fl/down.sql b/atd-vzd/migrations/default/1699990226463_alter_table_public_atd_txdot_person_add_column_peh_fl/down.sql new file mode 100644 index 000000000..acc2c7a8e --- /dev/null +++ b/atd-vzd/migrations/default/1699990226463_alter_table_public_atd_txdot_person_add_column_peh_fl/down.sql @@ -0,0 +1,2 @@ +ALTER TABLE public.atd_txdot_person +DROP COLUMN IF EXISTS peh_fl; diff --git a/atd-vzd/migrations/default/1699990226463_alter_table_public_atd_txdot_person_add_column_peh_fl/up.sql b/atd-vzd/migrations/default/1699990226463_alter_table_public_atd_txdot_person_add_column_peh_fl/up.sql new file mode 100644 index 000000000..318bd7858 --- /dev/null +++ b/atd-vzd/migrations/default/1699990226463_alter_table_public_atd_txdot_person_add_column_peh_fl/up.sql @@ -0,0 +1,4 @@ +alter table "public"."atd_txdot_person" add column "peh_fl" boolean + null; + +COMMENT ON COLUMN public.atd_txdot_person.peh_fl IS 'Boolean flag that indicates whether the person was experiencing homelessness at the time of the crash.'; diff --git a/atd-vzd/migrations/default/1699990248367_alter_table_public_atd_txdot_primaryperson_add_column_peh_fl/down.sql b/atd-vzd/migrations/default/1699990248367_alter_table_public_atd_txdot_primaryperson_add_column_peh_fl/down.sql new file mode 100644 index 000000000..ebcfdb714 --- /dev/null +++ b/atd-vzd/migrations/default/1699990248367_alter_table_public_atd_txdot_primaryperson_add_column_peh_fl/down.sql @@ -0,0 +1,2 @@ +ALTER TABLE public.atd_txdot_primaryperson +DROP COLUMN IF EXISTS peh_fl; diff --git a/atd-vzd/migrations/default/1699990248367_alter_table_public_atd_txdot_primaryperson_add_column_peh_fl/up.sql b/atd-vzd/migrations/default/1699990248367_alter_table_public_atd_txdot_primaryperson_add_column_peh_fl/up.sql new file mode 100644 index 000000000..44bbadd74 --- /dev/null +++ b/atd-vzd/migrations/default/1699990248367_alter_table_public_atd_txdot_primaryperson_add_column_peh_fl/up.sql @@ -0,0 +1,4 @@ +alter table "public"."atd_txdot_primaryperson" add column "peh_fl" boolean + null; + +COMMENT ON COLUMN public.atd_txdot_primaryperson.peh_fl IS 'Boolean flag that indicates whether the person was experiencing homelessness at the time of the crash.'; diff --git a/atd-vze/src/queries/people.js b/atd-vze/src/queries/people.js index d591fc976..e6def75c2 100644 --- a/atd-vze/src/queries/people.js +++ b/atd-vze/src/queries/people.js @@ -25,6 +25,7 @@ export const GET_PEOPLE = gql` ethnicity_desc } unit_nbr + peh_fl } atd_txdot_person(where: { crash_id: { _eq: $crashId } }) { prsn_age @@ -47,6 +48,7 @@ export const GET_PEOPLE = gql` ethnicity_desc } unit_nbr + peh_fl } } `; diff --git a/atd-vze/src/views/Crashes/RelatedRecordsTable.js b/atd-vze/src/views/Crashes/RelatedRecordsTable.js index ccdbdbc89..cfb5e50b5 100644 --- a/atd-vze/src/views/Crashes/RelatedRecordsTable.js +++ b/atd-vze/src/views/Crashes/RelatedRecordsTable.js @@ -79,6 +79,10 @@ const RelatedRecordsTable = ({ if (typeof data[field] === "object") { fieldValue = data[field] && data[field][fieldConfig.fields[field].lookup_desc]; + } else if (data[field] === true) { + fieldValue = "YES"; + } else if (data[field] === false) { + fieldValue = "NO"; } // Display null values as blanks, but allow 0 @@ -228,6 +232,19 @@ const RelatedRecordsTable = ({ })} )} + {uiType === "boolean" && ( + + handleInputChange(e, updateFieldKey) + } + > + + + + + )}