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

Show servicebody dropdown by default and expanded as well as all filters #1141

Merged
merged 1 commit into from
Nov 12, 2024
Merged
Show file tree
Hide file tree
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
62 changes: 30 additions & 32 deletions src/resources/js/components/MeetingsList.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -240,16 +240,16 @@

<TableSearch placeholder={$translations.filter} hoverable={true} bind:inputValue={searchTerm} {divClass} {innerDivClass} {searchClass} {classInput}>
<div slot="header" class="flex w-full flex-shrink-0 flex-col items-stretch justify-end space-y-2 md:w-auto md:flex-row md:items-center md:space-x-3 md:space-y-0">
<Button color="alternative" class="relative" aria-label={$translations.serviceBodiesTitle}>
{$translations.serviceBodiesTitle}
{#if selectedServiceBodies.length > 0}
{#if serviceBodies.length > 1}
<Button color="alternative" class="relative" aria-label={$translations.serviceBodiesTitle}>
{$translations.serviceBodiesTitle}
<Indicator color="red" size="sm" placement="top-right" />
{/if}
</Button>
<Dropdown class="w-90 top-full z-50 space-y-2 p-3 text-sm">
<h6 class="mb-3 text-sm font-medium text-gray-900 dark:text-white">{$translations.searchByServiceBody}</h6>
<ServiceBodiesTree {serviceBodies} bind:selectedValues={selectedServiceBodies} />
</Dropdown>
</Button>
<Dropdown class="w-90 top-full z-50 space-y-2 p-3 text-sm" open={true}>
<h6 class="mb-3 text-sm font-medium text-gray-900 dark:text-white">{$translations.searchByServiceBody}</h6>
<ServiceBodiesTree {serviceBodies} bind:selectedValues={selectedServiceBodies} />
</Dropdown>
{/if}
<Button color="alternative" class="relative" aria-label={$translations.day}>
{$translations.day}
{#if selectedDays.length > 0}
Expand All @@ -263,29 +263,27 @@
</Button>
<Checkbox name="weekdays" choices={weekdayChoices} bind:group={selectedDays} groupLabelClass="justify-between" />
</Dropdown>
{#if meetings.length}
<Button color="alternative" class="relative">
{$translations.published}
{#if selectedPublished.length > 0}
<Indicator color="red" size="sm" placement="top-right" />
{/if}
<FilterSolid class="ml-2 h-3 w-3 " />
</Button>
<Dropdown class="w-48 space-y-2 p-3 text-sm">
<Checkbox name="times" choices={publishedChoices} bind:group={selectedPublished} groupInputClass="ms-2" groupLabelClass="" />
</Dropdown>
<Button color="alternative" class="relative">
{$translations.time}
{#if selectedTimes.length > 0}
<Indicator color="red" size="sm" placement="top-right" />
{/if}
<FilterSolid class="ml-2 h-3 w-3 " />
</Button>
<Dropdown class="w-48 space-y-2 p-3 text-sm">
<h6 class="mb-3 text-sm font-medium text-gray-900 dark:text-white">{$translations.chooseStartTime}</h6>
<Checkbox name="times" choices={timeChoices} bind:group={selectedTimes} groupInputClass="ms-2" groupLabelClass="" />
</Dropdown>
{/if}
<Button color="alternative" class="relative">
{$translations.published}
{#if selectedPublished.length > 0}
<Indicator color="red" size="sm" placement="top-right" />
{/if}
<FilterSolid class="ml-2 h-3 w-3 " />
</Button>
<Dropdown class="w-48 space-y-2 p-3 text-sm">
<Checkbox name="times" choices={publishedChoices} bind:group={selectedPublished} groupInputClass="ms-2" groupLabelClass="" />
</Dropdown>
<Button color="alternative" class="relative">
{$translations.time}
{#if selectedTimes.length > 0}
<Indicator color="red" size="sm" placement="top-right" />
{/if}
<FilterSolid class="ml-2 h-3 w-3 " />
</Button>
<Dropdown class="w-48 space-y-2 p-3 text-sm">
<h6 class="mb-3 text-sm font-medium text-gray-900 dark:text-white">{$translations.chooseStartTime}</h6>
<Checkbox name="times" choices={timeChoices} bind:group={selectedTimes} groupInputClass="ms-2" groupLabelClass="" />
</Dropdown>
<Button on:click={searchMeetings}>{$translations.search}</Button>
{#if $authenticatedUser?.type !== 'observer'}
<Button on:click={() => handleAdd()} aria-label={$translations.addMeeting}><PlusOutline class="mr-2 h-3.5 w-3.5" />{$translations.addMeeting}</Button>
Expand Down
1 change: 1 addition & 0 deletions src/resources/js/components/ServiceBodiesTree.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
label: sb.name,
value: sb.id.toString(),
checked: selectedValues.includes(sb.id.toString()),
expanded: true,
children: []
};
});
Expand Down