Skip to content

Commit

Permalink
Merge branch 'develop' into feature/answers-to-search
Browse files Browse the repository at this point in the history
merge with develop
.
  • Loading branch information
ElemelonWind committed Jul 13, 2022
2 parents a70ab0d + d7f2df4 commit 0f5bcc9
Show file tree
Hide file tree
Showing 11 changed files with 595 additions and 433 deletions.
9 changes: 9 additions & 0 deletions .github/workflows/run-linting.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
name: Run Linter

on:
pull_request:
branches: [main, develop, release/*, hotfix/*]

jobs:
linting:
uses: yext/slapshot-reusable-workflows/.github/workflows/run-linting.yml@v1
11 changes: 11 additions & 0 deletions .github/workflows/sync_develop_and_main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
name: Create PR from main to develop

on:
push:
branches: main

jobs:
call_sync_develop_and_main:
uses: yext/slapshot-reusable-workflows/.github/workflows/sync_develop_and_main.yml@v1
secrets:
caller_github_token: ${{ secrets.GITHUB_TOKEN }}
11 changes: 11 additions & 0 deletions .github/workflows/version_update.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
name: Update package version for release & hotfix branches

on:
push:
branches: [release/*, hotfix/*]

jobs:
call_version_update:
uses: yext/slapshot-reusable-workflows/.github/workflows/version_update.yml@v1
secrets:
caller_github_token: ${{ secrets.GITHUB_TOKEN }}
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ which is made available under the ODC Attribution License (https://github.com/ma

BSD 3-Clause License

Copyright (c) 2021, Yext
Copyright (c) 2022, Yext
All rights reserved.

Redistribution and use in source and binary forms, with or without
Expand Down
970 changes: 549 additions & 421 deletions package-lock.json

Large diffs are not rendered by default.

14 changes: 10 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,17 @@
{
"name": "@yext/search-headless",
"version": "1.2.0",
"description": "",
"description": "A library for powering UI components for Yext Search integrations",
"author": "slapshot@yext.com",
"license": "ISC",
"license": "BSD-3-Clause",
"main": "./dist/commonjs/src/index.js",
"module": "./dist/esm/src/index.js",
"keywords": [
"search",
"yext",
"redux",
"state management"
],
"files": [
"dist",
"lib",
Expand Down Expand Up @@ -37,11 +43,11 @@
"@types/node": "^16.11.12",
"@typescript-eslint/eslint-plugin": "^5.16.0",
"@typescript-eslint/parser": "^5.16.0",
"@yext/eslint-config-slapshot": "^0.2.0",
"@yext/eslint-config-slapshot": "^0.4.0",
"@yext/eslint-plugin-export-star": "^1.0.0",
"babel-jest": "^27.4.5",
"eslint": "^8.11.0",
"eslint-config-react-app": "^7.0.0",
"eslint-config-react-app": "^7.0.1",
"eslint-plugin-tsdoc": "^0.2.14",
"generate-license-file": "^1.3.0",
"jest": "^28.1.0",
Expand Down
2 changes: 1 addition & 1 deletion src/slices/filters.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ const reducers = {
if (!state.static) {
state.static = [];
}
const { selected, displayName:_, ...targetFilter } = payload;
const { selected, displayName: _, ...targetFilter } = payload;
const matchingFilter = state.static.find(storedFilter => {
return areFiltersEqual(storedFilter, targetFilter);
});
Expand Down
4 changes: 2 additions & 2 deletions src/utils/transform-filters.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,12 +37,12 @@ export function transformFiltersToCoreFormat(
return null;
}
if (selectableFilters.length === 1) {
const { selected, displayName:_, ...filter } = selectableFilters[0];
const { selected, displayName: _, ...filter } = selectableFilters[0];
return selected ? filter : null;
}
const selectedFilters = selectableFilters.filter(selectableFilter => selectableFilter.selected);
const groupedFilters: Record<string, Filter[]> = selectedFilters.reduce((groups, element) => {
const { selected:_, displayName:__, ...filter } = element;
const { selected: _, displayName: __, ...filter } = element;
groups[filter.fieldId]
? groups[filter.fieldId].push(filter)
: groups[filter.fieldId] = [filter];
Expand Down
1 change: 0 additions & 1 deletion tests/integration/facets.ts
Original file line number Diff line number Diff line change
Expand Up @@ -294,7 +294,6 @@ it('can reset facets correctly', () => {
);
});


function createInitialState(
facetIsSelected: boolean
): [initialState: Partial<State>, facetOption: DisplayableFacetOption] {
Expand Down
1 change: 0 additions & 1 deletion tests/integration/verticalsearch.ts
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,6 @@ it('answers.setVerticalLimit sets the vertical limit when a number is passed to
expect(answers.state.vertical.limit).toEqual(7);
});


it('handle a rejected promise from core', async () => {
const mockSearch = createMockRejectedSearch();
const mockCore = { verticalSearch: mockSearch };
Expand Down
3 changes: 1 addition & 2 deletions tests/unit/search-headless.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ const mockedStateManager: jest.Mocked<StateManager> = {
addListener: jest.fn()
};

const mockedSearch = jest.fn(() => { return { queryId: '123' };});
const mockedSearch = jest.fn(() => { return { queryId: '123' }; });
const mockedCore: any = {
verticalAutocomplete: jest.fn(() => { return {}; }),
universalAutocomplete: jest.fn(() => { return {}; }),
Expand Down Expand Up @@ -302,7 +302,6 @@ describe('filter functions work as expected', () => {
});
});


describe('auto-complete works as expected', () => {
beforeEach(() => {
jest.clearAllMocks();
Expand Down

0 comments on commit 0f5bcc9

Please sign in to comment.