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
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.16",
"version": "0.0.17",
"private": false,
"main": "./dist/core/components/RestImport.js",
"release": {
Expand Down
30 changes: 18 additions & 12 deletions src/core/components/RestImport.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -1222,10 +1222,16 @@ export default function RestImport({ language, restImportConfig }: { language: s
withCredentials: true
};
const response: any = await Apicall(updateSwagger);
handleResponse(handleRes, handleReq, response)
if (response.status === 200) {

if (response.status >= 200 && response.status < 300) {
const updateSwaggerResponse = response.data
if (!restImportConfig.viewMode) {
restImportConfig.getServiceName(updateSwaggerResponse?.serviceId)
setserviceName(updateSwaggerResponse?.serviceId)
}
handleResponse(handleRes, handleReq, updateSwaggerResponse)
} else {
handleResponse(handleRes, handleReq)
console.log("Received an unexpected response:", response);
}
}
Expand Down Expand Up @@ -1271,8 +1277,8 @@ export default function RestImport({ language, restImportConfig }: { language: s
<Button className='test-btn' name="wm-webservice-sample-test" onClick={handleTestClick} variant='contained'>{translate('TEST')}</Button>
</Stack>
<Grid mt={2} container>
<Grid item md={3}>
<Stack sx={{ cursor: "pointer" }} spacing={2} display={'flex'} alignItems={'center'} direction={'row'}>
<Grid item md={4}>
<Stack sx={{ cursor: "pointer" }} display={'flex'} alignItems={'center'} direction={'row'}>
<Typography>{translate('SERVICE_NAME')}</Typography>
<TextField value={serviceName}
className='url-input service-input'
Expand All @@ -1289,26 +1295,26 @@ export default function RestImport({ language, restImportConfig }: { language: s
}} disabled={serviceNameEnabled || restImportConfig.viewMode} size='small' />
</Stack>
</Grid>
<Grid item md={3} pr={2}>
<Grid item md={4} px={2}>
<Stack sx={{ cursor: "pointer" }} spacing={2} display={'flex'} alignItems={'center'} direction={'row'}>
<Typography sx={{ margin: '10px' }}>{translate("BASE_PATH")}</Typography>
<Typography sx={{ marginRight: '15px' }}>{translate("BASE_PATH")}</Typography>
<FormControl size='small' sx={{width:'200px'}}>
<Select
className='form-control-select'
className='form-control-select service-base-path'
name="wm-base-path"
data-testid="base-path"
value={basePath}
title={basePath}
inputProps={{ readOnly: basePathEnabled}}
disabled={ basePathEnabled}
onChange={handleChangeBasePath}
>
{basePathList.map((basePath) => <MenuItem key={basePath} title={basePath} value={basePath}>{basePath}</MenuItem>)}
</Select>
</FormControl>
</Stack>
</Grid>
<Grid item md={3}>
<Stack spacing={2} display={'flex'} alignItems={'center'} direction={'row'}>
<Grid item md={2}>
<Stack display={'flex'} alignItems={'center'} direction={'row'}>
<Typography>{translate('USE_PROXY')}</Typography>
<Switch name="wm-webservice-use-proxy" data-testid="proxy-switch" checked={useProxy} onChange={handleChangeProxy} />
<Tooltip
Expand All @@ -1321,8 +1327,8 @@ export default function RestImport({ language, restImportConfig }: { language: s
</Stack>
</Grid>
{!useProxy &&
<Grid item md={3}>
<Stack spacing={2} display={'flex'} alignItems={'center'} direction={'row'}>
<Grid item md={2}>
<Stack display={'flex'} alignItems={'center'} direction={'row'}>
<Typography>{translate('WITH_CREDENTIALS')}</Typography>
<Switch name="wm-webservice-with-credentials" data-testid="with-credentials" checked={withCredentials} onChange={handleChangeWithCredentials} />
<Tooltip
Expand Down
3 changes: 2 additions & 1 deletion src/jsx/locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -104,5 +104,6 @@
"CODE_CHALLENGE": "Code Challenge method which your oAuth provider supports for PKCE.",
"USEPROXY_TOOLTIP": "Disable the Use Proxy to make a direct call to the target API for bypassing the proxy server. There may be issues if the API does not allow Cross Origin Resource Sharing.<br><br><u>Note</u>: \nUse Proxy should be enabled if you want to configure a Header or Query param as a Server Side Property. A server side param is sent from the proxy server and is hidden from the UI.",
"WITH_CREDENTIALS_TOOLTIP": "Check this if the cookies from the endpoint API should be set and honored by the browser.",
"CHANGE_PROVIDER": "Change Provider"
"CHANGE_PROVIDER": "Change Provider",
"BASE_PATH": "Base Path"
}