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
Wallet transactions: Add label manager #4796
Wallet transactions: Add label manager #4796
Conversation
@@ -5,12 +5,14 @@ namespace BTCPayServer.Components.LabelManager | |||
{ | |||
public class LabelManager : ViewComponent | |||
{ | |||
public IViewComponentResult Invoke(WalletObjectId walletObjectId, string[] selectedLabels) | |||
public IViewComponentResult Invoke(WalletObjectId walletObjectId, string[] selectedLabels, bool excludeTypes = true, bool displayInline = false) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Options that got added for the trasactions list, on which one was able to manage type labels as well. Inline mode is also for the list.
var walletObjectId = !string.IsNullOrEmpty(type) && !string.IsNullOrEmpty(id) | ||
? new WalletObjectId(walletId, type, id) | ||
: null; | ||
var labels = walletObjectId == null | ||
? await WalletRepository.GetWalletLabels(walletId) | ||
: await WalletRepository.GetWalletLabels(walletObjectId); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It turned out I didn't need this, but this makes it more flexible so that one can request either labels for the whole wallet or individual wallet objects.
$list.innerHTML += html; | ||
$list.insertAdjacentHTML('beforeend', html); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This did the trick on not removing event listeners from existing TomSelect instances. @Kukks
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
just tested and it feels good but we now lost a key feature: the descriptions of the labels are gone (for example payout ids, invoice link, etc)
Co-authored-by: Andrew Camilleri <evilkukka@gmail.com>
Good point, added in e5c5cdc. |
I think you should get rid of |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@NicolasDorier The noscript parts got removed. @Kukks I fixed the transaction label info clicks, but couldn't reproduce (Chrome and FF) or find an explanation for the red pixel glitches. Can you try and check the web inspector to see what might be going on there? |
Uses the label manager component in the wallet transactions list.
Closes #4706
Closes #4755
Also improved the label manager UI to work better with the list: Introduced an inline display mode, which removes the form input appearance. Also adjusted the dropdown and options to fit what we have elsewhere.