Skip to content

Commit

Permalink
feat: rename 'View' button to 'Columns' (#2954)
Browse files Browse the repository at this point in the history
  • Loading branch information
wescopeland authored Dec 19, 2024
1 parent 4709431 commit d3fbd25
Show file tree
Hide file tree
Showing 9 changed files with 28 additions and 27 deletions.
3 changes: 2 additions & 1 deletion lang/en_US.json
Original file line number Diff line number Diff line change
Expand Up @@ -511,5 +511,6 @@
"We're excited to have you here! We know you might have some questions about hardcore mode, RetroPoints (white points), subsets, or which emulators to use. Don't worry, we've got you covered! Check out our <1>comprehensive FAQ</1> to get started. Happy gaming!": "We're excited to have you here! We know you might have some questions about hardcore mode, RetroPoints (white points), subsets, or which emulators to use. Don't worry, we've got you covered! Check out our <1>comprehensive FAQ</1> to get started. Happy gaming!",
"Getting Started": "Getting Started",
"Moderation Comments - {{user}}": "Moderation Comments - {{user}}",
"Moderation Comments": "Moderation Comments"
"Moderation Comments": "Moderation Comments",
"Columns": "Columns"
}
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,7 @@ describe('Component: AllGamesMainRoot', () => {
});

// ACT
await userEvent.click(screen.getByRole('button', { name: /view/i }));
await userEvent.click(screen.getByRole('button', { name: /columns/i }));
await userEvent.click(screen.getByRole('menuitemcheckbox', { name: /points/i }));

// ASSERT
Expand All @@ -260,7 +260,7 @@ describe('Component: AllGamesMainRoot', () => {
});

// ACT
await userEvent.click(screen.getByRole('button', { name: /view/i }));
await userEvent.click(screen.getByRole('button', { name: /columns/i }));

// ASSERT
expect(
Expand All @@ -281,7 +281,7 @@ describe('Component: AllGamesMainRoot', () => {
});

// ACT
await userEvent.click(screen.getByRole('button', { name: /view/i }));
await userEvent.click(screen.getByRole('button', { name: /columns/i }));
await userEvent.click(screen.getByRole('menuitemcheckbox', { name: /tickets/i }));

// ASSERT
Expand Down Expand Up @@ -318,7 +318,7 @@ describe('Component: AllGamesMainRoot', () => {
});

// ACT
await userEvent.click(screen.getByRole('button', { name: /view/i }));
await userEvent.click(screen.getByRole('button', { name: /columns/i }));
await userEvent.click(screen.getByRole('menuitemcheckbox', { name: /tickets/i }));

// ASSERT
Expand Down Expand Up @@ -626,7 +626,7 @@ describe('Component: AllGamesMainRoot', () => {
});

// ACT
await userEvent.click(screen.getByRole('button', { name: /view/i }));
await userEvent.click(screen.getByRole('button', { name: /columns/i }));
await userEvent.click(screen.getByRole('menuitemcheckbox', { name: /claimed/i }));

await userEvent.click(screen.getByTestId('column-header-Claimed'));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,19 +12,19 @@ import {
BaseDropdownMenuTrigger,
} from '@/common/components/+vendor/BaseDropdownMenu';

interface DataTableViewOptionsProps<TData> {
interface DataTableColumnsToggleProps<TData> {
table: Table<TData>;
}

export function DataTableViewOptions<TData>({ table }: DataTableViewOptionsProps<TData>) {
export function DataTableColumnsToggle<TData>({ table }: DataTableColumnsToggleProps<TData>) {
const { t } = useTranslation();

return (
<BaseDropdownMenu>
<BaseDropdownMenuTrigger asChild>
<BaseButton size="sm" className="gap-1.5">
<RxMixerHorizontal className="h-4 w-4" />
{t('View')}
{t('Columns')}
</BaseButton>
</BaseDropdownMenuTrigger>

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export * from './DataTableColumnsToggle';
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ import { usePageProps } from '@/common/hooks/usePageProps';

import { doesColumnExist } from '../../utils/doesColumnExist';
import { getAreNonDefaultFiltersSet } from '../../utils/getAreNonDefaultFiltersSet';
import { DataTableColumnsToggle } from '../DataTableColumnsToggle';
import { DataTableResetFiltersButton } from '../DataTableResetFiltersButton';
import { DataTableSearchInput } from '../DataTableSearchInput';
import { DataTableViewOptions } from '../DataTableViewOptions';
import { DataTableAchievementsPublishedFilter } from './DataTableAchievementsPublishedFilter';
import { DataTableProgressFilter } from './DataTableProgressFilter';
import { DataTableSystemFilter } from './DataTableSystemFilter';
Expand Down Expand Up @@ -100,7 +100,7 @@ export function DataTableDesktopToolbar<TData>({
disabled={table.getRowCount() === 0}
/>

<DataTableViewOptions table={table} />
<DataTableColumnsToggle table={table} />
</div>
</div>
</div>
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,7 @@ describe('Component: HubMainRoot', () => {
});

// ACT
await userEvent.click(screen.getByRole('button', { name: /view/i }));
await userEvent.click(screen.getByRole('button', { name: /columns/i }));
await userEvent.click(screen.getByRole('menuitemcheckbox', { name: /points/i }));

// ASSERT
Expand All @@ -287,7 +287,7 @@ describe('Component: HubMainRoot', () => {
});

// ACT
await userEvent.click(screen.getByRole('button', { name: /view/i }));
await userEvent.click(screen.getByRole('button', { name: /columns/i }));

// ASSERT
expect(
Expand All @@ -312,7 +312,7 @@ describe('Component: HubMainRoot', () => {
});

// ACT
await userEvent.click(screen.getByRole('button', { name: /view/i }));
await userEvent.click(screen.getByRole('button', { name: /columns/i }));
await userEvent.click(screen.getByRole('menuitemcheckbox', { name: /tickets/i }));

// ASSERT
Expand Down Expand Up @@ -353,7 +353,7 @@ describe('Component: HubMainRoot', () => {
});

// ACT
await userEvent.click(screen.getByRole('button', { name: /view/i }));
await userEvent.click(screen.getByRole('button', { name: /columns/i }));
await userEvent.click(screen.getByRole('menuitemcheckbox', { name: /tickets/i }));

// ASSERT
Expand Down Expand Up @@ -710,7 +710,7 @@ describe('Component: HubMainRoot', () => {
});

// ACT
await userEvent.click(screen.getByRole('button', { name: /view/i }));
await userEvent.click(screen.getByRole('button', { name: /columns/i }));
await userEvent.click(screen.getByRole('menuitemcheckbox', { name: /claimed/i }));

await userEvent.click(screen.getByTestId('column-header-Claimed'));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,7 @@ describe('Component: SystemGamesMainRoot', () => {
});

// ACT
await userEvent.click(screen.getByRole('button', { name: /view/i }));
await userEvent.click(screen.getByRole('button', { name: /columns/i }));
await userEvent.click(screen.getByRole('menuitemcheckbox', { name: /points/i }));

// ASSERT
Expand All @@ -272,7 +272,7 @@ describe('Component: SystemGamesMainRoot', () => {
});

// ACT
await userEvent.click(screen.getByRole('button', { name: /view/i }));
await userEvent.click(screen.getByRole('button', { name: /columns/i }));

// ASSERT
expect(
Expand All @@ -294,7 +294,7 @@ describe('Component: SystemGamesMainRoot', () => {
});

// ACT
await userEvent.click(screen.getByRole('button', { name: /view/i }));
await userEvent.click(screen.getByRole('button', { name: /columns/i }));
await userEvent.click(screen.getByRole('menuitemcheckbox', { name: /tickets/i }));

// ASSERT
Expand Down Expand Up @@ -332,7 +332,7 @@ describe('Component: SystemGamesMainRoot', () => {
});

// ACT
await userEvent.click(screen.getByRole('button', { name: /view/i }));
await userEvent.click(screen.getByRole('button', { name: /columns/i }));
await userEvent.click(screen.getByRole('menuitemcheckbox', { name: /tickets/i }));

// ASSERT
Expand Down Expand Up @@ -603,7 +603,7 @@ describe('Component: SystemGamesMainRoot', () => {
});

// ACT
await userEvent.click(screen.getByRole('button', { name: /view/i }));
await userEvent.click(screen.getByRole('button', { name: /columns/i }));
await userEvent.click(screen.getByRole('menuitemcheckbox', { name: /claimed/i }));

await userEvent.click(screen.getByTestId('column-header-Claimed'));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ describe('Component: WantToPlayGamesMainRoot', () => {
});

// ACT
await userEvent.click(screen.getByRole('button', { name: /view/i }));
await userEvent.click(screen.getByRole('button', { name: /columns/i }));
await userEvent.click(screen.getByRole('menuitemcheckbox', { name: /points/i }));

// ASSERT
Expand All @@ -224,7 +224,7 @@ describe('Component: WantToPlayGamesMainRoot', () => {
});

// ACT
await userEvent.click(screen.getByRole('button', { name: /view/i }));
await userEvent.click(screen.getByRole('button', { name: /columns/i }));

// ASSERT
expect(
Expand All @@ -245,7 +245,7 @@ describe('Component: WantToPlayGamesMainRoot', () => {
});

// ACT
await userEvent.click(screen.getByRole('button', { name: /view/i }));
await userEvent.click(screen.getByRole('button', { name: /columns/i }));
await userEvent.click(screen.getByRole('menuitemcheckbox', { name: /tickets/i }));

// ASSERT
Expand Down Expand Up @@ -282,7 +282,7 @@ describe('Component: WantToPlayGamesMainRoot', () => {
});

// ACT
await userEvent.click(screen.getByRole('button', { name: /view/i }));
await userEvent.click(screen.getByRole('button', { name: /columns/i }));
await userEvent.click(screen.getByRole('menuitemcheckbox', { name: /tickets/i }));

// ASSERT
Expand Down Expand Up @@ -589,7 +589,7 @@ describe('Component: WantToPlayGamesMainRoot', () => {
});

// ACT
await userEvent.click(screen.getByRole('button', { name: /view/i }));
await userEvent.click(screen.getByRole('button', { name: /columns/i }));
await userEvent.click(screen.getByRole('menuitemcheckbox', { name: /claimed/i }));

await userEvent.click(screen.getByTestId('column-header-Claimed'));
Expand Down

0 comments on commit d3fbd25

Please sign in to comment.