-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #196 from FC4E-CAT/devel
Release v1.2.0
- Loading branch information
Showing
12 changed files
with
166 additions
and
87 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,5 +2,8 @@ | |
"api": { | ||
"base_url": "http://localhost:8080", | ||
"version": "v1" | ||
}, | ||
"embedded_views": { | ||
"pid_selection_view": "" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
import { useEffect, useRef } from "react"; | ||
import config from "@/config.json"; | ||
|
||
function PidSelection() { | ||
const iframeRef = useRef<HTMLIFrameElement>(null); | ||
// const [iframeHeight, setIframeHeight] = useState('0px'); | ||
|
||
useEffect(() => { | ||
const handleResize = (event: MessageEvent) => { | ||
if (event.origin === config?.embedded_views?.pid_selection_view) { | ||
// Replace with the actual domain of pageB | ||
console.log("received size from child:", event.data); | ||
if (iframeRef.current) | ||
iframeRef.current.style.height = event.data + "px"; | ||
} | ||
}; | ||
|
||
window.addEventListener("message", handleResize); | ||
|
||
// Cleanup function to remove the event listener | ||
return () => { | ||
window.removeEventListener("message", handleResize); | ||
}; | ||
}, []); | ||
|
||
return ( | ||
<div> | ||
<iframe | ||
src={config?.embedded_views?.pid_selection_view} | ||
style={{ width: "100%", height: "800px" }} | ||
ref={iframeRef} | ||
></iframe> | ||
</div> | ||
); | ||
} | ||
|
||
export default PidSelection; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters