stable
Clone or download
Part of request #12245: Displaying an artifact with a lot of artifact links is slow Context ------- If there are a lot of artifact links, and associated reports take ages to load (with computed fields for example), then the whole page is blocked and users cannot work on the artifact. Proposal -------- A short term solution is proposed here to load slow renderers asynchronously. By "slow", we arbitrarily assume that above 50 artifacts we should load the renderer async. This limit can be increased or decreased later according to end users' feedback. For now (and to ease tests), it can be adjusted thanks to a local.inc variable: $tracker_artifactlink_async_limit = 3; β above 3 artifacts in a tracker, async loading. How to test ----------- In a release artifact, attach more than 50Β user story artifacts (from the same US tracker) and 3 or 4 sprint artifacts (from the same Sprint tracker). Now load the artifact, in the artifact link section: - sprints are already displayed in the "Sprint" tracker tab - there should be a spinner in the "User story" tracker tab content - there should be a spinner in the "User story" tracker tab label - there should be a spinner + message in edit mode - there should not be link/create/preview buttons - there is no possibility to mass unlink artifacts - it is not possible to expand/collapse children - it is possible to add/remove link and submit the artifact Once the user stories are loaded: - spinner in tab content is replaced by user stories renderer - spinner in tab label is hidden Once all trackers are loaded: - spinner + message in edit mode is hidden - there should be link/create/preview buttons - it is possible to mass unlink artifacts - it is possible to expand/collapse children - checkboxes to unlink is replaced by crosses (just like before this patch) Things to check: - ArtifactFolder behavior - submit artifact view - modal v1, v2, v3, β¦ - IE11 *Note:* To simulate a slow rendering, you can put sleep(2); statement at L885 of Tracker_FormElement_Field_ArtifactLink class. (don't forget to revert it!) Implementation notes -------------------- This contribution needs to hack legacy script TrackerArtifactLink.js. In order to be able to understand what was going on, I needed to split this file in two parts, and to reorganize and to group some functions. Ideally we should rewrite the whole thing to get rid of PrototypeJS legacy, unfortunately this is not the scope of this commit. However the change I made in order to be async are hidden under the split/reorg, sorry about that. Change-Id: I642a0f001623e0c2ed88c3b01e59d9c22a1f16a7
Modified Files
Name | ||||
---|---|---|---|---|
M | .eslintignore | +2 | β0 | Go to diff View file |
M | plugins/tracker/build-manifest.json | +1 | β0 | Go to diff View file |
M | plugins/tracker/include/Tracker/FormElement/Field/ArtifactLink/ArtifactLinksToRender.php | +22 | β0 | Go to diff View file |
M | plugins/tracker/include/Tracker/FormElement/Tracker_FormElement_Field_ArtifactLink.class.php | +106 | β17 | Go to diff View file |
M | plugins/tracker/include/Tracker/Report/Tracker_Report_Renderer_Table.class.php | +1 | β1 | Go to diff View file |
M | plugins/tracker/site-content/en_US/script_locale.txt | +2 | β1 | Go to diff View file |
M | plugins/tracker/site-content/fr_FR/script_locale.txt | +3 | β2 | Go to diff View file |
M | plugins/tracker/templates/artifactlink-nature-table-head.mustache | +1 | β0 | Go to diff View file |
A | plugins/tracker/www/scripts/LoadTrackerArtifactLink.js | +810 | β0 | Go to diff View file |
M | plugins/tracker/www/scripts/TrackerArtifactEditionSwitcher.js | +7 | β3 | Go to diff View file |
M | plugins/tracker/www/scripts/TrackerArtifactLink.js | +21 | β692 | Go to diff View file |
M | plugins/tracker/www/themes/FlamingParrot/css/style.scss | +4 | β0 | Go to diff View file |
M | plugins/tracker/www/themes/default/css/style.scss | +18 | β0 | Go to diff View file |