Skip to content

Commit

Permalink
Merge pull request #340 from KnowWhereGraph/develop
Browse files Browse the repository at this point in the history
RC2
  • Loading branch information
ckfisher authored May 22, 2023
2 parents 87e0cb7 + 18a6916 commit 92a362b
Show file tree
Hide file tree
Showing 8 changed files with 22 additions and 39 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/prettier-pr.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,4 @@ jobs:
with:
# This part is also where you can pass other options, for example:
prettier_options: --check **/*.{js,md,ts}
only_changed: True
only_changed: True
2 changes: 1 addition & 1 deletion .prettierrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@
"tabWidth": 2,
"semi": false,
"singleQuote": true,
"prettier.printWidth": 120
"printWidth": 80
}
30 changes: 6 additions & 24 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ or

When building choose between the configurations specified in with the `--configuration` flag. The `production` flag should be used for production builds and `stage` for staging.

`ng build --configuration <production/stage>`
`ng build --configuration=<production/stage>`

This command builds outputs the build in the `dist/` folder.

Expand All @@ -39,31 +39,15 @@ There are three types of deployments:

#### Locally (Development Mode)

When working on the faceted-search, use the traditional `ng serve`. Visit the site locally at http://localhost:4200.

#### Docker + NGINX

To run the full NGINX and Angular stack, run the docker container created from the included Dockerfile.

```bash
docker build -t faceted-search .
docker run -d -p 8080:80 faceted-search
```

Visit http://localhost:8080 for the deployment.

#### Staging & Production Servers

When deploying on the staging or production servers, first fetch the cache, then build the project, and finally copy the files to a location that is being served by NGINX.

For example,
When working on the faceted-search, run the following

```bash
npm run cache-prod
npm run build --configuration=stage
cp -r dist/faceted-search/* /var/www/html
ng serve
```

Visit the site at http://localhost:4200

## Troubleshooting

### The GNIS/Hazard/Location Tree Facets Aren't Working
Expand Down Expand Up @@ -134,6 +118,4 @@ The Faceted Search follows versioning conventions from [Semantic Versioning](htt

Contributions as issues and pull requests are welcome. New features should be made as pull requests into the `develop` branch and attached to an issue. The pull request should detail what was done, how it can be tested, and any relevant documentation updates. The project uses [prettier](https://prettier.io/) for code formatting, with line widths set to 120 characters.

Before creating pull requests, lint the project with

`ng lint`
Before creating pull requests, prettify your code changes with [prettier](https://prettier.io/).
14 changes: 7 additions & 7 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@
"karma-coverage": "~2.1.0",
"karma-jasmine": "~4.0.0",
"karma-jasmine-html-reporter": "~1.7.0",
"prettier": "^2.8.7",
"prettier": "2.8.8",
"typescript": "~4.8.4"
}
}
1 change: 1 addition & 0 deletions src/app/facets/facets.component.scss
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
border-radius: 0 5px 5px 0;
color: #fff;
cursor: pointer;
width: 30%
}

.facet {
Expand Down
4 changes: 2 additions & 2 deletions src/app/places-table/places-table.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ export class PlacesTableComponent implements OnInit {
this.placesDataSource = new MatTableDataSource(this.places)
this.populateTable()
this.totalSize = 0
// Emit an event signaling that counting has stopped, and include the results count
this.resultsCountEvent.emit(this.totalSize)
}

Expand Down Expand Up @@ -105,11 +106,10 @@ export class PlacesTableComponent implements OnInit {
.then((results: any) => {
this.places = []
// Check to see if the query failed
if (results === false) {
if (results.records === undefined) {
this.totalSize = 0
this.resultsCountEvent.emit(this.totalSize)
this.searchQueryFinishedEvent.emit(true)
this.errorModal.emit()
return
}
results.records.forEach((result) => {
Expand Down
6 changes: 3 additions & 3 deletions src/app/services/query.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -430,7 +430,7 @@ export class QueryService {

if (placesFacets['keyword'] && placesFacets['keyword'] != '') {
placeQuery += `
?search a elastic-index:kwg_fs_index;
?search a elastic-index:kwg_manhattan_fs_index;
elastic:query "${placesFacets['keyword']}";
elastic:entities ?entity.
?entity elastic:score ?score.
Expand Down Expand Up @@ -659,7 +659,7 @@ export class QueryService {
//Keyword search
if (hazardFacets['keyword'] && hazardFacets['keyword'] != '') {
hazardQuery += `
?search a elastic-index:kwg_fs_index;
?search a elastic-index:kwg_manhattan_fs_index;
elastic:query "${hazardFacets['keyword']}";
elastic:entities ?entity.
?entity elastic:score ?score.
Expand Down Expand Up @@ -871,7 +871,7 @@ export class QueryService {
}
let keyword_query = ``
if (keyword != '') {
keyword_query = `?search a elastic-index:kwg_fs_index;
keyword_query = `?search a elastic-index:kwg_manhattan_fs_index;
elastic:query "${keyword}";
elastic:entities ?entity.
?entity elastic:score ?score.`
Expand Down

0 comments on commit 92a362b

Please sign in to comment.