Skip to content

Commit

Permalink
Last june issues before i take my leave (#139)
Browse files Browse the repository at this point in the history
resolves #136
resolves #137
resolves #138

---------

Co-authored-by: Robin Kaggl <[email protected]>
  • Loading branch information
kaggl and Robin Kaggl authored Jun 24, 2024
1 parent b4e33d7 commit e557f10
Show file tree
Hide file tree
Showing 11 changed files with 100 additions and 81 deletions.
1 change: 1 addition & 0 deletions .npmrc
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@ engine-strict=true
shamefully-hoist=true
shell-emulator=true
use-node-version=20.10.0
package-manager-strict=false
27 changes: 0 additions & 27 deletions components/tooltip.vue

This file was deleted.

2 changes: 1 addition & 1 deletion lib/helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,6 @@ export function detectURLsAddLinks(content: string) {
/(https?:\/\/(?:www\.|(?!www))[a-zA-Z0-9][a-zA-Z0-9-]+[a-zA-Z0-9]\.[^\s]{2,}|www\.[a-zA-Z0-9][a-zA-Z0-9-]+[a-zA-Z0-9]\.[^\s]{2,}|https?:\/\/(?:www\.|(?!www))[a-zA-Z0-9]+\.[^\s]{2,}|www\.[a-zA-Z0-9]+\.[^\s]{2,})/;
return content.replace(
urlRegex,
'<a style="text-decoration: underline; font-weight: 600" href="$1" target="_blank">$1</a>',
'<a style="text-decoration: underline; font-weight: 600;" href="$1" target="_blank">$1&#8599;</a>',
);
}
5 changes: 4 additions & 1 deletion locales/de.json
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,10 @@
"allowance": "Zahlungen",
"same_as": "Onlineressourcen",
"confession": "Konfession",
"no-notes": "Keine Notizen vorhanden."
"no-notes": "Keine Notizen vorhanden.",
"notes": "Redaktioneller Hinweis",
"hierarchy": "Hierarchievisualisierung",
"citations": "Zitationsvorschlag"
},
"viecpro_courts": {
"model": "Modell",
Expand Down
5 changes: 4 additions & 1 deletion locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,10 @@
"allowance": "Allowance",
"same_as": "Online resources",
"confession": "Confession",
"no-notes": "No notes provided."
"no-notes": "No notes provided.",
"notes": "Editor's note",
"hierarchy": "Hierarchy visualisation",
"citations": "Proposal for citation "
},
"viecpro_courts": {
"model": "Model",
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"node": "20.x",
"pnpm": "8.x"
},
"packageManager": "pnpm@8.10.5",
"packageManager": "pnpm@8.15.8",
"scripts": {
"build": "nuxt build",
"dev": "nuxt dev",
Expand Down
16 changes: 12 additions & 4 deletions pages/detail/courts/[id].vue
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ definePageMeta({
});
const title = computed(() => {
if (data.value.entity.data?.name)
if (data.value.entity.data.name)
return `${data.value.entity.data.name} - ${t("pages.searchviews.courts.sing")}`;
return t("pages.searchviews.courts.sing");
});
Expand Down Expand Up @@ -74,15 +74,23 @@ useHead({
{{ data.entity.data?.name }}
</h1>
<div class="flex items-center gap-2">
<Indicator class="w-24" :status="data.details.data?.ampel" />
<Indicator
class="w-24"
:status="data.details.data?.ampel"
:title="t('collection-keys.viecpro_persons.ampel')"
/>
<HierarchyLinkButton
:id="String(data.entity.data?.object_id)"
model="Institution"
:label="data.entity.data?.name"
:title="t('collection-keys.viecpro_persons.hierarchy')"
/>
<InfoMenu>
<template #button>
<button class="rounded-full hover:bg-slate-200 active:bg-slate-300">
<button
class="rounded-full hover:bg-slate-200 active:bg-slate-300"
:title="t('collection-keys.viecpro_persons.citations')"
>
<span class="sr-only">Show Infos</span>
<Info class="m-2 h-6 w-6 shrink-0" />
</button>
Expand All @@ -100,7 +108,7 @@ useHead({
</div>
</template>
</InfoMenu>
<DownloadMenu detail :data="data" :collection="collection" />
<DownloadMenu detail :data="data" :collection="collection" title="Download" />
</div>
</div>
<span v-else class="animate-pulse">{{ t("ui.loading") }}</span>
Expand Down
22 changes: 16 additions & 6 deletions pages/detail/institutions/[id].vue
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,11 @@ const data = ref({
const fetchCourts = computed(() => {
if (
data.value.details.error?.httpStatus &&
data.value.details.error &&
data.value.entity.error &&
data.value.details.error.httpStatus &&
data.value.details.error.httpStatus === 404 &&
data.value.entity.error?.httpStatus &&
data.value.entity.error.httpStatus &&
data.value.entity.error.httpStatus === 404
)
return true;
Expand Down Expand Up @@ -79,7 +81,7 @@ definePageMeta({
});
const title = computed(() => {
if (data.value.entity.data?.name) return `${data.value.entity.data.name} - Institution`;
if (data.value.entity.data.name) return `${data.value.entity.data.name} - Institution`;
return "Institution";
});
Expand Down Expand Up @@ -113,15 +115,23 @@ useHead({
{{ data.entity.data?.name }}
</h1>
<div class="flex items-center gap-2">
<Indicator class="w-24" :status="data.entity.data?.ampel" />
<Indicator
class="w-24"
:status="data.entity.data?.ampel"
:title="t('collection-keys.viecpro_persons.ampel')"
/>
<HierarchyLinkButton
:id="String(data.entity.data?.object_id)"
model="Institution"
:label="data.entity.data?.name"
:title="t('collection-keys.viecpro_persons.hierarchy')"
/>
<InfoMenu>
<template #button>
<button class="rounded-full hover:bg-slate-200 active:bg-slate-300">
<button
class="rounded-full hover:bg-slate-200 active:bg-slate-300"
:title="t('collection-keys.viecpro_persons.citations')"
>
<span class="sr-only">Show Infos</span>
<Info class="m-2 h-6 w-6 shrink-0" />
</button>
Expand All @@ -138,7 +148,7 @@ useHead({
</template>
</InfoMenu>

<DownloadMenu detail :data="data" :collection="collection" />
<DownloadMenu detail :data="data" :collection="collection" title="Download" />
</div>
</div>
<span v-else class="animate-pulse">{{ t("ui.loading") }}</span>
Expand Down
78 changes: 46 additions & 32 deletions pages/detail/persons/[id].vue
Original file line number Diff line number Diff line change
Expand Up @@ -99,15 +99,42 @@ useHead({
{{ data.entity.data?.fullname }}
</h1>
<div class="flex items-center gap-2">
<Indicator class="w-24" :status="data.entity.data?.ampel" />
<Indicator
class="w-24"
:status="data.entity.data?.ampel"
:title="t('collection-keys.viecpro_persons.ampel')"
/>
<InfoMenu class="text-base font-normal">
<template #button>
<button
:title="t('collection-keys.viecpro_persons.notes')"
class="rounded-full transition hover:bg-slate-200 active:bg-slate-300"
>
<span class="sr-only">{{ t("collection-keys.viecpro_courts.sources") }}</span>
<StickyNote class="m-2 h-6 w-6 shrink-0" />
</button>
</template>
<template #content>
<div v-if="data.details.data.notes">
{{ data.details.data.notes }}
</div>
<div v-else class="italic">
{{ t("collection-keys.viecpro_persons.no-notes") }}
</div>
</template>
</InfoMenu>
<HierarchyLinkButton
:id="String(data.entity.data?.object_id)"
model="Person"
:label="data.entity.data?.fullname"
:title="t('collection-keys.viecpro_persons.hierarchy')"
/>
<InfoMenu>
<template #button>
<button class="rounded-full transition hover:bg-slate-200 active:bg-slate-300">
<button
class="rounded-full transition hover:bg-slate-200 active:bg-slate-300"
:title="t('collection-keys.viecpro_persons.citations')"
>
<span class="sr-only">Show Infos</span>
<Info class="m-2 h-6 w-6 shrink-0" />
</button>
Expand All @@ -124,23 +151,7 @@ useHead({
</template>
</InfoMenu>

<InfoMenu class="text-base font-normal">
<template #button>
<button class="rounded-full transition hover:bg-slate-200 active:bg-slate-300">
<span class="sr-only">{{ t("collection-keys.viecpro_courts.sources") }}</span>
<StickyNote class="m-2 h-6 w-6 shrink-0" />
</button>
</template>
<template #content>
<div v-if="data.details.data.notes">
{{ data.details.data.notes }}
</div>
<div v-else class="italic">
{{ t("collection-keys.viecpro_persons.no-notes") }}
</div>
</template>
</InfoMenu>
<DownloadMenu detail :data="data" :collection="collection" />
<DownloadMenu detail :data="data" :collection="collection" title="Download" />
</div>
</div>
<span v-else class="animate-pulse">{{ t("ui.loading") }}</span>
Expand Down Expand Up @@ -283,11 +294,21 @@ useHead({
>
<div v-if="data.refs.data" class="flex flex-col divide-y-2">
<div
v-for="tag in [...new Set(data.refs.data.hits?.map((hit) => hit.document.tag))]"
:key="tag"
v-for="tag in [...new Set(data.refs.data.hits?.map((hit) => hit.document.tag))].sort(
(a, b) => {
const standard = [
'Primärquellen',
'Sekundärliteratur',
'Datenbanken',
'Projekte',
];
return standard.indexOf(a) - standard.indexOf(b);
},
)"
:key="String(tag)"
class="p-2"
>
<h2 class="mb-2 text-xl font-semibold">
<h2 class="mb-2 font-semibold">
{{ tag }}
</h2>
<template
Expand All @@ -297,16 +318,9 @@ useHead({
:key="reference.id"
>
<div v-if="i !== 0" class="my-1 border" />
<div>
<span
:class="reference.folio && `after:content-[',_']`"
v-html="detectURLsAddLinks(reference.title || reference.shortTitle)"
/>
<span
v-if="reference.folio"
class="text-sm text-gray-600"
v-html="detectURLsAddLinks(reference.folio)"
/>
<div class="flex flex-col gap-0.5">
<span v-html="detectURLsAddLinks(reference.title || reference.shortTitle)" />
<span v-if="reference.folio" v-html="detectURLsAddLinks(reference.folio)" />
</div>
</template>
</div>
Expand Down
15 changes: 11 additions & 4 deletions pages/detail/places/[id].vue
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ definePageMeta({
});
const title = computed(() => {
if (data.value.entity.data?.name)
if (data.value.entity.data.name)
return `${data.value.entity.data.name} - ${t("pages.searchviews.places.sing")}`;
return t("pages.searchviews.places.sing");
});
Expand Down Expand Up @@ -98,10 +98,17 @@ useHead({
{{ data.entity.data?.name }}
</h1>
<div class="flex items-center gap-2">
<Indicator class="w-24" :status="data.entity.data?.ampel" />
<Indicator
class="w-24"
:status="data.entity.data?.ampel"
:title="t('collection-keys.viecpro_persons.ampel')"
/>
<InfoMenu>
<template #button>
<button class="rounded-full hover:bg-slate-200 active:bg-slate-300">
<button
class="rounded-full hover:bg-slate-200 active:bg-slate-300"
:title="t('collection-keys.viecpro_persons.citations')"
>
<span class="sr-only">Show Infos</span>
<Info class="m-2 h-6 w-6 shrink-0" />
</button>
Expand All @@ -120,7 +127,7 @@ useHead({
</template>
</InfoMenu>

<DownloadMenu detail :data="data" :collection="collection" />
<DownloadMenu detail :data="data" :collection="collection" title="Download" />
</div>
</div>
<span v-else class="animate-pulse">{{ t("ui.loading") }}</span>
Expand Down
8 changes: 4 additions & 4 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit e557f10

Please sign in to comment.