Skip to content
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

Fix issues with updating template images #338

Merged
merged 5 commits into from
Jan 14, 2021

Conversation

jacobkeeler
Copy link
Contributor

@jacobkeeler jacobkeeler commented Dec 22, 2020

Fixes #323

Summary of Changes:

  • Fixes warnings in Image.js
  • Fixes issue where template images were cached and never updated
  • Fixes issues with scaling when rerendering template images

Copy link
Collaborator

@iCollin iCollin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Testing went well, I couldn't find any BOTH softbuttons overflowing.

This branch needs to be rebased on develop since we squashed the commits from the PR templates.

@@ -7,13 +7,21 @@ class Image extends React.Component {
constructor(props) {
super(props);
this.state = {error: false, refreshed: false};
this.canvasStyle = {
this.customCanvasStyle = {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@JackLivio can you clarify the purpose of this variable? Is the intention that someone who adopts the generic HMI will modify the customCanvasStyle value here in the constructor to hardcode canvas sizes for the whole HMI?

This variable currently has no effect on how an Image is rendered.

Copy link
Collaborator

@Jack-Byrne Jack-Byrne Jan 5, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@iCollin Referring to canvasStyle before the changes in the pr, that object was created to store the canvasContainer height and width. There was a strange issue in safari where the canvasContainer height would increase when the image in a button that was clicked on, and it would drive the image down the page.

@jacobkeeler jacobkeeler force-pushed the fix/template_image_updating branch from 45dd957 to 6f5438e Compare January 4, 2021 15:40
@jacobkeeler
Copy link
Contributor Author

@iCollin Rebased commits, unfortunately it did require a force-push, but the changes were directly cherry-picked from the 3 original commits

Copy link
Collaborator

@iCollin iCollin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Testing went well, approved.

One question I have though, do you think we should leave the default canvas size as 300? I mistyped my image name at first, and the text was forced outside of an alert softbutton because by default the canvas was 300x75. This would also apply in the case an image upload failed. Would it make sense to use a smaller default canvas size?

Copy link
Collaborator

@iCollin iCollin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I could not reproduce #293 on this branch. I think we can remove customCanvasStyle.

@jacobkeeler jacobkeeler merged commit 80f015e into develop Jan 14, 2021
@jacobkeeler jacobkeeler deleted the fix/template_image_updating branch January 14, 2021 20:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants