-
-
Notifications
You must be signed in to change notification settings - Fork 860
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
Show only breaking participants in check-in screen #2556
base: develop
Are you sure you want to change the base?
Changes from all commits
2747a76
56527b9
eb79a1c
281a5ec
548311e
bf6883e
a27433b
68681f1
cc1229f
f56f323
ba12382
e6d3f2b
0475adf
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,7 +16,20 @@ | |
</button> | ||
</div> | ||
|
||
<div class="btn-group mb-md-0 mb-3" v-if="!isForVenues"> | ||
<!-- Filter for Breaking status --> | ||
<div class="btn-group mb-md-0 mb-3" v-if="this.isBreakRound"> | ||
<button | ||
v-for="(optionState, optionKey) in filterByBreaking || {}" | ||
:key="optionKey" | ||
type="button" | ||
:class="['btn btn-outline-primary', optionState ? 'active' : '']" | ||
@click="setListContext('filterByBreaking', optionKey, !optionState)"> | ||
<span v-if="optionKey === 'All'" v-text="gettext('All')"></span> | ||
<span v-if="optionKey === 'Breaking'" v-text="gettext('Breaking')"></span> | ||
</button> | ||
</div> | ||
|
||
<div class="btn-group mb-md-0 mb-3" v-if="!isForVenues"> | ||
<button v-for="(optionState, optionKey) in this.filterByType" | ||
:key="optionKey" type="button" | ||
:class="['btn btn-outline-primary', optionState ? 'active' : '']" | ||
|
@@ -145,6 +158,10 @@ export default { | |
filterByPresence: { | ||
All: true, Absent: false, Present: false, | ||
}, | ||
filterByBreaking: { | ||
All: true, | ||
Breaking: false, | ||
}, | ||
sockets: ['checkins'], | ||
// Keep internal copy as events needs to be mutated by the websocket | ||
// pushed changes and the data is never updated by the parent | ||
|
@@ -158,6 +175,8 @@ export default { | |
tournamentSlug: String, | ||
forAdmin: Boolean, | ||
teamSize: Number, | ||
breakingTeamShortNames: Array, | ||
isBreakRound: Boolean, | ||
}, | ||
computed: { | ||
statsAbsent: function () { | ||
|
@@ -220,7 +239,9 @@ export default { | |
}) | ||
}, | ||
entitiesBySortingSetting: function () { | ||
if (this.sortByGroup.Category === true) { | ||
if (this.filterByBreaking.Breaking === true) { | ||
return this.entitiesByBreaking | ||
} else if (this.sortByGroup.Category === true) { | ||
return this.venuesByCategory | ||
} else if (this.sortByGroup.Priority === true) { | ||
return this.venuesByPriority | ||
|
@@ -233,6 +254,28 @@ export default { | |
} | ||
return this.entitiesByTime | ||
}, | ||
entitiesByBreaking: function () { | ||
const isBreaking = (entityByPresence) => { | ||
if (entityByPresence.type === 'Adjudicator') { | ||
return entityByPresence.breaking | ||
} else if (this.breakingTeamShortNames.includes(entityByPresence.name)) { | ||
return true | ||
} | ||
return false | ||
} | ||
if (this.filterByBreaking.All) { | ||
return this.entitiesByPresence // No filter | ||
} else if (this.filterByBreaking.Breaking) { | ||
console.log('Breaking Teams and Adjudicators') | ||
// print each object in the array | ||
const temp = this.entitiesByPresence.filter(isBreaking) | ||
for (let i = 0; i < temp.length; i++) { | ||
console.log(temp[i]) | ||
} | ||
Comment on lines
+269
to
+274
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Avoid using There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yep, it's just temporary, will remove |
||
return this.entitiesByPresence.filter(isBreaking) | ||
} | ||
return this.entitiesByPresence | ||
}, | ||
tournamentSlugForWSPath: function () { | ||
return this.tournamentSlug | ||
}, | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We'd have to set |
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 using team IDs be shorter and avoid needing to escape the strings?
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.
Will do