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 routing issues that occur when using setIframe. #50

Merged
merged 4 commits into from
Sep 26, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .tool-versions
Original file line number Diff line number Diff line change
@@ -1 +1 @@
nodejs 18.16.0
nodejs 18.17.1
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
"url": "https://github.com/prismatic-io/embedded.git"
},
"license": "MIT",
"version": "2.2.1",
"version": "2.2.2",
"main": "dist/index.js",
"types": "dist/index.d.ts",
"files": [
Expand Down
2 changes: 1 addition & 1 deletion src/lib/configureInstance.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ export const configureInstance = ({
}: ConfigureInstanceProps) => {
assertInit("configureInstance");

setIframe("find-integration-marketplace", options, {
setIframe("/find-integration-marketplace/", options, {
integrationName,
...(skipRedirectOnRemove ? { skipRedirectOnRemove: "true" } : {}),
});
Expand Down
2 changes: 1 addition & 1 deletion src/lib/showComponent.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,5 @@ export const showComponent = ({
}: ShowComponentProps) => {
assertInit("showComponent");

setIframe(`components/${componentId}`, options, {});
setIframe(`/components/${componentId}/`, options, {});
};
2 changes: 1 addition & 1 deletion src/lib/showComponents.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,5 @@ export type ShowComponentsProps = Options & {};
export const showComponents = (options: ShowComponentsProps) => {
assertInit("showComponents");

setIframe("components", options, {});
setIframe("/components/", options, {});
};
2 changes: 1 addition & 1 deletion src/lib/showDashboard.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,5 @@ export const showDashboard = (
) => {
assertInit("showDashboard");

setIframe("dashboard", options, {});
setIframe("/dashboard/", options, {});
};
2 changes: 1 addition & 1 deletion src/lib/showDesigner.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,5 @@ export const showDesigner = ({
}: ShowDesignerProps) => {
assertInit("showDesigner");

setIframe(`integrations/${integrationId}`, options, {});
setIframe(`/integrations/${integrationId}/`, options, {});
};
2 changes: 1 addition & 1 deletion src/lib/showIntegrations.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,5 @@ export type ShowIntegrationsProps = Options & {};
export const showIntegrations = (options: ShowIntegrationsProps) => {
assertInit("showIntegrations");

setIframe("integrations", options, {});
setIframe("/integrations/", options, {});
};
2 changes: 1 addition & 1 deletion src/lib/showLogs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,5 @@ export type ShowLogsProps = Options & {};
export const showLogs = (options: ShowLogsProps) => {
assertInit("showLogs");

setIframe("logs", options, {});
setIframe("/logs/", options, {});
};
2 changes: 1 addition & 1 deletion src/lib/showMarketplace.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,5 @@ export const showMarketplace = (
) => {
assertInit("showMarketplace");

setIframe("integration-marketplace", options, {});
setIframe("/integration-marketplace/", options, {});
};
2 changes: 1 addition & 1 deletion src/utils/iframe.ts
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ export const setIframe = (
);
}

const iframeSrc = urlJoin(state.prismaticUrl, route, `?${queryParams}`);
const iframeSrc = `${urlJoin(state.prismaticUrl, route)}?${queryParams}`;

iframeContainerElement.innerHTML = /* html */ `
<iframe
Expand Down