Skip to content

Commit

Permalink
fix: fix test
Browse files Browse the repository at this point in the history
Signed-off-by: lstocchi <[email protected]>
  • Loading branch information
lstocchi committed May 13, 2024
1 parent 8d871e9 commit 4b244e0
Show file tree
Hide file tree
Showing 14 changed files with 99 additions and 41 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,11 @@ function getConditionColour(type: string): string {
</div>
</svelte:fragment>
<svelte:fragment slot="tip">
<div class="inline-block py-2 px-4 rounded-md bg-charcoal-800 text-xs text-white" aria-label="tooltip">
{condition.message}
</div>
{#if condition.message}
<div class="inline-block py-2 px-4 rounded-md bg-charcoal-800 text-xs text-white" aria-label="tooltip">
{condition.message}
</div>
{/if}
</svelte:fragment>
</Tooltip>
{/each}
Expand Down
8 changes: 5 additions & 3 deletions packages/renderer/src/lib/donut/Donut.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,10 @@ $: tooltip = percent ? percent.toFixed(0) + '% ' + title + ' usage' : '';
</svg>
</svelte:fragment>
<svelte:fragment slot="tip">
<div class="inline-block py-2 px-4 rounded-md bg-charcoal-800 text-xs text-white" aria-label="tooltip">
{tooltip}
</div>
{#if tooltip}
<div class="inline-block py-2 px-4 rounded-md bg-charcoal-800 text-xs text-white" aria-label="tooltip">
{tooltip}
</div>
{/if}
</svelte:fragment>
</Tooltip>
Original file line number Diff line number Diff line change
Expand Up @@ -83,9 +83,11 @@ function assertNumericValueIsValid(value: number): boolean {
aria-label="{record.description}" />
</svelte:fragment>
<svelte:fragment slot="tip">
<div class="inline-block py-2 px-4 rounded-md bg-charcoal-800 text-xs text-white" aria-label="tooltip">
{numberInputErrorMessage}
</div>
{#if numberInputErrorMessage}
<div class="inline-block py-2 px-4 rounded-md bg-charcoal-800 text-xs text-white" aria-label="tooltip">
{numberInputErrorMessage}
</div>
{/if}
</svelte:fragment>
</Tooltip>
</div>
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,10 @@ $: if (error) {
</NumberInput>
</svelte:fragment>
<svelte:fragment slot="tip">
<div class="inline-block py-2 px-4 rounded-md bg-charcoal-800 text-xs text-white" aria-label="tooltip">
{error}
</div>
{#if error}
<div class="inline-block py-2 px-4 rounded-md bg-charcoal-800 text-xs text-white" aria-label="tooltip">
{error}
</div>
{/if}
</svelte:fragment>
</Tooltip>
32 changes: 32 additions & 0 deletions packages/renderer/src/lib/ui/ErrorMessage.svelte
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
<script lang="ts">
import { faExclamationCircle } from '@fortawesome/free-solid-svg-icons';
import { Tooltip } from '@podman-desktop/ui-svelte';
import Fa from 'svelte-fa';
export let error: string;
export let icon = false;
</script>

{#if icon}
{#if error !== undefined && error !== ''}
<Tooltip top>
<svelte:fragment slot="item">
<Fa size="1.1x" class="cursor-pointer text-red-500 {$$props.class}" icon="{faExclamationCircle}" />
</svelte:fragment>
<svelte:fragment slot="tip">
{#if error}
<div class="inline-block py-2 px-4 rounded-md bg-charcoal-800 text-xs text-white" aria-label="tooltip">
{error}
</div>
{/if}
</svelte:fragment>
</Tooltip>
{/if}
{:else}
<div
class="text-red-500 p-1 flex flex-row items-center {$$props.class}"
class:opacity-0="{error === undefined || error === ''}">
<Fa size="1.1x" class="cursor-pointer text-red-500" icon="{faExclamationCircle}" />
<div role="alert" aria-label="Error Message Content" class="ml-2">{error}</div>
</div>
{/if}
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,11 @@ $: text = getText($kubernetesCurrentContextState);
{text}
</svelte:fragment>
<svelte:fragment slot="tip">
<div class="inline-block py-2 px-4 rounded-md bg-charcoal-800 text-xs text-white" aria-label="tooltip">
{$kubernetesCurrentContextState.error}
</div>
{#if $kubernetesCurrentContextState.error}
<div class="inline-block py-2 px-4 rounded-md bg-charcoal-800 text-xs text-white" aria-label="tooltip">
{$kubernetesCurrentContextState.error}
</div>
{/if}
</svelte:fragment>
</Tooltip>
{:else}
Expand Down
8 changes: 5 additions & 3 deletions packages/renderer/src/lib/ui/LoadingIconButton.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,10 @@ $: style = disable
</button>
</svelte:fragment>
<svelte:fragment slot="tip">
<div class="inline-block py-2 px-4 rounded-md bg-charcoal-800 text-xs text-white" aria-label="tooltip">
{tooltip}
</div>
{#if tooltip}
<div class="inline-block py-2 px-4 rounded-md bg-charcoal-800 text-xs text-white" aria-label="tooltip">
{tooltip}
</div>
{/if}
</svelte:fragment>
</Tooltip>
8 changes: 5 additions & 3 deletions packages/renderer/src/lib/ui/NavItem.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,11 @@ onDestroy(() => {
<slot />
</svelte:fragment>
<svelte:fragment slot="tip">
<div class="inline-block py-2 px-4 rounded-md bg-charcoal-800 text-xs text-white" aria-label="tooltip">
{tooltip}
</div>
{#if tooltip}
<div class="inline-block py-2 px-4 rounded-md bg-charcoal-800 text-xs text-white" aria-label="tooltip">
{tooltip}
</div>
{/if}
</svelte:fragment>
</Tooltip>
</div>
Expand Down
8 changes: 5 additions & 3 deletions packages/renderer/src/lib/ui/NavSection.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,11 @@ onMount(() => {
</div>
</svelte:fragment>
<svelte:fragment slot="tip">
<div class="inline-block py-2 px-4 rounded-md bg-charcoal-800 text-xs text-white" aria-label="tooltip">
{tooltip}
</div>
{#if tooltip}
<div class="inline-block py-2 px-4 rounded-md bg-charcoal-800 text-xs text-white" aria-label="tooltip">
{tooltip}
</div>
{/if}
</svelte:fragment>
</Tooltip>
</button>
Expand Down
8 changes: 5 additions & 3 deletions packages/renderer/src/lib/ui/ProviderInfo.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,11 @@ function getProviderColour(providerName: string): string {
{provider}
</svelte:fragment>
<svelte:fragment slot="tip">
<div class="inline-block py-2 px-4 rounded-md bg-charcoal-800 text-xs text-white" aria-label="tooltip">
{context}
</div>
{#if context}
<div class="inline-block py-2 px-4 rounded-md bg-charcoal-800 text-xs text-white" aria-label="tooltip">
{context}
</div>
{/if}
</svelte:fragment></Tooltip>
{:else}
{provider}
Expand Down
8 changes: 5 additions & 3 deletions packages/renderer/src/lib/ui/StatusDot.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,10 @@ let dotClass = getStatusColor(status);
</svelte:fragment>

<svelte:fragment slot="tip">
<div class="inline-block py-2 px-4 rounded-md bg-charcoal-800 text-xs text-white" aria-label="tooltip">
{tooltip}
</div>
{#if tooltip}
<div class="inline-block py-2 px-4 rounded-md bg-charcoal-800 text-xs text-white" aria-label="tooltip">
{tooltip}
</div>
{/if}
</svelte:fragment>
</Tooltip>
8 changes: 5 additions & 3 deletions packages/renderer/src/lib/ui/WarningMessage.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,11 @@ export let icon = false;
<Fa size="1.125x" class="cursor-pointer text-amber-500" icon="{faTriangleExclamation}" />
</svelte:fragment>
<svelte:fragment slot="tip">
<div class="inline-block py-2 px-4 rounded-md bg-charcoal-800 text-xs text-white" aria-label="tooltip">
{error}
</div>
{#if error}
<div class="inline-block py-2 px-4 rounded-md bg-charcoal-800 text-xs text-white" aria-label="tooltip">
{error}
</div>
{/if}
</svelte:fragment>
</Tooltip>
{/if}
Expand Down
12 changes: 7 additions & 5 deletions packages/renderer/src/lib/welcome/WelcomePage.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -133,11 +133,13 @@ function startOnboardingQueue() {
{onboarding.displayName}
</svelte:fragment>
<svelte:fragment slot="tip">
<div
class="inline-block py-2 px-4 rounded-md bg-charcoal-800 text-xs text-white"
aria-label="tooltip">
{onboarding.description}
</div>
{#if onboarding.description}
<div
class="inline-block py-2 px-4 rounded-md bg-charcoal-800 text-xs text-white"
aria-label="tooltip">
{onboarding.description}
</div>
{/if}
</svelte:fragment>
</Tooltip>
</div>
Expand Down
8 changes: 5 additions & 3 deletions packages/ui/src/lib/alert/ErrorMessage.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,11 @@ export let icon = false;
<Fa size="1.1x" class="cursor-pointer text-red-500 {$$props.class}" icon="{faExclamationCircle}" />
</svelte:fragment>
<svelte:fragment slot="tip">
<div class="inline-block py-2 px-4 rounded-md bg-charcoal-800 text-xs text-white" aria-label="tooltip">
{error}
</div>
{#if error}
<div class="inline-block py-2 px-4 rounded-md bg-charcoal-800 text-xs text-white" aria-label="tooltip">
{error}
</div>
{/if}
</svelte:fragment>
</Tooltip>
{/if}
Expand Down

0 comments on commit 4b244e0

Please sign in to comment.