From f0edf956dcba80dad6973ecc31af2a9c61d8460d Mon Sep 17 00:00:00 2001 From: Evgenii Kolosov <108291208+Ljutyj@users.noreply.github.com> Date: Tue, 12 Nov 2024 11:18:17 +0300 Subject: [PATCH] VCST-2164: Impelemented Reset cache button (#2857) feat: Reset cache button at the Settings blade calls a reset method on the backend side. Co-authored-by: Oleg Zhuk Co-authored-by: Maria-Volkova-Tula <106367190+Maria-Volkova-Tula@users.noreply.github.com> Co-authored-by: Kutasina Elena <62027488+ekuvirto@users.noreply.github.com> --- .../npm-shrinkwrap.json | 55 ++++++++++++------- src/VirtoCommerce.Platform.Web/package.json | 2 +- .../de.VirtoCommerce.Platform.json | 13 +++-- .../en.VirtoCommerce.Platform.json | 11 +++- .../es.VirtoCommerce.Platform.json | 13 +++-- .../fr.VirtoCommerce.Platform.json | 11 +++- .../it.VirtoCommerce.Platform.json | 11 +++- .../ja.VirtoCommerce.Platform.json | 11 +++- .../pl.VirtoCommerce.Platform.json | 13 +++-- .../pt.VirtoCommerce.Platform.json | 11 +++- .../ru.VirtoCommerce.Platform.json | 11 +++- .../zh.VirtoCommerce.Platform.json | 11 +++- .../js/app/changeLog/resources/changeLog.js | 3 +- .../app/settings/blades/settingGroup-list.js | 4 +- .../wwwroot/js/app/settings/settings.js | 38 ++++++++----- 15 files changed, 147 insertions(+), 71 deletions(-) diff --git a/src/VirtoCommerce.Platform.Web/npm-shrinkwrap.json b/src/VirtoCommerce.Platform.Web/npm-shrinkwrap.json index 290e9f52185..495c74e7010 100644 --- a/src/VirtoCommerce.Platform.Web/npm-shrinkwrap.json +++ b/src/VirtoCommerce.Platform.Web/npm-shrinkwrap.json @@ -64,7 +64,7 @@ "path": "~0.12.7", "sass": "~1.58.3", "sass-loader": "~12.6.0", - "webpack": "^5.68.0", + "webpack": "^5.96.1", "webpack-cli": "^4.10.0" } }, @@ -160,6 +160,28 @@ "resolved": "https://registry.npmjs.org/@types/angular/-/angular-1.8.4.tgz", "integrity": "sha512-wPS/ncJWhyxJsndsW1B6Ta8D4mi97x1yItSu+rkLDytU3oRIh2CFAjMuJceYwFAh9+DIohndWM0QBA9OU2Hv0g==" }, + "node_modules/@types/eslint": { + "version": "9.6.1", + "resolved": "https://registry.npmjs.org/@types/eslint/-/eslint-9.6.1.tgz", + "integrity": "sha512-FXx2pKgId/WyYo2jXw63kk7/+TY7u7AziEJxJAnSFzHlqTAS3Ync6SvgYAN/k4/PQpnnVuzoMuVnByKK2qp0ag==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/estree": "*", + "@types/json-schema": "*" + } + }, + "node_modules/@types/eslint-scope": { + "version": "3.7.7", + "resolved": "https://registry.npmjs.org/@types/eslint-scope/-/eslint-scope-3.7.7.tgz", + "integrity": "sha512-MzMFlSLBqNF2gcHWO0G1vP/YQyfvrxZ0bF+u7mzUdZ1/xK4A4sru+nraZz5i3iEIk1l1uyicaDVTB4QbbEkAYg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/eslint": "*", + "@types/estree": "*" + } + }, "node_modules/@types/estree": { "version": "1.0.6", "resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.6.tgz", @@ -521,10 +543,11 @@ "integrity": "sha512-NuHqBY1PB/D8xU6s/thBgOAiAP7HOYDQ32+BFZILJ8ivkUkAHQnWfn6WhL79Owj1qmUnoN/YPhktdIoucipkAQ==" }, "node_modules/acorn": { - "version": "8.13.0", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.13.0.tgz", - "integrity": "sha512-8zSiw54Oxrdym50NlZ9sUusyO1Z1ZchgRLWRaK6c86XJFClyCgFKetdowBg5bKxyp/u+CDBJG4Mpp0m3HLZl9w==", + "version": "8.14.0", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.14.0.tgz", + "integrity": "sha512-cl669nCJTZBsL97OF4kUQm5g5hC2uihk0NxY3WENAC0TYdILVkAyHymAntgxGkl7K+t0cXIrH5siy5S4XkFycA==", "dev": true, + "license": "MIT", "bin": { "acorn": "bin/acorn" }, @@ -532,15 +555,6 @@ "node": ">=0.4.0" } }, - "node_modules/acorn-import-attributes": { - "version": "1.9.5", - "resolved": "https://registry.npmjs.org/acorn-import-attributes/-/acorn-import-attributes-1.9.5.tgz", - "integrity": "sha512-n02Vykv5uA3eHGM/Z2dQrcD56kL8TyDb2p1+0P83PClMnC/nc+anbQRhIOWnSq4Ke/KvDPrY3C9hDtC/A3eHnQ==", - "dev": true, - "peerDependencies": { - "acorn": "^8" - } - }, "node_modules/ajv": { "version": "6.12.6", "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz", @@ -6201,18 +6215,19 @@ } }, "node_modules/webpack": { - "version": "5.95.0", - "resolved": "https://registry.npmjs.org/webpack/-/webpack-5.95.0.tgz", - "integrity": "sha512-2t3XstrKULz41MNMBF+cJ97TyHdyQ8HCt//pqErqDvNjU9YQBnZxIHa11VXsi7F3mb5/aO2tuDxdeTPdU7xu9Q==", + "version": "5.96.1", + "resolved": "https://registry.npmjs.org/webpack/-/webpack-5.96.1.tgz", + "integrity": "sha512-l2LlBSvVZGhL4ZrPwyr8+37AunkcYj5qh8o6u2/2rzoPc8gxFJkLj1WxNgooi9pnoc06jh0BjuXnamM4qlujZA==", "dev": true, + "license": "MIT", "dependencies": { - "@types/estree": "^1.0.5", + "@types/eslint-scope": "^3.7.7", + "@types/estree": "^1.0.6", "@webassemblyjs/ast": "^1.12.1", "@webassemblyjs/wasm-edit": "^1.12.1", "@webassemblyjs/wasm-parser": "^1.12.1", - "acorn": "^8.7.1", - "acorn-import-attributes": "^1.9.5", - "browserslist": "^4.21.10", + "acorn": "^8.14.0", + "browserslist": "^4.24.0", "chrome-trace-event": "^1.0.2", "enhanced-resolve": "^5.17.1", "es-module-lexer": "^1.2.1", diff --git a/src/VirtoCommerce.Platform.Web/package.json b/src/VirtoCommerce.Platform.Web/package.json index 0d236377c0e..71806f4f763 100644 --- a/src/VirtoCommerce.Platform.Web/package.json +++ b/src/VirtoCommerce.Platform.Web/package.json @@ -16,7 +16,7 @@ "path": "~0.12.7", "sass": "~1.58.3", "sass-loader": "~12.6.0", - "webpack": "^5.68.0", + "webpack": "^5.96.1", "webpack-cli": "^4.10.0" }, "dependencies": { diff --git a/src/VirtoCommerce.Platform.Web/wwwroot/Localizations/de.VirtoCommerce.Platform.json b/src/VirtoCommerce.Platform.Web/wwwroot/Localizations/de.VirtoCommerce.Platform.json index a67a03f59b7..de1864f0c28 100644 --- a/src/VirtoCommerce.Platform.Web/wwwroot/Localizations/de.VirtoCommerce.Platform.json +++ b/src/VirtoCommerce.Platform.Web/wwwroot/Localizations/de.VirtoCommerce.Platform.json @@ -880,14 +880,19 @@ "create-folder": { "title": "Ein Ordnername muss den folgenden Benennungsregeln entsprechen:\n Der Ordnername muss zwischen 3 und 63 Zeichen lang sein.\n Der Ordnername muss mit einem Buchstaben oder einer Zahl beginnen und darf nur Buchstaben, Zahlen und Bindestriche (-) enthalten.\n Jeder Bindestrich (-) muss unmittelbar vor und nach einem Buchstaben oder einer Zahl stehen; aufeinanderfolgende Bindestriche sind nicht erlaubt.\n Alle Buchstaben in einem Ordnernamen müssen klein geschrieben sein" }, - "storefront-cache-reset-successfully": { - "title": "Cache zurückgesetzt", - "message": "Der Cache der Frontend-Anwendung wurde erfolgreich zurückgesetzt" + "storefront-cache-reset": { + "title": "Cache zurücksetzen", + "confirm-reset-message": "Sind Sie sicher, dass Sie den Cache zurücksetzen möchten? Diese Aktion löscht alle zwischengespeicherten Daten und kann die Systemleistung vorübergehend beeinträchtigen. Bestätigen Sie, um fortzufahren", + "reset-successfully-message": "Der Cache der Frontend-Anwendung wurde erfolgreich zurückgesetzt" } }, "commands": { "login-on-behalf": "Im Namen von anmelden", - "reset-storefront-cache": "Cache zurücksetzen" + "reset-storefront-cache": { + "title": "Frontend-Anwendungs-Cache zurücksetzen", + "name": "Cache zurücksetzen" + }, + "restart-application-title": "Anwendung neu starten" } }, "permissions": { diff --git a/src/VirtoCommerce.Platform.Web/wwwroot/Localizations/en.VirtoCommerce.Platform.json b/src/VirtoCommerce.Platform.Web/wwwroot/Localizations/en.VirtoCommerce.Platform.json index 881815fd060..8933b633ba2 100644 --- a/src/VirtoCommerce.Platform.Web/wwwroot/Localizations/en.VirtoCommerce.Platform.json +++ b/src/VirtoCommerce.Platform.Web/wwwroot/Localizations/en.VirtoCommerce.Platform.json @@ -879,14 +879,19 @@ "create-folder": { "title": "A folder name must conform to the following naming rules:\n Folder name must be between 3 and 63 characters long.\n Folder name must start with a letter or number, and can only contain letters, numbers, and hyphen (-).\n Each hyphen (-) must be immediately preceded and followed by a letter or number; consecutive hyphens are not permitted.\n All letters in a folder name must be lower case" }, - "storefront-cache-reset-successfully": { + "storefront-cache-reset": { "title": "Cache reset", - "message": "Frontend Application cache has been reset successfully" + "confirm-reset-message": "Are you sure you want to reset the cache? This action will clear all cached data and may temporarily affect system performance. Confirm to proceed", + "reset-successfully-message": "Frontend Application cache has been reset successfully" } }, "commands": { "login-on-behalf": "Login on behalf", - "reset-storefront-cache": "Reset cache" + "reset-storefront-cache": { + "title": "Reset Frontend Application cache", + "name": "Reset cache" + }, + "restart-application-title": "Restart application" } }, "permissions": { diff --git a/src/VirtoCommerce.Platform.Web/wwwroot/Localizations/es.VirtoCommerce.Platform.json b/src/VirtoCommerce.Platform.Web/wwwroot/Localizations/es.VirtoCommerce.Platform.json index 38c64684891..ea9be049d90 100644 --- a/src/VirtoCommerce.Platform.Web/wwwroot/Localizations/es.VirtoCommerce.Platform.json +++ b/src/VirtoCommerce.Platform.Web/wwwroot/Localizations/es.VirtoCommerce.Platform.json @@ -878,14 +878,19 @@ "create-folder": { "title": "El nombre de una carpeta debe cumplir con las siguientes reglas de nomenclatura:\n El nombre de la carpeta debe tener entre 3 y 63 caracteres de longitud.\n El nombre de la carpeta debe comenzar con una letra o número, y solo puede contener letras, números y guiones (-).\n Cada guion (-) debe estar inmediatamente precedido y seguido por una letra o número; no se permiten guiones consecutivos.\n Todas las letras en el nombre de una carpeta deben estar en minúsculas" }, - "storefront-cache-reset-successfully": { - "title": "Reinicio de caché", - "message": "El caché de la aplicación de la tienda se ha reiniciado con éxito" + "storefront-cache-reset": { + "title": "Restablecer caché", + "confirm-reset-message": "¿Está seguro de que desea restablecer la caché? Esta acción borrará todos los datos almacenados en caché y puede afectar temporalmente el rendimiento del sistema. Confirme para continuar", + "reset-successfully-message": "La caché de la aplicación frontend se ha restablecido con éxito" } }, "commands": { "login-on-behalf": "Iniciar sesión en nombre de", - "reset-storefront-cache": "Reiniciar caché" + "reset-storefront-cache": { + "title": "Restablecer caché de la aplicación frontend", + "name": "Restablecer caché" + }, + "restart-application-title": "Reinicia la aplicación" } }, "permissions": { diff --git a/src/VirtoCommerce.Platform.Web/wwwroot/Localizations/fr.VirtoCommerce.Platform.json b/src/VirtoCommerce.Platform.Web/wwwroot/Localizations/fr.VirtoCommerce.Platform.json index 5d45ad56aaa..32194be5e0f 100644 --- a/src/VirtoCommerce.Platform.Web/wwwroot/Localizations/fr.VirtoCommerce.Platform.json +++ b/src/VirtoCommerce.Platform.Web/wwwroot/Localizations/fr.VirtoCommerce.Platform.json @@ -878,14 +878,19 @@ "create-folder": { "title": "Le nom d'un dossier doit respecter les règles de nommage suivantes :\n Le nom du dossier doit comporter entre 3 et 63 caractères.\n Le nom du dossier doit commencer par une lettre ou un chiffre et ne peut contenir que des lettres, des chiffres et des traits d'union (-).\n Chaque trait d'union (-) doit être immédiatement précédé et suivi d'une lettre ou d'un chiffre ; les traits d'union consécutifs ne sont pas autorisés.\n Toutes les lettres d'un nom de dossier doivent être en minuscules" }, - "storefront-cache-reset-successfully": { + "storefront-cache-reset": { "title": "Réinitialisation du cache", - "message": "Le cache de l'application frontale a été réinitialisé avec succès" + "confirm-reset-message": "Êtes-vous sûr de vouloir réinitialiser le cache? Cette action effacera toutes les données mises en cache et peut affecter temporairement les performances du système. Veuillez confirmer pour continuer", + "reset-successfully-message": "Le cache de l'application frontale a été réinitialisé avec succès" } }, "commands": { "login-on-behalf": "Se connecter au nom de", - "reset-storefront-cache": "Réinitialiser le cache" + "reset-storefront-cache": { + "title": "Réinitialiser le cache de l'application frontale", + "name": "Réinitialiser le cache" + }, + "restart-application-title": "Redémarrez l'application" } }, "permissions": { diff --git a/src/VirtoCommerce.Platform.Web/wwwroot/Localizations/it.VirtoCommerce.Platform.json b/src/VirtoCommerce.Platform.Web/wwwroot/Localizations/it.VirtoCommerce.Platform.json index 0911ec0539b..afa649aa2d6 100644 --- a/src/VirtoCommerce.Platform.Web/wwwroot/Localizations/it.VirtoCommerce.Platform.json +++ b/src/VirtoCommerce.Platform.Web/wwwroot/Localizations/it.VirtoCommerce.Platform.json @@ -878,14 +878,19 @@ "create-folder": { "title": "Il nome di una cartella deve rispettare le seguenti regole di denominazione:\n Il nome della cartella deve essere compreso tra 3 e 63 caratteri.\n Il nome della cartella deve iniziare con una lettera o un numero e può contenere solo lettere, numeri e trattini (-).\n Ogni trattino (-) deve essere immediatamente preceduto e seguito da una lettera o un numero; non sono consentiti trattini consecutivi.\n Tutte le lettere nel nome di una cartella devono essere minuscole" }, - "storefront-cache-reset-successfully": { + "storefront-cache-reset": { "title": "Reset della cache", - "message": "La cache dell'applicazione frontend è stata resettata con successo" + "confirm-reset-message": "Sei sicuro di voler resettare la cache? Questa azione cancellerà tutti i dati memorizzati nella cache e potrebbe influire temporaneamente sulle prestazioni del sistema. Conferma per procedere", + "reset-successfully-message": "La cache dell'applicazione frontend è stata resettata con successo" } }, "commands": { "login-on-behalf": "Accedi per conto di", - "reset-storefront-cache": "Resetta cache" + "reset-storefront-cache": { + "title": "Reset della cache dell'applicazione frontend", + "name": "Reset della cache" + }, + "restart-application-title": "Riavvia l'applicazione" } }, "permissions": { diff --git a/src/VirtoCommerce.Platform.Web/wwwroot/Localizations/ja.VirtoCommerce.Platform.json b/src/VirtoCommerce.Platform.Web/wwwroot/Localizations/ja.VirtoCommerce.Platform.json index 691874cb162..6c122907741 100644 --- a/src/VirtoCommerce.Platform.Web/wwwroot/Localizations/ja.VirtoCommerce.Platform.json +++ b/src/VirtoCommerce.Platform.Web/wwwroot/Localizations/ja.VirtoCommerce.Platform.json @@ -878,14 +878,19 @@ "create-folder": { "title": "フォルダ名は以下の命名規則に従う必要があります:\n フォルダ名は3文字以上63文字以下である必要があります。\n フォルダ名は文字または数字で始まり、文字、数字、ハイフン(-)のみを含むことができます。\n 各ハイフン(-)の前後には文字または数字が必要です。連続したハイフンは使用できません。\n フォルダ名のすべての文字は小文字である必要があります" }, - "storefront-cache-reset-successfully": { + "storefront-cache-reset": { "title": "キャッシュのリセット", - "message": "フロントエンドアプリケーションのキャッシュが正常にリセットされました" + "confirm-reset-message": "キャッシュをリセットしてもよろしいですか? この操作により、キャッシュされたすべてのデータが消去され、システムのパフォーマンスに一時的に影響する可能性があります。 続行するには確認してください", + "reset-successfully-message": "フロントエンドアプリケーションのキャッシュが正常にリセットされました" } }, "commands": { "login-on-behalf": "代理ログイン", - "reset-storefront-cache": "キャッシュのリセット" + "reset-storefront-cache": { + "title": "フロントエンドアプリケーションキャッシュをリセットする", + "name": "キャッシュのリセット" + }, + "restart-application-title": "アプリケーションを再起動します" } }, "permissions": { diff --git a/src/VirtoCommerce.Platform.Web/wwwroot/Localizations/pl.VirtoCommerce.Platform.json b/src/VirtoCommerce.Platform.Web/wwwroot/Localizations/pl.VirtoCommerce.Platform.json index 24e31350334..3c9bd53a7a3 100644 --- a/src/VirtoCommerce.Platform.Web/wwwroot/Localizations/pl.VirtoCommerce.Platform.json +++ b/src/VirtoCommerce.Platform.Web/wwwroot/Localizations/pl.VirtoCommerce.Platform.json @@ -878,14 +878,19 @@ "create-folder": { "title": "Nazwa folderu musi być zgodna z następującymi zasadami nazewnictwa:\n Nazwa folderu musi mieć od 3 do 63 znaków.\n Nazwa folderu musi zaczynać się od litery lub cyfry i może zawierać tylko litery, cyfry i myślnik (-).\n Każdy myślnik (-) musi być bezpośrednio poprzedzony i następowany przez literę lub cyfrę; kolejne myślniki są niedozwolone.\n Wszystkie litery w nazwie folderu muszą być małe" }, - "storefront-cache-reset-successfully": { - "title": "Reset pamięci podręcznej", - "message": "Pamięć podręczna aplikacji frontendowej została pomyślnie zresetowana" + "storefront-cache-reset": { + "title": "Zresetuj pamięć podręczną", + "confirm-reset-message": "Czy na pewno chcesz zresetować pamięć podręczną? Ta czynność spowoduje wyczyszczenie wszystkich buforowanych danych i może tymczasowo wpłynąć na wydajność systemu. Potwierdź, aby kontynuować", + "reset-successfully-message": "Pamięć podręczna aplikacji frontendowej została pomyślnie zresetowana" } }, "commands": { "login-on-behalf": "Zaloguj się w imieniu", - "reset-storefront-cache": "Zresetuj pamięć podręczną" + "reset-storefront-cache": { + "title": "Zresetuj pamięć podręczną aplikacji frontendowej", + "name": "Zresetuj pamięć podręczn" + }, + "restart-application-title": "Uruchom ponownie aplikację" } }, "permissions": { diff --git a/src/VirtoCommerce.Platform.Web/wwwroot/Localizations/pt.VirtoCommerce.Platform.json b/src/VirtoCommerce.Platform.Web/wwwroot/Localizations/pt.VirtoCommerce.Platform.json index 9789a4e954d..0147ea73fbe 100644 --- a/src/VirtoCommerce.Platform.Web/wwwroot/Localizations/pt.VirtoCommerce.Platform.json +++ b/src/VirtoCommerce.Platform.Web/wwwroot/Localizations/pt.VirtoCommerce.Platform.json @@ -878,14 +878,19 @@ "create-folder": { "title": "O nome da pasta deve estar em conformidade com as seguintes regras de nomenclatura:\n O nome da pasta deve ter entre 3 e 63 caracteres.\n O nome da pasta deve começar com uma letra ou número e pode conter apenas letras, números e hífen (-).\n Cada hífen (-) deve ser imediatamente precedido e seguido por uma letra ou número; hífens consecutivos não são permitidos.\n Todas as letras no nome da pasta devem ser minúsculas" }, - "storefront-cache-reset-successfully": { + "storefront-cache-reset": { "title": "Cache redefinido", - "message": "O cache da aplicação frontend foi redefinido com sucesso" + "confirm-reset-message": "Tem certeza de que deseja redefinir o cache? Esta ação limpará todos os dados armazenados em cache e poderá afetar temporariamente o desempenho do sistema. Confirme para prosseguir", + "reset-successfully-message": "O cache da aplicação frontend foi redefinido com sucess" } }, "commands": { "login-on-behalf": "Login em nome de", - "reset-storefront-cache": "Redefinir cache" + "reset-storefront-cache": { + "title": "Redefinir o cache da aplicação frontend", + "name": "Redefinir cache" + }, + "restart-application-title": "Reinicie a aplicação" } }, "permissions": { diff --git a/src/VirtoCommerce.Platform.Web/wwwroot/Localizations/ru.VirtoCommerce.Platform.json b/src/VirtoCommerce.Platform.Web/wwwroot/Localizations/ru.VirtoCommerce.Platform.json index 326fb814541..04ed3151105 100644 --- a/src/VirtoCommerce.Platform.Web/wwwroot/Localizations/ru.VirtoCommerce.Platform.json +++ b/src/VirtoCommerce.Platform.Web/wwwroot/Localizations/ru.VirtoCommerce.Platform.json @@ -880,14 +880,19 @@ "create-folder": { "title": "Имя папки должно соответствовать следующим правилам именования:\n Имя папки должно быть длиной от 3 до 63 символов.\n Имя папки должно начинаться с буквы или цифры и может содержать только буквы, цифры и дефис (-).\n Каждый дефис (-) должен непосредственно предшествовать букве или цифре и следовать за ней; последовательные дефисы не допускаются.\n Все буквы в имени папки должны быть в нижнем регистре" }, - "storefront-cache-reset-successfully": { + "storefront-cache-reset": { "title": "Сброс кэша", - "message": "Кэш фронтенд-приложения был успешно сброшен" + "confirm-reset-message": "Вы действительно хотите сбросить кэш? Это действие очистит все закешированные данные и может временно повлиять на производительность системы. Пожалуйста, подтвердите свое решение для продолжения", + "reset-successfully-message": "Кэш фронтенд-приложения был успешно сброшен" } }, "commands": { "login-on-behalf": "Войти от имени", - "reset-storefront-cache": "Сбросить кэш" + "reset-storefront-cache": { + "title": "Сбросить кэш фронтенд-приложения", + "name": "Сбросить кэш" + }, + "restart-application-title": "Перезапустить приложение" } }, "permissions": { diff --git a/src/VirtoCommerce.Platform.Web/wwwroot/Localizations/zh.VirtoCommerce.Platform.json b/src/VirtoCommerce.Platform.Web/wwwroot/Localizations/zh.VirtoCommerce.Platform.json index 9c71951e0ef..545e81cdb7c 100644 --- a/src/VirtoCommerce.Platform.Web/wwwroot/Localizations/zh.VirtoCommerce.Platform.json +++ b/src/VirtoCommerce.Platform.Web/wwwroot/Localizations/zh.VirtoCommerce.Platform.json @@ -878,14 +878,19 @@ "create-folder": { "title": "文件夹名称必须符合以下命名规则:\n 文件夹名称长度必须在 3 到 63 个字符之间。\n 文件夹名称必须以字母或数字开头,只能包含字母、数字和连字符(-)。\n 每个连字符(-)的前后必须紧跟字母或数字;不允许连续的连字符。\n 文件夹名称中的所有字母必须是小写" }, - "storefront-cache-reset-successfully": { + "storefront-cache-reset": { "title": "缓存重置", - "message": "前端应用程序缓存已成功重置" + "confirm-reset-message": "确定要重置缓存吗? 此操作将清除所有缓存的数据,并可能暂时影响系统性能。 确认继续", + "reset-successfully-message": "前端应用程序缓存已成功重置" } }, "commands": { "login-on-behalf": "代表登录", - "reset-storefront-cache": "重置缓存" + "reset-storefront-cache": { + "title": "重置前端应用程序缓存", + "name": "重置缓存" + }, + "restart-application-title": "重新启动应用程序" } }, "permissions": { diff --git a/src/VirtoCommerce.Platform.Web/wwwroot/js/app/changeLog/resources/changeLog.js b/src/VirtoCommerce.Platform.Web/wwwroot/js/app/changeLog/resources/changeLog.js index fa2d0d2c7d4..b2d03fd62ee 100644 --- a/src/VirtoCommerce.Platform.Web/wwwroot/js/app/changeLog/resources/changeLog.js +++ b/src/VirtoCommerce.Platform.Web/wwwroot/js/app/changeLog/resources/changeLog.js @@ -1,6 +1,7 @@ angular.module('platformWebApp').factory('platformWebApp.changeLogApi', ['$resource', function ($resource) { return $resource('api/platform/changelog', {}, { search: { method: 'POST', url: 'api/platform/changelog/search', isArray: true }, - forceChanges: { method: 'POST', url: 'api/changes/force' } + forceChanges: { method: 'POST', url: 'api/changes/force' }, + resetPlatformCache: { method: 'POST', url: 'api/platform-cache/reset' } }); }]); diff --git a/src/VirtoCommerce.Platform.Web/wwwroot/js/app/settings/blades/settingGroup-list.js b/src/VirtoCommerce.Platform.Web/wwwroot/js/app/settings/blades/settingGroup-list.js index 89b2dec635e..7a2e39059df 100644 --- a/src/VirtoCommerce.Platform.Web/wwwroot/js/app/settings/blades/settingGroup-list.js +++ b/src/VirtoCommerce.Platform.Web/wwwroot/js/app/settings/blades/settingGroup-list.js @@ -147,7 +147,9 @@ angular.module('platformWebApp') blade.toolbarCommands = [ { - name: "platform.commands.restart", icon: 'fa fa-bolt', + name: "platform.commands.restart", + title: "platform.commands.restart-application-title", + icon: 'fa fa-bolt', executeMethod: function () { restart(); }, canExecuteMethod: function () { return !blade.isLoading; }, permission: 'platform:module:manage' diff --git a/src/VirtoCommerce.Platform.Web/wwwroot/js/app/settings/settings.js b/src/VirtoCommerce.Platform.Web/wwwroot/js/app/settings/settings.js index ecc330cbf31..316229dd0d2 100644 --- a/src/VirtoCommerce.Platform.Web/wwwroot/js/app/settings/settings.js +++ b/src/VirtoCommerce.Platform.Web/wwwroot/js/app/settings/settings.js @@ -55,24 +55,32 @@ angular.module("platformWebApp") // Add 'Reset cache' command to settings blade var resetCacheCommand = { - name: 'platform.commands.reset-storefront-cache', + name: 'platform.commands.reset-storefront-cache.name', + title: 'platform.commands.reset-storefront-cache.title', icon: 'fa fa-eraser', executeMethod: function (blade) { - blade.isLoading = true; - - changeLogApi.forceChanges({}, function () { - blade.isLoading = false; - - var dialog = { - id: "cacheResetDialog", - title: 'platform.dialogs.storefront-cache-reset-successfully.title', - message: 'platform.dialogs.storefront-cache-reset-successfully.message' - }; - dialogService.showSuccessDialog(dialog); - }); - + var confirmDialog = { + id: "confirmCacheResetDialog", + title: "platform.dialogs.storefront-cache-reset.title", + message: "platform.dialogs.storefront-cache-reset.confirm-reset-message", + callback: function (confirm) { + if (confirm) { + blade.isLoading = true; + changeLogApi.resetPlatformCache({}, function () { + blade.isLoading = false; + var successDialog = { + id: "successCacheResetDialog", + title: "platform.dialogs.storefront-cache-reset.title", + message: "platform.dialogs.storefront-cache-reset.reset-successfully-message", + }; + dialogService.showSuccessDialog(successDialog); + }); + } + } + } + dialogService.showWarningDialog(confirmDialog); }, - canExecuteMethod: function () { return true; }, + canExecuteMethod: function (blade) { return !blade.isLoading; }, permission: 'cache:reset', index: 2 };