Skip to content

Commit

Permalink
fixes and improvments
Browse files Browse the repository at this point in the history
  • Loading branch information
Rathoz committed Jan 16, 2025
1 parent f50a600 commit 1551a29
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 10 deletions.
6 changes: 4 additions & 2 deletions components/standings/commons/standings.lua
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ function Standings.entryFromRecord(record)
local entry = {
opponent = Opponent.fromLpdbStruct(record),
placement = record.placement,
position = record.slotindex,
position = tonumber(record.slotindex),
positionStatus = record.currentstatus,
definitiveStatus = record.definitestatus,
changeFromPreviousRound = record.placementchange,
Expand Down Expand Up @@ -133,7 +133,9 @@ function Standings.makeRounds(standings)
local roundCount = Array.maxBy(Array.map(standingsEntries, Operator.property('roundindex')), FnUtil.identity)

return Array.map(Array.range(1, roundCount), function(roundIndex)
local roundEntries = Array.filter(standingsEntries, Operator.property('roundindex', Operator.eq(roundIndex)))
local roundEntries = Array.filter(standingsEntries, function(entry)
return tonumber(entry.roundindex) == roundIndex
end)
local opponents = Array.sortBy(Array.map(roundEntries, Standings.entryFromRecord), Operator.property('position'))
return {
round = roundIndex,
Expand Down
3 changes: 2 additions & 1 deletion components/widget/basic/widget_basic_button.lua
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
-- Please see https://github.com/Liquipedia/Lua-Modules to contribute
--

local Array = require('Module:Array')
local Class = require('Module:Class')
local Lua = require('Module:Lua')
local Table = require('Module:Table')
Expand Down Expand Up @@ -52,7 +53,7 @@ function Button:render()
end

local button = Div{
classes = Table.merge(cssClasses, self.props.classes or {}),
classes = Array.extend(cssClasses, self.props.classes or {}),
attributes = Table.merge({
title = self.props.title,
['aria-label'] = self.props.title,
Expand Down
2 changes: 1 addition & 1 deletion components/widget/standings/widget_standings_ffa.lua
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ function StandingsFfaWidget:render()
wrapperClasses = {'toggle-area', 'toggle-area-' .. roundCount},
classes = {'wikitable-bordered', 'wikitable-striped'},
attributes = {
['data-toggle-area'] = 'toggle-area-'.. roundCount,
['data-toggle-area'] = roundCount,
},
children = WidgetUtil.collect(
-- Outer header
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ function RoundSelectorWidget:render()

local function makeRoundButtons(roundTitle, roundIndex)
return Button{
title = roundTitle,
children = roundTitle,
variant = 'primary',
classes = {'toggle-area-button'},
attributes = {['data-toggle-area-btn'] = roundIndex},
Expand All @@ -52,16 +52,16 @@ function RoundSelectorWidget:render()

return HtmlWidgets.Div{
classes = {'dropdown-box-wrapper'},
style = {float = 'left'},
css = {float = 'left'},
children = {
Button{
title = finalRoundTitle(),
children = finalRoundTitle(),
variant = 'primary',
classes = {'dropdown-box-button'},
},
HtmlWidgets.Div{
classes = {'dropdown-box'},
style = {padding = '0px'},
css = {padding = '0px'},
children = Array.map(roundTitles, makeRoundButtons)
},
}
Expand Down
2 changes: 0 additions & 2 deletions stylesheets/commons/Miscellaneous.less
Original file line number Diff line number Diff line change
Expand Up @@ -566,8 +566,6 @@ Author(s): Rapture
float: left;
margin: 0;
padding: 5px;
border: 1px solid var( --clr-border, #d3d3d3 );
background-color: var( --clr-surface, #ffffff );
}

.dropdown-box-visible {
Expand Down

0 comments on commit 1551a29

Please sign in to comment.