New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: 🍰 Hero image height on post page is now set without having to wait for… #3583
feat: 🍰 Hero image height on post page is now set without having to wait for… #3583
Conversation
… the image to load. Vue gives the image aspect ratio to css as a css variable, css then sets the correct height in fuction of the width.
Test summaryRun details
View run in Cypress Dashboard ➡️ This comment has been generated by cypress-bot as a result of this project's GitHub integration settings. You can manage this integration in this project's settings in the Cypress Dashboard |
Test summaryRun details
View run in Cypress Dashboard ➡️ This comment has been generated by cypress-bot as a result of this project's GitHub integration settings. You can manage this integration in this project's settings in the Cypress Dashboard |
@Tirokk Any idea as to why the back-end tests fail? It seems to be different errors then my local ones. I'll try local tests on an Ubuntu VM in the meantime to rule out the windows quirkiness. |
n.v.m, seems they succeeded on a subsequent run. |
I just restarted the failing build … 🤗 If they fail we can just restart them. There are some guesses of @rbeer why it is this way, but no time at the moment to change this … |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey @DriesCruyskens !
Wonderful you did your first PR. 🍾💫
I’ve tried this out with my images and created a post.
Unfortunately it didn’t worked with both images.
But in the production it worked correctly …
Here you see what I got …
Created a post and dragged the image in the teaser area …
Post before saved, correct so far:
Post in newsfeed, correct so far:
I don’t now what the reason is till now and have no time to find out before the weekend.
That's on me then for not testing it rigorously enough, I will look into it. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey @DriesCruyskens ,
this is wonderful work of yours !!! 🚀💫
Your solution works great for me and as well if I jump to comments I got notified of!
Love it! 😍
I'm glad that you devoted your time to our project!
Just in case somebody has time and because I'm not the CSS specialist, what are other peoples opinions? Otherwise I will merge it like it is … |
…te-size-ratio-from-the-beginning
- My conflict resolved on GitHub missed a bracket.
… the image to load. Vue gives the image aspect ratio to css as a css variable, css then sets the correct height in fuction of the width.
🍰 Pullrequest
The implementation uses CSS to determine the height of the Card image and thus only affects the Post page, whereas a solution using Javascript to explicitly setting the height would need communication between the Post page and the Card component for the aspect ratio to be propagated. I think this would needlessly clutter the card component since the issue is related to the Post component only.
The solution might be seen as a 'CSS hack' to a few people but I think it is the most concise solution for the problem and is mentioned by W3 https://www.w3schools.com/howto/howto_css_aspect_ratio.asp.
Here is a GIF demonstrating the problem, before my pull request:
This is after the PR:
Issues
Todo
Test
Solution works using a Neo4j cloud sandbox to simulate real loading times. Using the docker compose setup gives near instant loading times making it difficult too see the fix in action.
TLDR: all test should succeed, but don't on a windows machine. Someone else or CD/CI pipeline should verify.
Both end-to-end and back-end tests don't even work on a clean master git clone while the app works when developing. Since some things have to be done through WSL in order to work (like
yarn test .\pages\post\_id\_slug\index.spec.js
) I think this might have to do with me developing on a windows machine (windows 10 Pro 1909). This pull request/fix is pretty minimal so it shouldn't break anything end-to-end or back-end wise. If anyone with a working test suite can verify...This is the error for end-to-end tests:
And these are the failed back-end tests: