Skip to content

Commit

Permalink
fix/dnd-bugs (#721)
Browse files Browse the repository at this point in the history
  • Loading branch information
samkevin1 authored Mar 23, 2021
1 parent 8b190c4 commit d83c594
Show file tree
Hide file tree
Showing 6 changed files with 37 additions and 5 deletions.
2 changes: 1 addition & 1 deletion app/assets/javascripts/components/Columns/ColumnItem.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ export const Column = ({ title, children, renderAction, onClose, canClose, provi

const DroppableColumn = ({ title, children, renderAction, onClose, visible, canClose, columnId }) => (
visible && (
<Droppable droppableId={JSON.stringify({ columnId })} isDropDisabled={isDone(columnId)}>
<Droppable droppableId={JSON.stringify({ columnId })} isDropDisabled={isDone(columnId)} type='column'>
{provided => (
<Column
canClose={canClose}
Expand Down
1 change: 0 additions & 1 deletion app/assets/javascripts/components/projects/ProjectBoard.js
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,6 @@ export const ProjectBoard = ({
dragStory.state,
);


const newStories = moveStory(
sourceArray,
destinationArray,
Expand Down
2 changes: 1 addition & 1 deletion app/assets/javascripts/components/stories/Sprints.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ const renderSprints = (sprints, fetchStories, columnId) => (
)

const droppableContainer = columnId => (
<Droppable droppableId={JSON.stringify({columnId, sprintIndex: 0})}>
<Droppable droppableId={JSON.stringify({columnId, sprintIndex: 0})} type='sprints'>
{provided => (
<div className='Sprints' ref={provided.innerRef} {...provided.droppableProps}>
{provided.placeholder}
Expand Down
1 change: 1 addition & 0 deletions app/assets/javascripts/components/stories/Stories.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ const Stories = ({ stories, from, sprintIndex, columnId, isDropDisabled }) => (
<Droppable
droppableId={JSON.stringify({ columnId, sprintIndex })}
isDropDisabled={isDropDisabled}
type='stories'
>
{provided => (
<div
Expand Down
2 changes: 1 addition & 1 deletion app/assets/stylesheets/new_board/_project_board.scss
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
overflow: inherit;
padding-top: 2px;
max-width: 100%;
overflow: auto hidden;
overflow: hidden;

&-loading {
display: flex;
Expand Down
34 changes: 33 additions & 1 deletion spec/cypress/integration/dragAndDrop_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,38 @@ describe("DragAndDrop", () => {
// check new order
cy.getDraggablesFromColumn(backlog).should("contain", dragStory);
cy.getDraggablesFromColumn(done).should("not.contain", dragStory);
})
});

it("Drags to closed and reopened columns", () => {
const dragStory =
"A user should be able drag this story from chilly bean and drop to backlog";

// close first column
cy.contains("close").click();

cy.wait(300);

// close second column
cy.contains("close").click();

cy.wait(300);

// reopen chillybin column
cy.get('i[class$="fa-snowflake"]').click();

cy.wait(300);

//reopen backlog/current sprint column
cy.get('i[class$="fa-th-list"]').click();

// move story
cy.getDraggablesFromColumn(chillyBin)
.eq(1)
.as("drag-element")
.moveStory("@drag-element", Keys.arrowRight, Keys.space);

cy.getDraggablesFromColumn(backlog).should("contain", dragStory);

});
});
});

0 comments on commit d83c594

Please sign in to comment.