Fix the name of Bare Metal Nodes
When create or edit, fill in name of node, then clear it, creating and editing nodes throws an error Closes-Bug: #1991208 Change-Id: Ia2ad3fb1f9f4a5fa38e59df68386caf5c0c74d3d
This commit is contained in:
@@ -150,7 +150,8 @@ export class Create extends StepAction {
|
|||||||
body[key] = newValue;
|
body[key] = newValue;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
body[key] = values[key];
|
const isEmptyName = key === 'name' && values[key] === '';
|
||||||
|
body[key] = isEmptyName ? null : values[key];
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
body.driver_info = driverInfo;
|
body.driver_info = driverInfo;
|
||||||
@@ -186,8 +187,13 @@ export class Create extends StepAction {
|
|||||||
} else {
|
} else {
|
||||||
const oldValue = originData[key];
|
const oldValue = originData[key];
|
||||||
if (!isEqual(oldValue, value) && (oldValue || value)) {
|
if (!isEqual(oldValue, value) && (oldValue || value)) {
|
||||||
obj.op = 'replace';
|
if (key === 'name' && value === '') {
|
||||||
replaces.push(obj);
|
obj.op = 'remove';
|
||||||
|
dels.push(obj);
|
||||||
|
} else {
|
||||||
|
obj.op = 'replace';
|
||||||
|
replaces.push(obj);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
Reference in New Issue
Block a user