File tree Expand file tree Collapse file tree 4 files changed +4
-13
lines changed
app/code/Magento/PageBuilder Expand file tree Collapse file tree 4 files changed +4
-13
lines changed Original file line number Diff line number Diff line change @@ -30,26 +30,19 @@ class GoogleMapsApiKeyValidationContainer extends \Magento\Ui\Component\Containe
30
30
*/
31
31
private $ scopeConfig ;
32
32
33
- /**
34
- * @var ApiKeyValidator
35
- */
36
- private $ apiKeyValidator ;
37
-
38
33
/**
39
34
* Constructor
40
35
*
41
36
* @param ContextInterface $context
42
37
* @param UrlInterface $url
43
38
* @param ScopeConfigInterface $scopeConfig
44
- * @param ApiKeyValidator $apiKeyValidator
45
39
* @param array $components
46
40
* @param array $data
47
41
*/
48
42
public function __construct (
49
43
ContextInterface $ context ,
50
44
UrlInterface $ url ,
51
45
ScopeConfigInterface $ scopeConfig ,
52
- ApiKeyValidator $ apiKeyValidator ,
53
46
array $ components = [],
54
47
array $ data = []
55
48
) {
@@ -60,7 +53,6 @@ public function __construct(
60
53
);
61
54
$ this ->url = $ url ;
62
55
$ this ->scopeConfig = $ scopeConfig ;
63
- $ this ->apiKeyValidator = $ apiKeyValidator ;
64
56
}
65
57
66
58
/**
@@ -73,8 +65,7 @@ public function prepare()
73
65
parent ::prepare ();
74
66
$ config = $ this ->getData ('config ' );
75
67
$ apiKey = $ this ->scopeConfig ->getValue (self ::GOOGLE_MAPS_API_KEY_PATH ) ?: "" ;
76
- $ response = $ this ->apiKeyValidator ->validate ($ apiKey );
77
- if (!$ response ['success ' ]) {
68
+ if (trim ($ apiKey ) == "" ) {
78
69
$ config ['visible ' ] = true ;
79
70
}
80
71
Original file line number Diff line number Diff line change 24
24
<entity name =" PageBuilderMapCommonData" type =" pagebuilder__map_common_data" >
25
25
<data key =" mapErrorTitleStorefront" >Oops! Something went wrong.</data >
26
26
<data key =" mapErrorMessageStorefront" >This page didn't load Google Maps correctly. See the JavaScript console for technical details.</data >
27
- <data key =" mapErrorMessageStage" >Enter API Key to use Google Maps</data >
27
+ <data key =" mapErrorMessageStage" >Enter valid API Key to use Google Maps</data >
28
28
</entity >
29
29
<!-- Map Position -->
30
30
<entity name =" PageBuilderMapPositionDefaultProperty" type =" pagebuilder_map_position_property" >
Original file line number Diff line number Diff line change 27
27
<field id =" google_maps_api_key_validator" translate =" button_label valid_label invalid_label" sortOrder =" 2011" showInDefault =" 1" showInWebsite =" 0" showInStore =" 0" >
28
28
<attribute type =" button_label" >Test Key</attribute >
29
29
<attribute type =" valid_label" >Key is valid</attribute >
30
- <attribute type =" invalid_label" >Key is invalid. Try different key.</attribute >
30
+ <attribute type =" invalid_label" >Key is invalid. Try a different key.</attribute >
31
31
<attribute type =" source_field" >cms_pagebuilder_google_maps_api_key</attribute >
32
32
<frontend_model >Magento\PageBuilder\Block\Adminhtml\System\Config\Form\Field\GoogleMapsApiKey</frontend_model >
33
33
</field >
Original file line number Diff line number Diff line change @@ -50,7 +50,7 @@ define([
50
50
this . usePlaceholder = function ( container ) {
51
51
var placeholder = document . createElement ( 'div' ) ;
52
52
53
- placeholder . innerHTML = $t ( 'Enter API Key to use Google Maps' ) ;
53
+ placeholder . innerHTML = $t ( 'Enter valid API Key to use Google Maps' ) ;
54
54
placeholder . classList . add ( 'google-map-auth-failure-placeholder' ) ;
55
55
container . innerHTML = '' ;
56
56
container . appendChild ( placeholder ) ;
You can’t perform that action at this time.
0 commit comments