Skip to content

Commit

Permalink
Allow configuring additional text for interface
Browse files Browse the repository at this point in the history
  • Loading branch information
stefandesu committed Dec 12, 2024
1 parent 182cac8 commit 77054d8
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 2 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,8 @@ VITE_ALLOWED_USERS=uri1,uri2
# List of allowed provider IDs (works in addition to VITE_ALLOWED_USERS, i.e. if a user either has one of the
# specified URIs or has one of the specified providers linked, they can perform enrichments in the backend)
VITE_ALLOWED_PROVIDERS=provider1,provider2
# Additional text (HTML) shown instead of prod/dev text
VITE_ADDITIONAL_TEXT=Hello World
# Local file path where submitted enrichments will be temporarily stored
ENRICHMENTS_PATH=./enrichments
```
Expand Down
7 changes: 5 additions & 2 deletions src/client/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ const { showGoToTopButton, goToTop } = useGoToTop()
import { useSubmitEnrichments } from "@/composables/submit-enrichments.js"
const { submitEnrichments, successMessage, errorMessage, submitLoading, resetSubmit } = useSubmitEnrichments()
import { version, name, showWhenExistsKey, examples, allowedUsers, allowedProviders, isProduction } from "@/config.js"
import { version, name, showWhenExistsKey, examples, allowedUsers, allowedProviders, isProduction, additionalText } from "@/config.js"
const hasBackendAccess = computed(() => allowedUsers.includes(user.value?.uri) || allowedProviders.find(provider => user.value?.identities[provider]?.id))
Expand Down Expand Up @@ -309,7 +309,10 @@ watch(() => state.ppn, async (ppn) => {
target="_blank">Mapping-Tool Cocoda</a>
ein neues Mapping für Ihr Konzept erstellen und dieses direkt (nach neuladen dieser Seite) zur Eintragung in der coli-rich-Webanwendung übernehmen
</p>
<p v-if="isProduction">
<div
v-if="additionalText"
v-html="additionalText" />
<p v-else-if="isProduction">
<!-- TODO: Adjust production text -->
Vorgemerkte Anreicherungen werden regelmäßig in den K10plus übernommen. Da dieses Tool noch in der Entwicklung ist, kann sich dies verzögern.
</p>
Expand Down
7 changes: 7 additions & 0 deletions src/client/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,3 +43,10 @@ export const allowedProviders = (import.meta.env.VITE_ALLOWED_PROVIDERS || "").s

export const baseUrl = import.meta.env.BASE_URL || "/"
export const isProduction = import.meta.env.MODE === "production"

let _additionalText = import.meta.env.VITE_ADDITIONAL_TEXT || null
// If the additional text is not enclosed in a HTML tag, use <p></p>
if (_additionalText && !_additionalText.startsWith("<")) {
_additionalText = `<p>${_additionalText}</p>`
}
export const additionalText = _additionalText

0 comments on commit 77054d8

Please sign in to comment.