From 81041b82723ce5b34c9ac2ef157dea387c695e13 Mon Sep 17 00:00:00 2001 From: "v.pavlov" Date: Mon, 9 Jul 2018 13:29:04 +0300 Subject: [PATCH] =?UTF-8?q?Rename=20"Timing=20and=20location"=20to=20?= =?UTF-8?q?=E2=80=9CLocation=E2=80=9D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/constants/datasets.ts | 2 +- src/ui/pages/dataset/dataset-stepper/steps.ts | 4 ++-- .../FormMap.tsx | 0 .../LocationForm.tsx} | 8 ++++---- .../{timing-and-location => location}/index.tsx | 16 ++++++++-------- src/ui/routes.tsx | 6 +++--- 6 files changed, 18 insertions(+), 18 deletions(-) rename src/ui/pages/dataset/dataset-stepper/steps/{timing-and-location => location}/FormMap.tsx (100%) rename src/ui/pages/dataset/dataset-stepper/steps/{timing-and-location/TimingAndLocationForm.tsx => location/LocationForm.tsx} (97%) rename src/ui/pages/dataset/dataset-stepper/steps/{timing-and-location => location}/index.tsx (86%) diff --git a/src/constants/datasets.ts b/src/constants/datasets.ts index 19d2946..0580df9 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 dce74cf..ff332ec 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 d2f9180..a6ba5a1 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 1de6d02..de4bc26 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 71ddf0e..f42ea18 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, }, { -- GitLab