+13
-16
@@ -67,13 +67,13 @@ export const EntityLifecyclePicker = () => {
|
||||
: filters.lifecycles?.values ?? [],
|
||||
);
|
||||
|
||||
// Set selected lifecycles on query parameter updates; this happens at initial page load and from
|
||||
// external updates to the page location.
|
||||
useEffect(() => {
|
||||
updateFilters({
|
||||
lifecycles: selectedLifecycles.length
|
||||
? new EntityLifecycleFilter(selectedLifecycles)
|
||||
: undefined,
|
||||
});
|
||||
}, [selectedLifecycles, updateFilters]);
|
||||
if (queryParamLifecycles.length) {
|
||||
setSelectedLifecycles(queryParamLifecycles);
|
||||
}
|
||||
}, [queryParamLifecycles]);
|
||||
|
||||
const availableLifecycles = useMemo(
|
||||
() =>
|
||||
@@ -87,17 +87,14 @@ export const EntityLifecyclePicker = () => {
|
||||
[backendEntities],
|
||||
);
|
||||
|
||||
// Set selected lifecycles on query parameter updates; this happens at initial page load and from
|
||||
// external updates to the page location.
|
||||
useEffect(() => {
|
||||
if (queryParamLifecycles.length && availableLifecycles.length) {
|
||||
setSelectedLifecycles(queryParamLifecycles);
|
||||
}
|
||||
}, [queryParamLifecycles, availableLifecycles]);
|
||||
|
||||
useEffect(() => {
|
||||
if (!availableLifecycles.length) setSelectedLifecycles([]);
|
||||
}, [availableLifecycles]);
|
||||
updateFilters({
|
||||
lifecycles:
|
||||
selectedLifecycles.length && availableLifecycles.length
|
||||
? new EntityLifecycleFilter(selectedLifecycles)
|
||||
: undefined,
|
||||
});
|
||||
}, [selectedLifecycles, updateFilters, availableLifecycles]);
|
||||
|
||||
if (!availableLifecycles.length) return null;
|
||||
|
||||
|
||||
@@ -67,13 +67,13 @@ export const EntityOwnerPicker = () => {
|
||||
queryParamOwners.length ? queryParamOwners : filters.owners?.values ?? [],
|
||||
);
|
||||
|
||||
// Set selected owners on query parameter updates; this happens at initial page load and from
|
||||
// external updates to the page location.
|
||||
useEffect(() => {
|
||||
updateFilters({
|
||||
owners: selectedOwners.length
|
||||
? new EntityOwnerFilter(selectedOwners)
|
||||
: undefined,
|
||||
});
|
||||
}, [selectedOwners, updateFilters]);
|
||||
if (queryParamOwners.length) {
|
||||
setSelectedOwners(queryParamOwners);
|
||||
}
|
||||
}, [queryParamOwners]);
|
||||
|
||||
const availableOwners = useMemo(
|
||||
() =>
|
||||
@@ -91,17 +91,14 @@ export const EntityOwnerPicker = () => {
|
||||
[backendEntities],
|
||||
);
|
||||
|
||||
// Set selected owners on query parameter updates; this happens at initial page load and from
|
||||
// external updates to the page location.
|
||||
useEffect(() => {
|
||||
if (queryParamOwners.length && availableOwners.length) {
|
||||
setSelectedOwners(queryParamOwners);
|
||||
}
|
||||
}, [queryParamOwners, availableOwners]);
|
||||
|
||||
useEffect(() => {
|
||||
if (!availableOwners.length) setSelectedOwners([]);
|
||||
}, [availableOwners]);
|
||||
updateFilters({
|
||||
owners:
|
||||
selectedOwners.length && availableOwners.length
|
||||
? new EntityOwnerFilter(selectedOwners)
|
||||
: undefined,
|
||||
});
|
||||
}, [selectedOwners, updateFilters, availableOwners]);
|
||||
|
||||
if (!availableOwners.length) return null;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user