mirror of
https://github.com/makeplane/plane
synced 2024-06-14 14:31:34 +00:00
fix state and label types
This commit is contained in:
parent
2bb0a89679
commit
f7586ba046
3
packages/types/src/issues.d.ts
vendored
3
packages/types/src/issues.d.ts
vendored
@ -110,10 +110,9 @@ export type IssuePriorities = {
|
||||
export interface IIssueLabel {
|
||||
id: string;
|
||||
name: string;
|
||||
description: string;
|
||||
color: string;
|
||||
project_id: string;
|
||||
workspace_slug: string;
|
||||
workspace__slug: string;
|
||||
parent: string | null;
|
||||
sort_order: number;
|
||||
}
|
||||
|
11
packages/types/src/state.d.ts
vendored
11
packages/types/src/state.d.ts
vendored
@ -5,20 +5,13 @@ export type TStateGroups = "backlog" | "unstarted" | "started" | "completed" | "
|
||||
export interface IState {
|
||||
readonly id: string;
|
||||
color: string;
|
||||
readonly created_at: Date;
|
||||
readonly created_by: string;
|
||||
default: boolean;
|
||||
description: string;
|
||||
group: TStateGroups;
|
||||
name: string;
|
||||
project: string;
|
||||
readonly project_detail: IProjectLite;
|
||||
project_id: string;
|
||||
sequence: number;
|
||||
readonly slug: string;
|
||||
readonly updated_at: Date;
|
||||
readonly updated_by: string;
|
||||
workspace: string;
|
||||
workspace_detail: IWorkspaceLite;
|
||||
workspace__slug: string;
|
||||
}
|
||||
|
||||
export interface IStateLite {
|
||||
|
@ -58,9 +58,10 @@ export const IssuePropertyLabels: React.FC<IIssuePropertyLabels> = observer((pro
|
||||
const storeLabels = getProjectLabels(projectId);
|
||||
|
||||
const openDropDown = () => {
|
||||
setIsLoading(true);
|
||||
if (!storeLabels && workspaceSlug && projectId)
|
||||
if (!storeLabels && workspaceSlug && projectId) {
|
||||
setIsLoading(true);
|
||||
fetchProjectLabels(workspaceSlug, projectId).then(() => setIsLoading(false));
|
||||
}
|
||||
};
|
||||
|
||||
const { styles, attributes } = usePopper(referenceElement, popperElement, {
|
||||
|
@ -42,7 +42,7 @@ export const DeleteStateModal: React.FC<Props> = observer((props) => {
|
||||
|
||||
setIsDeleteLoading(true);
|
||||
|
||||
await deleteState(workspaceSlug.toString(), data.project, data.id)
|
||||
await deleteState(workspaceSlug.toString(), data.project_id, data.id)
|
||||
.then(() => {
|
||||
postHogEventTracker("STATE_DELETE", {
|
||||
state: "SUCCESS",
|
||||
|
@ -82,7 +82,7 @@ export class LabelStore implements ILabelStore {
|
||||
const currentWorkspaceDetails = this.rootStore.workspaceRoot.currentWorkspace;
|
||||
const worksapceSlug = this.rootStore.app.router.workspaceSlug || "";
|
||||
if (!currentWorkspaceDetails || !this.fetchedMap[worksapceSlug]) return;
|
||||
return Object.values(this.labelMap).filter((label) => label.workspace_slug === currentWorkspaceDetails.slug);
|
||||
return Object.values(this.labelMap).filter((label) => label.workspace__slug === currentWorkspaceDetails.slug);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -78,7 +78,7 @@ export class StateStore implements IStateStore {
|
||||
const projectId = this.router.projectId;
|
||||
const worksapceSlug = this.router.workspaceSlug || "";
|
||||
if (!projectId || !(this.fetchedMap[projectId] || this.fetchedMap[worksapceSlug])) return;
|
||||
return Object.values(this.stateMap).filter((state) => state.project === this.router.query.projectId);
|
||||
return Object.values(this.stateMap).filter((state) => state.project_id === projectId);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -106,7 +106,7 @@ export class StateStore implements IStateStore {
|
||||
getProjectStates = computedFn((projectId: string) => {
|
||||
const worksapceSlug = this.router.workspaceSlug || "";
|
||||
if (!projectId || !(this.fetchedMap[projectId] || this.fetchedMap[worksapceSlug])) return;
|
||||
return Object.values(this.stateMap).filter((state) => state.project === projectId);
|
||||
return Object.values(this.stateMap).filter((state) => state.project_id === projectId);
|
||||
});
|
||||
|
||||
/**
|
||||
@ -208,7 +208,7 @@ export class StateStore implements IStateStore {
|
||||
markStateAsDefault = async (workspaceSlug: string, projectId: string, stateId: string) => {
|
||||
const originalStates = this.stateMap;
|
||||
const currentDefaultState = Object.values(this.stateMap).find(
|
||||
(state) => state.project === projectId && state.default
|
||||
(state) => state.project_id === projectId && state.default
|
||||
);
|
||||
try {
|
||||
runInAction(() => {
|
||||
|
Loading…
Reference in New Issue
Block a user