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:
rahulramesha 2024-01-22 17:07:32 +05:30 committed by GitHub
parent be62662bb1
commit b3ac9def8d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
82 changed files with 494 additions and 463 deletions

View file

@ -1,4 +1,5 @@
import { action, computed, makeObservable, observable, runInAction } from "mobx";
import { computedFn } from "mobx-utils";
import set from "lodash/set";
import sortBy from "lodash/sortBy";
// services
@ -64,9 +65,6 @@ export class ProjectMemberStore implements IProjectMemberStore {
projectMemberMap: observable,
// computed
projectMemberIds: computed,
// computed actions
getProjectMemberDetails: action,
getProjectMemberIds: action,
// actions
fetchProjectMembers: action,
bulkAddMembersToProject: action,
@ -101,7 +99,7 @@ export class ProjectMemberStore implements IProjectMemberStore {
* @description get the details of a project member
* @param userId
*/
getProjectMemberDetails = (userId: string) => {
getProjectMemberDetails = computedFn((userId: string) => {
const projectId = this.routerStore.projectId;
if (!projectId) return null;
const projectMember = this.projectMemberMap?.[projectId]?.[userId];
@ -113,13 +111,13 @@ export class ProjectMemberStore implements IProjectMemberStore {
member: this.memberRoot?.memberMap?.[projectMember.member],
};
return memberDetails;
};
});
/**
* @description get the list of all the user ids of all the members of a project using projectId
* @param projectId
*/
getProjectMemberIds = (projectId: string): string[] | null => {
getProjectMemberIds = computedFn((projectId: string): string[] | null => {
if (!this.projectMemberMap?.[projectId]) return null;
let members = Object.values(this.projectMemberMap?.[projectId]);
members = sortBy(members, [
@ -128,7 +126,7 @@ export class ProjectMemberStore implements IProjectMemberStore {
]);
const memberIds = members.map((m) => m.member);
return memberIds;
};
});
/**
* @description fetch the list of all the members of a project