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.
Description
Closes #135
This pr is dependent on the changes in the outstanding PR on the backend
Files changed
utils/popup-utils/parseAspectRatio.ts
- because the backend will only allow a drop down selector for string values (which must include characters besides numbers), this util will take any string that includes a recognisable aspect ratio in it (i.e.: 4:3) and parse that out and return the calculated ratioparseWindowSize.ts
- now expects a string for theaspectRatio
and callsparseAspectRatio.ts
to return the appropriate ratio calculatedbackgroundPopCreate.ts
&&displayPopup.ts
- both take the newaspect_ratio
property from the popups and pass them toparseWindowSize.ts
if the type of content is "video"types/eventTypes.ts
- extend the types system to reflect the new property forMediaContent
UI changes
It all looks the same except the window size for popups will match what's been chosen in the CMS. The ratio will default to
16:9
if nothing has been passed or if the content type is an image or text.Changes to Documentation
n/a
Tests
parseWindowSize.test.js
- one of the tests was checking the return value for a call where the aspect ratio is explicitly passed. This was adjusted as the argument type is no longer anumber
but astring
parseAspectRatio.test.js
- new test suite for the new util