diff --git a/Controller/Adminhtml/FastlyCdn/Edge/Dictionary/ListAll.php b/Controller/Adminhtml/FastlyCdn/Edge/Dictionary/ListAll.php index e65ddc07..74a57afc 100644 --- a/Controller/Adminhtml/FastlyCdn/Edge/Dictionary/ListAll.php +++ b/Controller/Adminhtml/FastlyCdn/Edge/Dictionary/ListAll.php @@ -35,6 +35,8 @@ class ListAll extends Action { const ADMIN_RESOURCE = 'Magento_Config::config'; + const NGWAF_DICTIONARY_NAME = "Edge_Security"; + /** * @var Http */ @@ -96,6 +98,14 @@ public function execute() ]); } + // This dictionary represents NGWAF, used while migrating customers from WAF. Adobe is requesting that + // their customers shouldn't be able to disable it, so we remove it from Admin listing. + foreach ($dictionaries as $key => $dictionary) { + if (isset($dictionary->name) && $dictionary->name === self::NGWAF_DICTIONARY_NAME) { + array_splice($dictionaries, $key, 1); + } + } + return $result->setData([ 'status' => true, 'dictionaries' => $dictionaries diff --git a/view/adminhtml/web/js/edge-dictionaries.js b/view/adminhtml/web/js/edge-dictionaries.js index 4f1f74f7..81b10502 100644 --- a/view/adminhtml/web/js/edge-dictionaries.js +++ b/view/adminhtml/web/js/edge-dictionaries.js @@ -72,13 +72,11 @@ define([ listDictionaries(active_version, false).done(function (response) { $('.loading-dictionaries').hide(); if (response.status !== false) { - if (response.status !== false) { - if (response.dictionaries.length > 0) { - dictionaries = response.dictionaries; - processDictionaries(response.dictionaries); - } else { - $('.no-dictionaries').show(); - } + if (response.dictionaries.length > 0) { + dictionaries = response.dictionaries; + processDictionaries(response.dictionaries); + } else { + $('.no-dictionaries').show(); } } }).fail(function () {