Skip to content

Commit

Permalink
Adjust function name
Browse files Browse the repository at this point in the history
  • Loading branch information
seancolsen committed Jul 18, 2024
1 parent ba676e5 commit 872a7ef
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 16 deletions.
6 changes: 3 additions & 3 deletions mathesar_ui/src/components/TableName.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,20 @@
import type { Table } from '@mathesar/api/rpc/tables';
import { iconTable } from '@mathesar/icons';
import { isTableImportConfirmationRequired } from '@mathesar/utils/tables';
import { tableRequiresImportConfirmation } from '@mathesar/utils/tables';
import NameWithIcon from './NameWithIcon.svelte';
interface $$Props extends Omit<ComponentProps<NameWithIcon>, 'icon'> {
table: Pick<Table, 'name'> &
Parameters<typeof isTableImportConfirmationRequired>[0];
Parameters<typeof tableRequiresImportConfirmation>[0];
isLoading?: boolean;
}
export let table: $$Props['table'];
export let isLoading = false;
$: isNotConfirmed = isTableImportConfirmationRequired(table);
$: isNotConfirmed = tableRequiresImportConfirmation(table);
</script>

<NameWithIcon icon={iconTable} {isLoading} {...$$restProps}>
Expand Down
4 changes: 2 additions & 2 deletions mathesar_ui/src/pages/import/preview/ImportPreviewPage.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
import ImportPreviewContent from './ImportPreviewContent.svelte';
import ImportPreviewLayout from './ImportPreviewLayout.svelte';
import { currentConnection } from '@mathesar/stores/databases';
import { isTableImportConfirmationRequired } from '@mathesar/utils/tables';
import { tableRequiresImportConfirmation } from '@mathesar/utils/tables';
const tableFetch = new AsyncStore(getTableFromStoreOrApi);
const dataFileFetch = new AsyncStore(dataFilesApi.get);
Expand All @@ -41,7 +41,7 @@
return;
}
if (!isTableImportConfirmationRequired(table)) {
if (!tableRequiresImportConfirmation(table)) {
redirectToTablePage();
return;
}
Expand Down
14 changes: 7 additions & 7 deletions mathesar_ui/src/pages/schema/TableCard.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
import { createDataExplorerUrlToExploreATable } from '@mathesar/systems/data-explorer';
import { getRecordSelectorFromContext } from '@mathesar/systems/record-selector/RecordSelectorController';
import TableDeleteConfirmationBody from '@mathesar/systems/table-view/table-inspector/table/TableDeleteConfirmationBody.svelte';
import { isTableImportConfirmationRequired } from '@mathesar/utils/tables';
import { tableRequiresImportConfirmation } from '@mathesar/utils/tables';
import {
ButtonMenuItem,
DropdownMenu,
Expand All @@ -45,8 +45,8 @@
let isHoveringBottomButton = false;
let isTableCardFocused = false;
$: isTableImportConfirmationNeeded = isTableImportConfirmationRequired(table);
$: tablePageUrl = isTableImportConfirmationNeeded
$: requiresImportConfirmation = tableRequiresImportConfirmation(table);
$: tablePageUrl = requiresImportConfirmation
? getImportPreviewPageUrl(database.id, schema.oid, table.oid, {
useColumnTypeInference: true,
})
Expand Down Expand Up @@ -87,7 +87,7 @@
class:focus={isTableCardFocused}
class:hovering-menu-trigger={isHoveringMenuTrigger}
class:hovering-bottom-button={isHoveringBottomButton}
class:unconfirmed-import={isTableImportConfirmationNeeded}
class:unconfirmed-import={requiresImportConfirmation}
>
<a
class="link passthrough"
Expand All @@ -114,7 +114,7 @@
{/if}
</div>
<div class="bottom">
{#if isTableImportConfirmationNeeded}
{#if requiresImportConfirmation}
{$_('needs_import_confirmation')}
{/if}
</div>
Expand All @@ -138,7 +138,7 @@
icon={iconMoreActions}
size="small"
>
{#if !isTableImportConfirmationNeeded}
{#if !requiresImportConfirmation}
<LinkMenuItem href={explorationPageUrl} icon={iconExploration}>
{$_('explore_table')}
</LinkMenuItem>
Expand All @@ -159,7 +159,7 @@
{/if}
</DropdownMenu>
</div>
{#if !isTableImportConfirmationNeeded}
{#if !requiresImportConfirmation}
<button
class="bottom-button passthrough"
on:mouseenter={() => {
Expand Down
4 changes: 2 additions & 2 deletions mathesar_ui/src/stores/tables.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ import type { Table } from '@mathesar/api/rpc/tables';
import { invalidIf } from '@mathesar/components/form';
import { TupleMap } from '@mathesar/packages/tuple-map';
import { preloadCommonData } from '@mathesar/utils/preloadData';
import { isTableImportConfirmationRequired } from '@mathesar/utils/tables';
import { tableRequiresImportConfirmation } from '@mathesar/utils/tables';
import { connectionsStore } from './databases';
import { addCountToSchemaNumTables, currentSchemaId } from './schemas';

Expand Down Expand Up @@ -388,7 +388,7 @@ export const importVerifiedTables: Readable<TablesMap> = derived(
(tablesData) =>
new Map(
[...tablesData.tablesMap.values()]
.filter((table) => !isTableImportConfirmationRequired(table))
.filter((table) => !tableRequiresImportConfirmation(table))
.map((table) => [table.oid, table]),
),
);
Expand Down
4 changes: 2 additions & 2 deletions mathesar_ui/src/utils/tables.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ interface TableWithImportVerification {
} | null;
}

export function isTableImportConfirmationRequired(
export function tableRequiresImportConfirmation(
table: TableWithImportVerification,
): boolean {
if (table.metadata?.import_verified === false) {
Expand Down Expand Up @@ -69,7 +69,7 @@ export function getLinkForTableItem(
schemaId: number,
table: TableWithImportVerification & { oid: Table['oid'] },
) {
if (isTableImportConfirmationRequired(table)) {
if (tableRequiresImportConfirmation(table)) {
return getImportPreviewPageUrl(connectionId, schemaId, table.oid, {
useColumnTypeInference: true,
});
Expand Down

0 comments on commit 872a7ef

Please sign in to comment.