Commit 86d79ec7 authored by Matija Obreza's avatar Matija Obreza

Moved models to appropriate namespace folders

parent 3ed4abd5
......@@ -3,14 +3,14 @@
*/
import navigateTo from 'actions/navigation';
import FilteredPage, { IPageRequest } from 'model/FilteredPage';
import Accession from 'model/Accession';
import AccessionFilter from 'model/AccessionFilter';
import AccessionDetails from 'model/AccessionDetails';
import AccessionMapInfo from 'model/AccessionMapInfo';
import Accession from 'model/accession/Accession';
import AccessionFilter from 'model/accession/AccessionFilter';
import AccessionDetails from 'model/accession/AccessionDetails';
import AccessionMapInfo from 'model/accession/AccessionMapInfo';
import {RECEIVE_ACCESSIONS, RECEIVE_ACCESSION, RECEIVE_ACCESSION_OVERVIEW, APPEND_ACCESSIONS, RECEIVE_ACCESSION_MAPINFO} from 'accessions/constants';
import AccessionService from 'service/genesys/AccessionService';
import { AccessionRef } from 'model/dataset.model';
import { AccessionRef } from 'model/accession/AccessionRef';
const receiveAccessions = (paged: FilteredPage<Accession>, error = null) => ({
type: RECEIVE_ACCESSIONS,
......
......@@ -4,9 +4,9 @@ import { IReducerAction } from 'model/common.model';
import {RECEIVE_ACCESSIONS, RECEIVE_ACCESSION, RECEIVE_ACCESSION_OVERVIEW, APPEND_ACCESSIONS, RECEIVE_ACCESSION_MAPINFO} from 'accessions/constants';
import FilteredPage from 'model/FilteredPage';
import Accession from 'model/Accession';
import AccessionMapInfo from 'model/AccessionMapInfo';
import AccessionOverview from 'model/AccessionOverview';
import Accession from 'model/accession/Accession';
import AccessionMapInfo from 'model/accession/AccessionMapInfo';
import AccessionOverview from 'model/accession/AccessionOverview';
const INITIAL_STATE: {
accession: Accession;
......
......@@ -7,7 +7,7 @@ import { parse } from 'query-string';
import { applyFilters, loadAccessionsPage, updateRoute } from 'accessions/actions/public';
// Models
import Accession from 'model/Accession';
import Accession from 'model/accession/Accession';
// UI
import BrowsePageTemplate, { IBrowsePageProps } from 'ui/pages/_base/BrowsePage';
......
......@@ -8,7 +8,7 @@ import { loadAccession } from 'accessions/actions/public';
import {addAccessionToMyList, removeAccessionFromMyList} from 'user/actions/public';
// Models
import AccessionDetails from 'model/AccessionDetails';
import AccessionDetails from 'model/accession/AccessionDetails';
// UI
import { Link } from 'react-router-dom';
......
......@@ -3,9 +3,9 @@ import {connect} from 'react-redux';
import {withStyles} from '@material-ui/core/styles';
import {bindActionCreators} from 'redux';
import { loadAccessionsMapInfo } from 'accessions/actions/public';
import AccessionFilter from 'model/AccessionFilter';
import AccessionFilter from 'model/accession/AccessionFilter';
import Loading from 'ui/common/Loading';
import AccessionMapInfo from 'model/AccessionMapInfo';
import AccessionMapInfo from 'model/accession/AccessionMapInfo';
import PageLayout from 'ui/layout/PageLayout';
import ContentHeader from 'ui/common/heading/ContentHeader';
import Button from '@material-ui/core/Button';
......
......@@ -10,10 +10,10 @@ import {applyFilters, loadAccessionsPage, listAccessionsPromise, updateRoute, ap
import { showSnackbar } from 'actions/snackbar';
// Models
import Accession from 'model/Accession';
import Accession from 'model/accession/Accession';
import FilteredPage, {IPageRequest} from 'model/FilteredPage';
import AccessionFilter from 'model/AccessionFilter';
import AccessionOverview from 'model/AccessionOverview';
import AccessionFilter from 'model/accession/AccessionFilter';
import AccessionOverview from 'model/accession/AccessionOverview';
// UI
import PageLayout, { PageContents } from 'ui/layout/PageLayout';
......
......@@ -3,7 +3,7 @@ import {connect} from 'react-redux';
import {bindActionCreators} from 'redux';
import { withStyles } from '@material-ui/core/styles';
import Accession from 'model/Accession';
import Accession from 'model/accession/Accession';
import { AccessionLink } from 'ui/genesys/Links';
import Card, {CardContent, CardActions} from 'ui/common/Card';
import DOI from 'ui/common/DOI';
......
......@@ -9,7 +9,7 @@ import BooleanFilter from 'ui/common/filter/BooleanFilter';
import NumberFilter from 'ui/common/filter/NumberFilter';
import StringFilter from 'ui/common/filter/StringFilter';
import StringArrFilter from 'ui/common/filter/StringArrFilter';
import Accession from 'model/Accession';
import Accession from 'model/accession/Accession';
import DateFilter from 'ui/common/filter/DateFilter';
const AccessionFilters = ({handleSubmit, initialValues, initialize, ...other}) => {
......
......@@ -2,7 +2,7 @@ import * as React from 'react';
import {translate} from 'react-i18next';
// model
import PDCI from 'model/PDCI';
import PDCI from 'model/accession/PDCI';
// UI
import Grid from '@material-ui/core/Grid';
......
import Crop from 'model/Crop';
import Crop from 'model/genesys/Crop';
import {CropService} from 'service/CropService';
import {LOAD_CROPS_CACHE_IDLE, RECEIVE_CROPS} from 'crop/constants';
import {IReducerAction} from 'model/common.model';
......
......@@ -3,7 +3,7 @@ import {connect} from 'react-redux';
import {bindActionCreators} from 'redux';
// Models
import Crop from 'model/Crop';
import Crop from 'model/genesys/Crop';
// UI
import PageLayout, { PageContents } from 'ui/layout/PageLayout';
......
......@@ -3,7 +3,7 @@ import {connect} from 'react-redux';
import {bindActionCreators} from 'redux';
// Models
import Crop from 'model/Crop';
import Crop from 'model/genesys/Crop';
// UI
import PageLayout, {PageContents} from 'ui/layout/PageLayout';
......
......@@ -2,7 +2,7 @@ import * as React from 'react';
import {Link} from 'react-router-dom';
// Models
import Crop from 'model/Crop';
import Crop from 'model/genesys/Crop';
// UI
import Card, {CardHeader, CardContent} from 'ui/common/Card';
......
......@@ -2,7 +2,7 @@ import * as React from 'react';
import {connect} from 'react-redux';
import { withStyles } from '@material-ui/core/styles';
import Crop from 'model/Crop';
import Crop from 'model/genesys/Crop';
interface ICropChipsProps extends React.ClassAttributes<any> {
crops?: string[] | string;
......
import * as React from 'react';
import { connect } from 'react-redux';
import Crop from 'model/Crop';
import Crop from 'model/genesys/Crop';
import StringArrFilter from 'ui/common/filter/StringArrFilter';
......
......@@ -10,7 +10,7 @@ import FormHelperText from '@material-ui/core/FormHelperText';
import Checkbox from '@material-ui/core/Checkbox';
import Radio from '@material-ui/core/Radio';
import Crop from 'model/Crop';
import Crop from 'model/genesys/Crop';
interface ICropSelectorProps extends React.ClassAttributes<any> {
t: any;
......
......@@ -4,7 +4,7 @@ import {DASHBOARD_APPEND_INSTITUTES, DASHBOARD_RECEIVE_INSTITUTE, DASHBOARD_RECE
// Model
import FilteredPage, {IPageRequest} from 'model/FilteredPage';
import FaoInstitute from 'model/FaoInstitute';
import FaoInstitute from 'model/genesys/FaoInstitute';
import InstituteService from 'service/genesys/InstituteService';
const receiveInstitutes = (paged: FilteredPage<FaoInstitute>, error = null) => ({
......
......@@ -2,8 +2,8 @@ import navigateTo from 'actions/navigation';
import {APPEND_INSTITUTES, RECEIVE_INSTITUTE, RECEIVE_INSTITUTES} from 'institutes/constants';
import FaoInstitute from 'model/FaoInstitute';
import FaoInstituteFilter from 'model/FaoInstituteFilter';
import FaoInstitute from 'model/genesys/FaoInstitute';
import FaoInstituteFilter from 'model/genesys/FaoInstituteFilter';
import FilteredPage, {IPageRequest} from 'model/FilteredPage';
import InstituteService from 'service/genesys/InstituteService';
......
......@@ -4,7 +4,7 @@ import { IReducerAction } from 'model/common.model';
import FilteredPage from 'model/FilteredPage';
import {DASHBOARD_APPEND_INSTITUTES, DASHBOARD_RECEIVE_INSTITUTE, DASHBOARD_RECEIVE_INSTITUTES} from 'institutes/constants';
import FaoInstitute from 'model/FaoInstitute';
import FaoInstitute from 'model/genesys/FaoInstitute';
const INITIAL_STATE: {
institute: FaoInstitute;
......
......@@ -4,7 +4,7 @@ import { IReducerAction } from 'model/common.model';
import FilteredPage from 'model/FilteredPage';
import {APPEND_INSTITUTES, RECEIVE_INSTITUTE, RECEIVE_INSTITUTES} from 'institutes/constants';
import FaoInstitute from 'model/FaoInstitute';
import FaoInstitute from 'model/genesys/FaoInstitute';
const INITIAL_STATE: {
institute: FaoInstitute;
......
......@@ -7,7 +7,7 @@ import { parse } from 'query-string';
import {applyFilters, loadInstitutesPage, updateRoute} from 'institutes/actions/public';
// Models
import FaoInstitute from 'model/FaoInstitute';
import FaoInstitute from 'model/genesys/FaoInstitute';
// UI
import BrowsePageTemplate, { IBrowsePageProps } from 'ui/pages/_base/BrowsePage';
......
......@@ -9,7 +9,7 @@ import {loadInstitute} from 'institutes/actions/public';
import {applyFilters} from 'accessions/actions/public';
// Models
import FaoInstituteDetails from 'model/FaoInstituteDetails';
import FaoInstituteDetails from 'model/genesys/FaoInstituteDetails';
// UI
import PageLayout, {MainSection, PageContents, PageSection} from 'ui/layout/PageLayout';
......
import * as React from 'react';
import { withStyles } from '@material-ui/core/styles';
import FaoInstitute from 'model/FaoInstitute';
import FaoInstitute from 'model/genesys/FaoInstitute';
import {InstituteLink} from 'ui/genesys/Links';
import Card, {CardContent, CardActions} from 'ui/common/Card';
import SciName from 'ui/genesys/SciName';
......
import AccessionAlias from 'model/AccessionAlias';
import AccessionCollect from 'model/AccessionCollect';
import AccessionGeo from 'model/AccessionGeo';
import AccessionRemark from 'model/AccessionRemark';
import Country from 'model/Country';
import Crop from 'model/Crop';
import FaoInstitute from 'model/FaoInstitute';
import PDCI from 'model/PDCI';
import Taxonomy2 from 'model/Taxonomy2';
import AccessionAlias from 'model/accession/AccessionAlias';
import AccessionCollect from 'model/accession/AccessionCollect';
import AccessionGeo from 'model/accession/AccessionGeo';
import AccessionRemark from 'model/accession/AccessionRemark';
import Country from 'model/geo/Country';
import Crop from 'model/genesys/Crop';
import FaoInstitute from 'model/genesys/FaoInstitute';
import PDCI from 'model/accession/PDCI';
import Taxonomy2 from 'model/genesys/Taxonomy2';
/*
* Defined in Swagger as '#/definitions/Accession'
......
import Accession from 'model/Accession';
import Subset from 'model/Subset';
import PDCI from 'model/PDCI';
import Accession from 'model/accession/Accession';
import Subset from 'model/subset/Subset';
import PDCI from 'model/accession/PDCI';
class AccessionDetails {
public details: Accession;
......
import CountryFilter from 'model/CountryFilter';
import DateFilter from 'model/DateFilter';
import InstituteFilter from 'model/InstituteFilter';
import NumberFilter from 'model/NumberFilter';
import StringFilter from 'model/StringFilter';
import TaxonomyFilter from 'model/TaxonomyFilter';
import CountryFilter from 'model/geo/CountryFilter';
import DateFilter from 'model/filter/DateFilter';
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'
......
import AccessionFilter from 'model/AccessionFilter';
import AccessionFilter from 'model/accession/AccessionFilter';
/*
* Defined in Swagger as '#/definitions/AccessionMapInfo'
......
import AccessionFilter from 'model/AccessionFilter';
import AccessionFilter from 'model/accession/AccessionFilter';
/*
* Defined in Swagger as '#/definitions/AccessionOverview'
......
import StringFilter from 'model/StringFilter';
import StringFilter from 'model/filter/StringFilter';
/*
* Defined in Swagger as '#/definitions/ArticleFilter'
......
import Country from 'model/Country';
import Country from 'model/geo/Country';
/*
* Defined in Swagger as '#/definitions/FaoInstitute'
......
import FaoInstitute from 'model/FaoInstitute';
import FaoInstitute from 'model/genesys/FaoInstitute';
/*
* Defined in Swagger as '#/definitions/FaoInstitute'
......
......@@ -2,8 +2,8 @@
/*
* Defined in OpenAPI as '#/definitions/FaoInstituteFilter'
*/
import StringFilter from 'model/StringFilter';
import CountryFilter from './CountryFilter';
import StringFilter from 'model/filter/StringFilter';
import CountryFilter from 'model/geo/CountryFilter';
class FaoInstituteFilter {
public code: string[];
......
import CountryFilter from 'model/CountryFilter';
import StringFilter from 'model/StringFilter';
import CountryFilter from 'model/geo/CountryFilter';
import StringFilter from 'model/filter/StringFilter';
/*
* Defined in Swagger as '#/definitions/InstituteFilter'
......
import DateFilter from 'model/DateFilter';
import StringFilter from 'model/StringFilter';
import DateFilter from 'model/filter/DateFilter';
import StringFilter from 'model/filter/StringFilter';
/*
* Defined in Swagger as '#/definitions/TaxonomyFilter'
......
import MaterialSubRequest from 'model/MaterialSubRequest';
import MaterialSubRequest from 'model/request/MaterialSubRequest';
/*
* Defined in Swagger as '#/definitions/MaterialRequest'
......
import DateFilter from 'model/DateFilter';
import StringFilter from 'model/StringFilter';
import DateFilter from 'model/filter/DateFilter';
import StringFilter from 'model/filter/StringFilter';
/*
* Defined in Swagger as '#/definitions/MaterialRequestFilter'
......
import MaterialRequest from 'model/MaterialRequest';
import MaterialRequest from 'model/request/MaterialRequest';
/*
* Defined in Swagger as '#/definitions/MaterialSubRequest'
......
import DateFilter from 'model/DateFilter';
import StringFilter from 'model/StringFilter';
import DateFilter from 'model/filter/DateFilter';
import StringFilter from 'model/filter/StringFilter';
/*
* Defined in Swagger as '#/definitions/MaterialSubRequestFilter'
......
......@@ -3,15 +3,15 @@
* Defined in OpenAPI as '#/definitions/Subset'
*/
import {PublishState} from 'model/common.model';
import Creator from 'model/Creator';
import FaoInstitute from 'model/FaoInstitute';
import Crop from 'model/Crop';
import SubsetCreator from 'model/subset/SubsetCreator';
import FaoInstitute from 'model/genesys/FaoInstitute';
import Crop from 'model/genesys/Crop';
class Subset {
public accessionCount: number;
public accessionRefs: string[];
public active: boolean;
public creators: Creator[];
public creators: SubsetCreator[];
public createdBy: number;
public createdDate: Date;
public dateCreated: string;
......
import { UuidModel } from 'model/common.model';
class Creator extends UuidModel {
class SubsetCreator extends UuidModel {
public fullName: string;
public email: string;
public phoneNumber: number;
......@@ -26,4 +26,4 @@ enum CreatorRole {
CURATOR = 'CURATOR',
}
export { Creator as default, CreatorRole };
export { SubsetCreator as default, CreatorRole };
import DateFilter from 'model/DateFilter';
import StringFilter from 'model/StringFilter';
import DateFilter from 'model/filter/DateFilter';
import StringFilter from 'model/filter/StringFilter';
/*
* Defined in OpenAPI as '#/definitions/SubsetFilter'
......
......@@ -4,10 +4,10 @@ import * as _ from 'lodash';
import {ADMIN_APPEND_MATERIAL_REQUESTS, ADMIN_RECEIVE_MATERIAL_REQUEST, ADMIN_RECEIVE_MATERIAL_REQUESTS} from 'requests/constants';
// models
import MaterialRequest from 'model/MaterialRequest';
import MaterialRequest from 'model/request/MaterialRequest';
import FilteredPage, {IPageRequest} from 'model/FilteredPage';
import RequestService from 'service/genesys/RequestService';
import MaterialRequestFilter from 'model/MaterialRequestFilter';
import MaterialRequestFilter from 'model/request/MaterialRequestFilter';
const receiveRequests = (paged: FilteredPage<MaterialRequest>, error = null) => ({
......
import update from 'immutability-helper';
import { IReducerAction } from 'model/common.model';
import MaterialRequest from 'model/MaterialRequest';
import MaterialRequest from 'model/request/MaterialRequest';
import FilteredPage from 'model/FilteredPage';
import {ADMIN_APPEND_MATERIAL_REQUESTS, ADMIN_RECEIVE_MATERIAL_REQUEST, ADMIN_RECEIVE_MATERIAL_REQUESTS} from 'requests/constants';
......
......@@ -6,7 +6,7 @@ import {bindActionCreators} from 'redux';
import {listMaterialRequests} from 'requests/actions/admin';
// Models
import MaterialRequest from 'model/MaterialRequest';
import MaterialRequest from 'model/request/MaterialRequest';
// UI
import BrowsePageTemplate from 'ui/pages/_base/BrowsePage';
......
......@@ -7,7 +7,7 @@ import {translate} from 'react-i18next';
import {loadMaterialRequest, sendValidationEmailAction, recheckPidAction, validateRequestAction} from 'requests/actions/admin';
// Models
import MaterialRequest from 'model/MaterialRequest';
import MaterialRequest from 'model/request/MaterialRequest';
// UI
import ContentHeaderWithButton from 'ui/common/heading/ContentHeaderWithButton';
......
import * as React from 'react';
import {withStyles} from '@material-ui/core/styles';
import MaterialRequest from 'model/MaterialRequest';
import MaterialRequest from 'model/request/MaterialRequest';
import {RequestLink} from 'ui/genesys/Links';
import Card, {CardContent} from 'ui/common/Card';
import PrettyDate from 'ui/common/time/PrettyDate';
......
import * as UrlTemplate from 'url-template';
import { axiosBackend } from 'utilities/requestUtils';
import Crop from 'model/Crop';
import Crop from 'model/genesys/Crop';
const URL_LIST_CROPS = UrlTemplate.parse(`/api/v0/crops`);
const URL_SAVE_CROP = `/api/v0/crops/save`;
......
import { log } from 'utilities/debug';
import { axiosBackend } from 'utilities/requestUtils';
import { User } from 'model/User';
import { User } from 'model/user/User';
const REGISTER_URL = `/api/v1/user/register`;
const GET_USER_PROFILE_URL = `/api/v0/me/profile`;
......
......@@ -3,12 +3,12 @@ import * as UrlTemplate from 'url-template';
import * as QueryString from 'query-string';
import { axiosBackend } from 'utilities/requestUtils';
import Accession from 'model/Accession';
import AccessionDetails from 'model/AccessionDetails';
import AccessionFilter from 'model/AccessionFilter';
import AccessionMapInfo from 'model/AccessionMapInfo';
import Accession from 'model/accession/Accession';
import AccessionDetails from 'model/accession/AccessionDetails';
import AccessionFilter from 'model/accession/AccessionFilter';
import AccessionMapInfo from 'model/accession/AccessionMapInfo';
import FilteredPage, { IPageRequest } from 'model/FilteredPage';
import {AccessionRef} from 'model/dataset.model';
import {AccessionRef} from 'model/accession/AccessionRef';
const URL_GET_BY_DOI = `/api/v1/acn/{doi}`; // UrlTemplate doesn't like the / in DOI
const URL_GET_BY_UUID = UrlTemplate.parse(`/api/v1/acn/{UUID}`);
......
......@@ -4,8 +4,8 @@ import * as QueryString from 'query-string';
import { axiosBackend } from 'utilities/requestUtils';
import FilteredPage, { IPageRequest } from 'model/FilteredPage';
import FaoInstitute from 'model/FaoInstitute';
import FaoInstituteFilter from 'model/FaoInstituteFilter';
import FaoInstitute from 'model/genesys/FaoInstitute';
import FaoInstituteFilter from 'model/genesys/FaoInstituteFilter';
const URL_LIST = `/api/v1/wiews/list`;