Skip to content

Commit

Permalink
Merge pull request #3260 from beckn/fix-EC-Bugs
Browse files Browse the repository at this point in the history
fix: ec bugs
  • Loading branch information
aniketceminds authored Feb 25, 2025
2 parents 0144305 + eaf2075 commit fad253d
Show file tree
Hide file tree
Showing 9 changed files with 27 additions and 16 deletions.
3 changes: 2 additions & 1 deletion apps/open-spark-solaris/locales/en.ts
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@ const en: { [key: string]: string } = {
items: 'Order Overview',
loading: 'Loading Plans',
pleaseWait: 'Please wait!',
confirmLoaderSubtext: 'While we confirm your order'
confirmLoaderSubtext: 'While we confirm your order',
noProduct: 'There are no products in this category yet! New products will be added soon.'
}
export default en
6 changes: 4 additions & 2 deletions apps/open-spark/locales/en.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ const en: { [key: string]: string } = {
errorNumber: 'Mobile Number is required',
errorNumber2: 'Invalid Mobile Number',
errorAddress: 'Complete Address is required',
errorAddressMinLength: 'Address must be at least 3 characters long',
errorName2: 'Name can only contain letters and spaces',
errorName3: 'Name must contain at least 3 characters',
cardNumber: '**** **** **** 1234',
Expand Down Expand Up @@ -107,12 +108,13 @@ const en: { [key: string]: string } = {
gPay: 'Google Pay',
items: 'Order Overview',
allRequestFullfilled: 'All orders delivered!',
loading: 'Fetching financing plan from ONDC...',
loading: 'Fetching the best finance options from the ONDC network...',
pleaseWait: 'Please wait!',
fetchingTrackLoaderSubtext: 'While we fetch for tracking and support details',
confirmLoaderSubtext: 'While we confirm your order',
itemSourceText: '',
emptyOrderHistoryText: 'This space appears quite empty!',
noExistingWorkflowText: 'No existing workflows found; create a new workflow to proceed.'
noExistingWorkflowText: 'No existing workflows found; create a new workflow to proceed.',
noProduct: 'There are no products in this category yet! New products will be added soon.'
}
export default en
2 changes: 2 additions & 0 deletions apps/open-spark/pages/OTPVerification.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,8 @@ const OTPVerification = () => {
key={index}
value={digit}
maxLength={1}
inputMode="numeric"
pattern="[0-9]"
onChange={e => handleChange(e.target.value, index)}
onKeyUp={e => handleBackspaceAndEnter(e, index)}
ref={el => (otpBoxReference.current[index] = el)}
Expand Down
1 change: 1 addition & 0 deletions apps/open-spark/pages/confirmRent.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,7 @@ export default function ConfirmRent() {
className="hideScroll"
maxH="calc(100vh - 100px)"
overflowY={'scroll'}
mb={5}
>
<Box>
<Box mb={'40px'}>
Expand Down
1 change: 1 addition & 0 deletions apps/open-spark/pages/product.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ const Product = () => {
totalPrice: selectedProduct.item.price.value,
handleIncrement: increment,
handleDecrement: decrement,
// counterTitle: 'Select Quantity',
counter: counter,
cta: {
dataTest: testIds.productpage_addTocartButton,
Expand Down
20 changes: 10 additions & 10 deletions apps/open-spark/pages/profile.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -150,16 +150,16 @@ const ProfilePage = () => {
disabled: !profileEditable,
customInputBlurHandler: updateProfile
},
{
type: 'text',
name: 'customerId',
value: formData.customerId!,
handleChange: handleInputChange,
label: t.formCustomerId,
error: formErrors.customerId,
dataTest: testIds.profile_customerId,
disabled: true
},
// {
// type: 'text',
// name: 'customerId',
// value: formData.customerId!,
// handleChange: handleInputChange,
// label: t.formCustomerId,
// error: formErrors.customerId,
// dataTest: testIds.profile_customerId,
// disabled: true
// },
{
type: 'text',
name: 'address',
Expand Down
4 changes: 4 additions & 0 deletions apps/open-spark/utilities/form-utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ export const validateForm = (formData: ShippingFormData): FormErrors => {

if (formData.address.trim() === '') {
errors.address = 'errorAddress'
} else if (formData.address.trim().length < 3) {
errors.address = 'errorAddressMinLength'
}

if (formData.zipCode.trim() === '') {
Expand Down Expand Up @@ -92,6 +94,8 @@ export const signUpValidateForm = (formData: SignUpProps): CustomFormErrorProps
}
if (formData.address.trim() === '') {
errors.address = 'errorAddress'
} else if (formData.address.trim().length < 3) {
errors.address = 'errorAddressMinLength'
}
if (formData?.mobileNumber?.trim() === '') {
errors.mobileNumber = 'errorNumber'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,6 @@ const ItemDetails: React.FC<ItemDetailProps> = ({
</Flex>
</Box>
</Box>
<Divider mb={'15px'} />
</>
)
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React, { useState } from 'react'
import { Box, useBreakpoint } from '@chakra-ui/react'
import { Box, Divider, useBreakpoint } from '@chakra-ui/react'
import { FormField, Typography, Loader, Button, LoaderWithMessage } from '@beckn-ui/molecules'
import DetailsCard from './details-card'
import ItemDetails from './checkout-item-details'
Expand Down Expand Up @@ -51,7 +51,7 @@ const Checkout: React.FC<CheckoutProps<FormField[]>> = ({
{items?.type === 'RENT_AND_HIRE' ? (
<OrderOverview items={items.data as RentalItemProps[]} />
) : (
(items?.data as ItemDetailProps[])?.map((item, i) => (
(items?.data as ItemDetailProps[])?.map((item, i, arr) => (
<div
key={i}
data-test={dataTestItemDetails}
Expand All @@ -64,6 +64,7 @@ const Checkout: React.FC<CheckoutProps<FormField[]>> = ({
currency={item.currency}
image={item.image}
/>
{arr.length > 1 && i !== arr.length - 1 && <Divider mb={'15px'} />}
</div>
))
)}
Expand Down

0 comments on commit fad253d

Please sign in to comment.