forked from cms/tibi-svelte-starter
7ef080ba88
Ohne Repo verständlich: Routen, Lookup-Pfade, Upload-Format src/path, translationKey-Falle, SSR-Cache, Tailwind/Svelte-Regeln.
103 lines
2.2 KiB
YAML
103 lines
2.2 KiB
YAML
name: comment
|
|
uploadPath: ../media/comment
|
|
audit:
|
|
enabled: true
|
|
meta:
|
|
label: { de: "Kommentare", en: "Comments" }
|
|
muiIcon: chat
|
|
group: community
|
|
imageUrl: "https://images.unsplash.com/photo-1522096823084-2d1aa8411c13?auto=format&fit=crop&q=80&w=800"
|
|
agent:
|
|
purpose: "Page comments counted via aggregate and listed per contentId."
|
|
instructions: "Required: contentId (content.id), author, message. App loads aggregate commentCount plus list {active:true, contentId}. Only active:true is public."
|
|
fieldHints:
|
|
contentId: "content.id the comment belongs to"
|
|
examples: [{ author: "Demo", message: "Nice page", active: true }]
|
|
hints: ["mutations invalidate SSR via clear_cache hooks"]
|
|
preview:
|
|
label: author
|
|
secondary: message
|
|
tertiary: contentId
|
|
|
|
permissions:
|
|
public:
|
|
methods:
|
|
get: true
|
|
user:
|
|
methods:
|
|
get: true
|
|
post: true
|
|
put: true
|
|
delete: true
|
|
"token:${ADMIN_TOKEN}":
|
|
methods:
|
|
"get": true
|
|
"post": true
|
|
"put": true
|
|
"delete": true
|
|
|
|
hooks:
|
|
get:
|
|
read:
|
|
type: javascript
|
|
file: hooks/filter_public.js
|
|
post:
|
|
return:
|
|
type: javascript
|
|
file: hooks/clear_cache.js
|
|
put:
|
|
return:
|
|
type: javascript
|
|
file: hooks/clear_cache.js
|
|
delete:
|
|
return:
|
|
type: javascript
|
|
file: hooks/clear_cache.js
|
|
|
|
indexes:
|
|
- name: content_active
|
|
key:
|
|
- contentId
|
|
- active
|
|
background: true
|
|
|
|
search:
|
|
- name: default
|
|
mode: regex
|
|
fields: [author, message, contentId]
|
|
|
|
fields:
|
|
- name: active
|
|
type: boolean
|
|
meta:
|
|
label: { de: "Sichtbar", en: "Visible" }
|
|
defaultValue: true
|
|
|
|
- name: contentId
|
|
type: string
|
|
validator:
|
|
required: true
|
|
meta:
|
|
label: { de: "Seite (Content)", en: "Page (Content)" }
|
|
widget: foreignKey
|
|
foreign:
|
|
collection: content
|
|
protected: true
|
|
|
|
- name: author
|
|
type: string
|
|
validator:
|
|
required: true
|
|
meta:
|
|
label: { de: "Autor", en: "Author" }
|
|
protected: true
|
|
|
|
- name: message
|
|
type: string
|
|
validator:
|
|
required: true
|
|
meta:
|
|
label: { de: "Nachricht", en: "Message" }
|
|
widget: textarea
|
|
protected: true
|