forked from github/plane
fix: issue property dropdown data flow (#3425)
* dev: workspace states and estimates * refactor issue dropdown logic to help work properly with issues on global level * fix: project labels response change * fix label type * change store computed actions to computed functions from mobx-utils * fix: state response change * chore: project and workspace state change * fix state and label types * chore: state and label serializer change * modify state and label types * fix dropdown reset on project id change * fix label sort order --------- Co-authored-by: pablohashescobar <nikhilschacko@gmail.com> Co-authored-by: Rahul R <rahulr@Rahuls-MacBook-Pro.local> Co-authored-by: NarayanBavisetti <narayan3119@gmail.com> Co-authored-by: Rahul R <rahul.ramesha@plane.so>
This commit is contained in:
@@ -158,17 +158,12 @@ export const EstimateDropdown: React.FC<Props> = observer((props) => {
|
||||
const filteredOptions =
|
||||
query === "" ? options : options?.filter((o) => o.query.toLowerCase().includes(query.toLowerCase()));
|
||||
|
||||
// fetch cycles of the project if not already present in the store
|
||||
useEffect(() => {
|
||||
if (!workspaceSlug) return;
|
||||
|
||||
if (!activeEstimate) fetchProjectEstimates(workspaceSlug, projectId);
|
||||
}, [activeEstimate, fetchProjectEstimates, projectId, workspaceSlug]);
|
||||
|
||||
const selectedEstimate = value !== null ? getEstimatePointValue(value) : null;
|
||||
const selectedEstimate = value !== null ? getEstimatePointValue(value, projectId) : null;
|
||||
|
||||
const openDropdown = () => {
|
||||
setIsOpen(true);
|
||||
|
||||
if (!activeEstimate && workspaceSlug) fetchProjectEstimates(workspaceSlug, projectId);
|
||||
if (referenceElement) referenceElement.focus();
|
||||
};
|
||||
const closeDropdown = () => setIsOpen(false);
|
||||
|
||||
@@ -93,14 +93,10 @@ export const ProjectMemberDropdown: React.FC<Props> = observer((props) => {
|
||||
};
|
||||
if (multiple) comboboxProps.multiple = true;
|
||||
|
||||
useEffect(() => {
|
||||
if (!workspaceSlug) return;
|
||||
|
||||
if (!projectMemberIds) fetchProjectMembers(workspaceSlug, projectId);
|
||||
}, [fetchProjectMembers, projectId, projectMemberIds, workspaceSlug]);
|
||||
|
||||
const openDropdown = () => {
|
||||
setIsOpen(true);
|
||||
|
||||
if (!projectMemberIds && workspaceSlug) fetchProjectMembers(workspaceSlug, projectId);
|
||||
if (referenceElement) referenceElement.focus();
|
||||
};
|
||||
const closeDropdown = () => setIsOpen(false);
|
||||
|
||||
@@ -142,17 +142,12 @@ export const StateDropdown: React.FC<Props> = observer((props) => {
|
||||
const filteredOptions =
|
||||
query === "" ? options : options?.filter((o) => o.query.toLowerCase().includes(query.toLowerCase()));
|
||||
|
||||
// fetch states of the project if not already present in the store
|
||||
useEffect(() => {
|
||||
if (!workspaceSlug) return;
|
||||
|
||||
if (!statesList) fetchProjectStates(workspaceSlug, projectId);
|
||||
}, [fetchProjectStates, projectId, statesList, workspaceSlug]);
|
||||
|
||||
const selectedState = getStateById(value);
|
||||
|
||||
const openDropdown = () => {
|
||||
setIsOpen(true);
|
||||
if (!statesList && workspaceSlug) fetchProjectStates(workspaceSlug, projectId);
|
||||
if (referenceElement) referenceElement.focus();
|
||||
};
|
||||
const closeDropdown = () => setIsOpen(false);
|
||||
|
||||
Reference in New Issue
Block a user