Skip to content

Commit

Permalink
feat: add title search (TT-1560) (#5)
Browse files Browse the repository at this point in the history
Bruker tittelindeks fra bikube til søk. Ruter til ny side vha.
tittel-id.

Litt småtjafs:
* Grunnet [en irriterende bug i Autocomplete-komponenten i
v2.3.x](heroui-inc/heroui#2849) i NextUI har
jeg brukt v2.2.10
* Følgende måtte jeg legge til `allowsEmptyCollection={false}` og
     `onKeyDown={e => {
        if ('continuePropagation' in e) {
          e.continuePropagation();
        }
      }}`
for å unngå error-spam i console

Når buggen er fikset kan vi nok fint oppgradere igjen og fjerne de
ekstra propertiene som ble lagt på her.
  • Loading branch information
fredrikmonsen authored May 15, 2024
1 parent 6fa098f commit fbd9626
Show file tree
Hide file tree
Showing 22 changed files with 3,893 additions and 383 deletions.
1 change: 1 addition & 0 deletions .env
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
BASE_PATH=/hugin
2 changes: 2 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
BASE_PATH=/hugin
CATALOGUE_API_PATH=http://localhost:8087/bikube
9 changes: 9 additions & 0 deletions .github/workflows/ci_pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,14 @@ jobs:
- name: Linting
run: npm run lint

- name: Set environment variables based on ref
run: |
if [[ "${{ github.ref }}" == refs/tags/v* ]]; then
echo "CATALOGUE_API_PATH=${{ secrets.CATALOGUE_PROD_API_PATH }}" >> $GITHUB_ENV
else
echo "CATALOGUE_API_PATH=${{ secrets.CATALOGUE_STAGE_API_PATH }}" >> $GITHUB_ENV
fi
- name: Build application
run: npm run build

Expand Down Expand Up @@ -89,6 +97,7 @@ jobs:
build-args: |
HTTP_PROXY=${{ secrets.HTTP_PROXY }}
HTTPS_PROXY=${{ secrets.HTTPS_PROXY }}
CATALOGUE_API_PATH=${{ env.CATALOGUE_API_PATH }}
SENTRY_DSN=${{ secrets.SENTRY_DSN }}
SENTRY_ORG=${{ secrets.SENTRY_ORG }}
SENTRY_PROJECT=${{ secrets.SENTRY_PROJECT }}
Expand Down
44 changes: 15 additions & 29 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,36 +1,22 @@
This is a [Next.js](https://nextjs.org/) project bootstrapped with [`create-next-app`](https://github.com/vercel/next.js/tree/canary/packages/create-next-app).
## Hugin

## Getting Started

First, run the development server:
Hugin er en applikasjon for fysisk mottak av aviser.

### Lokalt oppsett
For å kjøre lokalt må du sette de nødvendige miljøvariablene:
```bash
npm run dev
# or
yarn dev
# or
pnpm dev
# or
bun dev
cp .env.example .env.local
```

Open [http://localhost:3000](http://localhost:3000) with your browser to see the result.

You can start editing the page by modifying `app/page.tsx`. The page auto-updates as you edit the file.

This project uses [`next/font`](https://nextjs.org/docs/basic-features/font-optimization) to automatically optimize and load Inter, a custom Google Font.

## Learn More

To learn more about Next.js, take a look at the following resources:
| Variabelnavn | Standardverdi | Beskrivelse |
|--------------------|------------------------------|----------------------------------------------------------------------------------------------------------------------|
| BASE_PATH | /hugin | Base path for applikasjonen |
| CATALOGUE_API_PATH | http://localhost:8087/bikube | Sti til [katalog APIet ](https://github.com/NationalLibraryOfNorway/bikube)<br/>Må starte med http:// eller https:// |

- [Next.js Documentation](https://nextjs.org/docs) - learn about Next.js features and API.
- [Learn Next.js](https://nextjs.org/learn) - an interactive Next.js tutorial.

You can check out [the Next.js GitHub repository](https://github.com/vercel/next.js/) - your feedback and contributions are welcome!

## Deploy on Vercel

The easiest way to deploy your Next.js app is to use the [Vercel Platform](https://vercel.com/new?utm_medium=default-template&filter=next.js&utm_source=create-next-app&utm_campaign=create-next-app-readme) from the creators of Next.js.

Check out our [Next.js deployment documentation](https://nextjs.org/docs/deployment) for more details.
Deretter kan du kjøre følgende kommandoer:
```bash
npm install
npm run dev
```
Applikasjonen finner du nå i nettleseren på [http://localhost:3000/hugin](http://localhost:3000/hugin).
11 changes: 10 additions & 1 deletion next.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,16 @@ import {withSentryConfig} from "@sentry/nextjs";
/** @type {import('next').NextConfig} */
const nextConfig = {
output: "standalone",
basePath: "/hugin",
basePath: process.env.BASE_PATH,
async rewrites() {
return [
{
source: '/api/:path*',
destination: `${process.env.CATALOGUE_API_PATH}/:path*`,
basePath: false
},
];
}
};

export default withSentryConfig(nextConfig, {
Expand Down
Loading

0 comments on commit fbd9626

Please sign in to comment.