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

fix: display required indicator only for non-empty labels and Improve test structure #762

Merged
merged 18 commits into from
Nov 20, 2023

Conversation

amitbadala
Copy link
Contributor

@amitbadala amitbadala commented Nov 15, 2023

Summary of change

Fixes and feedbacks from this PR

Related issues

  • Link to issue1 here
  • Link to issue1 here

Test Plan

(Write your test plan here. If you changed any code, please provide us with clear instructions on how you verified your changes work. Bonus points for screenshots and videos!)

Documentation changes

(If relevant, please create a PR in our docs repo, or create a checklist here highlighting the necessary changes)

Checklist for important updates

  • Changelog has been updated
  • frontendDriverInterfaceSupported.json file has been updated (if needed)
  • Changes to the version if needed
    • In package.json
    • In package-lock.json
    • In lib/ts/version.ts
  • Had run npm run build-pretty
  • Had installed and ran the pre-commit hook
  • Issue this PR against the latest non released version branch.
    • To know which one it is, run find the latest released tag (git tag) in the format vX.Y.Z, and then find the latest branch (git branch --all) whose X.Y is greater than the latest released tag.
    • If no such branch exists, then create one from the latest released branch.
  • If added a new recipe interface, then make sure that the implementation of it uses NON arrow functions only (like someFunc: function () {..}).
  • If I added a new recipe, I also added the recipe entry point into the size-limit section of package.json with the size limit set to the current size rounded up.
  • If I added a new recipe, I also added the recipe entry point into the rollup.config.mjs

Remaining TODOs for this PR

  • Item1
  • Item2

Copy link

github-actions bot commented Nov 15, 2023

size-limit report 📦

Path Size
lib/build/index.js 14.19 KB (0%)
recipe/session/index.js 15.15 KB (0%)
recipe/session/prebuiltui.js 17.77 KB (0%)
recipe/thirdpartyemailpassword/index.js 29.71 KB (0%)
recipe/thirdparty/index.js 26.43 KB (0%)
recipe/emailpassword/index.js 10.01 KB (0%)
recipe/emailverification/index.js 7.26 KB (0%)
recipe/passwordless/index.js 63.47 KB (0%)
recipe/thirdpartypasswordless/index.js 84.2 KB (0%)
recipe/emailverification/prebuiltui.js 22.46 KB (0%)
recipe/thirdpartyemailpassword/prebuiltui.js 54.09 KB (+0.02% 🔺)
recipe/thirdparty/prebuiltui.js 38.51 KB (0%)
recipe/emailpassword/prebuiltui.js 27.82 KB (+0.03% 🔺)
recipe/passwordless/prebuiltui.js 103.03 KB (+0.01% 🔺)
recipe/thirdpartypasswordless/prebuiltui.js 130.65 KB (+0.01% 🔺)
recipe/multitenancy/index.js 6.12 KB (0%)

@amitbadala amitbadala changed the title Show required sign only if label is valid fix: Show required sign only if label is not empty Nov 15, 2023
@amitbadala amitbadala changed the title fix: Show required sign only if label is not empty fix: display required indicator only for non-empty labels and Improve test structure Nov 17, 2023
CHANGELOG.md Outdated Show resolved Hide resolved
examples/for-tests/src/App.js Outdated Show resolved Hide resolved
@rishabhpoddar rishabhpoddar merged commit 45dd28c into feat/custom-form-fields Nov 20, 2023
22 of 23 checks passed
@rishabhpoddar rishabhpoddar deleted the fix/email-password-label branch November 20, 2023 09:00
rishabhpoddar added a commit that referenced this pull request Nov 23, 2023
* feat: add input component as types, simplify event handlers - emailpassword recipe  (#752)

* Add inputComponent to exposed types

* Add inputComponent to normalised fields

* For testing only - use custom type definition for inputComponent

* Input component already present in  FormFieldThemeProps

* Testing if git package is getting installed correctly

* Run build for previous commits

* Remove inputComp from NormalizedFormField

* Add tests for custom fields

* Remove testing ele

* Move the custom fields tests into existing describe

* Update dropdown values to avoid confusion

* Add helper func to set dropdown, better test title, use existing describe hooks

* Use strict equal

* Update request

* A seperate func to fetch custom comp not required

* Move inputComponent to signup types

* Cleanup unwanted imports

* Move inputComponent to signup types

* Clean types

* Update build files

* Use explicit values in validate func

* Minor cleanup of types

* Better type names

* Props suggestions working for inputComponent

* Enforce strict string check on form values, now onChange function for fields only needs value, no need to supply name or id

* Update based on the new onChange func

* Ability to add default value with getDefaultValue prop

* Handle if getDefaultValue is not a function

* instead of form submit apply type test within onChange function itself

* Add tests for default value

* Remove unwanted abort

* Testing email-verification workflow

* Reverting onChange changes

* onChange function to accept only values

* Initialize fieldstates at the start

* Remove useEffect

* Fix race conditions when setting default value

* Add custom default fields to typescript example, plus add tests to show custom error message

* Add tests for incorrect default props in formFields

* Add tests for incorrect usage of onChange prop

* Add change log

* Wrap ternary opeators into seperate func for better readibility

* Wrap inputComponent in a serperate component to avoid unecessary rerenders

* Add change log feedbacks

* Better variable names, include formfields directly in typescript example

* Add more tests for default & onChange func, updated typescript file to show the latest changes

* Add more test, which intercepts request payload

* Cleanup comments

* Minor formatting

* Minor fix

* Clean up helper

* Update change log & versions

* feat: add getDefaultValue to signin & signup form fields   (#756)

* Add getDefaultValue to signin, hence shuffle the existing types

* Add tests for default signin feature

* Add default feature to typescript

* Fix failed test

* Reset password now supports getDefaultValue

* Add tests for resetPassword email field

* Revert "Add tests for resetPassword email field"

This reverts commit 363b575.

* Revert "Reset password now supports getDefaultValue"

This reverts commit be4c00a.

* feat: add nonOptionalErrorMsg props  (#757)

* Add nonOptionalErr types

* Now supports nonOptionalErrorMsg attribute

* Add tests and fix signin types to include nonOptionalMsg

* Enforce no api request are made on blank forms

* Clean up signup

* Throw error if invalid nonOptionalErrorMsg, add tests for the same

* Better error message

* Handle incorrect optional flag

* fixes redundant normalisation

---------

Co-authored-by: rishabhpoddar <[email protected]>

* Add test for thirdparty signup - new features

* Add tests for thirdparty signin - new features

* Run build-pretty

* Set correct flag

* fix: display required indicator only for non-empty labels and Improve test structure (#762)

* Show required sign only if label is valid

* Better func names & consistent return type

* Use assert instead of throw error

* Consistent tests description

* Remove unecessary code

* Add correct version number

* Update changelog, add thirdparty example

* Minor fox

* Read from testContext

* Refactor tests to ensure its easy to maintain different configurations

* Update third party tests

* Clean up

* Minor copy update

* Trim the label text

* Add build

* Handle if label is not supplied

* Highlight var in changelog, minor update

* Update custom payload to test for trimmed-version label

* Use page.select for changing dropdown values

* Handle react 16 tests for new features (#764)

---------

Co-authored-by: Amit Badala <[email protected]>
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.

3 participants