Handle stringified json response and fix alignment issue (#12886)

This commit is contained in:
Ayangade Adeoluwa 2022-04-14 08:23:07 +01:00 committed by GitHub
parent 0b4741f3ce
commit a4d22b3d13
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 9 deletions

View File

@ -240,7 +240,7 @@ export const responseTabComponent = (
folding
height={"100%"}
input={{
value: output ? JSON.stringify(output, null, 2) : "",
value: isString(output) ? output : JSON.stringify(output, null, 2),
}}
isReadOnly
/>
@ -253,7 +253,7 @@ export const responseTabComponent = (
folding
height={"100%"}
input={{
value: output ? JSON.stringify(output, null, 2) : "",
value: isString(output) ? output : JSON.stringify(output, null, 2),
}}
isRawView
isReadOnly
@ -390,7 +390,7 @@ function ApiResponseView(props: Props) {
</NoResponseContainer>
) : (
<ResponseBodyContainer>
{isString(response.body) && isHtml(response.body) && (
{isString(response.body) && isHtml(response.body) ? (
<ReadOnlyEditor
folding
height={"100%"}
@ -399,11 +399,9 @@ function ApiResponseView(props: Props) {
}}
isReadOnly
/>
)}
{!isString(response.body) &&
responseTabs &&
responseTabs.length > 0 &&
selectedTabIndex !== -1 ? (
) : responseTabs &&
responseTabs.length > 0 &&
selectedTabIndex !== -1 ? (
<EntityBottomTabs
defaultIndex={selectedTabIndex}
onSelect={onResponseTabSelect}

View File

@ -30,10 +30,12 @@ const EmptyDatasourceContainer = styled.div`
`;
const DatasourceContainer = styled.div`
.react-tabs__tab-list {
&&&&&&&&&&& .react-tabs__tab-list {
padding: 0 16px !important;
border-bottom: none;
border-left: 2px solid #e8e8e8;
margin-left: 0px;
margin-right: 0px;
.cs-icon {
margin-right: 0;
}