diff --git a/src/lib/components/bottom-nav-namespaces.svelte b/src/lib/components/bottom-nav-namespaces.svelte
index e0a04ee5fc..7f44d0b3e3 100644
--- a/src/lib/components/bottom-nav-namespaces.svelte
+++ b/src/lib/components/bottom-nav-namespaces.svelte
@@ -4,16 +4,22 @@
import type { NamespaceListItem } from '$lib/types/global';
import { sortAlphabetically } from '$lib/utilities/sort-alphabetically';
- export let open = false;
- export let namespaceList: NamespaceListItem[] = [];
+ interface Props {
+ open?: boolean;
+ namespaceList?: NamespaceListItem[];
+ }
+
+ let { open = false, namespaceList = [] }: Props = $props();
- let search = '';
+ let search = $state('');
- $: namespaces = sortAlphabetically(
- search
- ? namespaceList.filter(({ namespace }) => namespace.includes(search))
- : namespaceList,
- (ns) => ns.namespace,
+ const namespaces = $derived(
+ sortAlphabetically(
+ search
+ ? namespaceList.filter(({ namespace }) => namespace.includes(search))
+ : namespaceList,
+ (ns) => ns.namespace,
+ ),
);
@@ -35,7 +41,11 @@
diff --git a/src/lib/components/lines-and-dots/event-type-filter.svelte b/src/lib/components/lines-and-dots/event-type-filter.svelte
index 9de9f2e660..54c570299b 100644
--- a/src/lib/components/lines-and-dots/event-type-filter.svelte
+++ b/src/lib/components/lines-and-dots/event-type-filter.svelte
@@ -2,7 +2,7 @@
import { writable } from 'svelte/store';
import { goto } from '$app/navigation';
- import { page } from '$app/stores';
+ import { page } from '$app/state';
import Checkbox from '$lib/holocene/checkbox.svelte';
import Icon from '$lib/holocene/icon/icon.svelte';
@@ -26,43 +26,46 @@
import { CategoryIcon } from './constants';
- export let compact = false;
+ interface Props {
+ compact?: boolean;
+ }
- let open = writable(false);
+ let { compact = false }: Props = $props();
- $: defaultOptions = compact
- ? compactEventTypeOptions.map((o) => o.value)
- : allEventTypeOptions.map((o) => o.value);
+ const open = writable(false);
- $: options = [
- ...(compact ? compactEventTypeOptions : allEventTypeOptions).map((o) => ({
- ...o,
- label: translate(o.label),
- icon: CategoryIcon[o.value],
- description: translate(o.description),
- })),
- ];
+ const defaultOptions = $derived(
+ compact
+ ? compactEventTypeOptions.map((o) => o.value)
+ : allEventTypeOptions.map((o) => o.value),
+ );
- $: {
+ const options = $derived.by(() => {
+ let list = (compact ? compactEventTypeOptions : allEventTypeOptions).map(
+ (o) => ({
+ ...o,
+ label: translate(o.label),
+ icon: CategoryIcon[o.value],
+ description: o.description ? translate(o.description) : '',
+ }),
+ );
if (isVersionNewer('1.21.0', $temporalVersion)) {
- options = options.filter(({ value }) => value !== 'update');
+ list = list.filter(({ value }) => value !== 'update');
}
- }
-
- $: {
- if (!nexusEnabled($page.data.systemInfo?.capabilities)) {
- options = options.filter(({ value }) => value !== 'nexus');
+ if (!nexusEnabled(page.data.systemInfo?.capabilities)) {
+ list = list.filter(({ value }) => value !== 'nexus');
}
- }
+ return list;
+ });
- const onOptionClick = ({ value }) => {
+ const onOptionClick = ({ value }: (typeof options)[number]) => {
clearActiveGroups();
const newCategories = $eventTypeFilter.some((type) => type === value)
? $eventTypeFilter.filter((type) => type !== value)
: [...$eventTypeFilter, value];
$eventTypeFilter = newCategories;
updateEventFilterParams(
- $page.url,
+ page.url,
{
categories:
newCategories.length === defaultOptions.length ? null : newCategories,
@@ -75,7 +78,7 @@
$eventTypeFilter = defaultOptions;
$eventStatusFilter = false;
updateEventFilterParams(
- $page.url,
+ page.url,
{ categories: null, statusFilter: false },
goto,
);
@@ -85,7 +88,7 @@
$eventTypeFilter = defaultOptions;
$eventStatusFilter = !$eventStatusFilter;
updateEventFilterParams(
- $page.url,
+ page.url,
{ categories: null, statusFilter: !$eventStatusFilter },
goto,
);
@@ -95,13 +98,15 @@
$eventTypeFilter = [];
$eventStatusFilter = false;
updateEventFilterParams(
- $page.url,
+ page.url,
{ categories: [], statusFilter: false },
goto,
);
};
- $: filterActive = $eventTypeFilter.length < defaultOptions.length;
+ const filterActive = $derived(
+ $eventTypeFilter.length < defaultOptions.length,
+ );
@@ -111,7 +116,10 @@
class="flex h-6 w-6 flex-col items-center justify-center rounded-full transition-colors duration-200"
class:bg-interactive={filterActive}
>
-
+
{/snippet}
{translate('common.filter')}
@@ -167,7 +175,7 @@
{translate('common.none')}
- {#each options as option}
+ {#each options as option (option.value)}