Skip to content
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

Merged

Conversation

dennisreimann
Copy link
Member

@dennisreimann dennisreimann commented Mar 21, 2023

Uses the label manager component in the wallet transactions list.
Closes #4706
Closes #4755

labels-inline

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.

@@ -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)
Copy link
Member Author

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.

Comment on lines +1364 to +1369
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);
Copy link
Member Author

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.

Comment on lines -95 to +97
$list.innerHTML += html;
$list.insertAdjacentHTML('beforeend', html);
Copy link
Member Author

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

Copy link
Member

@Kukks Kukks left a 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)

dennisreimann and others added 2 commits March 22, 2023 11:52
@dennisreimann
Copy link
Member Author

we now lost a key feature: the descriptions of the labels are gone (for example payout ids, invoice link, etc)

Good point, added in e5c5cdc.

grafik

@NicolasDorier
Copy link
Member

NicolasDorier commented Mar 23, 2023

I think you should get rid of <noscript> stuff, which only work if no JS is present.
While I think it's cool to have it on public pages, backend pages can just require javascript.

Copy link
Member

@Kukks Kukks left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.


weird red pixels?

also there is no link on the badges that used to have links

@dennisreimann
Copy link
Member Author

@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?

@Kukks
Copy link
Member

Kukks commented Mar 24, 2023

The Send page now supports labelling destinations:
image

Additionally, the confirm page shows labels on both inputs and outputs when possible.

image

cc @NicolasDorier

@NicolasDorier NicolasDorier merged commit 95f3e42 into btcpayserver:master Mar 26, 2023
4 checks passed
@dennisreimann dennisreimann deleted the wallet-transactions-labels branch March 26, 2023 12:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants