Skip to content

Commit

Permalink
Merge pull request #516 from NYPL/development
Browse files Browse the repository at this point in the history
Release 0.18.2 to production
  • Loading branch information
kylevillegas93 authored Aug 6, 2024
2 parents 73f353e + 7877174 commit 211d516
Show file tree
Hide file tree
Showing 22 changed files with 344 additions and 147 deletions.
12 changes: 10 additions & 2 deletions .env.sample
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,19 @@ API_URL=http://drb-api-qa.nypl.org
# https://github.com/NYPL-Simplified/web-reader#cors-proxy
NEXT_PUBLIC_PROXY_URL=http://localhost:3001/?requestUrl=


# OPTIONAL LOCAL VARIABLES

# READER VERSION
NEXT_PUBLIC_READER_VERSION="v2"

# Airtable API Key
# The airtable key is only needed in development if the developer needs to send data via the feedback form.

NEXT_PUBLIC_AIRTABLE_API_KEY=[insert key here]
NEXT_PUBLIC_ADOBE_ANALYTICS=[insert AA url here]

# ADOBE ANALYTICS
NEXT_PUBLIC_ADOBE_ANALYTICS=[insert AA url here]

# NEW RELIC
NEW_RELIC_APP_NAME=[insert name here]
NEW_RELIC_LICENSE_KEY=[insert key here]
2 changes: 1 addition & 1 deletion .github/PULL_REQUEST_TEMPLATE
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[Jira Ticket](http://jira.nypl.org/browse/SFR-XXX)
[Jira Ticket](https://newyorkpubliclibrary.atlassian.net/browse/SFR-XXX)

### This PR does the following:
-
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/build-production.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ jobs:
# the tag will match the package.json version (eg. v1.0.0)
- name: Tag
id: autotagger
uses: butlerlogic/action-autotag@stable
env:
uses: butlerlogic/action-autotag@1.1.2
env:
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
with:
strategy: package
Expand Down
16 changes: 15 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,19 @@
# CHANGE LOG

## [0.18.2]

- Fix cut off text on search bar dropdown
- Fix broken link on the About page
- SFR-2008: Automate License Page Headers and Sub-Headers
- SFR-2033: Verify the external NYPL header links of DRB App
- Update PR template with new Jira link
- Add error page for /read links with invalid source
- Implement "Read Online" for UP items
- SFR-2032: Update local API url
- SFR-2076: Fix DRB PW Regression Tests
- Update README with instructions to run app locally
- Update `butlerlogic/action-autotag` version to be pinned since the stable version is using an unsupported Node version

## [0.18.1]

- SFR-1917: Fixed failing Playwright tests
Expand All @@ -9,7 +23,7 @@
- Update README to include production release information
- Upgrade NYPL Design System to 3.1.1
- Upgrade Web Reader to 4.3.4
- Fix issue where 0 character is shown when there are no authors
- Fix issue where 0 character is shown when there are no authors

## [0.18.0]

Expand Down
61 changes: 43 additions & 18 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
## NYPL ResearchNow

### ResearchNow Search & Retrieval Application
# Digital Research Books Frontend

[![GitHub version](https://badge.fury.io/gh/NYPL%2Fsfr-bookfinder-front-end.svg)](https://badge.fury.io/gh/NYPL%2Fsfr-bookfinder-front-end)

Digital Research Books' front end application based on NYPL's React Design System.
Digital Research Books' front end application based on NYPL's Reservoir Design System.

Provides a "Welcome page" entry point with heading, search box, and tagline. Connects to an ElasticSearch index via an API endpoint (https://digital-research-books-api.nypl.org).
Simple searches can be entered in the form and an index response is displayed back to the user.
Expand All @@ -15,40 +13,67 @@ This is a [Next.js](https://nextjs.org/) project bootstrapped with [`create-next

### Contributing: Local Development

Clone the repo and run `npm install`.
#### Getting Started

##### Prerequisites

- Install Node.js v18 or later
- To view pdfs locally through the webreader, you will need to set up a local proxy. If you used environment variables from `.env.sample` you should be able to pull the [web-reader](https://github.com/NYPL-Simplified/web-reader) repo, install it, and run `npm run cors-proxy`. See the web-reader repo for more [instructions](https://github.com/NYPL-Simplified/web-reader#cors-proxy)

Create a `.env` file and add the `APP_ENV` and `API_URL`. See `.env.sample` for an example.
1. Install the required packages

Run `npm run dev` to start the local server at `localhost:3000`
```
npm install
```

2. Create a `.env` file and add required environment variables. See `.env.sample` for an example.

#### Running the app locally with npm at `localhost:3000`

```
npm run dev
```

To view pdfs locally through the webreader, you will need to set up a local proxy. If you used environment variables from `.env.sample` you should be able to pull the [web-reader](https://github.com/NYPL-Simplified/web-reader) repo, install it, and run `npm run cors-proxy`. See the web-reader repo for more [instructions](https://github.com/NYPL-Simplified/web-reader#cors-proxy)
#### Local Hosting

In order to successfully login under a local deployment, you will need to update your machine's `etc/hosts` file. This hosts file maps local host names to ip addresses.

Add this to your `etc/hosts` file:
This is necessary because NYPL's authentication system works by reading cookies and parsing the patron's encrypted credentials. These cookies only work on .nypl.org domains, so we need to map our local deployment to a .nypl.org domain.

Add this line to your `etc/hosts` file:

```
127.0.0.1 local.nypl.org
```

#### Running the app locally with Docker

1. Download and install Docker.
2. `cd` into `sfr-bookfinder-front-end` repo
3. To build and run the application, run:

```
docker-compose up
```

4. Check that app is being served at http://localhost:3000

### Deploying to Production

1. Create a new branch off `development` with the name `NO-REF_prepare-<VERSION>`, i.e. `NO-REF_prepare-1.2.3`. Replace any reference to "Pre-release" and the previous production version in the package.json and package-lock.json files with the current version number. Push the branch and create a Pull Request with the name `NOREF prepare <VERSION> release`, i.e. `NOREF prepare 1.2.3 release`. Merge these changes once the PR is approved.
1. Create a new branch off `development` with the name `NO-REF_prepare-<VERSION>`, i.e. `NO-REF_prepare-1.2.3`. Replace any reference to "Pre-release" and the previous production version in the package.json and package-lock.json files with the current version number. Push the branch and create a Pull Request with the name `NOREF prepare <VERSION> release`, i.e. `NOREF prepare 1.2.3 release`. Merge these changes once the PR is approved.
2. Create a Pull Request to `production` from `development` with the name `Release <VERSION> to production`, i.e. `Release 1.2.3 to production`. The description of the PR should be the new version's changelog to be used in the tag and release step of the .yaml file.
3. Merge the PR after approval to trigger the [`build-production.yaml`](./.github/workflows/build-production.yaml) GitHub Action, which pushes a Docker image to ECR, updates the `production` ECS deployment, and creates a new release version on GitHub.
4. Add the link to the PR to the release ticket in Jira and tag the appropriate member of QA, the project manager, and the product manager. Move the ticket to "In QA" and assign it to the appropriate member of QA. QA should be done on https://drb-qa.nypl.org/.


### Dependencies

- NextJS
- Redux
- NYPL Header and Footer npm modules
- NYPL Design System
- NYPL Web Reader

### Usage

### Searchbar
#### Searchbar

Currently takes in a query string to pass along to the ResearchNow Search API which submits a keyword search to the Elasticsearch instance, and renders the returned output. Sends the `query` parameter specified in the rendered search form on the main page.

Expand All @@ -63,23 +88,23 @@ Term combinations

These types of combinations can be used with any available field selection.

### Filtering
#### Filtering

Search Results can be filtered by year range, language and available format.

### Advanced Search
#### Advanced Search

Advanced Search works like the Simple Search, but allows searching for multiple fields and for pre-filtering. Terms use the AND boolean operator
Term combinations

- Example: Subject:"English Literature" AND Keyword:"Witches"

### Works and Editions
#### Works and Editions

- Each source record is represented as an Item (something that can actually be read online), which are grouped into Editions (e.g. the 1917 edition of X), which are in turn grouped into Works, (e.g. Moby Dick, or, The Whale). Through this a user can search for and find a single Work record and see all editions of that Work and all of its options for reading online.
- The information and code for this normalization is found in the [drb-etl-pipeline repo](https://github.com/NYPL/drb-etl-pipeline)

### Accessing books
#### Accessing books

- Books can be read three ways:
- Embedded page: DRB embeds a read-online page from a different source. DRB commonly does this for Hathitrust books
Expand Down
7 changes: 6 additions & 1 deletion config/appConfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ const appConfig = {
baseUrl: "",
api: {
url: {
local: "localhost:5000",
local: "http://localhost:5050",
development: "https://drb-api-qa.nypl.org",
qa: "https://drb-api-qa.nypl.org",
production: "http://drb-api-qa.nypl.org",
Expand All @@ -34,6 +34,11 @@ const appConfig = {
displayCitations: {
experimentName: "DisplayCitations",
},
aboutPageWork: {
development: "/work/5950e6df-9d99-42fe-8924-1116166a2acb",
qa: "/work/5950e6df-9d99-42fe-8924-1116166a2acb",
production: "/work/8771d353-b75f-4f30-a424-e3b9516601f0",
},
};

export default appConfig;
Loading

0 comments on commit 211d516

Please sign in to comment.