Skip to content
This repository has been archived by the owner on Apr 27, 2023. It is now read-only.
/ wvui Public archive

[component][typeahead-suggestion] Add network client for typeahead-search component #72

Merged
merged 23 commits into from Aug 13, 2020

Commits on Jul 31, 2020

  1. Add fetch wrapper

    In most browsers we can use window.fetch. In others, like IE 11, this is not available.
    To keep this simple for now reject the promise if native fetch is not available.
    
    Added jest-fetch-mock for testing the "fetch is available" branch.
    berndsi committed Jul 31, 2020
    Configuration menu
    Copy the full SHA
    610e2cd View commit details
    Browse the repository at this point in the history
  2. Add buildQueryString()

    A convenience method to serialize a JS object into a query string, so it can be appended
    to the URL (after '?').
    berndsi committed Jul 31, 2020
    Configuration menu
    Copy the full SHA
    0a660a2 View commit details
    Browse the repository at this point in the history
  3. Add REST API search client

    This network client provides a fetchByTitle() function, to be used for typeahead search suggestions.
    Not providing accept-language header at this time since it does not seem to make a difference.
    berndsi committed Jul 31, 2020
    Configuration menu
    Copy the full SHA
    ff9b4a8 View commit details
    Browse the repository at this point in the history
  4. Allow API tests to run against live servers

    By default the requests are mocked, so no network is used.
    If the environment variable TEST_LIVE_REQUESTS is set to
    a truthy value, the mocks are disabled and requests are made
    against a live server.
    berndsi committed Jul 31, 2020
    Configuration menu
    Copy the full SHA
    836648f View commit details
    Browse the repository at this point in the history

Commits on Aug 3, 2020

  1. Remove excerpt

    A repeat of `title` doesn't seem useful to me.
    berndsi committed Aug 3, 2020
    Configuration menu
    Copy the full SHA
    4fe737c View commit details
    Browse the repository at this point in the history
  2. Move jestFetchMock.enableFetchMocks() into beforeAll

    Also undo in afterAll().
    Plus a formatting fix.
    berndsi committed Aug 3, 2020
    Configuration menu
    Copy the full SHA
    81a0602 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    52ccd37 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    a402cb3 View commit details
    Browse the repository at this point in the history

Commits on Aug 4, 2020

  1. Configuration menu
    Copy the full SHA
    9ac0a9f View commit details
    Browse the repository at this point in the history
  2. Explicitly type RestResponse in test

    Doing that I noticed that the null values need to be called out in the interface.
    berndsi committed Aug 4, 2020
    Configuration menu
    Copy the full SHA
    756882f View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    841da9f View commit details
    Browse the repository at this point in the history
  4. Add searchText to the search response

    so it can be used by the UI for highlighting the search text.
    berndsi committed Aug 4, 2020
    Configuration menu
    Copy the full SHA
    ae5f10c View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    21c992c View commit details
    Browse the repository at this point in the history

Commits on Aug 5, 2020

  1. Trim search text

    Titles don't start or end with spaces. So, remove them, at least for title search.
    berndsi committed Aug 5, 2020
    Configuration menu
    Copy the full SHA
    97fc0b8 View commit details
    Browse the repository at this point in the history
  2. Update test name

    berndsi committed Aug 5, 2020
    Configuration menu
    Copy the full SHA
    304de07 View commit details
    Browse the repository at this point in the history
  3. Handle null thumbnail width/height

    The REST API documentation says it could return null for width or height. Make the value undefined in this case.
    berndsi committed Aug 5, 2020
    Configuration menu
    Copy the full SHA
    0a24a02 View commit details
    Browse the repository at this point in the history

Commits on Aug 6, 2020

  1. Reuse input object for test verification

    Clarify that the input object changes in one place where the thumbnail is null.
    berndsi committed Aug 6, 2020
    Configuration menu
    Copy the full SHA
    6ff044a View commit details
    Browse the repository at this point in the history

Commits on Aug 12, 2020

  1. Configuration menu
    Copy the full SHA
    124b10b View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    fcb845d View commit details
    Browse the repository at this point in the history

Commits on Aug 13, 2020

  1. Add network error test

    berndsi committed Aug 13, 2020
    Configuration menu
    Copy the full SHA
    a190a23 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    70b88b9 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    1c9faef View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    4a25ff8 View commit details
    Browse the repository at this point in the history