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

Update React Sample App according to new Headless State #54

Merged
merged 14 commits into from
Nov 17, 2021

Conversation

yen-tt
Copy link
Contributor

@yen-tt yen-tt commented Nov 9, 2021

Update React sample app and tests based on the updated headless state

  • update components to use the new vertical and universal state interfaces, and the new SearchStatusState and QueryState
  • update SearchBar to manage its own autocomplete results in component state. Added a useAutocomplete hook
    • Note: autocomplete dropdown will flicker between old and recently trigger search results. This will be address through supporting async and non-async in inputDropdown in another item
  • update AppliedFilter and StaticFilter to no longer use ID with headless public interface
  • as discussed with product, any update to static Filter should reset facet to avoid invalid facet send as part of request. Added call to resetFacets on handleFilterOptionChange

J=SLAP-1693
TEST=manual

jest tests passed
smoke tested sample-app with new headless version

  • see that universal search executed properly
  • see that vertical search work with multiple static filters
  • see that UI for loading state behave properly with universal/vertical search
  • see that autocomplete display options properly

Yen Truong and others added 5 commits November 9, 2021 17:37
update StaticFilter to no longer use ID with headless public interface
update function to transform static filters to displayableFilter to no longer account for ID
Note: will update package path/version when new headless version is publish

J=SLAP-1688
TEST=manual

hook sample-app with local headless branch. Setup two static filters, and see that they work accordingly
@yen-tt yen-tt changed the title Remove ID from staticFilter Update React Sample App according to new Headless State Nov 11, 2021
@yen-tt yen-tt added the wip Work in progress label Nov 11, 2021
@yen-tt yen-tt removed the wip Work in progress label Nov 16, 2021
@coveralls
Copy link

coveralls commented Nov 16, 2021

Coverage Status

Coverage remained the same at 75.532% when pulling 57e3a4a on dev/remove-id-in-filter into b159efd on main.

@yen-tt yen-tt requested a review from cea2aj November 16, 2021 18:04
@yen-tt yen-tt requested a review from oshi97 November 16, 2021 21:49
@yen-tt yen-tt requested a review from oshi97 November 16, 2021 21:53
export function useAutocomplete(isVertical: boolean): [AutocompleteResult[], () => Promise<void>] {
const answersActions = useAnswersActions();
const autocompleteNetworkIds = useRef({ latestRequest: 0, responseInState: 0 });
const [ autocompleteResults, setAutoCompleteResults ] = useState<AutocompleteResult[]>([]);
Copy link
Contributor

@oshi97 oshi97 Nov 16, 2021

Choose a reason for hiding this comment

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

we have an item to be consistent about the capitzliation for AutoComplete vs Autocomplete but I think within this method it would be nice to be consistent as well

Copy link
Contributor Author

Choose a reason for hiding this comment

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

oh yea, good catch. I made some changes to headless to have it lowercase, missed it here

@yen-tt yen-tt requested a review from oshi97 November 17, 2021 14:53
@yen-tt yen-tt merged commit ced7e2c into main Nov 17, 2021
@yen-tt yen-tt deleted the dev/remove-id-in-filter branch November 17, 2021 15:24
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.

None yet

4 participants