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.
61 lines (52 loc) • 2.04 kB
JSX
import React, { Component } from "react";
import { register } from "../../core/registry";
import EntityListWidget from "../../core/components/entityRelated/EntityListWidget.jsx";
import { connect } from "react-redux";
import { fetchGenericLastOrganizations } from "../../core/action/organization";
class LastOrganizations extends Component {
constructor( props ) {
super( props );
this.state = {
timestamp: Date.now()
};
}
componentWillMount() {
this.fetch();
}
fetch() {
this.props.dispatch( fetchGenericLastOrganizations( this.state.timestamp ) );
}
render() {
const { isFetching, entities, isAdmin, layoutPosition, isFake, pageNumber } = this.props;
let entityType = '/Organization';
return (<EntityListWidget widgetName={this.constructor.name}
layoutPosition={layoutPosition}
title="Latest Companies"
fetch={this.fetch.bind(this)}
entities={entities}
isFetching={isFetching}
isAdmin={isAdmin}
entityType={entityType}
pageNumber={pageNumber}
isFake={isFake}></EntityListWidget>);
}
}
function select( state ) {
return {
entities: state.organization.currentOrganizations,
pageNumber: state.organization.pageNumber,
isFetching: state.organization.isFetchingGenericOrganizations,
isFake: state.organization.isFakeGenericOrganization
};
}
register( 'LastOrganizations', connect( select )( LastOrganizations ), {
displayName: 'Lastest organizations',
description: 'All the latest organizations CluedIn discovered in all your integrations.',
relatedProviders: [
'all'
],
tags: [
'support', 'sales', 'marketing'
],
requireEntity: false
} );