Skip to content

Commit

Permalink
chore: also collapse Add Data and Export Data, add title attributes C…
Browse files Browse the repository at this point in the history
…OMPASS-8231 (mongodb-js#6170)

also collapse Add Data and Export Data, add title attributes
  • Loading branch information
lerouxb authored Sep 5, 2024
1 parent 4b81a9b commit 8671616
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ export const PipelineSettings: React.FunctionComponent<
onClick={onExportToLanguage}
data-testid="pipeline-toolbar-export-button"
disabled={!isExportToLanguageEnabled}
title="Export to language"
>
<span className={hiddenOnNarrowPipelineToolbarStyles}>
Export to language
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import type { ButtonProps } from '@leafygreen-ui/button';
import type { glyphs } from '@leafygreen-ui/icon';
import { spacing } from '@leafygreen-ui/tokens';
import { css, cx } from '@leafygreen-ui/emotion';
import { WorkspaceContainer } from './workspace-container';

export type ItemAction<Action extends string> = {
action: Action;
Expand Down Expand Up @@ -486,6 +487,13 @@ export function ItemActionControls<Action extends string>({
return <ItemActionGroup actions={actions} {...sharedProps}></ItemActionGroup>;
}

const hiddenOnNarrowStyles = css({
[`@container ${WorkspaceContainer.toolbarContainerQueryName} (width < 900px)`]:
{
display: 'none',
},
});

export function DropdownMenuButton<Action extends string>({
isVisible = true,
actions,
Expand Down Expand Up @@ -557,8 +565,9 @@ export function DropdownMenuButton<Action extends string>({
onClick && onClick(evt);
}}
rightGlyph={<Icon glyph={'CaretDown'} />}
title={buttonText}
>
{buttonText}
<span className={hiddenOnNarrowStyles}>{buttonText}</span>
{children}
</Button>
);
Expand Down
1 change: 1 addition & 0 deletions packages/compass-crud/src/components/delete-data-menu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ const DeleteMenuButton: React.FunctionComponent<DeleteMenuButtonProps> = ({
onClick={onClick}
leftGlyph={<Icon glyph="Trash"></Icon>}
data-testid="crud-bulk-delete"
title="Delete"
>
<span className={hiddenOnNarrowStyles}>Delete</span>
</Button>
Expand Down
1 change: 1 addition & 0 deletions packages/compass-crud/src/components/update-data-menu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ const UpdateMenuButton: React.FunctionComponent<UpdateMenuButtonProps> = ({
onClick={onClick}
leftGlyph={<Icon glyph="Edit"></Icon>}
data-testid="crud-update"
title="Update"
>
<span className={hiddenOnNarrowStyles}>Update</span>
</Button>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@ function AIExperienceEntry({
onClick={onClick}
data-testid={dataTestId}
type="button"
title={`Generate ${type}`}
>
<span className={hiddenOnNarrowStyles}>Generate {type}</span>
<AIEntrySVG darkMode={darkMode} />
Expand Down

0 comments on commit 8671616

Please sign in to comment.