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
Branches
Tags
1 merge request!163Relase 1.3.0
Showing
with 55 additions and 36 deletions
......@@ -18,8 +18,8 @@ WEBSITE=http://localhost
GATEWAY_ENDPOINT=http://gateway-service:9095
TOKEN_MAX=5
LOG_LEVEL=trace # error, warning, info, debug, trace
DOI_URL=https://doi.org
DATACITE_URL=https://api.datacite.org
DATACITE_PREFIX=10.1234
DATACITE_USERNAME=username
DATACITE_PASSWORD=password
\ No newline at end of file
DOI_URL="https://doi.org"
DATACITE_URL="https://api.datacite.org"
DATACITE_PREFIX="10.1234"
DATACITE_USERNAME="username"
DATACITE_PASSWORD="password"
......@@ -16,7 +16,7 @@ COPY ./services ./services
COPY ./report ./report
# Make sure it compiles
RUN mvn -q clean package -DskipTests > /dev/null
RUN mvn -q clean package -DskipTests
###### THIRD STAGE ######
FROM openjdk:11-jre-slim as runtime
......
......@@ -46,7 +46,7 @@ fda:
mount.path: /tmp
ready.path: ./ready
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
client_secret: client-secret
client_id: dbrepo-client
......
......@@ -16,7 +16,7 @@ COPY ./services ./services
COPY ./report ./report
# Make sure it compiles
RUN mvn -q clean package -DskipTests > /dev/null
RUN mvn -q clean package -DskipTests
###### THIRD STAGE ######
FROM openjdk:11-jre-slim as runtime
......
......@@ -47,7 +47,7 @@ fda:
password: elastic
ready.path: ./ready
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
client_secret: client-secret
client_id: dbrepo-client
......
......@@ -16,7 +16,7 @@ COPY ./services ./services
COPY ./report ./report
# Make sure it compiles
RUN mvn -q clean package -DskipTests > /dev/null
RUN mvn -q clean package -DskipTests
###### THIRD STAGE ######
FROM openjdk:11-jre-slim as runtime
......
......@@ -15,7 +15,7 @@ COPY ./report ./report
COPY ./rest-service ./rest-service
# Make sure it compiles
RUN mvn -q clean package -DskipTests > /dev/null
RUN mvn -q clean package -DskipTests
###### SECOND STAGE ######
FROM openjdk:11-jre-slim as runtime
......
......@@ -17,7 +17,7 @@ COPY ./services ./services
COPY ./report ./report
# Make sure it compiles
RUN mvn -q clean package -DskipTests > /dev/null
RUN mvn -q clean package -DskipTests
###### THIRD STAGE ######
FROM openjdk:11-jre-slim as runtime
......
......@@ -135,7 +135,7 @@ public class IdentifierEndpoint {
@NotNull Principal principal)
throws IdentifierAlreadyExistsException, QueryNotFoundException, IdentifierPublishingNotAllowedException,
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) {
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");
......
......@@ -44,7 +44,7 @@ eureka:
fda:
ready.path: ./ready
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
client_secret: client-secret
client_id: dbrepo-client
......
......@@ -14,7 +14,7 @@ COPY ./querystore ./querystore
COPY ./test ./test
# Make sure it compiles
RUN mvn -q clean package -DskipTests > /dev/null
RUN mvn -q clean package -DskipTests
# Install to local repository
RUN mvn -q clean install > /dev/null
......
......@@ -16,7 +16,7 @@ COPY ./services ./services
COPY ./report ./report
# Make sure it compiles
RUN mvn -q clean package -DskipTests > /dev/null
RUN mvn -q clean package -DskipTests
###### THIRD STAGE ######
FROM openjdk:11-jre-slim as runtime
......
......@@ -17,7 +17,7 @@ COPY ./report ./report
COPY ./api ./api
# Make sure it compiles
RUN mvn -q clean package -DskipTests > /dev/null
RUN mvn -q clean package -DskipTests
###### THIRD STAGE ######
FROM openjdk:11-jre-slim as runtime
......
......@@ -48,7 +48,7 @@ fda:
gateway.endpoint: http://localhost:9095
ready.path: ./ready
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
client_secret: client-secret
client_id: dbrepo-client
......
......@@ -16,7 +16,7 @@ COPY ./services ./services
COPY ./report ./report
# Make sure it compiles
RUN mvn -q clean package -DskipTests > /dev/null
RUN mvn -q clean package -DskipTests
###### THIRD STAGE ######
FROM openjdk:11-jre-slim as runtime
......
......@@ -43,7 +43,7 @@ eureka:
fda:
ready.path: ./ready
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
client_secret: client-secret
client_id: dbrepo-client
......
<template>
<p v-if="identifier?.doi">DOI: <a :href="doiUrl(identifier.doi)">{{ identifier.doi }}</a></p>
<p v-else-if="identifier?.id"><a :href="pidUrl(identifier.id)">{{ pidUrl(identifier.id) }}</a></p>
<div>
{{ prefix }}: <a :href="pidUrl">{{ displayName }}</a>
</div>
</template>
yarn dev
<script>
export default {
props: {
identifier: {
......@@ -17,17 +16,34 @@ export default {
computed: {
baseUrl () {
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 (pid) {
return `${this.baseUrl}/pid/${pid}`
pidUrl () {
if (!this.identifier) {
return null
}
return this.isDoi ? `${this.baseDoi}/${this.identifier.doi}` : `${this.baseUrl}/pid/${this.identifier.id}`
},
doiUrl (doi) {
return `${this.$config.doiUrl}/${doi}`
displayName () {
if (!this.identifier) {
return null
}
return this.isDoi ? `${this.identifier.doi}` : `/pid/${this.identifier.id}`
}
}
}
</script>
<style scoped></style>
import path from 'path'
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 = {}
......@@ -92,7 +92,8 @@ export default {
version,
logo,
clientSecret,
defaultPublisher
defaultPublisher,
doiUrl
},
serverMiddleware: [
......
......@@ -16,7 +16,7 @@ COPY ./services ./services
COPY ./report ./report
# Make sure it compiles
RUN mvn -q clean package -DskipTests > /dev/null
RUN mvn -q clean package -DskipTests
###### THIRD STAGE ######
FROM openjdk:11-jre-slim as runtime
......
......@@ -213,6 +213,8 @@ services:
- "9096:9096"
env_file:
- .env
environment:
- SPRING_PROFILES_ACTIVE=doi
depends_on:
dbrepo-query-service:
condition: service_healthy
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment