mirror of
https://github.com/ansible/awx.git
synced 2026-01-16 04:10:44 -03:30
rename usePFSelect to useSyncedSelectValue
This commit is contained in:
parent
1cc4e302f9
commit
8850687d1b
@ -1,2 +1,2 @@
|
||||
export { default as TagMultiSelect } from './TagMultiSelect';
|
||||
export { default as usePFSelect } from './usePFSelect';
|
||||
export { default as useSyncedSelectValue } from './useSyncedSelectValue';
|
||||
|
||||
@ -6,7 +6,7 @@ import { useState, useEffect } from 'react';
|
||||
between objects in `value` and the corresponding objects loaded as
|
||||
`options` (based on matched id value).
|
||||
*/
|
||||
export default function usePFSelect(value, onChange) {
|
||||
export default function useSyncedSelectValue(value, onChange) {
|
||||
const [options, setOptions] = useState([]);
|
||||
const [selections, setSelections] = useState([]);
|
||||
|
||||
@ -2,7 +2,7 @@ import React, { useState, useEffect } from 'react';
|
||||
import { func, arrayOf, number, shape, string, oneOfType } from 'prop-types';
|
||||
import { Select, SelectOption, SelectVariant } from '@patternfly/react-core';
|
||||
import { LabelsAPI } from '@api';
|
||||
import usePFSelect from '@components/MultiSelect/usePFSelect';
|
||||
import { useSyncedSelectValue } from '@components/MultiSelect';
|
||||
|
||||
async function loadLabelOptions(setLabels, onError) {
|
||||
let labels;
|
||||
@ -30,7 +30,7 @@ async function loadLabelOptions(setLabels, onError) {
|
||||
}
|
||||
|
||||
function LabelSelect({ value, placeholder, onChange, onError }) {
|
||||
const { selections, onSelect, options, setOptions } = usePFSelect(
|
||||
const { selections, onSelect, options, setOptions } = useSyncedSelectValue(
|
||||
value,
|
||||
onChange
|
||||
);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user