Skip to content

Commit

Permalink
Merge pull request #135 from ezpaarse-project/development
Browse files Browse the repository at this point in the history
Development
  • Loading branch information
felixleo22 authored Nov 8, 2023
2 parents 2080ac3 + 57241d9 commit 7168c9a
Show file tree
Hide file tree
Showing 18 changed files with 28 additions and 17 deletions.
2 changes: 1 addition & 1 deletion docker-compose.debug.yml
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ services:
- 24678:24678
environment:
- NODE_ENV=development
- NUXT_PUBLIC_NODE_ENV=development
- NUXT_PUBLIC_ENVIRONMENT=development
- NUXT_PUBLIC_ELASTIC_ENV=development
- NUXT_PUBLIC_VERSION=development
- NUXT_PUBLIC_UNPAYWALL_HOMEPAGE_HOST
Expand Down
2 changes: 1 addition & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ services:
container_name: ezunpaywall-frontend-prod
environment:
- NODE_ENV=development
- NUXT_PUBLIC_NODE_ENV=development
- NUXT_PUBLIC_ENVIRONMENT=development
- NUXT_PUBLIC_ELASTIC_ENV=development
- NUXT_PUBLIC_VERSION=development
- NUXT_PUBLIC_UNPAYWALL_HOMEPAGE_HOST
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "ezunpaywall",
"version": "1.3.2",
"version": "1.3.3",
"description": "",
"author": "felixleo22",
"license": "CeCILL",
Expand Down
2 changes: 1 addition & 1 deletion src/apikey/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "ezunpaywall-apikey",
"version": "1.3.2",
"version": "1.3.3",
"description": "",
"main": "app.js",
"author": "felixleo22",
Expand Down
2 changes: 2 additions & 0 deletions src/enrich/lib/services/graphql.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,9 @@ async function requestGraphql(data, args, index, apikey) {
let dois = [];
let res = [];
// contain index of doi

const map1 = await data.map((elem) => elem?.doi);

// contain array of doi to request ezunpaywall
dois = await map1.filter((elem) => elem !== undefined);
dois = dois.join('","');
Expand Down
2 changes: 1 addition & 1 deletion src/enrich/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "ezunpaywall-enrich",
"version": "1.3.2",
"version": "1.3.3",
"description": "",
"main": "app.js",
"author": "felixleo22",
Expand Down
2 changes: 1 addition & 1 deletion src/fakeUnpaywall/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "fakeunpaywall",
"version": "1.3.2",
"version": "1.3.3",
"description": "",
"main": "app.js",
"author": "felixleo22",
Expand Down
2 changes: 1 addition & 1 deletion src/frontend/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ FROM node:18.17-alpine3.18 as build

LABEL maintainer="ezTeam <[email protected]>"

ARG NUXT_PUBLIC_NODE_ENV
ARG NUXT_PUBLIC_ENVIRONMENT
ARG NUXT_PUBLIC_UNPAYWALL_HOST
ARG NUXT_PUBLIC_UNPAYWALL_API_HOST
ARG NUXT_PUBLIC_DASHBOARD_HOST
Expand Down
2 changes: 1 addition & 1 deletion src/frontend/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ frontend service of ezunpaywall

| name | default | description |
| --- | --- | --- |
| NUXT_PUBLIC_NODE_ENV | development | environment of node |
| NUXT_PUBLIC_ENVIRONMENT | development | environment of node |
| NUXT_PUBLIC_UNPAYWALL_HOST | https://unpaywall.org | Host of unpaywall |
| NUXT_PUBLIC_UNPAYWALL_API_HOST | http://api.unpaywall.org | Host of API of unpaywall |
| NUXT_PUBLIC_DASHBOARD_HOST | https://ezmesure.couperin.org/kibana/s/ezunpaywall/app/dashboards | Host of ezmesure dashboard |
Expand Down
2 changes: 1 addition & 1 deletion src/frontend/components/graphql/request/RequestTab.vue
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ function copyText() {
snackStore.error(t('error.graphql.copyRequest'));
return;
}
snackStore.info(t('info.graphql.copyResult'));
snackStore.info(t('info.graphql.copyRequest'));
}
function setGraphqlData(data) {
Expand Down
2 changes: 1 addition & 1 deletion src/frontend/nuxt.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
export default defineNuxtConfig({
runtimeConfig: {
public: {
environment: process.env.NUXT_PUBLIC_NODE_ENV || 'development',
environment: process.env.NUXT_PUBLIC_ENVIRONMENT || 'development',
unpaywallHost: process.env.NUXT_PUBLIC_UNPAYWALL_HOST || 'https://unpaywall.org',
unpaywallAPIHost: process.env.NUXT_PUBLIC_UNPAYWALL_API_HOST || 'http://api.unpaywall.org',
dashbordHost: process.env.NUXT_PUBLIC_DASHBOARD_HOST || 'https://ezmesure.couperin.org/kibana/s/ezunpaywall/app/dashboards',
Expand Down
2 changes: 1 addition & 1 deletion src/frontend/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "client",
"version": "1.3.2",
"version": "1.3.3",
"private": true,
"scripts": {
"build": "nuxt build",
Expand Down
1 change: 1 addition & 0 deletions src/graphql/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ fs.ensureDir(path.resolve(logDir, 'access'));
const server = new ApolloServer({
typeDefs,
resolvers,
introspection: true,
csrfPrevention: false,
});

Expand Down
12 changes: 10 additions & 2 deletions src/graphql/lib/middlewares/args.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
const logger = require('../logger');

function getNumberOfDOI(req) {
const patternBetweenBracket = /.*?(\[.*?\]).*?$/i;
const patternBetweenBracketQuery = /.*?(\[".*?"\]\)).*?$/i;
// BODY
// {
// query: 'query ($dois: [ID!]!) {GetByDOI(dois: $dois) {doi, is_oa}}',
Expand All @@ -11,9 +14,14 @@ function getNumberOfDOI(req) {
// BODY
// query: '{GetByDOI(dois:["10.1186/s40510-015-0109-6","Coin Coin"]){doi, is_oa}}'
if (req?.body?.query) {
const match = patternBetweenBracket.exec(req?.body?.query);
const match = patternBetweenBracketQuery.exec(req?.body?.query);
if (match?.length >= 1) {
const listOfDOI = JSON.parse(match[1]);
let listOfDOI;
try {
listOfDOI = match[1].split(',').length;
} catch (err) {
logger.error(`[Apollo] Cannot parse ${match[1]}`);
}
return listOfDOI.length;
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/graphql/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "ezunpaywall-graphql-api",
"version": "1.3.2",
"version": "1.3.3",
"description": "",
"main": "app.js",
"author": "felixleo22",
Expand Down
2 changes: 1 addition & 1 deletion src/health/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "ezunpaywall-health",
"version": "1.3.2",
"version": "1.3.3",
"description": "",
"main": "app.js",
"author": "felixleo22",
Expand Down
2 changes: 1 addition & 1 deletion src/mail/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "mail",
"version": "1.3.2",
"version": "1.3.3",
"description": "",
"main": "app.js",
"scripts": {
Expand Down
2 changes: 1 addition & 1 deletion src/update/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "ezunpaywall-update",
"version": "1.3.2",
"version": "1.3.3",
"description": "",
"main": "app.js",
"author": "felixleo22",
Expand Down

0 comments on commit 7168c9a

Please sign in to comment.