Skip to content

Bugfix/#235 edge module groups bug #268

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

Merged
merged 2 commits into from
May 3, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
19 changes: 11 additions & 8 deletions Model/Config.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ class Config extends \Magento\PageCache\Model\Config
/**
* Magento Error Page Response Object Name
*/
const ERROR_PAGE_RESPONSE_OBJECT = 'magentomodule_error_page_response_object';
const ERROR_PAGE_RESPONSE_OBJECT = self::FASTLY_MAGENTO_MODULE.'_error_page_response_object';

/**
* WAF Page Response Object Name
Expand Down Expand Up @@ -85,7 +85,7 @@ class Config extends \Magento\PageCache\Model\Config
/**
* Blocking setting name
*/
const BLOCKING_SETTING_NAME = 'magentomodule_blocking_recv';
const BLOCKING_SETTING_NAME = self::FASTLY_MAGENTO_MODULE.'_blocking_recv';

/**
* Rate Limiting snippets directory path
Expand All @@ -100,7 +100,7 @@ class Config extends \Magento\PageCache\Model\Config
/**
* Rate Limiting setting name
*/
const RATE_LIMITING_SETTING_NAME = 'magentomodule_rate_limiting';
const RATE_LIMITING_SETTING_NAME = self::FASTLY_MAGENTO_MODULE.'_rate_limiting';

/**
* WAF snippets directory path
Expand All @@ -115,7 +115,7 @@ class Config extends \Magento\PageCache\Model\Config
/**
* WAF setting name
*/
const WAF_SETTING_NAME = 'magentomodule_waf_recv';
const WAF_SETTING_NAME = self::FASTLY_MAGENTO_MODULE.'_waf_recv';

/**
* Authentication snippets directory path
Expand All @@ -130,12 +130,12 @@ class Config extends \Magento\PageCache\Model\Config
/**
* Authentication dictionary name
*/
const AUTH_DICTIONARY_NAME = 'magentomodule_basic_auth';
const AUTH_DICTIONARY_NAME = self::FASTLY_MAGENTO_MODULE.'_basic_auth';

/**
* Image optimization setting name
*/
const IMAGE_SETTING_NAME = 'magentomodule_image_optimization_recv';
const IMAGE_SETTING_NAME = self::FASTLY_MAGENTO_MODULE.'_image_optimization_recv';

/**
* Force TLS snippet path
Expand All @@ -145,12 +145,12 @@ class Config extends \Magento\PageCache\Model\Config
/**
* Force TLS setting name
*/
const FORCE_TLS_SETTING_NAME = 'magentomodule_force_tls_recv';
const FORCE_TLS_SETTING_NAME = self::FASTLY_MAGENTO_MODULE.'_force_tls_recv';

/**
* Configure Dictionary name
*/
const CONFIG_DICTIONARY_NAME = 'magentomodule_config';
const CONFIG_DICTIONARY_NAME = self::FASTLY_MAGENTO_MODULE.'_config';

/**
* Maintenance Allowlist name
Expand Down Expand Up @@ -477,6 +477,9 @@ class Config extends \Magento\PageCache\Model\Config
const XML_FASTLY_CRAWLER_RATE_LIMITING_TTL
= 'system/full_page_cache/fastly/fastly_rate_limiting_settings/crawler_protection/crawler_rate_limiting_ttl';

/**
* XML path to Exempt Good Bots flag
*/
const XML_FASTLY_EXEMPT_GOOD_BOTS
= 'system/full_page_cache/fastly/fastly_rate_limiting_settings/crawler_protection/exempt_good_bots';

Expand Down
10 changes: 8 additions & 2 deletions view/adminhtml/web/js/modly.js
Original file line number Diff line number Diff line change
Expand Up @@ -703,9 +703,9 @@ define([
$('body').on('click', 'button.fastly-edit-active-modules-icon', function () {
let module_id = $(this).data('module-id');
let properties = [];
let fieldset = $('<div class="admin__fieldset form-list modly-group">');
let message = $('<div class="message"></div>');
let title = '';
let groups = [];

// call getModule data function to retrieve a specific module's data
getModuleData(module_id).done(function (response) {
Expand Down Expand Up @@ -748,15 +748,19 @@ define([
// for each group data property
$.each(groupData, function (groupIndex, groupValues) {
// for each manifest defined config property, render fields with group values
let fieldset = $('<div class="admin__fieldset form-list modly-group"></div>');
$.each(property.properties, function (propertyIndex, propertyValues) {
fieldset.append(renderFields(propertyValues, groupValues, active_version));
});
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>');
fieldset.append('<div class="admin__field field"><div class="admin__field-label"></div><div class="admin__field-control"><hr></div></div></div>');
groups.push(fieldset);
});
});
} else {
let fieldset = $('<div class="admin__fieldset form-list modly-group"></div>');
fieldset.append(renderFields(property, parsedValues[0], active_version));
groups.push(fieldset);
}
});
}
Expand All @@ -767,7 +771,9 @@ define([
setServiceLabel(active_version, next_version, service_name);
$('.module-messages').prepend(message);
let question = $('.question');
question.append(fieldset);
$.each(groups, function (grIndex, grData) {
question.append(grData);
});
$('.modal-title').html(title);
$('#module-id').val(module_id);
let groupBtn = '<button class="action-secondary group-button" type="button" data-role="action"><span>Add group</span></button>';
Expand Down