Conversation
dc89f7c to
c1f4fad
Compare
|
This is an initial version of a (potentially standardized) SquadAuto, without TimelineAuto. Once all wikis are on this version, there are also further simplifications possible (e.g. merging SquadAutoPerson and SquadPerson types) |
hjpalpha
left a comment
There was a problem hiding this comment.
spaces --> tabs pls ;)
hjpalpha
left a comment
There was a problem hiding this comment.
probably oos, but long term we probably should use the model for the transfer queries
overall, seems reasonable on phone
ElectricalBoy
left a comment
There was a problem hiding this comment.
some strings use " and others use '; we should use ' to stay consistent with the rest of Lua files
|
Marking this as ready for review. Idea is still to roll out wiki-by-wiki and fix (or implement) necessary things. |
|
Test page with comparison new (left) vs old squadauto: |
| Array.forEach(self.config.teams, function (templatename) | ||
| conditions:add{ | ||
| Condition.Node(Condition.ColumnName('fromteamtemplate'), Comparator.eq, templatename), | ||
| Condition.Node(Condition.ColumnName('extradata_fromteamsectemplate'), Comparator.eq, templatename), | ||
| Condition.Node(Condition.ColumnName('toteamtemplate'), Comparator.eq, templatename), | ||
| Condition.Node(Condition.ColumnName('extradata_toteamsectemplate'), Comparator.eq, templatename) | ||
| } | ||
| end) |
There was a problem hiding this comment.
use ConditionUtil.anyOf maybe?
There was a problem hiding this comment.
In what way? It's not a list of values, but a list of columns.
Unless you mean to create an array of columns, and then use anyOf for the list of teams
There was a problem hiding this comment.
| Array.forEach(self.config.teams, function (templatename) | |
| conditions:add{ | |
| Condition.Node(Condition.ColumnName('fromteamtemplate'), Comparator.eq, templatename), | |
| Condition.Node(Condition.ColumnName('extradata_fromteamsectemplate'), Comparator.eq, templatename), | |
| Condition.Node(Condition.ColumnName('toteamtemplate'), Comparator.eq, templatename), | |
| Condition.Node(Condition.ColumnName('extradata_toteamsectemplate'), Comparator.eq, templatename) | |
| } | |
| end) | |
| conditions:add{ | |
| Condition.Util.anyOf(Condition.ColumnName('fromteamtemplate'), self.config.teams), | |
| Condition.Util.anyOf(Condition.ColumnName('extradata_fromteamsectemplate'), self.config.teams), | |
| Condition.Util.anyOf(Condition.ColumnName('toteamtemplate'), self.config.teams), | |
| Condition.Util.anyOf(Condition.ColumnName('extradata_toteamsectemplate'), self.config.teams), | |
| } |
like this?
I'd prefer the current way, as it is IMO easier to digest and also leads to a simpler rendered condition.
| Condition.Tree(BooleanOperator.any):add{ | ||
| Condition.Node(Condition.ColumnName('date'), Comparator.gt, date), | ||
| } |
There was a problem hiding this comment.
| Condition.Tree(BooleanOperator.any):add{ | |
| Condition.Node(Condition.ColumnName('date'), Comparator.gt, date), | |
| } | |
| Condition.Node(Condition.ColumnName('date'), Comparator.gt, date), |
maybe use Comparator.ge?
There was a problem hiding this comment.
That wouldn't work (at least not on it's own) as you'd get the transfer of the person leaving, whereas we are interested in the next transfer of the person joining.
Would need to also check for lt objectid (if eq date) or something.
Co-authored-by: ElectricalBoy <15651807+ElectricalBoy@users.noreply.github.com>
hjpalpha
left a comment
There was a problem hiding this comment.
on mobile, so could be easily wrong, but does this kick the Squad/rank stuff?
if yes we can expect the wikis that use it to cry if this goes live
It's not supposed to kick it, just not implemented yet. |
Summary
Replace old, unmaintainable SquadAuto with a version that is hopefully a bit easier to maintain.
How did you test this change?
dev