Skip to content

Commit

Permalink
Fix the issue where clicking on the + button at the top of a board gr…
Browse files Browse the repository at this point in the history
…oup wouldn't open the newly-added card (#1708)

Co-authored-by: Moncy Gopalan <ilusivespectre@gmail.com>
  • Loading branch information
Moncy Gopalan and Moncy Gopalan authored Nov 15, 2021
1 parent d2bcb9a commit e9e86d8
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
9 changes: 9 additions & 0 deletions webapp/cypress/integration/createBoard.js
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,15 @@ describe('Create and delete board / card', () => {
cy.get('.Dialog.dialog-back .wrapper').click({force: true});
});

it('Can create a card by clicking on the + button', () => {
// Create a card by clicking on the + button
cy.get('.KanbanColumnHeader :nth-child(5) > .CompassIcon ').click();
cy.get('.CardDetail').should('exist');

// Close card
cy.get('.Dialog.dialog-back .wrapper').click({force: true});
});

it('Can create a table view', () => {
// Create table view
// cy.intercept('POST', '/api/v1/blocks').as('insertBlocks');
Expand Down
6 changes: 4 additions & 2 deletions webapp/src/components/kanban/kanbanColumnHeader.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ type Props = {
groupByProperty?: IPropertyTemplate
intl: IntlShape
readonly: boolean
addCard: (groupByOptionId?: string) => Promise<void>
addCard: (groupByOptionId?: string, show?: boolean) => Promise<void>
propertyNameChanged: (option: IPropertyOption, text: string) => Promise<void>
onDropToColumn: (srcOption: IPropertyOption, card?: Card, dstOption?: IPropertyOption) => void
calculationMenuOpen: boolean
Expand Down Expand Up @@ -180,7 +180,9 @@ export default function KanbanColumnHeader(props: Props): JSX.Element {
</MenuWrapper>
<IconButton
icon={<AddIcon/>}
onClick={() => props.addCard(group.option.id)}
onClick={() => {
props.addCard(group.option.id, true)
}}
/>
</>
}
Expand Down

0 comments on commit e9e86d8

Please sign in to comment.