Skip to content

Commit

Permalink
Merge pull request #98 from diggsweden/release-3.1.5-main
Browse files Browse the repository at this point in the history
Release 3.1.5 main
  • Loading branch information
dajjen authored Dec 19, 2023
2 parents bb2765e + 1ce9ab7 commit 502c053
Show file tree
Hide file tree
Showing 10 changed files with 4,880 additions and 5,423 deletions.
10 changes: 8 additions & 2 deletions .env.local.example
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,19 @@ HTTP_PROXY=http://proxy.digg.se:8080
HTTP_PROXY_USER=secretuser
HTTP_PROXY_PASS=secretpass

# Connect to a local backend.
## Connect to a local strapi backend.
#APOLLO_URL=http://localhost:1301
#REACT_APP_APOLLO_URL=http://localhost:1301
#IMAGE_DOMAIN=localhost
#REACT_APP_MEDIA_BASE_URL=http://localhost:1337

# Connect to production backend. (dataportal.se).
## Connect to a local apollo-gateway proxy server.
#APOLLO_URL=http://localhost:1400
#REACT_APP_APOLLO_URL=http://localhost:1400
#IMAGE_DOMAIN=localhost
#REACT_APP_MEDIA_BASE_URL=http://localhost:1337

## Connect to production gateway.
APOLLO_URL=https://graphql.digg.se/
REACT_APP_APOLLO_URL=https://graphql.digg.se/
IMAGE_DOMAIN=graphql.digg.se
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ yarn-error.log*

# misc
.DS_Store
.idea/
*.pem
.idea/

Expand Down
8 changes: 4 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
FROM node:16-alpine as base
FROM node:18-alpine as base
WORKDIR /base
COPY package.json yarn.lock ./
RUN yarn install --frozen-lockfile

FROM node:16-alpine as builder
FROM node:18-alpine as builder
WORKDIR /build
COPY . .
COPY --from=base /base ./
RUN yarn build

FROM node:16-alpine as production
FROM node:18-alpine as production
ENV NODE_ENV=production

WORKDIR /app
Expand All @@ -36,4 +36,4 @@ RUN chgrp -R 0 /app && \
chmod -R g=u /app
USER 1001

CMD ["yarn","start"]
CMD ["yarn","start"]
18 changes: 14 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ The Swedish data portal is tightly integrated with the EntryScape product suite
EntryScape Registry is a solution for managing a registry of data catalogs and related information

## Requirements
![node-current](https://img.shields.io/badge/node-16.13.2-green)
![node-current](https://img.shields.io/badge/node-18.18.0-green)
![npm-current](https://img.shields.io/badge/npm-8.1.2-green)
![nextjs-current](https://img.shields.io/badge/nextjs-12.1.6-green)

Expand All @@ -23,7 +23,7 @@ Start by creating an ```.env.local``` file. Use the ```.env.local.example``` as
### Run application in development mode
Starts the application in development mode with hot-code reloading, error reporting, and more. See [Nextjs Development](https://nextjs.org/docs/app/api-reference/next-cli#development) for more information.
Run:
```sh
```sh
yarn
yarn dev
```
Expand All @@ -33,7 +33,7 @@ Visit [http://localhost:3000](http://localhost:3000) in the browser.
Builds the application for production usage. See [Nextjs production build](https://nextjs.org/docs/app/api-reference/next-cli#build) for more info.
And Start the Next.js production server. See [Nextjs start production](https://nextjs.org/docs/app/api-reference/next-cli#production) for more info.

Use real data from dataportalen.se by using the variables under "Connect to production backend. (dataportal.se)." in env.local.example file.
Use real data from dataportalen.se by using the variables under "Connect to production backend. (dataportal.se)." in env.local.example file.
Run:
```sh
yarn
Expand All @@ -46,7 +46,17 @@ Visit [http://localhost:3000](http://localhost:3000) in the browser.
### Run application with Docker

```sh
#build image
yarn build
```

Detta kommer generera applikationen som statiska filer under .next-mappen.

## Docker
Docker version running is [node:18-alpine](https://hub.docker.com/layers/library/node/18-alpine/images/sha256-28630a8b97ae8336d77b6dae5705bea816bdc1d6383901bb4495c521929a4091?context=explore)


```sh
#bygg image
docker build . -t nextjs-dataportal

#create container
Expand Down
8 changes: 6 additions & 2 deletions components/EntrystoreProvider/EntrystoreProvider.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,9 @@ export const EntrystoreProvider: React.FC<EntrystoreProviderProps> = ({
es
)
);
valuePromises.push(getLocalizedValue(graph, 'dcterms:description', nextLang, es));
valuePromises.push(
getLocalizedValue(graph, 'dcterms:description', nextLang, es, { resourceURI })
);
if (fetchMore) {
valuePromises.push(getLocalizedValue(graph, 'dcterms:publisher', nextLang, es));
valuePromises.push(
Expand Down Expand Up @@ -269,7 +271,9 @@ export const EntrystoreProvider: React.FC<EntrystoreProviderProps> = ({
es
)
);
valuePromises.push(getLocalizedValue(graph, 'dcterms:description', nextLang, es));
valuePromises.push(
getLocalizedValue(graph, 'dcterms:description', nextLang, es, { resourceURI })
);
if (fetchMore) {
valuePromises.push(getLocalizedValue(graph, 'dcterms:publisher', nextLang, es));
valuePromises.push(
Expand Down
9 changes: 4 additions & 5 deletions components/pages/DataSetPage.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React, { useContext, useEffect } from 'react';
import { EntrystoreContext } from '..';
import ShowMoreText from 'react-show-more-text';
import ShowMore from 'react-show-more';
import { useRouter } from 'next/router';
import useTranslation from 'next-translate/useTranslation';
import { SettingsContext } from '../SettingsProvider';
Expand Down Expand Up @@ -404,17 +404,16 @@ export const DataSetPage: React.FC = () => {
</div>

{/* Description */}
<div className="description">
<ShowMoreText
<div className="description text-md">
<ShowMore
lines={8}
more={t('pages|datasetpage$view_more')}
less={t('pages|datasetpage$view_less')}
className="text-md"
anchorClass="text-md view-more-text-link"
expanded={false}
>
<span className="text-md">{entry.description}</span>
</ShowMoreText>
</ShowMore>
</div>

{/* Left column */}
Expand Down
43 changes: 21 additions & 22 deletions env/Settings.Sandbox.ts
Original file line number Diff line number Diff line change
@@ -1,36 +1,35 @@
import { generateRandomKey } from "../utilities";
import { EnvSettings } from "./EnvSettings";
import { generateRandomKey } from '../utilities';
import { EnvSettings } from './EnvSettings';

export class Settings_Sandbox extends EnvSettings {
ENTRYSCAPE_DATASETS_PATH="sandbox.admin.dataportal.se"
ENTRYSCAPE_SPECS_PATH="editera.dataportal.se"
ENTRYSCAPE_TERMS_PATH="editera.dataportal.se"
ENTRYSCAPE_ORG_STATS_URL="https://sandbox.admin.dataportal.se/charts/orgData.json"
ENTRYSCAPE_THEME_STATS_URL="https://sandbox.admin.dataportal.se/charts/themeData.json"
ENTRYSCAPE_THEME_STATS_URL_EN="https://sandbox.admin.dataportal.se/charts/themeData_en.json"
ENTRYSCAPE_DATASETS_PATH = 'sandbox.admin.dataportal.se';
ENTRYSCAPE_SPECS_PATH = 'sandbox.editera.dataportal.se';
ENTRYSCAPE_TERMS_PATH = 'sandbox.editera.dataportal.se';
ENTRYSCAPE_ORG_STATS_URL = 'https://sandbox.admin.dataportal.se/charts/orgData.json';
ENTRYSCAPE_THEME_STATS_URL = 'https://sandbox.admin.dataportal.se/charts/themeData.json';
ENTRYSCAPE_THEME_STATS_URL_EN = 'https://sandbox.admin.dataportal.se/charts/themeData_en.json';

ENTRYSCAPE_CONCEPT_STATS_URL="https://editera.dataportal.se/stats/entityData.json"
ENTRYSCAPE_HISTORY_STATS_URL="https://sandbox.admin.dataportal.se/stats/historyData.json"
ENTRYSCAPE_CONCEPT_STATS_URL = 'https://sandbox.editera.dataportal.se/stats/entityData.json';
ENTRYSCAPE_HISTORY_STATS_URL = 'https://sandbox.admin.dataportal.se/stats/historyData.json';

ENTRYSCAPE_BLOCKS_URL="https://static.cdn.entryscape.com/blocks/0.20/app.js"
ENTRYSCAPE_BLOCKS_URL = 'https://static.cdn.entryscape.com/blocks/0.20/app.js';

ENTRYSCAPE_OPENDATA_SV_URL="https://static.entryscape.com/blocks/0.20/ext/opendata-sv.js"
ENTRYSCAPE_OPENDATA_EN_URL="https://static.entryscape.com/blocks/0.20/ext/opendata-en.js"
ENTRYSCAPE_OPENDATA_SV_URL = 'https://static.entryscape.com/blocks/0.20/ext/opendata-sv.js';
ENTRYSCAPE_OPENDATA_EN_URL = 'https://static.entryscape.com/blocks/0.20/ext/opendata-en.js';

ENTRYSCAPE_SITEMAP_JSON_URL="https://sandbox.admin.dataportal.se/sitemap.json";
ENTRYSCAPE_SITEMAP_JSON_URL = 'https://sandbox.admin.dataportal.se/sitemap.json';

API_DETECTION_PATH = "https://sandbox.admin.dataportal.se/detectedapis.json";
API_DETECTION_PATH = 'https://sandbox.admin.dataportal.se/detectedapis.json';

CANONICAL_URL = "https://www-sandbox.dataportal.se";
CANONICAL_URL = 'https://www-sandbox.dataportal.se';

DCAT_BUNDLE_PATH = "/dcatse_bundle_2022-02-20.json";
DCAT_BUNDLE_PATH = '/dcatse_bundle_2022-02-20.json';

envName = 'sandbox';

nonce = generateRandomKey(256)
nonce = generateRandomKey(256);

public constructor()
{
super();
public constructor() {
super();
}
}
}
20 changes: 11 additions & 9 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
"http-proxy-agent": "^5.0.0",
"https-proxy-agent": "^5.0.1",
"lucene": "^2.1.1",
"next": "12.3.0",
"next": "12.3.2",
"next-absolute-url": "^1.2.2",
"next-translate": "^1.5.0",
"node-fetch": "^3.2.10",
Expand All @@ -38,31 +38,30 @@
"react-children-utilities": "^2.8.0",
"react-dom": "^18.2.0",
"react-markdown": "^8.0.3",
"react-show-more-text": "^1.5.2",
"react-show-more": "^2.0.0",
"react-vis": "^1.11.7",
"rehype-raw": "^6.1.1",
"remark-gfm": "^3.0.1",
"sass": "^1.54.9",
"sharp": "^0.31.0",
"swagger-ui-react": "4.14.0",
"sharp": "^0.32.6",
"swagger-ui-react": "5.10.3",
"winston": "^3.8.2"
},
"devDependencies": {
"@emotion/babel-preset-css-prop": "^11.10.0",
"@types/graphql": "^14.5.0",
"@types/node": "18.7.16",
"@types/react": "18.0.18",
"@types/react-dom": "^18.0.6",
"@types/react": "18.2.42",
"@types/react-dom": "^18.2.17",
"@types/react-truncate": "^2.3.4",
"@types/react-vis": "^1.11.11",
"apollo": "^2.34.0",
"eslint": "8.23.0",
"eslint-config-next": "12.3.0",
"typescript": "4.8.3"
},
"engines": {
"npm": ">=8.1.2",
"node": ">=16.13.2"
"node": ">=18.18.0"
},
"resolutions": {
"**/**/@braintree/sanitize-url": ">=6.0.0",
Expand All @@ -74,6 +73,9 @@
"**/**/parse-url": ">=8.1.0",
"**/**/prismjs": "^1.28.0",
"**/**/shelljs": "^0.8.5",
"**/**/minimatch": ">=3.0.5"
"**/**/minimatch": ">=3.0.5",
"**/**/@babel/traverse": ">=7.23.2",
"**/**/sharp": ">=0.32.6",
"types-ramda": "0.29.4"
}
}
2 changes: 1 addition & 1 deletion types/global.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ declare module 'react-truncate' {
export default content;
}

declare module 'react-show-more-text';
declare module 'react-show-more';

declare module 'fetch-enhanced';

Expand Down
Loading

0 comments on commit 502c053

Please sign in to comment.