From 1bd546a6d81e8fcb1cf731581645b06e2f9e2c78 Mon Sep 17 00:00:00 2001 From: thomasthelen Date: Sat, 29 Apr 2023 19:40:44 -0700 Subject: [PATCH 1/6] Add docs for action test --- src/app/places-table/places-table.component.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/app/places-table/places-table.component.ts b/src/app/places-table/places-table.component.ts index 171de780..4c1c2d19 100644 --- a/src/app/places-table/places-table.component.ts +++ b/src/app/places-table/places-table.component.ts @@ -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) } @@ -76,7 +77,7 @@ export class PlacesTableComponent implements OnInit { ngAfterViewInit() { this.paginator.page.subscribe((event) => { this.pageSize = event.pageSize - this.offset = event.pageIndex * this.pageSize + this.offset = event.pageIndex *this.pageSize this.paginationEvent.emit() }) } From d4844b88113b0dba642ed874992f175c03fbad0d Mon Sep 17 00:00:00 2001 From: thomasthelen Date: Sat, 29 Apr 2023 19:48:00 -0700 Subject: [PATCH 2/6] Use improper formatting to test prettier action --- .github/workflows/prettier-pr.yaml | 2 +- .prettierrc.json | 2 +- package-lock.json | 14 +++++++------- package.json | 2 +- src/app/places-table/places-table.component.ts | 2 +- 5 files changed, 11 insertions(+), 11 deletions(-) diff --git a/.github/workflows/prettier-pr.yaml b/.github/workflows/prettier-pr.yaml index 25e02d6f..d44e5737 100644 --- a/.github/workflows/prettier-pr.yaml +++ b/.github/workflows/prettier-pr.yaml @@ -22,4 +22,4 @@ jobs: with: # This part is also where you can pass other options, for example: prettier_options: --write **/*.{js,md} - only_changed: True \ No newline at end of file + only_changed: True diff --git a/.prettierrc.json b/.prettierrc.json index 21903849..1f0a776c 100644 --- a/.prettierrc.json +++ b/.prettierrc.json @@ -3,5 +3,5 @@ "tabWidth": 2, "semi": false, "singleQuote": true, - "prettier.printWidth": 120 + "printWidth": 80 } diff --git a/package-lock.json b/package-lock.json index 1442d8ac..e018842f 100644 --- a/package-lock.json +++ b/package-lock.json @@ -58,7 +58,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" } }, @@ -11715,9 +11715,9 @@ } }, "node_modules/prettier": { - "version": "2.8.7", - "resolved": "https://registry.npmjs.org/prettier/-/prettier-2.8.7.tgz", - "integrity": "sha512-yPngTo3aXUUmyuTjeTUT75txrf+aMh9FiD7q9ZE/i6r0bPb22g4FsE6Y338PQX1bmfy08i9QQCB7/rcUAVntfw==", + "version": "2.8.8", + "resolved": "https://registry.npmjs.org/prettier/-/prettier-2.8.8.tgz", + "integrity": "sha512-tdN8qQGvNjw4CHbY+XXk0JgCXn9QiF21a55rBe5LJAU+kDyC4WQn4+awm2Xfk2lQMk5fKup9XgzTZtGkjBdP9Q==", "dev": true, "bin": { "prettier": "bin-prettier.js" @@ -23231,9 +23231,9 @@ "dev": true }, "prettier": { - "version": "2.8.7", - "resolved": "https://registry.npmjs.org/prettier/-/prettier-2.8.7.tgz", - "integrity": "sha512-yPngTo3aXUUmyuTjeTUT75txrf+aMh9FiD7q9ZE/i6r0bPb22g4FsE6Y338PQX1bmfy08i9QQCB7/rcUAVntfw==", + "version": "2.8.8", + "resolved": "https://registry.npmjs.org/prettier/-/prettier-2.8.8.tgz", + "integrity": "sha512-tdN8qQGvNjw4CHbY+XXk0JgCXn9QiF21a55rBe5LJAU+kDyC4WQn4+awm2Xfk2lQMk5fKup9XgzTZtGkjBdP9Q==", "dev": true }, "pretty-bytes": { diff --git a/package.json b/package.json index 97e19ce5..706d15bb 100644 --- a/package.json +++ b/package.json @@ -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" } } diff --git a/src/app/places-table/places-table.component.ts b/src/app/places-table/places-table.component.ts index 4c1c2d19..db18b032 100644 --- a/src/app/places-table/places-table.component.ts +++ b/src/app/places-table/places-table.component.ts @@ -77,7 +77,7 @@ export class PlacesTableComponent implements OnInit { ngAfterViewInit() { this.paginator.page.subscribe((event) => { this.pageSize = event.pageSize - this.offset = event.pageIndex *this.pageSize + this.offset = event.pageIndex * this.pageSize this.paginationEvent.emit() }) } From ac56e2f73c0eaeae86598f1384f7347ac02f4ed2 Mon Sep 17 00:00:00 2001 From: thomasthelen Date: Sat, 29 Apr 2023 20:23:22 -0700 Subject: [PATCH 3/6] Update readme --- README.md | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) diff --git a/README.md b/README.md index 774a41c2..c6e68ccd 100644 --- a/README.md +++ b/README.md @@ -39,18 +39,14 @@ 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. +When working on the faceted-search, run the following ```bash -docker build -t faceted-search . -docker run -d -p 8080:80 faceted-search +npm run cache-prod +ng serve ``` -Visit http://localhost:8080 for the deployment. +Visit the site at http://localhost:4200 #### Staging & Production Servers @@ -134,6 +130,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/). From de3198ebdb7e3c3540e91c34ceea15f3adadbe2b Mon Sep 17 00:00:00 2001 From: thomasthelen Date: Tue, 16 May 2023 14:37:53 -0700 Subject: [PATCH 4/6] Change the ES name --- src/app/services/query.service.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/app/services/query.service.ts b/src/app/services/query.service.ts index aedd808f..418f258c 100644 --- a/src/app/services/query.service.ts +++ b/src/app/services/query.service.ts @@ -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. @@ -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. @@ -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.` From f03e62638c5f86210f970cbaedf73c1bd7898ee8 Mon Sep 17 00:00:00 2001 From: thomasthelen Date: Thu, 18 May 2023 20:47:38 -0700 Subject: [PATCH 5/6] Fix styling on keyword search --- README.md | 2 +- src/app/facets/facets.component.scss | 1 + src/app/places-table/places-table.component.ts | 3 +-- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index c6e68ccd..3908ffa8 100644 --- a/README.md +++ b/README.md @@ -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 ` +`ng build --configuration=` This command builds outputs the build in the `dist/` folder. diff --git a/src/app/facets/facets.component.scss b/src/app/facets/facets.component.scss index 696a6468..d721ad6b 100644 --- a/src/app/facets/facets.component.scss +++ b/src/app/facets/facets.component.scss @@ -32,6 +32,7 @@ border-radius: 0 5px 5px 0; color: #fff; cursor: pointer; + width: 30% } .facet { diff --git a/src/app/places-table/places-table.component.ts b/src/app/places-table/places-table.component.ts index db18b032..b939f1b8 100644 --- a/src/app/places-table/places-table.component.ts +++ b/src/app/places-table/places-table.component.ts @@ -106,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) => { From 18a691609d6b237185ef37e0a7e7d68adc167c8a Mon Sep 17 00:00:00 2001 From: Thomas Thelen Date: Sun, 21 May 2023 21:33:01 -0700 Subject: [PATCH 6/6] Update README.md --- README.md | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/README.md b/README.md index 3908ffa8..862c6309 100644 --- a/README.md +++ b/README.md @@ -48,18 +48,6 @@ ng serve Visit the site at http://localhost:4200 -#### 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, - -```bash -npm run cache-prod -npm run build --configuration=stage -cp -r dist/faceted-search/* /var/www/html -``` - ## Troubleshooting ### The GNIS/Hazard/Location Tree Facets Aren't Working