cluedin-widget
Version:
This project contains all the pages needed for browsing entities and searching them. The aim is to replace the CluedIn.Webapp project with this one when all the pages ( including the Admin page ) will be ported to REACT.
97 lines (95 loc) • 3.86 kB
JSX
import React, { Component } from 'react';
import EntityDefault from './entities/DefaultEntity.jsx';
export default class DefaultEntity extends Component {
render() {
const { entity, openInNewTab, q, highlight } = this.props;
const entityType = entity.data.entityType;
let content;
switch (entityType) {
case '/Infrastructure/User':
content = (<EntityDefault q={q}
openInNewTab={openInNewTab}
highlight={highlight}
entity={entity}
properties={['property-user.jobTitle', 'property-person.jobTitle']}
/>);
break;
case '/Document/Spreadsheet':
content = (<EntityDefault q={q}
openInNewTab={openInNewTab}
highlight={highlight}
entity={entity}
dataProperty="documentFileName"
/>);
break;
case '/Document/Presentation':
content = (<EntityDefault q={q}
openInNewTab={openInNewTab}
highlight={highlight}
entity={entity}
dataProperty="documentFileName"
/>);
break;
case '/Presentation':
content = (<EntityDefault q={q}
openInNewTab={openInNewTab}
highlight={highlight}
entity={entity}
dataProperty="documentFileName"
/>);
break;
case '/Person':
content = (<EntityDefault q={q}
openInNewTab={openInNewTab}
highlight={highlight}
entity={entity}
properties={['property-user.jobTitle', 'property-person.jobTitle']}
/>);
break;
case '/Organization':
content = (<EntityDefault q={q}
openInNewTab={openInNewTab}
highlight={highlight}
entity={entity}
dataProperty="documentFileName"
/>);
break;
case '/Document':
content = (<EntityDefault q={q}
openInNewTab={openInNewTab}
highlight={highlight}
entity={entity}
dataProperty="documentFileName"
/>);
break;
case '/Document/Document':
content = (<EntityDefault q={q}
openInNewTab={openInNewTab}
highlight={highlight}
entity={entity}
dataProperty="documentFileName"
/>);
break;
case '/Calendar/Event':
content = (<EntityDefault q={q}
openInNewTab={openInNewTab}
highlight={highlight}
entity={entity}
htmlDescription={true}
/>);
break;
case '/Mail':
content = (<EntityDefault q={q}
openInNewTab={openInNewTab}
highlight={highlight}
entity={entity}
htmlDescription={true}
/>);
default:
content = (
<EntityDefault q={q} openInNewTab={openInNewTab} highlight={highlight} entity={entity}/>);
break;
}
return content;
}
}