[MWPW-170376] Preflight assets tab updates #4510
Open
+287
−135
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This adapts the Assets checks from the Preflight suite to also check videos, not only images. To keep a god balance between performance and quality, a factor of
1
has been chosen for video assets; meaning a video's dimensions should be at least those of its container. It considers:video
tags. These are marked as Video (Sharepoint);iframe
tags. These are marked as Video (MPC);video
tags. These are marked as Video (MPC source).A couple of additional checks can populate a new Notes field, as suggested here, should one of these conditions be met:
The Assets logic had to be refactored, as the logic got more complex with adding video checks. Another small change was made to the video decoration logic to ensure a source is only added if one doesn't already exist. This is needed, since the Preflight logic forces video load, even when outside the viewport, in order to perform the relevant size calculations. When a user eventually scrolls the page, we need to ensure we don't duplicate the video's
source
child.Resolves: MWPW-170376
Test URLs: