Skip to content

Commit

Permalink
Use items instead of children in Ant collapse
Browse files Browse the repository at this point in the history
  • Loading branch information
Dinika committed Oct 4, 2023
1 parent d1a813d commit 24c70ed
Showing 1 changed file with 81 additions and 85 deletions.
166 changes: 81 additions & 85 deletions src/shared/containers/AdminPluginContainer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -93,113 +93,109 @@ const AdminPlugin: React.FunctionComponent<AdminProps> = ({
resource={resource}
refreshResource={refreshResource}
/>
<Tabs
activeKey={activeTabKey}
onChange={onTabChange}
<Tabs activeKey={activeTabKey} onChange={onTabChange}
items={[
{
key: '#JSON',
label: 'JSON',
children: (
<ResourceEditorContainer
resourceId={resource['@id']}
orgLabel={orgLabel}
projectLabel={projectLabel}
rev={resource._rev}
defaultExpanded={
!!expandedFromQuery && expandedFromQuery === 'true'
}
defaultEditable={editable}
onSubmit={handleEditFormSubmit}
onExpanded={handleExpanded}
tabChange={tabChange}
showFullScreen={showFullScreen}
/>
),
},
<ResourceEditorContainer
resourceId={resource['@id']}
orgLabel={orgLabel}
projectLabel={projectLabel}
rev={resource._rev}
defaultExpanded={
!!expandedFromQuery && expandedFromQuery === 'true'
}
defaultEditable={editable}
onSubmit={handleEditFormSubmit}
onExpanded={handleExpanded}
tabChange={tabChange}
showFullScreen={showFullScreen}
/>
),
},
{
key: '#mde',
label: 'Description',
children: (
<MarkdownEditorContainer
resourceId={resource['@id']}
orgLabel={orgLabel}
projectLabel={projectLabel}
rev={resource._rev}
readOnly={!editable}
goToResource={goToResource}
/>
),
},
<MarkdownEditorContainer
resourceId={resource['@id']}
orgLabel={orgLabel}
projectLabel={projectLabel}
rev={resource._rev}
readOnly={!editable}
goToResource={goToResource}
/>
),
},
{
key: '#history',
label: 'History',
children: (
<HistoryContainer
resourceId={resource['@id']}
orgLabel={orgLabel}
projectLabel={projectLabel}
latestRev={latestResource._rev}
link={(rev: number) => {
return (
<a
onClick={() => {
goToResource(orgLabel, projectLabel, resourceId, {
revision: rev,
});
}}
>
Revision {rev}
</a>
);
}}
/>
),
},
label: 'History',
children: (<HistoryContainer
resourceId={resource['@id']}
orgLabel={orgLabel}
projectLabel={projectLabel}
latestRev={latestResource._rev}
link={(rev: number) => {
return (
<a
onClick={() => {
goToResource(orgLabel, projectLabel, resourceId, {
revision: rev,
});
}}
>
Revision {rev}
</a>
);
}}
/>
),
},
{
key: '#links',
label: 'Links',
className: 'rows',
children: (
<>
<section className="links incoming">
<h3>Incoming</h3>
<ResourceLinksContainer
resourceId={resource['@id']}
orgLabel={orgLabel}
projectLabel={projectLabel}
rev={resource._rev}
direction="incoming"
onClick={handleGoToInternalLink}
/>
</section>
<section className="links outgoing">
<h3>Outgoing</h3>
<ResourceLinksContainer
resourceId={resource['@id']}
orgLabel={orgLabel}
projectLabel={projectLabel}
rev={resource._rev}
direction="outgoing"
onClick={handleGoToInternalLink}
/>
</section>
</>
),
children: (
<><section className="links incoming">
<h3>Incoming</h3>
<ResourceLinksContainer
resourceId={resource['@id']}
orgLabel={orgLabel}
projectLabel={projectLabel}
rev={resource._rev}
direction="incoming"
onClick={handleGoToInternalLink}
/>
</section>
<section className="links outgoing">
<h3>Outgoing</h3>
<ResourceLinksContainer
resourceId={resource['@id']}
orgLabel={orgLabel}
projectLabel={projectLabel}
rev={resource._rev}
direction="outgoing"
onClick={handleGoToInternalLink}
/>
</section>
</>
),
},
{
key: '#graph',
label: 'Graph',
className: 'rows',
children: (
<div className="graph-wrapper-container">
<div className="fixed-minus-header">
<div ref={ref} className="graph-wrapper">
<GraphContainer resource={resource as Resource} />
</div>
</div>
<div className="graph-wrapper-container">
<div className="fixed-minus-header">
<div ref={ref} className="graph-wrapper">
<GraphContainer resource={resource as Resource} />
</div>
),
</div>
</div>
),
},
]}
></Tabs>
Expand Down

0 comments on commit 24c70ed

Please sign in to comment.