Skip to content
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 dist/config-import-bundle.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/config-import-bundle.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/log.bundle-sizes.rest-import-ui.txt
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ process: 5.29 KB (0.0473%)
scheduler: 4.33 KB (0.0387%)
@emotion/is-prop-valid: 4.33 KB (0.0387%)
deep-extend: 4.19 KB (0.0375%)
base64-js: 3.84 KB (0.0344%)
base64-js: 3.84 KB (0.0343%)
@mui/styled-engine: 3.55 KB (0.0318%)
@mui/private-theming: 3.5 KB (0.0314%)
css.escape: 3.08 KB (0.0275%)
Expand Down
2 changes: 1 addition & 1 deletion dist/rest-import-bundle.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/rest-import-bundle.js.map

Large diffs are not rendered by default.

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
@@ -1,6 +1,6 @@
{
"name": "@wavemaker/rest-client-ui",
"version": "0.0.19",
"version": "0.0.20",
"private": false,
"main": "./dist/core/components/RestImport.js",
"release": {
Expand Down
11 changes: 9 additions & 2 deletions src/core/components/RestImport.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -338,7 +338,14 @@ export default function RestImport({ language, restImportConfig }: { language: s
const path = new URL(url).pathname; // Extract path from URL
const parts = path.split("/").filter(Boolean); // Remove empty strings

const basePathDetails = parts.map((_, index) => decodeURIComponent("/" + parts.slice(0, index + 1).join("/")));
// Stop at the first occurrence of `{}` placeholders
const firstValidIndex = parts.findIndex(part => {
const decodePart = decodeURIComponent(part)
return decodePart.includes("{") || decodePart.includes("}")
});
const filteredParts = firstValidIndex === -1 ? parts : parts.slice(0, firstValidIndex);

const basePathDetails = filteredParts.map((_, index) => decodeURIComponent("/" + filteredParts.slice(0, index + 1).join("/")));
if(basePathDetails.length > 0){
setBasePath(restImportConfig?.urlBasePath ? restImportConfig?.urlBasePath : basePathDetails[0]);
}
Expand All @@ -347,7 +354,7 @@ export default function RestImport({ language, restImportConfig }: { language: s
console.error("Invalid URL:", error);
setBasePathList([])
}

}

const updateProviderConfig = (key: string, value: any) => {
Expand Down