Commit 9410f400 authored by Marjolaine Bodin's avatar Marjolaine Bodin
Browse files

#507 adapt industry panel

parent e626833f
import React from 'react';
import { Panel, Glyphicon } from 'react-bootstrap';
import InvestigationTable from '../../components/Investigation/InvestigationTable';
import { useResource } from 'rest-hooks';
import InvestigationResource from '../../resources/investigation';
const INDUSTRY_PROPOSAL_REGEX = /^(IX|FX|IN|IM)/;
function MyIndustryProposalsPanel() {
const myInvestigations = useResource(InvestigationResource.listShape(), {
filter: 'participant',
});
// TODO replace `inv.visitId` with `inv.type !== "PROPOSAL"` when available
const industryProposals = myInvestigations.filter((inv) => {
return inv.visitId === 'PROPOSAL' && INDUSTRY_PROPOSAL_REGEX.test(inv.name);
});
if (industryProposals.length === 0) {
return null;
}
return (
<Panel bsStyle="info">
<Panel.Heading>
......@@ -34,7 +17,7 @@ function MyIndustryProposalsPanel() {
been scheduled for them.
</p>
<InvestigationTable
investigations={industryProposals}
filter="industry"
withInvestigationStats
withProposalLinks
/>
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment