diff --git a/.yarn/install-state.gz b/.yarn/install-state.gz index 0b1c495..c0bbb10 100644 Binary files a/.yarn/install-state.gz and b/.yarn/install-state.gz differ diff --git a/api/collections/comments.yml b/api/collections/comment.yml similarity index 90% rename from api/collections/comments.yml rename to api/collections/comment.yml index 84e3c55..05fad29 100644 --- a/api/collections/comments.yml +++ b/api/collections/comment.yml @@ -1,9 +1,9 @@ -name: comments +name: comment meta: label: { de: "Kommentare", en: "Comments" } muiIcon: chat group: community - imageUrl: "https://images.unsplash.com/photo-1516321318423-f06f85e504b3?auto=format&fit=crop&q=80&w=800" + imageUrl: "https://images.unsplash.com/photo-1522096823084-2d1aa8411c13?auto=format&fit=crop&q=80&w=800" preview: label: author secondary: message diff --git a/api/collections/content.yml b/api/collections/content.yml index b73c7c8..9f07f46 100644 --- a/api/collections/content.yml +++ b/api/collections/content.yml @@ -6,7 +6,7 @@ name: content uploadPath: ../media/content meta: label: { de: "Inhalte", en: "Content" } - muiIcon: description + muiIcon: file-document-outline group: content imageUrl: "https://images.unsplash.com/photo-1499750310107-5fef28a66643?auto=format&fit=crop&q=80&w=800" preview: @@ -27,6 +27,7 @@ meta: label: { de: "Veröffentlichung", en: "Publishing" } - group: seo label: { de: "SEO", en: "SEO" } + viewHint: cards hooks: get: diff --git a/api/collections/medialib.yml b/api/collections/medialib.yml index 408d0ab..c0b3f29 100644 --- a/api/collections/medialib.yml +++ b/api/collections/medialib.yml @@ -6,9 +6,9 @@ name: medialib uploadPath: ../media/medialib meta: label: { de: "Mediathek", en: "Media Library" } - muiIcon: perm_media + muiIcon: folder-multiple-image group: content - imageUrl: "https://images.unsplash.com/photo-1542204165-65bf26472b9b?auto=format&fit=crop&q=80&w=800" + imageUrl: "https://images.unsplash.com/photo-1452587925148-ce544e77e70d?auto=format&fit=crop&q=80&w=800" viewHint: media: ai: @@ -23,7 +23,7 @@ meta: file: file preview: label: title - secondary: tags + secondary: tag tertiary: description image: file mediaFile: file @@ -129,13 +129,13 @@ fields: inputProps: multiline: true rows: 4 - - name: tags + - name: tag type: string[] meta: label: { de: "Schlagwörter", en: "Tags" } widget: foreignKey foreign: - collection: tags + collection: tag - name: _testdata type: boolean meta: diff --git a/api/collections/navigation.yml b/api/collections/navigation.yml index 6e16015..19d8024 100644 --- a/api/collections/navigation.yml +++ b/api/collections/navigation.yml @@ -7,7 +7,7 @@ meta: label: { de: "Navigation", en: "Navigation" } muiIcon: menu group: content - imageUrl: "https://images.unsplash.com/photo-1506784926709-22f1ec395907?auto=format&fit=crop&q=80&w=800" + imageUrl: "https://images.unsplash.com/photo-1452423668729-43a98052d3ee?auto=format&fit=crop&q=80&w=800" viewHint: navigation: nodesField: elements diff --git a/api/collections/ssr.yml b/api/collections/ssr.yml index 881208b..4a36113 100644 --- a/api/collections/ssr.yml +++ b/api/collections/ssr.yml @@ -7,7 +7,7 @@ meta: label: { de: "SSR Dummy", en: "ssr dummy" } muiIcon: storage group: system - imageUrl: "https://images.unsplash.com/photo-1518770660439-4636190af475?auto=format&fit=crop&q=80&w=800" + imageUrl: "https://images.unsplash.com/photo-1558494949-ef010cbdcc31?auto=format&fit=crop&q=80&w=800" hide: true permissions: diff --git a/api/collections/tags.yml b/api/collections/tag.yml similarity index 95% rename from api/collections/tags.yml rename to api/collections/tag.yml index 3d734af..2d89416 100644 --- a/api/collections/tags.yml +++ b/api/collections/tag.yml @@ -2,14 +2,14 @@ # Tags — verwaltete Schlagwörter für Mediathek und andere Collections ######################################################################## -name: tags +name: tag meta: label: { de: "Schlagwörter", en: "Tags" } - muiIcon: tag + muiIcon: label group: content - imageUrl: "https://images.unsplash.com/photo-1543285198-3af15c4592ce?auto=format&fit=crop&w=640&q=80" + imageUrl: "https://images.unsplash.com/photo-1555421689-491a97ff2040?auto=format&fit=crop&w=800&q=80" preview: - select: [ name, color ] + select: [name, color] label: name labelStyle: eval: | diff --git a/api/config.yml b/api/config.yml index 31438bd..124b914 100644 --- a/api/config.yml +++ b/api/config.yml @@ -22,11 +22,11 @@ meta: icon: settings collections: - - !include collections/tags.yml - !include collections/content.yml - !include collections/medialib.yml - !include collections/navigation.yml - - !include collections/comments.yml + - !include collections/tag.yml + - !include collections/comment.yml - !include collections/ssr.yml assets: diff --git a/api/config.yml.env b/api/config.yml.env index badafda..f427019 100644 --- a/api/config.yml.env +++ b/api/config.yml.env @@ -1,2 +1,2 @@ ADMIN_TOKEN=5bdfjc78hdxn338cuhSJ -ADMIN_ASSET_VERSION=db968ab-dirty-1779031609756 +ADMIN_ASSET_VERSION=d74964d-dirty-1779040944093 diff --git a/frontend/mocking/comments.json b/frontend/mocking/comment.json similarity index 100% rename from frontend/mocking/comments.json rename to frontend/mocking/comment.json diff --git a/frontend/src/App.svelte b/frontend/src/App.svelte index 514b8fe..e6b598e 100644 --- a/frontend/src/App.svelte +++ b/frontend/src/App.svelte @@ -24,12 +24,12 @@ const CONTENT_MEDIA_LOOKUP = ["blocks.heroImage.image:medialib", "blocks.image:medialib"].join(",") const NAVIGATION_CONTENT_LOOKUP = "elements.page:content" - const CONTENT_COMMENTS_AGGREGATE = { - collection: "comments", + const CONTENT_COMMENT_AGGREGATE = { + collection: "comment", foreignField: "contentId", op: "count", filter: { active: true }, - as: "commentsCount", + as: "commentCount", } let { url = "" }: { url?: string } = $props() @@ -138,7 +138,7 @@ } let loading = $state(true) let notFound = $state(false) - let comments = $state([]) + let commentList = $state([]) // Header scroll detection let scrolled = $state(false) @@ -187,7 +187,7 @@ filter: { lang, path: routePath, active: true }, sort: "sort", limit: 1, - aggregate: CONTENT_COMMENTS_AGGREGATE, + aggregate: CONTENT_COMMENT_AGGREGATE, lookup: CONTENT_MEDIA_LOOKUP, }) @@ -200,13 +200,13 @@ } try { - comments = await getCachedEntries("comments", { + commentList = await getCachedEntries("comment", { filter: { active: true, contentId: contentEntry.id as string }, sort: "sort", }) } catch (e) { - console.error("Failed to load comments", e) - comments = [] + console.error("Failed to load comment", e) + commentList = [] } } else { notFound = true @@ -396,14 +396,14 @@
- {#if (contentEntry as any)?._aggregate?.commentsCount !== undefined} + {#if (contentEntry as any)?._aggregate?.commentCount !== undefined}

- Kommentare ({(contentEntry as any)._aggregate.commentsCount}) + Kommentare ({(contentEntry as any)._aggregate.commentCount})

- {#if comments && comments.length > 0} + {#if commentList && commentList.length > 0}
- {#each comments as comment} + {#each commentList as comment}
{comment.author}

{comment.message}

diff --git a/frontend/src/lib/mock.ts b/frontend/src/lib/mock.ts index 51917b3..ec6fb3f 100644 --- a/frontend/src/lib/mock.ts +++ b/frontend/src/lib/mock.ts @@ -16,7 +16,7 @@ import contentData from "../../mocking/content.json" import medialibData from "../../mocking/medialib.json" import navigationData from "../../mocking/navigation.json" -import commentsData from "../../mocking/comments.json" +import commentsData from "../../mocking/comment.json" type EJsonObjectId = { $oid: string @@ -26,7 +26,7 @@ const mockRegistry: Record[]> = { content: normalizeMockCollection(contentData as Record[]), medialib: normalizeMockCollection(medialibData as Record[]), navigation: normalizeMockCollection(navigationData as Record[]), - comments: normalizeMockCollection(commentsData as Record[]), + comment: normalizeMockCollection(commentsData as Record[]), } function isEJsonObjectId(value: unknown): value is EJsonObjectId { @@ -263,7 +263,7 @@ function applyAggregate(entry: Record, options?: ApiOptions): R continue } - // "comments:contentId:count" + // "comment:contentId:count" const parts = spec.split(":") if (parts.length < 3) continue const targetCollection = parts[0]