Просмотр исходного кода

Merge pull request #314 from smiclea/description

Use the `notes` field for replica description
Dorin Paslaru 7 лет назад
Родитель
Сommit
8acf8f09c7

+ 2 - 4
src/components/organisms/MainDetails/MainDetails.jsx

@@ -286,7 +286,6 @@ class MainDetails extends React.Component<Props> {
     const propertyNames = this.props.item && this.props.item.destination_environment ? Object.keys(this.props.item.destination_environment).filter(k => k !== 'description' && k !== 'network_map') : []
     const lastUpdated = this.renderLastExecutionTime()
 
-
     return (
       <ColumnsLayout>
         <Column width="42.5%">
@@ -314,13 +313,12 @@ class MainDetails extends React.Component<Props> {
               {this.props.item && this.props.item.created_at ? this.renderValue(DateUtils.getLocalTime(this.props.item.created_at).format('YYYY-MM-DD HH:mm:ss'), 'created') : <Value>-</Value>}
             </Field>
           </Row>
-          {this.props.item && this.props.item.destination_environment
-            && this.props.item.destination_environment.description
+          {this.props.item && this.props.item.notes
             ? (
               <Row >
                 <Field>
                   <Label>Description</Label>
-                  <CopyMultilineValue value={this.props.item.destination_environment.description} data-test-id="mainDetails-description" />
+                  <CopyMultilineValue value={this.props.item.notes} data-test-id="mainDetails-description" />
                 </Field>
               </Row>
             )

+ 1 - 3
src/components/organisms/MainDetails/test.jsx

@@ -35,10 +35,8 @@ let item = {
   id: 'item-id',
   created_at: new Date(2017, 10, 24, 16, 15),
   instances: ['instance_1'],
-  destination_environment: {
-    description: 'A description',
-  },
   type: 'Replica',
+  notes: 'A description',
 }
 let instancesDetails = [
   {

+ 1 - 1
src/plugins/endpoint/default/OptionsSchemaPlugin.js

@@ -64,7 +64,7 @@ export const defaultFillMigrationImageMapValues = (field: Field, option: Destina
 
 export const defaultGetDestinationEnv = (data: WizardData): any => {
   let env = {}
-  let specialOptions = ['execute_now', 'separate_vm', 'skip_os_morphing', 'default_storage']
+  let specialOptions = ['execute_now', 'separate_vm', 'skip_os_morphing', 'default_storage', 'description']
     .concat(executionOptions.map(o => o.name))
     .concat(migrationImageOsTypes.map(o => `${o}_os_image`))
 

+ 1 - 1
src/sources/WizardSource.js

@@ -34,7 +34,7 @@ class WizardSource {
       network_map: parser.getNetworkMap(data),
       instances: data.selectedInstances ? data.selectedInstances.map(i => i.instance_name) : 'null',
       storage_mappings: parser.getStorageMap(data, storageMap),
-      notes: '',
+      notes: data.options ? data.options.description || '' : '',
     }
 
     if (data.options && data.options.skip_os_morphing != null) {

+ 1 - 1
src/types/MainItem.js

@@ -35,7 +35,6 @@ export type DestinationEnvInfo = {
       destination_network: string,
     } | 'string'
   },
-  description: string,
   [string]: mixed,
 }
 
@@ -43,6 +42,7 @@ export type MainItem = {
   id: string,
   executions: Execution[],
   name: string,
+  notes: string,
   status: string,
   tasks: Task[],
   created_at: Date,