Skip to content

Fix: Toggling a task inside a collapsible section collapses all sections

What does this MR do?

PORTS https://gitlab.com/gitlab-org/gitlab-ee/merge_requests/16153 to EE.

This solves issue: https://gitlab.com/gitlab-org/gitlab-ce/issues/61933.

The issue was when the html string for the description was returned from the server, we added it to the dom. The issue was we we were NOT keeping track of the <details> open state.

This solution retrieves the dom nodes and then does a replace on the html string we get back from the server, updating the correct <details> tags from open to closed, or closed to open.

Screenshots

2019-08-23_15.43.24

2019-08-23_15.48.38

Future considerations: Im not sure how important this is but well want to consider nested <details> tags. The issue that this fixes is also happening on an issue comment. (Currently investigating and will reach out to product for prioritization). To my knowledge, the description was the most important aspect for this fix.

WIP: Adding tests, refactoring, and thinking about ways to improve performance.

Does this MR meet the acceptance criteria?

Conformity

Performance and Testing

I dont think the solution I introduced will cause a laggy user experience, however, I am not super comfortable refetching the details dom nodes every single time the poll is updated. Though I am not sure there is a way around it right now.

Another solution is keeping track of the details toggle in local state, instead of fetching the dom nodes, however, we need a way to find the corresponding dom node for the corresponding state.

Eventually, if we start supporting searching through issue comments as well. We will definitely need to find a more performant way. (Not sure what that is at the moment)

If cross-browser testing is not required, please remove the relevant item, or mark it as not needed: [-] -->

Security

If this MR contains changes to processing or storing of credentials or tokens, authorization and authentication methods and other items described in the security review guidelines:

  • Label as security and @ mention @gitlab-com/gl-security/appsec
  • The MR includes necessary changes to maintain consistency between UI, API, email, or other methods
  • Security reports checked/validated by a reviewer from the AppSec team

Closes #61933 (moved)

Edited by Scott Stern

Merge request reports