Skip to content

Commit

Permalink
Merge pull request #3602 from InosRahul/feat/table_view_loading_spinner
Browse files Browse the repository at this point in the history
Show a Loading Spinner for Table Pages
  • Loading branch information
pavish committed Jun 6, 2024
2 parents bcafa54 + 0428119 commit 3960fd0
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions mathesar_ui/src/systems/table-view/TableView.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import { get } from 'svelte/store';
import type { TableEntry } from '@mathesar/api/rest/types/tables';
import { ImmutableMap } from '@mathesar/component-library';
import { ImmutableMap, Spinner } from '@mathesar/component-library';
import { Sheet } from '@mathesar/components/sheet';
import { SheetClipboardHandler } from '@mathesar/components/sheet/SheetClipboardHandler';
import { rowHeaderWidthPx } from '@mathesar/geometry';
Expand Down Expand Up @@ -46,7 +46,8 @@
$: usesVirtualList = context !== 'widget';
$: allowsDdlOperations = context !== 'widget' && canExecuteDDL;
$: sheetHasBorder = context === 'widget';
$: ({ processedColumns, display, selection, recordsData } = $tabularData);
$: ({ processedColumns, display, isLoading, selection, recordsData } =
$tabularData);
$: clipboardHandler = new SheetClipboardHandler({
getCopyingContext: () => ({
rowsMap: new Map(
Expand Down Expand Up @@ -95,6 +96,11 @@
bind:activeTabId={tableInspectorTab}
>
<div class="sheet-area">
{#if $isLoading}
<div class="loading-sheet">
<Spinner />
</div>
{/if}
{#if $processedColumns.size}
<Sheet
{clipboardHandler}
Expand Down Expand Up @@ -139,4 +145,10 @@
height: 100%;
overflow-x: auto;
}
.loading-sheet {
text-align: center;
font-size: 2rem;
padding: 2rem;
color: var(--slate-500);
}
</style>

0 comments on commit 3960fd0

Please sign in to comment.