fix(front): fix selecting all participants in participant view

Signed-off-by: Thomas Citharel <tcit@tcit.fr>
This commit is contained in:
Thomas Citharel 2023-08-24 09:50:22 +02:00
parent 010a5e426d
commit beef3ff16d
No known key found for this signature in database
GPG key ID: A061B9DDE0CA0773

View file

@ -21,7 +21,7 @@
<div class=""> <div class="">
<o-field :label="t('Status')" horizontal label-for="role-select"> <o-field :label="t('Status')" horizontal label-for="role-select">
<o-select v-model="role" id="role-select"> <o-select v-model="role" id="role-select">
<option :value="null"> <option value="EVERYTHING">
{{ t("Everything") }} {{ t("Everything") }}
</option> </option>
<option :value="ParticipantRole.CREATOR"> <option :value="ParticipantRole.CREATOR">
@ -303,17 +303,15 @@ const participantsExportFormats = useParticipantsExportFormats();
const ellipsize = (text?: string) => const ellipsize = (text?: string) =>
text && text.substring(0, MESSAGE_ELLIPSIS_LENGTH).concat("…"); text && text.substring(0, MESSAGE_ELLIPSIS_LENGTH).concat("…");
// metaInfo() { const eventId = computed(() => props.eventId);
// return {
// title: this.t("Participants") as string, const ParticipantAllRoles = { ...ParticipantRole, EVERYTHING: "EVERYTHING" };
// };
// },
const page = useRouteQuery("page", 1, integerTransformer); const page = useRouteQuery("page", 1, integerTransformer);
const role = useRouteQuery( const role = useRouteQuery(
"role", "role",
ParticipantRole.PARTICIPANT, "EVERYTHING",
enumTransformer(ParticipantRole) enumTransformer(ParticipantAllRoles)
); );
const checkedRows = ref<IParticipant[]>([]); const checkedRows = ref<IParticipant[]>([]);
@ -325,10 +323,10 @@ const { result: participantsResult, loading: participantsLoading } = useQuery<{
}>( }>(
PARTICIPANTS, PARTICIPANTS,
() => ({ () => ({
uuid: props.eventId, uuid: eventId.value,
page: page.value, page: page.value,
limit: PARTICIPANTS_PER_PAGE, limit: PARTICIPANTS_PER_PAGE,
roles: role.value, roles: role.value === "EVERYTHING" ? undefined : role.value,
}), }),
() => ({ () => ({
enabled: enabled: