Skip to content

Commit c64901c

Browse files
Merge branch 'develop'
2 parents 43ca285 + d39d333 commit c64901c

28 files changed

+2314
-260
lines changed

Diff for: .devcontainer/devcontainer.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "Nuxt",
3-
"image": "ghcr.io/acdh-oeaw/devcontainer-frontend:20",
3+
"image": "ghcr.io/acdh-oeaw/devcontainer-frontend:22",
44
"customizations": {
55
"vscode": {
66
"extensions": [

Diff for: .github/workflows/validate.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ jobs:
4343
strategy:
4444
fail-fast: true
4545
matrix:
46-
node-version: [20.x]
46+
node-version: [22.x]
4747
os: [ubuntu-latest]
4848

4949
steps:

Diff for: Dockerfile

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
# @see https://sharp.pixelplumbing.com/install#linux-memory-allocator
55

66
# build
7-
FROM node:20-alpine AS build
7+
FROM node:22-alpine AS build
88

99
RUN corepack enable
1010

@@ -39,7 +39,7 @@ ENV NODE_ENV=production
3939
RUN pnpm run build
4040

4141
# serve
42-
FROM node:20-alpine AS serve
42+
FROM node:22-alpine AS serve
4343

4444
RUN mkdir /app && chown -R node:node /app
4545
WORKDIR /app

Diff for: components/app-header.vue

+1-1
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ const defaultLinks = computed<
3838
}
3939
return {
4040
home: {
41-
href: project.map.startPage ? { path: "/", mode: "map" } : { path: "/" },
41+
href: project.map.startPage ? { path: "/", query: { mode: "map" } } : { path: "/" },
4242
label: t("AppHeader.links.home"),
4343
},
4444
team: { href: { path: "/team" }, label: t("AppHeader.links.team") },

Diff for: components/custom-primary-details-event.vue

+156
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,156 @@
1+
<script setup lang="ts">
2+
import { ChevronLeftIcon, ChevronRightIcon } from "lucide-vue-next";
3+
4+
const t = useTranslations();
5+
6+
const { getUnprefixedId } = useIdPrefix();
7+
8+
const props = defineProps<{ entity: EntityFeature }>();
9+
const route = useRoute();
10+
11+
const multipleMovements = useGetLinkedEntitiesRecursive(
12+
computed(() => {
13+
return { entityId: Number.parseInt(getUnprefixedId(props.entity["@id"])) };
14+
}),
15+
);
16+
17+
const movementDetails = computed(() => {
18+
if (multipleMovements.data.value) {
19+
return multipleMovements.data.value;
20+
} else return null;
21+
});
22+
23+
const linkedMovements = computed(() => {
24+
if (movementDetails.value === null) {
25+
return null;
26+
}
27+
28+
const features = Object.values(movementDetails.value).flatMap((entity) => {
29+
if (entity && typeof entity === "object" && Array.isArray(entity.features)) {
30+
return entity.features as Array<EntityFeature>;
31+
}
32+
return [];
33+
});
34+
35+
// Now map through the features to get the IDs
36+
return features.map((movement) => {
37+
return {
38+
id: getUnprefixedId(movement["@id"]),
39+
"@id": movement["@id"],
40+
title: movement.properties.title,
41+
systemClass: movement.systemClass,
42+
};
43+
});
44+
});
45+
46+
const currentFeatureIndex = computed(() => {
47+
if (linkedMovements.value == null) {
48+
return -1;
49+
}
50+
return linkedMovements.value.findIndex((feature) => {
51+
return feature["@id"] === props.entity["@id"];
52+
});
53+
});
54+
55+
const previousFeature = computed(() => {
56+
if (currentFeatureIndex.value <= 0 || linkedMovements.value == null) {
57+
return null;
58+
}
59+
return linkedMovements.value[currentFeatureIndex.value - 1];
60+
});
61+
62+
const nextFeature = computed(() => {
63+
if (
64+
linkedMovements.value == null ||
65+
currentFeatureIndex.value === linkedMovements.value.length - 1
66+
) {
67+
return null;
68+
}
69+
return linkedMovements.value[currentFeatureIndex.value + 1];
70+
});
71+
72+
const collapsibleRelations: Array<{
73+
relationType: RelationType;
74+
systemClass?: string;
75+
title: string;
76+
}> = [
77+
{
78+
relationType: {
79+
crmCode: "P46",
80+
},
81+
systemClass: "artifact",
82+
title: t("Relations.Artifacts"),
83+
},
84+
{
85+
relationType: {
86+
crmCode: "P46",
87+
},
88+
systemClass: "human_remains",
89+
title: t("Relations.HumanRemains"),
90+
},
91+
];
92+
93+
const emit = defineEmits({
94+
handledRelations(payload: Array<RelationType>) {
95+
return payload;
96+
},
97+
});
98+
99+
const handledRelations: Array<RelationType> = [
100+
{
101+
crmCode: "P46",
102+
},
103+
];
104+
105+
onMounted(() => {
106+
emit("handledRelations", handledRelations);
107+
});
108+
109+
function getPath() {
110+
if (route.path.includes("visualization")) {
111+
return "visualization";
112+
}
113+
return "";
114+
}
115+
116+
const currentMode = computed(() => {
117+
return route.query.mode;
118+
});
119+
</script>
120+
121+
<template>
122+
<div class="flex justify-between">
123+
<NavLink
124+
v-if="previousFeature"
125+
:href="{
126+
path: `/${getPath()}`,
127+
query: { mode: currentMode, selection: getUnprefixedId(previousFeature['@id']) },
128+
}"
129+
class="flex items-center underline decoration-dotted transition hover:no-underline focus-visible:no-underline"
130+
>
131+
<ChevronLeftIcon class="size-4" />
132+
<span>{{ previousFeature.title }}</span>
133+
<span class="sr-only">{{ t("EntitySidebar.PreviousFeature") }}</span>
134+
</NavLink>
135+
<NavLink
136+
v-if="nextFeature"
137+
:href="{
138+
path: `/${getPath()}`,
139+
query: { mode: currentMode, selection: getUnprefixedId(nextFeature['@id']) },
140+
}"
141+
class="flex items-center underline decoration-dotted transition hover:no-underline focus-visible:no-underline"
142+
>
143+
<span>{{ nextFeature.title }}</span>
144+
<span class="sr-only">{{ t("EntitySidebar.NextFeature") }}</span>
145+
<ChevronRightIcon class="size-4" />
146+
</NavLink>
147+
</div>
148+
<GroupedRelationCollapsible
149+
v-for="rel in collapsibleRelations"
150+
:key="rel.relationType.crmCode + rel.relationType.inverse"
151+
:title="rel.title"
152+
:relations="entity.relations"
153+
:system-class="rel.systemClass"
154+
:relation-type="rel.relationType"
155+
/>
156+
</template>

0 commit comments

Comments
 (0)