Skip to content

Commit

Permalink
Merge pull request #1103 from cityofaustin/jc-new-project-work-type
Browse files Browse the repository at this point in the history
Sets component work type when creating a signal project
  • Loading branch information
johnclary authored Aug 17, 2023
2 parents da0017f + d073de2 commit c45426c
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions moped-editor/src/utils/signalComponentHelpers.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,12 @@ import { TextField } from "@mui/material";
export const SOCRATA_ENDPOINT =
"https://data.austintexas.gov/resource/p53x-x73x.geojson?$select=signal_id,location_name,location,signal_type,id&$order=signal_id asc&$limit=9999";

/**
* An array to use as the default value for
* moped_proj_component_work_type: 7 = "New"
*/
const DEFAULT_SIGNAL_WORK_TYPE = [{ work_type_id: 7 }];

/**
* MUI autocomplete getOptionSelected function to which matches input signal value to
* select options.
Expand Down Expand Up @@ -176,5 +182,10 @@ export const generateProjectComponent = (
feature_signals: {
data: [signalRecord],
},
// create default value for component work type, which
// is a required field enforced through the UI
moped_proj_component_work_types: {
data: DEFAULT_SIGNAL_WORK_TYPE,
},
};
};

0 comments on commit c45426c

Please sign in to comment.