Commit 67a55629 authored by Matija Obreza's avatar Matija Obreza
Browse files

Accession: Display notice for historical accessions

parent 4146a8ac
...@@ -85,7 +85,7 @@ class AccessionDetailsPage extends React.Component<IAccessionDetailsPage & WithT ...@@ -85,7 +85,7 @@ class AccessionDetailsPage extends React.Component<IAccessionDetailsPage & WithT
const canAdd = canAddToCart(accession.details); const canAdd = canAddToCart(accession.details);
return <button return !accession.details.historic && <button
type="button" type="button"
disabled={ !canAdd } disabled={ !canAdd }
name={ `button-add-${accession.details.uuid}` } name={ `button-add-${accession.details.uuid}` }
...@@ -137,15 +137,14 @@ class AccessionDetailsPage extends React.Component<IAccessionDetailsPage & WithT ...@@ -137,15 +137,14 @@ class AccessionDetailsPage extends React.Component<IAccessionDetailsPage & WithT
} }
</div> </div>
{ details.historic && <div className="bg-warning p-2 mb-2">{ t('accession.historicalNote') }</div> }
{ details.doi && <Property title={ t('accession.doi') } value={ <a href={ `https://doi.org/${details.doi}` } target="_blank">{ details.doi }</a> } index={ propertyIndex++ }/> } { details.doi && <Property title={ t('accession.doi') } value={ <a href={ `https://doi.org/${details.doi}` } target="_blank">{ details.doi }</a> } index={ propertyIndex++ }/> }
{ details.accessionName && <Property title={ t('accession.accessionName') } value={ <b>{ details.accessionName }</b> } index={ propertyIndex++ }/> } { details.accessionName && <Property title={ t('accession.accessionName') } value={ <b>{ details.accessionName }</b> } index={ propertyIndex++ }/> }
<Property title={ t('accession.acceNumb') } value={ details.accessionNumber } index={ propertyIndex++ } /> <Property title={ t('accession.acceNumb') } value={ details.accessionNumber } index={ propertyIndex++ } />
{ details.institute && details.institute.fullName && { details.institute && details.institute.fullName &&
<Property title={ t('accession.holdingInstitute') } value={ details.institute.fullName } index={ propertyIndex++ }/> <Property title={ t('accession.holdingInstitute') } value={ details.institute.fullName } index={ propertyIndex++ }/>
} }
{ details.historic &&
<Property title="Historic accession" value={ 'This is a historic record of an accession' } index={ propertyIndex++ }/>
}
{ details.institute && details.institute.code && { details.institute && details.institute.code &&
<Property title={ t('accession.instituteCode') } value={ details.institute.code } index={ propertyIndex++ }/> <Property title={ t('accession.instituteCode') } value={ details.institute.code } index={ propertyIndex++ }/>
} }
......
...@@ -216,7 +216,7 @@ class AccessionListPage extends React.Component<IAccessionListPageProps & WithTr ...@@ -216,7 +216,7 @@ class AccessionListPage extends React.Component<IAccessionListPageProps & WithTr
</thead> </thead>
<tbody> <tbody>
{ accessions.content.map((a, i) => ( { accessions.content.map((a, i) => (
<tr key={ a.id } className={ selectedUUIDs.has(a.uuid) ? 'table-primary' : '' }> <tr key={ a.id } className={ a.historic ? 'table-historical' : selectedUUIDs.has(a.uuid) ? 'table-primary' : '' }>
{ shoppingCart.enabled && ( { shoppingCart.enabled && (
<td> <td>
{ canAddToCart(a) && { canAddToCart(a) &&
......
tr.table-historical {
opacity: 50%;
}
...@@ -31,6 +31,7 @@ ...@@ -31,6 +31,7 @@
"accession": { "accession": {
"model": "Accession", "model": "Accession",
"model_plural": "Accessions", "model_plural": "Accessions",
"historicalNote": "This is a historical record of an accession.",
"doi": "Accession DOI", "doi": "Accession DOI",
"crop": "Crop", "crop": "Crop",
"cropName": "Crop name", "cropName": "Crop name",
......
...@@ -18,6 +18,7 @@ import MapPage from 'map/MapPage'; ...@@ -18,6 +18,7 @@ import MapPage from 'map/MapPage';
import ApiInfo from '@genesys/client/model/ApiInfo'; import ApiInfo from '@genesys/client/model/ApiInfo';
import 'leaflet/dist/leaflet.css'; import 'leaflet/dist/leaflet.css';
import 'genesys.css';
const hashHistory = createHashHistory({}); const hashHistory = createHashHistory({});
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment