mirror of
https://github.com/ansible/awx.git
synced 2026-05-06 17:07:36 -02:30
Add AdvancedSearch propTypes and defaultProps
This commit is contained in:
@@ -1,5 +1,6 @@
|
|||||||
import 'styled-components/macro';
|
import 'styled-components/macro';
|
||||||
import React, { useState } from 'react';
|
import React, { useState } from 'react';
|
||||||
|
import PropTypes from 'prop-types';
|
||||||
import { withI18n } from '@lingui/react';
|
import { withI18n } from '@lingui/react';
|
||||||
import { t } from '@lingui/macro';
|
import { t } from '@lingui/macro';
|
||||||
import {
|
import {
|
||||||
@@ -134,7 +135,7 @@ function AdvancedSearch({
|
|||||||
onCreateOption={setKeySelection}
|
onCreateOption={setKeySelection}
|
||||||
maxHeight="500px"
|
maxHeight="500px"
|
||||||
>
|
>
|
||||||
{allKeys.map((optionKey) => (
|
{allKeys.map(optionKey => (
|
||||||
<SelectOption key={optionKey} value={optionKey}>
|
<SelectOption key={optionKey} value={optionKey}>
|
||||||
{optionKey}
|
{optionKey}
|
||||||
</SelectOption>
|
</SelectOption>
|
||||||
@@ -265,6 +266,15 @@ function AdvancedSearch({
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO: prop types
|
AdvancedSearch.propTypes = {
|
||||||
|
onSearch: PropTypes.func.isRequired,
|
||||||
|
searchableKeys: PropTypes.arrayOf(PropTypes.string),
|
||||||
|
relatedSearchableKeys: PropTypes.arrayOf(PropTypes.string),
|
||||||
|
};
|
||||||
|
|
||||||
|
AdvancedSearch.defaultProps = {
|
||||||
|
searchableKeys: [],
|
||||||
|
relatedSearchableKeys: [],
|
||||||
|
};
|
||||||
|
|
||||||
export default withI18n()(AdvancedSearch);
|
export default withI18n()(AdvancedSearch);
|
||||||
|
|||||||
Reference in New Issue
Block a user