Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 1 addition & 4 deletions lib/components/WorkPackage/OptionsPopover.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import { defaultWpVariables } from "./atoms";
import {
LinkExternalIcon,
TrashIcon,
ScreenFullIcon,
ChevronDownIcon,
} from "@primer/octicons-react";

Expand All @@ -26,7 +25,7 @@ export interface WpOptionsProps {
}

const INLINE_SIZE_OPTIONS: InlineWpSize[] = ["xxs", "xs", "s"];
const BLOCK_SIZE_OPTIONS: BlockWpSize[] = ["m", "l", "xl"];
const BLOCK_SIZE_OPTIONS: BlockWpSize[] = ["m"];
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍


export const WpOptionsPopover = ({
wp,
Expand Down Expand Up @@ -78,7 +77,6 @@ export const WpOptionsPopover = ({
setShowSizes((prev) => !prev);
}}
>
<IcSize />
{displayedSize}
<IcChevron />
</PopBtn>
Expand Down Expand Up @@ -271,5 +269,4 @@ const SizeBtnDesc = styled.span`

const IcOpen = () => <LinkExternalIcon size={13} />;
const IcDelete = () => <TrashIcon size={13} />;
const IcSize = () => <ScreenFullIcon size={13} />;
const IcChevron = () => <ChevronDownIcon size={10} />;
12 changes: 6 additions & 6 deletions lib/locales/en.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,12 +41,12 @@ export const en = {
"chipAriaLabel": "Work package #{{id}}",
},
"sizes": {
"xxs": { "label": "Tiny (inline)", "desc": "Identifier" },
"xs": { "label": "Compact (inline)", "desc": "Type, Identifier, Subject" },
"s": { "label": "Regular (inline)", "desc": "Status, Type, Identifier, Subject" },
"m": { "label": "Compact card", "desc": "Compact card - Status, Type, Identifier, Subject" },
"l": { "label": "Regular card", "desc": "Regular card - Identifier, Subject, Type, Status, Parent, Project" },
"xl": { "label": "Full card", "desc": "Full card - Identifier, Subject, Type, Status, Parent, Project, Description" }
"xxs": { "label": "Tiny", "desc": "Identifier" },
"xs": { "label": "Compact", "desc": "Type, Identifier, Subject" },
"s": { "label": "Regular", "desc": "Status, Type, Identifier, Subject" },
"m": { "label": "Compact card", "desc": "Status, Type, Identifier, Subject" },
"l": { "label": "Regular card", "desc": "Identifier, Subject, Type, Status, Parent, Project" },
"xl": { "label": "Full card", "desc": "Identifier, Subject, Type, Status, Parent, Project, Description" }
},
"hashMenu": {
"typeToSearch": "Type to search work packages…",
Expand Down
56 changes: 27 additions & 29 deletions test/lib/components/integration/editor.blockCard.browser.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,34 +9,34 @@ import {
} from '../../../helpers/editorHelpers';

describe('Block card - resize', () => {
it('Compact card -> Regular card: both show title and status', async () => {
renderEditor();
await insertInlineChipViaSlashMenu();
await convertToCompactCard();
// it('Compact card -> Regular card: both show title and status', async () => {
// renderEditor();
// await insertInlineChipViaSlashMenu();
// await convertToCompactCard();

await openBlockCardSizeMenu();
await userEvent.click(page.getByRole('button', { name: 'Regular card', exact: true }));
// await openBlockCardSizeMenu();
// await userEvent.click(page.getByRole('button', { name: 'Regular card', exact: true }));

await expect.element(page.getByTestId('block-card')).toBeVisible();
await expect.element(page.getByText('Fix login bug')).toBeVisible();
await expect.element(page.getByText('In Progress')).toBeVisible();
});
// await expect.element(page.getByTestId('block-card')).toBeVisible();
// await expect.element(page.getByText('Fix login bug')).toBeVisible();
// await expect.element(page.getByText('In Progress')).toBeVisible();
// });

it('Regular card -> Full card shows extended content', async () => {
renderEditor();
await insertInlineChipViaSlashMenu();
// it('Regular card -> Full card shows extended content', async () => {
// renderEditor();
// await insertInlineChipViaSlashMenu();

await openBlockCardSizeMenu();
await userEvent.click(page.getByRole('button', { name: 'Regular card', exact: true }));
await expect.element(page.getByTestId('block-card')).toBeVisible();
// await openBlockCardSizeMenu();
// await userEvent.click(page.getByRole('button', { name: 'Regular card', exact: true }));
// await expect.element(page.getByTestId('block-card')).toBeVisible();

await openBlockCardSizeMenu();
await userEvent.click(page.getByRole('button', { name: 'Full card', exact: true }));
// await openBlockCardSizeMenu();
// await userEvent.click(page.getByRole('button', { name: 'Full card', exact: true }));

await expect.element(page.getByTestId('block-card')).toBeVisible();
await expect.element(page.getByText('Fix login bug')).toBeVisible();
await expect.element(page.getByText('In Progress')).toBeVisible();
});
// await expect.element(page.getByTestId('block-card')).toBeVisible();
// await expect.element(page.getByText('Fix login bug')).toBeVisible();
// await expect.element(page.getByText('In Progress')).toBeVisible();
// });

it('size button label reflects current card size', async () => {
renderEditor();
Expand All @@ -47,20 +47,18 @@ describe('Block card - resize', () => {
await expect.element(page.getByTitle('Change size')).toHaveTextContent('Compact card');
});

it('size menu shows all 6 options for a block card', async () => {
it('size menu shows all 4 options for a block card', async () => {
renderEditor();
await insertInlineChipViaSlashMenu();
await convertToCompactCard();

await openBlockCardSizeMenu();

for (const label of [
'Tiny (inline)',
'Compact (inline)',
'Regular (inline)',
'Tiny',
'Compact',
'Regular',
'Compact card',
'Regular card',
'Full card',
]) {
await expect.element(page.getByRole('button', { name: label, exact: true })).toBeVisible();
}
Expand All @@ -72,7 +70,7 @@ describe('Block card - resize', () => {
await convertToCompactCard();

await openBlockCardSizeMenu();
await userEvent.click(page.getByRole('button', { name: 'Regular card', exact: true }));
await userEvent.click(page.getByRole('button', { name: 'Compact card', exact: true }));

await expect.element(page.getByTestId('size-menu')).not.toBeInTheDocument();
});
Expand Down
28 changes: 14 additions & 14 deletions test/lib/components/integration/editor.conversion.browser.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,17 +22,17 @@ describe('Inline chip - convert to block card', () => {
await expect.element(page.getByTestId('op-bn-work-package--type')).toBeVisible();
});

it('inline → Regular card replaces chip with block card', async () => {
renderEditor();
await insertInlineChipViaSlashMenu();
// it('inline → Regular card replaces chip with block card', async () => {
// renderEditor();
// await insertInlineChipViaSlashMenu();

await openInlineChipSizeMenu();
await userEvent.click(page.getByRole('button', { name: 'Regular card', exact: true }));
// await openInlineChipSizeMenu();
// await userEvent.click(page.getByRole('button', { name: 'Regular card', exact: true }));

await expect.element(page.getByTestId('block-card')).toBeVisible();
await expect.element(page.getByText('Fix login bug')).toBeVisible();
await expect.element(page.getByText('In Progress')).toBeVisible();
});
// await expect.element(page.getByTestId('block-card')).toBeVisible();
// await expect.element(page.getByText('Fix login bug')).toBeVisible();
// await expect.element(page.getByText('In Progress')).toBeVisible();
// });
});

describe('Block card - convert to inline chip', () => {
Expand All @@ -42,7 +42,7 @@ describe('Block card - convert to inline chip', () => {
await convertToCompactCard();

await openBlockCardSizeMenu();
await userEvent.click(page.getByRole('button', { name: 'Tiny (inline)', exact: true }));
await userEvent.click(page.getByRole('button', { name: 'Tiny', exact: true }));

await expect.element(page.getByTestId('block-card')).not.toBeInTheDocument();
await expect.element(page.getByText('#123')).toBeVisible();
Expand All @@ -56,7 +56,7 @@ describe('Block card - convert to inline chip', () => {
await convertToCompactCard();

await openBlockCardSizeMenu();
await userEvent.click(page.getByRole('button', { name: 'Compact (inline)', exact: true }));
await userEvent.click(page.getByRole('button', { name: 'Compact', exact: true }));

await expect.element(page.getByTestId('block-card')).not.toBeInTheDocument();
await expect.element(page.getByText('#123')).toBeVisible();
Expand All @@ -71,7 +71,7 @@ describe('Block card - convert to inline chip', () => {
await convertToCompactCard();

await openBlockCardSizeMenu();
await userEvent.click(page.getByRole('button', { name: 'Regular (inline)', exact: true }));
await userEvent.click(page.getByRole('button', { name: 'Regular', exact: true }));

await expect.element(page.getByTestId('block-card')).not.toBeInTheDocument();
await expect.element(page.getByText('#123')).toBeVisible();
Expand All @@ -90,7 +90,7 @@ describe('Round-trip conversion', () => {

// back to inline S
await openBlockCardSizeMenu();
await userEvent.click(page.getByRole('button', { name: 'Regular (inline)', exact: true }));
await userEvent.click(page.getByRole('button', { name: 'Regular', exact: true }));

await expect.element(page.getByTestId('block-card')).not.toBeInTheDocument();
await expect.element(page.getByText('#123')).toBeVisible();
Expand All @@ -109,7 +109,7 @@ describe('Round-trip conversion', () => {

// back to XXS inline
await openBlockCardSizeMenu();
await userEvent.click(page.getByRole('button', { name: 'Tiny (inline)', exact: true }));
await userEvent.click(page.getByRole('button', { name: 'Tiny', exact: true }));

await expect.element(page.getByTestId('block-card')).not.toBeInTheDocument();
await expect.element(page.getByText('#123')).toBeVisible();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ describe('Inline chip - resize', () => {
await insertInlineChipViaSlashMenu();

await openInlineChipSizeMenu();
await userEvent.click(page.getByRole('button', { name: 'Tiny (inline)', exact: true }));
await userEvent.click(page.getByRole('button', { name: 'Tiny', exact: true }));

await expect.element(page.getByText('#123')).toBeVisible();
await expect.element(page.getByTestId('op-bn-work-package--type')).not.toBeInTheDocument();
Expand All @@ -66,7 +66,7 @@ describe('Inline chip - resize', () => {
await insertInlineChipViaSlashMenu();

await openInlineChipSizeMenu();
await userEvent.click(page.getByRole('button', { name: 'Compact (inline)', exact: true }));
await userEvent.click(page.getByRole('button', { name: 'Compact', exact: true }));

await expect.element(page.getByText('#123')).toBeVisible();
await expect.element(page.getByTestId('op-bn-work-package--type')).toBeVisible();
Expand All @@ -79,7 +79,7 @@ describe('Inline chip - resize', () => {
await insertInlineChipViaHash('##');

await openInlineChipSizeMenu();
await userEvent.click(page.getByRole('button', { name: 'Tiny (inline)', exact: true }));
await userEvent.click(page.getByRole('button', { name: 'Tiny', exact: true }));

await expect.element(page.getByText('#123')).toBeVisible();
await expect.element(page.getByTestId('op-bn-work-package--type')).not.toBeInTheDocument();
Expand Down
18 changes: 8 additions & 10 deletions test/lib/components/integration/wpOptionsPopover.browser.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ describe('Inline chip size transitions (user-visible content)', () => {
await expect.element(page.getByText('In Progress')).not.toBeInTheDocument();

await openSizeMenu();
await userEvent.click(page.getByRole('button', { name: 'Compact (inline)', exact: true }));
await userEvent.click(page.getByRole('button', { name: 'Compact', exact: true }));

await expect.element(page.getByTestId('op-bn-work-package--type')).toBeVisible();
await expect.element(page.getByText('Fix login bug')).toBeVisible();
Expand All @@ -72,7 +72,7 @@ describe('Inline chip size transitions (user-visible content)', () => {
await expect.element(page.getByText('In Progress')).not.toBeInTheDocument();

await openSizeMenu();
await userEvent.click(page.getByRole('button', { name: 'Regular (inline)', exact: true }));
await userEvent.click(page.getByRole('button', { name: 'Regular', exact: true }));

await expect.element(page.getByText('In Progress')).toBeVisible();
});
Expand All @@ -86,7 +86,7 @@ describe('Inline chip size transitions (user-visible content)', () => {
await expect.element(page.getByText('Fix login bug')).toBeVisible();

await openSizeMenu();
await userEvent.click(page.getByRole('button', { name: 'Tiny (inline)', exact: true }));
await userEvent.click(page.getByRole('button', { name: 'Tiny', exact: true }));

await expect.element(page.getByText('#123')).toBeVisible();
await expect.element(page.getByTestId('op-bn-work-package--type')).not.toBeInTheDocument();
Expand Down Expand Up @@ -183,15 +183,15 @@ describe('Inline chip popover UX', () => {
render(<ChipWrapper initialSize="s" />);
await waitForResolvedChip();
await openSizeMenu();
await userEvent.click(page.getByRole('button', { name: 'Compact (inline)', exact: true }));
await userEvent.click(page.getByRole('button', { name: 'Compact', exact: true }));
await expect.element(page.getByTestId('size-menu')).not.toBeInTheDocument();
});

it('size button label reflects the current chip size', async () => {
render(<ChipWrapper initialSize="s" />);
await waitForResolvedChip();
await openPopover();
await expect.element(page.getByTitle('Change size')).toHaveTextContent('Regular (inline)');
await expect.element(page.getByTitle('Change size')).toHaveTextContent('Regular');
});

it('inline size menu shows all 6 options', async () => {
Expand All @@ -200,12 +200,10 @@ describe('Inline chip popover UX', () => {
await openSizeMenu();

for (const label of [
'Tiny (inline)',
'Compact (inline)',
'Regular (inline)',
'Tiny',
'Compact',
'Regular',
'Compact card',
'Regular card',
'Full card',
]) {
await expect.element(page.getByRole('button', { name: label, exact: true })).toBeVisible();
}
Expand Down
Loading