\r\n );\r\n};\r\nexport const InputTextArea = ({\r\n input, label, subText, meta: {touched, error},\r\n ...custom\r\n }) => {\r\n return (\r\n \r\n );\r\n};\r\nexport const MaterialRadio = ({\r\n input,\r\n label,\r\n option1,\r\n option2,\r\n option3,\r\n option4,\r\n option5,\r\n meta: {touched, error, warning}\r\n }) => {\r\n\r\n return (\r\n \r\n {label} \r\n \r\n\r\n }\r\n label={option1}/>\r\n }\r\n label={option2}/>\r\n {option3 &&\r\n }\r\n label={option3}/>}\r\n {option4 &&\r\n }\r\n label={option4}/>}\r\n {option5 &&\r\n }\r\n label={option5}/>}\r\n \r\n {((error && {error}
) || (warning &&\r\n {warning}
))}\r\n \r\n );\r\n};\r\nexport const PaymentOptions = ({input, label, Options1, keyWord, meta: {touched, error, warning}}) => {\r\n return (\r\n \r\n {label} \r\n \r\n\r\n {Options1 &&Options1.map((ele) => {\r\n if (ele.Active && ele.ApplicationName.includes(keyWord)) {\r\n return (\r\n }\r\n label={ele.ApplicationName}/>\r\n )\r\n } else return null\r\n })}\r\n \r\n {((error && {error}
) || (warning &&\r\n {warning}
))}\r\n \r\n );\r\n};\r\nexport const RenderTextField = ({\r\n input,\r\n label,\r\n txtwidth,\r\n meta: {touched, error},\r\n ...custom\r\n }) => {\r\n return \r\n};\r\n\r\nexport const RenderContactInfo = ({\r\n input,\r\n label,\r\n cName, readOnly,\r\n nameField, address, other\r\n // meta: { touched, error },\r\n // ...custom\r\n }) => {\r\n const classes = useStyles();\r\n return \r\n\r\n {nameField === 'true' &&
\r\n \r\n \r\n \r\n \r\n }\r\n {address === 'true' &&
\r\n \r\n \r\n \r\n\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n
}\r\n {other === 'true' &&
\r\n \r\n \r\n }\r\n
\r\n};\r\nexport const DateField = props => {\r\n const {\r\n meta: {submitting, error, touched},\r\n input: {onBlur, value, ...inputProps},\r\n ...others\r\n } = props;\r\n\r\n const onChange = date => {\r\n Date.parse(date) ? inputProps.onChange(date.toISOString()) : inputProps.onChange(null);\r\n };\r\n return (\r\n \r\n onBlur(value ? new Date(value).toISOString() : null)}\r\n error={touched && error}\r\n helperText={touched && error}\r\n onChange={onChange}\r\n />\r\n \r\n );\r\n};\r\nexport const TimeField = props => {\r\n const {\r\n meta: {submitting, error},\r\n input: {onBlur, value, ...inputProps},\r\n ...others\r\n } = props;\r\n\r\n const onChange = date => {\r\n Date.parse(date) ? inputProps.onChange(new Date(date)) : inputProps.onChange(null);\r\n };\r\n\r\n return (\r\n \r\n onBlur(value ? value : null)}\r\n error={error}\r\n helperText={error}\r\n onChange={onChange}\r\n />\r\n \r\n );\r\n};\r\nexport const MaterialCheckBox = ({input, label}) => (\r\n \r\n {label && \r\n }\r\n label={label}\r\n />}\r\n
\r\n);\r\n// export const RenderFileUpload = ({input, label,name}) => (\r\n// \r\n// {label} \r\n// \r\n//
)\r\n\r\nexport const RenderFileInput = ({input, callback, label, type, meta}) => {\r\n const handleChange = (event, input) => {\r\n event.preventDefault();\r\n let imageFile = event.target.files[0];\r\n ///TODO: Add the file size restriction here\r\n input.onChange(imageFile);\r\n callback(event.target, input.name);\r\n };\r\n return (\r\n \r\n {label} \r\n \r\n \r\n handleChange(event, input)}\r\n />\r\n \r\n );\r\n};\r\n\r\nexport const SelectVariants = ({input, label, data, defaultValue, meta: {touched, error, warning}}) => {\r\n const [SelectValue, setSelectValue] = React.useState(defaultValue !== null ? defaultValue : '');\r\n\r\n const handleChange = (event) => {\r\n setSelectValue(event.target.value);\r\n };\r\n\r\n return (\r\n \r\n
\r\n {label} \r\n \r\n\r\n {data && data.map((e, i) => {e} )}\r\n\r\n \r\n {((touched && error && {error}
) || (warning &&\r\n {warning}
))}\r\n \r\n\r\n
\r\n );\r\n};","import {change} from \"redux-form\";\r\n//Festival\r\nexport const SET_APPLICATION_ID = 'SET_APPLICATION_ID';\r\nexport const SET_STEP = 'SET_STEP';\r\nexport const GET_FESTIVAL_APPLICATION = 'GET_FESTIVAL_APPLICATION';\r\nexport const GET_FESTIVAL_APPLICATION_Edit = 'GET_FESTIVAL_APPLICATION_Edit';\r\nexport const GET_FILES = 'GET_FILES';\r\nexport const STATUS = 'STATUS';\r\nexport const VENDOR = 'VENDOR';\r\nexport const APPLICATION_STATUS = 'APPLICATION_STATUS';\r\nexport const CERT_DETAILS = 'CERT_DETAILS';\r\n//URLS\r\nexport const ERROR_CODE_NOT_FOUND = \"404\";\r\nexport const BaseUrl = window.extconfig.apiBaseURL;\r\nexport const ApplicationCost = window.extconfig.ApplicationCost;\r\nexport const VendorCost = window.extconfig.VendorCost;\r\nexport const ACHPaymentURL = window.extconfig.ACHPaymentURL;\r\n\r\n//Payment\r\nexport const GET_APPLICATIONS = 'GET_APPLICATIONS';\r\nexport const SET_PAYMENTAPPLICATION = 'SET_PAYMENTAPPLICATION';\r\nexport const GET_PAYMENT_APPLICATION_DETAILS = 'GET_PAYMENT_APPLICATION_DETAILS';\r\nexport const UPDATE_PAYMENT = 'UPDATE_PAYMENT';\r\nexport const MESSAGE = 'MESSAGE';\r\nexport const ACHPAYMENT = 'ACHPAYMENT';\r\nexport const PAY_DETAILS = 'PAY_DETAILS';\r\n\r\n//Festival\r\nexport const FestivalPostURL = BaseUrl+ \"api/FestivalLicenses\";\r\nexport const FestivalURL = BaseUrl+ \"api/Festival\";\r\nexport const SharePointURL = BaseUrl+ \"api/FileSharePoint\";\r\nexport const MiscURL = BaseUrl+ \"api/Misc\";\r\nexport const StatusURL = BaseUrl+ \"api/MiscController/GetStatus\";\r\nexport const VendorURL = BaseUrl+ \"api/MiscController/GetVendorDetails\";\r\nexport const SetVendorURL = BaseUrl+ \"api/MiscController/SetVendorDetails\";\r\nexport const DeleteVendorURL = BaseUrl+ \"api/MiscController/DeleteVendorDetails\";\r\n//Payment\r\nexport const PaymentApplicationsURL = BaseUrl+ \"api/PaymentPortal_MasterTable\";\r\nexport const GetPaymentURL = BaseUrl+ \"api/MiscController/GetPaymentDetails\";\r\nexport const updatePaymentURL = BaseUrl+ \"api/MiscController/updatePaymentDetails\";\r\nexport const MessageURL = BaseUrl+ \"api/MiscController/GetMessage\";\r\nexport const LicenseeURL = BaseUrl+ \"api/MiscController/GetLicenseeDetails\";\r\nexport const PaymentDetails = BaseUrl+ \"api/PaymentPortal_PaymentTable/GetPaymentStatus\";\r\n\r\n//Certificate\r\nexport const GetCertDetailsURL = BaseUrl+ \"api/CertController/GetCertDetails\";\r\nexport const LicenseDownloadURL = BaseUrl+ \"api/FileSharePoint\";\r\nexport const DownloadHistoryURL = BaseUrl+ \"api/CertController/CertDownload\";\r\n\r\n\r\n//Steps\r\nexport const Steps=[\"APPLICANT_DETAILS\",\"EVENT_DETAILS\",\"PROPERTY_DETAILS\",\"FACILITY_DETAILS\"\r\n ,\"PROMOTER_DETAILS\",\"VENDOR_DETAILS\",\"FILE_UPLOAD\",\"APPLICANT_SIGNATURE\"];\r\n//callback\r\nexport const GenericCallbacks = (type,handleFetchComplete,handleNotFound,handleApiError,handleSuccess) => {\r\n return {\r\n handleSuccess: (dispatch, payload) => {\r\n // dispatch(dispatchJson);\r\n // this.setState({Success:\"Fines are saved successfully\"})\r\n let MainURL=window.location.href;\r\n if(payload) {\r\n if (handleFetchComplete === \"function\") handleFetchComplete();\r\n }\r\n if (type===GET_FESTIVAL_APPLICATION_Edit && payload.length>0)\r\n {\r\n // dispatch({type: SET_STEP, StepName: payload[0].StepName})\r\n if (payload[0].Status==='Draft') {\r\n dispatch(change('FestivalForm', `Applicant.ApplicantDetails`, payload[0].ApplicantDetails));\r\n dispatch(change('FestivalForm', `Applicant.NonProfitOrganizationName`, payload[0].NonProfitOrganizationName));\r\n dispatch(change('FestivalForm', `Applicant.OrganizerDetails`, payload[0].OrganizerDetails));\r\n dispatch(change('FestivalForm', `Event.EventName`, payload[0].EventName));\r\n dispatch(change('FestivalForm', `Event.EventType`, payload[0].EventType));\r\n dispatch(change('FestivalForm', `Event.EventWebsite`, payload[0].EventWebsite));\r\n dispatch(change('FestivalForm', `Event.StartDate`, payload[0].StartDate));\r\n dispatch(change('FestivalForm', `Event.EndDate`, payload[0].EndDate));\r\n dispatch(change('FestivalForm', `Event.RainStartDate`, payload[0].RainStartDate));\r\n dispatch(change('FestivalForm', `Event.RainEndDate`, payload[0].RainEndDate));\r\n dispatch(change('FestivalForm', `Event.EventDetails`, payload[0].EventDetailsReadOnly.map((ele) => {\r\n ele.EventStartTime = new Date(ele.EventDate.replace('00:00:00', ele.EventStartTime));\r\n ele.EventEndTime = new Date(ele.EventDate.replace('00:00:00', ele.EventEndTime));\r\n ele.AlcoholStartTime = new Date(ele.EventDate.replace('00:00:00', ele.AlcoholStartTime));\r\n ele.AlcoholEndTime = new Date(ele.EventDate.replace('00:00:00', ele.AlcoholEndTime));\r\n return ele;\r\n })));\r\n dispatch(change('FestivalForm', `Property.IsPropertyOwnerSame`, payload[0].IsPropertyOwnerSame ? 'Yes' : 'No'));\r\n dispatch(change('FestivalForm', `Property.PropertyDetails`, payload[0].PropertyDetails));\r\n dispatch(change('FestivalForm', `Facility.FacilityDetails`, payload[0].FacilityDetails));\r\n dispatch(change('FestivalForm', `Facility.PropertyName`, payload[0].PropertyName));\r\n dispatch(change('FestivalForm', `Facility.Attendees`, payload[0].Attendees));\r\n dispatch(change('FestivalForm', `Facility.EntertainmentHours`, payload[0].EntertainmentHours));\r\n dispatch(change('FestivalForm', `Facility.EntertainmentType`, payload[0].EntertainmentType));\r\n dispatch(change('FestivalForm', `Facility.EventLocation`, payload[0].EventLocation));\r\n dispatch(change('FestivalForm', `Facility.Radio`, payload[0].AdvertisingType===null? null :payload[0].AdvertisingType.includes('Radio')));\r\n dispatch(change('FestivalForm', `Facility.Flyer`, payload[0].AdvertisingType===null? null :payload[0].AdvertisingType.includes('Flyer')));\r\n dispatch(change('FestivalForm', `Facility.Internet`,payload[0].AdvertisingType===null? null : payload[0].AdvertisingType.includes('Internet')));\r\n dispatch(change('FestivalForm', `Facility.Other`, payload[0].AdvertisingType===null? null :payload[0].AdvertisingType.includes('Other')));\r\n dispatch(change('FestivalForm', `Facility.AdvertisingComment`, payload[0].AdvertisingComment));\r\n dispatch(change('FestivalForm', `Facility.IsIndoor`, payload[0].IsIndoor ? 'Indoor' : 'Outdoor'));\r\n dispatch(change('FestivalForm', `Facility.FoodMenu`, payload[0].FoodMenu));\r\n dispatch(change('FestivalForm', `Facility.AlcoholMenu`, payload[0].AlcoholMenu));\r\n dispatch(change('FestivalForm', `Promoter.IsPromoter`, payload[0].IsPromoter ? 'Yes' : 'No'));\r\n dispatch(change('FestivalForm', `Promoter.PromoterDetails`, payload[0].PromoterDetails));\r\n dispatch(change('FestivalForm', `Promoter.PromoterWebsite`, payload[0].PromoterWebsite));\r\n dispatch(change('FestivalForm', `Promoter.PromoterFacebook`, payload[0].PromoterFacebook));\r\n dispatch(change('FestivalForm', `Promoter.IsSecurity`, payload[0].IsSecurity ? 'Yes' : 'No'));\r\n dispatch(change('FestivalForm', `Promoter.SecurityCompanyName`, payload[0].SecurityCompanyName));\r\n dispatch(change('FestivalForm', `Promoter.SecurityDetails`, payload[0].SecurityDetails));\r\n dispatch(change('FestivalForm', `FestivalVendorDetails`, payload[0].FestivalVendorDetailsReadOnly.map((ele) => {\r\n let result = {};\r\n result.VendorID = ele.VendorID;\r\n result.VendorDetails = ele.VendorDetails;\r\n result.EstablishmentName = ele.EstablishmentName\r\n result.LicenseType = ele.LicenseType\r\n return result;\r\n })));\r\n }\r\n dispatch({type: STATUS, payload: payload[0].Status})\r\n type=GET_FESTIVAL_APPLICATION;\r\n }\r\n else if(type===GET_FESTIVAL_APPLICATION_Edit && payload.length<=0)\r\n {\r\n //dispatch({type: STATUS, payload: payload[0].Status})\r\n type=GET_FESTIVAL_APPLICATION;\r\n }\r\n if ((MainURL.includes('FestivalApplicationEdit') && type===GET_FILES)) {\r\n if (payload.find(x => x.FileName.includes('ApplicantSignature'))!==null)\r\n {\r\n dispatch(change('FestivalForm', `FileUploads.FestivalDiagram`, 'FestivalDiagram'));\r\n }\r\n if (payload.find(x => x.FileName.includes('FestivalInvitation'))!==null)\r\n {\r\n dispatch(change('FestivalForm', `FileUploads.FestivalInvitation`, 'FestivalInvitation'));\r\n }\r\n if (payload.find(x => x.FileName.includes('SecurityPlan'))!==null)\r\n {\r\n dispatch(change('FestivalForm', `FileUploads.SecurityPlan`, 'SecurityPlan'));\r\n }\r\n if (payload.find(x => x.FileName.includes('LetterOfDetermination')) !== null)\r\n {\r\n dispatch(change('FestivalForm', `FileUploads.LetterOfDetermination`, 'LetterOfDetermination'));\r\n }\r\n }\r\n if(type===VENDOR)\r\n {\r\n dispatch(change('VendorForm', `Vendor.EstablishmentName`, payload[0].EstablishmentName));\r\n dispatch(change('VendorForm', `Vendor.LicenseType`, payload[0].LicenseType));\r\n dispatch(change('VendorForm', `Vendor.LicenseNumber`, payload[0].LicenseNumber));\r\n dispatch(change('VendorForm', `Vendor.VendorLicenseNumber`, payload[0].VendorLicenseNumber));\r\n dispatch(change('VendorForm', `Vendor.LicenseeName`, payload[0].LicenseeName));\r\n dispatch(change('VendorForm', `Vendor.EventName`, payload[0].EventName));\r\n dispatch(change('VendorForm', `Vendor.EventStartDate`, payload[0].EventStartDate));\r\n dispatch(change('VendorForm', `Vendor.EventEndDate`, payload[0].EventEndDate));\r\n dispatch(change('VendorForm', `Vendor.StartDate`, payload[0].StartDate));\r\n dispatch(change('VendorForm', `Vendor.EndDate`, payload[0].EndDate));\r\n dispatch(change('VendorForm', `Vendor.VendorDetails`, payload[0].VendorDetails));\r\n // dispatch(change('VendorForm', `Vendor.VendorDetails`, payload[0].VendorDetails));\r\n dispatch(change('VendorForm', `Vendor.Status`, payload[0].Status));\r\n }\r\n dispatch({type: type, payload: payload})\r\n }\r\n ,handleNotFound:(dispatch) => {\r\n // dispatch(dispatchJson);\r\n if (handleNotFound=== \"function\") {\r\n handleNotFound();\r\n }\r\n },\r\n handleApiError:(dispatch) => {\r\n // dispatch(dispatchJson);\r\n if (handleApiError=== \"function\") handleApiError();\r\n }\r\n }\r\n\r\n};\r\n","import * as Constants from \"../Common/ActionConstants\";\r\n// import {fetchMessage} from \"../actions/ErrorActions\";\r\n\r\n// Reusable fetch flow incorporating error and success panel logic, with callbacks for special handling\r\n// url (string) - url to fetch\r\n// headers (object) - headers to use in the fetch.\r\n// If missing, standard headers will be used, but an authorizationToken argument is required.\r\n// If provided, must include an authorizationToken inside the headers.\r\n// getStandardHeaders() can be used to get a starting point for customized header objects.\r\n// method (string) - method to use in the fetch. If missing, GET will be used\r\n// body (object) - body to use in the fetch. If missing, null will be used\r\n// authorizationToken - required if headers are not provided. Not used when they are.\r\n// updateErrorPanel (boolean) - when false, the ErrorPanel-related logic will be skipped.\r\n// successMessage (string) - when null, the SuccessPanel-related logic will be skipped. When provided, will be used as the message in the SuccessPanel\r\n// callbacks (object) - object containing functions that will be called to provide hooks for custom logic in various scenarios:\r\n//\r\n// handleSuccess(dispatch, payload) - behavior for the happy path. Required.\r\n// handleNotFound(dispatch) - behavior for a 404 Not Found result. Only used if ErrorPanel is turned off. Optional.\r\n// handleFetchComplete(dispatch) - behavior that will be run after the fetch is done, regardless of success or failure outcome. Optional.\r\n// allowedErrorStatuses (array of Numbers) - This is an array of response codes that are allowed as exceptions. Optional.\r\n//\r\nexport function genericFetch(url, headers, method, body, updateErrorPanel, successMessage, callbacks, allowedErrorStatuses) {\r\n return (dispatch) => {\r\n let apiErrorOccurred = false;\r\n let responseOk = false;\r\n let fetchMethod = method ? method : \"GET\";\r\n let fetchHeaders = headers;\r\n let fetchBody = body ? JSON.stringify(body) : null;\r\n let AuthHeader={\"Authorization\":\"Basic QUJTQFVzM3JOQG0zOkFCU0AzZDE1ME5QQHJrXzIwMQ==\"};\r\n fetchHeaders={\r\n ...fetchHeaders,\r\n ...AuthHeader\r\n }\r\n fetchBody= fetchHeaders['redirect']=== 'follow' ?body : fetchBody;\r\n let params = (fetchHeaders !== null) ? {\r\n headers: fetchHeaders,\r\n method: fetchMethod,\r\n body: fetchBody,\r\n } : {\r\n method: fetchMethod,\r\n body: fetchBody,\r\n };\r\n allowedErrorStatuses = allowedErrorStatuses === null || allowedErrorStatuses === undefined ? [] : allowedErrorStatuses;\r\n fetch(url, params)\r\n .then((response) => {\r\n // go straight to error handling if we're not using the ErrorPanel\r\n if (!updateErrorPanel && !response.ok) {\r\n throw Error(response.status);\r\n }\r\n // remember the value for later\r\n responseOk = response.ok;\r\n responseOk = allowedErrorStatuses.includes(response.status) ? true : responseOk; //check for an empty response\r\n return response.json();\r\n })\r\n .then((payload) => {\r\n // check for ErrorPanel-style errors\r\n if (updateErrorPanel && (payload.length > 0) && (payload[0].errorMessage !== undefined)) {\r\n apiErrorOccurred = true;\r\n throw payload;\r\n }\r\n\r\n // check for unintentional errors\r\n if (!responseOk) {\r\n const errorMessage = \"Unexpected error from rest service.\";\r\n throw Error(errorMessage);\r\n }\r\n if (typeof callbacks.handleSuccess === \"function\") {\r\n callbacks.handleSuccess(dispatch, payload);\r\n }\r\n\r\n\r\n if (successMessage) {\r\n //dispatch(fetchMessage({content:successMessage,status: \"Success\"}));\r\n }\r\n })\r\n .catch((error) => {\r\n if (apiErrorOccurred) {\r\n if (callbacks.handleApiError) {\r\n callbacks.handleApiError(dispatch, error);\r\n } else {\r\n // dispatch(fetchMessage({content:error[0].errorMessage, status: \"Failure\"}));\r\n }\r\n } else if (!updateErrorPanel && callbacks && (error.message === Constants.ERROR_CODE_NOT_FOUND)) {\r\n if (callbacks) {\r\n if (typeof callbacks.handleNotFound === \"function\") {\r\n callbacks.handleNotFound(dispatch);\r\n }\r\n }\r\n // dispatch(fetchMessage({content:\"Fetch Failed\",status: \"Failure\"}));\r\n } else if (updateErrorPanel) {\r\n callbacks.handleFetchComplete(dispatch);\r\n } else {\r\n // No graceful handling found, go to standard catch-all error page\r\n // dispatch(fetchMessage({content:\"Something went wrong. Please contact the Help Desk.\",status: \"Failure\"}));\r\n }\r\n })\r\n .then((onFinally) => {\r\n if (callbacks) {\r\n if (typeof callbacks.handleFetchComplete === \"function\") {\r\n // callbacks.handleFetchComplete(dispatch);\r\n }\r\n }\r\n });\r\n };\r\n}\r\n\r\n\r\n\r\n","import React, {Component} from 'react';\r\nimport {MDBCard, MDBCardBody, MDBCardText, MDBCardTitle, MDBCol, MDBRow} from 'mdbreact';\r\nimport {Btn} from '../Common/Component';\r\nimport {\r\n GenericCallbacks,\r\n GET_APPLICATIONS,\r\n MESSAGE,\r\n MessageURL,\r\n PaymentApplicationsURL\r\n} from \"../Common/ActionConstants\";\r\nimport {connect} from \"react-redux\";\r\nimport {genericFetch} from \"../Common/GenericFetch\";\r\n\r\nexport class LandingPage extends Component {\r\n constructor(props) {\r\n\r\n super(props);\r\n this.props.get(PaymentApplicationsURL, GET_APPLICATIONS);\r\n this.props.get(MessageURL, MESSAGE);\r\n }\r\n\r\n render() {\r\n return (\r\n \r\n
\r\n\r\n ALCOHOL BEVERAGE SERVICES \r\n {this.props.PaymentReducers.Message && this.props.PaymentReducers.Message.length > 0 &&
\r\n \r\n \r\n {this.props.PaymentReducers.Message && this.props.PaymentReducers.Message.map((ele, index) => {\r\n return (ele.Message)\r\n })\r\n }\r\n
\r\n }\r\n\r\n
\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n
\r\n \r\n \r\n \r\n Montgomery County Beer, Wine & Liquor Festival License Application\r\n \r\n \r\n \r\n Step 1:The festival organizer must create an application first. \r\n Step 2:The organizer must provide each vendor with a festival application number so that\r\n they can complete their application. \r\n \r\n \r\n \r\n \r\n \r\n
\r\n \r\n \r\n \r\n Montgomery County Beer, Wine & Liquor Festival\r\n License Application (Festival Organizers)\r\n \r\n \r\n \r\n \r\n \r\n { }\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n Montgomery County\r\n Beer, Wine & Liquor Festival\r\n (Vendor Application) \r\n \r\n \r\n \r\n \r\n \r\n \r\n
\r\n );\r\n }\r\n}\r\n\r\nconst mapDispatchToProps = (dispatch) => {\r\n return {\r\n get: (url, type) =>\r\n (dispatch(genericFetch(url, null, \"GET\", null, false, null, GenericCallbacks(type, null, null, null))))\r\n };\r\n};\r\n\r\nconst mapStateToProps = (state) => {\r\n return {\r\n PaymentReducers: state.PaymentReducers,\r\n };\r\n};\r\n\r\nexport default connect(mapStateToProps, mapDispatchToProps)(LandingPage);\r\n","const validate = (values /*, dispatch */) => {\r\n let errors = {};\r\n\r\n let BaseElement = ['EstablishmentName','LicenseType','VendorLicenseNumber','LicenseeName','StartDate','EndDate'];\r\n if (values['Vendor']!==undefined) {\r\n\r\n errors.Vendor={};\r\n BaseElement.forEach(field=>{\r\n if (values.Vendor[field]===undefined ||!values.Vendor[field] || values.Vendor[field]===null ) {\r\n // eslint-disable-next-line no-throw-literal\r\n errors['Vendor'][field] = 'is Required';\r\n }\r\n\r\n\r\n })\r\n\r\n }\r\n return errors;\r\n}\r\n\r\nexport default validate\r\n","import React from \"react\";\r\nimport Typography from \"@material-ui/core/Typography\";\r\nimport {MDBCol, MDBContainer, MDBRow} from \"mdbreact\";\r\nimport {\r\n FestivalPostURL,\r\n GenericCallbacks,\r\n SET_APPLICATION_ID,\r\n SetVendorURL,\r\n SharePointURL,\r\n VENDOR,\r\n VendorCost,\r\n VendorURL\r\n} from \"../Common/ActionConstants\";\r\nimport {connect} from \"react-redux\";\r\nimport {Field, FormSection, formValueSelector, getFormSyncErrors, reduxForm} from \"redux-form\";\r\nimport {DateField, RenderContactInfo, RenderTextField, SelectVariants} from \"../Common/Component\";\r\nimport {Button, Grid} from \"@material-ui/core\";\r\nimport SignatureCanvas from \"react-signature-canvas\";\r\nimport {genericFetch} from \"../Common/GenericFetch\";\r\nimport {differenceInCalendarDays} from \"date-fns\";\r\nimport validate from \"../Common/VendorValidateForm\";\r\n\r\nlet VendorEdit = (props) => {\r\n const [Sign, setSign] = React.useState('False');\r\n const [SubmitFlag, setSubmitFlag] = React.useState('False');\r\n\r\n const dataURItoBlob = (dataURI) => {\r\n // convert base64 to raw binary data held in a string\r\n // doesn't handle URLEncoded DataURIs - see SO answer #6850276 for code that does this\r\n let byteString = atob(dataURI.split(',')[1]);\r\n // separate out the mime component\r\n let mimeString = dataURI.split(',')[0].split(':')[1].split(';')[0];\r\n // write the bytes of the string to an ArrayBuffer\r\n let ab = new ArrayBuffer(byteString.length);\r\n let ia = new Uint8Array(ab);\r\n for (let i = 0; i < byteString.length; i++) {\r\n ia[i] = byteString.charCodeAt(i);\r\n }\r\n //New Code\r\n return new Blob([ab], {type: mimeString});\r\n };\r\n let sigPad = {};\r\n const clear = () => {\r\n sigPad.clear()\r\n };\r\n const trim = () => {\r\n let context = sigPad.getCanvas().getContext(\"2d\");\r\n context.fillText(`${props.FormValue.VendorDetails.Firstname}. ${props.FormValue.VendorDetails.LastName} - ${new Date()}`, 10, 175);\r\n\r\n let sign = dataURItoBlob(sigPad.getTrimmedCanvas().toDataURL('image/png'));\r\n let URL = SharePointURL + `?ID=${props.FestivalReducers.Vendor[0].FestivalID}&FileName=Vendor-${props.FormValue.VendorID.trim()}-${props.FormValue.VendorDetails.Firstname}.png`;\r\n const formData = new FormData();\r\n formData.append(\"image\", sign);\r\n let requestOptions = {\r\n method: 'POST',\r\n body: formData,\r\n redirect: 'follow'\r\n };\r\n props.Post(URL, formData, requestOptions, () => {\r\n let URL = FestivalPostURL;\r\n let Vendor = [{\r\n VendorSignature: 1,\r\n VendorID: props.FormValue.VendorID,\r\n FestivalID: props.FestivalReducers.Vendor[0].FestivalID,\r\n }];\r\n let json = {\r\n FestivalVendorDetails: Vendor,\r\n FestivalID: props.FestivalReducers.Vendor[0].FestivalID,\r\n StepName: 'Vendor_Sign'\r\n };\r\n setSign(\"True\");\r\n props.Patch(URL, json, () => {\r\n });\r\n });\r\n };\r\n\r\n const getErrors = () => {\r\n let result = false;\r\n let errors = props.synchronousError.Vendor;\r\n if (Object.keys(errors).length > 0 || Sign === 'False') {\r\n return true;\r\n }\r\n return result;\r\n };\r\n\r\n return (\r\n \r\n \r\n \r\n )\r\n\r\n};\r\n\r\nconst mapDispatchToProps = (dispatch) => {\r\n return {\r\n get: (url) =>\r\n (dispatch(genericFetch(url, null, \"GET\", null, false, null, GenericCallbacks(VENDOR, null, null, null)))),\r\n Post: (url, data, headers, handleFetchComplete) =>\r\n (dispatch(genericFetch(url, headers\r\n , \"POST\", data, false,\r\n \"Saved Successfully\",\r\n GenericCallbacks(null, handleFetchComplete(), null, null)))),\r\n ApplicationID: (ID) =>\r\n (dispatch({type: SET_APPLICATION_ID, ApplicationID: ID}))\r\n , Patch: (url, json, handleFetchComplete) =>\r\n (dispatch(genericFetch(url, {\"Content-Type\": \"application/json\"}\r\n , \"PATCH\", json, false,\r\n \"Saved Successfully\",\r\n GenericCallbacks(null, handleFetchComplete(), null, null))))\r\n };\r\n};\r\nconst selector = formValueSelector('VendorForm');\r\nconst mapStateToProps = (state) => {\r\n return {\r\n FestivalReducers: state.FestivalReducers,\r\n FormValue: selector(state, 'Vendor'),\r\n synchronousError: getFormSyncErrors('VendorForm')(state),\r\n };\r\n};\r\nVendorEdit = reduxForm({\r\n form: 'VendorForm',\r\n destroyOnUnmount: false,\r\n validate\r\n})(VendorEdit);\r\nexport default connect(mapStateToProps, mapDispatchToProps)(VendorEdit);\r\n\r\n","import {Steps} from \"./ActionConstants\";\r\nimport {lightFormat} from \"date-fns\";\r\n// import validate from \"./VendorValidateForm\";\r\n\r\nconst getBaseElement = (StepName,values) => {\r\n let BaseElement = [];\r\n let RequiredFields = [];\r\n let ContactName = ['Firstname',\r\n 'LastName'];\r\n let Address = [\r\n 'StreetAddress',\r\n 'City',\r\n 'State',\r\n 'ZipCode'];\r\n let Other = [\r\n 'Mobile',\r\n 'Email']\r\n switch (StepName) {\r\n case Steps[0]:\r\n BaseElement = ['Applicant','ApplicantDetails','OrganizerDetails'];\r\n let OrganizerDetails = [...ContactName, ...Address,...Other]\r\n\r\n RequiredFields = [[],[...ContactName, ...Other],[...OrganizerDetails]];\r\n break;\r\n case Steps[1]:\r\n BaseElement = ['Event','EventDetails'];\r\n RequiredFields = [[\"EventName\", \"EventType\", \"EventWebsite\", \"StartDate\", \"EndDate\"]\r\n ,['EventStartTime','EventEndTime','AlcoholStartTime','AlcoholEndTime']];\r\n break;\r\n case Steps[2]:\r\n BaseElement = ['Property', 'PropertyDetails'];\r\n let PropertyDetails = [...ContactName, ...Address, ...Other]\r\n RequiredFields = [[\"IsPropertyOwnerSame\"]\r\n , [...PropertyDetails]];\r\n break;\r\n case Steps[3]:\r\n BaseElement = ['Facility', 'FacilityDetails'];\r\n let FacilityDetails = [...Address]\r\n RequiredFields = [[\"PropertyName\", 'Attendees', 'EntertainmentHours', 'EntertainmentType', 'EventLocation', 'IsIndoor'\r\n , 'FoodMenu', 'AlcoholMenu']\r\n , [...FacilityDetails]];\r\n break;\r\n case Steps[4]:\r\n BaseElement = ['Promoter', 'PromoterDetails','SecurityDetails'];\r\n let PromoterDetails = [...ContactName, ...Other];\r\n let SecurityDetails = [...ContactName, ...Other];\r\n let ReqFields = [\"IsPromoter\", 'IsSecurity'];\r\n if (values.Promoter && values.Promoter.IsPromoter==='No') {\r\n PromoterDetails = [];\r\n\r\n }else\r\n {\r\n ReqFields.push(\"PromoterWebsite\");\r\n ReqFields.push(\"PromoterFacebook\");\r\n }\r\n if (values.Promoter && values.Promoter.IsSecurity==='No') SecurityDetails=[];\r\n else\r\n {ReqFields.push(\"SecurityCompanyName\");}\r\n RequiredFields = [[...ReqFields]\r\n , [...PromoterDetails],[...SecurityDetails]];\r\n break;\r\n case Steps[6]:\r\n BaseElement = ['FileUploads'];\r\n RequiredFields = [[\"FestivalDiagram\",'SecurityPlan','LetterOfDetermination']];\r\n break;\r\n case Steps[5]:\r\n BaseElement = ['FestivalVendorDetails','VendorDetails'];\r\n RequiredFields = [[\"EstablishmentName\", 'LicenseType'],[...ContactName, ...Other]];\r\n break; case Steps[7]:\r\n BaseElement = ['ApplicantAffidavit'];\r\n RequiredFields = [[\"ApplicantName\", 'ApplicantTitle']];\r\n break;\r\n default:\r\n break;\r\n }\r\n return {BaseElement: BaseElement, RequiredFields: RequiredFields};\r\n}\r\n\r\n\r\n const validate = (values, state) => {\r\n\r\n let errors = {};\r\n const Base = getBaseElement(state.FestivalReducers.StepName,values)\r\n const TopElement = Base.BaseElement[0];\r\n if(TopElement==='FestivalVendorDetails') {\r\n const BaseElement=Base.BaseElement[0]\r\n const subElement=Base.BaseElement[1]\r\n errors[BaseElement]=[{}];\r\n if (values[BaseElement]) {\r\n values[BaseElement].map((ele, index) => {\r\n errors[BaseElement][index] = {};\r\n Base.RequiredFields[0].forEach(field => {\r\n\r\n // if (!values[BaseElement]) {\r\n //\r\n // errors[BaseElement][0][field] = 'is Required';\r\n // } else {values[BaseElement][0]\r\n\r\n if (!ele[field]) {\r\n\r\n errors[BaseElement][index][field] = 'is Required';\r\n\r\n }\r\n if (!ele[subElement]) {\r\n errors[BaseElement][index][subElement] = {};\r\n Base.RequiredFields[1].forEach(field => {\r\n\r\n // if (!values[BaseElement][0][subElement]) {\r\n errors[BaseElement][index][subElement][field] = 'is Required';\r\n\r\n // }\r\n })\r\n } else {\r\n errors[BaseElement][index][subElement] = {};\r\n Base.RequiredFields[1].forEach(field => {\r\n\r\n if (!ele[subElement][field]) {\r\n errors[BaseElement][index][subElement][field] = 'is Required';\r\n\r\n } else {\r\n errors[BaseElement][index][subElement] = {};\r\n }\r\n })\r\n }\r\n })\r\n return null;\r\n })\r\n }\r\n }\r\n else {\r\n errors[TopElement] = {};\r\n Base.BaseElement.forEach((ele, index) => {\r\n const BaseElement = ele;\r\n if (BaseElement === 'EventDetails')\r\n errors[TopElement][BaseElement] = []\r\n else if (index > 0)\r\n errors[TopElement][BaseElement] = {}\r\n\r\n const requiredFields = Base.RequiredFields[index];\r\n///Required Fields Validation\r\n requiredFields.forEach(field => {\r\n if (index === 0) {\r\n\r\n if (!values[BaseElement]) {\r\n\r\n errors[BaseElement][field] = 'is Required';\r\n } else if (!values[BaseElement][field]) {\r\n errors[BaseElement][field] = 'is Required';\r\n }\r\n } else {\r\n if (!values[TopElement] || !values[TopElement][BaseElement]) {\r\n errors[TopElement][BaseElement][field] = 'is Required';\r\n\r\n } else if (!values[TopElement][BaseElement][field]) {\r\n errors[TopElement][BaseElement][field] = 'is Required';\r\n\r\n }\r\n }\r\n })\r\n //Other Validation\r\n if (index === 0) {\r\n if (\r\n values[BaseElement] && values[BaseElement].Email &&\r\n !/^[A-Z0-9._%+-]+@[A-Z0-9.-]+\\.[A-Z]{2,4}$/i.test(values[BaseElement].Email)\r\n ) {\r\n errors[BaseElement].Email = 'Invalid email address'\r\n }\r\n if (\r\n values[BaseElement] && values[BaseElement].Mobile &&\r\n !/^[0-9]{10}$/i.test(values[BaseElement].Mobile)\r\n ) {\r\n errors[BaseElement].Mobile = 'Invalid Mobile Number'\r\n }\r\n let today=new Date();\r\n if (values[BaseElement] && values[BaseElement].StartDate && new Date(values[BaseElement].StartDate) < today) {\r\n errors[BaseElement].StartDate = 'Invalid Event Start Date'\r\n }\r\n if (values[BaseElement] && values[BaseElement].EndDate && new Date(values[BaseElement].EndDate) < new Date(values[BaseElement].StartDate) ) {\r\n errors[BaseElement].EndDate = 'Invalid Event End Date';\r\n }\r\n if (values[BaseElement] && values[BaseElement].RainStartDate && values[BaseElement].RainStartDate <= values[BaseElement].StartDate) {\r\n errors[BaseElement].RainStartDate = 'Invalid Rain Start Date'\r\n }\r\n if (values[BaseElement] && values[BaseElement].RainEndDate && values[BaseElement].RainEndDate < values[BaseElement].RainStartDate) {\r\n errors[BaseElement].RainEndDate = 'Invalid Rain End Date'\r\n }\r\n } else {\r\n if (values[TopElement] && values[TopElement][BaseElement]) {\r\n if (BaseElement === 'VendorDetails') {\r\n values[TopElement].map((ele, index) => {\r\n errors[TopElement][index][BaseElement] = {};\r\n if (ele[BaseElement].Email &&\r\n !/^[A-Z0-9._%+-]+@[A-Z0-9.-]+\\.[A-Z]{2,4}$/i.test(ele[BaseElement].Email)\r\n ) {\r\n ele[BaseElement].Email = 'Invalid email address'\r\n }\r\n if (ele[BaseElement].Mobile &&\r\n !/^[0-9]{10}$/i.test(ele[BaseElement].Mobile)) {\r\n ele[BaseElement].Mobile = 'Invalid Mobile Number'\r\n }\r\n return null;\r\n })\r\n }\r\n if (values[TopElement][BaseElement].Email &&\r\n !/^[A-Z0-9._%+-]+@[A-Z0-9.-]+\\.[A-Z]{2,4}$/i.test(values[TopElement][BaseElement].Email)\r\n ) {\r\n errors[TopElement][BaseElement].Email = 'Invalid email address'\r\n }\r\n if (values[TopElement][BaseElement].Mobile &&\r\n !/^[0-9]{10}$/i.test(values[TopElement][BaseElement].Mobile)) {\r\n errors[TopElement][BaseElement].Mobile = 'Invalid Mobile Number'\r\n }\r\n if (BaseElement === 'ApplicantDetails') {\r\n if (values[TopElement][BaseElement].State && !(values[TopElement][BaseElement].State==='Maryland' || values[TopElement][BaseElement].State==='MD'))\r\n {\r\n errors[TopElement][BaseElement].State=`Applicant's Residency should be in maryland`;\r\n }\r\n }\r\n if (BaseElement === 'EventDetails') {\r\n values[TopElement][BaseElement].map((x, index) => {\r\n errors[TopElement][BaseElement][index] = {};\r\n if (x.EventEndTime\r\n && lightFormat(x.EventEndTime, 'HH:mm') < lightFormat(x.EventStartTime, 'HH:mm')) {\r\n errors[TopElement][BaseElement][index].EventEndTime = 'Invalid Event End Time'\r\n }\r\n if (x.AlcoholStartTime\r\n && lightFormat(x.AlcoholStartTime, 'HH:mm') < lightFormat(x.EventStartTime, 'HH:mm')) {\r\n errors[TopElement][BaseElement][index].AlcoholStartTime = 'Invalid Alcohol Start Time'\r\n }\r\n if (x.AlcoholEndTime\r\n && (lightFormat(x.AlcoholEndTime, 'HH:mm') < lightFormat(x.AlcoholStartTime, 'HH:mm') ||\r\n lightFormat(x.AlcoholEndTime, 'HH:mm') > lightFormat(x.EventEndTime, 'HH:mm'))\r\n ) {\r\n errors[TopElement][BaseElement][index].AlcoholEndTime = 'Invalid Alcohol End Time'\r\n }\r\n return null;\r\n })\r\n }\r\n }\r\n }\r\n\r\n })\r\n }\r\n return errors;\r\n}\r\n export default validate\r\n","import React, {Component} from \"react\";\r\nimport {RenderContactInfo, RenderTextField} from \"../../Common/Component\";\r\nimport {Field, FormSection, reduxForm} from \"redux-form\";\r\nimport {connect} from \"react-redux\";\r\nimport {SET_STEP, Steps} from \"../../Common/ActionConstants\";\r\nimport validate from \"../../Common/ValidateForm\";\r\n\r\nexport class ApplicantDetails extends Component {\r\n constructor(props) {\r\n super(props);\r\n this.props.SetStepName(Steps[0]);\r\n }\r\n\r\n render() {\r\n const {handleSubmit} = this.props;\r\n return (\r\n \r\n \r\n
)\r\n }\r\n}\r\n\r\nconst mapDispatchToProps = (dispatch) => {\r\n return {\r\n SetStepName: (StepName) =>\r\n (dispatch({type: SET_STEP, StepName: StepName}))\r\n };\r\n};\r\n\r\nconst mapStateToProps = (state) => {\r\n return {\r\n FestivalReducers: state.FestivalReducers,\r\n };\r\n};\r\nApplicantDetails = reduxForm({\r\n form: 'FestivalForm',\r\n destroyOnUnmount: false,\r\n validate,\r\n\r\n})(ApplicantDetails);\r\nexport default connect(mapStateToProps, mapDispatchToProps)(ApplicantDetails);\r\n","import React, {Component} from \"react\";\r\nimport {DateField, RenderTextField, TextFieldReadonly, TimeField} from \"../../Common/Component\";\r\nimport {MDBCol, MDBRow} from \"mdbreact\";\r\nimport {change, Field, FormSection, formValueSelector, reduxForm} from \"redux-form\";\r\nimport {connect} from \"react-redux\";\r\nimport {SET_STEP} from \"../../Common/ActionConstants\";\r\nimport validate from \"../../Common/ValidateForm\";\r\nimport {eachDayOfInterval, lightFormat} from 'date-fns'\r\n\r\nexport class EventDetails extends Component {\r\n\r\n render() {\r\n\r\n return (\r\n \r\n
Event Details \r\n
\r\n
)\r\n }\r\n}\r\n\r\nconst selector = formValueSelector('FestivalForm');\r\nconst mapDispatchToProps = (dispatch) => {\r\n return {\r\n SetStepName: (StepName) =>\r\n (dispatch({type: SET_STEP, StepName: StepName}))\r\n };\r\n};\r\n\r\nconst mapStateToProps = (state) => {\r\n return {\r\n FestivalReducers: state.FestivalReducers,\r\n Event: selector(state, 'Event'),\r\n };\r\n};\r\nEventDetails = reduxForm({\r\n form: 'FestivalForm',\r\n destroyOnUnmount: false,\r\n validate\r\n})(EventDetails);\r\nexport default connect(mapStateToProps, mapDispatchToProps)(EventDetails);\r\n","import React, {Component} from \"react\";\r\nimport {\r\n InputNumber,\r\n InputTextArea,\r\n MaterialCheckBox,\r\n MaterialRadio,\r\n RenderContactInfo,\r\n RenderTextField\r\n} from \"../../Common/Component\";\r\nimport {MDBCol, MDBRow} from \"mdbreact\";\r\nimport {SET_STEP} from \"../../Common/ActionConstants\";\r\nimport {Field, FormSection, formValueSelector, reduxForm} from \"redux-form\";\r\nimport validate from \"../../Common/ValidateForm\";\r\nimport {connect} from \"react-redux\";\r\nimport {FormControl, FormGroup, FormLabel} from \"@material-ui/core\";\r\n\r\nexport class FacilityDetails extends Component {\r\n\r\n render() {\r\n return (\r\n \r\n \r\n
)\r\n }\r\n}\r\n\r\nconst selector = formValueSelector('FestivalForm');\r\nconst mapDispatchToProps = (dispatch) => {\r\n return {\r\n SetStepName: (StepName) =>\r\n (dispatch({type: SET_STEP, StepName: StepName}))\r\n };\r\n};\r\n\r\nconst mapStateToProps = (state) => {\r\n return {\r\n FestivalReducers: state.FestivalReducers,\r\n FormValue: selector(state, 'Facility'),\r\n };\r\n};\r\nFacilityDetails = reduxForm({\r\n form: 'FestivalForm',\r\n destroyOnUnmount: false,\r\n validate\r\n})(FacilityDetails);\r\nexport default connect(mapStateToProps, mapDispatchToProps)(FacilityDetails);\r\n","import React from \"react\";\r\nimport {makeStyles} from \"@material-ui/core/styles\";\r\nimport {Grid, Paper, TextField} from \"@material-ui/core\";\r\nimport Typography from \"@material-ui/core/Typography\";\r\nimport {lightFormat} from \"date-fns\";\r\nimport DataGrid from 'react-data-grid';\r\n\r\nconst useStyles = makeStyles((theme) => ({\r\n\r\n paper: {\r\n padding: theme.spacing(1),\r\n textAlign: 'center',\r\n color: theme.palette.text.secondary,\r\n border: 0,\r\n marginBottom: 0,\r\n paddingBottom: 0,\r\n },\r\n\r\n}));\r\nexport const ViewApplicant = ({input, label, cName, data, nameField, address, other}) => {\r\n\r\n const classes = useStyles();\r\n return \r\n {data !== undefined && data !== null && \r\n \r\n \r\n \r\n }\r\n \r\n};\r\nexport const ViewProperty = ({input, label, cName, data, nameField, address, other}) => {\r\n\r\n const classes = useStyles();\r\n return \r\n {data !== undefined && data !== null && \r\n \r\n \r\n\r\n }\r\n \r\n};\r\n\r\nexport const ViewEvent = ({data}) => {\r\n const classes = useStyles();\r\n return \r\n {data !== undefined && data !== null && \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n {data.EventDetailsReadOnly.map((ele, index) => {\r\n return ' + ele.EventStartTime + ' to ' + ele.EventEndTime}\r\n InputProps={{readOnly: true,}}\r\n style={{width: \"510px\"}}\r\n />\r\n })}\r\n {data.EventDetailsReadOnly.map((ele, index) => {\r\n return ' + ele.AlcoholStartTime + ' to ' + ele.AlcoholEndTime}\r\n InputProps={{readOnly: true,}}\r\n style={{width: \"510px\"}}\r\n />\r\n })}\r\n }\r\n \r\n}\r\nexport const ViewFacilities = ({data}) => {\r\n const classes = useStyles();\r\n return \r\n \r\n {data && \r\n \r\n
}\r\n \r\n \r\n}\r\nexport const ViewPromoter = ({data}) => {\r\n const classes = useStyles();\r\n return \r\n \r\n {data && \r\n \r\n \r\n \r\n \r\n \r\n
\r\n }\r\n \r\n \r\n}\r\nexport const ViewVendor = ({data}) => {\r\n const classes = useStyles();\r\n return \r\n \r\n {data && data.FestivalVendorDetailsReadOnly.map(ele => {\r\n return \r\n \r\n \r\n
\r\n })}\r\n \r\n \r\n}\r\nconst FileDownload = (file, element) => {\r\n if (file !== undefined) {\r\n const binaryString = window.atob(file.MemoryStream); // Comment this if not using base64\r\n const bytes = new Uint8Array(binaryString.length);\r\n let blob = new Blob([bytes.map((byte, i) => binaryString.charCodeAt(i))]);// change resultByte to bytes\r\n let link = document.getElementById(element);\r\n if (link !== null) {\r\n link.href = window.URL.createObjectURL(blob);\r\n link.download = file.FileName;\r\n link.hidden = false;\r\n }\r\n }\r\n};\r\nconst CertFileDownload = (file, element, click) => {\r\n if (file !== undefined) {\r\n const binaryString = window.atob(file.MemoryStream); // Comment this if not using base64\r\n const bytes = new Uint8Array(binaryString.length);\r\n let blob = new Blob([bytes.map((byte, i) => binaryString.charCodeAt(i))]);// change resultByte to bytes\r\n let link = document.getElementById(element);\r\n if (link !== null) {\r\n link.href = window.URL.createObjectURL(blob);\r\n link.download = file.FileName;\r\n link.hidden = false;\r\n link.innerText = \"Click here to download the License\"\r\n }\r\n }\r\n};\r\nexport const ViewAffidavit = (data) => {\r\n let files = data.data.Files;\r\n if (files.length > 0) {\r\n let Applicant = files.find(x => x.FileName.includes('ApplicantSignature'));\r\n FileDownload(Applicant, \"ApplicantSignature\");\r\n let Property = files.find(x => x.FileName.includes('PropertyOwnerSignature'));\r\n FileDownload(Property, \"PropertyOwnerSignature\");\r\n }\r\n\r\n return \r\n Applicant Signature \r\n \r\n Facility/Property Owner Signature \r\n \r\n \r\n}\r\nexport const DownloadCert = ({data, fileName, click}) => {\r\n let files = null;\r\n if ((data.Files !== undefined || true)) {\r\n if (data.Files.length > 0) {\r\n files = data.Files.find(x => x.FileName.includes(fileName) && x.FileName.includes(\"pdf\") );\r\n if (files !== undefined) {\r\n if (files.FileName !== null && files.FileName !== undefined) {\r\n CertFileDownload(files, \"LicenseURL\", click);\r\n }\r\n }\r\n }\r\n }\r\n\r\n return \r\n}\r\nexport const ViewFileUpload = (data) => {\r\n let files = data.data.Files;\r\n if (files.length > 0) {\r\n let Festival = files.find(x => x.FileName.includes('FestivalDiagram'));\r\n FileDownload(Festival, \"FestivalDiagramView\");\r\n let Security = files.find(x => x.FileName.includes('SecurityPlan'));\r\n FileDownload(Security, \"SecurityPlanView\");\r\n let Flyer = files.find(x => x.FileName.includes('FestivalInvitation'));\r\n FileDownload(Flyer, \"FlyerView\");\r\n let Letter = files.find(x => x.FileName.includes('LetterOfDetermination'));\r\n FileDownload(Letter, \"LetterView\");\r\n let Rental = files.find(x => x.FileName.includes('RentalAgreement'));\r\n FileDownload(Rental, \"RentalView\");\r\n }\r\n return \r\n {/**/}\r\n {files.length > 0 && files.find(x => x.FileName.includes('FestivalDiagram')) &&\r\n Festival Diagram }\r\n {files.length > 0 && files.find(x => x.FileName.includes('SecurityPlan')) &&\r\n Security Plan }\r\n {files.length > 0 && files.find(x => x.FileName.includes('FestivalInvitation')) &&\r\n Invitation, flyer or promotion }\r\n {files.length > 0 && files.find(x => x.FileName.includes('LetterOfDetermination')) &&\r\n IRS Letter of Determination }\r\n {files.length > 0 && files.find(x => x.FileName.includes('RentalAgreement')) &&\r\n Rental Agreement }\r\n \r\n\r\n \r\n}\r\nexport const ViewStatus = ({input, label, cName, data, nameField, address, other}) => {\r\n return {data &&
\r\n \r\n \r\n \r\n \r\n Vendor Application Status\r\n \r\n \r\n {data.VendorStatuses.length > 0 && }
}
\r\n};\r\nexport const ViewContactInfo = ({input, label, cName, data, nameField, address, other}) => {\r\n let width = (nameField === 'true' && address === 'true' && other === 'true' ? \"1050px\" : \"510px\");\r\n return {data &&
\r\n {nameField === 'true' && } {other === 'true' && }\r\n {address === 'true' && }\r\n
}\r\n
\r\n};\r\n","import React, {Component} from \"react\";\r\n\r\nimport {change, Field, FormSection, reduxForm} from \"redux-form\";\r\nimport {GenericCallbacks, SET_STEP, SharePointURL} from \"../../Common/ActionConstants\";\r\nimport validate from \"../../Common/ValidateForm\";\r\nimport {connect} from \"react-redux\";\r\nimport {genericFetch} from \"../../Common/GenericFetch\";\r\nimport {RenderFileInput} from \"../../Common/Component\";\r\nimport {ViewFileUpload} from \"../../Common/ReadonlyComponents\";\r\n\r\nexport class FileUploads extends Component {\r\n\r\n render() {\r\n const handleUpload = (imageFile, name) => {\r\n name = name.replace(\"FileUploads.\", '');\r\n let URL = SharePointURL + `?ID=${this.props.FestivalReducers.ApplicationID}&FileName=${name}`;\r\n const formData = new FormData();\r\n formData.append(\"\", imageFile.files[0]);\r\n let requestOptions = {\r\n method: 'POST',\r\n body: formData,\r\n redirect: 'follow'\r\n };\r\n this.props.Post(URL, formData, requestOptions, null);\r\n this.props.dispatch(change('FestivalForm', name, name));\r\n\r\n };\r\n return (\r\n \r\n \r\n
)\r\n }\r\n}\r\n\r\nconst mapDispatchToProps = (dispatch) => {\r\n return {\r\n SetStepName: (StepName) =>\r\n (dispatch({type: SET_STEP, StepName: StepName})),\r\n\r\n Post: (url, data, headers, handleFetchComplete) =>\r\n (dispatch(genericFetch(url, headers\r\n , \"POST\", data, false,\r\n \"Saved Successfully\",\r\n GenericCallbacks(null, null, null, null))))\r\n };\r\n};\r\n\r\nconst mapStateToProps = (state) => {\r\n return {\r\n FestivalReducers: state.FestivalReducers,\r\n };\r\n};\r\nFileUploads = reduxForm({\r\n form: 'FestivalForm',\r\n destroyOnUnmount: false,\r\n validate\r\n})(FileUploads);\r\nexport default connect(mapStateToProps, mapDispatchToProps)(FileUploads);\r\n","import React, {Component} from \"react\";\r\nimport {MaterialRadio, RenderContactInfo, RenderTextField} from \"../../Common/Component\";\r\nimport {MDBCol, MDBRow} from \"mdbreact\";\r\nimport {Field, FormSection, formValueSelector, reduxForm} from \"redux-form\";\r\nimport {SET_STEP} from \"../../Common/ActionConstants\";\r\nimport validate from \"../../Common/ValidateForm\";\r\nimport {connect} from \"react-redux\";\r\nimport Typography from \"@material-ui/core/Typography\";\r\n\r\nexport class PromoterDetails extends Component {\r\n render() {\r\n return (\r\n )\r\n }\r\n}\r\n\r\nconst selector = formValueSelector('FestivalForm');\r\nconst mapDispatchToProps = (dispatch) => {\r\n return {\r\n SetStepName: (StepName) =>\r\n (dispatch({type: SET_STEP, StepName: StepName}))\r\n };\r\n};\r\n\r\nconst mapStateToProps = (state) => {\r\n return {\r\n FestivalReducers: state.FestivalReducers,\r\n Promoter: selector(state, 'Promoter'),\r\n };\r\n};\r\nPromoterDetails = reduxForm({\r\n form: 'FestivalForm',\r\n destroyOnUnmount: false,\r\n validate\r\n})(PromoterDetails);\r\nexport default connect(mapStateToProps, mapDispatchToProps)(PromoterDetails);","import React, {Component} from \"react\";\r\nimport {RenderContactInfo, RenderTextField, SelectVariants, TextFieldReadonly} from \"../../Common/Component\";\r\nimport {GenericCallbacks, GET_FESTIVAL_APPLICATION_Edit, SET_STEP} from \"../../Common/ActionConstants\";\r\nimport {change, Field, FormSection, formValueSelector, reduxForm} from \"redux-form\";\r\nimport validate from \"../../Common/ValidateForm\";\r\nimport {connect} from \"react-redux\";\r\nimport {MDBCol, MDBRow} from \"mdbreact\";\r\nimport {Box, Button, ButtonGroup, Card} from \"@material-ui/core\";\r\nimport Typography from \"@material-ui/core/Typography\";\r\nimport {customAlphabet} from \"nanoid\";\r\nimport {genericFetch} from \"../../Common/GenericFetch\";\r\n\r\nexport class VendorDetails extends Component {\r\n constructor(props) {\r\n super(props);\r\n let vCount = 1;\r\n let id = customAlphabet('123456789STUVWXYZ', 10)();\r\n if (this.props.FormValue) {\r\n vCount = this.props.FormValue.length;\r\n if (vCount > 0) {\r\n console.log(this.props.FormValue.map(ele => ele.VendorId));\r\n this.state = {\r\n 'VendorCount': vCount,\r\n VendorId: [...this.props.FormValue.map(ele => ele.VendorID)]\r\n }\r\n } else {\r\n this.state = {\r\n 'VendorCount': vCount,\r\n VendorId: [id]\r\n }\r\n }\r\n } else {\r\n this.state = {\r\n 'VendorCount': vCount,\r\n VendorId: [id]\r\n }\r\n }\r\n console.log(this.state);\r\n this.props.dispatch(change('FestivalForm', 'FestivalVendorDetails[0].VendorID', this.state.VendorId[0]));\r\n }\r\n\r\n render() {\r\n\r\n\r\n return (\r\n \r\n \r\n
)\r\n }\r\n}\r\n\r\nconst mapDispatchToProps = (dispatch) => {\r\n return {\r\n SetStepName: (StepName) =>\r\n (dispatch({type: SET_STEP, StepName: StepName})),\r\n DeleteVendor: (url, callback) => {\r\n (dispatch(genericFetch(url, null, \"DELETE\", null, false, null, callback())))\r\n },\r\n get: (url, callback) =>\r\n (dispatch(genericFetch(url, null, \"GET\", null, false, null, GenericCallbacks(GET_FESTIVAL_APPLICATION_Edit, callback()), null)))\r\n\r\n }\r\n};\r\nconst selector = formValueSelector('FestivalForm');\r\n\r\nconst mapStateToProps = (state) => {\r\n return {\r\n FestivalReducers: state.FestivalReducers,\r\n FormValue: selector(state, 'FestivalVendorDetails'),\r\n };\r\n};\r\nVendorDetails = reduxForm({\r\n form: 'FestivalForm',\r\n destroyOnUnmount: false,\r\n validate\r\n})(VendorDetails);\r\nexport default connect(mapStateToProps, mapDispatchToProps)(VendorDetails);","import React, {Component} from \"react\";\r\nimport {RenderTextField} from \"../../Common/Component\";\r\nimport {MDBCol, MDBRow} from \"mdbreact\";\r\nimport {Field, FormSection, formValueSelector, reduxForm} from \"redux-form\";\r\nimport {connect} from \"react-redux\";\r\nimport {FestivalPostURL, GenericCallbacks, SET_STEP, SharePointURL} from \"../../Common/ActionConstants\";\r\nimport validate from \"../../Common/ValidateForm\";\r\nimport Typography from \"@material-ui/core/Typography\";\r\nimport SignatureCanvas from \"react-signature-canvas\";\r\nimport {genericFetch} from \"../../Common/GenericFetch\";\r\nimport Button from \"@material-ui/core/Button\";\r\n\r\nexport class ApplicantSignature extends Component {\r\n sigPad = {};\r\n dataURItoBlob = (dataURI) => {\r\n // convert base64 to raw binary data held in a string\r\n // doesn't handle URLEncoded DataURIs - see SO answer #6850276 for code that does this\r\n let byteString = atob(dataURI.split(',')[1]);\r\n\r\n // separate out the mime component\r\n let mimeString = dataURI.split(',')[0].split(':')[1].split(';')[0];\r\n\r\n // write the bytes of the string to an ArrayBuffer\r\n let ab = new ArrayBuffer(byteString.length);\r\n let ia = new Uint8Array(ab);\r\n for (let i = 0; i < byteString.length; i++) {\r\n ia[i] = byteString.charCodeAt(i);\r\n }\r\n\r\n //New Code\r\n return new Blob([ab], {type: mimeString});\r\n };\r\n\r\n clear = () => {\r\n this.sigPad.clear()\r\n };\r\n trim = () => {\r\n let context = this.sigPad.getCanvas().getContext(\"2d\");\r\n context.fillText(`${this.props.FormValue.ApplicantTitle}. ${this.props.FormValue.ApplicantName} - ${new Date()}`, 10, 175);\r\n let sign = this.dataURItoBlob(this.sigPad.getTrimmedCanvas().toDataURL('image/png'));\r\n let URL = SharePointURL + `?ID=${this.props.FestivalReducers.ApplicationID}&FileName=ApplicantSignature.png`;\r\n const formData = new FormData();\r\n formData.append(\"image\", sign);\r\n let requestOptions = {\r\n method: 'POST',\r\n body: formData,\r\n redirect: 'follow'\r\n };\r\n this.props.Post(URL, formData, requestOptions, () => {\r\n let URL = FestivalPostURL;\r\n let json = {\r\n IsApplicantAffidavit: 1,\r\n FestivalID: this.props.FestivalReducers.ApplicationID,\r\n StepName: this.props.FestivalReducers.StepName + '_Sign'\r\n };\r\n\r\n this.props.Patch(URL, json);\r\n });\r\n };\r\n\r\n render() {\r\n return (\r\n \r\n
\r\n As applicant, I hereby certify that if the license applied for is granted, I will conform to all\r\n State and County laws\r\n and regulations relating to the sale of alcoholic beverages, as well as to the rules and regulations\r\n of the Board of\r\n License Commissioners for Montgomery County, and hereby grant permission to the State Comptroller,\r\n his duly\r\n authorized deputies, inspectors and clerks, The Board of License Commissioners for Montgomery\r\n County, its duly\r\n authorized employees, and any peace officer of Montgomery County to inspect and search at any and\r\n all hours,\r\n without warrant, the premises and any and all parts thereof upon and in which said business is to be\r\n conducted\r\n during the term of the license. \r\n
\r\n Affidavit\r\n \r\n
\r\n
\r\n Also, by signing this application, I do solemnly declare and affirm under the penalties of perjury\r\n that the contents of\r\n the foregoing document are true and correct to the best of my knowledge, information, and belief.\r\n \r\n
\r\n
)\r\n }\r\n}\r\n\r\nconst mapDispatchToProps = (dispatch) => {\r\n return {\r\n SetStepName: (StepName) =>\r\n (dispatch({type: SET_STEP, StepName: StepName})),\r\n Post: (url, data, headers, handleFetchComplete) =>\r\n (dispatch(genericFetch(url, headers\r\n , \"POST\", data, false,\r\n \"Saved Successfully\",\r\n GenericCallbacks(null, handleFetchComplete(), null, null))))\r\n , Patch: (url, json, handleFetchComplete) =>\r\n (dispatch(genericFetch(url, {\"Content-Type\": \"application/json\"}\r\n , \"PATCH\", json, false,\r\n \"Saved Successfully\",\r\n GenericCallbacks(null, null, null, null))))\r\n };\r\n};\r\nconst selector = formValueSelector('FestivalForm');\r\n\r\nconst mapStateToProps = (state) => {\r\n return {\r\n FestivalReducers: state.FestivalReducers,\r\n FormValue: selector(state, 'ApplicantAffidavit'),\r\n\r\n };\r\n};\r\nApplicantSignature = reduxForm({\r\n form: 'FestivalForm',\r\n destroyOnUnmount: true,\r\n validate\r\n})(ApplicantSignature);\r\nexport default connect(mapStateToProps, mapDispatchToProps)(ApplicantSignature);\r\n","import React, {Component} from \"react\";\r\nimport {MaterialRadio, RenderContactInfo} from \"../../Common/Component\";\r\nimport {MDBCol, MDBRow} from \"mdbreact\";\r\nimport {SET_STEP} from \"../../Common/ActionConstants\";\r\nimport {change, Field, FormSection, formValueSelector, reduxForm} from \"redux-form\";\r\nimport validate from \"../../Common/ValidateForm\";\r\nimport {connect} from \"react-redux\";\r\nimport {customAlphabet} from \"nanoid\";\r\n\r\nexport class PropertyOwner extends Component {\r\n\r\n render() {\r\n return (\r\n \r\n \r\n
)\r\n }\r\n}\r\n\r\nconst selector = formValueSelector('FestivalForm');\r\nconst mapDispatchToProps = (dispatch) => {\r\n return {\r\n SetStepName: (StepName) =>\r\n (dispatch({type: SET_STEP, StepName: StepName}))\r\n };\r\n};\r\n\r\nconst mapStateToProps = (state) => {\r\n return {\r\n FestivalReducers: state.FestivalReducers,\r\n Other: selector(state, 'Other'),\r\n FormValue: selector(state, 'Applicant', 'Event', 'Property', 'Facility'\r\n , 'Promoter', 'FestivalVendors'),\r\n };\r\n};\r\nPropertyOwner = reduxForm({\r\n form: 'FestivalForm',\r\n destroyOnUnmount: false,\r\n validate\r\n})(PropertyOwner);\r\nexport default connect(mapStateToProps, mapDispatchToProps)(PropertyOwner);\r\n","import React from 'react';\r\nimport PropTypes from 'prop-types';\r\nimport {makeStyles} from '@material-ui/core/styles';\r\nimport clsx from 'clsx';\r\nimport Stepper from '@material-ui/core/Stepper';\r\nimport Step from '@material-ui/core/Step';\r\nimport StepLabel from '@material-ui/core/StepLabel';\r\nimport Check from '@material-ui/icons/Check';\r\nimport Button from '@material-ui/core/Button';\r\nimport Typography from '@material-ui/core/Typography';\r\nimport ApplicantDetails from \"../Components/SubComponents/ApplicantDetails\";\r\nimport EventDetails from \"../Components/SubComponents/EventDetails\";\r\nimport FacilityDetails from \"../Components/SubComponents/FacilityDetails\";\r\nimport FileUploads from \"../Components/SubComponents/FileUploads\";\r\nimport PromoterDetails from \"../Components/SubComponents/PromoterDetails\";\r\nimport VendorDetails from \"../Components/SubComponents/VendorDetails\";\r\nimport ApplicantSignature from \"../Components/SubComponents/ApplicantSignature\";\r\nimport {connect} from \"react-redux\";\r\nimport {formValueSelector, getFormSyncErrors} from \"redux-form\";\r\nimport {genericFetch} from \"./GenericFetch\";\r\nimport {ApplicationCost, FestivalPostURL, GenericCallbacks, SET_STEP, Steps} from \"./ActionConstants\";\r\nimport {customAlphabet} from \"nanoid\";\r\nimport {differenceInCalendarDays, lightFormat} from \"date-fns\";\r\nimport PropertyOwner from \"../Components/SubComponents/PropertyOwner\";\r\nimport {GoHome} from \"./Component\";\r\n\r\nconst useQontoStepIconStyles = makeStyles({\r\n root: {\r\n color: '#eaeaf0',\r\n display: 'flex',\r\n height: 22,\r\n alignItems: 'center',\r\n },\r\n active: {\r\n color: '#784af4',\r\n },\r\n circle: {\r\n width: 8,\r\n height: 8,\r\n borderRadius: '50%',\r\n backgroundColor: 'currentColor',\r\n },\r\n completed: {\r\n color: '#784af4',\r\n zIndex: 1,\r\n fontSize: 18,\r\n },\r\n});\r\n\r\nfunction QontoStepIcon(props) {\r\n const classes = useQontoStepIconStyles();\r\n const {active, completed} = props;\r\n\r\n return (\r\n \r\n {completed ?
: }\r\n
\r\n );\r\n}\r\n\r\nQontoStepIcon.propTypes = {\r\n /**\r\n * Whether this step is active.\r\n */\r\n active: PropTypes.bool,\r\n /**\r\n * Mark the step as completed. Is passed to child components.\r\n */\r\n completed: PropTypes.bool,\r\n};\r\n\r\nconst useStyles = makeStyles((theme) => ({\r\n root: {\r\n width: '100%',\r\n },\r\n button: {\r\n marginRight: theme.spacing(1),\r\n },\r\n instructions: {\r\n marginTop: theme.spacing(1),\r\n marginBottom: theme.spacing(1),\r\n },\r\n}));\r\n\r\nfunction getSteps() {\r\n return ['Applicant Details', 'Event Details', 'Property Owner', 'Facility Details', 'Promoter & Security Details', 'Vendor Details', 'File Uploads', 'Affidavit'];\r\n}\r\n\r\nconst MaterialStepper = (props) => {\r\n const classes = useStyles();\r\n\r\n const [activeStep, setActiveStep] = React.useState(0);\r\n const steps = getSteps();\r\n\r\n const handleNext = () => {\r\n let MainURL = window.location.href;\r\n\r\n let URL = FestivalPostURL;\r\n // console.log(URL);\r\n const nanoid = customAlphabet('1234567890ghijkl', 10);\r\n if (activeStep === 0) {\r\n URL = FestivalPostURL + `?FestivalID=${props.FestivalReducers.ApplicationID}`;\r\n let json = props.FormValue.Applicant;\r\n\r\n json.NonProfitOrganizationName = props.FormValue.Applicant.NonProfitOrganizationName;\r\n\r\n json.OrganizerDetails.ContactType = \"Organizer\";\r\n json.OrganizerDetails.FestivalID = props.FestivalReducers.ApplicationID;\r\n json.OrganizerDetails.CreatedOn = null;\r\n json.OrganizerDetails.ModifiedOn = null;\r\n\r\n json.ApplicantDetails.ContactType = \"Applicant\";\r\n json.ApplicantDetails.FestivalID = props.FestivalReducers.ApplicationID;\r\n json.ApplicantDetails.CreatedOn = null;\r\n json.ApplicantDetails.ModifiedOn = null;\r\n json.StepName = props.FestivalReducers.StepName;\r\n json.FestivalID = props.FestivalReducers.ApplicationID;\r\n\r\n if (MainURL.includes('FestivalApplicationEdit')) {\r\n props.Patch(URL, json);\r\n } else {\r\n json.OrganizerDetails.ContactID = customAlphabet('1234567890ghijkl', 10)();\r\n json.ApplicantDetails.ContactID = nanoid();\r\n props.Post(URL, json);\r\n }\r\n\r\n }\r\n if (activeStep === 1) {\r\n\r\n let EventDetails = props.FormValue.Event.EventDetails.map((value, index) => {\r\n let detail = {};\r\n detail.FestivalID = props.FestivalReducers.ApplicationID;\r\n if (value.EventID === undefined || value.EventID === null) {\r\n detail.EventID = nanoid();\r\n } else {\r\n detail.EventID = value.EventID;\r\n }\r\n detail.EventDate = value.Date;\r\n detail.CreatedOn = null;\r\n detail.ModifiedOn = null;\r\n detail.EventStartTime = lightFormat(value.EventStartTime, 'HH:mm');\r\n\r\n detail.EventEndTime = lightFormat(value.EventEndTime, 'HH:mm');\r\n detail.AlcoholStartTime = lightFormat(value.AlcoholStartTime, 'HH:mm');\r\n detail.AlcoholEndTime = lightFormat(value.AlcoholEndTime, 'HH:mm');\r\n return detail;\r\n });\r\n let event = props.FormValue.Event.EventDetails;\r\n let json = {};\r\n json = props.FormValue.Event;\r\n json.FestivalID = props.FestivalReducers.ApplicationID;\r\n json.EventDetails = EventDetails;\r\n json.StepName = props.FestivalReducers.StepName;\r\n json.Amount = (differenceInCalendarDays(\r\n new Date(props.FormValue.Event.EndDate),\r\n new Date(props.FormValue.Event.StartDate)\r\n ) + 1) * ApplicationCost;\r\n console.log(differenceInCalendarDays(\r\n new Date(props.FormValue.Event.EndDate),\r\n new Date(props.FormValue.Event.StartDate)\r\n ) + 1, ApplicationCost);\r\n props.Patch(URL, json);\r\n json.EventDetails = event;\r\n }\r\n if (activeStep === 2) {\r\n let json = {};\r\n json = props.FormValue.Property;\r\n if (json.PropertyDetails.ContactID === undefined || json.PropertyDetails.ContactID === null) {\r\n json.PropertyDetails.ContactID = customAlphabet('1234567890ghijkl', 10)();\r\n }\r\n json.PropertyDetails.ContactType = \"PropertyOwner\";\r\n json.PropertyDetails.FestivalID = props.FestivalReducers.ApplicationID;\r\n json.PropertyDetails.CreatedOn = null;\r\n json.PropertyDetails.ModifiedOn = null;\r\n json.FestivalID = props.FestivalReducers.ApplicationID;\r\n json.StepName = props.FestivalReducers.StepName;\r\n json.IsPropertyOwnerSame = (json.IsPropertyOwnerSame === 'Yes');\r\n props.Patch(URL, json);\r\n json.IsPropertyOwnerSame = (json.IsPropertyOwnerSame ? 'Yes' : 'No');\r\n\r\n }\r\n if (activeStep === 3) {\r\n let json = {};\r\n json = props.FormValue.Facility;\r\n if (json.FacilityDetails.ContactID === undefined || json.FacilityDetails.ContactID === null) {\r\n json.FacilityDetails.ContactID = customAlphabet('1234567890ghijkl', 10)();\r\n }\r\n json.FacilityDetails.ContactType = \"Facility/Property\";\r\n json.FacilityDetails.FestivalID = props.FestivalReducers.ApplicationID;\r\n json.FacilityDetails.CreatedOn = null;\r\n json.FacilityDetails.ModifiedOn = null;\r\n json.FestivalID = props.FestivalReducers.ApplicationID;\r\n json.StepName = props.FestivalReducers.StepName;\r\n json.IsIndoor = (json.IsIndoor === 'Indoor');\r\n json.AdvertisingType = (json.Radio ? 'Radio' : '') + (json.Flyer ? 'Flyer' : '') + (json.InternetAdv ? 'Internet' : '') + (json.Other ? 'Other' : '');\r\n delete json.Radio;\r\n delete json.Flyer;\r\n delete json.InternetAdv;\r\n delete json.Other;\r\n\r\n props.Patch(URL, json);\r\n json.IsIndoor = (json.IsIndoor ? 'Indoor' : 'Outdoor');\r\n json.Radio = json.AdvertisingType.includes('Radio');\r\n json.Flyer = json.AdvertisingType.includes('Flyer');\r\n json.InternetAdv = json.AdvertisingType.includes('Internet');\r\n json.Other = json.AdvertisingType.includes('Other');\r\n\r\n }\r\n if (activeStep === 4) {\r\n let json = {};\r\n json = props.FormValue.Promoter;\r\n if (json.IsPromoter === 'Yes') {\r\n json.PromoterDetails.ContactType = \"Promoter\";\r\n // json.PromoterDetails.ContactID= customAlphabet('1234567890ghijkl', 10)();\r\n json.PromoterDetails.FestivalID = props.FestivalReducers.ApplicationID;\r\n json.PromoterDetails.CreatedOn = null;\r\n json.PromoterDetails.ModifiedOn = null;\r\n }\r\n if (json.IsSecurity === 'Yes') {\r\n json.SecurityDetails.ContactType = \"Security\";\r\n json.SecurityDetails.FestivalID = props.FestivalReducers.ApplicationID;\r\n json.SecurityDetails.CreatedOn = null;\r\n json.SecurityDetails.ModifiedOn = null;\r\n }\r\n if (json.IsSecurity === 'Yes') {\r\n if (json.SecurityDetails.ContactID === undefined || json.SecurityDetails.ContactID === null)\r\n json.SecurityDetails.ContactID = customAlphabet('1234567890ghijkl', 10)();\r\n }\r\n if (json.IsPromoter === 'Yes') {\r\n if (json.PromoterDetails.ContactID === undefined || json.PromoterDetails.ContactID === null)\r\n json.PromoterDetails.ContactID = customAlphabet('1234567890ghijkl', 10)();\r\n }\r\n\r\n\r\n json.FestivalID = props.FestivalReducers.ApplicationID;\r\n json.StepName = props.FestivalReducers.StepName;\r\n json.IsPromoter = (json.IsPromoter === 'Yes');\r\n json.IsSecurity = (json.IsSecurity === 'Yes');\r\n props.Patch(URL, json);\r\n json.IsPromoter = (json.IsPromoter ? 'Yes' : 'No');\r\n json.IsSecurity = (json.IsSecurity ? 'Yes' : 'No');\r\n }\r\n if (activeStep === 5) {\r\n let vendor = props.FormValue.FestivalVendorDetails.map((value, index) => {\r\n // if (!(MainURL.includes('FestivalApplicationEdit'))) {\r\n if (value.VendorDetails.ContactID === undefined || value.VendorDetails.ContactID === null) {\r\n let id = customAlphabet('1234567890ghijkl', 10)();\r\n value.VendorContactID = id;\r\n value.VendorDetails.ContactID = id;\r\n value.VendorDetails.ContactType = \"Vendor\";\r\n }\r\n\r\n\r\n value.VendorDetails.FestivalID = props.FestivalReducers.ApplicationID;\r\n value.VendorDetails.CreatedOn = null;\r\n value.VendorDetails.ModifiedOn = null;\r\n value.FestivalID = props.FestivalReducers.ApplicationID;\r\n\r\n return value;\r\n });\r\n let json = {\r\n FestivalVendorDetails: vendor,\r\n FestivalID: props.FestivalReducers.ApplicationID,\r\n StepName: props.FestivalReducers.StepName\r\n };\r\n props.Patch(URL, json);\r\n }\r\n if (activeStep === 7) {\r\n let json = {\r\n FestivalID: props.FestivalReducers.ApplicationID,\r\n StepName: props.FestivalReducers.StepName,\r\n Status: 'Submitted'\r\n };\r\n props.Patch(URL, json);\r\n }\r\n setActiveStep((prevActiveStep) => prevActiveStep + 1);\r\n props.SetStepName(Steps[activeStep + 1]);\r\n };\r\n const handleBack = () => {\r\n setActiveStep((prevActiveStep) => prevActiveStep - 1);\r\n props.SetStepName(Steps[activeStep - 1]);\r\n };\r\n\r\n const handleReset = () => {\r\n setActiveStep(0);\r\n GoHome();\r\n };\r\n const getErrors = () => {\r\n let result = false;\r\n let errors = props.synchronousError;\r\n if (Object.keys(errors).length > 0) {\r\n switch (activeStep) {\r\n case 0:\r\n // console.log(errors.hasOwnProperty(\"Applicant\"));\r\n if (errors.hasOwnProperty(\"Applicant\")) {\r\n result = !((Object.keys(errors.Applicant[\"ApplicantDetails\"]).length === 0) && (Object.keys(errors.Applicant[\"OrganizerDetails\"]).length === 0));\r\n return result;\r\n } else {\r\n return false;\r\n }\r\n case 1:\r\n if (errors.hasOwnProperty(\"Event\")) {\r\n let count = true;\r\n errors.Event[\"EventDetails\"].map(x => {\r\n count = count && Object.keys(x).length <= 0;\r\n return null;\r\n });\r\n result = (count && (Object.keys(errors.Event).length === 1));\r\n return !result;\r\n } else {\r\n return false;\r\n }\r\n case 2:\r\n if (errors.hasOwnProperty(\"Property\")) {\r\n return !((Object.keys(errors.Property[\"PropertyDetails\"]).length === 0));\r\n } else {\r\n return false;\r\n }\r\n case 3:\r\n if (errors.hasOwnProperty(\"Facility\")) {\r\n return !((Object.keys(errors.Facility[\"FacilityDetails\"]).length === 0) && (Object.keys(errors.Facility).length === 1));\r\n } else {\r\n return false;\r\n }\r\n\r\n case 4:\r\n if (errors.hasOwnProperty(\"Promoter\")) {\r\n let PromoterValues = props.FormValue.Promoter;\r\n let validate1 = Object.keys(errors.Promoter).length === 2;\r\n if (PromoterValues && PromoterValues.IsPromoter === 'Yes') validate1 = validate1 && (Object.keys(errors.Promoter[\"PromoterDetails\"]).length === 0);\r\n if (PromoterValues && PromoterValues.IsSecurity === 'Yes') validate1 = validate1 && (Object.keys(errors.Promoter[\"SecurityDetails\"]).length === 0);\r\n return !(validate1);\r\n } else {\r\n return false;\r\n }\r\n case 6:\r\n if (errors.hasOwnProperty(\"FileUploads\")) {\r\n return !((Object.keys(errors.FileUploads).length === 0));\r\n } else {\r\n return false;\r\n }\r\n case 5:\r\n if (errors.hasOwnProperty(\"FestivalVendorDetails\")) {\r\n let count = true;\r\n if (errors.FestivalVendorDetails.length >= 0) {\r\n errors.FestivalVendorDetails.map(x => {\r\n if (errors.FestivalVendorDetails.hasOwnProperty(\"VendorDetails\"))\r\n count = count && Object.keys(x).length <= 1 && Object.keys(x.VendorDetails).length <= 0;\r\n else\r\n count = count && Object.keys(x).length <= 1;\r\n return null;\r\n });\r\n }\r\n return !count;\r\n } else {\r\n return false;\r\n }\r\n case 7:\r\n if (errors.hasOwnProperty(\"ApplicantAffidavit\")) {\r\n return !((Object.keys(errors.ApplicantAffidavit).length === 0));\r\n } else {\r\n return false;\r\n }\r\n default:\r\n return false;\r\n }\r\n }\r\n\r\n return result;\r\n };\r\n return (\r\n \r\n
\r\n {steps.map((label) => (\r\n \r\n {label} \r\n \r\n ))}\r\n \r\n\r\n
\r\n {activeStep === steps.length &&\r\n
\r\n \r\n All steps completed - you're finished\r\n \r\n \r\n Reset\r\n \r\n
\r\n }\r\n {activeStep === 0 &&
}{activeStep === 1 &&
\r\n \r\n
}{activeStep === 2 &&
}{activeStep === 3 &&
\r\n \r\n
}{activeStep === 4 &&
}\r\n {activeStep === 5 &&
\r\n \r\n
}\r\n {activeStep === 6 &&
\r\n \r\n
}{activeStep === 7 &&
}\r\n\r\n
\r\n
\r\n {activeStep !== steps.length &&
\r\n \r\n Back\r\n \r\n \r\n {activeStep === steps.length - 1 ? 'Submit the Application' : 'Save & Continue'}\r\n \r\n
\r\n }\r\n
\r\n
\r\n );\r\n};\r\n\r\n\r\nconst mapDispatchToProps = (dispatch) => {\r\n return {\r\n SetStepName: (StepName) =>\r\n (dispatch({type: SET_STEP, StepName: StepName})),\r\n get: (url) =>\r\n (dispatch(genericFetch(url, null, \"GET\", null, false, null, null))),\r\n\r\n Post: (url, json, handleFetchComplete) =>\r\n (dispatch(genericFetch(url, {\"Content-Type\": \"application/json\"}\r\n , \"POST\", json, false,\r\n \"Saved Successfully\",\r\n GenericCallbacks(null, null, null, null))))\r\n , Patch: (url, json, handleFetchComplete) =>\r\n (dispatch(genericFetch(url, {\"Content-Type\": \"application/json\"}\r\n , \"PATCH\", json, false,\r\n \"Saved Successfully\",\r\n GenericCallbacks(null, null, null, null))))\r\n ,\r\n Put: (url, json, handleFetchComplete) =>\r\n (dispatch(genericFetch(url, {\"Content-Type\": \"application/json\"}, \"PUT\", json, false, \"Fine Added Successfully\", GenericCallbacks(null, null, null, null))))\r\n }\r\n};\r\nconst selector = formValueSelector('FestivalForm');\r\n// const ItemList = formValues('FestivalForm')(FestivalForm)\r\nconst mapStateToProps = (state) => {\r\n return {\r\n FestivalReducers: state.FestivalReducers,\r\n FormValue: selector(state, 'Applicant', 'Event', 'Property', 'Facility'\r\n , 'Promoter', 'FestivalVendorDetails', 'ApplicantAffidavit'),\r\n synchronousError: getFormSyncErrors('FestivalForm')(state),\r\n };\r\n};\r\nexport default connect(mapStateToProps, mapDispatchToProps)(MaterialStepper);\r\n","import React, {Component} from \"react\";\r\nimport {MDBContainer} from \"mdbreact\";\r\nimport MaterialStepper from \"../Common/MaterialStepper\";\r\nimport {customAlphabet} from 'nanoid';\r\nimport {connect} from \"react-redux\";\r\nimport {SET_APPLICATION_ID} from \"../Common/ActionConstants\";\r\nimport Typography from \"@material-ui/core/Typography\";\r\n\r\nexport class FestivalApplication extends Component {\r\n constructor(props) {\r\n super(props);\r\n const nanoid = customAlphabet('123456789ABCDEFGH', 10);\r\n let id = nanoid();\r\n this.props.ApplicationID(id);\r\n }\r\n\r\n render() {\r\n return \r\n \r\n APPLICATION FOR EVENT\r\n ORGANIZER FOR A MONTGOMERY COUNTY\r\n BEER, WINE & LIQUOR FESTIVAL LICENSE\r\n \r\n \r\n The Application is hereby made by the undersigned, under the provisions of the Annotated Code of\r\n Maryland, as amended, for a Special Festival License. \r\n \r\n License fee: $30 per day of the Festival. $30 per day for vendors. \r\n \r\n All applications should be submitted at least 14 days prior to event. \r\n Application ID : {this.props.FestivalReducers.ApplicationID} \r\n \r\n \r\n }\r\n}\r\n\r\nconst mapDispatchToProps = (dispatch) => {\r\n return {\r\n ApplicationID: (ID) =>\r\n (dispatch({type: SET_APPLICATION_ID, ApplicationID: ID}))\r\n };\r\n};\r\n\r\nconst mapStateToProps = (state) => {\r\n return {\r\n FestivalReducers: state.FestivalReducers,\r\n };\r\n};\r\n\r\nexport default connect(mapStateToProps, mapDispatchToProps)(FestivalApplication);\r\n","import React, {Component} from \"react\";\r\nimport {Btn, RenderTextField} from \"../Common/Component\";\r\nimport {MDBCol, MDBContainer, MDBRow} from \"mdbreact\";\r\nimport {Field, FormSection, formValueSelector, reduxForm} from \"redux-form\";\r\nimport {connect} from \"react-redux\";\r\nimport {\r\n FestivalPostURL,\r\n FestivalURL,\r\n GenericCallbacks,\r\n GET_FESTIVAL_APPLICATION,\r\n GET_FILES,\r\n SET_STEP,\r\n SharePointURL\r\n} from \"../Common/ActionConstants\";\r\nimport ValidateForm from \"../Common/ValidateForm\";\r\nimport {Button} from \"@material-ui/core\";\r\nimport Typography from \"@material-ui/core/Typography\";\r\nimport SignatureCanvas from \"react-signature-canvas\";\r\nimport {genericFetch} from \"../Common/GenericFetch\";\r\n\r\nexport class PropertyOwnerSignature extends Component {\r\n sigPad = {};\r\n\r\n constructor(props) {\r\n super(props);\r\n this.state = {\r\n SubmitFlag: false\r\n };\r\n this.props.SetStepName(\"PROPERTY_OWNER_SIGNATURE\");\r\n }\r\n\r\n dataURItoBlob = (dataURI) => {\r\n // convert base64 to raw binary data held in a string\r\n // doesn't handle URLEncoded DataURIs - see SO answer #6850276 for code that does this\r\n let byteString = atob(dataURI.split(',')[1]);\r\n\r\n // separate out the mime component\r\n let mimeString = dataURI.split(',')[0].split(':')[1].split(';')[0];\r\n\r\n // write the bytes of the string to an ArrayBuffer\r\n let ab = new ArrayBuffer(byteString.length);\r\n let ia = new Uint8Array(ab);\r\n for (let i = 0; i < byteString.length; i++) {\r\n ia[i] = byteString.charCodeAt(i);\r\n }\r\n //New Code\r\n return new Blob([ab], {type: mimeString});\r\n\r\n\r\n };\r\n\r\n clear = () => {\r\n this.sigPad.clear()\r\n };\r\n trim = () => {\r\n let context = this.sigPad.getCanvas().getContext(\"2d\");\r\n context.fillText(`${this.props.FormValue.PropertyOwnerTitle}. ${this.props.FormValue.PropertyOwnerName} - ${new Date()}`, 10, 175);\r\n\r\n let sign = this.dataURItoBlob(this.sigPad.getTrimmedCanvas().toDataURL('image/png'));\r\n let URL = SharePointURL + `?ID=${this.props.ApplicationID}&FileName=PropertyOwnerSignature.png`;\r\n const formData = new FormData();\r\n formData.append(\"image\", sign);\r\n let requestOptions = {\r\n method: 'POST',\r\n body: formData,\r\n redirect: 'follow'\r\n };\r\n this.props.Post(URL, formData, requestOptions, () => {\r\n let URL = FestivalPostURL;\r\n let json = {\r\n IsPropertyOwnerAffidavit: 1,\r\n FestivalID: this.props.ApplicationID.trim(),\r\n StepName: this.props.FestivalReducers.StepName\r\n };\r\n this.props.Patch(URL, json);\r\n this.setState({\"SubmitFlag\": true});\r\n });\r\n };\r\n\r\n render() {\r\n return (\r\n \r\n \r\n MONTGOMERY COUNTY\r\n BEER, WINE & LIQUOR FESTIVAL LICENSE\r\n \r\n Property Owner /Designee Signature\r\n \r\n \r\n \r\n {\r\n this.props.get(FestivalURL + `?FestivalID=${this.props.ApplicationID.trim()}`);\r\n this.props.getFiles(SharePointURL + `?UniqueID=${this.props.ApplicationID.trim()}&FolderName=Shared Documents/FestivalLicense`);\r\n }\r\n\r\n }>\r\n Search\r\n \r\n \r\n {this.props.FestivalReducers && this.props.FestivalReducers.FestivalApplicationDetails[0]\r\n && this.props.FestivalReducers.FestivalApplicationDetails[0].IsPropertyOwnerAffidavit &&\r\n \r\n \r\n Property Owner/Designee have signed the application.\r\n \r\n
}\r\n {this.props.FestivalReducers && this.props.FestivalReducers.FestivalApplicationDetails[0]\r\n && !this.props.FestivalReducers.FestivalApplicationDetails[0].IsPropertyOwnerAffidavit &&\r\n \r\n
\r\n\r\n
\r\n I hereby certify that I am the owner of the property named in the foregoing application for an\r\n alcoholic beverage\r\n license and that I hereby consent to the use of the said property for the sale thereon of such\r\n alcoholic beverages as\r\n may be permitted by law, and I do hereby grant permission to the State Comptroller, his duly\r\n authorized deputies,\r\n inspectors and clerks, the Board of License Commissioners for Montgomery County, its duly\r\n authorized\r\n employees, and any peace officer of Montgomery County to inspect and search at any and all\r\n hours, without\r\n warrant, the premises and any and all parts thereof upon and in which said business is to be\r\n conducted during the\r\n term of the license. \r\n
\r\n Affidavit\r\n \r\n
\r\n
\r\n Also, by signing this application, I do solemnly declare and affirm under the penalties of\r\n perjury that the contents of\r\n the foregoing document are true and correct to the best of my knowledge, information, and\r\n belief.\r\n \r\n
\r\n
}\r\n )\r\n }\r\n}\r\n\r\nconst mapDispatchToProps = (dispatch) => {\r\n return {\r\n get: (url) =>\r\n (dispatch(genericFetch(url, null, \"GET\", null, false, null, GenericCallbacks(GET_FESTIVAL_APPLICATION, null, null, null)))),\r\n\r\n SetStepName: (StepName) =>\r\n (dispatch({type: SET_STEP, StepName: StepName})),\r\n Post: (url, data, headers, handleFetchComplete) =>\r\n (dispatch(genericFetch(url, headers\r\n , \"POST\", data, false,\r\n \"Saved Successfully\",\r\n GenericCallbacks(null, handleFetchComplete(), null, null)))),\r\n Patch: (url, json, handleFetchComplete) =>\r\n (dispatch(genericFetch(url, {\"Content-Type\": \"application/json\"}\r\n , \"PATCH\", json, false,\r\n \"Saved Successfully\",\r\n GenericCallbacks(null, null, null, null))))\r\n , getFiles: (url) =>\r\n (dispatch(genericFetch(url, null, \"POST\", null, false, null, GenericCallbacks(GET_FILES, null, null, null)))),\r\n\r\n };\r\n};\r\nconst selector = formValueSelector('FestivalForm');\r\n\r\nconst mapStateToProps = (state) => {\r\n return {\r\n FestivalReducers: state.FestivalReducers,\r\n ApplicationID: selector(state, 'ApplicationID'),\r\n FormValue: selector(state, 'PropertyOwnerAffidavit'),\r\n };\r\n};\r\nPropertyOwnerSignature = reduxForm({\r\n form: 'FestivalForm',\r\n destroyOnUnmount: false,\r\n ValidateForm\r\n})(PropertyOwnerSignature);\r\nexport default connect(mapStateToProps, mapDispatchToProps)(PropertyOwnerSignature);\r\n","import React from \"react\";\r\nimport {MDBContainer} from \"mdbreact\";\r\nimport {connect} from \"react-redux\";\r\nimport {\r\n FestivalURL,\r\n GenericCallbacks,\r\n GET_FESTIVAL_APPLICATION,\r\n GET_FILES,\r\n SharePointURL\r\n} from \"../Common/ActionConstants\";\r\nimport {Button, Grid} from \"@material-ui/core\";\r\nimport {genericFetch} from \"../Common/GenericFetch\";\r\nimport Typography from \"@material-ui/core/Typography\";\r\nimport {makeStyles} from \"@material-ui/core/styles\";\r\nimport {\r\n ViewAffidavit,\r\n ViewApplicant,\r\n ViewEvent,\r\n ViewFacilities,\r\n ViewFileUpload,\r\n ViewPromoter,\r\n ViewProperty,\r\n ViewVendor\r\n} from \"../Common/ReadonlyComponents\";\r\nimport {Field, formValueSelector, reduxForm} from \"redux-form\";\r\nimport {RenderTextField} from \"../Common/Component\";\r\nimport ValidateForm from \"../Common/ValidateForm\";\r\n\r\nconst useStyles = makeStyles((theme) => ({\r\n root: {\r\n flexGrow: 1,\r\n '& .MuiTextField-root': {\r\n margin: theme.spacing(1),\r\n width: '25ch',\r\n },\r\n },\r\n paper: {\r\n padding: theme.spacing(0),\r\n textAlign: 'center',\r\n color: theme.palette.text.secondary,\r\n border: 0,\r\n },\r\n accroot: {\r\n width: '100%',\r\n },\r\n heading: {\r\n fontSize: theme.typography.pxToRem(20),\r\n fontWeight: theme.typography.fontWeightRegular,\r\n textAlign: \"left\",\r\n color: '#3f51b5'\r\n },\r\n}));\r\n\r\n\r\nlet FestivalApplicationView = (props) => {\r\n const classes = useStyles();\r\n const sections = ['Applicant Details', 'Event Details', 'Property Owner', 'Facility Details', 'Promoter & Security Details', 'Vendor Details', 'File Uploads', 'Affidavit'];\r\n return (\r\n \r\n
\r\n \r\n APPLICATION FOR APPLICANT / EVENT\r\n ORGANIZER FOR A MONTGOMERY COUNTY\r\n BEER, WINE & LIQUOR FESTIVAL LICENSE\r\n \r\n \r\n Application is hereby made by the undersigned, under the provisions of the Annotated Code of\r\n Maryland, as amended, for a Special Festival License. \r\n \r\n License fee: $30 for applicant. $30 a day for each beer vendor. \r\n \r\n All applications should be submitted at least 14 days prior to event. \r\n Application ID : \r\n \r\n \r\n {\r\n props.get(FestivalURL + `?FestivalID=${props.ApplicationID.trim()}`);\r\n props.getFiles(SharePointURL + `?UniqueID=${props.ApplicationID.trim()}&FolderName=Shared Documents/FestivalLicense`);\r\n }\r\n }>\r\n Search\r\n \r\n {props.Details && \r\n
\r\n {sections.map((a, i) =>\r\n \r\n \r\n {a} \r\n {i === 0 && }\r\n {i === 1 && }\r\n {i === 2 && }\r\n {i === 3 && }\r\n {i === 4 && }\r\n {i === 5 && }\r\n {i === 6 && }\r\n {i === 7 && }\r\n
)}\r\n \r\n
}\r\n \r\n
\r\n )\r\n}\r\n\r\nconst mapDispatchToProps = (dispatch) => {\r\n return {\r\n get: (url) =>\r\n (dispatch(genericFetch(url, null, \"GET\", null, false, null, GenericCallbacks(GET_FESTIVAL_APPLICATION, null, null, null))))\r\n , getFiles: (url) =>\r\n (dispatch(genericFetch(url, null, \"POST\", null, false, null, GenericCallbacks(GET_FILES, null, null, null)))),\r\n\r\n };\r\n};\r\nconst selector = formValueSelector('FestivalForm');\r\nconst mapStateToProps = (state) => {\r\n return {\r\n FestivalReducers: state.FestivalReducers,\r\n ApplicationID: selector(state, 'ApplicationID'),\r\n Details: state.FestivalReducers.FestivalApplicationDetails[0],\r\n };\r\n};\r\nFestivalApplicationView = reduxForm({\r\n form: 'FestivalForm',\r\n destroyOnUnmount: false,\r\n ValidateForm\r\n})(FestivalApplicationView);\r\n\r\nexport default connect(mapStateToProps, mapDispatchToProps)(FestivalApplicationView);\r\n","import React from \"react\";\r\nimport {MDBContainer} from \"mdbreact\";\r\nimport {connect} from \"react-redux\";\r\nimport {\r\n FestivalURL,\r\n GenericCallbacks,\r\n GET_FESTIVAL_APPLICATION_Edit,\r\n GET_FILES,\r\n SET_APPLICATION_ID,\r\n SharePointURL\r\n} from \"../Common/ActionConstants\";\r\nimport {Button} from \"@material-ui/core\";\r\nimport {genericFetch} from \"../Common/GenericFetch\";\r\nimport Typography from \"@material-ui/core/Typography\";\r\nimport {Field, formValueSelector, reduxForm} from \"redux-form\";\r\nimport {Btn, RenderTextField} from \"../Common/Component\";\r\nimport ValidateForm from \"../Common/ValidateForm\";\r\nimport MaterialStepper from \"../Common/MaterialStepper\";\r\n\r\n\r\nlet FestivalApplicationEdit = (props) => {\r\n\r\n return (\r\n \r\n
\r\n \r\n APPLICATION FOR APPLICANT / EVENT\r\n ORGANIZER FOR A MONTGOMERY COUNTY\r\n BEER, WINE & LIQUOR FESTIVAL LICENSE\r\n \r\n \r\n Application is hereby made by the undersigned, under the provisions of the Annotated Code of\r\n Maryland, as amended, for a Special Festival License. \r\n \r\n License fee: $30 for applicant. $30 a day for each beer vendor. \r\n \r\n All applications should be submitted at least 14 days prior to event. \r\n Application ID : \r\n \r\n \r\n {\r\n // props.dispatch(reset(\"FestivalForm\"));\r\n props.get(FestivalURL + `?FestivalID=${props.Application.ApplicationID.trim()}`);\r\n props.SetApplicationID(props.Application.ApplicationID.trim());\r\n props.getFiles(SharePointURL + `?UniqueID=${props.Application.ApplicationID.trim()}&FolderName=Shared Documents/FestivalLicense`);\r\n\r\n }\r\n }>\r\n Search\r\n \r\n {props.FestivalReducers && props.FestivalReducers.Status && props.FestivalReducers.Status !== 'Draft' //&& props.FestivalReducers.Status.length>0\r\n && \r\n \r\n Your Application Status is {props.FestivalReducers.Status}. \r\n \r\n\r\n
}\r\n {(props.Application.Applicant && props.Application.Applicant.ApplicantDetails && props.Application.Applicant.ApplicantDetails.Firstname.length > 0) &&\r\n }\r\n \r\n
\r\n )\r\n}\r\n\r\nconst mapDispatchToProps = (dispatch) => {\r\n return {\r\n\r\n get: (url) =>\r\n (dispatch(genericFetch(url, null, \"GET\", null, false, null, GenericCallbacks(GET_FESTIVAL_APPLICATION_Edit, null, null, null))))\r\n , getFiles: (url) =>\r\n (dispatch(genericFetch(url, null, \"POST\", null, false, null, GenericCallbacks(GET_FILES, null, null, null)))),\r\n SetApplicationID: (ID) =>\r\n (dispatch({type: SET_APPLICATION_ID, ApplicationID: ID}))\r\n\r\n };\r\n};\r\nconst selector = formValueSelector('FestivalForm');\r\nconst mapStateToProps = (state) => {\r\n return {\r\n FestivalReducers: state.FestivalReducers,\r\n Application: selector(state, 'ApplicationID', 'Applicant'),\r\n Details: state.FestivalReducers.FestivalApplicationDetails[0],\r\n };\r\n};\r\nFestivalApplicationEdit = reduxForm({\r\n form: 'FestivalForm',\r\n destroyOnUnmount: false,\r\n ValidateForm\r\n})(FestivalApplicationEdit);\r\n\r\n\r\nexport default connect(mapStateToProps, mapDispatchToProps)(FestivalApplicationEdit);\r\n","import React, {Component} from \"react\";\r\nimport Typography from \"@material-ui/core/Typography\";\r\nimport {MDBContainer} from \"mdbreact\";\r\nimport {APPLICATION_STATUS, GenericCallbacks, SET_APPLICATION_ID, StatusURL} from \"../Common/ActionConstants\";\r\nimport {connect} from \"react-redux\";\r\nimport {Field, formValueSelector, reduxForm} from \"redux-form\";\r\nimport {RenderTextField} from \"../Common/Component\";\r\nimport {Button, Grid} from \"@material-ui/core\";\r\nimport ValidateForm from \"../Common/ValidateForm\";\r\nimport {genericFetch} from \"../Common/GenericFetch\";\r\nimport {ViewStatus} from \"../Common/ReadonlyComponents\";\r\n\r\n\r\nexport class CheckApplicationStatus extends Component {\r\n\r\n render() {\r\n return (\r\n \r\n \r\n \r\n )\r\n }\r\n}\r\n\r\nconst mapDispatchToProps = (dispatch) => {\r\n return {\r\n get: (url) =>\r\n (dispatch(genericFetch(url, null, \"GET\", null, false, null, GenericCallbacks(APPLICATION_STATUS,null,null,null)))),\r\n\r\n ApplicationID: (ID) =>\r\n (dispatch({type: SET_APPLICATION_ID, ApplicationID: ID}))\r\n };\r\n};\r\nconst selector = formValueSelector('StatusForm');\r\nconst mapStateToProps = (state) => {\r\n return {\r\n FestivalReducers: state.FestivalReducers,\r\n FormValue: selector(state,'ApplicationID','VendorID'),\r\n // Application: state.user.Application,\r\n };\r\n};\r\nCheckApplicationStatus = reduxForm({\r\n form: 'StatusForm',\r\n destroyOnUnmount: false,\r\n ValidateForm\r\n})(CheckApplicationStatus);\r\nexport default connect(mapStateToProps, mapDispatchToProps)(CheckApplicationStatus);\r\n\r\n","import React, {useState} from \"react\";\r\nimport {MDBCol, MDBContainer, MDBRow} from \"mdbreact\";\r\nimport {connect} from \"react-redux\";\r\nimport Typography from \"@material-ui/core/Typography\";\r\nimport {Button, Card, CardContent, CardHeader, Grid} from \"@material-ui/core\";\r\nimport {Field, FormSection, formValueSelector, reduxForm} from \"redux-form\";\r\nimport {GoHome, PaymentOptions, RenderTextField} from \"../Common/Component\";\r\nimport {\r\n ACHPAYMENT,\r\n ACHPaymentURL,\r\n GenericCallbacks,\r\n GET_PAYMENT_APPLICATION_DETAILS,\r\n GetPaymentURL,\r\n LicenseeURL,\r\n SET_PAYMENTAPPLICATION\r\n} from \"../Common/ActionConstants\";\r\nimport {genericFetch} from \"../Common/GenericFetch\";\r\nimport {lightFormat} from \"date-fns\";\r\n\r\nlet PaymentPortal = (props) => {\r\n const [clicked, setClicked] = useState(0);\r\n if (props.PaymentApplications === null) {\r\n GoHome();\r\n }\r\n return (\r\n\r\n {props.PaymentApplications !== null &&\r\n
\r\n \r\n \r\n }
\r\n )\r\n\r\n}\r\n\r\nconst mapDispatchToProps = (dispatch) => {\r\n return {\r\n SetPaymentApplication: (ID) =>\r\n (dispatch({type: SET_PAYMENTAPPLICATION, PaymentApplicationDetail: ID})),\r\n get: (url, type, json) =>\r\n (dispatch(genericFetch(url, null, \"GET\", null, false, null, GenericCallbacks(type, null, null, null)))),\r\n\r\n };\r\n};\r\nconst selector = formValueSelector('PaymentForm');\r\nconst mapStateToProps = (state) => {\r\n return {\r\n PaymentApplications: state.PaymentReducers.PaymentApplications,\r\n PaymentDetails: state.PaymentReducers.PaymentApplicationDetail,\r\n ApplicationDetails: state.PaymentReducers.ApplicationDetails,\r\n ACHPaymentInfo: state.PaymentReducers.ACHPaymentInfo,\r\n FormValue: selector(state, 'Payment'),\r\n };\r\n};\r\nPaymentPortal = reduxForm({\r\n form: 'PaymentForm',\r\n destroyOnUnmount: true\r\n})(PaymentPortal);\r\nexport default connect(mapStateToProps, mapDispatchToProps)(PaymentPortal);\r\n\r\n","import React, {Component} from \"react\";\r\nimport {MDBContainer} from \"mdbreact\";\r\nimport Typography from \"@material-ui/core/Typography\";\r\nimport {Card, CardContent, Grid} from \"@material-ui/core\";\r\nimport {GenericCallbacks, updatePaymentURL} from \"../Common/ActionConstants\";\r\nimport {genericFetch} from \"../Common/GenericFetch\";\r\nimport {connect} from \"react-redux\";\r\n\r\nexport class PaymentPortal extends Component {\r\n\r\n constructor(props) {\r\n super(props);\r\n let search = this.props.location.search;\r\n let params = new URLSearchParams(search);\r\n this.state = {\r\n TransactionId: params.get('transactionId'),\r\n ApprovalCode: params.get('key'),\r\n l1: params.get('l1'),\r\n l2: params.get('l2'),\r\n l3: params.get('l3'),\r\n l4: params.get('l4'),\r\n l5: params.get('l5'),\r\n BillAmount: params.get('billAmount'),\r\n SiteFeeAmount: params.get('siteFeeAmount'),\r\n TotalAmount: params.get('totalAmount'),\r\n FullName: params.get('fullName'),\r\n Email: params.get(\"email\") !== null ? params.get(\"email\").replace('%40', '@') : '',\r\n Address: params.get('address'),\r\n Zip: params.get('zip'),\r\n PaymentType: params.get('paymentType'),\r\n Phone: params.get('phone'),\r\n }\r\n }\r\n\r\n componentDidMount() {\r\n if (this.state.l1 !== null) {\r\n this.props.Patch(updatePaymentURL, this.state);\r\n }\r\n }\r\n\r\n render() {\r\n return (\r\n \r\n \r\n Payment Portal \r\n Alcohol Beverage Services \r\n Division of Licensure, Regulation, and Education \r\n \r\n {this.state.TransactionId\r\n &&\r\n \r\n \r\n Payment Success\r\n \r\n \r\n \r\n \r\n Full Name : {this.state.FullName} \r\n Address : {this.state.Address} - {this.state.Zip} \r\n Email : {this.state.Email} \r\n \r\n \r\n\r\n \r\n Payment Type : {this.state.PaymentType} \r\n Bill Amount : {this.state.BillAmount} \r\n Site Fee Amount : {this.state.SiteFeeAmount} \r\n Total Amount : {this.state.TotalAmount} \r\n \r\n \r\n A receipt is sent to the email {this.state.Email} .\r\n\r\n \r\n \r\n \r\n \r\n }\r\n \r\n )\r\n }\r\n}\r\n\r\nconst mapDispatchToProps = (dispatch) => {\r\n return {\r\n Patch: (url, json, handleFetchComplete) =>\r\n (dispatch(genericFetch(url, {\"Content-Type\": \"application/json\"}\r\n , \"PATCH\", json, false,\r\n \"Saved Successfully\",\r\n GenericCallbacks(null, null, null, null))))\r\n }\r\n};\r\n\r\nexport default connect(null, mapDispatchToProps)(PaymentPortal);\r\n","import React, {useState} from \"react\";\r\nimport Typography from \"@material-ui/core/Typography\";\r\nimport {MDBCol, MDBContainer, MDBRow} from \"mdbreact\";\r\nimport {\r\n CERT_DETAILS,\r\n DownloadHistoryURL,\r\n GenericCallbacks,\r\n GET_FILES,\r\n GetCertDetailsURL,\r\n LicenseDownloadURL,\r\n PAY_DETAILS,\r\n PaymentDetails,\r\n SET_APPLICATION_ID,\r\n SET_PAYMENTAPPLICATION\r\n} from \"../Common/ActionConstants\";\r\nimport {connect} from \"react-redux\";\r\nimport {Field, FormSection, formValueSelector, reduxForm} from \"redux-form\";\r\nimport {PaymentOptions, RenderTextField} from \"../Common/Component\";\r\nimport {Button, Card, CardContent, CardHeader, Grid} from \"@material-ui/core\";\r\nimport {genericFetch} from \"../Common/GenericFetch\";\r\nimport {DownloadCert} from \"../Common/ReadonlyComponents\";\r\n\r\nconst validate = (values /*, dispatch */) => {\r\n let errors = {};\r\n if (values.EmailID === undefined || !values.EmailID) {\r\n // eslint-disable-next-line no-throw-literal\r\n errors['EmailID'] = 'is Required';\r\n } else if (\r\n values.EmailID &&\r\n !/^[A-Z0-9._%+-]+@[A-Z0-9.-]+\\.[A-Z]{2,4}$/i.test(values.EmailID)\r\n ) {\r\n errors['EmailID'] = 'Invalid email address'\r\n }\r\n return errors;\r\n};\r\nlet DownloadLicense = (props) => {\r\n const [clicked, setClicked] = useState(0);\r\n // let App = \"Annual License Fee\"\r\n let message = '';\r\n\r\n\r\n if (props.Payment && props.Payment.Status !== \"Paid\") message = message + `You have not paid the ${props.FormValue.PaymentApplicationType.replace(\"Download\",'')}. Return to the previous page and click 'Click here to make payment' button to pay`;\r\n else if (props.CertReducers.CertDetails === null || props.CertReducers.CertDetails.CertActive === false) message = message + `Your account has not been enabled to download the license.`;\r\n //else if(props.CertReducers.CertDetails!==null && clicked===1 && !props.CertReducers.CertDetails.CertActive)\r\n return (\r\n \r\n \r\n \r\n )\r\n\r\n};\r\n\r\nconst mapDispatchToProps = (dispatch) => {\r\n return {\r\n SetPaymentApplication: (ID) =>\r\n (dispatch({type: SET_PAYMENTAPPLICATION, PaymentApplicationDetail: ID})),\r\n get: (url, type, handleFetchComplete) =>\r\n (dispatch(genericFetch(url, null, \"GET\", null, false, null, GenericCallbacks(type, handleFetchComplete(), null, null)))),\r\n getFiles: (url) =>\r\n (dispatch(genericFetch(url, null, \"POST\", null, false, null, GenericCallbacks(GET_FILES, null, null, null)))),\r\n\r\n Post: (url, json, handleFetchComplete) =>\r\n (dispatch(genericFetch(url, {\"Content-Type\": \"application/json\"}\r\n , \"POST\", json, false,\r\n \"Saved Successfully\",\r\n GenericCallbacks(null, handleFetchComplete, null, null)))),\r\n\r\n ApplicationID: (ID) =>\r\n (dispatch({type: SET_APPLICATION_ID, ApplicationID: ID}))\r\n };\r\n};\r\nconst selector = formValueSelector('DownloadForm');\r\nconst mapStateToProps = (state) => {\r\n return {\r\n PaymentApplications: state.PaymentReducers.PaymentApplications,\r\n PaymentDetails: state.PaymentReducers.PaymentApplicationDetail,\r\n Payment: state.PaymentReducers.PayDetails,\r\n CertReducers: state.CertReducers,\r\n FestivalReducers: state.FestivalReducers,\r\n FormValue: selector(state, 'Download'),\r\n };\r\n};\r\nDownloadLicense = reduxForm({\r\n form: 'DownloadForm',\r\n validate,\r\n destroyOnUnmount: true,\r\n\r\n})(DownloadLicense);\r\nexport default connect(mapStateToProps, mapDispatchToProps)(DownloadLicense);\r\n\r\n","import React from 'react';\r\nimport {Route, Switch} from 'react-router-dom';\r\n\r\nimport LandingPage from \"./Components/LandingPage\";\r\nimport VendorEdit from \"./Components/VendorEdit\";\r\nimport FestivalApplication from \"./Components/FestivalApplication\";\r\nimport PropertyOwnerSignature from \"./Components/PropertyOwnerSignature\";\r\nimport FestivalApplicationView from \"./Components/FestivalApplicationView\";\r\nimport FestivalApplicationEdit from \"./Components/FestivalApplicationEdit\";\r\nimport CheckApplicationStatus from \"./Components/CheckApplicationStatus\";\r\nimport PaymentPortal from \"./Components/PaymentPortal\";\r\nimport PaymentSuccess from \"./Components/PaymentSuccess\";\r\n// import {DownloadLicense} from \"./Components/DownloadLicense\";\r\nimport DownloadLicense from \"./Components/DownloadLicense\";\r\n\r\nclass Routes extends React.Component {\r\n render() {\r\n return (\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n Not Found;\r\n }}\r\n />\r\n \r\n );\r\n }\r\n}\r\n\r\nexport default Routes;\r\n","import './App.css';\r\nimport React from 'react';\r\n// import { BrowserRouter as Router } from 'react-router-dom';\r\nimport {HashRouter as Router} from \"react-router-dom\";\r\nimport Routes from './Routes';\r\n// import { Router, useRouterHistory } from 'react-router';\r\n// import createBrowserHistory from 'history/lib/createBrowserHistory'\r\n// const history = useRouterHistory(createBrowserHistory)({\r\n// basename: '/',\r\n// })\r\n\r\nfunction App() {\r\n return (\r\n \r\n \r\n \r\n
\r\n \r\n );\r\n}\r\n\r\nexport default App;\r\n","const reportWebVitals = onPerfEntry => {\r\n if (onPerfEntry && onPerfEntry instanceof Function) {\r\n import('web-vitals').then(({ getCLS, getFID, getFCP, getLCP, getTTFB }) => {\r\n getCLS(onPerfEntry);\r\n getFID(onPerfEntry);\r\n getFCP(onPerfEntry);\r\n getLCP(onPerfEntry);\r\n getTTFB(onPerfEntry);\r\n });\r\n }\r\n};\r\n\r\nexport default reportWebVitals;\r\n","import {\r\n APPLICATION_STATUS,\r\n GET_FESTIVAL_APPLICATION,\r\n GET_FILES,\r\n SET_APPLICATION_ID,\r\n SET_STEP,\r\n STATUS,\r\n VENDOR\r\n} from \"../Common/ActionConstants\";\r\n\r\nconst initialState = {ApplicationStatus:[],Vendor:[],Status:'',ApplicationID: [],StepName:[],FestivalApplicationDetails:[],Files:[]};\r\nexport const reducer = (state, action) => {\r\n state = state || initialState;\r\n\r\n if (action.type === SET_APPLICATION_ID) {\r\n return {\r\n ...state,\r\n ApplicationID: action.ApplicationID\r\n };\r\n } if (action.type === SET_STEP) {\r\n return {\r\n ...state,\r\n StepName: action.StepName\r\n };\r\n }\r\n if (action.type === GET_FESTIVAL_APPLICATION) {\r\n return {\r\n ...state,\r\n FestivalApplicationDetails : action.payload\r\n };\r\n }if (action.type === GET_FILES) {\r\n return {\r\n ...state,\r\n Files: action.payload\r\n };\r\n }\r\n if (action.type === STATUS) {\r\n return {\r\n ...state,\r\n Status: action.payload\r\n };\r\n }\r\n if (action.type === VENDOR) {\r\n return {\r\n ...state,\r\n Vendor : action.payload\r\n };\r\n } if (action.type === APPLICATION_STATUS) {\r\n return {\r\n ...state,\r\n ApplicationStatus : action.payload\r\n };\r\n }\r\n return state;\r\n}","import {\r\n ACHPAYMENT,\r\n GET_APPLICATIONS,\r\n GET_PAYMENT_APPLICATION_DETAILS,\r\n MESSAGE, PAY_DETAILS,\r\n SET_PAYMENTAPPLICATION\r\n} from \"../Common/ActionConstants\";\r\n\r\nconst initialState = {PaymentApplications:null,ApplicationDetails:null,PaymentApplicationDetail:null,Message: null,ACHPaymentInfo:null,PayDetails:null};\r\nexport const reducer = (state, action) => {\r\n state = state || initialState;\r\n if (action.type === GET_APPLICATIONS) {\r\n return {\r\n ...state,\r\n PaymentApplications : action.payload\r\n };\r\n }if (action.type === SET_PAYMENTAPPLICATION) {\r\n return {\r\n ...state,\r\n PaymentApplicationDetail : action.PaymentApplicationDetail\r\n };\r\n }if (action.type === GET_PAYMENT_APPLICATION_DETAILS) {\r\n return {\r\n ...state,\r\n ApplicationDetails : action.payload\r\n };\r\n }\r\n if (action.type === MESSAGE) {\r\n return {\r\n ...state,\r\n Message : action.payload\r\n };\r\n }if (action.type === ACHPAYMENT) {\r\n return {\r\n ...state,\r\n ACHPaymentInfo : action.payload\r\n };\r\n }if (action.type === PAY_DETAILS) {\r\n return {\r\n ...state,\r\n PayDetails : action.payload\r\n };\r\n }\r\n return state;\r\n}","import {CERT_DETAILS} from \"../Common/ActionConstants\";\r\n\r\nconst initialState = {CertDetails:null};\r\nexport const reducer = (state, action) => {\r\n state = state || initialState;\r\n if (action.type === CERT_DETAILS) {\r\n return {\r\n ...state,\r\n CertDetails: action.payload\r\n };\r\n }\r\n return state;\r\n}","import {combineReducers} from 'redux';\r\nimport {reducer as reduxFormReducer} from 'redux-form';\r\nimport * as FestivalReducers from './FestivalReducers';\r\nimport * as PaymentReducers from \"./PaymentReducers\";\r\nimport * as CertReducers from \"./CertReducers\";\r\n\r\n\r\nexport default combineReducers({\r\n form: reduxFormReducer,\r\n FestivalReducers: FestivalReducers.reducer,\r\n PaymentReducers: PaymentReducers.reducer,\r\n CertReducers: CertReducers.reducer\r\n});","import {createStore, applyMiddleware, compose} from 'redux';\r\nimport thunk from 'redux-thunk';\r\nimport rootReducer from '../Reducers';\r\n\r\n\r\nconst composeEnhancers =\r\n typeof window === 'object' &&\r\n window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__ ?\r\n window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__({\r\n // Specify extension’s options like name, actionsBlacklist, actionsCreators, serialize...\r\n }) : compose;\r\n\r\nconst enhancer = composeEnhancers(\r\n applyMiddleware(thunk)\r\n);\r\n\r\n\r\nexport default function configureStore() {\r\n return createStore(\r\n rootReducer,\r\n enhancer\r\n );\r\n}","import React from 'react';\r\nimport ReactDOM from 'react-dom';\r\nimport './index.css';\r\nimport App from './App';\r\nimport reportWebVitals from './reportWebVitals';\r\nimport '@fortawesome/fontawesome-free/css/all.min.css';\r\nimport 'bootstrap-css-only/css/bootstrap.min.css';\r\nimport 'mdbreact/dist/css/mdb.css';\r\nimport \"react-widgets/styles.css\";\r\nimport configureStore from \"./Common/configureStore\";\r\nimport { Provider } from 'react-redux'\r\nimport \"isomorphic-fetch\";\r\n\r\nconst store = configureStore();\r\n\r\nReactDOM.render(\r\n \r\n \r\n \r\n \r\n ,\r\n document.getElementById('root')\r\n);\r\n\r\n// If you want to start measuring performance in your app, pass a function\r\n// to log results (for example: reportWebVitals(console.log))\r\n// or send to an analytics endpoint. Learn more: https://bit.ly/CRA-vitals\r\nreportWebVitals();\r\n"],"sourceRoot":""}