import React from 'react'; import { Anchor, Layout } from 'antd'; import { Entity } from 'matrix-ui-service'; import { PortalRequiredServices } from './PortalRequiredServices'; const { Sider } = Layout; interface P { portal: Entity; services: PortalRequiredServices; portalRowRelAllList: Entity[]; portletColRelAllList: Entity[]; } export class PortalSider extends React.Component

{ render() { const { portalRowRelAllList, portletColRelAllList } = this.props; const rowRelList = portalRowRelAllList.filter((value) => value.portal.id === this.props.portal.id); const portletList: Entity[] = []; rowRelList.every((rowRel) => rowRel.row.cols .slice() .sort((a: Entity, b: Entity) => a.colOrder - b.colOrder) .every((col: Entity) => portletColRelAllList .filter((colRel) => colRel.col.id === col.id) .reduce((list, colRel) => (list.push(colRel.portlet), list), portletList), ), ); return ( {portletList.map((portlet, index) => ( ))} ); } }