diff --git a/src/constants/datasets.ts b/src/constants/datasets.ts index 19d2946b6c6714bff54c0160e313fa28db28edb8..0580df9ef6020ff941cba4742c8e698d29464e4e 100644 --- a/src/constants/datasets.ts +++ b/src/constants/datasets.ts @@ -13,7 +13,7 @@ export const REMOVE_CREATOR_FROM_DATASET = 'App/REMOVE_CREATOR_FROM_DATASET'; export const UPDATE_DATASET_CREATOR = 'App/UPDATE_DATASET_CREATOR'; // locations -export const TIMING_AND_LOCATION_FORM = 'Form/TIMING_AND_LOCATION_FORM'; +export const LOCATION_FORM = 'Form/LOCATION_FORM'; export const RECEIVE_LOCATION = 'App/RECEIVE_LOCATION'; export const ADD_LOCATION = 'App/ADD_LOCATION'; export const REMOVE_LOCATION = 'App/REMOVE_LOCATION'; diff --git a/src/ui/pages/dataset/dataset-stepper/steps.ts b/src/ui/pages/dataset/dataset-stepper/steps.ts index dce74cf7a786009749b2a21a90403bcd70bf3a72..ff332ecce737740c67f324cd5543dab49a68166f 100644 --- a/src/ui/pages/dataset/dataset-stepper/steps.ts +++ b/src/ui/pages/dataset/dataset-stepper/steps.ts @@ -16,8 +16,8 @@ const steps = [ }, { id: 4, - name: 'Timing and location', - link: 'edit/timing-and-location', + name: 'Location', + link: 'edit/location', }, { id: 5, diff --git a/src/ui/pages/dataset/dataset-stepper/steps/timing-and-location/FormMap.tsx b/src/ui/pages/dataset/dataset-stepper/steps/location/FormMap.tsx similarity index 100% rename from src/ui/pages/dataset/dataset-stepper/steps/timing-and-location/FormMap.tsx rename to src/ui/pages/dataset/dataset-stepper/steps/location/FormMap.tsx diff --git a/src/ui/pages/dataset/dataset-stepper/steps/timing-and-location/TimingAndLocationForm.tsx b/src/ui/pages/dataset/dataset-stepper/steps/location/LocationForm.tsx similarity index 97% rename from src/ui/pages/dataset/dataset-stepper/steps/timing-and-location/TimingAndLocationForm.tsx rename to src/ui/pages/dataset/dataset-stepper/steps/location/LocationForm.tsx index d2f91807344d5ed07c4d50cf9ede018ba5049e72..a6ba5a1ae5455c127bde39edcce87f9a047a4b4e 100644 --- a/src/ui/pages/dataset/dataset-stepper/steps/timing-and-location/TimingAndLocationForm.tsx +++ b/src/ui/pages/dataset/dataset-stepper/steps/location/LocationForm.tsx @@ -2,7 +2,7 @@ import * as React from 'react'; import {Field, Fields, FieldArray, reduxForm} from 'redux-form'; import Button from 'material-ui/Button'; -import {TIMING_AND_LOCATION_FORM} from 'constants/datasets'; +import {LOCATION_FORM} from 'constants/datasets'; import MaterialAutosuggest from 'ui/common/material-autosuggest'; import {TextField} from 'ui/common/text-field'; @@ -28,7 +28,7 @@ interface ILocationFormProps extends React.ClassAttributes { changeFieldValue: (field: string, value: any) => void; } -class TimingAndLocationForm extends React.Component { +class LocationForm extends React.Component { protected updateCountryInfo = (fields, index) => (property: string) => () => { const {dataset: {locations}, changeFieldValue} = this.props; @@ -170,6 +170,6 @@ class TimingAndLocationForm extends React.Component { } export default reduxForm({ - form: TIMING_AND_LOCATION_FORM, + form: LOCATION_FORM, enableReinitialize: true, -})(TimingAndLocationForm); +})(LocationForm); diff --git a/src/ui/pages/dataset/dataset-stepper/steps/timing-and-location/index.tsx b/src/ui/pages/dataset/dataset-stepper/steps/location/index.tsx similarity index 86% rename from src/ui/pages/dataset/dataset-stepper/steps/timing-and-location/index.tsx rename to src/ui/pages/dataset/dataset-stepper/steps/location/index.tsx index 1de6d0295b0b718bd1c62963954011555947c441..de4bc26460d2784cda40943f1bf235ba46ee4c0c 100644 --- a/src/ui/pages/dataset/dataset-stepper/steps/timing-and-location/index.tsx +++ b/src/ui/pages/dataset/dataset-stepper/steps/location/index.tsx @@ -7,14 +7,14 @@ import {Dataset} from 'model/dataset.model'; import {createLocationRequest, deleteLocationRequest, updateLocationRequest} from 'actions/dataset'; -import TimingAndLocationForm from './TimingAndLocationForm'; +import LocationForm from './LocationForm'; import steps from '../../steps'; import NavigationWrapper from 'ui/common/stepper/NavigationWrapper'; import {getFormValues, change} from 'redux-form'; -import {TIMING_AND_LOCATION_FORM} from 'constants/datasets'; +import {LOCATION_FORM} from 'constants/datasets'; import * as _ from 'lodash'; -interface ITimingAndLocationStepProps extends React.ClassAttributes { +interface ILocationStepProps extends React.ClassAttributes { dataset: Dataset; createLocationRequest: (datasetUUID: string) => Promise; updateLocationRequest: (datasetUUID: string, location: Location) => Promise; @@ -28,7 +28,7 @@ interface ITimingAndLocationStepProps extends React.ClassAttributes { change: any; } -class TimingAndLocationStep extends React.Component { +class LocationStep extends React.Component { protected gotoStep = (id) => () => { this.updateIfNeed(); @@ -41,7 +41,7 @@ class TimingAndLocationStep extends React.Component { - this.props.change(TIMING_AND_LOCATION_FORM, field, value); + this.props.change(LOCATION_FORM, field, value); } private updateIfNeed = () => { @@ -63,7 +63,7 @@ class TimingAndLocationStep extends React.Component - ({ onDelete: ownProps.onDelete, onGotoStep: ownProps.onGotoStep, onPublish: ownProps.onPublish, - formValues: getFormValues(TIMING_AND_LOCATION_FORM)(state), + formValues: getFormValues(LOCATION_FORM)(state), }); const mapDispatchToProps = (dispatch) => bindActionCreators({ @@ -94,4 +94,4 @@ const mapDispatchToProps = (dispatch) => bindActionCreators({ export default connect( mapStateToProps, mapDispatchToProps, -)(TimingAndLocationStep); +)(LocationStep); diff --git a/src/ui/routes.tsx b/src/ui/routes.tsx index 71ddf0e283ec94544bdef89084dae12e61147bc1..f42ea18a3da284203a07fd267891d16825dae235 100644 --- a/src/ui/routes.tsx +++ b/src/ui/routes.tsx @@ -38,7 +38,7 @@ import BasicInfoStep from './pages/dataset/dataset-stepper/steps/basic-info'; import FilesStep from './pages/dataset/dataset-stepper/steps/files'; import Creators from './pages/dataset/dataset-stepper/steps/creators'; import AccessionsListStep from './pages/dataset/dataset-stepper/steps/accessions-list'; -import TimingAndLocationStep from './pages/dataset/dataset-stepper/steps/timing-and-location'; +import LocationStep from './pages/dataset/dataset-stepper/steps/location'; import ReviewAndPublishStep from './pages/dataset/dataset-stepper/steps/review'; import Traits from './pages/dataset/dataset-stepper/steps/traits'; import ReorderTraitsStep from 'ui/pages/dataset/dataset-stepper/steps/reorder'; @@ -228,8 +228,8 @@ const routes = [ exact: true, }, { - path: '/timing-and-location', - component: TimingAndLocationStep, + path: '/location', + component: LocationStep, exact: true, }, {