Skip to content

Commit

Permalink
Merge pull request #359 from TFNS/0-search-through-guests
Browse files Browse the repository at this point in the history
Add possibility to search for guests in invites
  • Loading branch information
JJ-8 authored Nov 12, 2024
2 parents bb0d4de + 0d0fe63 commit a9e4666
Showing 1 changed file with 19 additions and 1 deletion.
20 changes: 19 additions & 1 deletion front/src/components/CTF/Guests.vue
Original file line number Diff line number Diff line change
@@ -1,6 +1,15 @@
<template>
<div class="q-gutter-md">
<div class="row text-h6">Invite guests</div>
<div class="row q-mt-sm">
<div style="width: 590px">
<q-input v-model="filter" filled dense placeholder="Search">
<template #prepend>
<q-icon name="search" />
</template>
</q-input>
</div>
</div>
<div class="row q-mt-sm" style="margin-left: 12px">
<template v-if="guestsWithInvitation.length > 0">
<div
Expand Down Expand Up @@ -61,8 +70,10 @@ export default defineComponent({
const team = ctfnote.profiles.injectTeam();
const now = ref(new Date());
const settings = ctfnote.settings.injectSettings();
const filter = ref('');
return {
filter,
now,
team,
settings,
Expand All @@ -79,7 +90,14 @@ export default defineComponent({
);
},
guestsWithInvitation() {
return this.guests.map((g) => {
let guests = this.guests;
if (this.filter) {
guests = guests.filter((g) =>
g.username.toLowerCase().includes(this.filter.toLowerCase()),
);
}
return guests.map((g) => {
const invitation = this.ctf.invitations.find(
(i) => i.profileId == g.id,
);
Expand Down

0 comments on commit a9e4666

Please sign in to comment.