Skip to content

Commit 22a79ed

Browse files
author
dterefe
committed
Cleanup
1 parent 9ed4299 commit 22a79ed

File tree

2 files changed

+12
-5
lines changed

2 files changed

+12
-5
lines changed

DUUIWeb/src/lib/svelte/components/Drawer/ComponentDrawer.svelte

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -409,6 +409,10 @@
409409
component.target = registryEntry.registry_url
410410
? `${registryEntry.registry_url}${registryEntry.name}:${entryMetadata.tag}`
411411
: "";
412+
413+
if (component.target.startsWith('https://')) {
414+
component.target = component.target.replace(/^https?:\/\//, '');
415+
}
412416

413417
component.description = entryMetadata.description
414418
}

DUUIWeb/src/lib/svelte/components/Input/RegistryDropdown.svelte

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
import { onMount, createEventDispatcher } from 'svelte';
1616
import type {DUUIComponentMetaData, DUUIRegistryEntry} from "$lib/duui/component";
1717
import Tip from "$lib/svelte/components/Tip.svelte";
18-
import {infoToast} from "$lib/duui/utils/ui";
18+
import {errorToast, infoToast} from "$lib/duui/utils/ui";
1919
import Popup from "$lib/svelte/components/Popup.svelte";
2020
import Link from "$lib/svelte/components/Link.svelte";
2121
import Chip from "$lib/svelte/components/Chip.svelte"; // wherever you put the types
@@ -153,6 +153,9 @@
153153
154154
if (response.ok) {
155155
entries = await response.json()
156+
} else {
157+
toastStore.trigger(errorToast(`ERROR ${response.status}: ${response.statusText} \n Failed to fetch registry entries. Registry is not reachable.`))
158+
entries = [];
156159
}
157160
}
158161
@@ -352,10 +355,10 @@
352355
<Tip tipTheme="error">
353356
You have no registries available. Access can be granted by an administrator.
354357
</Tip>
355-
<!--{:else if !selectedRegistryEndpoint }-->
356-
<!-- <Tip tipTheme="tertiary">-->
357-
<!-- Please select a registry endpoint to view entries.-->
358-
<!-- </Tip>-->
358+
{:else if !entries.length }
359+
<Tip tipTheme="tertiary">
360+
No entries found in the selected registry.
361+
</Tip>
359362
{:else}
360363
<div class="overflow-visible">
361364

0 commit comments

Comments
 (0)