Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
D
Datahub
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
93
Issues
93
List
Boards
Labels
Service Desk
Milestones
Jira
Jira
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
ICAT
Datahub
Commits
d783770d
Commit
d783770d
authored
Sep 11, 2020
by
Axel Bocciarelli
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fetch parcel investigations by IDs
parent
f15f283f
Pipeline
#33314
passed with stage
in 2 minutes and 58 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
28 deletions
+6
-28
src/components/Parcels/MyParcelsSummary.js
src/components/Parcels/MyParcelsSummary.js
+6
-2
src/helpers/hooks.js
src/helpers/hooks.js
+0
-26
No files found.
src/components/Parcels/MyParcelsSummary.js
View file @
d783770d
...
...
@@ -6,8 +6,8 @@ import { beamlineFormatter, dateFormatter } from '../Investigation/utils';
import
ParcelTable
from
'
./ParcelTable
'
;
import
styles
from
'
./MyParcelsSummary.module.css
'
;
import
{
itemsFormatter
}
from
'
../../helpers
'
;
import
{
useAllInvestigations
}
from
'
../../helpers/hooks
'
;
import
ParcelCondensedView
from
'
./ParcelCondensedView
'
;
import
InvestigationResource
from
'
../../resources/investigation
'
;
function
getColumns
(
investigations
)
{
return
[
...
...
@@ -159,7 +159,11 @@ function getColumns(investigations) {
function
MyParcelsSummary
()
{
const
parcels
=
useResource
(
ParcelResource
.
listShape
(),
{});
const
{
investigations
}
=
useAllInvestigations
();
const
investigationIds
=
parcels
.
map
((
p
)
=>
p
.
investigationId
);
const
investigations
=
useResource
(
InvestigationResource
.
listShape
(),
{
ids
:
investigationIds
,
});
return
(
<
ParcelTable
...
...
src/helpers/hooks.js
View file @
d783770d
import
{
useLocation
}
from
'
react-router
'
;
import
{
useSelector
}
from
'
react-redux
'
;
export
function
useQuery
()
{
return
new
URLSearchParams
(
useLocation
().
search
);
}
export
function
useAllInvestigations
()
{
return
useSelector
(()
=>
{
// const {
// scientistInstrumentInvestigations,
// myInvestigations,
// releasedInvestigations,
// investigations,
// } = state;
return
{
investigations
:
[
// ...scientistInstrumentInvestigations.data,
// ...myInvestigations.data,
// ...releasedInvestigations.data,
// ...investigations.data,
],
fetching
:
false
,
// scientistInstrumentInvestigations.fetching ||
// myInvestigations.fetching ||
// releasedInvestigations.fetching ||
// investigations.fetching,
};
});
}
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