Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions stormpiper/stormpiper/spa/src/components/bmpForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ import React, {
import { useForm } from "react-hook-form";
import { BMPReadOnlyInfo } from "./bmp-detail-page/bmp-basic-info";
import { KCBMPDetailModal } from "./cost-estimator/kc-estimator-modal";
import { fieldAlias } from "./fieldAlias";

const hiddenFields: string[] = [
"ref_data_key",
Expand Down Expand Up @@ -183,7 +184,7 @@ export const BMPForm = forwardRef(function BMPForm(props: formProps, ref) {
if (!hiddenFields.includes(k)) {
let fieldObj = {
fieldID: k,
label: v.title,
label: fieldAlias?.[k] || v.title,
type: overrides?.type
? overrides.type
: typeof v?.type === "string" || v?.type instanceof String
Expand Down Expand Up @@ -385,7 +386,8 @@ export const BMPForm = forwardRef(function BMPForm(props: formProps, ref) {
...formField.adornment,
}}
disabled={
(formField.label === "Node Id" && showSubmit) || formDisabled //having showSubmit disabled the field is a workaround to disable it only in the scenario version of this form
(formField.fieldID === "node_id" && showSubmit) ||
formDisabled //having showSubmit disabled the field is a workaround to disable it only in the scenario version of this form
}
onClick={() => setIsTouched(true)}
/>
Expand Down
7 changes: 7 additions & 0 deletions stormpiper/stormpiper/spa/src/components/fieldAlias.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
export const fieldAlias = {
node_id: "Facility ID",
basinname: "Watershed",
node_type: "Modeling Approach",
facility_type: "Facility Type (Modeled)",
facilitytype: "Facility Type (Tacoma GIS)",
};
Loading