Skip to content

Commit e0a1651

Browse files
author
Michael Yu
committed
MAGETWO-91961: architecture resolve feedback
- Renamed GoogleMapsApiValidator to form/field/GoogleMapsApiKey - Renamed MapContainer to GoogleMapsApiKeyValidationContainer - Renamed google_maps_api_validator to google_maps_api_key - Fixed test names - Fixed docblock and camelcased members
1 parent 0e51723 commit e0a1651

File tree

12 files changed

+19
-19
lines changed

12 files changed

+19
-19
lines changed

app/code/Magento/PageBuilder/Block/Adminhtml/System/Config/GoogleMapsApiValidator.php renamed to app/code/Magento/PageBuilder/Block/Adminhtml/System/Config/Form/Field/GoogleMapsApiKey.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,17 +5,17 @@
55
*/
66
declare(strict_types=1);
77

8-
namespace Magento\PageBuilder\Block\Adminhtml\System\Config;
8+
namespace Magento\PageBuilder\Block\Adminhtml\System\Config\Form\Field;
99

10-
class GoogleMapsApiValidator extends \Magento\Config\Block\System\Config\Form\Field
10+
class GoogleMapsApiKey extends \Magento\Config\Block\System\Config\Form\Field
1111
{
1212
/**
1313
* @inheritdoc
1414
*/
1515
protected function _prepareLayout()
1616
{
1717
parent::_prepareLayout();
18-
$this->setTemplate('Magento_PageBuilder::system/config/google_maps_api_validator.phtml');
18+
$this->setTemplate('Magento_PageBuilder::system/config/google_maps_api_key.phtml');
1919
return $this;
2020
}
2121

app/code/Magento/PageBuilder/Component/MapContainer.php renamed to app/code/Magento/PageBuilder/Component/GoogleMapsApiKeyValidationContainer.php

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -13,40 +13,40 @@
1313
use Magento\Framework\View\Element\UiComponent\ContextInterface;
1414
use Magento\PageBuilder\Model\GoogleMaps\ApiKeyValidator;
1515

16-
class MapContainer extends \Magento\Ui\Component\Container
16+
class GoogleMapsApiKeyValidationContainer extends \Magento\Ui\Component\Container
1717
{
1818
const GOOGLE_MAPS_API_KEY_PATH = 'cms/pagebuilder/google_maps_api_key';
1919

2020
/**
21-
* @var UrlInterface $url
21+
* @var UrlInterface
2222
*/
2323
private $url;
2424

2525
/**
26-
* @var ScopeConfigInterface $scopeConfig
26+
* @var ScopeConfigInterface
2727
*/
2828
private $scopeConfig;
2929

3030
/**
31-
* @var ApiKeyValidator $ApiKeyValidator
31+
* @var ApiKeyValidator
3232
*/
33-
private $ApiKeyValidator;
33+
private $apiKeyValidator;
3434

3535
/**
3636
* Constructor
3737
*
3838
* @param ContextInterface $context
3939
* @param UrlInterface $url
4040
* @param ScopeConfigInterface $scopeConfig
41-
* @param ApiKeyValidator $ApiKeyValidator
41+
* @param ApiKeyValidator $apiKeyValidator
4242
* @param array $components
4343
* @param array $data
4444
*/
4545
public function __construct(
4646
ContextInterface $context,
4747
UrlInterface $url,
4848
ScopeConfigInterface $scopeConfig,
49-
ApiKeyValidator $ApiKeyValidator,
49+
ApiKeyValidator $apiKeyValidator,
5050
array $components = [],
5151
array $data = []
5252
) {
@@ -57,7 +57,7 @@ public function __construct(
5757
);
5858
$this->url = $url;
5959
$this->scopeConfig = $scopeConfig;
60-
$this->ApiKeyValidator = $ApiKeyValidator;
60+
$this->ApiKeyValidator = $apiKeyValidator;
6161
}
6262

6363
/**

app/code/Magento/PageBuilder/Controller/Adminhtml/GoogleMaps/ValidateApi.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,20 +16,20 @@ class ValidateApi extends \Magento\Backend\App\Action
1616
/**
1717
* @var \Magento\PageBuilder\Model\GoogleMaps\ApiKeyValidator
1818
*/
19-
private $ApiKeyValidator;
19+
private $apiKeyValidator;
2020

2121
/**
2222
* Constructor
2323
*
2424
* @param \Magento\Backend\App\Action\Context $context
25-
* @param \Magento\PageBuilder\Model\GoogleMaps\ApiKeyValidator $ApiKeyValidator
25+
* @param \Magento\PageBuilder\Model\GoogleMaps\ApiKeyValidator $apiKeyValidator
2626
*/
2727
public function __construct(
2828
\Magento\Backend\App\Action\Context $context,
29-
\Magento\PageBuilder\Model\GoogleMaps\ApiKeyValidator $ApiKeyValidator
29+
\Magento\PageBuilder\Model\GoogleMaps\ApiKeyValidator $apiKeyValidator
3030
) {
3131
parent::__construct($context);
32-
$this->ApiKeyValidator = $ApiKeyValidator;
32+
$this->ApiKeyValidator = $apiKeyValidator;
3333
}
3434

3535
/**

app/code/Magento/PageBuilder/etc/adminhtml/system.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
<attribute type="valid_label">Key is valid</attribute>
3030
<attribute type="invalid_label">Key is invalid. Try different key.</attribute>
3131
<attribute type="source_field">cms_pagebuilder_google_maps_api_key</attribute>
32-
<frontend_model>Magento\PageBuilder\Block\Adminhtml\System\Config\GoogleMapsApiValidator</frontend_model>
32+
<frontend_model>Magento\PageBuilder\Block\Adminhtml\System\Config\Form\Field\GoogleMapsApiKey</frontend_model>
3333
</field>
3434
</group>
3535
</section>
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
*/
66

77
/**
8-
* @var \Magento\PageBuilder\Block\Adminhtml\System\Config\GoogleMapsApiValidator $block
8+
* @var \Magento\PageBuilder\Block\Adminhtml\System\Config\Form\Field\GoogleMapsApiKey $block
99
*/
1010
?>
1111
<button class="scalable"

app/code/Magento/PageBuilder/view/adminhtml/ui_component/pagebuilder_map_form.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@
6262
</formElements>
6363
</field>
6464
</fieldset>
65-
<container sortOrder="20" name="google_map_api_key_check" component="Magento_Ui/js/form/components/html" class="Magento\PageBuilder\Component\MapContainer">
65+
<container sortOrder="20" name="google_map_api_key_check" component="Magento_Ui/js/form/components/html" class="Magento\PageBuilder\Component\GoogleMapsApiKeyValidationContainer">
6666
<argument name="data" xsi:type="array">
6767
<item name="config" xsi:type="array">
6868
<item name="additionalClasses" xsi:type="string">message message-warning</item>
@@ -189,7 +189,7 @@
189189
</settings>
190190
</field>
191191
</fieldset>
192-
<fieldset name="map_settings" sortOrder="30">
192+
<fieldset name="map_settings" sortOrder="40">
193193
<settings>
194194
<label translate="true">Map Settings</label>
195195
<collapsible>true</collapsible>

0 commit comments

Comments
 (0)