fix: Fix role list and monitor data and others

1. Fix the role list fetch in user manger and system role
2. Fix the state to get the right data of up and down
3. Add rest attribute for better extension functionality in select component
4. Fix create rule error

A recent git update broke our jobs, diskimage-builder was updated to fix

1. This issue but the grenade job doesn't use dib from master (our other
jobs do)
2. This commit ensure that our grenade job pulls dib from the git repo

Change-Id: I2de592a337e769d1604d72b117fd8a44d5777f58
This commit is contained in:
xusongfu 2022-04-15 15:42:09 +08:00
parent d76bd458fc
commit f91454fdcb
11 changed files with 42 additions and 32 deletions

View File

@ -212,6 +212,7 @@
- openstack/requirements
- openstack/skyline-apiserver
- openstack/skyline-console
- opendev.org/openstack/diskimage-builder
timeout: 10800
vars:
devstack_services:

View File

@ -33,12 +33,12 @@ export default class index extends Component {
placeholder,
...componentProps,
};
const { rules, ...rest } = formItemProps;
const { rules, extra, ...rest } = formItemProps;
const newRules = this.getRules(rules);
const newFormItemProps = {
...rest,
rules: newRules,
extra: portRangeMessage,
extra: extra || portRangeMessage,
};
return (
<Form.Item {...newFormItemProps}>

View File

@ -157,6 +157,7 @@ export default class FormItem extends React.Component {
checkOptions,
checkBoxInfo,
allowClear,
...rest
} = this.props;
return {
options,
@ -171,6 +172,7 @@ export default class FormItem extends React.Component {
checkOptions,
checkBoxInfo,
allowClear,
...rest,
};
}
default: {

View File

@ -689,6 +689,7 @@
"Effective mode after configuration changes": "Effective mode after configuration changes",
"Egress": "Egress",
"Egypt": "Egypt",
"Eject": "Eject",
"El Salvador": "El Salvador",
"Email": "Email",
"Enable": "Enable",
@ -1546,6 +1547,7 @@
"Project User": "Project User",
"Project User Group": "Project User Group",
"Projects": "Projects",
"Promote": "Promote",
"Properties": "Properties",
"Protected": "Protected",
"Protocol": "Protocol",

View File

@ -689,6 +689,7 @@
"Effective mode after configuration changes": "配置变更后的生效模式",
"Egress": "出口",
"Egypt": "埃及",
"Eject": "删除",
"El Salvador": "萨尔瓦多",
"Email": "邮箱",
"Enable": "启用",
@ -1546,6 +1547,7 @@
"Project User": "项目用户",
"Project User Group": "项目用户组",
"Projects": "项目",
"Promote": "推动",
"Properties": "属性",
"Protected": "受保护的",
"Protocol": "协议",

View File

@ -25,14 +25,14 @@ export class UserGroupManager extends ModalAction {
static title = t('Manage User Group');
init() {
async init() {
const roles = JSON.stringify(this.item.groups);
this.state.domainDefault = this.item.domain_id;
this.state.groupRoles = JSON.parse(roles);
this.userGroupStore = new GroupStore();
this.store = globalRoleStore;
await this.getRoleList();
this.getUserGroup();
this.getRoleList();
}
get name() {
@ -48,7 +48,11 @@ export class UserGroupManager extends ModalAction {
}
getRoleList() {
this.store.fetchList();
return new Promise((resolve) => {
this.store.fetchList().finally(() => {
resolve();
});
});
}
static get modalSize() {

View File

@ -30,20 +30,20 @@ export class UserManager extends ModalAction {
return t('Manager user');
}
init() {
async init() {
const projectRole = JSON.stringify(this.item.userMapProjectRoles);
this.state.domainDefault = this.item.domain_id;
this.state.userRoles = JSON.parse(projectRole);
this.store = new RoleStore();
this.domainStore = globalDomainStore;
this.userStore = new UserStore();
this.getRoleList();
await this.getRoleList();
this.getDomains();
this.getUser();
}
getRoleList() {
this.store.fetchList();
return this.store.fetchList();
}
getDomains() {

View File

@ -30,20 +30,20 @@ export class SystemRole extends ModalAction {
return t('edit system permission');
}
init() {
async init() {
const systemRole = JSON.stringify(this.item.projectMapSystemRole);
this.state.domainDefault = this.item.domain_id;
this.state.projectRoles = JSON.parse(systemRole);
this.store = new RoleStore();
this.domainStore = globalDomainStore;
this.userStore = globalUserStore;
this.getRoleList();
await this.getRoleList();
this.getDomains();
this.getUser();
}
getRoleList() {
this.store.fetchList();
return this.store.fetchList();
}
getDomains() {

View File

@ -169,7 +169,7 @@ export const physicalNodeRightTopCardList = [
];
const result = get(responses[0], 'data.result', []);
result.forEach((r) => {
const idx = r.metric.adminState === 'enabled' ? 0 : 1;
const idx = r.metric.services_state === 'up' ? 0 : 1;
status[idx].value += parseInt(r.value[1], 10);
});
return status;

View File

@ -159,8 +159,14 @@ export default class Create extends ModalAction {
});
};
handleDirectionChange = (direction) => {
this.setState({
direction,
});
};
get formItems() {
const { protocol, portOrRange, remoteType } = this.state;
const { protocol, portOrRange, remoteType, direction } = this.state;
const isCustomProtocol = protocol === 'custom_protocol';
const isCustomIcmp = protocol === 'custom_icmp';
const showPortType = ['custom_udp', 'custom_tcp'].includes(protocol);
@ -188,6 +194,7 @@ export default class Create extends ModalAction {
{ value: 'ingress', label: t('Ingress') },
{ value: 'egress', label: t('Egress') },
],
onChange: this.handleDirectionChange,
},
{
name: 'ethertype',
@ -212,18 +219,16 @@ export default class Create extends ModalAction {
},
{
name: 'sourcePort',
label: t('Source Port/Port Range'),
label:
direction === 'egress'
? t('Destination Port/Port Range')
: t('Source Port/Port Range'),
type: 'port-range',
required: showSourcePort,
hidden: !showSourcePort || this.state.direction === 'egress',
},
{
name: 'destination_port',
label: t('Destination Port/Port Range'),
type: 'input',
required: showSourcePort,
help: t('Input destination port or port range(example: 80 or 80:160)'),
hidden: !showSourcePort || this.state.direction === 'ingress',
hidden: !showSourcePort,
extra:
direction === 'egress' &&
t('Input destination port or port range(example: 80 or 80:160)'),
},
{
name: 'ipProtocol',
@ -292,8 +297,6 @@ export default class Create extends ModalAction {
const { match: { params: { id } = {} } = {} } = containerProps;
const {
sourcePort,
destination_port,
direction,
protocol,
ipProtocol,
icmpType,
@ -305,10 +308,7 @@ export default class Create extends ModalAction {
const range =
['custom_udp', 'custom_tcp'].includes(protocol) &&
portOrRange === 'range';
const ports =
values.direction === 'ingress'
? sourcePort.split(':')
: destination_port.split(':');
const ports = sourcePort.split(':');
const newProtocol =
protocol !== 'custom_protocol'
? this.defaultRules[protocol].ip_protocol
@ -328,7 +328,6 @@ export default class Create extends ModalAction {
? parseInt(ports[1] || ports[0], 10)
: null,
protocol: newProtocol,
direction,
...rest,
};
if (protocol.includes('all')) {

View File

@ -20,8 +20,8 @@ testFiles:
# identity
- pages/identity/role.spec.js
- pages/identity/domain.spec.js
# - pages/identity/user.spec.js
# - pages/identity/project.spec.js
- pages/identity/user.spec.js
- pages/identity/project.spec.js
- pages/identity/user-group.spec.js
# configuration
- pages/configuration/metadata.spec.js