Skip to content
Snippets Groups Projects
Verified Commit 35b3ad94 authored by Martin Weise's avatar Martin Weise
Browse files

Hotfix doi display in the frontend

parent 11dc716d
No related branches found
No related tags found
1 merge request!163Relase 1.3.0
Showing
with 55 additions and 36 deletions
...@@ -18,8 +18,8 @@ WEBSITE=http://localhost ...@@ -18,8 +18,8 @@ WEBSITE=http://localhost
GATEWAY_ENDPOINT=http://gateway-service:9095 GATEWAY_ENDPOINT=http://gateway-service:9095
TOKEN_MAX=5 TOKEN_MAX=5
LOG_LEVEL=trace # error, warning, info, debug, trace LOG_LEVEL=trace # error, warning, info, debug, trace
DOI_URL=https://doi.org DOI_URL="https://doi.org"
DATACITE_URL=https://api.datacite.org DATACITE_URL="https://api.datacite.org"
DATACITE_PREFIX=10.1234 DATACITE_PREFIX="10.1234"
DATACITE_USERNAME=username DATACITE_USERNAME="username"
DATACITE_PASSWORD=password DATACITE_PASSWORD="password"
\ No newline at end of file
...@@ -16,7 +16,7 @@ COPY ./services ./services ...@@ -16,7 +16,7 @@ COPY ./services ./services
COPY ./report ./report COPY ./report ./report
# Make sure it compiles # Make sure it compiles
RUN mvn -q clean package -DskipTests > /dev/null RUN mvn -q clean package -DskipTests
###### THIRD STAGE ###### ###### THIRD STAGE ######
FROM openjdk:11-jre-slim as runtime FROM openjdk:11-jre-slim as runtime
......
...@@ -46,7 +46,7 @@ fda: ...@@ -46,7 +46,7 @@ fda:
mount.path: /tmp mount.path: /tmp
ready.path: ./ready ready.path: ./ready
jwt: jwt:
issuer: http://localhost:8443/realms/dbrepo issuer: https://localhost:8443/realms/dbrepo
public_key: MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAqqnHQ2BWWW9vDNLRCcxD++xZg/16oqMo/c1l+lcFEjjAIJjJp/HqrPYU/U9GvquGE6PbVFtTzW1KcKawOW+FJNOA3CGo8Q1TFEfz43B8rZpKsFbJKvQGVv1Z4HaKPvLUm7iMm8Hv91cLduuoWx6Q3DPe2vg13GKKEZe7UFghF+0T9u8EKzA/XqQ0OiICmsmYPbwvf9N3bCKsB/Y10EYmZRb8IhCoV9mmO5TxgWgiuNeCTtNCv2ePYqL/U0WvyGFW0reasIK8eg3KrAUj8DpyOgPOVBn3lBGf+3KFSYi+0bwZbJZWqbC/Xlk20Go1YfeJPRIt7ImxD27R/lNjgDO/MwIDAQAB public_key: MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAqqnHQ2BWWW9vDNLRCcxD++xZg/16oqMo/c1l+lcFEjjAIJjJp/HqrPYU/U9GvquGE6PbVFtTzW1KcKawOW+FJNOA3CGo8Q1TFEfz43B8rZpKsFbJKvQGVv1Z4HaKPvLUm7iMm8Hv91cLduuoWx6Q3DPe2vg13GKKEZe7UFghF+0T9u8EKzA/XqQ0OiICmsmYPbwvf9N3bCKsB/Y10EYmZRb8IhCoV9mmO5TxgWgiuNeCTtNCv2ePYqL/U0WvyGFW0reasIK8eg3KrAUj8DpyOgPOVBn3lBGf+3KFSYi+0bwZbJZWqbC/Xlk20Go1YfeJPRIt7ImxD27R/lNjgDO/MwIDAQAB
client_secret: client-secret client_secret: client-secret
client_id: dbrepo-client client_id: dbrepo-client
......
...@@ -16,7 +16,7 @@ COPY ./services ./services ...@@ -16,7 +16,7 @@ COPY ./services ./services
COPY ./report ./report COPY ./report ./report
# Make sure it compiles # Make sure it compiles
RUN mvn -q clean package -DskipTests > /dev/null RUN mvn -q clean package -DskipTests
###### THIRD STAGE ###### ###### THIRD STAGE ######
FROM openjdk:11-jre-slim as runtime FROM openjdk:11-jre-slim as runtime
......
...@@ -47,7 +47,7 @@ fda: ...@@ -47,7 +47,7 @@ fda:
password: elastic password: elastic
ready.path: ./ready ready.path: ./ready
jwt: jwt:
issuer: http://localhost:8443/realms/dbrepo issuer: https://localhost:8443/realms/dbrepo
public_key: MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAqqnHQ2BWWW9vDNLRCcxD++xZg/16oqMo/c1l+lcFEjjAIJjJp/HqrPYU/U9GvquGE6PbVFtTzW1KcKawOW+FJNOA3CGo8Q1TFEfz43B8rZpKsFbJKvQGVv1Z4HaKPvLUm7iMm8Hv91cLduuoWx6Q3DPe2vg13GKKEZe7UFghF+0T9u8EKzA/XqQ0OiICmsmYPbwvf9N3bCKsB/Y10EYmZRb8IhCoV9mmO5TxgWgiuNeCTtNCv2ePYqL/U0WvyGFW0reasIK8eg3KrAUj8DpyOgPOVBn3lBGf+3KFSYi+0bwZbJZWqbC/Xlk20Go1YfeJPRIt7ImxD27R/lNjgDO/MwIDAQAB public_key: MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAqqnHQ2BWWW9vDNLRCcxD++xZg/16oqMo/c1l+lcFEjjAIJjJp/HqrPYU/U9GvquGE6PbVFtTzW1KcKawOW+FJNOA3CGo8Q1TFEfz43B8rZpKsFbJKvQGVv1Z4HaKPvLUm7iMm8Hv91cLduuoWx6Q3DPe2vg13GKKEZe7UFghF+0T9u8EKzA/XqQ0OiICmsmYPbwvf9N3bCKsB/Y10EYmZRb8IhCoV9mmO5TxgWgiuNeCTtNCv2ePYqL/U0WvyGFW0reasIK8eg3KrAUj8DpyOgPOVBn3lBGf+3KFSYi+0bwZbJZWqbC/Xlk20Go1YfeJPRIt7ImxD27R/lNjgDO/MwIDAQAB
client_secret: client-secret client_secret: client-secret
client_id: dbrepo-client client_id: dbrepo-client
......
...@@ -16,7 +16,7 @@ COPY ./services ./services ...@@ -16,7 +16,7 @@ COPY ./services ./services
COPY ./report ./report COPY ./report ./report
# Make sure it compiles # Make sure it compiles
RUN mvn -q clean package -DskipTests > /dev/null RUN mvn -q clean package -DskipTests
###### THIRD STAGE ###### ###### THIRD STAGE ######
FROM openjdk:11-jre-slim as runtime FROM openjdk:11-jre-slim as runtime
......
...@@ -15,7 +15,7 @@ COPY ./report ./report ...@@ -15,7 +15,7 @@ COPY ./report ./report
COPY ./rest-service ./rest-service COPY ./rest-service ./rest-service
# Make sure it compiles # Make sure it compiles
RUN mvn -q clean package -DskipTests > /dev/null RUN mvn -q clean package -DskipTests
###### SECOND STAGE ###### ###### SECOND STAGE ######
FROM openjdk:11-jre-slim as runtime FROM openjdk:11-jre-slim as runtime
......
...@@ -17,7 +17,7 @@ COPY ./services ./services ...@@ -17,7 +17,7 @@ COPY ./services ./services
COPY ./report ./report COPY ./report ./report
# Make sure it compiles # Make sure it compiles
RUN mvn -q clean package -DskipTests > /dev/null RUN mvn -q clean package -DskipTests
###### THIRD STAGE ###### ###### THIRD STAGE ######
FROM openjdk:11-jre-slim as runtime FROM openjdk:11-jre-slim as runtime
......
...@@ -135,7 +135,7 @@ public class IdentifierEndpoint { ...@@ -135,7 +135,7 @@ public class IdentifierEndpoint {
@NotNull Principal principal) @NotNull Principal principal)
throws IdentifierAlreadyExistsException, QueryNotFoundException, IdentifierPublishingNotAllowedException, throws IdentifierAlreadyExistsException, QueryNotFoundException, IdentifierPublishingNotAllowedException,
RemoteUnavailableException, UserNotFoundException, DatabaseNotFoundException, IdentifierRequestException, AccessDeniedException { RemoteUnavailableException, UserNotFoundException, DatabaseNotFoundException, IdentifierRequestException, AccessDeniedException {
log.debug("endpoint create identifier, data={}, authorization={}, principal={}", data, authorization, principal); log.debug("endpoint create identifier, data={}, authorization=(hidden), principal={}", data, principal);
if (data.getType().equals(IdentifierTypeDto.SUBSET) && data.getQid() == null) { if (data.getType().equals(IdentifierTypeDto.SUBSET) && data.getQid() == null) {
log.error("Identifier of type subset need to have a qid present"); log.error("Identifier of type subset need to have a qid present");
throw new IdentifierRequestException("Identifier of type subset need to have a qid present"); throw new IdentifierRequestException("Identifier of type subset need to have a qid present");
......
...@@ -44,7 +44,7 @@ eureka: ...@@ -44,7 +44,7 @@ eureka:
fda: fda:
ready.path: ./ready ready.path: ./ready
jwt: jwt:
issuer: http://localhost:8443/realms/dbrepo issuer: https://localhost:8443/realms/dbrepo
public_key: MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAqqnHQ2BWWW9vDNLRCcxD++xZg/16oqMo/c1l+lcFEjjAIJjJp/HqrPYU/U9GvquGE6PbVFtTzW1KcKawOW+FJNOA3CGo8Q1TFEfz43B8rZpKsFbJKvQGVv1Z4HaKPvLUm7iMm8Hv91cLduuoWx6Q3DPe2vg13GKKEZe7UFghF+0T9u8EKzA/XqQ0OiICmsmYPbwvf9N3bCKsB/Y10EYmZRb8IhCoV9mmO5TxgWgiuNeCTtNCv2ePYqL/U0WvyGFW0reasIK8eg3KrAUj8DpyOgPOVBn3lBGf+3KFSYi+0bwZbJZWqbC/Xlk20Go1YfeJPRIt7ImxD27R/lNjgDO/MwIDAQAB public_key: MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAqqnHQ2BWWW9vDNLRCcxD++xZg/16oqMo/c1l+lcFEjjAIJjJp/HqrPYU/U9GvquGE6PbVFtTzW1KcKawOW+FJNOA3CGo8Q1TFEfz43B8rZpKsFbJKvQGVv1Z4HaKPvLUm7iMm8Hv91cLduuoWx6Q3DPe2vg13GKKEZe7UFghF+0T9u8EKzA/XqQ0OiICmsmYPbwvf9N3bCKsB/Y10EYmZRb8IhCoV9mmO5TxgWgiuNeCTtNCv2ePYqL/U0WvyGFW0reasIK8eg3KrAUj8DpyOgPOVBn3lBGf+3KFSYi+0bwZbJZWqbC/Xlk20Go1YfeJPRIt7ImxD27R/lNjgDO/MwIDAQAB
client_secret: client-secret client_secret: client-secret
client_id: dbrepo-client client_id: dbrepo-client
......
...@@ -14,7 +14,7 @@ COPY ./querystore ./querystore ...@@ -14,7 +14,7 @@ COPY ./querystore ./querystore
COPY ./test ./test COPY ./test ./test
# Make sure it compiles # Make sure it compiles
RUN mvn -q clean package -DskipTests > /dev/null RUN mvn -q clean package -DskipTests
# Install to local repository # Install to local repository
RUN mvn -q clean install > /dev/null RUN mvn -q clean install > /dev/null
......
...@@ -16,7 +16,7 @@ COPY ./services ./services ...@@ -16,7 +16,7 @@ COPY ./services ./services
COPY ./report ./report COPY ./report ./report
# Make sure it compiles # Make sure it compiles
RUN mvn -q clean package -DskipTests > /dev/null RUN mvn -q clean package -DskipTests
###### THIRD STAGE ###### ###### THIRD STAGE ######
FROM openjdk:11-jre-slim as runtime FROM openjdk:11-jre-slim as runtime
......
...@@ -17,7 +17,7 @@ COPY ./report ./report ...@@ -17,7 +17,7 @@ COPY ./report ./report
COPY ./api ./api COPY ./api ./api
# Make sure it compiles # Make sure it compiles
RUN mvn -q clean package -DskipTests > /dev/null RUN mvn -q clean package -DskipTests
###### THIRD STAGE ###### ###### THIRD STAGE ######
FROM openjdk:11-jre-slim as runtime FROM openjdk:11-jre-slim as runtime
......
...@@ -48,7 +48,7 @@ fda: ...@@ -48,7 +48,7 @@ fda:
gateway.endpoint: http://localhost:9095 gateway.endpoint: http://localhost:9095
ready.path: ./ready ready.path: ./ready
jwt: jwt:
issuer: http://localhost:8443/realms/dbrepo issuer: https://localhost:8443/realms/dbrepo
public_key: MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAqqnHQ2BWWW9vDNLRCcxD++xZg/16oqMo/c1l+lcFEjjAIJjJp/HqrPYU/U9GvquGE6PbVFtTzW1KcKawOW+FJNOA3CGo8Q1TFEfz43B8rZpKsFbJKvQGVv1Z4HaKPvLUm7iMm8Hv91cLduuoWx6Q3DPe2vg13GKKEZe7UFghF+0T9u8EKzA/XqQ0OiICmsmYPbwvf9N3bCKsB/Y10EYmZRb8IhCoV9mmO5TxgWgiuNeCTtNCv2ePYqL/U0WvyGFW0reasIK8eg3KrAUj8DpyOgPOVBn3lBGf+3KFSYi+0bwZbJZWqbC/Xlk20Go1YfeJPRIt7ImxD27R/lNjgDO/MwIDAQAB public_key: MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAqqnHQ2BWWW9vDNLRCcxD++xZg/16oqMo/c1l+lcFEjjAIJjJp/HqrPYU/U9GvquGE6PbVFtTzW1KcKawOW+FJNOA3CGo8Q1TFEfz43B8rZpKsFbJKvQGVv1Z4HaKPvLUm7iMm8Hv91cLduuoWx6Q3DPe2vg13GKKEZe7UFghF+0T9u8EKzA/XqQ0OiICmsmYPbwvf9N3bCKsB/Y10EYmZRb8IhCoV9mmO5TxgWgiuNeCTtNCv2ePYqL/U0WvyGFW0reasIK8eg3KrAUj8DpyOgPOVBn3lBGf+3KFSYi+0bwZbJZWqbC/Xlk20Go1YfeJPRIt7ImxD27R/lNjgDO/MwIDAQAB
client_secret: client-secret client_secret: client-secret
client_id: dbrepo-client client_id: dbrepo-client
......
...@@ -16,7 +16,7 @@ COPY ./services ./services ...@@ -16,7 +16,7 @@ COPY ./services ./services
COPY ./report ./report COPY ./report ./report
# Make sure it compiles # Make sure it compiles
RUN mvn -q clean package -DskipTests > /dev/null RUN mvn -q clean package -DskipTests
###### THIRD STAGE ###### ###### THIRD STAGE ######
FROM openjdk:11-jre-slim as runtime FROM openjdk:11-jre-slim as runtime
......
...@@ -43,7 +43,7 @@ eureka: ...@@ -43,7 +43,7 @@ eureka:
fda: fda:
ready.path: ./ready ready.path: ./ready
jwt: jwt:
issuer: http://localhost:8443/realms/dbrepo issuer: https://localhost:8443/realms/dbrepo
public_key: MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAqqnHQ2BWWW9vDNLRCcxD++xZg/16oqMo/c1l+lcFEjjAIJjJp/HqrPYU/U9GvquGE6PbVFtTzW1KcKawOW+FJNOA3CGo8Q1TFEfz43B8rZpKsFbJKvQGVv1Z4HaKPvLUm7iMm8Hv91cLduuoWx6Q3DPe2vg13GKKEZe7UFghF+0T9u8EKzA/XqQ0OiICmsmYPbwvf9N3bCKsB/Y10EYmZRb8IhCoV9mmO5TxgWgiuNeCTtNCv2ePYqL/U0WvyGFW0reasIK8eg3KrAUj8DpyOgPOVBn3lBGf+3KFSYi+0bwZbJZWqbC/Xlk20Go1YfeJPRIt7ImxD27R/lNjgDO/MwIDAQAB public_key: MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAqqnHQ2BWWW9vDNLRCcxD++xZg/16oqMo/c1l+lcFEjjAIJjJp/HqrPYU/U9GvquGE6PbVFtTzW1KcKawOW+FJNOA3CGo8Q1TFEfz43B8rZpKsFbJKvQGVv1Z4HaKPvLUm7iMm8Hv91cLduuoWx6Q3DPe2vg13GKKEZe7UFghF+0T9u8EKzA/XqQ0OiICmsmYPbwvf9N3bCKsB/Y10EYmZRb8IhCoV9mmO5TxgWgiuNeCTtNCv2ePYqL/U0WvyGFW0reasIK8eg3KrAUj8DpyOgPOVBn3lBGf+3KFSYi+0bwZbJZWqbC/Xlk20Go1YfeJPRIt7ImxD27R/lNjgDO/MwIDAQAB
client_secret: client-secret client_secret: client-secret
client_id: dbrepo-client client_id: dbrepo-client
......
<template> <template>
<p v-if="identifier?.doi">DOI: <a :href="doiUrl(identifier.doi)">{{ identifier.doi }}</a></p> <div>
<p v-else-if="identifier?.id"><a :href="pidUrl(identifier.id)">{{ pidUrl(identifier.id) }}</a></p> {{ prefix }}: <a :href="pidUrl">{{ displayName }}</a>
</div>
</template> </template>
yarn dev
<script> <script>
export default { export default {
props: { props: {
identifier: { identifier: {
...@@ -17,17 +16,34 @@ export default { ...@@ -17,17 +16,34 @@ export default {
computed: { computed: {
baseUrl () { baseUrl () {
return `${location.protocol}//${location.host}` return `${location.protocol}//${location.host}`
},
baseDoi () {
return this.$config.doiUrl
},
isDoi () {
if (!this.identifier) {
return null
}
return this.identifier.doi !== null
},
prefix () {
if (!this.identifier) {
return null
} }
return this.isDoi ? 'DOI' : 'URI'
}, },
methods: { pidUrl () {
pidUrl (pid) { if (!this.identifier) {
return `${this.baseUrl}/pid/${pid}` return null
}
return this.isDoi ? `${this.baseDoi}/${this.identifier.doi}` : `${this.baseUrl}/pid/${this.identifier.id}`
}, },
doiUrl (doi) { displayName () {
return `${this.$config.doiUrl}/${doi}` if (!this.identifier) {
return null
}
return this.isDoi ? `${this.identifier.doi}` : `/pid/${this.identifier.id}`
} }
} }
} }
</script> </script>
<style scoped></style>
import path from 'path' import path from 'path'
import colors from 'vuetify/es5/util/colors' import colors from 'vuetify/es5/util/colors'
import { api, icon, search, clientSecret, title, sandbox, logo, version, defaultPublisher } from './config' import { api, icon, search, clientSecret, title, sandbox, logo, version, defaultPublisher, doiUrl } from './config'
const proxy = {} const proxy = {}
...@@ -92,7 +92,8 @@ export default { ...@@ -92,7 +92,8 @@ export default {
version, version,
logo, logo,
clientSecret, clientSecret,
defaultPublisher defaultPublisher,
doiUrl
}, },
serverMiddleware: [ serverMiddleware: [
......
...@@ -16,7 +16,7 @@ COPY ./services ./services ...@@ -16,7 +16,7 @@ COPY ./services ./services
COPY ./report ./report COPY ./report ./report
# Make sure it compiles # Make sure it compiles
RUN mvn -q clean package -DskipTests > /dev/null RUN mvn -q clean package -DskipTests
###### THIRD STAGE ###### ###### THIRD STAGE ######
FROM openjdk:11-jre-slim as runtime FROM openjdk:11-jre-slim as runtime
......
...@@ -213,6 +213,8 @@ services: ...@@ -213,6 +213,8 @@ services:
- "9096:9096" - "9096:9096"
env_file: env_file:
- .env - .env
environment:
- SPRING_PROFILES_ACTIVE=doi
depends_on: depends_on:
dbrepo-query-service: dbrepo-query-service:
condition: service_healthy condition: service_healthy
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment