Skip to content

Commit

Permalink
fix(widget-builder): Change wording for adding columns to table (#85004)
Browse files Browse the repository at this point in the history
Changes the verbiage from `Visualize` to `Columns` specifically for
tables. Makes it clearer what the field is for and follows the concepts
of representing columns in tables.
  • Loading branch information
narsaynorath authored Feb 11, 2025
1 parent c51908b commit 89a7ec7
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -632,9 +632,9 @@ describe('Visualize', () => {
expect(screen.getByLabelText('Column Selection')).toHaveTextContent('user');

// Add 3 fields
await userEvent.click(screen.getByRole('button', {name: 'Add Field'}));
await userEvent.click(screen.getByRole('button', {name: 'Add Field'}));
await userEvent.click(screen.getByRole('button', {name: 'Add Field'}));
await userEvent.click(screen.getByRole('button', {name: 'Add Column'}));
await userEvent.click(screen.getByRole('button', {name: 'Add Column'}));
await userEvent.click(screen.getByRole('button', {name: 'Add Column'}));

// count() is the default aggregate when adding a field
expect(screen.getAllByText('count')).toHaveLength(3);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -325,10 +325,14 @@ function Visualize({error, setError}: VisualizeProps) {
return (
<Fragment>
<SectionHeader
title={t('Visualize')}
tooltipText={t(
'Primary metric that appears in your chart. You can also overlay a series onto an existing chart or add an equation.'
)}
title={isChartWidget ? t('Visualize') : t('Columns')}
tooltipText={
isChartWidget
? t(
'Primary metric that appears in your chart. You can also overlay a series onto an existing chart or add an equation.'
)
: t('Columns to display in your table. You can also add equations.')
}
/>
<StyledFieldGroup
error={isChartWidget ? aggregateErrors : fieldErrors}
Expand Down Expand Up @@ -1009,7 +1013,13 @@ function Visualize({error, setError}: VisualizeProps) {
<AddButtons>
<AddButton
priority="link"
aria-label={isChartWidget ? t('Add Series') : t('Add Field')}
aria-label={
isChartWidget
? t('Add Series')
: isBigNumberWidget
? t('Add Field')
: t('Add Column')
}
onClick={() => {
dispatch({
type: updateAction,
Expand All @@ -1027,7 +1037,11 @@ function Visualize({error, setError}: VisualizeProps) {
});
}}
>
{isChartWidget ? t('+ Add Series') : t('+ Add Field')}
{isChartWidget
? t('+ Add Series')
: isBigNumberWidget
? t('+ Add Field')
: t('+ Add Column')}
</AddButton>
{datasetConfig.enableEquations && (
<AddButton
Expand Down

0 comments on commit 89a7ec7

Please sign in to comment.