Skip to content

Commit 6fa24f6

Browse files
committed
feat(metadata-view): bulk custom actions
Refactor
1 parent 74005fa commit 6fa24f6

5 files changed

Lines changed: 14 additions & 10 deletions

File tree

i18n/en-US.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1825,7 +1825,7 @@ boxui.shareMenu.viewAndDownload = View and Download
18251825
# Description of permissions granted to users who have access to the shared link
18261826
boxui.shareMenu.viewOnly = View Only
18271827
# Aria-label for the dropdown menu that shows actions for selected items
1828-
boxui.subHeader.bulkItemActionMenuAriaLabel = Show actions for selected items
1828+
boxui.subHeader.bulkItemActionMenuAriaLabel = Bulk actions
18291829
# Text for metadata button that will open the metadata side panel
18301830
boxui.subHeader.metadata = Metadata
18311831
# Error message for empty time formats. "HH:MM A" should be localized.

src/elements/common/sub-header/BulkItemActionMenu.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ export const BulkItemActionMenu = ({
2525

2626
return (
2727
<DropdownMenu.Root>
28-
<DropdownMenu.Trigger className="be-SubHeaderRight-bulkItemActionMenuDropdownTrigger">
28+
<DropdownMenu.Trigger className="be-bulkItemActionMenu-trigger">
2929
<Button
3030
role="button"
3131
aria-label={formatMessage(messages.bulkItemActionMenuAriaLabel)}
@@ -34,7 +34,7 @@ export const BulkItemActionMenu = ({
3434
variant="secondary"
3535
/>
3636
</DropdownMenu.Trigger>
37-
<DropdownMenu.Content align="start">
37+
<DropdownMenu.Content align="end">
3838
{actions.map(({ label, onClick }) => {
3939
return (
4040
<DropdownMenu.Item key={label} onSelect={() => onClick(selectedItemIds)}>

src/elements/common/sub-header/SubHeaderRight.scss

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
margin-left: 7px;
2121
}
2222

23-
.be-SubHeaderRight-bulkItemActionMenuDropdownTrigger {
24-
margin-right: 7px;
23+
.be-bulkItemActionMenu-trigger {
24+
margin-right: var(--space-2);
2525
}
2626
}

src/elements/common/sub-header/messages.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { defineMessages } from 'react-intl';
22

33
const messages = defineMessages({
44
bulkItemActionMenuAriaLabel: {
5-
defaultMessage: 'Show actions for selected items',
5+
defaultMessage: 'Bulk actions',
66
description: 'Aria-label for the dropdown menu that shows actions for selected items',
77
id: 'boxui.subHeader.bulkItemActionMenuAriaLabel',
88
},

src/elements/content-explorer/stories/tests/MetadataView-visual.stories.tsx

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -192,6 +192,10 @@ export const metadataViewV2WithBulkItemActionMenuShowsEllipsis: Story = {
192192
const firstRow = canvas.getByRole('row', { name: /Child 2/i });
193193
const checkbox = within(firstRow).getByRole('checkbox');
194194
userEvent.click(checkbox);
195+
196+
await waitFor(() => {
197+
expect(canvas.getByRole('button', { name: 'Bulk actions' })).toBeInTheDocument();
198+
});
195199
},
196200
};
197201

@@ -207,10 +211,10 @@ export const metadataViewV2WithBulkItemActionMenuShowsItemActionMenu: Story = {
207211
userEvent.click(checkbox);
208212

209213
await waitFor(() => {
210-
expect(canvas.getByRole('button', { name: 'Show actions for selected items' })).toBeInTheDocument();
214+
expect(canvas.getByRole('button', { name: 'Bulk actions' })).toBeInTheDocument();
211215
});
212216

213-
const ellipsisButton = canvas.getByRole('button', { name: 'Show actions for selected items' });
217+
const ellipsisButton = canvas.getByRole('button', { name: 'Bulk actions' });
214218

215219
userEvent.click(ellipsisButton);
216220

@@ -232,10 +236,10 @@ export const metadataViewV2WithBulkItemActionMenuCallsOnClick: Story = {
232236
userEvent.click(checkbox);
233237

234238
await waitFor(() => {
235-
expect(canvas.getByRole('button', { name: 'Show actions for selected items' })).toBeInTheDocument();
239+
expect(canvas.getByRole('button', { name: 'Bulk actions' })).toBeInTheDocument();
236240
});
237241

238-
const ellipsisButton = canvas.getByRole('button', { name: 'Show actions for selected items' });
242+
const ellipsisButton = canvas.getByRole('button', { name: 'Bulk actions' });
239243

240244
userEvent.click(ellipsisButton);
241245

0 commit comments

Comments
 (0)