Skip to content

Commit 93792a1

Browse files
authored
Merge pull request #268 from Inchoo/bugfix/#235-edge-module-groups-bug
Bugfix/#235 edge module groups bug
2 parents e91ceab + 3795a78 commit 93792a1

File tree

2 files changed

+19
-10
lines changed

2 files changed

+19
-10
lines changed

Diff for: Model/Config.php

+11-8
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ class Config extends \Magento\PageCache\Model\Config
5555
/**
5656
* Magento Error Page Response Object Name
5757
*/
58-
const ERROR_PAGE_RESPONSE_OBJECT = 'magentomodule_error_page_response_object';
58+
const ERROR_PAGE_RESPONSE_OBJECT = self::FASTLY_MAGENTO_MODULE.'_error_page_response_object';
5959

6060
/**
6161
* WAF Page Response Object Name
@@ -85,7 +85,7 @@ class Config extends \Magento\PageCache\Model\Config
8585
/**
8686
* Blocking setting name
8787
*/
88-
const BLOCKING_SETTING_NAME = 'magentomodule_blocking_recv';
88+
const BLOCKING_SETTING_NAME = self::FASTLY_MAGENTO_MODULE.'_blocking_recv';
8989

9090
/**
9191
* Rate Limiting snippets directory path
@@ -100,7 +100,7 @@ class Config extends \Magento\PageCache\Model\Config
100100
/**
101101
* Rate Limiting setting name
102102
*/
103-
const RATE_LIMITING_SETTING_NAME = 'magentomodule_rate_limiting';
103+
const RATE_LIMITING_SETTING_NAME = self::FASTLY_MAGENTO_MODULE.'_rate_limiting';
104104

105105
/**
106106
* WAF snippets directory path
@@ -115,7 +115,7 @@ class Config extends \Magento\PageCache\Model\Config
115115
/**
116116
* WAF setting name
117117
*/
118-
const WAF_SETTING_NAME = 'magentomodule_waf_recv';
118+
const WAF_SETTING_NAME = self::FASTLY_MAGENTO_MODULE.'_waf_recv';
119119

120120
/**
121121
* Authentication snippets directory path
@@ -130,12 +130,12 @@ class Config extends \Magento\PageCache\Model\Config
130130
/**
131131
* Authentication dictionary name
132132
*/
133-
const AUTH_DICTIONARY_NAME = 'magentomodule_basic_auth';
133+
const AUTH_DICTIONARY_NAME = self::FASTLY_MAGENTO_MODULE.'_basic_auth';
134134

135135
/**
136136
* Image optimization setting name
137137
*/
138-
const IMAGE_SETTING_NAME = 'magentomodule_image_optimization_recv';
138+
const IMAGE_SETTING_NAME = self::FASTLY_MAGENTO_MODULE.'_image_optimization_recv';
139139

140140
/**
141141
* Force TLS snippet path
@@ -145,12 +145,12 @@ class Config extends \Magento\PageCache\Model\Config
145145
/**
146146
* Force TLS setting name
147147
*/
148-
const FORCE_TLS_SETTING_NAME = 'magentomodule_force_tls_recv';
148+
const FORCE_TLS_SETTING_NAME = self::FASTLY_MAGENTO_MODULE.'_force_tls_recv';
149149

150150
/**
151151
* Configure Dictionary name
152152
*/
153-
const CONFIG_DICTIONARY_NAME = 'magentomodule_config';
153+
const CONFIG_DICTIONARY_NAME = self::FASTLY_MAGENTO_MODULE.'_config';
154154

155155
/**
156156
* Maintenance Allowlist name
@@ -477,6 +477,9 @@ class Config extends \Magento\PageCache\Model\Config
477477
const XML_FASTLY_CRAWLER_RATE_LIMITING_TTL
478478
= 'system/full_page_cache/fastly/fastly_rate_limiting_settings/crawler_protection/crawler_rate_limiting_ttl';
479479

480+
/**
481+
* XML path to Exempt Good Bots flag
482+
*/
480483
const XML_FASTLY_EXEMPT_GOOD_BOTS
481484
= 'system/full_page_cache/fastly/fastly_rate_limiting_settings/crawler_protection/exempt_good_bots';
482485

Diff for: view/adminhtml/web/js/modly.js

+8-2
Original file line numberDiff line numberDiff line change
@@ -703,9 +703,9 @@ define([
703703
$('body').on('click', 'button.fastly-edit-active-modules-icon', function () {
704704
let module_id = $(this).data('module-id');
705705
let properties = [];
706-
let fieldset = $('<div class="admin__fieldset form-list modly-group">');
707706
let message = $('<div class="message"></div>');
708707
let title = '';
708+
let groups = [];
709709

710710
// call getModule data function to retrieve a specific module's data
711711
getModuleData(module_id).done(function (response) {
@@ -748,15 +748,19 @@ define([
748748
// for each group data property
749749
$.each(groupData, function (groupIndex, groupValues) {
750750
// for each manifest defined config property, render fields with group values
751+
let fieldset = $('<div class="admin__fieldset form-list modly-group"></div>');
751752
$.each(property.properties, function (propertyIndex, propertyValues) {
752753
fieldset.append(renderFields(propertyValues, groupValues, active_version));
753754
});
754755
fieldset.append('<div class="admin__field field"><div class="admin__field-label"></div><div class="admin__field-control"><button class="action remove-group-button" type="button" data-role="action"><span>Remove group</span></button></div></div>');
755756
fieldset.append('<div class="admin__field field"><div class="admin__field-label"></div><div class="admin__field-control"><hr></div></div></div>');
757+
groups.push(fieldset);
756758
});
757759
});
758760
} else {
761+
let fieldset = $('<div class="admin__fieldset form-list modly-group"></div>');
759762
fieldset.append(renderFields(property, parsedValues[0], active_version));
763+
groups.push(fieldset);
760764
}
761765
});
762766
}
@@ -767,7 +771,9 @@ define([
767771
setServiceLabel(active_version, next_version, service_name);
768772
$('.module-messages').prepend(message);
769773
let question = $('.question');
770-
question.append(fieldset);
774+
$.each(groups, function (grIndex, grData) {
775+
question.append(grData);
776+
});
771777
$('.modal-title').html(title);
772778
$('#module-id').val(module_id);
773779
let groupBtn = '<button class="action-secondary group-button" type="button" data-role="action"><span>Add group</span></button>';

0 commit comments

Comments
 (0)