Fixed main issue, bad step structure now gets fixed to empty template

This commit is contained in:
Zanz2 2018-02-15 23:28:20 +01:00
parent 95501eb046
commit c963c948a1
2 changed files with 11 additions and 13 deletions

View file

@ -641,7 +641,6 @@ class ProtocolsController < ApplicationController
end end
@json_object = JSON.parse(json_file_contents) @json_object = JSON.parse(json_file_contents)
@json_object['steps'] = step_hash_not_null(@json_object['steps']) @json_object['steps'] = step_hash_not_null(@json_object['steps'])
byebug
@json_object['steps'] = protocols_io_guid_reorder_step_json( @json_object['steps'] = protocols_io_guid_reorder_step_json(
@json_object['steps'] @json_object['steps']
) )
@ -674,7 +673,6 @@ class ProtocolsController < ApplicationController
) )
@db_json['steps'] = {} @db_json['steps'] = {}
@json_object['steps'] = step_hash_not_null(@json_object['steps']) @json_object['steps'] = step_hash_not_null(@json_object['steps'])
byebug
@db_json['steps'] = protocols_io_fill_step( @db_json['steps'] = protocols_io_fill_step(
@json_object, @db_json['steps'] @json_object, @db_json['steps']
) )

View file

@ -177,21 +177,21 @@ module ProtocolsIoHelper
def generate_null_step_skeleton def generate_null_step_skeleton
json_string = [ json_string = [
{ {
"guid": 0, 'guid' => '0',
"previous_guid": nil, 'previous_guid' => nil,
"components": 'components' =>
[ [
{ {
"component_type_id": '1', 'component_type_id' => '1',
"name": 'Description', 'name' => 'Description',
"data": '', 'data' => '',
"data_id": nil 'data_id' => nil
}, },
{ {
"component_type_id": '6', 'component_type_id' => '6',
"name": 'Section', 'name' => 'Section',
"data": 'Step', 'data' => 'Step',
"data_id": '0' 'data_id' => '0'
} }
] ]
} }