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

✨(react) add async mode to Select #305

Open
wants to merge 27 commits into
base: main
Choose a base branch
from

Commits on Sep 24, 2024

  1. ✨(react) introduce mono async searchable select

    Add *.tool-versions to .gitignore
    Add a test asserting that a mono uncontrolled
    searchable select can work with an async
    callback given as an options prop.
    Add types for the callback provided as an options
    prop for the Form/Select component
    Add Searchable Uncontrolled With Async Options
    Fetching and Searchable Uncontrolled With Async
    Options Fetching And Default Value stories in
    storybook.
    Change SelectMono so that only an array of
    options is passed to SelectMonoSimple since
    options prop of SelectMono may also be a
    callback to pass to SelectMonoSearchable.
    
    This new feature allow to pass an async callback as
    options prop for a Searchable Mono Select
    component. Give it a function to fetch
    dynamically data from a third service and format
    them into an array of options.
    A context param is automatically passed to the
    callback so that the function is able to filter
    tha data according to the search string. If the
    props.defaultValue is provided, then the Select
    will pick a default option matching the default
    value.
    daproclaima committed Sep 24, 2024
    Configuration menu
    Copy the full SHA
    457d922 View commit details
    Browse the repository at this point in the history
  2. ⚡️(react) prevent unecessary async options fetching

    Prevents useless triggering of async options fetching due
    to default value and inputFilter updates handling in
    mono-searchable.ts.
    daproclaima committed Sep 24, 2024
    Configuration menu
    Copy the full SHA
    cd38f69 View commit details
    Browse the repository at this point in the history
  3. ✅(react) update test for select with async options fetching

    updates Mono.spec tests according to improvement related with
    async data fetching callback preventing useless execution.
    daproclaima committed Sep 24, 2024
    Configuration menu
    Copy the full SHA
    c795bd5 View commit details
    Browse the repository at this point in the history
  4. ✨(react) add use of loader in mono searchable select

    Add style for the loader of Select component when it uses
    async options callback fetching.
    daproclaima committed Sep 24, 2024
    Configuration menu
    Copy the full SHA
    c876a16 View commit details
    Browse the repository at this point in the history
  5. ✅(react) add test for searchable mono select

    Update mono.spec tests to verify the use of the new isLoading and
    default value, async options fetching props and the loader.
    daproclaima committed Sep 24, 2024
    Configuration menu
    Copy the full SHA
    8c576ba View commit details
    Browse the repository at this point in the history
  6. 💬(react) add select loader translations

    updates english and french translations for the loader
    of select component showed during options fetching.
    daproclaima committed Sep 24, 2024
    Configuration menu
    Copy the full SHA
    bb2c096 View commit details
    Browse the repository at this point in the history
  7. 🔧(vitest) add workspace configuration

        Creates a vitest workspace configuration file in root folder.
        It allows to run all tests in debug mode inside IntelliJ
        - https://vitest.dev/guide/debugging.html\#intellij-idea
        - https://vitest.dev/guide/workspace.html\#defining-a-workspace
    daproclaima committed Sep 24, 2024
    Configuration menu
    Copy the full SHA
    f573509 View commit details
    Browse the repository at this point in the history
  8. ♻️(react) improve select mono searchable

    It simplifies the code related with the asynchronous options
    fetching and renames related component tests names
    daproclaima committed Sep 24, 2024
    Configuration menu
    Copy the full SHA
    5d9dee9 View commit details
    Browse the repository at this point in the history
  9. ♻️(react) gather options fetching code in mono select

    This prepares the select component to work both in controlled
    and uncontrolled context when the component is searchable and
    has to fetch the options. Also refactor the related tests and
    add a skipped test for controlled context.
    daproclaima committed Sep 24, 2024
    Configuration menu
    Copy the full SHA
    7d25e30 View commit details
    Browse the repository at this point in the history
  10. ✅(react) test controlled Select mono searchable with fetched options

    Add component test for controlled Select mono searchable
    with fetched options. Makes sure to not call the fetch
    options callback when previous search is the same
    as the current one.
    daproclaima committed Sep 24, 2024
    Configuration menu
    Copy the full SHA
    6be1825 View commit details
    Browse the repository at this point in the history
  11. 📝(react) add story for Select mono

    Add story for searchable controlled with async options fetching
    mono select.
    daproclaima committed Sep 24, 2024
    Configuration menu
    Copy the full SHA
    193b0fe View commit details
    Browse the repository at this point in the history
  12. 📝(react) update documentation of mono select

    It updates the storybook files by adding instructions about the select
    mono searchable with options fetching.
    daproclaima committed Sep 24, 2024
    Configuration menu
    Copy the full SHA
    104b794 View commit details
    Browse the repository at this point in the history
  13. 💄(react) move loader for select mono searchable

    Adds or removes loader and actions buttons according to loading status
    when select mono searchable is fetching options.
    daproclaima committed Sep 24, 2024
    Configuration menu
    Copy the full SHA
    0dfb7b7 View commit details
    Browse the repository at this point in the history
  14. 🐛(react) fix options fetching in select mono searchable

    Options fetching callback is now executed only on search input change event
    and when component is mounted if it uses a default value.
    Previously, even selecting an option used to trigger the options fetching.
    The select also now has the disabled status when initial fetch options
    callback is triggered.
    daproclaima committed Sep 24, 2024
    Configuration menu
    Copy the full SHA
    19a0ca0 View commit details
    Browse the repository at this point in the history
  15. 🐛(react) fix options reset for select mono searchable

    Allows to clear selected options when select mono searchable
    uses options fetching and is controlled.
    daproclaima committed Sep 24, 2024
    Configuration menu
    Copy the full SHA
    ab25244 View commit details
    Browse the repository at this point in the history
  16. 🐛(react) fix select mono searchable menu toggle

    Prevents options menu to open again at click on arrow down button
    when select mono searchable uses options fetching
    daproclaima committed Sep 24, 2024
    Configuration menu
    Copy the full SHA
    1965f80 View commit details
    Browse the repository at this point in the history
  17. Configuration menu
    Copy the full SHA
    6f212af View commit details
    Browse the repository at this point in the history
  18. Configuration menu
    Copy the full SHA
    f883441 View commit details
    Browse the repository at this point in the history
  19. 🐛(react) fix options reset for select mono searchable

    Allows to clear selected options when select mono searchable
    uses options fetching and is controlled.
    daproclaima committed Sep 24, 2024
    Configuration menu
    Copy the full SHA
    8051ba5 View commit details
    Browse the repository at this point in the history
  20. 📝(react) update stories for mono select

    Stories with searchable and options fetching now
    fetch all options without filtering them with
    search term at initial options fetching
    daproclaima committed Sep 24, 2024
    Configuration menu
    Copy the full SHA
    0fd628f View commit details
    Browse the repository at this point in the history
  21. 🐛(react) select mono searchable work with loading state

    - fix displaying and hidding of inner actions elements
    accordingly to loading state and apply display none on
    action arrow button
    - updates related component tests
    
    The arrow button needs to remain in the dom to not
    reset its react ref. That is why we apply a display
    none css rule to its visual element instead of taking
    the component out of the DOM.
    daproclaima committed Sep 24, 2024
    Configuration menu
    Copy the full SHA
    f744390 View commit details
    Browse the repository at this point in the history
  22. 🚸(react) change select mono arrow button

    - make arrow button keyboard navigable
    daproclaima committed Sep 24, 2024
    Configuration menu
    Copy the full SHA
    00d50dd View commit details
    Browse the repository at this point in the history
  23. ✨(react) add options fetching to controllable select mono searchable

    - update related component tests
    - apply fixes to SelectMonoSearchable concerning loading state
    and refactors
    - prevent passing a string array in value prop to select mono
    - update storybook documentation and options fetching utils
    daproclaima committed Sep 24, 2024
    Configuration menu
    Copy the full SHA
    6fd14cb View commit details
    Browse the repository at this point in the history
  24. 🐛(react) update mono select options fetching

    - execute options fetching on select mono searchable when
    clear button is clicked
    - update related tests and a new one
    daproclaima committed Sep 24, 2024
    Configuration menu
    Copy the full SHA
    0f780aa View commit details
    Browse the repository at this point in the history
  25. 📝(react) update stories for mono select

    - update description for searchable select with
    options fetching
    daproclaima committed Sep 24, 2024
    Configuration menu
    Copy the full SHA
    3a1607b View commit details
    Browse the repository at this point in the history
  26. 🎨(react) improve select mono-common code

    - simplify the reading of the condition
    displaying the clear button
    - update CHANGELOG.md for release
    daproclaima committed Sep 24, 2024
    Configuration menu
    Copy the full SHA
    ab61478 View commit details
    Browse the repository at this point in the history
  27. 🚨(react) fix select mono stories

    - remove unused error var
    daproclaima committed Sep 24, 2024
    Configuration menu
    Copy the full SHA
    13e89dc View commit details
    Browse the repository at this point in the history