diff --git a/BTCPayServer.Tests/SeleniumTests.cs b/BTCPayServer.Tests/SeleniumTests.cs index 491fb5624..fdb4c9155 100644 --- a/BTCPayServer.Tests/SeleniumTests.cs +++ b/BTCPayServer.Tests/SeleniumTests.cs @@ -855,8 +855,7 @@ namespace BTCPayServer.Tests s.GoToStore(StoreNavPages.Emails); s.Driver.FindElement(By.Id("ConfigureEmailRules")).Click(); Assert.Contains("There are no rules yet.", s.Driver.PageSource); - // by default selenium tests setup email server settings - Assert.DoesNotContain("You need to configure email settings before this feature works", s.Driver.PageSource); + Assert.Contains("You need to configure email settings before this feature works", s.Driver.PageSource); // invoice created rule s.Driver.FindElement(By.Id("CreateEmailRule")).Click(); @@ -906,13 +905,11 @@ namespace BTCPayServer.Tests Assert.True(deleteLinks.Count == 2, "Expected exactly two delete buttons but found a different number."); deleteLinks[0].Click(); - s.Driver.SwitchTo().Alert().Accept(); // Confirm the delete deleteLinks = s.Driver.FindElements(By.XPath("//a[contains(text(), 'Delete')]")); // Refresh list Assert.True(deleteLinks.Count == 1, "Expected one delete button remaining."); deleteLinks[0].Click(); - s.Driver.SwitchTo().Alert().Accept(); // Confirm the second delete // Validate that there are no more rules Assert.Contains("There are no rules yet.", s.Driver.PageSource); @@ -3960,7 +3957,6 @@ retry: s.Server.ActivateLightning(); await s.StartAsync(); await s.Server.EnsureChannelsSetup(); - var storeSettingsPaths = new [] {"settings", "rates", "checkout", "tokens", "users", "roles", "webhooks", "payout-processors", "payout-processors/onchain-automated/BTC", "payout-processors/lightning-automated/BTC", "emails", "email-settings", "forms"}; // Setup user, store and wallets s.RegisterNewUser(); @@ -3993,6 +3989,10 @@ retry: s.AssertPageAccess(false, GetStorePath("lightning/BTC")); s.AssertPageAccess(false, GetStorePath("lightning/BTC/settings")); s.AssertPageAccess(false, GetStorePath("apps/create")); + + var storeSettingsPaths = new [] {"settings", "rates", "checkout", "tokens", "users", "roles", "webhooks", + "payout-processors", "payout-processors/onchain-automated/BTC", "payout-processors/lightning-automated/BTC", + "emails/rules", "email-settings", "forms"}; foreach (var path in storeSettingsPaths) { // should have view access to settings, but no submit buttons or create links TestLogs.LogInformation($"Checking access to store page {path} as admin"); @@ -4013,7 +4013,8 @@ retry: s.Server.ActivateLightning(); await s.StartAsync(); await s.Server.EnsureChannelsSetup(); - var storeSettingsPaths = new [] {"settings", "rates", "checkout", "tokens", "users", "roles", "webhooks", "payout-processors", "payout-processors/onchain-automated/BTC", "payout-processors/lightning-automated/BTC", "emails", "email-settings", "forms"}; + var storeSettingsPaths = new [] {"settings", "rates", "checkout", "tokens", "users", "roles", "webhooks", "payout-processors", + "payout-processors/onchain-automated/BTC", "payout-processors/lightning-automated/BTC", "emails/rules", "email-settings", "forms"}; // Setup users var manager = s.RegisterNewUser(); diff --git a/BTCPayServer/Services/Translations.Default.cs b/BTCPayServer/Services/Translations.Default.cs index 77d434cff..47a536c28 100644 --- a/BTCPayServer/Services/Translations.Default.cs +++ b/BTCPayServer/Services/Translations.Default.cs @@ -523,6 +523,8 @@ namespace BTCPayServer.Services "Email password reset functionality is not configured for this server. Please contact the server administrator to assist with account recovery.": "", "email rules": "", "Email Rules": "", + "Create Email Rule": "", + "Edit Email Rule": "", "Email rules allow BTCPay Server to send customized emails from your store based on events.": "", "Email sent to {0}. Please verify you received it.": "", "Email Server": "", diff --git a/BTCPayServer/Views/UIStores/StoreEmailRulesList.cshtml b/BTCPayServer/Views/UIStores/StoreEmailRulesList.cshtml index 250e64c67..9c5d2750b 100644 --- a/BTCPayServer/Views/UIStores/StoreEmailRulesList.cshtml +++ b/BTCPayServer/Views/UIStores/StoreEmailRulesList.cshtml @@ -53,7 +53,7 @@ Edit -
- Delete + Delete
diff --git a/BTCPayServer/Views/UIStores/StoreEmailRulesManage.cshtml b/BTCPayServer/Views/UIStores/StoreEmailRulesManage.cshtml index 12d8fc5bd..a2fed01ed 100644 --- a/BTCPayServer/Views/UIStores/StoreEmailRulesManage.cshtml +++ b/BTCPayServer/Views/UIStores/StoreEmailRulesManage.cshtml @@ -6,7 +6,7 @@ @{ var storeId = Context.GetStoreData().Id; bool isEdit = Model.Trigger != null; - ViewData["Title"] = isEdit ? "Edit Store Email Rule" : "Create Store Email Rule"; + ViewData.SetActivePage(StoreNavPages.Emails, StringLocalizer[isEdit ? "Edit Email Rule" : "Create Email Rule"], storeId); } @section PageHeadContent {