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
5c2d2c5d
Commit
5c2d2c5d
authored
Sep 14, 2020
by
Axel Bocciarelli
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'parcels-investigations' into 'master'
Fetch parcel investigations by IDs See merge request
!446
parents
f15f283f
d783770d
Pipeline
#33407
passed with stages
in 11 minutes and 13 seconds
Changes
2
Pipelines
2
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 @
5c2d2c5d
...
...
@@ -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 @
5c2d2c5d
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