-
Notifications
You must be signed in to change notification settings - Fork 100
feat: opt-in shop button for team infobox #6971
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
base: main
Are you sure you want to change the base?
Conversation
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.
Pull request overview
This PR adds an opt-in shop button feature to team infoboxes, allowing teams to display merchandise links with customizable styling.
Changes:
- Introduces a new
ShopMerchwidget with URL validation restricted tolinks.liquipedia.netdomain - Adds customization options for button text, icon, and link URL via infobox parameters
- Integrates the shop button into the team infobox template with comprehensive test coverage
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| lua/wikis/commons/Widget/Infobox/ShopMerch.lua | Core widget implementation with URL validation and rendering logic for the shop button |
| lua/wikis/commons/Widget/Infobox/All.lua | Registers ShopMerch widget in the infobox widget collection |
| lua/wikis/commons/Widget/All.lua | Registers ShopMerch widget in the global widget collection |
| lua/wikis/commons/Infobox/Team.lua | Integrates ShopMerch widget into team infobox structure |
| lua/wikis/commons/Icon/Data.lua | Adds shopping_bag icon definition for the shop button |
| lua/spec/infobox_shop_merch_spec.lua | Comprehensive test suite covering validation, normalization, and customization scenarios |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: ElectricalBoy <15651807+ElectricalBoy@users.noreply.github.com>
| @@ -0,0 +1,114 @@ | |||
| --- | |||
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.
actually, if the intended design is to enforce use of links.liquipedia.net domain only, then why not just do 'https://links.liquipedia.net/' .. args.shoplink?
that should be able to remove all the url checking logic, right?
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.
Hmm yeah at least for now the idea is to only accept links.liquipedia.net links. I think input being the slug makes sense so we can tighten the validation to only the slug part. 045139e
Wdyt?
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.
Intended that you reverted that change again?
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's wasn't completely reverted, just needed to introduce the mw.uri.new again to construct the url before the length check validation. But otherwise it's simpler now than what it was (as we're enforcing the domain)
| @@ -0,0 +1,114 @@ | |||
| --- | |||
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.
Intended that you reverted that change again?
|
|
||
| local SHOP_DEFAULT_LINK = 'https://links.liquipedia.net/tlstore' | ||
| local SHOP_DEFAULT_ICON = 'shopping_bag' | ||
| local SHOP_DEFAULT_TEXT = 'Shop Official Team Liquid Gear' |
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.
Could make this a pattern
| local SHOP_DEFAULT_TEXT = 'Shop Official Team Liquid Gear' | |
| local SHOP_DEFAULT_TEXT = 'Shop Official ${teamname} Gear' |
then later use String.interpolate to fill with the correct team name
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.
Probably a good idea for later, now we're just testing the clickrate for TL team infoboxes so we can keep it as is
Summary
Introduces a shop button for team infoboxes that's opt-in.
|shoplink. A truthy value will use the default value, but editors can use any validlinks.liquipedia.neturl for this flag.How did you test this change?
|dev=sbiand flag|shoplinkon any team infobox.