Skip to content

Commit

Permalink
Fix resource switch with special characters
Browse files Browse the repository at this point in the history
  • Loading branch information
filippomc committed Nov 15, 2023
1 parent 0d8fde5 commit fc57208
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ const OSBResourceItem = (props: {
Icon,
} = props;
const canOpenFile: boolean =
resource.status === ResourceStatus.available && !active;
resource.status === ResourceStatus.available;
const [waiting, setWaiting] = React.useState(
resource.status === ResourceStatus.pending
);
Expand All @@ -129,7 +129,7 @@ const OSBResourceItem = (props: {
(e: any) => {
navigate(
{pathname: `/workspace/open/${workspaceId}/${resource.type.application.code}`,
search: `?resource=${resource.name}`},
search: `?resource=${encodeURIComponent(resource.name)}`},
)
};

Expand Down
3 changes: 1 addition & 2 deletions applications/osb-portal/src/pages/SampleIframePage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@ const SampleIframePage = () => {
const [fileLoaded, setFileLoaded] = React.useState("");
React.useEffect(() => {
if (window !== window.parent) {
setTimeout(() => {
window.parent.postMessage({ type: "APP_READY" }, "*");}, 1000);
window.parent.postMessage({ type: "APP_READY" }, "*");
}
return () => {};
}, []);
Expand Down
4 changes: 3 additions & 1 deletion applications/osb-portal/src/pages/WorkspaceOpenPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,9 @@ export default (props: any) => {
app: string;
}>();

props.selectWorkspace(workspaceId);
React.useEffect(() => {
props.selectWorkspace(workspaceId);
}, [workspaceId]);

return (
<Box className="verticalFill">
Expand Down

0 comments on commit fc57208

Please sign in to comment.