File tree Expand file tree Collapse file tree 1 file changed +34
-5
lines changed
Expand file tree Collapse file tree 1 file changed +34
-5
lines changed Original file line number Diff line number Diff line change 33
44 import Dragula from ' @bpmn-io/draggle' ;
55
6-
76 import BoardFilter from ' ./BoardFilter.svelte' ;
87
98 import Avatar from ' ./components/Avatar.svelte' ;
9897
9998 const columnItems = items[column];
10099
101- shownItems[column] = columnItems .filter (item => ! isClosingPull (item) );
100+ shownItems[column] = columnItems .filter (isShown );
102101
103102 return shownItems;
104103 }, {})
729728 };
730729 }
731730
732- function isClosingPull (item ) {
733- return isPull (item) && isOpenOrMerged (item) && item .links .some (link => {
734- return isClosingLink (link) && itemsById[link .target .id ];
731+ /**
732+ * Test whether the item should be shown on the board, because they are not
733+ *
734+ * * pull requests
735+ * * linked to an issue via <Closes #ISSUE_NR>
736+ * * in the same column as the issue
737+ *
738+ * @param {any} item
739+ *
740+ * @return {boolean}
741+ */
742+ function isShown (item ) {
743+
744+ if (! isPull (item)) {
745+ return true ;
746+ }
747+
748+ if (! isOpenOrMerged (item)) {
749+ return true ;
750+ }
751+
752+ if (! isAttachedInSameColumn (item)) {
753+ return true ;
754+ }
755+
756+ return false ;
757+ }
758+
759+ function isAttachedInSameColumn (item ) {
760+ return item .links .some (link => {
761+ const closedItem = isClosingLink (link) && itemsById[link .target .id ];
762+
763+ return closedItem && closedItem .column === item .column ;
735764 });
736765 }
737766
You can’t perform that action at this time.
0 commit comments