mirror of
https://github.com/netbox-community/netbox.git
synced 2025-07-14 01:41:22 -06:00
Fixes #3289: Prevent position from being nullified when moving a device to a new rack
This commit is contained in:
parent
a6c41e0be5
commit
ea32853ab3
@ -10,6 +10,7 @@ v2.6.2 (FUTURE)
|
|||||||
|
|
||||||
## Bug Fixes
|
## Bug Fixes
|
||||||
|
|
||||||
|
* [#3289](https://github.com/netbox-community/netbox/issues/3289) - Prevent position from being nullified when moving a device to a new rack
|
||||||
* [#3293](https://github.com/netbox-community/netbox/issues/3293) - Enable filtering device components by multiple device IDs
|
* [#3293](https://github.com/netbox-community/netbox/issues/3293) - Enable filtering device components by multiple device IDs
|
||||||
* [#3315](https://github.com/netbox-community/netbox/issues/3315) - Enable filtering devices/interfaces by multiple MAC addresses
|
* [#3315](https://github.com/netbox-community/netbox/issues/3315) - Enable filtering devices/interfaces by multiple MAC addresses
|
||||||
* [#3317](https://github.com/netbox-community/netbox/issues/3317) - Fix permissions for ConfigContextBulkDeleteView
|
* [#3317](https://github.com/netbox-community/netbox/issues/3317) - Fix permissions for ConfigContextBulkDeleteView
|
||||||
|
@ -1268,7 +1268,7 @@ class DeviceForm(BootstrapMixin, TenancyForm, CustomFieldForm):
|
|||||||
required=False,
|
required=False,
|
||||||
widget=APISelect(
|
widget=APISelect(
|
||||||
api_url='/api/dcim/racks/',
|
api_url='/api/dcim/racks/',
|
||||||
display_field='display_name',
|
display_field='display_name'
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
position = forms.TypedChoiceField(
|
position = forms.TypedChoiceField(
|
||||||
|
@ -183,7 +183,7 @@ $(document).ready(function() {
|
|||||||
// Additional query params
|
// Additional query params
|
||||||
$.each(element.attributes, function(index, attr){
|
$.each(element.attributes, function(index, attr){
|
||||||
if (attr.name.includes("data-additional-query-param-")){
|
if (attr.name.includes("data-additional-query-param-")){
|
||||||
var param_name = attr.name.split("data-additional-query-param-")[1]
|
var param_name = attr.name.split("data-additional-query-param-")[1];
|
||||||
parameters[param_name] = attr.value;
|
parameters[param_name] = attr.value;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@ -194,6 +194,8 @@ $(document).ready(function() {
|
|||||||
|
|
||||||
processResults: function (data) {
|
processResults: function (data) {
|
||||||
var element = this.$element[0];
|
var element = this.$element[0];
|
||||||
|
// Clear any disabled options
|
||||||
|
$(element).children('option').attr('disabled', false);
|
||||||
var results = $.map(data.results, function (obj) {
|
var results = $.map(data.results, function (obj) {
|
||||||
obj.text = obj[element.getAttribute('display-field')] || obj.name;
|
obj.text = obj[element.getAttribute('display-field')] || obj.name;
|
||||||
obj.id = obj[element.getAttribute('value-field')] || obj.id;
|
obj.id = obj[element.getAttribute('value-field')] || obj.id;
|
||||||
@ -207,7 +209,7 @@ $(document).ready(function() {
|
|||||||
|
|
||||||
// Handle the null option, but only add it once
|
// Handle the null option, but only add it once
|
||||||
if (element.getAttribute('data-null-option') && data.previous === null) {
|
if (element.getAttribute('data-null-option') && data.previous === null) {
|
||||||
var null_option = $(element).children()[0]
|
var null_option = $(element).children()[0];
|
||||||
results.unshift({
|
results.unshift({
|
||||||
id: null_option.value,
|
id: null_option.value,
|
||||||
text: null_option.text
|
text: null_option.text
|
||||||
|
Loading…
Reference in New Issue
Block a user