Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(core): create register customer page #730

Merged
merged 1 commit into from
May 13, 2024
Merged

Conversation

yurytut1993
Copy link
Contributor

@yurytut1993 yurytut1993 commented Apr 4, 2024

What/Why?

This pr adds Register Customer Page with Built In Fields
register-customer-form

Testing

Locally

Copy link

changeset-bot bot commented Apr 4, 2024

🦋 Changeset detected

Latest commit: b0dac9f

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@bigcommerce/catalyst-core Minor

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

Copy link

vercel bot commented Apr 4, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
catalyst-core ❌ Failed (Inspect) May 13, 2024 11:51am
catalyst-latest ✅ Ready (Inspect) Visit Preview May 13, 2024 11:51am
catalyst-storybook ✅ Ready (Inspect) Visit Preview 💬 Add feedback May 13, 2024 11:51am
catalyst-testbed ❌ Failed (Inspect) May 13, 2024 11:51am
4 Ignored Deployments
Name Status Preview Comments Updated (UTC)
catalyst-1millionproducts-store ⬜️ Ignored (Inspect) Visit Preview May 13, 2024 11:51am
catalyst-au ⬜️ Ignored (Inspect) Visit Preview May 13, 2024 11:51am
catalyst-test-store ⬜️ Ignored (Inspect) Visit Preview May 13, 2024 11:51am
catalyst-uk ⬜️ Ignored (Inspect) Visit Preview May 13, 2024 11:51am

@@ -15,7 +15,8 @@ type ValidationPattern =
| 'tooShort'
| 'typeMismatch'
| 'valid'
| 'valueMissing';
| 'valueMissing'
| ValidationFunction;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think there can be an error in ControlValidationPatterns so basically you can update and use ControlValidationPatterns after:
type ControlValidationPatterns = ValidationPattern | ValidationFunction;
What do you think?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, changed after your updates

Copy link
Contributor

@jorgemoya jorgemoya left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IMO /register-customer-form should be nested under a _components folder in the register-customer path, since it's not reused.

Comment on lines 7 to 11
import { getCountries } from '~/client/management/get-countries';
import { getAddressFormFields } from '~/client/queries/get-address-form-fields';
import { getCustomerFormFields } from '~/client/queries/get-customer-form-fields';
import { getReCaptchaSettings } from '~/client/queries/get-recaptcha-settings';
import { getStoreCountry } from '~/client/queries/get-store-country';
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we do this with a single query?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Interesting idea, but getAddressFormFields, getAddressFormFields and getReCaptchaSettings need to be used in separate cases 🤔

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can try something like what @deini is doing with fragment colocation. What do you think?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jorgemoya thats great idea, thanks. Refactored according to the new approach 👍

@bc-alexsaiannyi
Copy link
Contributor

IMO /register-customer-form should be nested under a _components folder in the register-customer path, since it's not reused.

Hmm, It's interested point. I guess that in this case it makes sense to move contactUs form to relevant page _components and delete core/components/forms altogether. What do you think guys?🤔

@yurytut1993
Copy link
Contributor Author

IMO /register-customer-form should be nested under a _components folder in the register-customer path, since it's not reused.

Hmm, It's interested point. I guess that in this case it makes sense to move contactUs form to relevant page _components and delete core/components/forms altogether. What do you think guys?🤔

It will be consistent. And blog-post-card also should be replaced under Blog then

{ address: {} },
);

console.log(parsedData, 'parsedData');
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

don't forget to remove console

setCountryStates(data);
};

const handlePicklistWihtTextValidation = (e: ChangeEvent<HTMLInputElement>) => {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

here is a typo in method's name.

Copy link
Contributor

@bc-azvierieva bc-azvierieva left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice job!

Copy link
Contributor

⚡️🏠 Lighthouse report

Lighthouse ran against https://catalyst-latest-5d59de1i0-bigcommerce-platform.vercel.app

🖥️ Desktop

We ran Lighthouse against the changes on a desktop and produced this report. Here's the summary:

Category Score
🟢 Performance 100
🟢 Accessibility 100
🟢 Best practices 100
🟢 SEO 90

📱 Mobile

We ran Lighthouse against the changes on a mobile and produced this report. Here's the summary:

Category Score
🟢 Performance 96
🟢 Accessibility 100
🟢 Best practices 100
🟢 SEO 92

@yurytut1993 yurytut1993 added this pull request to the merge queue May 13, 2024
Merged via the queue into main with commit 15e4b82 May 13, 2024
11 checks passed
@yurytut1993 yurytut1993 deleted the register-customer-page branch May 13, 2024 12:34
This was referenced May 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants