diff --git a/src/screens/Connectors/ConnectorUtils.res b/src/screens/Connectors/ConnectorUtils.res index 6d1799e90..9cfd19062 100644 --- a/src/screens/Connectors/ConnectorUtils.res +++ b/src/screens/Connectors/ConnectorUtils.res @@ -494,7 +494,7 @@ let taxJarInfo = { description: "TaxJar is reimagining how businesses manage sales tax compliance. Its cloud-based platform automates the entire sales tax life cycle across all sales channels — from calculations and nexus tracking to reporting and filing.", } let nexixpayInfo = { - description : "Nexi's latest generation virtual POS is designed for those who, through a website, want to sell goods or services by managing payments online." + description: "Nexi's latest generation virtual POS is designed for those who, through a website, want to sell goods or services by managing payments online.", } let signifydInfo = { description: "One platform to protect the entire shopper journey end-to-end", diff --git a/src/screens/OMPSwitch/MerchantSwitch.res b/src/screens/OMPSwitch/MerchantSwitch.res index cd15d9ffc..dbfd234ef 100644 --- a/src/screens/OMPSwitch/MerchantSwitch.res +++ b/src/screens/OMPSwitch/MerchantSwitch.res @@ -24,14 +24,28 @@ module NewAccountCreationModal = { } let onSubmit = (values, _) => { - createNewAccount(values) + open LogicUtils + let dict = values->getDictFromJsonObject + let trimmedData = dict->getString("company_name", "")->String.trim + Dict.set(dict, "company_name", trimmedData->JSON.Encode.string) + createNewAccount(dict->JSON.Encode.object) } let merchantName = FormRenderer.makeFieldInfo( ~label="Merchant Name", ~name="company_name", - ~placeholder="Eg: My New Merchant", - ~customInput=InputFields.textInput(), + ~customInput=(~input, ~placeholder as _) => + InputFields.textInput()( + ~input={ + ...input, + onChange: event => + ReactEvent.Form.target(event)["value"] + ->String.trimStart + ->Identity.stringToFormReactEvent + ->input.onChange, + }, + ~placeholder="Eg: My New Merchant", + ), ~isRequired=true, ) @@ -44,7 +58,7 @@ module NewAccountCreationModal = { let errorMessage = if companyName->isEmptyString { "Merchant name cannot be empty" } else if companyName->String.length > 64 { - "Merchant name too long" + "Merchant name cannot exceed 64 characters" } else if !RegExp.test(RegExp.fromString(regexForCompanyName), companyName) { "Merchant name should not contain special characters" } else { @@ -59,23 +73,22 @@ module NewAccountCreationModal = { } let modalBody = { -