refactor(PortalStatistics): Standardized PortalStatistics to Table2 and Widget3 - #8043
refactor(PortalStatistics): Standardized PortalStatistics to Table2 and Widget3#8043steve020607 wants to merge 11 commits into
Conversation
|
Might need more check on the annotiation from the master, since it's probably not right |
| if #args.showTierTypes then | ||
| for _, tierTypeValue in ipairs(args.showTierTypes) do | ||
| local _, tierTypeData = Tier.raw(nil, tierTypeValue) | ||
| local tierTypeCells = Array.map(args.showTierTypes, function(tierTypeValue) |
There was a problem hiding this comment.
need a nil check (or {} fallback) for the showTierType
There was a problem hiding this comment.
So wrap the args.showTierTypes with Logic.readBoolOrNil?
There was a problem hiding this comment.
no, the array map will error if it is nil, so you have to make sure it is not nil
readBoolOrNil would make it error always
There was a problem hiding this comment.
There was a problem hiding this comment.
so do i add the or {} fallback or not?
| if #args.showTierTypes then | ||
| for _, tierTypeValue in ipairs(args.showTierTypes) do | ||
| local _, tierTypeData = Tier.raw(nil, tierTypeValue) | ||
| local tierTypeCells = Array.map(args.showTierTypes, function(tierTypeValue) |
There was a problem hiding this comment.
| local age = os.date('*t', os.difftime(TIMESTAMP, birthdate)) | ||
| local yearAge = age.year - 1970 | ||
| local dayAge = age.yday - 1 |
There was a problem hiding this comment.
DateExt.calculateAge
There was a problem hiding this comment.
i seems don't know how to do it?
seems like i only get year, don't know how to show the day
Summary
PortalStatistics is now still running at mw.html.create and wikitable, this pr changes it
with helped of Claude
How did you test this change?
dev
https://liquipedia.net/mobilelegends/User:Steve23/Testing_Page
https://liquipedia.net/mobilelegends/Portal:Statistics (put
{{#vardefine:feature_dev|steve23}})