-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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 app configuration frame embedding #1172
Conversation
}; | ||
} | ||
|
||
async function _fetchAndSetContent( |
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.
I don't think we need to prefix this with _
as we're not exporting it anywhere
} | ||
|
||
async function _fetchAndSetContent( | ||
frameContainer: MutableRefObject<HTMLDivElement>, |
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.
Let's pass the object reference itself without any React logic
frameContainer: MutableRefObject<HTMLDivElement>, | |
frameContainer: HTMLDivElement, |
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.
Im not so sure if it would work, this object has to be mutable. Ill test it tomorrow
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.
Suprisingly it works
const frameContainer = useRef<HTMLDivElement>(null); | ||
|
||
useEffect(() => { | ||
_fetchAndSetContent(frameContainer, data, backendHost, callbacks); |
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.
_fetchAndSetContent(frameContainer, data, backendHost, callbacks); | |
_fetchAndSetContent(frameContainer.current, data, backendHost, callbacks); |
I want to merge this change because it fixes problems with iframe scripts embedding - it currently handles cases when configuration page has no
<script />
tags at all or when they don't havesrc
property. Also fixes relative path handling.PR intended to be tested with API branch: master
Pull Request Checklist
[data-test-id]
are added for new elementsTest environment config
API_URI=https://qa.staging.saleor.cloud/graphql/