Rename global search keywords to aliases (#7586)
What changed, and why it matters
This commit simply renames the search feature's 'Keywords' field to 'Aliases' across the BTCPay Server codebase. It is a non-functional refactoring that does not change any security behavior, access controls, or data handling. Backward compatibility is preserved with an obsolete property that maps to the new name.
No security action required. Treat as a normal refactoring commit.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The patch is a broad rename from ‘Keywords’ to ‘Aliases’ in the Global Search plugin and all consumers. ViewModel classes keep an [Obsolete, JsonIgnore] ‘Keywords’ property that delegates to ‘Aliases’, ensuring existing code continues to work. Tests are updated to assert the new JSON field name. No logic, authorization, serialization exposure, or search behavior changes are introduced.
Changed components
BTCPayServer.Plugins.GlobalSearchGlobal search JavaScript clientSearch result providers across multiple pluginsInspect captured patch +96 / −77
### BTCPayServer.Tests/GlobalSearchTests.cs
@@ -83,7 +83,10 @@ await s.Server.WaitForEvent<NewOnChainTransactionEvent>(async () =>
// Access UISearchController.Global route, and check that all the routes are accessible
var response = await s.Page.Context.APIRequest.GetAsync(s.Link($"/search/global?storeId={s.StoreId}"));
Assert.True(response.Ok, $"Global search endpoint returned {response.Status}: {await response.TextAsync()}");
- var items = JsonConvert.DeserializeObject<List<ResultItemViewModel>>(await response.TextAsync());
+ var responseText = await response.TextAsync();
+ Assert.Contains("\"aliases\":", responseText);
+ Assert.DoesNotContain("\"keywords\":", responseText);
+ var items = JsonConvert.DeserializeObject<List<ResultItemViewModel>>(responseText);
Assert.NotNull(items);
Assert.NotEmpty(items);
### BTCPayServer/Plugins/Bitpay/BitpayPlugin.cs
@@ -47,7 +47,7 @@ public override void Execute(IServiceCollection services)
Controller = "UIStoresToken",
Values = (ctx) => new { storeId = ctx.Store!.Id, area = Area },
Category = "Store",
- Keywords = new[] { "Tokens" }
+ Aliases = new[] { "Tokens" }
});
}
}
### BTCPayServer/Plugins/DynamicDNS/DynamicDnsPlugin.cs
@@ -27,7 +27,7 @@ public override void Execute(IServiceCollection services)
services.AddStaticSearch(new ActionResultItemViewModel()
{
Title = "Setup Dynamic DNS",
- Keywords = new[] { "Dynamic DNS", "DDNS", "DynDns", "DNS" },
+ Aliases = new[] { "Dynamic DNS", "DDNS", "DynDns", "DNS" },
Action = nameof(UIDynamicDnsController.DynamicDnsService),
Controller = "UIDynamicDns",
Values = ctx => new { area = Area },
### BTCPayServer/Plugins/Emails/EmailsPlugin.cs
@@ -68,7 +68,7 @@ private static void ConfigureEmailSearch(IServiceCollection services)
Controller = "UIStoreEmailRules",
Values = ctx => new { area = Area, storeId = ctx.Store!.Id },
Category = "Store",
- Keywords = ["Email", "Rules"]
+ Aliases = ["Email", "Rules"]
});
services.AddStaticSearch(new ActionResultItemViewModel()
{
@@ -78,7 +78,7 @@ private static void ConfigureEmailSearch(IServiceCollection services)
Controller = "UIServerEmailRules",
Values = ctx => new { area = Area },
Category = "Server",
- Keywords = ["Email", "Rules"]
+ Aliases = ["Email", "Rules"]
});
services.AddStaticSearch(new ActionResultItemViewModel()
{
@@ -88,7 +88,7 @@ private static void ConfigureEmailSearch(IServiceCollection services)
Controller = "UIStoresEmail",
Values = ctx => new { area = Area, storeId = ctx.Store!.Id },
Category = "Store",
- Keywords = ["Email", "Settings"]
+ Aliases = ["Email", "Settings"]
});
services.AddStaticSearch(new ActionResultItemViewModel()
{
@@ -98,7 +98,7 @@ private static void ConfigureEmailSearch(IServiceCollection services)
Controller = "UIServerEmail",
Values = ctx => new { area = Area },
Category = "Server",
- Keywords = ["Email", "Settings"]
+ Aliases = ["Email", "Settings"]
});
}
### BTCPayServer/Plugins/Forms/FormsPlugin.cs
@@ -33,7 +33,7 @@ public override void Execute(IServiceCollection services)
Controller = "UIForms",
Values = ctx => new { area = Area, storeId = ctx.Store!.Id },
Category = "Store",
- Keywords = ["Forms", "Configure"]
+ Aliases = ["Forms", "Configure"]
});
}
}
### BTCPayServer/Plugins/GlobalSearch/GlobalSearchExtensions.cs
@@ -12,7 +12,7 @@ public static IServiceCollection AddSearchResultItemProvider<T>(this IServiceCol
return services;
}
/// <summary>
- /// Add a static search result, title, subtitle, category, keywords, will be exposed to translations.
+ /// Add a static search result; its title, subtitle, category, and aliases will be exposed to translations.
/// </summary>
/// <param name="services"></param>
/// <param name="vm"></param>
@@ -24,7 +24,7 @@ public static IServiceCollection AddStaticSearch(this IServiceCollection service
}
/// <summary>
- /// Add a static search result, title, subtitle, category, keywords, will be exposed to translations.
+ /// Add a static search result; its title, subtitle, category, and aliases will be exposed to translations.
/// </summary>
/// <param name="services"></param>
/// <param name="actionResultItem"></param>
@@ -35,7 +35,7 @@ public static IServiceCollection AddStaticSearch(this IServiceCollection service
return services;
}
/// <summary>
- /// Add a static search result, title, subtitle, category, keywords, will be exposed to translations.
+ /// Add static search results; their titles, subtitles, categories, and aliases will be exposed to translations.
/// </summary>
/// <param name="services"></param>
/// <param name="vm"></param>
@@ -48,7 +48,7 @@ public static IServiceCollection AddStaticSearch(this IServiceCollection service
}
/// <summary>
- /// Add a static search result, title, subtitle, category, keywords, will be exposed to translations.
+ /// Add static search results; their titles, subtitles, categories, and aliases will be exposed to translations.
/// </summary>
/// <param name="services"></param>
/// <param name="actionResultItem"></param>
### BTCPayServer/Plugins/GlobalSearch/GlobalSearchPlugin.cs
@@ -42,7 +42,7 @@ private static void AddDefaultStaticSearch(IServiceCollection services)
Controller = "UIStores",
Values = ctx => new { storeId = ctx.Store!.Id },
Category = "Store",
- Keywords = ["Settings", "Branding"]
+ Aliases = ["Settings", "Branding"]
},
new ActionResultItemViewModel
{
@@ -52,7 +52,7 @@ private static void AddDefaultStaticSearch(IServiceCollection services)
Controller = "UIStores",
Values = ctx => new { storeId = ctx.Store!.Id },
Category = "Store",
- Keywords = ["Exchange", "Configure"]
+ Aliases = ["Exchange", "Configure"]
},
new ActionResultItemViewModel
{
@@ -62,7 +62,7 @@ private static void AddDefaultStaticSearch(IServiceCollection services)
Controller = "UIStores",
Values = ctx => new { storeId = ctx.Store!.Id },
Category = "Store",
- Keywords = ["Checkout", "Appearance", "Configure"]
+ Aliases = ["Checkout", "Appearance", "Configure"]
},
new ActionResultItemViewModel
{
@@ -72,7 +72,7 @@ private static void AddDefaultStaticSearch(IServiceCollection services)
Controller = "UIStores",
Values = ctx => new { storeId = ctx.Store!.Id },
Category = "Store",
- Keywords = ["Users", "View"]
+ Aliases = ["Users", "View"]
},
new ActionResultItemViewModel
{
@@ -82,7 +82,7 @@ private static void AddDefaultStaticSearch(IServiceCollection services)
Controller = "UIStores",
Values = ctx => new { storeId = ctx.Store!.Id },
Category = "Store",
- Keywords = ["Roles", "View"]
+ Aliases = ["Roles", "View"]
},
new ActionResultItemViewModel
{
@@ -92,7 +92,7 @@ private static void AddDefaultStaticSearch(IServiceCollection services)
Controller = "UIPayoutProcessors",
Values = ctx => new { storeId = ctx.Store!.Id },
Category = "Store",
- Keywords = ["Payout", "Processors", "Configure"]
+ Aliases = ["Payout", "Processors", "Configure"]
},
new ActionResultItemViewModel
{
@@ -102,7 +102,7 @@ private static void AddDefaultStaticSearch(IServiceCollection services)
Controller = "UIPaymentRequest",
Values = ctx => new { storeId = ctx.Store!.Id },
Category = "Payments",
- Keywords = ["Payment", "Requests", "View"]
+ Aliases = ["Payment", "Requests", "View"]
},
new ActionResultItemViewModel
{
@@ -112,7 +112,7 @@ private static void AddDefaultStaticSearch(IServiceCollection services)
Controller = "UIStorePullPayments",
Values = ctx => new { storeId = ctx.Store!.Id },
Category = "Payments",
- Keywords = ["Pull Payments", "Pull", "View"]
+ Aliases = ["Pull Payments", "Pull", "View"]
},
new ActionResultItemViewModel
{
@@ -122,7 +122,7 @@ private static void AddDefaultStaticSearch(IServiceCollection services)
Controller = "UIStorePullPayments",
Values = ctx => new { storeId = ctx.Store!.Id },
Category = "Payments",
- Keywords = ["Payouts", "View"]
+ Aliases = ["Payouts", "View"]
},
new ActionResultItemViewModel
{
@@ -131,7 +131,7 @@ private static void AddDefaultStaticSearch(IServiceCollection services)
Action = nameof(UIServerController.Policies),
Controller = "UIServer",
Category = "Server",
- Keywords = ["Server", "Settings", "Policies", "Configure"]
+ Aliases = ["Server", "Settings", "Policies", "Configure"]
},
new ActionResultItemViewModel
{
@@ -140,7 +140,7 @@ private static void AddDefaultStaticSearch(IServiceCollection services)
Action = nameof(UIServerController.ListUsers),
Controller = "UIServer",
Category = "Server",
- Keywords = ["Server", "Settings", "Users", "View"]
+ Aliases = ["Server", "Settings", "Users", "View"]
},
new ActionResultItemViewModel
{
@@ -149,7 +149,7 @@ private static void AddDefaultStaticSearch(IServiceCollection services)
Action = nameof(UIServerController.ListRoles),
Controller = "UIServer",
Category = "Server",
- Keywords = ["Server", "Settings", "Roles", "View"]
+ Aliases = ["Server", "Settings", "Roles", "View"]
},
new ActionResultItemViewModel
{
@@ -158,7 +158,7 @@ private static void AddDefaultStaticSearch(IServiceCollection services)
Action = nameof(UIServerController.Services),
Controller = "UIServer",
Category = "Server",
- Keywords = ["Server", "Settings", "Services", "View"]
+ Aliases = ["Server", "Settings", "Services", "View"]
},
new ActionResultItemViewModel
{
@@ -167,7 +167,7 @@ private static void AddDefaultStaticSearch(IServiceCollection services)
Action = nameof(UIServerController.Branding),
Controller = "UIServer",
Category = "Server",
- Keywords = ["Server", "Settings", "Branding", "Configure"]
+ Aliases = ["Server", "Settings", "Branding", "Configure"]
},
new ActionResultItemViewModel
{
@@ -176,7 +176,7 @@ private static void AddDefaultStaticSearch(IServiceCollection services)
Action = nameof(UIServerController.LogsView),
Controller = "UIServer",
Category = "Server",
- Keywords = ["Server", "Settings", "Logs", "View"]
+ Aliases = ["Server", "Settings", "Logs", "View"]
},
new ActionResultItemViewModel
{
@@ -185,7 +185,7 @@ private static void AddDefaultStaticSearch(IServiceCollection services)
Action = nameof(UIServerController.Files),
Controller = "UIServer",
Category = "Server",
- Keywords = ["Server", "Settings", "Files", "Storage", "Configure"]
+ Aliases = ["Server", "Settings", "Files", "Storage", "Configure"]
},
new ActionResultItemViewModel
{
@@ -194,7 +194,7 @@ private static void AddDefaultStaticSearch(IServiceCollection services)
Action = nameof(UIManageController.Index),
Controller = "UIManage",
Category = "Account",
- Keywords = ["Profile", "Account", "Manage"]
+ Aliases = ["Profile", "Account", "Manage"]
},
new ActionResultItemViewModel
{
@@ -203,7 +203,7 @@ private static void AddDefaultStaticSearch(IServiceCollection services)
Action = nameof(UIManageController.ChangePassword),
Controller = "UIManage",
Category = "Account",
- Keywords = ["Password", "Change"]
+ Aliases = ["Password", "Change"]
},
new ActionResultItemViewModel
{
@@ -212,7 +212,7 @@ private static void AddDefaultStaticSearch(IServiceCollection services)
Action = nameof(UIManageController.TwoFactorAuthentication),
Controller = "UIManage",
Category = "Account",
- Keywords = ["2FA Security", "Two-Factor", "Authentication"]
+ Aliases = ["2FA Security", "Two-Factor", "Authentication"]
},
new ActionResultItemViewModel
{
@@ -221,7 +221,7 @@ private static void AddDefaultStaticSearch(IServiceCollection services)
Action = nameof(UIManageController.Passkeys),
Controller = "UIManage",
Category = "Account",
- Keywords = ["Passkey", "Authentication"]
+ Aliases = ["Passkey", "Authentication"]
},
new ActionResultItemViewModel
{
@@ -230,7 +230,7 @@ private static void AddDefaultStaticSearch(IServiceCollection services)
Action = nameof(UIManageController.APIKeys),
Controller = "UIManage",
Category = "Account",
- Keywords = ["API", "Keys"]
+ Aliases = ["API", "Keys"]
},
new ActionResultItemViewModel
{
@@ -239,7 +239,7 @@ private static void AddDefaultStaticSearch(IServiceCollection services)
Action = nameof(UIManageController.NotificationSettings),
Controller = "UIManage",
Category = "Account",
- Keywords = ["Notifications", "Manage"]
+ Aliases = ["Notifications", "Manage"]
},
new ActionResultItemViewModel
{
@@ -248,31 +248,31 @@ private static void AddDefaultStaticSearch(IServiceCollection services)
Action = nameof(UINotificationsController.Index),
Controller = "UINotifications",
Category = "Account",
- Keywords = ["Notifications", "View"]
+ Aliases = ["Notifications", "View"]
},
new ActionResultItemViewModel
{
Title = "Go to the dashboard",
Action = nameof(UIHomeController.Index),
Controller = "UIHome",
Category = "General",
- Keywords = ["Dashboard", "Overview"]
+ Aliases = ["Dashboard", "Overview"]
},
new ActionResultItemViewModel
{
Title = "View all the stores",
Action = nameof(UIUserStoresController.ListStores),
Controller = "UIUserStores",
Category = "Store",
- Keywords = ["Stores", "List", "View"]
+ Aliases = ["Stores", "List", "View"]
},
new ActionResultItemViewModel
{
Title = "Browse the API documentation",
Action = nameof(UIHomeController.SwaggerDocs),
Controller = "UIHome",
Category = "General",
- Keywords = ["Documentation", "API", "Docs", "Browse"]
+ Aliases = ["Documentation", "API", "Docs", "Browse"]
}
]);
}
### BTCPayServer/Plugins/GlobalSearch/InvoiceSearchResultProvider.cs
@@ -47,15 +47,15 @@ public async Task ProvideAsync(SearchResultItemProviderContext context, Cancella
Category = Category,
Title = StringLocalizer["Browse the invoices"],
Url = context.Url.Action(nameof(UIInvoiceController.ListInvoices), "UIInvoice", new { storeId = store.Id }),
- Keywords = ["Invoices", "List", "Browse"],
+ Aliases = ["Invoices", "List", "Browse"],
RequiredPolicy = Policies.CanViewInvoices
},
new ResultItemViewModel
{
Category = Category,
Title = StringLocalizer["Create Invoice"],
Url = context.Url.Action(nameof(UIInvoiceController.CreateInvoice), "UIInvoice", new { storeId = store.Id }),
- Keywords = ["Invoice"],
+ Aliases = ["Invoice"],
RequiredPolicy = Policies.CanCreateInvoice
}]);
}
### BTCPayServer/Plugins/GlobalSearch/SearchResultItemProviders.cs
@@ -76,11 +76,11 @@ private void Translate(SearchResultItemProviderContext ctx)
result.Title = stringLocalizer[result.Title];
if (result.Category is not null)
result.Category = stringLocalizer[result.Category];
- if (result.Keywords is not null)
+ if (result.Aliases is not null)
{
- for (int i = 0; i < result.Keywords.Length; i++)
+ for (int i = 0; i < result.Aliases.Length; i++)
{
- result.Keywords[i] = stringLocalizer[result.Keywords[i]];
+ result.Aliases[i] = stringLocalizer[result.Aliases[i]];
}
}
result.Order = o.Order;
### BTCPayServer/Plugins/GlobalSearch/StaticSearchResultProvider.cs
@@ -7,6 +7,7 @@
using BTCPayServer.Plugins.GlobalSearch.Views;
using BTCPayServer.Services;
using Microsoft.AspNetCore.Mvc;
+using Newtonsoft.Json;
namespace BTCPayServer.Plugins.GlobalSearch;
@@ -19,7 +20,15 @@ public class ActionResultItemViewModel
public required string Controller { get; set; }
public Func<SearchResultItemProviderContext, object>? Values { get; set; }
public string? Category { get; set; }
- public string[]? Keywords { get; set; }
+ public string[]? Aliases { get; set; }
+
+ [Obsolete("Use Aliases instead")]
+ [JsonIgnore]
+ public string[]? Keywords
+ {
+ get => Aliases;
+ set => Aliases = value;
+ }
}
public class StaticSearchResultProvider(
@@ -39,8 +48,8 @@ internal class TranslationProvider(
translations.Add(item.Title);
if (item.Category is not null)
translations.Add(item.Category);
- if (item.Keywords is not null)
- translations.AddRange(item.Keywords);
+ if (item.Aliases is not null)
+ translations.AddRange(item.Aliases);
}
foreach (var item in routeItems)
{
@@ -49,8 +58,8 @@ internal class TranslationProvider(
translations.Add(item.SubTitle);
if (item.Category is not null)
translations.Add(item.Category);
- if (item.Keywords is not null)
- translations.AddRange(item.Keywords);
+ if (item.Aliases is not null)
+ translations.AddRange(item.Aliases);
}
return Task.FromResult(translations.Select(s => KeyValuePair.Create(s, null as string)).ToArray());
}
@@ -71,7 +80,7 @@ public async Task ProvideAsync(SearchResultItemProviderContext context, Cancella
RequiredPolicy = item.RequiredPolicy,
Category = item.Category,
Title = item.Title,
- Keywords = item.Keywords,
+ Aliases = item.Aliases,
Url = context.Url.Action(item.Action, item.Controller, item.Values?.Invoke(context))
});
}
### BTCPayServer/Plugins/GlobalSearch/Views/GlobalSearchViewModel.cs
@@ -35,20 +35,27 @@ public ResultItemViewModel(ResultItemViewModel other)
Title = other.Title;
Category = other.Category;
Url = other.Url;
- Keywords = other.Keywords?.ToArray();
+ Aliases = other.Aliases?.ToArray();
Order = other.Order;
}
[JsonIgnore]
public string RequiredPolicy { get; set; }
public string Title { get; set; }
public string Category { get; set; }
public string Url { get; set; }
- public string[] Keywords { get; set; }
+ public string[] Aliases { get; set; }
+
+ [Obsolete("Use Aliases instead")]
+ [JsonIgnore]
+ public string[] Keywords
+ {
+ get => Aliases;
+ set => Aliases = value;
+ }
/// <summary>
/// Lower order values appear first (higher up), and higher order values appear later (lower down).
/// </summary>
[JsonIgnore]
public int Order { get; set; }
}
-
### BTCPayServer/Plugins/Impersonation/ImpersonationPlugin.cs
@@ -36,7 +36,7 @@ public override void Execute(IServiceCollection services)
Controller = "UIImpersonation",
Values = ctx => new { area = Area },
Category = "Account",
- Keywords = ["Login", "Codes", "Login Codes", "QR", "Device", "Impersonate"]
+ Aliases = ["Login", "Codes", "Login Codes", "QR", "Device", "Impersonate"]
});
}
}
### BTCPayServer/Plugins/Maintenance/MaintenanceSearchResultProvider.cs
@@ -13,7 +13,7 @@ namespace BTCPayServer.Plugins.Maintenance;
public class MaintenanceSearchResultProvider(HostIntegrationState hostIntegrationState) : ISearchResultItemProvider
{
- private static readonly string[] Keywords = ["Server", "Settings", "Maintenance"];
+ private static readonly string[] Aliases = ["Server", "Settings", "Maintenance"];
public Task ProvideAsync(SearchResultItemProviderContext context, CancellationToken cancellationToken)
{
@@ -27,7 +27,7 @@ public Task ProvideAsync(SearchResultItemProviderContext context, CancellationTo
Title = "Go to the maintenance page",
Url = context.Url.Action(nameof(UIMaintenanceController.Maintenance), "UIMaintenance", new { area = MaintenancePlugin.Area }),
Category = "Server",
- Keywords = Keywords
+ Aliases = Aliases
});
if (hostIntegration.SupportedCommands.Contains(HostCommands.Update))
{
@@ -37,7 +37,7 @@ public Task ProvideAsync(SearchResultItemProviderContext context, CancellationTo
Title = "Update the server",
Url = context.Url.Action(nameof(UIMaintenanceController.Maintenance), "UIMaintenance", new { area = MaintenancePlugin.Area }),
Category = "Server",
- Keywords = Keywords
+ Aliases = Aliases
});
}
return Task.CompletedTask;
### BTCPayServer/Plugins/Multisig/MultisigSearchResultProvider.cs
@@ -51,7 +51,7 @@ public async Task ProvideAsync(SearchResultItemProviderContext context, Cancella
Title = StringLocalizer["Continue multisig setup in progress"].Value,
Url = context.Url.Action(nameof(UIMultisigSetupController.SetupMultisigStatus), "UIMultisigSetup", new { area = MultisigPlugin.Area, multisigSetupId = pending.RequestId }),
Category = category,
- Keywords = ["Multisig", "Setup", "Wallet", network.CryptoCode, translated, untranslated],
+ Aliases = ["Multisig", "Setup", "Wallet", network.CryptoCode, translated, untranslated],
Order = 1
});
}
@@ -64,7 +64,7 @@ public async Task ProvideAsync(SearchResultItemProviderContext context, Cancella
Title = StringLocalizer["Set up a multisig wallet"].Value,
Url = context.Url.Action(nameof(UIMultisigWalletsController.SetupMultisig), "UIMultisigWallets", new { area = MultisigPlugin.Area, storeId, cryptoCode = network.CryptoCode }),
Category = category,
- Keywords = ["Multisig", "Setup", "Wallet", network.CryptoCode, translated, untranslated],
+ Aliases = ["Multisig", "Setup", "Wallet", network.CryptoCode, translated, untranslated],
Order = 1
});
}
### BTCPayServer/Plugins/PluginManager/PluginManagerPlugin.cs
@@ -34,7 +34,7 @@ public override void Execute(IServiceCollection services)
Controller = "UIPluginManager",
Values = _ => new { area = Area },
Category = "Server",
- Keywords = ["Plugins", "Installed", "Update", "Configure"]
+ Aliases = ["Plugins", "Installed", "Update", "Configure"]
},
new ActionResultItemViewModel
{
@@ -44,7 +44,7 @@ public override void Execute(IServiceCollection services)
Controller = "UIPluginManager",
Values = _ => new { area = Area },
Category = "Server",
- Keywords = ["Plugins", "Directory", "Install"]
+ Aliases = ["Plugins", "Directory", "Install"]
}
]);
}
### BTCPayServer/Plugins/Translations/TranslationsPlugin.cs
@@ -36,7 +36,7 @@ public override void Execute(IServiceCollection services)
Controller = "UITranslation",
Values = _ => new { area = Area },
Category = "Server",
- Keywords = ["Server", "Settings", "Translations", "Language", "Dictionary", "Localization"]
+ Aliases = ["Server", "Settings", "Translations", "Language", "Dictionary", "Localization"]
});
}
}
### BTCPayServer/Plugins/Wallets/WalletSearchResultProvider.cs
@@ -35,7 +35,7 @@ public Task ProvideAsync(SearchResultItemProviderContext context, CancellationTo
Title = StringLocalizer["List wallets"],
Category = OnChainCategory,
Url = context.Url.Action(nameof(UIWalletsController.ListWallets), "UIWallets", new { area = WalletsPlugin.Area }),
- Keywords = ["List", "Wallets"],
+ Aliases = ["List", "Wallets"],
RequiredPolicy = Policies.CanModifyStoreSettings
});
@@ -59,7 +59,7 @@ public Task ProvideAsync(SearchResultItemProviderContext context, CancellationTo
Title = StringLocalizer["Set up a wallet"].Value,
Category = category,
Url = context.Url.Action(nameof(UIStoreOnChainWalletsController.SetupWallet), "UIStoreOnChainWallets", new { area = WalletsPlugin.Area, storeId, cryptoCode = network.CryptoCode }),
- Keywords = ["Setup", "Wallets", network.CryptoCode, translated, untranslated],
+ Aliases = ["Setup", "Wallets", network.CryptoCode, translated, untranslated],
RequiredPolicy = WalletPolicies.CanManageWalletSettings
});
}
@@ -71,39 +71,39 @@ public Task ProvideAsync(SearchResultItemProviderContext context, CancellationTo
Title = StringLocalizer["Create a new transaction"].Value,
Category = category,
Url = context.Url.WalletSend(walletId),
- Keywords = ["Send", "Wallets", "Create", "transaction", network.CryptoCode, translated, untranslated],
+ Aliases = ["Send", "Wallets", "Create", "transaction", network.CryptoCode, translated, untranslated],
RequiredPolicy = WalletPolicies.CanCreateWalletTransactions
});
context.ItemResults.Add(new ResultItemViewModel()
{
Title = StringLocalizer["Get a deposit address"].Value,
Category = category,
Url = context.Url.WalletReceive(walletId),
- Keywords = ["Receive", "Deposit", "Address", "Wallets", network.CryptoCode, translated, untranslated],
+ Aliases = ["Receive", "Deposit", "Address", "Wallets", network.CryptoCode, translated, untranslated],
RequiredPolicy = WalletPolicies.CanViewWallet
});
context.ItemResults.Add(new ResultItemViewModel()
{
Title = StringLocalizer["Browse all deposit addresses"].Value,
Category = category,
Url = context.Url.WalletReservedAddresses(walletId),
- Keywords = ["Receive", "Deposit", "Address", "Wallets", network.CryptoCode, translated, untranslated],
+ Aliases = ["Receive", "Deposit", "Address", "Wallets", network.CryptoCode, translated, untranslated],
RequiredPolicy = WalletPolicies.CanViewWallet
});
context.ItemResults.Add(new ResultItemViewModel()
{
Title = StringLocalizer["View transactions"].Value,
Category = category,
Url = context.Url.WalletTransactions(walletId),
- Keywords = ["Transactions", "View", "Wallets", network.CryptoCode, translated, untranslated],
+ Aliases = ["Transactions", "View", "Wallets", network.CryptoCode, translated, untranslated],
RequiredPolicy = WalletPolicies.CanViewWallet
});
context.ItemResults.Add(new ResultItemViewModel()
{
Title = StringLocalizer["Go to wallet's settings"].Value,
Category = category,
Url = context.Url.WalletSettings(walletId),
- Keywords = ["Settings", "Wallets", network.CryptoCode, translated, untranslated],
+ Aliases = ["Settings", "Wallets", network.CryptoCode, translated, untranslated],
RequiredPolicy = WalletPolicies.CanManageWalletSettings
});
}
@@ -127,7 +127,7 @@ public Task ProvideAsync(SearchResultItemProviderContext context, CancellationTo
Title = StringLocalizer["Set up a Lightning node"].Value,
Category = category,
Url = context.Url.Action(nameof(UIStoresController.SetupLightningNode), "UIStores", new { storeId, cryptoCode = network.CryptoCode }),
- Keywords = ["Setup", "Wallets", network.CryptoCode, translated, untranslated, lntranslated, lnuntranslated, "Lightning"],
+ Aliases = ["Setup", "Wallets", network.CryptoCode, translated, untranslated, lntranslated, lnuntranslated, "Lightning"],
RequiredPolicy = Policies.CanModifyStoreSettings
});
}
@@ -138,7 +138,7 @@ public Task ProvideAsync(SearchResultItemProviderContext context, CancellationTo
Title = StringLocalizer["View the public node info"].Value,
Category = category,
Url = context.Url.Action(nameof(UIPublicLightningNodeInfoController.ShowLightningNodeInfo), "UIPublicLightningNodeInfo", new { storeId, cryptoCode = network.CryptoCode }),
- Keywords = ["Public", "Node", "Info", "View", translated, untranslated, lntranslated, lnuntranslated, "Lightning"],
+ Aliases = ["Public", "Node", "Info", "View", translated, untranslated, lntranslated, lnuntranslated, "Lightning"],
RequiredPolicy = Policies.CanModifyStoreSettings
});
}
### BTCPayServer/Plugins/Webhooks/WebhooksPlugin.cs
@@ -63,7 +63,7 @@ public override void Execute(IServiceCollection services)
Controller = "UIStoreWebhooks",
Values = ctx => new { area = Area, storeId = ctx.Store!.Id },
Category = "Store",
- Keywords = ["Webhooks", "Configure"]
+ Aliases = ["Webhooks", "Configure"]
});
// Add built-in webhooks
### BTCPayServer/Services/Reporting/ReportingSearchResultProvider.cs
@@ -28,7 +28,7 @@ public Task ProvideAsync(SearchResultItemProviderContext context, CancellationTo
RequiredPolicy = Policies.CanViewReports,
Category = Category,
Title = StringLocalizer["Go to Reports"],
- Keywords = ["Reports", "Go"],
+ Aliases = ["Reports", "Go"],
Url = context.Url.Action(nameof(UIReportsController.StoreReports), "UIReports", new { storeId = context.Store!.Id })
});
@@ -37,7 +37,7 @@ public Task ProvideAsync(SearchResultItemProviderContext context, CancellationTo
RequiredPolicy = Policies.CanViewReports,
Category = Category,
Url = context.Url.Action(nameof(UIReportsController.StoreReports), "UIReports", new { storeId = context.Store!.Id, viewName = provider.Name }),
- Keywords = ["Reports", "View", provider.Name],
+ Aliases = ["Reports", "View", provider.Name],
Title = StringLocalizer["View report '{0}'", provider.Name]
}));
return Task.CompletedTask;
### BTCPayServer/wwwroot/plugins/GlobalSearch/global-search.js
@@ -7,12 +7,12 @@
if (initGlobalSearchInitiated) return;
initGlobalSearchInitiated = true;
// removeDups remove returns an array with no duplicates.
- // it also merges the keywords of the same item.
+ // it also merges the aliases of the same item.
function removeDups(localIndex) {
var noDups = [];
var localIndexMap = new Map();
localIndex.forEach(item => {
- item.keywords ??= [];
+ item.aliases ??= [];
var key = JSON.stringify({category: item.category, title: item.title});
if (!localIndexMap.has(key)) {
localIndexMap.set(key, item)
@@ -21,7 +21,7 @@
else
{
var existing = localIndexMap.get(key);
- item.keywords.forEach(keyword => {existing.keywords.push(keyword)})
+ item.aliases.forEach(alias => {existing.aliases.push(alias)})
}
});
return noDups;
@@ -46,7 +46,7 @@
useExtendedSearch: true,
keys: [
{name: 'title', weight: 0.5},
- {name: 'keywords', weight: 0.35},
+ {name: 'aliases', weight: 0.35},
{name: 'category', weight: 0.1},
{name: 'subtitle', weight: 0.05}
]Why this scored 15/100
Community notes
Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.
The AI analysis stands alone for now. Submit a note if you can add evidence or important context.