Merge "fix: Make port's fixed_ip not required"

This commit is contained in:
Zuul 2021-09-01 04:14:20 +00:00 committed by Gerrit Code Review
commit 125ccd3c6d

View File

@ -116,6 +116,8 @@ export default class CreateAction extends ModalAction {
...rest ...rest
} = values; } = values;
const data = { const data = {
...(fixed_ips && fixed_ips.length > 0
? {
fixed_ips: fixed_ips.map((i) => { fixed_ips: fixed_ips.map((i) => {
const ret = { const ret = {
subnet_id: i.subnet, subnet_id: i.subnet,
@ -125,6 +127,8 @@ export default class CreateAction extends ModalAction {
} }
return ret; return ret;
}), }),
}
: {}),
network_id: network_id.selectedRowKeys[0], network_id: network_id.selectedRowKeys[0],
...rest, ...rest,
}; };
@ -192,11 +196,10 @@ export default class CreateAction extends ModalAction {
{ {
name: 'fixed_ips', name: 'fixed_ips',
label: t('Owned Subnet'), label: t('Owned Subnet'),
// component: <IPDistributer subnets={subnetDetails} />,
type: 'ip-distributer', type: 'ip-distributer',
subnets: subnetDetails, subnets: subnetDetails,
hidden: !network_id, hidden: !network_id,
required: true, // required: true,
}, },
{ {
name: 'ipv6', name: 'ipv6',