Fix excessive page updates in gitlab migration
What does this MR do and why?
Related to #350984 (closed)
This MR fixes excessive page updates in gitlab migration page.
The main reason of redraws was computed, where we attempted to setup "default target" for each group. However, due to the way how Vue reactivity works, that meant that computed value considered that it was depending on entire this.importTargets
object - so when any import target was changed (by typing) - all elements on page were rerendered
We are changing this logic to prepopulate default targets when groups
data changes. In this way reactivity system correctly sets dependency tracking group with id X <--> this.importTargets[x]
instead of depending on whole this.importTargets
which fixes redraw problem
Describe in detail what your merge request does and why.
Screenshots or screen recordings
Before (multiple redraws tracked by Vue devtools)
After (no redraws tracked)
How to set up and validate locally
- Open "New group" -> Import (
/groups/new
) - Use
https://gitlab.com
as source instance andGeK1Nis4j-SY1X4sqE5c
as personal access token (this token is from separate user on GitLab instance with 0 real data available, so we do not expose any security risks here) - Open Vue devtools and enable
Highlight updates
(three dots in top right corner) - Start typing something in inputs
- Observe no page redraws
MR acceptance checklist
This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.
-
I have evaluated the MR acceptance checklist for this MR.