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

DT-2179 - fix wf reset button & other fixes #2133

Merged
merged 4 commits into from
Jun 3, 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
6 changes: 4 additions & 2 deletions src/lib/components/side-nav.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -72,14 +72,16 @@
label={translate('common.namespaces')}
icon="namespace"
/>
</IsLegacyCloudGuard>
<slot name="middle" />
<IsCloudGuard {isCloud}>
<NavigationItem
link={linkList.docs}
data-testid="docs-button"
label={translate('common.docs')}
icon="book"
/>
</IsLegacyCloudGuard>
<slot name="middle" />
</IsCloudGuard>
</svelte:fragment>
<svelte:fragment slot="bottom">
<slot name="bottom" />
Expand Down
11 changes: 6 additions & 5 deletions src/lib/components/workflow-actions.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -60,11 +60,6 @@
}
}

$: resetAllowed =
resetEnabled &&
workflow?.pendingChildren?.length === 0 &&
$resetEvents.length > 0;

$: workflowActions = [
{
label: translate('workflows.reset'),
Expand Down Expand Up @@ -97,6 +92,12 @@
$: actionsDisabled =
$coreUser.namespaceWriteDisabled(namespace) ||
!writeActionsAreAllowed(settings);

$: resetAllowed =
resetEnabled &&
workflow?.pendingChildren?.length === 0 &&
$resetEvents.length > 0 &&
!actionsDisabled;
</script>

{#if isRunning}
Expand Down
27 changes: 18 additions & 9 deletions src/lib/holocene/api-pagination.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
import { isError } from '$lib/utilities/is';

type T = $$Generic;
interface $$Props extends HTMLAttributes<HTMLDivElement> {
type BaseProps = HTMLAttributes<HTMLDivElement> & {
onError?: (error: Error | unknown) => void | undefined;
onFetch: () => Promise<PaginatedRequest<T>>;
onShiftUp?: (event: KeyboardEvent) => void | undefined;
Expand All @@ -31,9 +31,18 @@
itemsKeyname?: string;
previousButtonLabel: string;
nextButtonLabel: string;
filterable?: boolean | undefined;
filterInputLabel?: string | undefined;
}
};

type NonFilterableProps = {
filterable?: false;
};

type FilterableProps = {
filterable: true;
filterInputPlaceholder: string;
};

type $$Props = BaseProps & (FilterableProps | NonFilterableProps);

type PaginatedRequest<T> = (
size: number,
Expand All @@ -58,7 +67,7 @@
export let previousButtonLabel: string;
export let nextButtonLabel: string;
export let filterable = false;
export let filterInputLabel: string = undefined;
export let filterInputPlaceholder: string = undefined;

let query = '';

Expand Down Expand Up @@ -205,15 +214,15 @@
<slot name="action-top-left" visibleItems={$store.visibleItems} />
</div>
{/if}
{#if filterable && filterInputLabel}
{#if filterable && filterInputPlaceholder}
<Input
icon="search"
id="api-pagination-search-input"
class="grow"
bind:value={query}
slot="action-top-left"
label={filterInputLabel}
label={filterInputPlaceholder}
labelHidden
placeholder={filterInputLabel}
placeholder={filterInputPlaceholder}
on:input={debounce(handleFilter, 1000)}
on:clear={handleFilter}
clearable
Expand Down
Loading