Skip to content

Commit a9ab90b

Browse files
authored
Merge pull request #140 from TinkoffCreditSystems/bug/139
[#139] show or hide group sub-task by click on personal WIP-limit
2 parents ff7acbd + f281590 commit a9ab90b

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed

src/person-limits/PersonLimits.js

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,10 @@ export default class extends PageModification {
8686
.ghx-issue.no-visibility {
8787
display: none!important;
8888
}
89+
90+
.ghx-parent-group.no-visibility {
91+
display: none!important;
92+
}
8993
</style>
9094
`;
9195
}
@@ -169,6 +173,7 @@ export default class extends PageModification {
169173
cards.forEach(node => {
170174
node.classList.remove('no-visibility');
171175
});
176+
this.showAllSubTaskParentGroup();
172177
return;
173178
}
174179

@@ -189,6 +194,27 @@ export default class extends PageModification {
189194
node.classList.add('no-visibility');
190195
}
191196
});
197+
this.showOrHideSubTaskParentGroup();
198+
}
199+
200+
showAllSubTaskParentGroup() {
201+
document.querySelectorAll('.ghx-parent-group').forEach(el => {
202+
el.classList.remove('no-visibility');
203+
});
204+
}
205+
206+
showOrHideSubTaskParentGroup() {
207+
const parentGroup = Array.from(document.querySelectorAll('.ghx-parent-group'));
208+
parentGroup.forEach(el => {
209+
const lenNoVisibleCards = el.querySelectorAll('.ghx-issue.no-visibility').length;
210+
const lenCard = el.querySelectorAll('.ghx-issue').length;
211+
212+
if (lenNoVisibleCards === lenCard) {
213+
el.classList.add('no-visibility');
214+
} else {
215+
el.classList.remove('no-visibility');
216+
}
217+
});
192218
}
193219

194220
hasCustomSwimlines() {

0 commit comments

Comments
 (0)