Skip to content
Open
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
4 changes: 2 additions & 2 deletions src/lib/components/event/event-date-filter.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -68,13 +68,13 @@
{#each sortOptions as { option, label }}
<MenuItem
selected={$eventFilterSort === option}
on:click={() => onSortOptionClick(option)}>{label}</MenuItem
onclick={() => onSortOptionClick(option)}>{label}</MenuItem
>
{/each}
<MenuDivider />
<MenuItem
selected={$eventShowElapsed === 'true'}
on:click={onShowElapsedClick}
onclick={onShowElapsedClick}
>{translate('events.show-elapsed-time')}</MenuItem
>
</Menu>
Expand Down
4 changes: 2 additions & 2 deletions src/lib/components/lines-and-dots/event-sort-filter.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -68,13 +68,13 @@
{#each sortOptions as { option, label }}
<MenuItem
selected={$eventFilterSort === option}
on:click={() => onSortOptionClick(option)}>{label}</MenuItem
onclick={() => onSortOptionClick(option)}>{label}</MenuItem
>
{/each}
<MenuDivider />
<MenuItem
selected={$eventShowElapsed === 'true'}
on:click={onShowElapsedClick}
onclick={onShowElapsedClick}
>{translate('events.show-elapsed-time')}</MenuItem
>
</Menu>
Expand Down
111 changes: 58 additions & 53 deletions src/lib/components/lines-and-dots/event-type-filter.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -66,13 +66,14 @@

<MenuContainer {open}>
<MenuButton controls="status-menu" size="sm">
<div
slot="leading"
class="flex h-6 w-6 flex-col items-center justify-center rounded-full transition-colors duration-200"
class:bg-interactive={filterActive}
>
<Icon name="filter" class={filterActive && 'pt-0.5 text-white'} />
</div>
{#snippet leading()}
<div
class="flex h-6 w-6 flex-col items-center justify-center rounded-full transition-colors duration-200"
class:bg-interactive={filterActive}
>
<Icon name="filter" class={filterActive && 'pt-0.5 text-white'} />
</div>
{/snippet}
<span class="hidden text-sm md:block">{translate('common.filter')}</span>
</MenuButton>
<Menu
Expand All @@ -83,87 +84,91 @@
>
<MenuItem
data-testid={translate('common.all')}
on:click={() => {
onclick={() => {
$eventTypeFilter = defaultOptions;
$eventStatusFilter = false;
}}
>
<Checkbox
on:change={() => {
$eventTypeFilter = defaultOptions;
$eventStatusFilter = false;
}}
slot="leading"
checked={!$eventStatusFilter &&
$eventTypeFilter.length === defaultOptions.length}
label={translate('common.all')}
labelHidden
class="mt-px"
/>
{#snippet leading()}
<Checkbox
on:change={() => {
$eventTypeFilter = defaultOptions;
$eventStatusFilter = false;
}}
checked={!$eventStatusFilter &&
$eventTypeFilter.length === defaultOptions.length}
label={translate('common.all')}
labelHidden
class="mt-px"
/>
{/snippet}
{translate('common.all')}
</MenuItem>
{#if $eventViewType !== 'json'}
<MenuItem
data-testid={translate('common.pending-and-failed')}
description={translate('common.pending-and-failed-description')}
on:click={() => {
onclick={() => {
$eventTypeFilter = defaultOptions;
$eventStatusFilter = !$eventStatusFilter;
}}
class="items-start"
>
<Checkbox
on:change={() => {
$eventTypeFilter = defaultOptions;
$eventStatusFilter = !$eventStatusFilter;
}}
slot="leading"
checked={$eventStatusFilter}
label={translate('common.all')}
labelHidden
class="mt-px"
/>
{#snippet leading()}
<Checkbox
on:change={() => {
$eventTypeFilter = defaultOptions;
$eventStatusFilter = !$eventStatusFilter;
}}
checked={$eventStatusFilter}
label={translate('common.all')}
labelHidden
class="mt-px"
/>
{/snippet}
{translate('common.pending-and-failed')}
</MenuItem>
{/if}
<MenuItem
data-testid={translate('common.none')}
on:click={() => {
onclick={() => {
$eventTypeFilter = [];
$eventStatusFilter = false;
}}
>
<Checkbox
on:change={() => {
$eventTypeFilter = [];
$eventStatusFilter = false;
}}
slot="leading"
checked={!$eventStatusFilter && !$eventTypeFilter.length}
label={translate('common.none')}
labelHidden
class="mt-px"
/>
{#snippet leading()}
<Checkbox
on:change={() => {
$eventTypeFilter = [];
$eventStatusFilter = false;
}}
checked={!$eventStatusFilter && !$eventTypeFilter.length}
label={translate('common.none')}
labelHidden
class="mt-px"
/>
{/snippet}
{translate('common.none')}
</MenuItem>
<MenuDivider />
{#each options as option}
<MenuItem
data-testid={option.label}
description={option.description}
on:click={() => {
onclick={() => {
onOptionClick(option);
}}
class="items-start"
>
<Checkbox
on:click={() => onOptionClick(option)}
slot="leading"
checked={$eventTypeFilter.some((type) => type === option.value)}
label={option.label}
labelHidden
class="mt-px"
/>
{#snippet leading()}
<Checkbox
on:click={() => onOptionClick(option)}
checked={$eventTypeFilter.some((type) => type === option.value)}
label={option.label}
labelHidden
class="mt-px"
/>
{/snippet}
{option.label}
</MenuItem>
{/each}
Expand Down
7 changes: 2 additions & 5 deletions src/lib/components/namespace-picker.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,7 @@
);
$: href = routeForNamespace({ namespace });

const handleNamespaceSelect = (
event: CustomEvent<{ value: NamespaceListItem }>,
) => {
const namespaceListItem = event.detail.value;
const handleNamespaceSelect = (namespaceListItem: NamespaceListItem) => {
$lastUsedNamespace = namespaceListItem.namespace;
namespaceListItem?.onClick(namespaceListItem.namespace);
};
Expand All @@ -34,7 +31,7 @@
leadingIcon="namespace-switcher"
options={namespaceList}
optionValueKey="namespace"
on:change={handleNamespaceSelect}
onchange={handleNamespaceSelect}
minSize={32}
actionTooltip={translate('namespaces.go-to-namespace')}
{href}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
<Menu id="boolean-filter-menu">
{#each options as { value, label }}
<MenuItem
on:click={() => {
onclick={() => {
if (isNullConditional(value)) {
$filter.conditional = value;
$filter.value = null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@
<Menu id="conditional-menu" class="whitespace-nowrap">
{#each conditionalOptions as { value, label }}
<MenuItem
on:click={() => {
onclick={() => {
$filter.conditional = value;
$focusedElementId = inputId;
if (isNullConditional(value)) handleNullFilter();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@
</div>
</MenuItem>
{:else}
<MenuItem on:click={() => ($timeFormatType = 'relative')}>
<MenuItem onclick={() => ($timeFormatType = 'relative')}>
<div class="flex flex-col">
<RadioInput
label={translate('common.relative')}
Expand Down Expand Up @@ -223,7 +223,7 @@
</div>
</MenuItem>
<MenuDivider />
<MenuItem on:click={() => ($timeFormatType = 'absolute')}>
<MenuItem onclick={() => ($timeFormatType = 'absolute')}>
<div class="flex flex-col gap-2">
<RadioInput
label={translate('common.absolute')}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,21 +61,21 @@
id="search-attribute-filter-button"
controls="search-attribute-menu"
disabled={$activeQueryIndex !== null || query?.length >= MAX_QUERY_LENGTH}
on:click={() => (searchAttributeValue = '')}
onclick={() => (searchAttributeValue = '')}
class="text-nowrap"
>
<svelte:fragment slot="leading">
{#snippet leading()}
{#if !$filter.attribute}
<Icon name="add" />
{/if}
</svelte:fragment>
{/snippet}
{$filter.attribute || 'Search Attribute'}
</MenuButton>
<Menu id="search-attribute-menu" keepOpen>
<MenuItem
class="p-0"
hoverable={false}
on:click={() => {
onclick={() => {
document.getElementById('filter-search')?.focus();
}}
>
Expand All @@ -95,7 +95,7 @@
{#each filteredOptions as { value, label, type }}
{@const disabled = isOptionDisabled(value, filters)}
<MenuItem
on:click={() => {
onclick={() => {
handleNewQuery(value, type);
}}
{disabled}
Expand Down
21 changes: 11 additions & 10 deletions src/lib/components/search-attribute-filter/status-filter.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -84,10 +84,10 @@
};
</script>

<MenuContainer {open} on:close={resetFilter}>
<MenuContainer {open} onclose={resetFilter}>
<MenuButton
controls="status-menu"
on:click={() => {
onclick={() => {
if ($open) resetFilter();
}}
>
Expand All @@ -100,17 +100,18 @@
(!statusFilters.length && status === 'All')}
<MenuItem
data-testid={status}
on:click={() => {
onclick={() => {
onStatusClick(status);
}}
>
<Checkbox
on:click={() => onStatusClick(status)}
slot="leading"
{checked}
label={status}
labelHidden
/>
{#snippet leading()}
<Checkbox
on:click={() => onStatusClick(status)}
{checked}
label={status}
labelHidden
/>
{/snippet}
{#if status === 'All'}
<Translate key="workflows.all-statuses" />
{:else}
Expand Down
8 changes: 5 additions & 3 deletions src/lib/components/timezone-select.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,9 @@
{size}
data-testid="timezones-menu-button"
>
<Icon slot="leading" name="clock" />
{#snippet leading()}
<Icon name="clock" />
{/snippet}
{timezone}
</MenuButton>
<Menu
Expand Down Expand Up @@ -185,7 +187,7 @@
{#if !search}
{#each QuickTimezoneOptions as { value, label }}
<MenuItem
on:click={() => selectTimezone(value)}
onclick={() => selectTimezone(value)}
data-testid={`timezones-${value}`}
selected={value === $timeFormat}
description={value === 'local' && localTime}
Expand All @@ -200,7 +202,7 @@
{#each filteredOptions as { value, label, offset, abbr }}
<MenuItem
selected={value === $timeFormat}
on:click={() => selectTimezone(value)}
onclick={() => selectTimezone(value)}
description={formatUTCOffset(offset, translate('common.utc'))}
>
{label} ({abbr})
Expand Down
8 changes: 4 additions & 4 deletions src/lib/components/workflow-actions.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@
<MenuDivider />
{/if}
<MenuItem
on:click={onClick}
onclick={onClick}
{destructive}
disabled={!enabled}
data-testid={testId}
Expand All @@ -194,7 +194,7 @@
{#if !workflowCreateDisabled($page)}
<MenuDivider />
<MenuItem
on:click={() =>
onclick={() =>
goto(
routeForWorkflowStart({
namespace,
Expand Down Expand Up @@ -230,7 +230,7 @@
</MenuButton>
<Menu id="workflow-actions" position="right" class="w-[16rem]">
<MenuItem
on:click={() =>
onclick={() =>
goto(
routeForWorkflowStart({
namespace,
Expand All @@ -248,7 +248,7 @@
{#if terminateEnabled && next}
<MenuDivider />
<MenuItem
on:click={() => (terminateConfirmationModalOpen = true)}
onclick={() => (terminateConfirmationModalOpen = true)}
data-testid="terminate-button"
destructive
>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@
<Option {value} {description}>{value}</Option>
{/each}
<Option
on:click={handleCustom}
onclick={handleCustom}
value="custom"
description="Input Signal name">Custom</Option
>
Expand Down
Loading
Loading