Fixed bug #1175: DynamicFields imported from OTRS are mandatory and stop input forms from submitting.

This commit is contained in:
Thorsten Eckel 2017-08-23 16:41:01 +02:00
parent f35645e051
commit d6bc129af4
14 changed files with 28 additions and 24 deletions

View file

@ -11,7 +11,7 @@ module Import
true => 'Yes',
false => 'No',
},
null: false,
null: true,
translate: true,
}
)

View file

@ -14,7 +14,7 @@ module Import
future: dynamic_field['Config']['YearsInFuture'] != '0',
past: dynamic_field['Config']['YearsInPast'] != '0',
diff: dynamic_field['Config']['DefaultValue'].to_i / 60 / 60 / 24,
null: false,
null: true,
}
)
end

View file

@ -14,7 +14,7 @@ module Import
future: dynamic_field['Config']['YearsInFuture'] != '0',
past: dynamic_field['Config']['YearsInPast'] != '0',
diff: dynamic_field['Config']['DefaultValue'].to_i / 60 / 60,
null: false,
null: true,
}
)
end

View file

@ -6,11 +6,12 @@ module Import
@attribute_config.merge!(
data_type: 'select',
data_option: {
default: '',
multiple: false,
options: dynamic_field['Config']['PossibleValues'],
null: dynamic_field['Config']['PossibleNone'] == '1',
translate: dynamic_field['Config']['TranslatableValues'] == '1',
default: '',
multiple: false,
options: dynamic_field['Config']['PossibleValues'],
nulloption: dynamic_field['Config']['PossibleNone'] == '1',
null: true,
translate: dynamic_field['Config']['TranslatableValues'] == '1',
}
)
end

View file

@ -6,11 +6,12 @@ module Import
@attribute_config.merge!(
data_type: 'select',
data_option: {
default: '',
multiple: true,
options: dynamic_field['Config']['PossibleValues'],
null: dynamic_field['Config']['PossibleNone'] == '1',
translate: dynamic_field['Config']['TranslatableValues'] == '1',
default: '',
multiple: true,
options: dynamic_field['Config']['PossibleValues'],
nulloption: dynamic_field['Config']['PossibleNone'] == '1',
null: true,
translate: dynamic_field['Config']['TranslatableValues'] == '1',
}
)
end

View file

@ -9,7 +9,7 @@ module Import
default: dynamic_field['Config']['DefaultValue'],
type: 'text',
maxlength: 255,
null: false,
null: true,
}
)
end

View file

@ -8,7 +8,7 @@ module Import
data_option: {
default: dynamic_field['Config']['DefaultValue'],
rows: dynamic_field['Config']['Rows'],
null: false,
null: true,
}
)
end

View file

@ -29,7 +29,7 @@ RSpec.describe Import::OTRS::DynamicField::Checkbox do
true => 'Yes',
false => 'No'
},
null: false,
null: true,
translate: true
}
}

View file

@ -33,7 +33,7 @@ RSpec.describe Import::OTRS::DynamicField::Date do
future: false,
past: false,
diff: 0,
null: false
null: true
}
}

View file

@ -33,7 +33,7 @@ RSpec.describe Import::OTRS::DynamicField::DateTime do
future: true,
past: true,
diff: 72,
null: false
null: true
}
}

View file

@ -32,8 +32,9 @@ RSpec.describe Import::OTRS::DynamicField::Dropdown do
'Köln' => 'Köln',
'Berlin' => 'Berlin'
},
null: true,
translate: false
nulloption: true,
null: true,
translate: false
}
}

View file

@ -32,8 +32,9 @@ RSpec.describe Import::OTRS::DynamicField::Multiselect do
'Köln' => 'Köln',
'Berlin' => 'Berlin'
},
null: false,
translate: false
nulloption: false,
null: true,
translate: false
}
}

View file

@ -26,7 +26,7 @@ RSpec.describe Import::OTRS::DynamicField::TextArea do
data_option: {
default: '',
rows: '20',
null: false
null: true
}
}

View file

@ -27,7 +27,7 @@ RSpec.describe Import::OTRS::DynamicField::Text do
default: '',
type: 'text',
maxlength: 255,
null: false
null: true
}
}