Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
ICAT
Datahub
Commits
9410f400
Commit
9410f400
authored
Jun 30, 2021
by
Marjolaine Bodin
Browse files
#507
adapt industry panel
parent
e626833f
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/containers/MyData/MyIndustryProposalsPanel.js
View file @
9410f400
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
/>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment