Skip to content

Commit 50d46b5

Browse files
committed
Renamed /app-search to /search-lib
1 parent f50527d commit 50d46b5

23 files changed

+80
-73
lines changed

README.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# App Search Reference UI
22

33
The Reference UI is a configurable, generic UI meant to work with
4-
any [App Search](https://www.elastic.co/cloud/app-search-service) Engine. It
4+
any [App Search](https://www.elastic.co/cloud/search-lib-service) Engine. It
55
can serve as a simple demo, a functional test for your Engine data,
66
or as a code reference when building out your own App Search
77
UI.
@@ -27,7 +27,7 @@ Run the following commands to start this application:
2727
# Run the `cd` command to change the current directory to the
2828
# location of your downloaded Reference UI. Replace the path
2929
# below with the actual path of your project.
30-
cd ~/Downloads/app-search-reference-ui
30+
cd ~/Downloads/search-lib-reference-ui
3131

3232
# Run this to set everything up
3333
npm install
@@ -57,7 +57,7 @@ The following is a complete list of options available for configuration in [engi
5757
| `urlField` | String | optional | A field with a url to use as a link in results. |
5858
| `urlFieldTemplate` | String | optional | Instead of urlField, you can provide a URL "template" here, which lets you build a URL from other fields. ex: "https://www.example.com/{{id}}". |
5959
| `sortFields` | Array[String] | required | A list of fields that will be used for sort options. |
60-
| `facets` | Array[String] | required | A list of fields that will be available as "facet" filters. Read more about facets within the [App Search documentation](https://swiftype.com/documentation/app-search/guides/facets). |
60+
| `facets` | Array[String] | required | A list of fields that will be available as "facet" filters. Read more about facets within the [App Search documentation](https://swiftype.com/documentation/search-lib/guides/facets). |
6161

6262
### External configuration
6363

@@ -92,13 +92,13 @@ Logically, the pieces of this application fit together like this:
9292
|
9393
( State manager ) ( Syncs state with URL )
9494
------------------- --------------
95-
| AppSearchDriver | <--> | URLManager |
95+
| SearchDriver | <--> | URLManager |
9696
------------------- --------------
9797
|
9898
| actions / state
9999
v
100100
---------------------
101-
| AppSearchProvider | ( Driver to React glue )
101+
| SearchProvider | ( Driver to React glue )
102102
---------------------
103103
|
104104
| context
@@ -115,7 +115,7 @@ Logically, the pieces of this application fit together like this:
115115

116116
That corresponds to the code and file structure in the following way:
117117

118-
**src/app-search**
118+
**src/search-lib**
119119

120120
Everything in this directory for now should be thought of as a separate library.
121121
The goal eventually is to actually separate this out into a library of its own,
@@ -171,7 +171,7 @@ Components in this UI are separated into "Containers" and "Components". These
171171
can be thought of as "Logic" and "View", respectively.
172172

173173
"Containers" are "connected" to the "context" via a "Higher Order Component"
174-
(HOC) `withAppSearch`. This HOC simply exposes all state and actions as `props`.
174+
(HOC) `withSearch`. This HOC simply exposes all state and actions as `props`.
175175
A consuming Container simply accesses those actions and state, composes
176176
appropriate handlers and data as props and passes them to the appropriate
177177
Component.
@@ -218,7 +218,7 @@ own implementation. Here are a few places to look to make changes:
218218
won't need this.
219219

220220
- Lastly, if you find there is a core action or state missing, you may
221-
consider updating the core logic in [src/app-search](src/app-search).
221+
consider updating the core logic in [src/search-lib](src/search-lib).
222222

223223
Lastly, we accept PRs! If you make a customization that you think would benefit
224224
others, please feel free to contribute it back.

src/App.js

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
11
import React, { Component } from "react";
22

33
import { Body, Header } from "./components";
4-
import AppSearchProvider from "./app-search/AppSearchProvider";
5-
import AppSearchDriver from "./app-search/AppSearchDriver";
6-
import AppSearchAPIConnector from "./app-search/AppSearchAPIConnector";
4+
import {
5+
SearchProvider,
6+
SearchDriver,
7+
AppSearchAPIConnector
8+
} from "./search-lib";
79

810
import {
911
buildFacetConfigFromConfig,
@@ -13,7 +15,7 @@ import {
1315

1416
function createDriver() {
1517
const { hostIdentifier, searchKey, endpointBase, engineName } = getConfig();
16-
return new AppSearchDriver({
18+
return new SearchDriver({
1719
apiConnector: new AppSearchAPIConnector({
1820
hostIdentifier,
1921
searchKey,
@@ -39,7 +41,7 @@ class App extends Component {
3941
}
4042

4143
return (
42-
<AppSearchProvider driver={createDriver()}>
44+
<SearchProvider driver={createDriver()}>
4345
{({ searchTerm, results }) => (
4446
<div
4547
className={`reference-ui${
@@ -50,7 +52,7 @@ class App extends Component {
5052
<Body />
5153
</div>
5254
)}
53-
</AppSearchProvider>
55+
</SearchProvider>
5456
);
5557
}
5658
}

src/app-search/AppSearchConsumer.js

Lines changed: 0 additions & 3 deletions
This file was deleted.

src/app-search/AppSearchContext.js

Lines changed: 0 additions & 5 deletions
This file was deleted.

src/containers/ErrorBoundary.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import PropTypes from "prop-types";
22
import React, { Component } from "react";
33

4-
import withAppSearch from "../app-search/withAppSearch";
4+
import { withSearch } from "../search-lib";
55
import { ErrorBoundary } from "../components";
66

77
export class ErrorBoundaryContainer extends Component {
@@ -15,4 +15,4 @@ export class ErrorBoundaryContainer extends Component {
1515
}
1616
}
1717

18-
export default withAppSearch(ErrorBoundaryContainer);
18+
export default withSearch(ErrorBoundaryContainer);

src/containers/Facets.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import PropTypes from "prop-types";
22
import React, { Component } from "react";
33

4-
import withAppSearch from "../app-search/withAppSearch";
4+
import { withSearch } from "../search-lib";
55
import { Facet, Facets } from "../components";
66
import { FacetDetail, Filter } from "../types";
77

@@ -57,4 +57,4 @@ export class FacetsContainer extends Component {
5757
}
5858
}
5959

60-
export default withAppSearch(FacetsContainer);
60+
export default withSearch(FacetsContainer);

src/containers/Paging.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import React from "react";
44

55
import "rc-pagination/assets/index.css";
66

7-
import withAppSearch from "../app-search/withAppSearch";
7+
import { withSearch } from "../search-lib";
88

99
// App Search is currently limited to 100 pages, so we need to make sure
1010
// that our pager only shows up to 100 pages.
@@ -39,4 +39,4 @@ PagingContainer.propTypes = {
3939
totalResults: PropTypes.number.isRequired
4040
};
4141

42-
export default withAppSearch(PagingContainer);
42+
export default withSearch(PagingContainer);

src/containers/PagingInfo.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import PropTypes from "prop-types";
22
import React, { Component } from "react";
33

4-
import withAppSearch from "../app-search/withAppSearch";
4+
import { withSearch } from "../search-lib";
55
import { PagingInfo } from "../components";
66

77
export class PagingInfoContainer extends Component {
@@ -40,4 +40,4 @@ export class PagingInfoContainer extends Component {
4040
}
4141
}
4242

43-
export default withAppSearch(PagingInfoContainer);
43+
export default withSearch(PagingInfoContainer);

src/containers/Results.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import PropTypes from "prop-types";
22
import React, { Component } from "react";
33

4-
import withAppSearch from "../app-search/withAppSearch";
4+
import { withSearch } from "../search-lib";
55
import { Result, Results } from "../components";
66
import * as Config from "../config/config-helper";
77

@@ -63,4 +63,4 @@ export class ResultsContainer extends Component {
6363
}
6464
}
6565

66-
export default withAppSearch(ResultsContainer);
66+
export default withSearch(ResultsContainer);

src/containers/ResultsPerPage.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import PropTypes from "prop-types";
22
import React, { Component } from "react";
33

4-
import withAppSearch from "../app-search/withAppSearch";
4+
import { withSearch } from "../search-lib";
55
import { ResultsPerPage } from "../components";
66

77
export class ResultsPerPageContainer extends Component {
@@ -34,4 +34,4 @@ export class ResultsPerPageContainer extends Component {
3434
}
3535
}
3636

37-
export default withAppSearch(ResultsPerPageContainer);
37+
export default withSearch(ResultsPerPageContainer);

0 commit comments

Comments
 (0)