Commit 51a9d92c authored by Matija Obreza's avatar Matija Obreza
Browse files

Updated AccessionRef

- Additional models
parent e85a0349
Pipeline #6856 passed with stages
in 7 minutes and 4 seconds
......@@ -32,10 +32,10 @@ const DatasetFilters = ({handleSubmit, initialize, ...other}) => (
<CropFilter />
<CollapsibleComponentSearch title="Accessions">
<StringArrFilter name="accessionIdentifier.genus" label="Genus" placeholder="Manihot"/>
<StringFilter name="accessionIdentifier.acceNumb" searchType="contains" label="Accession number" placeholder="IRGC100"/>
<StringArrFilter name="accessionIdentifier.instCode" label="FAO WIEWS Institute code" placeholder="PHL001"/>
<StringArrFilter name="accessionIdentifier.doi" label="Accession DOI" placeholder="10.xxxx/yyyyy"/>
<StringArrFilter name="accessionRef.genus" label="Genus" placeholder="Manihot"/>
<StringFilter name="accessionRef.acceNumb" searchType="contains" label="Accession number" placeholder="IRGC100"/>
<StringArrFilter name="accessionRef.instCode" label="FAO WIEWS Institute code" placeholder="PHL001"/>
<StringArrFilter name="accessionRef.doi" label="Accession DOI" placeholder="10.xxxx/yyyyy"/>
<CollapsibleComponentSearch title="Licence">
<LicenceFilter name="rights" className="p-20"/>
import Country from 'model/geo/Country';
import Crop from 'model/genesys/Crop';
import FaoInstitute from 'model/genesys/FaoInstitute';
import Taxonomy from 'model/genesys/Taxonomy';
* Defined in Swagger as '#/definitions/Accession'
class Accession {
public accNames: string;
public acceUrl: string;
public accessionNumber: string;
public acquisitionDate: string;
public acquisitionSource: string;
public active: boolean;
// public aliases: AccessionAlias[];
public ancest: string;
public available: boolean;
public breederCode: string[];
public breederName: string[];
// public coll: AccessionCollect;
public countryOfOrigin: Country;
public createdBy: number;
public createdDate: Date;
public crop: Crop;
public cropName: string;
public doi: string;
public donorCode: string;
public donorName: string;
public donorNumb: string;
public duplSite: string[];
public genus: string;
// public geo: AccessionGeo;
public historic: boolean;
public id: number;
public inSvalbard: boolean;
public inTrust: boolean;
public institute: FaoInstitute;
public instituteCode: string;
public lastModifiedBy: number;
public lastModifiedDate: Date;
// public lists: AccessionList[];
public mlsStatus: boolean;
public origCty: string;
public otherIds: string;
// public pdci: PDCI;
// public remarks: AccessionRemark[];
public sampStat: number;
public seqNo: number;
public storage: number[];
public taxonomy: Taxonomy;
public tileIndex: number;
public uuid: string;
public version: number;
export default Accession;
// import AccessionCollectFilter from 'model/accession/AccessionCollectFilter';
// import AccessionGeoFilter from 'model/accession/AccessionGeoFilter';
import CountryFilter from 'model/geo/CountryFilter';
import InstituteFilter from 'model/genesys/InstituteFilter';
import NumberFilter from 'model/filter/NumberFilter';
import StringFilter from 'model/filter/StringFilter';
import TaxonomyFilter from 'model/genesys/TaxonomyFilter';
* Defined in Swagger as '#/definitions/AccessionFilter'
class AccessionFilter {
public acceNumb?: StringFilter;
public art15?: boolean;
public available?: boolean;
// public coll?: AccessionCollectFilter;
public crop?: string;
public cropName?: string;
public doi?: string[];
// public geo?: AccessionGeoFilter;
public historic?: boolean;
public holder?: InstituteFilter;
public list?: string[];
public mlsStatus?: boolean;
public origin?: CountryFilter;
public pdci?: NumberFilter;
public sampStat?: number[];
public seqNo?: NumberFilter;
public sgsv?: boolean;
public storage?: number[];
public taxa?: TaxonomyFilter;
export default AccessionFilter;
import Accession from 'model/accession/Accession';
export default class AccessionRef {
class AccessionRef {
public static clazz: string = 'org.genesys2.server.model.genesys.AccessionRef';
public doi: string;
public instCode: string;
public acceNumb: string;
public genus: string;
public species: string;
public accession: Accession;
export default AccessionRef;
import AccessionFilter from 'model/accession/AccessionFilter';
import StringFilter from 'model/filter/StringFilter';
* Defined in Swagger as '#/definitions/AccessionRefFilter'
class AccessionRefFilter {
public acceNumb: StringFilter;
public accession: AccessionFilter;
public doi: string[];
public genus: string[];
public instCode: string[];
public species: string[];
export default AccessionRefFilter;
import AccessionIdentifierFilter from 'model/accession/AccessionIdentifierFilter';
import AccessionRefFilter from 'model/accession/AccessionRefFilter';
import DatasetLocationFilter from 'model/catalog/DatasetLocationFilter';
import DateFilter from 'model/filter/DateFilter';
import DescriptorFilter from 'model/catalog/DescriptorFilter';
......@@ -13,7 +13,7 @@ class DatasetFilter {
public NOTNULL?: string[];
public NULL?: string[];
public _text?: string;
public accessionIdentifier?: AccessionIdentifierFilter;
public accessionRef?: AccessionRefFilter;
public active?: boolean;
public createdBy?: number[];
public createdDate?: DateFilter;
import Country from 'model/geo/Country';
// import Organization from 'model/genesys/Organization';
// import PDCIStatistics from 'model/accession/PDCIStatistics';
* Defined in Swagger as '#/definitions/FaoInstitute'
class FaoInstitute {
public accessionCount: number;
public acronym: string;
public allowMaterialRequests: boolean;
public code: string;
public codeSGSV: string;
public country: Country;
public current: boolean;
public elevation: number;
public email: string;
public fullName: string;
public id: number;
public latitude: number;
public longitude: number;
public maintainsCollection: boolean;
// public networks: Organization[];
public pdciAvg: number;
public pdciHistogram: string;
public pdciMax: number;
public pdciMin: number;
public pgrActivity: boolean;
public safeUrls: string[];
public settings: any;
// public statisticsPDCI: PDCIStatistics;
public type: string;
public uniqueAcceNumbs: boolean;
public url: string;
public urls: string[];
public vCode: string;
export default FaoInstitute;
import CountryFilter from 'model/geo/CountryFilter';
import StringFilter from 'model/filter/StringFilter';
* Defined in Swagger as '#/definitions/InstituteFilter'
class InstituteFilter {
public accessions?: boolean;
public code?: string[];
public country?: CountryFilter;
public name?: StringFilter;
// public networks?: string[];
export default InstituteFilter;
* Defined in Swagger as '#/definitions/Taxonomy2'
class Taxonomy {
public active: boolean;
public createdBy: number;
public createdDate: Date;
public genus: string;
public id: number;
public lastModifiedBy: number;
public lastModifiedDate: Date;
public rdfUri: string;
public spAuthor: string;
public species: string;
public subtAuthor: string;
public subtaxa: string;
public taxGenus: number;
public taxSpecies: number;
public taxonName: string;
public taxonNameHtml: string;
public version: number;
export default Taxonomy;
import StringFilter from 'model/filter/StringFilter';
* Defined in Swagger as '#/definitions/AccessionIdentifierFilter'
* Defined in Swagger as '#/definitions/TaxonomyFilter'
class AccessionIdentifierFilter {
public acceNumb?: StringFilter;
public doi?: string[];
class TaxonomyFilter {
public genus?: string[];
public instCode?: string[];
public species?: string[];
public subtaxa?: StringFilter;
public taxon?: StringFilter;
export default AccessionIdentifierFilter;
export default TaxonomyFilter;
import GeoRegion from 'model/geo/GeoRegion';
* Defined in Swagger as '#/definitions/Country'
class Country {
public code2: string;
public code3: string;
public codeNum: string;
public current: boolean;
public id: number;
public maxLatitude: number;
public maxLongitude: number;
public minLatitude: number;
public minLongitude: number;
public name: string;
public nameL: string;
public refnameId: number;
public region: GeoRegion;
public replacedBy: Country;
public wikiLink: string;
export default Country;
* Defined in Swagger as '#/definitions/CountryFilter'
class CountryFilter {
public iso3?: string[];
public region?: string[];
export default CountryFilter;
import Country from 'model/geo/Country';
* Defined in Swagger as '#/definitions/GeoRegion'
class GeoRegion {
public active: boolean;
public countries: Country[];
public id: number;
public isoCode: string;
public name: string;
public parentRegion: GeoRegion;
public version: number;
export default GeoRegion;
......@@ -268,13 +268,13 @@ class DatasetService {
* @param UUID UUID
* @param version version
* @param accessionIdentifiers accessionIdentifiers
* @param accessionRefs accessionRefs
public static upsertAccessions(UUID: string, version: number, accessionIdentifiers: AccessionRef[]): Promise<Dataset> {
public static upsertAccessions(UUID: string, version: number, accessionRefs: AccessionRef[]): Promise<Dataset> {
const apiUrl = URL_UPSERT_ACCESSIONS.expand({UUID, version});
// console.log(`Fetching from ${apiUrl}`);
const content = { data: accessionIdentifiers };
const content = { data: accessionRefs };
return axiosBackend.request({
url: apiUrl,
......@@ -20,6 +20,7 @@ import Crop from 'model/genesys/Crop';
import { Link } from 'react-router-dom';
import Markdown from 'ui/common/markdown';
import { PublishState } from 'model/common.model';
import AccessionRef from 'model/accession/AccessionRef';
interface IDatasetLinkProps extends React.Props<any> {
to: Dataset;
......@@ -108,20 +109,22 @@ const DescriptorListLink = connect(({}) => ({}), (dispatch) => bindActionCreator
interface IAccessionLinkProps extends React.Props<any> {
apiUrl: string;
accessionIdentifier: any;
accessionRef: AccessionRef;
const AccessionLink_ = ({ apiUrl, accessionIdentifier }: IAccessionLinkProps) => {
const url = accessionIdentifier.doi ? `${apiUrl}/${accessionIdentifier.doi}` : (accessionIdentifier.uuid ? `${apiUrl}/acn/${accessionIdentifier.uuid}` : ``);
const AccessionLink_ = ({ apiUrl, accessionRef }: IAccessionLinkProps) => {
const url = accessionRef.accession ?
(accessionRef.accession.doi ? `${apiUrl}/${accessionRef.accession.doi}` : (accessionRef.accession.uuid ? `${apiUrl}/acn/${accessionRef.accession.uuid}` : ``))
: (accessionRef.doi ? `${accessionRef.doi}` : null);
if (url) {
return (
<a href={ url } >
<span>{ accessionIdentifier.acceNumb }</span>
<span>{ accessionRef.acceNumb }</span>
} else {
return <span>{ accessionIdentifier.acceNumb }</span>;
return <span>{ accessionRef.acceNumb }</span>;
......@@ -46,7 +46,7 @@ class AccessionRefsTable extends React.Component<IAccessionRefsTableProps, any>
public render() {
const { accessionRefs, classes } = this.props;
const rowGetter = ({ index }) => accessionRefs[index];
const renderAccessionNumber = ({rowIndex}) => <AccessionLink accessionIdentifier={ accessionRefs[rowIndex] }/>;
const renderAccessionNumber = ({rowIndex}) => <AccessionLink accessionRef={ accessionRefs[rowIndex] }/>;
const renderDoi = ({ cellData }) => <DOI noPrefix value={ cellData } />;
const rowClassName = ({ index }) => index === -1 ? '' : `${classes.tableCell} ${index % 2 === 0 ? classes.evenRow : classes.oddRow}`;
Markdown is supported
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