fix: intake loading (#5966)

* fix: intake loading

* fix: image upload in space
This commit is contained in:
Akshita Goyal 2024-11-08 17:17:15 +05:30 committed by GitHub
parent 1d314dd25f
commit 0cd36b854e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 16 additions and 3 deletions

View file

@ -253,7 +253,7 @@ export class IssueDetailStore implements IIssueDetailStore {
anchor, anchor,
{ {
entity_identifier: commentID ?? "", entity_identifier: commentID ?? "",
entity_type: EFileAssetType.ISSUE_ATTACHMENT, entity_type: EFileAssetType.ISSUE_DESCRIPTION,
}, },
file file
); );

View file

@ -92,7 +92,7 @@ export class InboxIssueService extends APIService {
}); });
} }
async regeneratePublishForm(workspaceSlug: string, projectId: string): Promise<TInboxIssue> { async regeneratePublishForm(workspaceSlug: string, projectId: string): Promise<TInboxForm> {
return this.post(`/api/workspaces/${workspaceSlug}/projects/${projectId}/publish-intake-regenerate/`) return this.post(`/api/workspaces/${workspaceSlug}/projects/${projectId}/publish-intake-regenerate/`)
.then((response) => response?.data) .then((response) => response?.data)
.catch((error) => { .catch((error) => {

View file

@ -351,7 +351,10 @@ export class ProjectInboxStore implements IProjectInboxStore {
const form = await this.inboxIssueService.regeneratePublishForm(workspaceSlug, projectId); const form = await this.inboxIssueService.regeneratePublishForm(workspaceSlug, projectId);
if (form) { if (form) {
runInAction(() => { runInAction(() => {
set(this.intakeForms, projectId, form); set(this.intakeForms, projectId, {
...this.intakeForms[projectId],
anchor: form?.anchor,
});
}); });
} }
} catch { } catch {

View file

@ -13,6 +13,7 @@ import { CoreRootStore } from "../root.store";
export interface IProjectStore { export interface IProjectStore {
// observables // observables
isUpdatingProject: boolean;
loader: boolean; loader: boolean;
projectMap: { projectMap: {
[projectId: string]: TProject; // projectId: project Info [projectId: string]: TProject; // projectId: project Info
@ -47,6 +48,7 @@ export interface IProjectStore {
export class ProjectStore implements IProjectStore { export class ProjectStore implements IProjectStore {
// observables // observables
isUpdatingProject: boolean = false;
loader: boolean = false; loader: boolean = false;
projectMap: { projectMap: {
[projectId: string]: TProject; // projectId: project Info [projectId: string]: TProject; // projectId: project Info
@ -63,6 +65,7 @@ export class ProjectStore implements IProjectStore {
constructor(_rootStore: CoreRootStore) { constructor(_rootStore: CoreRootStore) {
makeObservable(this, { makeObservable(this, {
// observables // observables
isUpdatingProject: observable,
loader: observable.ref, loader: observable.ref,
projectMap: observable, projectMap: observable,
// computed // computed
@ -380,13 +383,20 @@ export class ProjectStore implements IProjectStore {
const projectDetails = this.getProjectById(projectId); const projectDetails = this.getProjectById(projectId);
runInAction(() => { runInAction(() => {
set(this.projectMap, [projectId], { ...projectDetails, ...data }); set(this.projectMap, [projectId], { ...projectDetails, ...data });
this.isUpdatingProject = true;
}); });
const response = await this.projectService.updateProject(workspaceSlug, projectId, data); const response = await this.projectService.updateProject(workspaceSlug, projectId, data);
runInAction(() => {
this.isUpdatingProject = false;
});
return response; return response;
} catch (error) { } catch (error) {
console.log("Failed to create project from project store"); console.log("Failed to create project from project store");
this.fetchProjects(workspaceSlug); this.fetchProjects(workspaceSlug);
this.fetchProjectDetails(workspaceSlug, projectId); this.fetchProjectDetails(workspaceSlug, projectId);
runInAction(() => {
this.isUpdatingProject = false;
});
throw error; throw error;
} }
}; };