UNPKG

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.

62 lines (52 loc) 1.96 kB
import React, { Component } from "react"; import { register } from "../../core/registry"; import EntityListWidget from "../../core/components/entityRelated/EntityListWidget.jsx"; import { connect } from "react-redux"; import { fetchGenericLastTools } from "../../core/action/tool"; class LastTools extends Component { constructor( props ) { super( props ); this.state = { timestamp: Date.now() }; } componentWillMount() { this.fetch(); } fetch() { this.props.dispatch( fetchGenericLastTools( this.state.timestamp ) ); } render() { const { isFetching, entities, isAdmin, layoutPosition, isFake, pageNumber, lastVisitedDate } = this.props; let entityType = '/Provider/Root'; return (<EntityListWidget widgetName={this.constructor.name} layoutPosition={layoutPosition} title="Your Integrations" fetch={this.fetch.bind(this)} entities={entities} isFetching={isFetching} isAdmin={isAdmin} entityType={entityType} pageNumber={pageNumber} lastVisitedDate={lastVisitedDate} isFake={isFake}></EntityListWidget>); } } function select( state ) { return { entities: state.tool.currentTools, pageNumber: state.tool.pageNumber, isFetching: state.tool.isFetchingGenericTools, isFake: state.tool.isFakeGenericTools }; } register( 'LastTools', connect( select )( LastTools ), { name: 'LastTools', displayName: 'Latest tools', description: 'All the latest tools added in CluedIn.', relatedProviders: [ 'all' ], tags: [], requireEntity: false } );