fe_comment: Feedback Overview content element in the page JSON
- New content element "Feedback Overview" (CType fecomment_overview):
the current FE user's feedback state under content.feedbackOverview,
so the overview page renders like any other page instead of a
front-end special case
- Rendered as USER_INT inside the cached page JSON (EXT:headless replaces
the field per request): data is per user, visitors without a session
get {"allowed": false} - verified that nothing leaks from the cache
- One implementation for both consumers: the new FeedbackState service
builds the state payload; the API middleware delegates to it
- State payload (API and element) gained canSubmit and actions (all
write endpoints with method and URL), so the front end needs no
hard-coded endpoints for the submit button below the ticket list
- New site set evomedien/fe-comment carries the TypoScript, added to the
site configuration; icon fecomment-overview
This commit is contained in:
1 parent
887caed2aa
commit
eb0d0d9ebc
9 files changed
+301
-110
No files matched your search
@@ -0,0 +1,8 @@
|
||||
<?php
|
||||
|
||||
return [
|
||||
'fecomment-overview' => [
|
||||
'provider' => \TYPO3\CMS\Core\Imaging\IconProvider\SvgIconProvider::class,
|
||||
'source' => 'EXT:fe_comment/Resources/Public/Icons/Extension.svg',
|
||||
],
|
||||
];
|
||||
@@ -0,0 +1,5 @@
|
||||
name: evomedien/fe-comment
|
||||
label: 'fe_comment: Feedback Overview (headless JSON)'
|
||||
# The overview element renders through EXT:headless (lib.contentElementWithHeader).
|
||||
dependencies:
|
||||
- friendsoftypo3/headless
|
||||
@@ -0,0 +1,15 @@
|
||||
# "Feedback Overview" content element as headless JSON (2026-10-09):
|
||||
# content.feedbackOverview = the payload of GET /api/fe-comment/state.
|
||||
# USER_INT on purpose - the data is per FE user; EXT:headless caches the page
|
||||
# and replaces only this field on every request.
|
||||
tt_content.fecomment_overview < lib.contentElementWithHeader
|
||||
tt_content.fecomment_overview {
|
||||
fields {
|
||||
content {
|
||||
fields {
|
||||
feedbackOverview = USER_INT
|
||||
feedbackOverview.userFunc = Evomedien\FeComment\UserFunc\OverviewJsonRenderer->render
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
<?php
|
||||
|
||||
defined('TYPO3') or die();
|
||||
|
||||
// "Feedback Overview": the current FE user's feedback state as JSON
|
||||
// (content.feedbackOverview, rendered by OverviewJsonRenderer). Place it on
|
||||
// the overview page (extension setting overviewPid). No plugin options.
|
||||
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addPlugin(
|
||||
[
|
||||
'label' => 'Feedback Overview',
|
||||
'description' => 'The logged-in user\'s open feedback summary (items, attachments, notes, recipients) as JSON for the front end.',
|
||||
'value' => 'fecomment_overview',
|
||||
'icon' => 'fecomment-overview',
|
||||
'group' => 'plugins',
|
||||
],
|
||||
'CType',
|
||||
'fe_comment'
|
||||
);
|
||||
|
||||
$GLOBALS['TCA']['tt_content']['types']['fecomment_overview']['showitem'] = '
|
||||
--div--;LLL:EXT:core/Resources/Private/Language/Form/locallang_tabs.xlf:general,
|
||||
--palette--;;general,
|
||||
--palette--;;headers,
|
||||
--div--;LLL:EXT:core/Resources/Private/Language/Form/locallang_tabs.xlf:access,
|
||||
--palette--;;hidden';
|
||||
Reference in new issue
Block a user