DisplayPage.tsx 22.8 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';
Oleksii Savran's avatar
Oleksii Savran committed
19
import MapLayer from 'model/genesys/MapTileLayer';
20
21

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

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

58

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

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

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

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

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

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

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

103
104
105
106
107
108
109
110
111
  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}`);
    }
  }

112
113
114
115
116
117
118
119
120
121
122
  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
123
  private onCheckboxChange = (event, checked) => {
124
      const {accession: {details: accession}, addAccessionToMyList, removeAccessionFromMyList} = this.props;
Viacheslav Pavlov's avatar
Viacheslav Pavlov committed
125
126
127
128
129
130
131
      if (checked) {
          addAccessionToMyList(accession.uuid);
      } else {
          removeAccessionFromMyList(accession.uuid);
        }
  }

Matija Obreza's avatar
Matija Obreza committed
132
133
134
135
136
137
138

  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);
  }

139
  public render() {
Oleksii Savran's avatar
Oleksii Savran committed
140
    const { t, error, uuid, doi, accessions, auditLog, classes, mapLayers } = this.props;
141
142
143

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

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

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

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

157
    return (
Oleksii Savran's avatar
Oleksii Savran committed
158
      <PageLayout withFooter>
Matija Obreza's avatar
Matija Obreza committed
159
        <ScrollToTopOnMount />
Viacheslav Pavlov's avatar
Viacheslav Pavlov committed
160
161
162
163
164
        <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
165

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

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

277
278
279
280
281
282
                    { accession.acceUrl &&
                      <PropertiesItem title={ t('accessions.public.p.display.accessionURL') }>
                          <ExternalLink link={ accession.acceUrl } />
                          <AuditedInfo info={ auditAccession.acceUrl }/>
                      </PropertiesItem>
                    }
283
284
                  </Properties>
                </MainSection>
Matija Obreza's avatar
Matija Obreza committed
285

286
287
288
289
                { imageGallery &&
                  <ImageGalleryView className={ classes.pageSection } imageGallery={ imageGallery }/>
                }

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

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

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

                    { hasLatLon &&
Oleksii Savran's avatar
Oleksii Savran committed
380
381
382
383
                      <LocationMap
                        locations={ [{ id: accession.geo.id, lat: accession.geo.latitude, lng: accession.geo.longitude }] }
                        mapLayers={ mapLayers }
                      />
384
385
386
                    }
                  </PageSection>
                }
Matija Obreza's avatar
Matija Obreza committed
387

Viacheslav Pavlov's avatar
Viacheslav Pavlov committed
388
                { accession.geo && accession.geo.climate &&
389
                 <BioClimateDisplay climateData={ accession.geo.climate } extraFilters={ { taxa: { genus: [ accession.taxonomy.genus ] } } } />
Viacheslav Pavlov's avatar
Viacheslav Pavlov committed
390
391
                }

392
                { accession.remarks && accession.remarks.length > 0 && <PageSection title={ t('accessions.public.p.display.remarks') }>
393
394
395
396
397
398
                  <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
399

400
401
402
403
404
405
                { 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}` }>
406
                            <Button variant="contained" component="span">
407
408
409
410
411
412
413
414
415
416
417
                              { t('common:action.download') }
                            </Button>
                          </a>
                        }>
                          <b>{ e.originalFilename }</b>
                        </PropertiesItem>
                      )) }
                    </Properties>
                  </PageSection>
                }

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

420
                <PageSection title={ t('accessions.public.p.display.metadata') }>
421
                  <Properties>
422
423
424
425
                    <PropertiesItem title={ t('common:label.UUID') }>
                      { `urn:uuid:${accession.uuid}` }
                      <AuditedInfo info={ auditAccessionId.uuid }/>
                    </PropertiesItem>
426
427
428
                    <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>
429
430
                  </Properties>
                </PageSection>
431

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

const mapStateToProps = (state, ownProps) => ({
460
  accession: state.accessions.public.accession,
461
  auditLog: state.accessions.public.auditLog,
462
  error: state.accessions.public.accessionError,
463
  uuid: ownProps.match.params.uuid,
464
  doi: ownProps.match.params.doi,
465
  accessions: state.list.public.myList.accessions,
Oleksii Savran's avatar
Oleksii Savran committed
466
  mapLayers: state.accessions.public.mapLayers,
467
468
469
});

const mapDispatchToProps = (dispatch) => bindActionCreators({
Viacheslav Pavlov's avatar
Viacheslav Pavlov committed
470
471
  addAccessionToMyList,
  removeAccessionFromMyList,
472
  loadAccession,
473
  loadAccessionAuditLog,
Matija Obreza's avatar
Matija Obreza committed
474
  applyFilters,
475
  navigateTo,
476
477
478
}, dispatch);


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