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

chore(transfer): Add configs where necessary and remove deprecated #4882

Merged
merged 3 commits into from
Oct 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 0 additions & 34 deletions components/transfer/commons/transfer_references.lua
Original file line number Diff line number Diff line change
Expand Up @@ -120,12 +120,6 @@ function TransferRef.fromStorageData(referencesData)
end
---@cast referencesData -nil

--fallback processing for pre standardized TRef data, so we do not break stuff
--to be removed after switching to standardized and having everything purged
if Logic.isEmpty(referencesData.reference1type) then
return TransferRef.fromLegacyStorageData(referencesData)
end

return Array.mapIndexes(function(referenceIndex)
local prefix = 'reference' .. referenceIndex
local link = referencesData[prefix]
Expand All @@ -146,34 +140,6 @@ function TransferRef.fromStorageData(referencesData)
end)
end

---@deprecated
---to be removed after switching to standardized and having everything purged
---@param referencesData table
---@return TransferReference[]
function TransferRef.fromLegacyStorageData(referencesData)
return Array.mapIndexes(function(referenceIndex)
local tempArray = mw.text.split(referencesData['reference' .. referenceIndex] or '', ',,,', true)
local refType = tempArray[1]

if not TransferRef.isValidRefType(refType) then return end

local link = Logic.nilIfEmpty(tempArray[2])
if Logic.isEmpty(refType) or refType == WEB_TYPE and not link then return end
return {
link = link,
refType = refType,
text = Logic.nilIfEmpty(tempArray[3]),
title = Logic.nilIfEmpty(tempArray[4]),
transTitle = Logic.nilIfEmpty(tempArray[5]),
language = Logic.nilIfEmpty(tempArray[6]),
author = Logic.nilIfEmpty(tempArray[7]),
publisher = Logic.nilIfEmpty(tempArray[8]),
archiveUrl = Logic.nilIfEmpty(tempArray[9]),
archiveDate = Logic.nilIfEmpty(tempArray[10]),
}
end)
end

---@param references TransferReference[]
---@return TransferReference[]
function TransferRef.makeUnique(references)
Expand Down
2 changes: 1 addition & 1 deletion spec/golden_masters/transfer_row_leagueoflegends.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<div class="divRow mainpage-transfer-neutral"><div class="divCell Date">2024-10-11</div><div class="divCell Name"><div class="block-player"><span class="flag">[[File:us_hd.png|36x24px|United States|link=]]</span><span class="name" style="overflow:hidden;text-overflow:ellipsis;white-space:pre">[[Supr|supr]]</span></div></div><div class="divCell Team OldTeam"><span style="font-style:italic">&nbsp;None&nbsp;</span></div><div class="divCell Icon" style="width:70px;font-size:larger">&#x21d2;</div><div class="divCell Team NewTeam"><span style="font-style:italic">&nbsp;None&nbsp;</span></div><div class="divCell Ref">[https://x.com/streamerzone_gg/status/1844766204742832441 <i class="fad fa-external-link-alt wiki-color-dark"></i>]</div></div>
<div class="divRow mainpage-transfer-neutral"><div class="divCell Date">2024-10-11</div><div class="divCell Name"><div class="block-player"><span class="flag">[[File:us_hd.png|36x24px|United States|link=]]</span><span class="name" style="overflow:hidden;text-overflow:ellipsis;white-space:pre">[[Supr|supr]]</span></div></div><div class="divCell Team OldTeam" style="text-align:right"><span style="font-style:italic;margin-right:60px">&nbsp;None&nbsp;</span></div><div class="divCell Icon" style="width:70px;font-size:larger">&#x21d2;</div><div class="divCell Team NewTeam" style="text-align:left"><span style="font-style:italic;margin-left:60px">&nbsp;None&nbsp;</span></div><div class="divCell Ref">[https://x.com/streamerzone_gg/status/1844766204742832441 <i class="fad fa-external-link-alt wiki-color-dark"></i>]</div></div>
2 changes: 1 addition & 1 deletion spec/golden_masters/transfer_row_mobilelegends.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<div class="divRow mainpage-transfer-neutral"><div class="divCell Date">2024-10-11</div><div class="divCell Name"><div class="block-player"><span class="flag">[[File:us_hd.png|36x24px|United States|link=]]</span><span class="name" style="overflow:hidden;text-overflow:ellipsis;white-space:pre">[[Supr|supr]]</span></div></div><div class="divCell Team OldTeam"><span style="font-style:italic">&nbsp;None&nbsp;</span></div><div class="divCell Icon" style="width:70px;font-size:larger">&#x21d2;</div><div class="divCell Team NewTeam"><span style="font-style:italic">&nbsp;None&nbsp;</span></div><div class="divCell Ref">[https://x.com/streamerzone_gg/status/1844766204742832441 <i class="fad fa-external-link-alt wiki-color-dark"></i>]</div></div>
<div class="divRow mainpage-transfer-neutral"><div class="divCell Date">2024-10-11</div><div class="divCell Name"><div class="block-player"><span class="flag">[[File:us_hd.png|36x24px|United States|link=]]</span><span class="name" style="overflow:hidden;text-overflow:ellipsis;white-space:pre">[[Supr|supr]]</span></div></div><div class="divCell Team OldTeam" style="text-align:right"><span style="font-style:italic;margin-right:60px">&nbsp;None&nbsp;</span></div><div class="divCell Icon" style="width:70px;font-size:larger">&#x21d2;</div><div class="divCell Team NewTeam" style="text-align:left"><span style="font-style:italic;margin-left:60px">&nbsp;None&nbsp;</span></div><div class="divCell Ref">[https://x.com/streamerzone_gg/status/1844766204742832441 <i class="fad fa-external-link-alt wiki-color-dark"></i>]</div></div>
3 changes: 3 additions & 0 deletions standard/info/wikis/clashofclans/info.lua
Original file line number Diff line number Diff line change
Expand Up @@ -36,5 +36,8 @@ return {
status = 1,
matchWidth = 200,
},
transfers = {
showTeamName = true,
},
},
}
3 changes: 3 additions & 0 deletions standard/info/wikis/crossfire/info.lua
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,9 @@ return {
matchWidth = 190,
gameScoresIfBo1 = true,
},
transfers = {
showTeamName = true,
},
},
defaultRoundPrecision = 0,
}
3 changes: 3 additions & 0 deletions standard/info/wikis/formula1/info.lua
Original file line number Diff line number Diff line change
Expand Up @@ -35,5 +35,8 @@ return {
match2 = {
status = 0,
},
transfers = {
showTeamName = true,
},
},
}
3 changes: 3 additions & 0 deletions standard/info/wikis/freefire/info.lua
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,9 @@ return {
match2 = {
status = 0,
},
transfers = {
showTeamName = true,
},
},
defaultRoundPrecision = 0,
}
3 changes: 3 additions & 0 deletions standard/info/wikis/honorofkings/info.lua
Original file line number Diff line number Diff line change
Expand Up @@ -78,5 +78,8 @@ return {
matchWidthMobile = 110,
matchWidth = 190,
},
transfers = {
showTeamName = true,
},
},
}
3 changes: 3 additions & 0 deletions standard/info/wikis/leagueoflegends/info.lua
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,9 @@ return {
status = 2,
matchWidth = 200,
},
transfers = {
showTeamName = true,
},
},
defaultRoundPrecision = 0,
}
3 changes: 3 additions & 0 deletions standard/info/wikis/mobilelegends/info.lua
Original file line number Diff line number Diff line change
Expand Up @@ -37,5 +37,8 @@ return {
matchWidthMobile = 110,
matchWidth = 190,
},
transfers = {
showTeamName = true,
},
},
}
3 changes: 3 additions & 0 deletions standard/info/wikis/omegastrikers/info.lua
Original file line number Diff line number Diff line change
Expand Up @@ -36,5 +36,8 @@ return {
status = 0,
matchWidth = 180,
},
transfers = {
showTeamName = true,
},
},
}
3 changes: 3 additions & 0 deletions standard/info/wikis/pubgmobile/info.lua
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,9 @@ return {
match2 = {
status = 0,
},
transfers = {
showTeamName = true,
},
},
defaultRoundPrecision = 0,
}
3 changes: 3 additions & 0 deletions standard/info/wikis/smite/info.lua
Original file line number Diff line number Diff line change
Expand Up @@ -48,5 +48,8 @@ return {
match2 = {
status = 0,
},
transfers = {
showTeamName = true,
},
},
}
3 changes: 3 additions & 0 deletions standard/info/wikis/splatoon/info.lua
Original file line number Diff line number Diff line change
Expand Up @@ -63,5 +63,8 @@ return {
matchWidthMobile = 110,
matchWidth = 190,
},
transfers = {
showTeamName = true,
},
},
}
3 changes: 3 additions & 0 deletions standard/info/wikis/wildrift/info.lua
Original file line number Diff line number Diff line change
Expand Up @@ -37,5 +37,8 @@ return {
matchWidthMobile = 110,
matchWidth = 200,
},
transfers = {
showTeamName = true,
},
},
}
Loading