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

Add possibility to search for guests in invites #359

Merged
merged 1 commit into from
Nov 12, 2024
Merged
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
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