Skip to content

Commit 797869f

Browse files
houhoucoopderekbit
authored andcommitted
fix: add default field (#864)
Signed-off-by: Yi-Ya Chen <[email protected]> (cherry picked from commit f3940f1)
1 parent 735da12 commit 797869f

File tree

4 files changed

+8
-3
lines changed

4 files changed

+8
-3
lines changed

src/routes/host/HostFilter.js

+3-1
Original file line numberDiff line numberDiff line change
@@ -76,9 +76,10 @@ class HostFilter extends React.Component {
7676
}
7777

7878
render() {
79-
const { location, onSearch, stateOption, fieldOption, selectedHostRows } = this.props
79+
const { location, onSearch, stateOption, fieldOption, selectedHostRows, defaultField } = this.props
8080
const searchGroupProps = {
8181
location,
82+
defaultField,
8283
stateOption,
8384
fieldOption,
8485
onSearch: (value) => {
@@ -105,6 +106,7 @@ class HostFilter extends React.Component {
105106
HostFilter.propTypes = {
106107
onSearch: PropTypes.func,
107108
location: PropTypes.object,
109+
defaultField: PropTypes.string,
108110
stateOption: PropTypes.array,
109111
fieldOption: PropTypes.array,
110112
selectedHostRows: PropTypes.array,

src/routes/host/index.js

+3-2
Original file line numberDiff line numberDiff line change
@@ -315,8 +315,9 @@ function Host({ host, volume, setting, loading, dispatch, location }) {
315315
replicaModalDeleteLoading,
316316
}
317317

318-
const HostFilterProps = {
318+
const hostFilterProps = {
319319
location,
320+
defaultField: 'name',
320321
selectedHostRows,
321322
dispatch,
322323
stateOption: [
@@ -357,7 +358,7 @@ function Host({ host, volume, setting, loading, dispatch, location }) {
357358

358359
return (
359360
<div className="content-inner" style={{ display: 'flex', flexDirection: 'column', overflow: 'visible !important' }}>
360-
<HostFilter ref={(component) => { hostFilter = component }} {...HostFilterProps} />
361+
<HostFilter ref={(component) => { hostFilter = component }} {...hostFilterProps} />
361362
<HostList ref={(component) => { hostList = component }} {...hostListProps} />
362363
{modalVisible && <AddDisk {...addDiskModalProps} />}
363364
{replicaModalVisible && <HostReplica {...hostReplicaModalProps} />}

src/routes/instanceManager/index.js

+1
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ class InstanceManager extends React.Component {
6262

6363
const instanceManagerFilterProps = {
6464
location,
65+
defaultField: 'name',
6566
fieldOption: [
6667
{ value: 'name', name: 'Name' },
6768
{ value: 'nodeID', name: 'Node' },

src/routes/volume/index.js

+1
Original file line numberDiff line numberDiff line change
@@ -597,6 +597,7 @@ class Volume extends React.Component {
597597

598598
const volumeFilterProps = {
599599
location,
600+
defaultField: 'name',
600601
stateOption: [
601602
{ value: 'healthy', name: 'Healthy' },
602603
{ value: 'inProgress', name: 'In Progress' },

0 commit comments

Comments
 (0)