diff --git a/docker-compose.yml b/docker-compose.yml index 060a25e9f..0953313ac 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -107,7 +107,7 @@ services: - .env environment: FLASK_SECRET_KEY: "${FLASK_SECRET_KEY}" - ICBC_API_ROOT: "http://icbc_mock_svc:5000/vips/icbc" + ICBC_API_ROOT: "${ICBC_API_ROOT}" ICBC_LOGIN_USER_ID: "${ICBC_LOGIN_USER_ID}" ICBC_API_USERNAME: "${ICBC_API_USERNAME}" ICBC_API_PASSWORD: "${ICBC_API_PASSWORD}" diff --git a/python/prohibition_web_svc/blueprints/events.py b/python/prohibition_web_svc/blueprints/events.py index a37bc811b..6982cb1cc 100644 --- a/python/prohibition_web_svc/blueprints/events.py +++ b/python/prohibition_web_svc/blueprints/events.py @@ -51,7 +51,6 @@ def create(): """ # logging.debug("new event post: {}".format(request.data)) if request.method == 'POST': - logging.debug("-------------Made it here---------------") kwargs = middle_logic( get_authorized_keycloak_user() + [ {"try": event_middleware.request_contains_a_payload, "fail": [ diff --git a/python/prohibition_web_svc/middleware/icbc_middleware.py b/python/prohibition_web_svc/middleware/icbc_middleware.py index 0a70fe92c..2dba6e0f0 100644 --- a/python/prohibition_web_svc/middleware/icbc_middleware.py +++ b/python/prohibition_web_svc/middleware/icbc_middleware.py @@ -24,7 +24,11 @@ def get_icbc_driver(**kwargs) -> tuple: url = "{}/drivers/{}".format(Config.ICBC_API_ROOT, kwargs.get('dl_number')) try: icbc_response = requests.get(url, headers=kwargs.get('icbc_header')) - kwargs['response'] = make_response(icbc_response.json(), icbc_response.status_code) + logging.debug(icbc_response.status_code) + if icbc_response.status_code == 400: + kwargs['response'] = make_response({}, 200) + else: + kwargs['response'] = make_response(icbc_response.json(), icbc_response.status_code) except Exception as e: return False, kwargs return True, kwargs @@ -40,6 +44,9 @@ def get_icbc_vehicle(**kwargs) -> tuple: try: icbc_response = requests.get(url, headers=kwargs.get('icbc_header'), params=url_parameters) logging.warning("icbc url:" + icbc_response.url) + logging.debug("---------------------------Made it here---------------------------") + logging.debug(icbc_response.json()) + logging.debug("------------------------------------------------------------------") kwargs['response'] = make_response(icbc_response.json(), icbc_response.status_code) except Exception as e: return False, kwargs diff --git a/roadside-forms-frontend/frontend_web_app/package-lock.json b/roadside-forms-frontend/frontend_web_app/package-lock.json index 167703f29..0ee3eb4f7 100644 --- a/roadside-forms-frontend/frontend_web_app/package-lock.json +++ b/roadside-forms-frontend/frontend_web_app/package-lock.json @@ -20,6 +20,7 @@ "formik": "^2.2.9", "html-to-image": "^1.11.11", "keycloak-js": "^21.0.1", + "lodash": "^4.17.21", "moment-timezone": "^0.5.34", "nth-check": "^2.0.1", "postcss": "^8.2.4", diff --git a/roadside-forms-frontend/frontend_web_app/package.json b/roadside-forms-frontend/frontend_web_app/package.json index 855a9a610..cdb9e7fff 100644 --- a/roadside-forms-frontend/frontend_web_app/package.json +++ b/roadside-forms-frontend/frontend_web_app/package.json @@ -16,6 +16,7 @@ "formik": "^2.2.9", "html-to-image": "^1.11.11", "keycloak-js": "^21.0.1", + "lodash": "^4.17.21", "moment-timezone": "^0.5.34", "nth-check": "^2.0.1", "postcss": "^8.2.4", diff --git a/roadside-forms-frontend/frontend_web_app/src/api/icbcDriverDataAPI.js b/roadside-forms-frontend/frontend_web_app/src/api/icbcDriverDataAPI.js new file mode 100644 index 000000000..2be8d4534 --- /dev/null +++ b/roadside-forms-frontend/frontend_web_app/src/api/icbcDriverDataAPI.js @@ -0,0 +1,17 @@ +import { api } from "./config/axiosConfig"; +import { createRequestHeader } from "../utils/requestHeaders"; + +export const ICBCDriverDataApi = { + get: async function (driver_licence_no) { + const headers = { + ...createRequestHeader(), + }; + const response = await api.request({ + url: `/api/v1/icbc/drivers/${driver_licence_no}`, + method: "GET", + headers: { ...headers }, + }); + console.log(response); + return response; + }, +}; diff --git a/roadside-forms-frontend/frontend_web_app/src/api/icbcVehicleDataApi.js b/roadside-forms-frontend/frontend_web_app/src/api/icbcVehicleDataApi.js new file mode 100644 index 000000000..0060718cc --- /dev/null +++ b/roadside-forms-frontend/frontend_web_app/src/api/icbcVehicleDataApi.js @@ -0,0 +1,17 @@ +import { api } from "./config/axiosConfig"; +import { createRequestHeader } from "../utils/requestHeaders"; + +export const ICBCVehicleDataApi = { + get: async function (licencePlate) { + const headers = { + ...createRequestHeader(), + }; + const response = await api.request({ + url: `/api/v1/icbc/vehicles/${licencePlate}`, + method: "GET", + headers: { ...headers }, + }); + console.log(response); + return response.data; + }, +}; diff --git a/roadside-forms-frontend/frontend_web_app/src/assets/MV2634E_082023_Driver.png b/roadside-forms-frontend/frontend_web_app/src/assets/MV2634E_082023_Driver.png deleted file mode 100644 index b30c622ec..000000000 Binary files a/roadside-forms-frontend/frontend_web_app/src/assets/MV2634E_082023_Driver.png and /dev/null differ diff --git a/roadside-forms-frontend/frontend_web_app/src/assets/MV2634E_082023_ILO.png b/roadside-forms-frontend/frontend_web_app/src/assets/MV2634E_082023_ILO.png deleted file mode 100644 index 55b102db9..000000000 Binary files a/roadside-forms-frontend/frontend_web_app/src/assets/MV2634E_082023_ILO.png and /dev/null differ diff --git a/roadside-forms-frontend/frontend_web_app/src/assets/MV2634E_082023_Police.png b/roadside-forms-frontend/frontend_web_app/src/assets/MV2634E_082023_Police.png deleted file mode 100644 index d692dffde..000000000 Binary files a/roadside-forms-frontend/frontend_web_app/src/assets/MV2634E_082023_Police.png and /dev/null differ diff --git a/roadside-forms-frontend/frontend_web_app/src/assets/MV2634_102018_driver.png b/roadside-forms-frontend/frontend_web_app/src/assets/MV2634_102018_driver.png deleted file mode 100644 index e89e84c71..000000000 Binary files a/roadside-forms-frontend/frontend_web_app/src/assets/MV2634_102018_driver.png and /dev/null differ diff --git a/roadside-forms-frontend/frontend_web_app/src/assets/MV2634_102018_police.png b/roadside-forms-frontend/frontend_web_app/src/assets/MV2634_102018_police.png deleted file mode 100644 index 00582e44c..000000000 Binary files a/roadside-forms-frontend/frontend_web_app/src/assets/MV2634_102018_police.png and /dev/null differ diff --git a/roadside-forms-frontend/frontend_web_app/src/assets/MV2722_201502_Incident_Details.png b/roadside-forms-frontend/frontend_web_app/src/assets/MV2722_201502_Incident_Details.png new file mode 100644 index 000000000..1a797b151 Binary files /dev/null and b/roadside-forms-frontend/frontend_web_app/src/assets/MV2722_201502_Incident_Details.png differ diff --git a/roadside-forms-frontend/frontend_web_app/src/components/CommonForm/driverInfo.js b/roadside-forms-frontend/frontend_web_app/src/components/CommonForm/driverInfo.js index 16ddc444c..05b071b16 100644 --- a/roadside-forms-frontend/frontend_web_app/src/components/CommonForm/driverInfo.js +++ b/roadside-forms-frontend/frontend_web_app/src/components/CommonForm/driverInfo.js @@ -2,6 +2,7 @@ import { Input } from "../common/Input/Input"; import React, { useState, useEffect } from "react"; import { SearchableSelect } from "../common/Select/SearchableSelect"; import PropTypes from "prop-types"; +import _ from "lodash"; import Button from "react-bootstrap/Button"; import Row from "react-bootstrap/Row"; import Col from "react-bootstrap/Col"; @@ -12,10 +13,11 @@ import { useFormikContext } from "formik"; import "./commonForm.scss"; import Modal from "react-bootstrap/Modal"; import { dlScanner } from "../../utils/dlScanner"; +import { ICBCDriverDataApi } from "../../api/icbcDriverDataAPI"; export const DriverInfo = (props) => { const { jurisdictions, provinces } = props; - const { values } = useFormikContext(); + const { values, setFieldValue } = useFormikContext(); const [disableBtn, setdisableBtn] = useState(true); const [modalShow, setModalShow] = useState(false); const [scannerOpened, setScannerOpened] = useState(false); @@ -81,6 +83,23 @@ export const DriverInfo = (props) => { }); }; + const fetchICBCDriverInfo = () => { + if (values["driver_licence_no"]) { + ICBCDriverDataApi.get(values["driver_licence_no"]).then((resp) => { + if (!_.isEmpty(resp.data)) { + const party = resp.data.party; + const address = party.addresses[0]; + setFieldValue("driver_last_name", party.lastName); + setFieldValue("driver_given_name", party.firstName); + setFieldValue("driver_dob", new Date(party.birthDate)); + setFieldValue("driver_address", address.addressLine1); + setFieldValue("driver_city", address.city); + setFieldValue("driver_postal", address.postalCode); + } + }); + } + }; + // Create conditional check for 12h return ( <> @@ -123,6 +142,7 @@ export const DriverInfo = (props) => { className="slim-button" variant="primary" disabled={disableBtn} + onClick={() => fetchICBCDriverInfo()} > ICBC Prefill @@ -250,6 +270,7 @@ export const DriverInfo = (props) => { ); }; + DriverInfo.propTypes = { jurisdictions: PropTypes.array.isRequired, provinces: PropTypes.array.isRequired, diff --git a/roadside-forms-frontend/frontend_web_app/src/components/CommonForm/vehicleInfo.js b/roadside-forms-frontend/frontend_web_app/src/components/CommonForm/vehicleInfo.js index 9db225328..4956c0270 100644 --- a/roadside-forms-frontend/frontend_web_app/src/components/CommonForm/vehicleInfo.js +++ b/roadside-forms-frontend/frontend_web_app/src/components/CommonForm/vehicleInfo.js @@ -1,11 +1,13 @@ import "./commonForm.scss"; import PropTypes from "prop-types"; import React, { useState, useEffect } from "react"; +import _ from "lodash"; import { Input } from "../common/Input/Input"; import { SearchableSelect } from "../common/Select/SearchableSelect"; import { useFormikContext } from "formik"; import Button from "react-bootstrap/Button"; import { MultiSelectField } from "../common/Select/MultiSelectField"; +import { ICBCVehicleDataApi } from "../../api/icbcVehicleDataApi"; export const VehicleInfo = (props) => { const { @@ -16,7 +18,7 @@ export const VehicleInfo = (props) => { jurisdictions, provinces, } = props; - const { values } = useFormikContext(); + const { values, setFieldValue } = useFormikContext(); const [disableBtn, setdisableBtn] = useState(true); const driversLicenceJurisdiction = values["vehicle_jurisdiction"]; @@ -31,6 +33,21 @@ export const VehicleInfo = (props) => { } }, [driversLicenceJurisdiction]); + const fetchICBCVehicleInfo = () => { + // if (values["vehicle_plate_no"]) { + // ICBCVehicleDataApi.get(values["vehicle_plate_no"]).then((resp) => { + // if (!_.isEmpty(resp.data)) { + // setFieldValue("driver_last_name", party.lastName); + // setFieldValue("driver_given_name", party.firstName); + // setFieldValue("driver_dob", new Date(party.birthDate)); + // setFieldValue("driver_address", address.addressLine1); + // setFieldValue("driver_city", address.city); + // setFieldValue("driver_postal", address.postalCode); + // } + // }); + // } + }; + return (

Vehicle Information

@@ -57,6 +74,7 @@ export const VehicleInfo = (props) => { className="slim-button" variant="primary" disabled={disableBtn} + onClick={() => fetchICBCVehicleInfo()} > ICBC Prefill diff --git a/roadside-forms-frontend/frontend_web_app/src/components/Dashboard/Dashboard.js b/roadside-forms-frontend/frontend_web_app/src/components/Dashboard/Dashboard.js index b2ef92c33..146981d5c 100644 --- a/roadside-forms-frontend/frontend_web_app/src/components/Dashboard/Dashboard.js +++ b/roadside-forms-frontend/frontend_web_app/src/components/Dashboard/Dashboard.js @@ -12,7 +12,6 @@ import { eventObjectFlatener, eventDataFormatter, } from "../../utils/helpers"; -import { eventDataUpsert } from "../../utils/dbHelpers"; import { convertToPST } from "../../utils/dateTime"; import { StaticDataApi } from "../../api/staticDataApi"; import { Button } from "../common/Button/Button"; diff --git a/roadside-forms-frontend/frontend_web_app/src/components/Event/createEvent.js b/roadside-forms-frontend/frontend_web_app/src/components/Event/createEvent.js index b79683eb7..25c089a0a 100644 --- a/roadside-forms-frontend/frontend_web_app/src/components/Event/createEvent.js +++ b/roadside-forms-frontend/frontend_web_app/src/components/Event/createEvent.js @@ -291,6 +291,9 @@ export const CreateEvent = () => { if (form === "ILO" && values["vehicle_impounded"] === "NO") { break; } + if (form === "DETAILS" && !values["incident_details_extra_page"]) { + break; + } components.push( { console.log(errors); onSubmit(values); }} + disabled={isSubmitting} > Submit diff --git a/roadside-forms-frontend/frontend_web_app/src/components/Forms/Print/print_layout.json b/roadside-forms-frontend/frontend_web_app/src/components/Forms/Print/print_layout.json index 0c8d99af9..4373131d7 100644 --- a/roadside-forms-frontend/frontend_web_app/src/components/Forms/Print/print_layout.json +++ b/roadside-forms-frontend/frontend_web_app/src/components/Forms/Print/print_layout.json @@ -1844,14 +1844,14 @@ "INCIDENT_DETAILS_ATTACHED": { "field_type": "checkbox", "field_name": "incident_details_extra_page", - "field_val": "", + "field_val": "true", "classNames": "fontSmall", "start": { "x": 98.5, "y": 139 } }, - "INCIDENT_DETAILS": { + "REPORT_INCIDENT_DETAILS": { "field_type": "textArea", "field_name": "incident_details", "classNames": "fontXXSmall textArea", @@ -1860,6 +1860,15 @@ "y": 144 } }, + "DETAILS_INCIDENT_DETAILS": { + "field_type": "textArea", + "field_name": "incident_details", + "classNames": "fontXXSmall textArea", + "start": { + "x": 52.75, + "y": 30 + } + }, "REPORT_OFFICER_LAST_NAME": { "field_type": "text", "field_name": "officer-lastname", @@ -1904,6 +1913,51 @@ "x": 130, "y": 178.5 } + }, + "DETAILS_OFFICER_LAST_NAME": { + "field_type": "text", + "field_name": "officer-lastname", + "classNames": "fontXSmall", + "start": { + "x": 52.75, + "y": 173.75 + } + }, + "DETAILS_OFFICER_SIGNATURE": { + "field_type": "text", + "field_name": "officer-lastname", + "classNames": "fontXSmall", + "start": { + "x": 96, + "y": 173.75 + } + }, + "DETAILS_OFFICER_BADGE_NUMBER": { + "field_type": "text", + "field_name": "officer-prime-id", + "classNames": "fontXSmall", + "start": { + "x": 143, + "y": 173.75 + } + }, + "DETAILS_AGENCY_NAME": { + "field_type": "text", + "field_name": "officer-agency", + "classNames": "fontXSmall", + "start": { + "x": 52.75, + "y": 178.5 + } + }, + "DETAILS_AGENCY_FILE_NUMBER": { + "field_type": "text", + "field_name": "agency_file_no", + "classNames": "fontXSmall", + "start": { + "x": 130, + "y": 178.5 + } } }, "DRIVER": [ @@ -2116,10 +2170,18 @@ "REPORT_AGENCY_FILE_NUMBER", "INCIDENT_DETAILS_EXPLAINED_BELOW", "INCIDENT_DETAILS_ATTACHED", - "INCIDENT_DETAILS", + "REPORT_INCIDENT_DETAILS", "UL_OUT_OF_PROVINCE", "SUSPECTED_BC_RESIDENT" ], + "DETAILS": [ + "DETAILS_INCIDENT_DETAILS", + "DETAILS_OFFICER_LAST_NAME", + "DETAILS_OFFICER_SIGNATURE", + "DETAILS_OFFICER_BADGE_NUMBER", + "DETAILS_AGENCY_NAME", + "DETAILS_AGENCY_FILE_NUMBER" + ], "viewbox": "0 0 210 210" }, "TwelveHour": { diff --git a/roadside-forms-frontend/frontend_web_app/src/components/common/Input/Input.js b/roadside-forms-frontend/frontend_web_app/src/components/common/Input/Input.js index 31ade2d62..ac7764a99 100644 --- a/roadside-forms-frontend/frontend_web_app/src/components/common/Input/Input.js +++ b/roadside-forms-frontend/frontend_web_app/src/components/common/Input/Input.js @@ -18,9 +18,18 @@ export const Input = ({ label, required, onChange, ...props }) => { - - {meta.touched && meta.error ?
{meta.error}
: null} + + + {meta.touched && meta.error ? ( +
{meta.error}
+ ) : null}
); -} +}; diff --git a/roadside-forms-frontend/frontend_web_app/src/components/common/Input/NumericInput.js b/roadside-forms-frontend/frontend_web_app/src/components/common/Input/NumericInput.js index 5f8a84d42..d7e2d9666 100644 --- a/roadside-forms-frontend/frontend_web_app/src/components/common/Input/NumericInput.js +++ b/roadside-forms-frontend/frontend_web_app/src/components/common/Input/NumericInput.js @@ -1,5 +1,5 @@ -import React from 'react'; -import { useField } from 'formik'; +import React from "react"; +import { useField } from "formik"; export const NumericInput = ({ required, label, name, ...props }) => { const [field, meta] = useField(name); @@ -8,7 +8,7 @@ export const NumericInput = ({ required, label, name, ...props }) => { const { value } = e.target; // Limit the input value to 999 - const sanitizedValue = value.replace(/[^0-9]/g, '').slice(0, 3); + const sanitizedValue = value.replace(/[^0-9]/g, "").slice(0, 3); // Update the field value field.onChange({ target: { name, value: sanitizedValue } }); @@ -16,7 +16,10 @@ export const NumericInput = ({ required, label, name, ...props }) => { return (
- + { {...props} onChange={handleChange} required={required} - className={`form-control ${meta.touched && meta.error && 'is-invalid'}`} + className={`form-control ${meta.touched && meta.error && "is-invalid"}`} + autoComplete="off" /> {meta.touched && meta.error && (
{meta.error}
diff --git a/roadside-forms-frontend/frontend_web_app/src/components/common/Input/TimeInputField.js b/roadside-forms-frontend/frontend_web_app/src/components/common/Input/TimeInputField.js index bce061d62..fe854951e 100644 --- a/roadside-forms-frontend/frontend_web_app/src/components/common/Input/TimeInputField.js +++ b/roadside-forms-frontend/frontend_web_app/src/components/common/Input/TimeInputField.js @@ -1,5 +1,5 @@ -import React from 'react'; -import { useField } from 'formik'; +import React from "react"; +import { useField } from "formik"; export const TimeInputField = ({ required, label, ...props }) => { const [field, meta, helpers] = useField(props.name); @@ -13,20 +13,21 @@ export const TimeInputField = ({ required, label, ...props }) => { const formatTime = (value) => { // Remove any non-digit characters - const digitsOnly = value.replace(/\D/g, ''); + const digitsOnly = value.replace(/\D/g, ""); - // Ensure the value has at most 4 digits + // Ensure the value has at most 4 digits const formattedValue = digitsOnly.slice(0, 4); - return formattedValue; }; return (
- + { value={field.value} onChange={handleInputChange} required={required} - className={`form-control ${meta.touched && meta.error && 'is-invalid'}`} + className={`form-control ${meta.touched && meta.error && "is-invalid"}`} + autoComplete="off" /> - {meta.touched && meta.error ?
{meta.error}
: null} + {meta.touched && meta.error ? ( +
{meta.error}
+ ) : null}
); }; diff --git a/roadside-forms-frontend/frontend_web_app/src/components/common/Input/phoneField.js b/roadside-forms-frontend/frontend_web_app/src/components/common/Input/phoneField.js index 7ee407b11..9a4620abc 100644 --- a/roadside-forms-frontend/frontend_web_app/src/components/common/Input/phoneField.js +++ b/roadside-forms-frontend/frontend_web_app/src/components/common/Input/phoneField.js @@ -1,58 +1,64 @@ -import React from 'react'; -import { useField } from 'formik'; -import PropTypes from 'prop-types'; +import React from "react"; +import { useField } from "formik"; +import PropTypes from "prop-types"; export const PhoneField = ({ label, required, ...props }) => { - const [field, meta] = useField(props); + const [field, meta] = useField(props); - const handlePhoneChange = (event) => { - const phone = event.target.value; - const formattedPhone = formatPhoneNumber(phone); - - field.onChange({ - target: { - name: event.target.name, - value: formattedPhone, - }, - }); - }; - - const formatPhoneNumber = (phone) => { - // Example: Format as ###-###-#### - const cleaned = phone.replace(/[^0-9]/g, ''); - const match = cleaned.match(/^(\d{0,3})(\d{0,3})(\d{0,4})$/); - if (!match) { - return ''; - } - - const formatted = [match[1], match[2], match[3]].filter((group) => !!group).join('-'); - return formatted; - }; - - return ( -
- - - {meta.touched && meta.error ? ( -
{meta.error}
- ) : null} -
- ); + const handlePhoneChange = (event) => { + const phone = event.target.value; + const formattedPhone = formatPhoneNumber(phone); + + field.onChange({ + target: { + name: event.target.name, + value: formattedPhone, + }, + }); }; - - PhoneField.propTypes = { - label: PropTypes.string.isRequired, + + const formatPhoneNumber = (phone) => { + // Example: Format as ###-###-#### + const cleaned = phone.replace(/[^0-9]/g, ""); + const match = cleaned.match(/^(\d{0,3})(\d{0,3})(\d{0,4})$/); + if (!match) { + return ""; + } + + const formatted = [match[1], match[2], match[3]] + .filter((group) => !!group) + .join("-"); + return formatted; }; - \ No newline at end of file + + return ( +
+ + + {meta.touched && meta.error ? ( +
{meta.error}
+ ) : null} +
+ ); +}; + +PhoneField.propTypes = { + label: PropTypes.string.isRequired, +}; diff --git a/roadside-forms-frontend/frontend_web_app/src/utils/commonStyles.scss b/roadside-forms-frontend/frontend_web_app/src/utils/commonStyles.scss index 69c77e33b..3068ec6aa 100644 --- a/roadside-forms-frontend/frontend_web_app/src/utils/commonStyles.scss +++ b/roadside-forms-frontend/frontend_web_app/src/utils/commonStyles.scss @@ -1,95 +1,95 @@ $primary: #003366; // Change this to your desired primary color // Import Bootstrap and its dependencies -@import '~bootstrap/scss/bootstrap'; +@import "~bootstrap/scss/bootstrap"; -.base-class{ - border: 1px solid black; - color: black; - border-radius: 0.2rem; - text-align: center; +.base-class { + border: 1px solid black; + color: black; + border-radius: 0.2rem; + text-align: center; } .slim-button { - padding: 0.15rem 1.0rem; - font-size: 0.875rem; - } + padding: 0.15rem 1rem; + font-size: 0.875rem; +} -.text-font{ - font-family: Avenir, Helvetica, Arial, sans-serif; - font-size: large; +.text-font { + font-family: Avenir, Helvetica, Arial, sans-serif; + font-size: large; } -.border-design{ - @extend .base-class; - background-color: #F2F2F2; - margin: 2rem; - padding: 2rem; +.border-design { + @extend .base-class; + background-color: #f2f2f2; + margin: 2rem; + padding: 2rem; } -.outline{ - @extend .base-class; - margin: 2rem; - padding: 2rem; +.outline { + @extend .base-class; + margin: 2rem; + padding: 2rem; } -.border-design-form{ - @extend .base-class; - background-color: #F2F2F2; - margin: 1rem; - padding: 1rem; +.border-design-form { + @extend .base-class; + background-color: #f2f2f2; + margin: 1rem; + padding: 1rem; } -.error-message{ - color: #D8292F; +.error-message { + color: #d8292f; } -.required-asterisk{ - color: #D8292F; +.required-asterisk { + color: #d8292f; } -.field-width{ - width: 100%; +.field-width { + width: 100%; } .field-height { - height: 40px; - } + height: 40px; +} .text-area-height { - height: 150px; - } + height: 150px; +} -.right{ - text-align: right; +.right { + text-align: right; } -.left{ - text-align: left; +.left { + text-align: left; } -.center{ - text-align: center; +.center { + text-align: center; } -.flex{ - display: flex; +.flex { + display: flex; } -.textArea{ - width: 120px; - height:25px; - text-align: left; +.textArea { + width: 120px; + height: 100%; + text-align: left; } ::-webkit-scrollbar { - width: 2em; - height: 2em; + width: 2em; + height: 2em; } ::-webkit-scrollbar-button { - background: #ccc; + background: #ccc; } ::-webkit-scrollbar-thumb { - background: #eee; + background: #eee; } ::-webkit-scrollbar-track-piece { - background: #888; -} \ No newline at end of file + background: #888; +} diff --git a/roadside-forms-frontend/frontend_web_app/src/utils/helpers.js b/roadside-forms-frontend/frontend_web_app/src/utils/helpers.js index 7555f655b..3ae2e06f2 100644 --- a/roadside-forms-frontend/frontend_web_app/src/utils/helpers.js +++ b/roadside-forms-frontend/frontend_web_app/src/utils/helpers.js @@ -7,6 +7,7 @@ import twentyFourHourDriverform from "../assets/MV2634E_101223_driver.png"; import twentyFourHourILOform from "../assets/MV2634E_101223_ilo.png"; import twentyFourHourPoliceform from "../assets/MV2634E_101223_police.png"; import viDriverForm from "../assets/MV2721_201502.png"; +import viIncidentDetails from "../assets/MV2722_201502_Incident_Details.png"; import appealsForm from "../assets/MV2721_201502_appeal.png"; import viReportForm from "../assets/MV2722_201502.png"; import twelveHourDriverForm from "../assets/TwelveHourDriverCopy.png"; @@ -148,6 +149,7 @@ export const formsPNG = { VI: { POLICE: { png: viDriverForm, aspectClass: "--portrait" }, REPORT: { png: viReportForm, aspectClass: "--portrait" }, + DETAILS: { png: viIncidentDetails, aspectClass: "--portrait" }, }, }, }; @@ -317,6 +319,19 @@ export const printFormatHelper = (values, data, key) => { } } + if ( + key === "REPORT_INCIDENT_DETAILS" && + values["incident_details_extra_page"] + ) { + val = ""; + } + if ( + key === "DETAILS_INCIDENT_DETAILS" && + !values["incident_details_extra_page"] + ) { + val = ""; + } + return val; };