DisplayPage.tsx 22.4 KB
Newer Older
1
import * as React from 'react';
2
3
import { connect } from 'react-redux';
import { bindActionCreators } from 'redux';
Matija Obreza's avatar
Matija Obreza committed
4
import { translate } from 'react-i18next';
5
import { withStyles } from '@material-ui/core/styles';
6
7

// Actions
8
import { loadAccession, applyFilters, loadAccessionAuditLog } from 'accessions/actions/public';
9
import { addAccessionToMyList, removeAccessionFromMyList } from 'list/actions/public';
10
import navigateTo from 'actions/navigation';
11

12
13
14
// Constants
import { ROLE_USER } from 'constants/userRoles';

15
// Models
16
import AccessionDetails from 'model/accession/AccessionDetails';
Viacheslav Pavlov's avatar
Viacheslav Pavlov committed
17
import RepositoryFile from 'model/repository/RepositoryFile';
18
import AccessionAuditLog from 'model/accession/AccessionAuditLog';
19
20

// UI
Matija Obreza's avatar
Matija Obreza committed
21
22
import PrettyDate from 'ui/common/time/PrettyDate';
import PageLayout, { PageContents, MainSection, PageSection } from 'ui/layout/PageLayout';
23
24
import ContentHeader from 'ui/common/heading/ContentHeader';
import Loading from 'ui/common/Loading';
Matija Obreza's avatar
Matija Obreza committed
25
26
27
28
29
import { Properties, PropertiesItem } from 'ui/common/Properties';
import DOI from 'ui/common/DOI';
import { ExternalLink } from 'ui/common/Links';
import SciName from 'ui/genesys/SciName';
import { ScrollToTopOnMount } from 'ui/common/page/scrollers';
Viacheslav Pavlov's avatar
Viacheslav Pavlov committed
30
import ReduxCheckbox from 'ui/common/checkbox';
31
import CropChips from 'crop/ui/c/CropChips';
32
import LocationMap from 'ui/common/LocationMap';
33
34
import {CountryLink, DatasetLink, InstituteLink, SubsetLink} from 'ui/genesys/Links';
import PropertiesCard from 'ui/common/PropertiesCard';
Viacheslav Pavlov's avatar
Viacheslav Pavlov committed
35
import GridContainer from 'ui/layout/GridContainer';
36
import McpdDate from 'ui/common/time/McpdDate';
37
import PdciTable from './c/PdciTable';
Viacheslav Pavlov's avatar
Viacheslav Pavlov committed
38
39
import ImageGalleryView from 'repository/ui/c/ImageGalleryView';
import Button from '@material-ui/core/Button/Button';
40
41
import AuditedInfo from 'ui/common/AuditedInfo';
import Authorize from 'ui/common/authorized/Authorize';
Viacheslav Pavlov's avatar
Viacheslav Pavlov committed
42
import BioClimateDisplay from 'accessions/ui/c/BioClimateDisplay';
Viacheslav Pavlov's avatar
Viacheslav Pavlov committed
43
import PageTitle from 'ui/common/PageTitle';
Matija Obreza's avatar
Matija Obreza committed
44

45
46
47
48
const styles = (theme) => ({
  pageSection: {
    marginBottom: '1em',
  },
Matija Obreza's avatar
Matija Obreza committed
49
50
51
52
53
54
  selected: {
    background: '#c9e2cb',
  },
  historic: {
    background: '#ffe2e2 !important',
  },
55
56
});

57

58
59
60
interface IBrowsePageProps {
  t?: any;
  classes?: any;
61

62
  uuid: string;
63
  doi: string; // DOI comes from the route without the '10.'
64
  accession: AccessionDetails;
65
  auditLog: AccessionAuditLog;
66
67
  error: any;
  loadAccession: any;
68
  loadAccessionAuditLog: any;
Viacheslav Pavlov's avatar
Viacheslav Pavlov committed
69
70
71
  accessions: any;
  addAccessionToMyList: any;
  removeAccessionFromMyList: any;
Matija Obreza's avatar
Matija Obreza committed
72
  applyFilters: any;
73
  navigateTo: (location: string) => void;
74
75
76
77
78
}

class BrowsePage extends React.Component<IBrowsePageProps, any> {

  protected static needs = [
79
    ({ params: { uuid, doi } }) => {
Viacheslav Pavlov's avatar
Viacheslav Pavlov committed
80
        return doi ? loadAccession({ doi: `10.${doi}` }) :  loadAccession({ uuid });
81
82
83
84
85
86
87
88
    },
  ];

  constructor(props: IBrowsePageProps, context: any) {
      super(props, context);
  }

  public componentWillMount() {
89
90
91
    const { doi, uuid, loadAccession } = this.props;
    const accession = this.props.accession ? this.props.accession.details : null;

92
93
94
95
    const theDoi = `10.${doi}`;
    if (doi && (! accession || theDoi !== accession.doi)) {
      loadAccession({ doi: theDoi });
    }
96
    if (uuid && (! accession || uuid !== accession.uuid)) {
97
      loadAccession({ uuid });
98
99
100
    }
  }

101
102
103
104
105
106
107
108
109
  public componentWillReceiveProps(nextProps): void {
    const {uuid, doi, navigateTo} = this.props;
    const accession = this.props.accession ? this.props.accession.details : null;

    if (accession && accession.doi && !doi && accession.uuid === uuid) {
      navigateTo(`/${accession.doi}`);
    }
  }

110
111
112
113
114
115
116
117
118
119
120
  private loadAuditLog = () => {
    const { doi, uuid, loadAccessionAuditLog } = this.props;

    const theDoi = `10.${doi}`;
    if (doi) {
      loadAccessionAuditLog({ doi: theDoi });
    } else {
      loadAccessionAuditLog({uuid});
    }
  }

Viacheslav Pavlov's avatar
Viacheslav Pavlov committed
121
  private onCheckboxChange = (event, checked) => {
122
      const {accession: {details: accession}, addAccessionToMyList, removeAccessionFromMyList} = this.props;
Viacheslav Pavlov's avatar
Viacheslav Pavlov committed
123
124
125
126
127
128
129
      if (checked) {
          addAccessionToMyList(accession.uuid);
      } else {
          removeAccessionFromMyList(accession.uuid);
        }
  }

Matija Obreza's avatar
Matija Obreza committed
130
131
132
133
134
135
136

  private applyFilterForInstituteSpecies = () => {
    const { accession: {details: accession}, applyFilters } = this.props;
    const filter = {holder: {code: [ accession.institute.code ]}, taxa: { genus: [ accession.taxonomy.genus ], species: [ accession.taxonomy.species ] }};
    applyFilters(filter);
  }

137
  public render() {
138
139
140
141
    const { t, error, uuid, doi, accessions, auditLog, classes } = this.props;

    const { auditAccession, auditAccessionId, auditAccessionCollect, auditAccessionGeo } = auditLog || { auditAccession: {}, auditAccessionId: {}, auditAccessionCollect: {}, auditAccessionGeo: {} };

142
    const { details: accession, pdci, datasets, subsets, files, imageGallery } = this.props.accession ?
143
144
      this.props.accession
      :
Viacheslav Pavlov's avatar
Viacheslav Pavlov committed
145
      {details: null, pdci: null, datasets: null, subsets: null, files: null, imageGallery: null};
146

Matija Obreza's avatar
Matija Obreza committed
147
    const isChecked  =  accession && accessions && accessions.includes(accession.uuid);
148
149
150
151
    const theDoi = `10.${doi}`;
    const stillLoading: boolean = ! error && (! accession
      || (doi && accession && accession.doi !== theDoi)
      || (uuid && accession && accession.uuid !== uuid));
152

Matija Obreza's avatar
Matija Obreza committed
153
154
    const hasLatLon = accession && accession.geo && accession.geo.latitude !== null && accession.geo.longitude !== null;

155
    return (
Oleksii Savran's avatar
Oleksii Savran committed
156
      <PageLayout withFooter>
Matija Obreza's avatar
Matija Obreza committed
157
        <ScrollToTopOnMount />
Viacheslav Pavlov's avatar
Viacheslav Pavlov committed
158
159
160
161
162
        <PageTitle title={ !stillLoading ? accession.accessionNumber : t('common:label.loading', { what: t('accessions.public.p.display.title') }) } />
        <ContentHeader
          title={ !stillLoading ? accession.accessionNumber : t('common:label.loading', { what: t('accessions.public.p.display.title') }) }
          subtitle={ t('accessions.public.p.display.subTitle') }
        />
Matija Obreza's avatar
Matija Obreza committed
163

164
165
166
        { stillLoading ? <Loading /> :
          <div>
            { error && <div>{ JSON.stringify(error) }</div> }
Matija Obreza's avatar
Matija Obreza committed
167

168
            { accession &&
Viacheslav Pavlov's avatar
Viacheslav Pavlov committed
169
              <PageContents className="pt-1rem">
Matija Obreza's avatar
Matija Obreza committed
170
                <MainSection className={ isChecked ? classes.selected : accession.historic ?  classes.historic : '' } title={
171
                  <div>
Viacheslav Pavlov's avatar
Viacheslav Pavlov committed
172
                    { t('accessions.public.p.display.title') }
173
                    <div className="float-right">
174
175
176
                        <Authorize role={ ROLE_USER }>
                            <Button className="mr-20" variant="contained" onClick={ this.loadAuditLog }>{ t('accessions.public.p.display.loadChanges') }</Button>
                        </Authorize>
177
178
179
                        <ReduxCheckbox
                            label={
                                <b>
Viacheslav Pavlov's avatar
i18n    
Viacheslav Pavlov committed
180
                                    { isChecked ? t('accessions.public.p.display.removeFromMyList', {accessionNumber: accession.accessionNumber}) : t('accessions.public.p.display.addToMyList', {accessionNumber: accession.accessionNumber}) }
181
182
183
184
185
186
187
188
189
190
191
192
                                </b>
                            }
                            input={ {
                                value: isChecked,
                                onChange: this.onCheckboxChange,
                            } }
                        />
                    </div>
                  </div>
                  }
                >
                  <Properties>
193
194
195
196
197
198
                    { accession.doi &&
                      <PropertiesItem title={ t('accessions.public.p.display.DOI') }>
                        <DOI noPrefix value={ accession.doi } />
                          <AuditedInfo info={ auditAccession.doi }/>
                      </PropertiesItem>
                    }
199
200
201
202
                    <PropertiesItem title={ t('accessions.common.acceNumb') } >
                      { accession.accessionNumber }
                      <AuditedInfo info={ auditAccession.accessionNumber }/>
                    </PropertiesItem>
203
                    <PropertiesItem title={ t('accessions.public.p.display.holdingInstitute') }>
204
205
206
                      <InstituteLink to={ accession.institute }>
                        { accession.institute.fullName }
                      </InstituteLink>
Matija Obreza's avatar
Matija Obreza committed
207
208
                      <span> &mdash; </span>
                      <CountryLink noflag country={ accession.institute.country }/>
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
                      <AuditedInfo info={ auditAccession.institute }/>
                    </PropertiesItem>
                    { accession.historic &&
                      <PropertiesItem className={ accession.historic ?  classes.historic : '' } title={ t('accessions.public.p.display.historic') }>
                        { t('accessions.public.p.display.isHistoric') }
                        <AuditedInfo info={ auditAccession.historic }/>
                      </PropertiesItem>
                    }
                    <PropertiesItem title={ t('accessions.common.instituteCode') }>
                      { accession.institute.code }
                      <AuditedInfo info={ auditAccession.instituteCode }/>
                    </PropertiesItem>
                    <PropertiesItem title={ t('accessions.public.p.display.acquisitionDate') }>
                      <McpdDate value={ accession.acquisitionDate } />
                      <AuditedInfo info={ auditAccession.acquisitionDate }/>
224
                    </PropertiesItem>
225
226
227
228
229
230
                    { accession.countryOfOrigin &&
                      <PropertiesItem title={ t('accessions.common.countryOfOrigin') }>
                          <CountryLink country={ accession.countryOfOrigin }/>
                          <AuditedInfo info={ auditAccession.countryOfOrigin }/>
                      </PropertiesItem>
                    }
231
232
233
                    { accession.sampStat &&
                      <PropertiesItem title={ t('accessions.common.sampStat') }>
                        { t(`accessions.common.sampleStatus.${accession.sampStat}`) }
234
                        <AuditedInfo info={ auditAccession.sampStat } tPrefix="accessions.common.sampleStatus"/>
235
236
                      </PropertiesItem>
                    }
237
                    { accession.storage && accession.storage.length > 0 && <PropertiesItem title={ t('accessions.common.storageType') }>
238
                      { accession.storage.map((storage, i) => (
Viacheslav Pavlov's avatar
i18n    
Viacheslav Pavlov committed
239
                        <div key={ storage } style={ {width: '100%', paddingTop: '.25rem'} }>{ t(`accessions.common.storage.${storage}`) }</div>
240
                      )) }
241
                        <AuditedInfo info={ auditAccession.storage } tPrefix="accessions.common.storage"/>
242
                    </PropertiesItem> }
243
244
                    <PropertiesItem title={ t('accessions.public.p.display.availability') } keepEmpty>
                      { t(`accessions.common.available.${accession.available}`) }
245
                      <AuditedInfo info={ auditAccession.available } tPrefix="accessions.common.available"/>
246
247
248
                    </PropertiesItem>
                    <PropertiesItem title={ t('accessions.public.p.display.ITPGRFAMLS') } keepEmpty>
                      { t(`accessions.common.mlsStatus.${accession.mlsStatus}`) }
249
                      <AuditedInfo info={ auditAccession.mlsStatus } tPrefix="accessions.common.mlsStatus"/>
250
                    </PropertiesItem>
251
252
253
254
255
256
257
258
259
260
261
262
                    { accession.donorCode &&
                      <PropertiesItem title={ t('accessions.public.p.display.donorInstitute') }>
                        { accession.donorCode }
                        <AuditedInfo info={ auditAccession.donorCode }/>
                      </PropertiesItem>
                    }
                    { accession.donorNumb &&
                      <PropertiesItem title={ t('accessions.public.p.display.donorAccessionNumber') }>
                        { accession.donorNumb }
                        <AuditedInfo info={ auditAccession.donorNumb }/>
                      </PropertiesItem>
                    }
263
                    { accession.duplSite && accession.duplSite.length > 0 && <PropertiesItem title={ t('accessions.public.p.display.safetyDuplicationInstitute') }>
264
                      { accession.duplSite.map((duplSite, i) => (
Viacheslav Pavlov's avatar
Viacheslav Pavlov committed
265
                        <div key={ duplSite } style={ {width: '100%', paddingTop: '.25rem'} }>{ duplSite }</div>
266
                      )) }
267
                      <AuditedInfo info={ auditAccession.duplSite }/>
268
                    </PropertiesItem> }
Matija Obreza's avatar
Matija Obreza committed
269

270
271
272
273
274
275
                    { accession.acceUrl &&
                      <PropertiesItem title={ t('accessions.public.p.display.accessionURL') }>
                          <ExternalLink link={ accession.acceUrl } />
                          <AuditedInfo info={ auditAccession.acceUrl }/>
                      </PropertiesItem>
                    }
276
277
                  </Properties>
                </MainSection>
Matija Obreza's avatar
Matija Obreza committed
278

279
280
281
282
                { imageGallery &&
                  <ImageGalleryView className={ classes.pageSection } imageGallery={ imageGallery }/>
                }

283
                <PageSection title={ t('accessions.common.taxonomy') }>
284
                  <Properties>
285
286
                    <PropertiesItem title={ t('accessions.common.genus') }>
                      { accession.taxonomy.genus }
287
                      <AuditedInfo info={ auditAccession.taxonomy } property="genus"/>
288
                    </PropertiesItem>
289
                    <PropertiesItem title={ t('accessions.common.species') }>
290
291
                      { accession.taxonomy.species }
                      { '' }
Matija Obreza's avatar
Matija Obreza committed
292
                      <a onClick={ this.applyFilterForInstituteSpecies }>View <i>{ `${accession.taxonomy.genus} ${accession.taxonomy.species}` }</i> at { accession.institute.code }</a>
293
294
295
296
297
                      <AuditedInfo info={ auditAccession.taxonomy } property="species"/>
                    </PropertiesItem>
                    <PropertiesItem title={ t('accessions.public.p.display.scientificName') }>
                        <SciName taxa={ accession.taxonomy.taxonNameHtml } />
                        <AuditedInfo info={ auditAccession.taxonomy }/>
298
                    </PropertiesItem>
299
                    { accession.crop && <PropertiesItem title={ t('accessions.public.p.display.cropName') }><CropChips crops={ accession.crop.shortName } /></PropertiesItem> }
300
301
302
303
                    <PropertiesItem title={ t('accessions.public.p.display.providedCropName') }>
                      { accession.cropName }
                      <AuditedInfo info={ auditAccession.cropName }/>
                    </PropertiesItem>
304
305
                  </Properties>
                </PageSection>
Matija Obreza's avatar
Cleanup    
Matija Obreza committed
306
307

                { (accession.donorCode || (accession.aliases && accession.aliases.length > 0)) &&
308
                  <PageSection title={ t('accessions.public.p.display.accessionNames') }>
309
                    <Properties>
310
311
312
313
314
315
316
                      { accession.donorCode &&
                        <PropertiesItem title={ t('accessions.common.alias.DONORNUMB') }>
                          { accession.donorNumb } <em>{ accession.donorCode }</em>
                          <AuditedInfo info={ auditAccession.donorNumb }/>
                          <AuditedInfo info={ auditAccession.donorCode }/>
                        </PropertiesItem>
                      }
317
                      { accession.aliases && accession.aliases.map((alias) => (
Viacheslav Pavlov's avatar
i18n    
Viacheslav Pavlov committed
318
                        <PropertiesItem key={ alias.id } title={ t(`accessions.common.alias.${alias.aliasType}`) }>{ alias.name } <em>{ alias.usedBy }</em></PropertiesItem>
319
320
321
322
                      )) }
                    </Properties>
                  </PageSection>
                }
323

324
                { accession.coll &&
325
                  <PageSection title={ t('accessions.public.p.display.collectingInformation') }>
326
                    <Properties>
327
328
329
330
331
332
333
334
335
336
337
338
                      { accession.countryOfOrigin &&
                        <PropertiesItem title={ t('accessions.common.countryOfOrigin') }>
                          <CountryLink country={ accession.countryOfOrigin }/>
                          <AuditedInfo info={ auditAccessionCollect.countryOfOrigin }/>
                        </PropertiesItem>
                      }
                      { accession.coll.collDate &&
                        <PropertiesItem key="collDate" title={ t(`accessions.common.coll.collDate`) }>
                          <McpdDate value={ accession.coll.collDate } />
                          <AuditedInfo info={ auditAccessionCollect.collDate }/>
                        </PropertiesItem>
                      }
Oleksii Savran's avatar
Oleksii Savran committed
339
340
341
                      { accession.coll.collSrc &&
                        <PropertiesItem key="collSrc" title={ t(`accessions.common.coll.collSrc`) }>
                          { t(`accessions.common.collectingSource.${accession.coll.collSrc}`) }
342
                          <AuditedInfo info={ auditAccessionCollect.collSrc } tPrefix="accessions.common.collectingSource"/>
Oleksii Savran's avatar
Oleksii Savran committed
343
344
                        </PropertiesItem>
                      }
345
                      { accession.coll &&
Oleksii Savran's avatar
Oleksii Savran committed
346
                        [ 'collMissId', 'collNumb', 'collSite' ]
347
                          .filter((prop) => accession.coll[prop] !== null).map((prop) => (
348
349
350
351
                          <PropertiesItem key={ prop } title={ t(`accessions.common.coll.${prop}`) }>
                            { accession.coll[prop] }
                            <AuditedInfo info={ auditAccessionCollect[prop] }/>
                          </PropertiesItem>
352
                        ))
353
                      }
354
355
356
                      { accession.coll &&
                        [ 'collCode', 'collName' ]
                          .filter((prop) => accession.coll[prop].length).map((prop) => (
357
358
359
360
                          <PropertiesItem key={ prop } title={ t(`accessions.common.coll.${prop}`) }>
                            { accession.coll[prop] }
                            <AuditedInfo info={ auditAccessionCollect[prop] }/>
                          </PropertiesItem>
361
362
363
364
365
                        ))
                      }
                      { accession.geo &&
                        [ 'latitude', 'longitude', 'datum', 'method', 'uncertainty', 'elevation' ]
                          .filter((prop) => accession.geo[prop] !== null).map((prop) => (
366
367
368
369
                          <PropertiesItem key={ prop } title={ t(`accessions.common.geo.${prop}`) }>
                            { accession.geo[prop] }
                            <AuditedInfo info={ auditAccessionGeo[prop] }/>
                          </PropertiesItem>
370
371
372
373
374
                        ))
                      }
                    </Properties>

                    { hasLatLon &&
375
                      <LocationMap locations={ [{ id: accession.geo.id, lat: accession.geo.latitude, lng: accession.geo.longitude }] } />
376
377
378
                    }
                  </PageSection>
                }
Matija Obreza's avatar
Matija Obreza committed
379

Viacheslav Pavlov's avatar
Viacheslav Pavlov committed
380
                { accession.geo && accession.geo.climate &&
381
                 <BioClimateDisplay climateData={ accession.geo.climate } extraFilters={ { taxa: { genus: [ accession.taxonomy.genus ] } } } />
Viacheslav Pavlov's avatar
Viacheslav Pavlov committed
382
383
                }

384
                { accession.remarks && accession.remarks.length > 0 && <PageSection title={ t('accessions.public.p.display.remarks') }>
385
386
387
388
389
390
                  <Properties>
                    { accession.remarks && accession.remarks.map((remark) => (
                      <PropertiesItem key={ remark.id } title={ remark.fieldName }>{ remark.remark }</PropertiesItem>
                    )) }
                  </Properties>
                </PageSection> }
Matija Obreza's avatar
Matija Obreza committed
391

392
393
394
395
396
397
                { files &&
                  <PageSection title={ t('accessions.public.p.display.relatedResources') }>
                    <Properties>
                      { files.map((e: RepositoryFile) => (
                        <PropertiesItem key={ e.uuid } title={
                          <a href={ `/proxy/api/v1/repository/download/${e.uuid}` }>
398
                            <Button variant="contained" component="span">
399
400
401
402
403
404
405
406
407
408
409
                              { t('common:action.download') }
                            </Button>
                          </a>
                        }>
                          <b>{ e.originalFilename }</b>
                        </PropertiesItem>
                      )) }
                    </Properties>
                  </PageSection>
                }

410
                { pdci && <PdciTable pdci={ pdci } title={ t('accessions.public.p.display.pdci') }/> }
Matija Obreza's avatar
Matija Obreza committed
411

412
                <PageSection title={ t('accessions.public.p.display.metadata') }>
413
                  <Properties>
414
415
416
417
                    <PropertiesItem title={ t('common:label.UUID') }>
                      { `urn:uuid:${accession.uuid}` }
                      <AuditedInfo info={ auditAccessionId.uuid }/>
                    </PropertiesItem>
418
419
420
                    <PropertiesItem title={ t('accessions.public.p.display.permanentURL') }><ExternalLink link={ `https://purl.org/germplasm/id/${accession.uuid}` } /></PropertiesItem>
                    <PropertiesItem title={ t('common:label.lastUpdated') }><PrettyDate value={ accession.lastModifiedDate } /></PropertiesItem>
                    <PropertiesItem title={ t('common:label.created') }><PrettyDate value={ accession.createdDate } /></PropertiesItem>
421
422
                  </Properties>
                </PageSection>
423

Viacheslav Pavlov's avatar
Viacheslav Pavlov committed
424
                <GridContainer className="mb-15">
425
426
427
                  { datasets && datasets.length > 0 &&
                  <PropertiesCard
                    small
428
                    title={ t('accessions.public.p.display.associatedDatasets') }
429
                    propertyItemProps={ { keepEmpty: true } }
Matija Obreza's avatar
Matija Obreza committed
430
                    propertiesList={ datasets.map((dataset) => ({ value: <DatasetLink to={ dataset } /> })) }
431
432
433
434
435
                  />
                  }
                  { subsets && subsets.length > 0 &&
                  <PropertiesCard
                    small
436
                    title={ t('accessions.public.p.display.associatedSubsets') }
437
                    propertyItemProps={ { keepEmpty: true } }
Matija Obreza's avatar
Matija Obreza committed
438
                    propertiesList={ subsets.map((subset) => ({ value: <SubsetLink to={ subset } /> })) }
439
440
                  />
                  }
Viacheslav Pavlov's avatar
Viacheslav Pavlov committed
441
                </GridContainer>
442
443
444
              </PageContents>
            }
          </div>
Matija Obreza's avatar
Matija Obreza committed
445
        }
446
447
448
449
450
451
      </PageLayout>
    );
  }
}

const mapStateToProps = (state, ownProps) => ({
452
  accession: state.accessions.public.accession,
453
  auditLog: state.accessions.public.auditLog,
454
  error: state.accessions.public.accessionError,
455
  uuid: ownProps.match.params.uuid,
456
  doi: ownProps.match.params.doi,
457
  accessions: state.list.public.myList.accessions,
458
459
460
});

const mapDispatchToProps = (dispatch) => bindActionCreators({
Viacheslav Pavlov's avatar
Viacheslav Pavlov committed
461
462
  addAccessionToMyList,
  removeAccessionFromMyList,
463
  loadAccession,
464
  loadAccessionAuditLog,
Matija Obreza's avatar
Matija Obreza committed
465
  applyFilters,
466
  navigateTo,
467
468
469
}, dispatch);


470
export default connect(mapStateToProps, mapDispatchToProps)(withStyles(styles)(translate()(BrowsePage)));