Release of v5.1.1-beta3

Fixes issue with loading the Component Builder Wiki. Adds advanced version update notice to the Component Builder Dashboard. Completely refactors the class that builds the Component Dashboard. #1134.
This commit is contained in:
2025-06-23 17:02:17 +00:00
parent 3c1057a830
commit dbebb5663c
28 changed files with 2067 additions and 888 deletions

View File

@ -28,6 +28,60 @@ namespace ###NAMESPACEPREFIX###\Component\###ComponentNamespace###\Administrator
#[\AllowDynamicProperties]
class HtmlView extends BaseHtmlView
{
/**
* @var array<string> List of icon identifiers to render in the dashboard view.
* @since 1.6
*/
public array $icons = [];
/**
* @var array<string> List of CSS file URLs to be added to the page.
* @since 4.3
*/
public array $styles = [];
/**
* @var array<string> List of JavaScript file URLs to be included on the page.
* @since 4.3
*/
public array $scripts = [];
/**
* @var array<int, object> List of contributor objects fetched via the helper.
* @since 1.6
*/
public array $contributors = [];
/**
* @var object|null The manifest metadata of the component as returned by `ComponentbuilderHelper::manifest()`.
* @since 1.6
*/
public $manifest = null;
/**
* @var string|null Markdown content of the component's wiki page.
* @since 1.6
*/
public ?string $wiki = null;
/**
* @var string|null The rendered or raw README markdown of the component.
* @since 1.6
*/
public ?string $readme = null;
/**
* @var string|null The current version of the component.
* @since 1.6
*/
public ?string $version = null;
/**
* @var string|null Help URL for the component dashboard view, if available.
* @since 1.6
*/
public ?string $help_url = null;
/**
* View display method
*
@ -96,8 +150,12 @@ class HtmlView extends BaseHtmlView
{
// set page title
$this->getDocument()->setTitle(Joomla___ba6326ef_cb79_4348_80f4_ab086082e3c5___Power::_('COM_###COMPONENT###_DASHBOARD'));
// add manifest to page JavaScript
$this->getDocument()->addScriptDeclaration("var manifest = JSON.parse(" . json_encode($this->manifest) . ");", "text/javascript");
/** \Joomla\CMS\WebAsset\WebAssetManager $wa */
$wa = $this->getDocument()->getWebAssetManager();
// Register the inline script with properly encoded JSON
$wa->addInlineScript(
'var manifest = ' . json_encode($this->manifest, JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE) . ';'
);
// add styles
foreach ($this->styles as $style)
{