Skip to content

Commit

Permalink
refactor: move EmptyScreen/FilteredEmptyScreen to ui package (podman-…
Browse files Browse the repository at this point in the history
…desktop#7278)

* refactor: move EmptyScreen/FilteredEmptyScreen to ui package

Fixes podman-desktop#6919

Signed-off-by: Jeff MAURY <[email protected]>
  • Loading branch information
jeffmaury authored May 23, 2024
1 parent 6b615e4 commit 41d943a
Show file tree
Hide file tree
Showing 36 changed files with 114 additions and 66 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<script lang="ts">
import 'xterm/css/xterm.css';
import { EmptyScreen } from '@podman-desktop/ui-svelte';
import { onDestroy, onMount } from 'svelte';
import { Terminal } from 'xterm';
import { FitAddon } from 'xterm-addon-fit';
Expand All @@ -9,7 +10,6 @@ import { TerminalSettings } from '../../../../main/src/plugin/terminal-settings'
import { getPanelDetailColor } from '../color/color';
import { ansi256Colours, colourizedANSIContainerName } from '../editor/editor-utils';
import { isMultiplexedLog } from '../stream/stream-utils';
import EmptyScreen from '../ui/EmptyScreen.svelte';
import NoLogIcon from '../ui/NoLogIcon.svelte';
import type { ComposeInfoUI } from './ComposeInfoUI';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
<script lang="ts">
import 'xterm/css/xterm.css';
import { EmptyScreen } from '@podman-desktop/ui-svelte';
import { onDestroy, onMount } from 'svelte';
import { Terminal } from 'xterm';
import { FitAddon } from 'xterm-addon-fit';
import { TerminalSettings } from '../../../../main/src/plugin/terminal-settings';
import { getPanelDetailColor } from '../color/color';
import { isMultiplexedLog } from '../stream/stream-utils';
import EmptyScreen from '../ui/EmptyScreen.svelte';
import NoLogIcon from '../ui/NoLogIcon.svelte';
import type { ContainerInfoUI } from './ContainerInfoUI';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<script lang="ts">
import 'xterm/css/xterm.css';
import { EmptyScreen } from '@podman-desktop/ui-svelte';
import { onDestroy, onMount } from 'svelte';
import { router } from 'tinro';
import { Terminal } from 'xterm';
Expand All @@ -10,7 +11,6 @@ import { getExistingTerminal, registerTerminal } from '/@/stores/container-termi
import { TerminalSettings } from '../../../../main/src/plugin/terminal-settings';
import { getPanelDetailColor } from '../color/color';
import EmptyScreen from '../ui/EmptyScreen.svelte';
import NoLogIcon from '../ui/NoLogIcon.svelte';
import type { ContainerInfoUI } from './ContainerInfoUI';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
<script lang="ts">
import 'xterm/css/xterm.css';
import { EmptyScreen } from '@podman-desktop/ui-svelte';
import { onDestroy, onMount } from 'svelte';
import { router } from 'tinro';
import { Terminal } from 'xterm';
import { FitAddon } from 'xterm-addon-fit';
import { TerminalSettings } from '../../../../main/src/plugin/terminal-settings';
import { getPanelDetailColor } from '../color/color';
import EmptyScreen from '../ui/EmptyScreen.svelte';
import NoLogIcon from '../ui/NoLogIcon.svelte';
import type { ContainerInfoUI } from './ContainerInfoUI';
Expand Down
10 changes: 7 additions & 3 deletions packages/renderer/src/lib/container/ContainerEmptyScreen.svelte
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
<script lang="ts">
import { EmptyScreen } from '@podman-desktop/ui-svelte';
import { ContainerIcon } from '@podman-desktop/ui-svelte/icons';
import EmptyScreen from '../ui/EmptyScreen.svelte';
export let runningOnly: boolean;
export let stoppedOnly: boolean;
Expand Down Expand Up @@ -35,4 +34,9 @@ function getCommandLine(stoppedOnly: boolean): string {
}
</script>

<EmptyScreen icon="{ContainerIcon}" title="{title}" message="{message}" commandline="{commandLine}" />
<EmptyScreen
icon="{ContainerIcon}"
title="{title}"
message="{message}"
commandline="{commandLine}"
on:click="{() => window.clipboardWriteText(commandLine)}" />
3 changes: 1 addition & 2 deletions packages/renderer/src/lib/container/ContainerList.svelte
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<script lang="ts">
import { faChevronDown, faChevronRight, faPlusCircle, faTrash } from '@fortawesome/free-solid-svg-icons';
import { Button, Checkbox, ErrorMessage, Modal, NavPage } from '@podman-desktop/ui-svelte';
import { Button, Checkbox, ErrorMessage, FilteredEmptyScreen, Modal, NavPage } from '@podman-desktop/ui-svelte';
import { ContainerIcon } from '@podman-desktop/ui-svelte/icons';
import moment from 'moment';
import { onDestroy, onMount } from 'svelte';
Expand Down Expand Up @@ -30,7 +30,6 @@ import SolidPodIcon from '../images/SolidPodIcon.svelte';
import StatusIcon from '../images/StatusIcon.svelte';
import { PodUtils } from '../pod/pod-utils';
import PodActions from '../pod/PodActions.svelte';
import FilteredEmptyScreen from '../ui/FilteredEmptyScreen.svelte';
import ProviderInfo from '../ui/ProviderInfo.svelte';
import StateChange from '../ui/StateChange.svelte';
import { CONTAINER_LIST_VIEW } from '../view/views';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<script lang="ts">
import { EmptyScreen } from '@podman-desktop/ui-svelte';
import DeploymentIcon from '../images/DeploymentIcon.svelte';
import EmptyScreen from '../ui/EmptyScreen.svelte';
</script>

<EmptyScreen
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
import { faTrash } from '@fortawesome/free-solid-svg-icons';
import {
Button,
FilteredEmptyScreen,
NavPage,
Table,
TableColumn,
Expand All @@ -20,7 +21,6 @@ import {
import DeploymentIcon from '../images/DeploymentIcon.svelte';
import KubeApplyYamlButton from '../kube/KubeApplyYAMLButton.svelte';
import FilteredEmptyScreen from '../ui/FilteredEmptyScreen.svelte';
import { DeploymentUtils } from './deployment-utils';
import DeploymentColumnActions from './DeploymentColumnActions.svelte';
import DeploymentColumnConditions from './DeploymentColumnConditions.svelte';
Expand Down
3 changes: 1 addition & 2 deletions packages/renderer/src/lib/extensions/ExtensionDetails.svelte
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<script lang="ts">
import { Button } from '@podman-desktop/ui-svelte';
import { Button, EmptyScreen } from '@podman-desktop/ui-svelte';
import { derived, type Readable } from 'svelte/store';
import extensionIcon from '/@/lib/images/ExtensionIcon.svelte';
Expand All @@ -9,7 +9,6 @@ import { catalogExtensionInfos } from '/@/stores/catalog-extensions';
import FeaturedExtensionDownload from '../featured/FeaturedExtensionDownload.svelte';
import DetailsPage from '../ui/DetailsPage.svelte';
import EmptyScreen from '../ui/EmptyScreen.svelte';
import ExtensionStatus from '../ui/ExtensionStatus.svelte';
import type { ExtensionDetailsUI } from './extension-details-ui';
import ExtensionBadge from './ExtensionBadge.svelte';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<script lang="ts">
import { faFileText } from '@fortawesome/free-solid-svg-icons';
import { EmptyScreen } from '@podman-desktop/ui-svelte';
import { onMount } from 'svelte';
import Markdown from '../markdown/Markdown.svelte';
import EmptyScreen from '../ui/EmptyScreen.svelte';
export let readme: { content?: string; uri?: string };
Expand Down
3 changes: 1 addition & 2 deletions packages/renderer/src/lib/extensions/ExtensionList.svelte
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
<script lang="ts">
import { faCloudDownload } from '@fortawesome/free-solid-svg-icons';
import { Button, NavPage } from '@podman-desktop/ui-svelte';
import { Button, FilteredEmptyScreen, NavPage } from '@podman-desktop/ui-svelte';
import { derived, type Readable, writable } from 'svelte/store';
import InstalledExtensionList from '/@/lib/extensions/InstalledExtensionList.svelte';
import ExtensionIcon from '/@/lib/images/ExtensionIcon.svelte';
import FilteredEmptyScreen from '/@/lib/ui/FilteredEmptyScreen.svelte';
import { type CombinedExtensionInfoUI, combinedInstalledExtensions } from '/@/stores/all-installed-extensions';
import { catalogExtensionInfos } from '/@/stores/catalog-extensions';
import { featuredExtensionInfos } from '/@/stores/featuredExtensions';
Expand Down
8 changes: 6 additions & 2 deletions packages/renderer/src/lib/image/ImageEmptyScreen.svelte
Original file line number Diff line number Diff line change
@@ -1,10 +1,14 @@
<script lang="ts">
import { EmptyScreen } from '@podman-desktop/ui-svelte';
import ImageIcon from '../images/ImageIcon.svelte';
import EmptyScreen from '../ui/EmptyScreen.svelte';
const commandLine = 'podman pull quay.io/podman/hello';
</script>

<EmptyScreen
icon="{ImageIcon}"
title="No images"
message="Pull a first image using the following command line:"
commandline="podman pull quay.io/podman/hello" />
commandline="{commandLine}"
on:click="{() => window.clipboardWriteText(commandLine)}" />
11 changes: 9 additions & 2 deletions packages/renderer/src/lib/image/ImagesList.svelte
Original file line number Diff line number Diff line change
@@ -1,6 +1,14 @@
<script lang="ts">
import { faArrowCircleDown, faCube, faDownload, faTrash, faUpload } from '@fortawesome/free-solid-svg-icons';
import { Button, NavPage, Table, TableColumn, TableRow, TableSimpleColumn } from '@podman-desktop/ui-svelte';
import {
Button,
FilteredEmptyScreen,
NavPage,
Table,
TableColumn,
TableRow,
TableSimpleColumn,
} from '@podman-desktop/ui-svelte';
import moment from 'moment';
import { onDestroy, onMount } from 'svelte';
import type { Unsubscriber } from 'svelte/store';
Expand All @@ -20,7 +28,6 @@ import type { ContextUI } from '../context/context';
import type { EngineInfoUI } from '../engine/EngineInfoUI';
import Prune from '../engine/Prune.svelte';
import ImageIcon from '../images/ImageIcon.svelte';
import FilteredEmptyScreen from '../ui/FilteredEmptyScreen.svelte';
import { IMAGE_LIST_VIEW_BADGES, IMAGE_LIST_VIEW_ICONS, IMAGE_VIEW_BADGES, IMAGE_VIEW_ICONS } from '../view/views';
import { ImageUtils } from './image-utils';
import ImageColumnActions from './ImageColumnActions.svelte';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
<script lang="ts">
import { faLayerGroup } from '@fortawesome/free-solid-svg-icons';
import { Button } from '@podman-desktop/ui-svelte';
import { Button, EmptyScreen } from '@podman-desktop/ui-svelte';
import { router } from 'tinro';
import EmptyScreen from '../ui/EmptyScreen.svelte';
function gotoResourcesPage() {
router.goto('/preferences/resources/');
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<script lang="ts">
import { EmptyScreen } from '@podman-desktop/ui-svelte';
import IngressRouteIcon from '../images/IngressRouteIcon.svelte';
import EmptyScreen from '../ui/EmptyScreen.svelte';
</script>

<EmptyScreen
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,14 @@
<script lang="ts">
import { faTrash } from '@fortawesome/free-solid-svg-icons';
import { Button, NavPage, Table, TableColumn, TableRow, TableSimpleColumn } from '@podman-desktop/ui-svelte';
import {
Button,
FilteredEmptyScreen,
NavPage,
Table,
TableColumn,
TableRow,
TableSimpleColumn,
} from '@podman-desktop/ui-svelte';
import { onDestroy, onMount } from 'svelte';
import type { Unsubscriber } from 'svelte/store';
Expand All @@ -15,7 +23,6 @@ import type { V1Route } from '/@api/openshift-types';
import IngressRouteIcon from '../images/IngressRouteIcon.svelte';
import KubeApplyYamlButton from '../kube/KubeApplyYAMLButton.svelte';
import FilteredEmptyScreen from '../ui/FilteredEmptyScreen.svelte';
import { IngressRouteUtils } from './ingress-route-utils';
import IngressRouteColumnActions from './IngressRouteColumnActions.svelte';
import IngressRouteColumnBackend from './IngressRouteColumnBackend.svelte';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<script lang="ts">
import { EmptyScreen } from '@podman-desktop/ui-svelte';
import { onMount } from 'svelte';
import EmptyScreen from '/@/lib/ui/EmptyScreen.svelte';
import NoLogIcon from '/@/lib/ui/NoLogIcon.svelte';
import { podsInfos } from '/@/stores/pods';
Expand Down
2 changes: 1 addition & 1 deletion packages/renderer/src/lib/pod/PodDetailsLogs.svelte
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<script lang="ts">
import 'xterm/css/xterm.css';
import { EmptyScreen } from '@podman-desktop/ui-svelte';
import { onDestroy, onMount } from 'svelte';
import { Terminal } from 'xterm';
import { FitAddon } from 'xterm-addon-fit';
Expand All @@ -9,7 +10,6 @@ import { TerminalSettings } from '../../../../main/src/plugin/terminal-settings'
import { getPanelDetailColor } from '../color/color';
import { ansi256Colours, colourizedANSIContainerName } from '../editor/editor-utils';
import { isMultiplexedLog } from '../stream/stream-utils';
import EmptyScreen from '../ui/EmptyScreen.svelte';
import NoLogIcon from '../ui/NoLogIcon.svelte';
import type { PodInfoUI } from './PodInfoUI';
Expand Down
8 changes: 6 additions & 2 deletions packages/renderer/src/lib/pod/PodEmptyScreen.svelte
Original file line number Diff line number Diff line change
@@ -1,10 +1,14 @@
<script lang="ts">
import { EmptyScreen } from '@podman-desktop/ui-svelte';
import PodIcon from '../images/PodIcon.svelte';
import EmptyScreen from '../ui/EmptyScreen.svelte';
const commandLine = 'podman pod create --label myFirstPod';
</script>

<EmptyScreen
icon="{PodIcon}"
title="No pods"
message="Run a first pod using the following command line:"
commandline="podman pod create --label myFirstPod" />
commandline="{commandLine}"
on:click="{() => window.clipboardWriteText(commandLine)}" />
3 changes: 1 addition & 2 deletions packages/renderer/src/lib/pod/PodsList.svelte
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<script lang="ts">
import { faTrash } from '@fortawesome/free-solid-svg-icons';
import { Button, NavPage, Table, TableColumn, TableRow } from '@podman-desktop/ui-svelte';
import { Button, FilteredEmptyScreen, NavPage, Table, TableColumn, TableRow } from '@podman-desktop/ui-svelte';
import moment from 'moment';
import { onDestroy, onMount } from 'svelte';
import type { Unsubscriber } from 'svelte/store';
Expand All @@ -15,7 +15,6 @@ import Prune from '../engine/Prune.svelte';
import NoContainerEngineEmptyScreen from '../image/NoContainerEngineEmptyScreen.svelte';
import PodIcon from '../images/PodIcon.svelte';
import KubePlayButton from '../kube/KubePlayButton.svelte';
import FilteredEmptyScreen from '../ui/FilteredEmptyScreen.svelte';
import { PodUtils } from './pod-utils';
import PodColumnActions from './PodColumnActions.svelte';
import PodColumnAge from './PodColumnAge.svelte';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import {
faRightFromBracket,
faRightToBracket,
} from '@fortawesome/free-solid-svg-icons';
import { Button, Tooltip } from '@podman-desktop/ui-svelte';
import { Button, EmptyScreen, Tooltip } from '@podman-desktop/ui-svelte';
import Fa from 'svelte-fa';
import EmbeddableCatalogExtensionList from '/@/lib/extensions/EmbeddableCatalogExtensionList.svelte';
Expand All @@ -14,7 +14,6 @@ import { authenticationProviders } from '../../stores/authenticationProviders';
import KeyIcon from '../images/KeyIcon.svelte';
import DropdownMenu from '../ui/DropdownMenu.svelte';
import DropdownMenuItem from '../ui/DropDownMenuItem.svelte';
import EmptyScreen from '../ui/EmptyScreen.svelte';
import SettingsPage from './SettingsPage.svelte';
</script>

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<script lang="ts">
import { EmptyScreen } from '@podman-desktop/ui-svelte';
import { cliToolInfos } from '../../stores/cli-tools';
import EmptyScreen from '../ui/EmptyScreen.svelte';
import EngineIcon from '../ui/EngineIcon.svelte';
import PreferencesCliTool from './PreferencesCliTool.svelte';
import SettingsPage from './SettingsPage.svelte';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<script lang="ts">
import { faCubes } from '@fortawesome/free-solid-svg-icons';
import type { AuditRequestItems, AuditResult, ConfigurationScope } from '@podman-desktop/api';
import { Button, ErrorMessage, LinearProgress, Spinner } from '@podman-desktop/ui-svelte';
import { Button, EmptyScreen, ErrorMessage, LinearProgress, Spinner } from '@podman-desktop/ui-svelte';
import { onDestroy, onMount } from 'svelte';
/* eslint-disable import/no-duplicates */
// https://github.com/import-js/eslint-plugin-import/issues/1479
Expand All @@ -22,7 +22,6 @@ import type {
import type { IConfigurationPropertyRecordedSchema } from '../../../../main/src/plugin/configuration-registry';
import Markdown from '../markdown/Markdown.svelte';
import AuditMessageBox from '../ui/AuditMessageBox.svelte';
import EmptyScreen from '../ui/EmptyScreen.svelte';
import TerminalWindow from '../ui/TerminalWindow.svelte';
import EditableConnectionResourceItem from './item-formats/EditableConnectionResourceItem.svelte';
import {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<script lang="ts">
import 'xterm/css/xterm.css';
import { EmptyScreen } from '@podman-desktop/ui-svelte';
import { onDestroy, onMount } from 'svelte';
import { Terminal } from 'xterm';
import { FitAddon } from 'xterm-addon-fit';
Expand All @@ -9,7 +10,6 @@ import type { ProviderContainerConnectionInfo, ProviderKubernetesConnectionInfo
import { TerminalSettings } from '../../../../main/src/plugin/terminal-settings';
import { getPanelDetailColor } from '../color/color';
import EmptyScreen from '../ui/EmptyScreen.svelte';
import NoLogIcon from '../ui/NoLogIcon.svelte';
import { writeToTerminal } from './Util';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
<script lang="ts">
import { faRightToBracket, faTrash } from '@fortawesome/free-solid-svg-icons';
import { ErrorMessage } from '@podman-desktop/ui-svelte';
import { EmptyScreen, ErrorMessage } from '@podman-desktop/ui-svelte';
import { kubernetesContextsState } from '/@/stores/kubernetes-contexts-state';
import { kubernetesContexts } from '../../stores/kubernetes-contexts';
import { clearKubeUIContextErrors, setKubeUIContextError } from '../kube/KubeContextUI';
import EmptyScreen from '../ui/EmptyScreen.svelte';
import EngineIcon from '../ui/EngineIcon.svelte';
import ListItemButtonIcon from '../ui/ListItemButtonIcon.svelte';
import SettingsPage from './SettingsPage.svelte';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<script lang="ts">
import { faArrowUpRightFromSquare, faGear } from '@fortawesome/free-solid-svg-icons';
import type { ContainerProviderConnection } from '@podman-desktop/api';
import { Button, Tooltip } from '@podman-desktop/ui-svelte';
import { Button, EmptyScreen, Tooltip } from '@podman-desktop/ui-svelte';
import { Buffer } from 'buffer';
import { filesize } from 'filesize';
import { onDestroy, onMount } from 'svelte';
Expand All @@ -27,7 +27,6 @@ import { ContextKeyExpr } from '../context/contextKey';
import { normalizeOnboardingWhenClause } from '../onboarding/onboarding-utils';
import ConnectionErrorInfoButton from '../ui/ConnectionErrorInfoButton.svelte';
import ConnectionStatus from '../ui/ConnectionStatus.svelte';
import EmptyScreen from '../ui/EmptyScreen.svelte';
import EngineIcon from '../ui/EngineIcon.svelte';
import { PeerProperties } from './PeerProperties';
import { eventCollect } from './preferences-connection-rendering-task';
Expand Down
Loading

0 comments on commit 41d943a

Please sign in to comment.