diff --git a/src/shared/components/IDResolution/ResponseViewer.tsx b/src/shared/components/IDResolution/ResponseViewer.tsx index e147dc15d..e3936061e 100644 --- a/src/shared/components/IDResolution/ResponseViewer.tsx +++ b/src/shared/components/IDResolution/ResponseViewer.tsx @@ -4,12 +4,20 @@ type Props = { data: any; header?: string; showHeader?: boolean; + collapsed?: boolean; + style?: React.CSSProperties; }; -const ResponseViewer = ({ data, showHeader = false, header = '' }: Props) => { +const ResponseViewer = ({ + data, + showHeader = false, + header = '', + collapsed = false, + style = {}, +}: Props) => { return ( { enableClipboard={false} displayObjectSize={false} displayDataTypes={false} - style={{ maxWidth: 'inherit', width: '600px' }} + style={{ maxWidth: 'inherit', width: '600px', ...style }} /> ); }; diff --git a/src/shared/containers/ResourceViewContainer.tsx b/src/shared/containers/ResourceViewContainer.tsx index 12d2dbb82..6f7c0f756 100644 --- a/src/shared/containers/ResourceViewContainer.tsx +++ b/src/shared/containers/ResourceViewContainer.tsx @@ -43,6 +43,7 @@ import VideoPluginContainer from './VideoPluginContainer/VideoPluginContainer'; import { useMutation } from 'react-query'; export const DEFAULT_ACTIVE_TAB_KEY = '#JSON'; +import ResponseViewer from '../../shared/components/IDResolution/ResponseViewer'; export type PluginMapping = { [pluginKey: string]: object; @@ -707,48 +708,67 @@ const ResourceViewContainer: FC<{ {!!error ? ( - - - {error.message} - - {error.rejections && ( - - - <> -
    - {error.rejections.map((el, ix) => ( -
  • {el.reason}
  • - ))} -
- -

- For further information please refer to the API - documentation,{' '} - - https://bluebrainnexus.io/docs/delta/api - -

- -
-
- )} - - } - /> + <> + + + {error.message} + + {error.rejections && ( + + + <> +
    + {error.rejections.map((el, ix) => ( +
  • {el.reason}
  • + ))} +
+ +

+ For further information please refer to the API + documentation,{' '} + + https://bluebrainnexus.io/docs/delta/api + +

+ +
+
+ )} + + } + /> +
+ +
+ ) : ( <> {resource && ( diff --git a/src/subapps/studioLegacy/containers/StudioContainer.tsx b/src/subapps/studioLegacy/containers/StudioContainer.tsx index f886c408c..e1a43549f 100644 --- a/src/subapps/studioLegacy/containers/StudioContainer.tsx +++ b/src/subapps/studioLegacy/containers/StudioContainer.tsx @@ -2,9 +2,8 @@ import * as React from 'react'; import { Resource } from '@bbp/nexus-sdk'; import { useNexusContext, AccessControl } from '@bbp/react-nexus'; import { Empty, message } from 'antd'; -import { omitBy } from 'lodash'; import { useHistory } from 'react-router'; - +import { omitBy } from 'lodash'; import EditStudio from '../components/EditStudio'; import StudioHeader from '../components/StudioHeader'; import StudioReactContext from '../contexts/StudioContext';