Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Basic version & system info on Editorial Dashboard #28

Merged
merged 26 commits into from
Mar 4, 2019
Merged
Show file tree
Hide file tree
Changes from 25 commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
fd81208
Extract version info on packages if root or branch alias
andrerom Dec 23, 2018
fe0d401
Keep collected packages info around for reuse
andrerom Dec 23, 2018
84ad6c3
Dashboard and eZ Platform info collector (for now not shown in admin)
andrerom Dec 21, 2018
bedfe8d
Update Resources/views/themes/admin/dashboard/block/ez.html.twig
Jan 3, 2019
204b379
Update Resources/views/themes/admin/dashboard/block/ez.html.twig
Jan 3, 2019
4f1e788
Update Resources/views/themes/admin/dashboard/block/ez.html.twig
Jan 3, 2019
f472089
Update Resources/views/themes/admin/dashboard/block/ez.html.twig
Jan 3, 2019
449773d
Update Resources/views/themes/admin/dashboard/block/ez.html.twig
Jan 3, 2019
fadb26c
Update Resources/views/themes/admin/dashboard/block/ez.html.twig
Jan 3, 2019
b6bd394
Change to have collapsed alert boxes expanded by clicking on badge
andrerom Feb 28, 2019
24059f5
Fix strings
andrerom Feb 28, 2019
506ac22
Change to use translation system
andrerom Mar 1, 2019
5610c88
Fix unit tests
andrerom Mar 1, 2019
fabcfb9
Update Resources/views/themes/admin/dashboard/block/ez.html.twig
SylvainGuittard Mar 2, 2019
0da57fa
Update Resources/views/themes/admin/dashboard/block/ez.html.twig
SylvainGuittard Mar 2, 2019
dc946af
Update Resources/views/themes/admin/dashboard/block/ez.html.twig
SylvainGuittard Mar 2, 2019
54fd1f5
Update Resources/views/themes/admin/dashboard/block/ez.html.twig
SylvainGuittard Mar 2, 2019
e44e4ca
Update Resources/views/themes/admin/dashboard/block/ez.html.twig
SylvainGuittard Mar 2, 2019
fdd5155
Update Resources/views/themes/admin/dashboard/block/ez.html.twig
SylvainGuittard Mar 2, 2019
70c3e99
Update Resources/views/themes/admin/dashboard/block/ez.html.twig
SylvainGuittard Mar 2, 2019
26312dc
Update Resources/views/themes/admin/dashboard/block/ez.html.twig
SylvainGuittard Mar 2, 2019
8b5247b
CS
andrerom Mar 2, 2019
d24b8f4
Extract URLs to yml, change translation display
ViniTou Mar 4, 2019
2f1edea
CR fixes
ViniTou Mar 4, 2019
d09d76a
Update requirments
ViniTou Mar 4, 2019
d63f6bb
Update composer.json
ViniTou Mar 4, 2019
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
84 changes: 84 additions & 0 deletions AdminUi/Component/EzInfoTwigComponent.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
<?php

/**
* @copyright Copyright (C) eZ Systems AS. All rights reserved.
* @license For full copyright and license information view LICENSE file distributed with this source code.
*/
declare(strict_types=1);

namespace EzSystems\EzSupportToolsBundle\AdminUi\Component;

use EzSystems\EzPlatformAdminUi\Component\Renderable;
use EzSystems\EzSupportToolsBundle\SystemInfo\Value\EzSystemInfo;
use Twig\Environment;

class EzInfoTwigComponent implements Renderable
{
/** @var string */
protected $template;

/** @var \Twig\Environment */
protected $twig;

/** @var array */
protected $parameters;

/** @var \EzSystems\EzSupportToolsBundle\SystemInfo\Value\EzSystemInfo */
private $ezSystemInfo;

/** @var array */
private $urlList;

/**
* @param \Twig\Environment $twig
* @param string $template
* @param \EzSystems\EzSupportToolsBundle\SystemInfo\Value\EzSystemInfo $ezSystemInfo
* @param array $urlList
* @param array $parameters
*/
public function __construct(
Environment $twig,
string $template,
EzSystemInfo $ezSystemInfo,
array $urlList,
array $parameters = []
) {
$this->twig = $twig;
$this->template = $template;
$this->parameters = $parameters;
$this->ezSystemInfo = $ezSystemInfo;
$this->urlList = $urlList;
}

/**
* @param array $parameters
*
* @return string
*/
public function render(array $parameters = []): string
{
$urls = $this->replaceUrlPlaceholders();

return $this->twig->render(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

missing empty line

$this->template,
$parameters + ['urls' => $urls, 'ez' => $this->ezSystemInfo] + $this->parameters
);
}

/**
* @return array
*/
private function replaceUrlPlaceholders(): array
{
$urls = $this->urlList;
foreach ($this->urlList as $urlName => $url) {
foreach ($this->ezSystemInfo as $attribute => $value) {
if (is_string($value) && strpos($url,'{ez.' . $attribute . '}') !== false) {
$urls[$urlName] = str_replace('{ez.' . $attribute . '}', $value, $url);
}
}
}

return $urls;
}
}
34 changes: 34 additions & 0 deletions Resources/config/services.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,25 @@ parameters:
support_tools.system_info.ezc.wrapper.class: EzSystems\EzSupportToolsBundle\SystemInfo\EzcSystemInfoWrapper
support_tools.system_info.collector.composer.lock_file.class: EzSystems\EzSupportToolsBundle\SystemInfo\Collector\JsonComposerLockSystemInfoCollector
support_tools.system_info.collector.database.doctrine.class: EzSystems\EzSupportToolsBundle\SystemInfo\Collector\DoctrineDatabaseSystemInfoCollector
support_tools.system_info.collector.system.ez.class: EzSystems\EzSupportToolsBundle\SystemInfo\Collector\EzSystemInfoCollector
support_tools.system_info.collector.hardware.ezc.class: EzSystems\EzSupportToolsBundle\SystemInfo\Collector\EzcHardwareSystemInfoCollector
support_tools.system_info.collector.php.ezc.class: EzSystems\EzSupportToolsBundle\SystemInfo\Collector\EzcPhpSystemInfoCollector
support_tools.system_info.collector.symfony.kernel.config.class: EzSystems\EzSupportToolsBundle\SystemInfo\Collector\ConfigurationSymfonyKernelSystemInfoCollector
support_tools.system_info.output_format.json.class: EzSystems\EzSupportToolsBundle\SystemInfo\OutputFormat\JsonOutputFormat
support_tools.ez_url_list:
contact: "https://ez.no/About-eZ/Contact-Us"
license: "https://ez.no/About-our-Software/Licenses-and-agreements"
ttl: "https://ez.no/About-our-Software/Licenses-and-agreements/eZ-Trial-and-Test-License-Agreement-eZ-TTL-v2.1"
service_life: "https://support.ez.no/Public/Service-Life"
support_service: "https://ez.no/Services/Support-Maintenance"
training_service: "https://ez.no/Services/Training"
consulting_service: "https://ez.no/Services/Consulting"
ee_product: "https://ez.no/Products/eZ-Platform-Enterprise-Edition"
install_ee: "https://doc.ezplatform.com/en/#{ez.release}/getting_started/install_ez_enterprise/"
doc: "https://doc.ezplatform.com"
update: "https://doc.ezplatform.com/en/latest/releases/updating_ez_platform/"
gpl_faq: "https://www.gnu.org/licenses/old-licenses/gpl-2.0-faq.en.html#GPLModuleLicense"
support: "https://support.ez.no"

services:
support_tools.command.dump_info:
Expand All @@ -34,6 +49,15 @@ services:

# SystemInfoCollectors

support_tools.system_info.collector.system.ez:
class: "%support_tools.system_info.collector.system.ez.class%"
arguments:
- "@support_tools.system_info.collector.composer.lock_file"
- "%kernel.debug%"
# Can't tag this before v0.3 (2.5?) as it will blow up in admin UI for missing templates there
# And it does not look like there is anway to add it from this package, so maybe it needs to be made extensible(?)
#tags: [{ name: "support_tools.system_info.collector", identifier: "ez" }]

support_tools.system_info.collector.composer.lock_file:
class: "%support_tools.system_info.collector.composer.lock_file.class%"
arguments:
Expand Down Expand Up @@ -77,3 +101,13 @@ services:
class: "%support_tools.system_info.output_format.json.class%"
tags:
- { name: "support_tools.system_info.output_format", format: "json" }

# Dashboard
EzSystems\EzSupportToolsBundle\AdminUi\Component\EzInfoTwigComponent:
autowire: true
arguments:
$template: '@@ezdesign/dashboard/block/ez.html.twig'
$ezSystemInfo: "@=service('support_tools.system_info.collector.system.ez').collect()"
$urlList: '%support_tools.ez_url_list%'
tags:
- { name: ezplatform.admin_ui.component, group: 'dashboard-blocks', priority: 200 }
105 changes: 105 additions & 0 deletions Resources/translations/dashboard.en.xlf
Original file line number Diff line number Diff line change
@@ -0,0 +1,105 @@
<?xml version="1.0" encoding="utf-8"?>
<xliff xmlns="urn:oasis:names:tc:xliff:document:1.2" xmlns:jms="urn:jms:translation" version="1.2">
<file source-language="en" target-language="en" datatype="plaintext" original="not.available">
<header>
<tool tool-id="JMSTranslationBundle" tool-name="JMSTranslationBundle" tool-version="1.1.0-DEV"/>
<note>The source node in most cases contains the sample message as written by the developer. If it looks like a dot-delimitted string such as "form.label.firstname", then the developer has not provided a default message.</note>
</header>
<body>
<trans-unit id="1710718593a511e351e6da36e3bb280e532bb768" resname="dashboard.ez_version.community_end_of_maintenance">
<source><![CDATA[Unfortunately %release% open source version has reached end of life, <a target="_blank" href="%update_url%">please upgrade</a>.]]></source>
<target state="new"><![CDATA[Unfortunately %release% open source version has reached end of life, <a target="_blank" href="%update_url%">please upgrade</a>.]]></target>
<note>key: dashboard.ez_version.community_end_of_maintenance</note>
</trans-unit>
<trans-unit id="c0d043ecd29c0bdfa32e8bb7faee57111d5ddaf7" resname="dashboard.ez_version.community_end_of_maintenance_upgrade">
<source><![CDATA[Tip: If you upgrade to eZ Platform Enterprise you'll get access to:
<a target="_blank" href="%license_url%">A business friendly license</a>,
<a target="_blank" href="%ee_product_url%">several productivity features</a>,
<a target="_blank" href="%support_service_url%">professional Support</a> and
<a target="_blank" href="%service_life_url%">longer maintenance periode of your release</a>.]]></source>
<target state="new"><![CDATA[Tip: If you upgrade to eZ Platform Enterprise you'll get access to:
<a target="_blank" href="%license_url%">A business friendly license</a>,
<a target="_blank" href="%ee_product_url%">several productivity features</a>,
<a target="_blank" href="%support_service_url%">professional Support</a> and
<a target="_blank" href="%service_life_url%">longer maintenance periode of your release</a>.]]></target>
<note>key: dashboard.ez_version.community_end_of_maintenance_upgrade</note>
</trans-unit>
<trans-unit id="7eb6ab2973439efa8ff820310952e02bc81209cb" resname="dashboard.ez_version.community_severity_non">
<source><![CDATA[Welcome to the open source %release% release. Using the community friendly <a target="_blank" href="%license_url%">GPL license</a>,
<a target="_blank" href="%gpl_faq_url%">sharing your code</a> is what it's all about.]]></source>
<target state="new"><![CDATA[Welcome to the open source %release% release. Using the community friendly <a target="_blank" href="%license_url%">GPL license</a>,
<a target="_blank" href="%gpl_faq_url%">sharing your code</a> is what it's all about.]]></target>
<note>key: dashboard.ez_version.community_severity_non</note>
</trans-unit>
<trans-unit id="bbddea87dd6b56fc0b4d21c28d1cbc2cfd92b754" resname="dashboard.ez_version.end_of_life">
<source><![CDATA[Welcome to the open source %release% release. Using the community friendly <a target="_blank" href="%license_url%">GPL license</a>,
<a target="_blank" href="%gpl_faq_url%">sharing your code</a> is what it's all about.]]></source>
<target state="new"><![CDATA[Welcome to the open source %release% release. Using the community friendly <a target="_blank" href="%license_url%">GPL license</a>,
<a target="_blank" href="%gpl_faq_url%">sharing your code</a> is what it's all about.]]></target>
<note>key: dashboard.ez_version.end_of_life</note>
</trans-unit>
<trans-unit id="9bad0b8d1efd71dca8071e736f332b3b4218d557" resname="dashboard.ez_version.end_of_life_upgrade">
<source><![CDATA[Unfortunately %release% has reached <a target="_blank" href="%service_life_url%">end of life</a>,
please plan to upgrade. If you need assistance, don't hesitate to <a target="_blank" href="%contact_url%">contact eZ</a>.]]></source>
<target state="new"><![CDATA[Unfortunately %release% has reached <a target="_blank" href="%service_life_url%">end of life</a>,
please plan to upgrade. If you need assistance, don't hesitate to <a target="_blank" href="%contact_url%">contact eZ</a>.]]></target>
<note>key: dashboard.ez_version.end_of_life_upgrade</note>
</trans-unit>
<trans-unit id="d620cc5d1f36ef74cbf6c042e07c0ad89bf47d9f" resname="dashboard.ez_version.end_of_maintenance">
<source>Your trial period is coming to an end.</source>
<target state="new">Your trial period is coming to an end.</target>
<note>key: dashboard.ez_version.end_of_maintenance</note>
</trans-unit>
<trans-unit id="7b47468c70176c3f6c78ca0e29b1378e2685d2e1" resname="dashboard.ez_version.end_of_maintenance_contanct">
<source><![CDATA[<a target="_blank" href="%contact_url%">Contact eZ or its partner(s)</a> to purchase a subscription
and follow the <a target="_blank" href="%install_ee%">online documentation</a> to configure your project.]]></source>
<target state="new"><![CDATA[<a target="_blank" href="%contact_url%">Contact eZ or its partner(s)</a> to purchase a subscription
and follow the <a target="_blank" href="%install_ee%">online documentation</a> to configure your project.]]></target>
<note>key: dashboard.ez_version.end_of_maintenance_contanct</note>
</trans-unit>
<trans-unit id="99cfacc8eb18b57ad83dccc62b053ad0aea20b79" resname="dashboard.ez_version.non_stable">
<source>Your setup is running with unstable packages, this is not recommended besides when testing updates.</source>
<target state="new">Your setup is running with unstable packages, this is not recommended besides when testing updates.</target>
<note>key: dashboard.ez_version.non_stable</note>
</trans-unit>
<trans-unit id="59967d79ef1f521fd483dbb057f15bc756b80423" resname="dashboard.ez_version.non_stable_ee">
<source><![CDATA[If you need assistance, don't hesitate to <a target="_blank" href="%support_url%">get in touch with eZ support</a>.]]></source>
<target state="new"><![CDATA[If you need assistance, don't hesitate to <a target="_blank" href="%support_url%">get in touch with eZ support</a>.]]></target>
<note>key: dashboard.ez_version.non_stable_ee</note>
</trans-unit>
<trans-unit id="c1fb5ba9fd547e30a49a4e1895822e69cd4a9dbc" resname="dashboard.ez_version.release_not_determined">
<source><![CDATA[The system could not find your <code>composer.lock</code> file. It's needed to determine information about
your eZ install, and recommended to be kept on project development to make sure same package versions are used across all environments.]]></source>
<target state="new"><![CDATA[The system could not find your <code>composer.lock</code> file. It's needed to determine information about
your eZ install, and recommended to be kept on project development to make sure same package versions are used across all environments.]]></target>
<note>key: dashboard.ez_version.release_not_determined</note>
</trans-unit>
<trans-unit id="b0b5f4a2312f9a25f310e6d5044046ce0146a9c3" resname="dashboard.ez_version.severity_non">
<source><![CDATA[Welcome to %name%, check our <a target="_blank" href="%doc_url%">online documentation</a>, <a target="_blank" href="%consulting_url%">consulting</a>
or <a target="_blank" href="%training_url%">training</a> services in order to get the most out of your trial.]]></source>
<target state="new"><![CDATA[Welcome to %name%, check our <a target="_blank" href="%doc_url%">online documentation</a>, <a target="_blank" href="%consulting_url%">consulting</a>
or <a target="_blank" href="%training_url%">training</a> services in order to get the most out of your trial.]]></target>
<note>key: dashboard.ez_version.severity_non</note>
</trans-unit>
<trans-unit id="977ad02930ea5e0ae86eab268d0628786ad6b909" resname="dashboard.ez_version.severity_non_contant">
<source><![CDATA[<a target="_blank" href="%contact_url%">Contact eZ or its partner(s)</a> to purchase a subscription
and follow the <a target="_blank" href="%install_ee%">online documentation</a> to configure your project.]]></source>
<target state="new"><![CDATA[<a target="_blank" href="%contact_url%">Contact eZ or its partner(s)</a> to purchase a subscription
and follow the <a target="_blank" href="%install_ee%">online documentation</a> to configure your project.]]></target>
<note>key: dashboard.ez_version.severity_non_contant</note>
</trans-unit>
<trans-unit id="10afa9a6e250d82f948ea1e6cbcdf7aac8bd7a4b" resname="dashboard.ez_version.trial_expired">
<source><![CDATA[Unfortunately your trial period has expired and your <a target="_blank" href="%ttl_url%">TTL license</a> is no longer valid.]]></source>
<target state="new"><![CDATA[Unfortunately your trial period has expired and your <a target="_blank" href="%ttl_url%">TTL license</a> is no longer valid.]]></target>
<note>key: dashboard.ez_version.trial_expired</note>
</trans-unit>
<trans-unit id="fad8721d93ef0b882327327f52921f656a8e206b" resname="dashboard.ez_version.trial_expired_contant">
<source><![CDATA[<a target="_blank" href="%contact_url%">Contact eZ or its partner(s)</a> to purchase a subscription
and follow the <a target="_blank" href="%install_ee%">online documentation</a> to configure your project.]]></source>
<target state="new"><![CDATA[<a target="_blank" href="%contact_url%">Contact eZ or its partner(s)</a> to purchase a subscription
and follow the <a target="_blank" href="%install_ee%">online documentation</a> to configure your project.]]></target>
<note>key: dashboard.ez_version.trial_expired_contant</note>
</trans-unit>
</body>
</file>
</xliff>
Loading