fix a couple of invaild props (#10810)

This commit is contained in:
maoling 2023-07-19 16:27:34 +08:00 committed by GitHub
parent 3b9880a0ed
commit 64774de6e1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 12 additions and 8 deletions

View File

@ -39,7 +39,7 @@ class MainLayout extends React.Component {
getState: PropTypes.func,
functionMode: PropTypes.string,
authEnabled: PropTypes.string,
children: PropTypes.object,
children: PropTypes.array,
getNotice: PropTypes.func,
notice: PropTypes.string,
};
@ -152,7 +152,9 @@ class MainLayout extends React.Component {
</div>
<div className="right-panel next-shell-sub-main">
{authEnabled === 'false' ? (
<Message type="notice"><div dangerouslySetInnerHTML={{ __html: this.props.notice }} /></Message>
<Message type="notice">
<div dangerouslySetInnerHTML={{ __html: this.props.notice }} />
</Message>
) : null}
{this.props.children}
</div>

View File

@ -48,7 +48,7 @@ class PermissionsManagement extends React.Component {
static propTypes = {
locale: PropTypes.object,
permissions: PropTypes.object,
namespaces: PropTypes.object,
namespaces: PropTypes.array,
getPermissions: PropTypes.func,
getNamespaces: PropTypes.func,
};

View File

@ -123,7 +123,7 @@ class UserManagement extends React.Component {
<Form inline>
<Form.Item label={locale.username}>
<Input
value={this.username}
value={this.state.username || ''}
htmlType="text"
placeholder={this.state.defaultFuzzySearch ? locale.defaultFuzzyd : locale.fuzzyd}
style={{ width: 200 }}

View File

@ -29,8 +29,8 @@ class EditInstanceDialog extends React.Component {
serviceName: PropTypes.string,
clusterName: PropTypes.string,
groupName: PropTypes.string,
openLoading: PropTypes.string,
closeLoading: PropTypes.string,
openLoading: PropTypes.func,
closeLoading: PropTypes.func,
getInstanceList: PropTypes.func,
locale: PropTypes.object,
};

View File

@ -162,7 +162,7 @@ class InstanceTable extends React.Component {
cell={(metadata = {}) => {
if (!metadata) return null;
return Object.keys(metadata).map(k => (
<p>
<p key={k}>
{k}={metadata[k]}
</p>
));

View File

@ -111,6 +111,8 @@ class SubscriberList extends React.Component {
render() {
const { locale = {}, subscriberData = {} } = this.props;
const { count = 0, subscribers = [] } = subscriberData;
const subscribersArray = Array.isArray(subscribers) ? subscribers : [];
const {
pubNoData,
subscriberList,
@ -186,7 +188,7 @@ class SubscriberList extends React.Component {
</Row>
<Row style={{ padding: 0 }}>
<Col span="24" style={{ padding: 0 }}>
<Table dataSource={subscribers} locale={{ empty: pubNoData }}>
<Table dataSource={subscribersArray} locale={{ empty: pubNoData }}>
<Column title={locale.serviceName} dataIndex="serviceName" />
<Column title={locale.address} dataIndex="addrStr" />
<Column title={locale.clientVersion} dataIndex="agent" />