chore: linting warning resolved

This commit is contained in:
sriram veeraghanta 2024-09-10 17:29:19 +05:30
parent 8acb60baef
commit 902403a54d
14 changed files with 703 additions and 873 deletions

View file

@ -124,13 +124,7 @@ export class ArchivedIssuesFilter extends IssueFilterHelperStore implements IArc
); );
fetchFilters = async (workspaceSlug: string, projectId: string) => { fetchFilters = async (workspaceSlug: string, projectId: string) => {
try { const _filters = this.handleIssuesLocalFilters.get(EIssuesStoreType.ARCHIVED, workspaceSlug, projectId, undefined);
const _filters = this.handleIssuesLocalFilters.get(
EIssuesStoreType.ARCHIVED,
workspaceSlug,
projectId,
undefined
);
const filters: IIssueFilterOptions = this.computedFilters(_filters?.filters); const filters: IIssueFilterOptions = this.computedFilters(_filters?.filters);
const displayFilters: IIssueDisplayFilterOptions = this.computedDisplayFilters({ const displayFilters: IIssueDisplayFilterOptions = this.computedDisplayFilters({
@ -151,9 +145,6 @@ export class ArchivedIssuesFilter extends IssueFilterHelperStore implements IArc
set(this.filters, [projectId, "displayProperties"], displayProperties); set(this.filters, [projectId, "displayProperties"], displayProperties);
set(this.filters, [projectId, "kanbanFilters"], kanbanFilters); set(this.filters, [projectId, "kanbanFilters"], kanbanFilters);
}); });
} catch (error) {
throw error;
}
}; };
updateFilters = async ( updateFilters = async (

View file

@ -179,7 +179,6 @@ export class ArchivedIssues extends BaseIssuesStore implements IArchivedIssues {
* @returns * @returns
*/ */
restoreIssue = async (workspaceSlug: string, projectId: string, issueId: string) => { restoreIssue = async (workspaceSlug: string, projectId: string, issueId: string) => {
try {
// call API to restore the issue // call API to restore the issue
const response = await this.issueArchiveService.restoreIssue(workspaceSlug, projectId, issueId); const response = await this.issueArchiveService.restoreIssue(workspaceSlug, projectId, issueId);
@ -192,9 +191,6 @@ export class ArchivedIssues extends BaseIssuesStore implements IArchivedIssues {
}); });
return response; return response;
} catch (error) {
throw error;
}
}; };
// Setting them as undefined as they can not performed on Archived issues // Setting them as undefined as they can not performed on Archived issues

View file

@ -127,7 +127,6 @@ export class CycleIssuesFilter extends IssueFilterHelperStore implements ICycleI
); );
fetchFilters = async (workspaceSlug: string, projectId: string, cycleId: string) => { fetchFilters = async (workspaceSlug: string, projectId: string, cycleId: string) => {
try {
const _filters = await this.issueFilterService.fetchCycleIssueFilters(workspaceSlug, projectId, cycleId); const _filters = await this.issueFilterService.fetchCycleIssueFilters(workspaceSlug, projectId, cycleId);
const filters: IIssueFilterOptions = this.computedFilters(_filters?.filters); const filters: IIssueFilterOptions = this.computedFilters(_filters?.filters);
@ -157,9 +156,6 @@ export class CycleIssuesFilter extends IssueFilterHelperStore implements ICycleI
set(this.filters, [cycleId, "displayProperties"], displayProperties); set(this.filters, [cycleId, "displayProperties"], displayProperties);
set(this.filters, [cycleId, "kanbanFilters"], kanbanFilters); set(this.filters, [cycleId, "kanbanFilters"], kanbanFilters);
}); });
} catch (error) {
throw error;
}
}; };
updateFilters = async ( updateFilters = async (

View file

@ -273,14 +273,9 @@ export class CycleIssues extends BaseIssuesStore implements ICycleIssues {
* @returns * @returns
*/ */
override createIssue = async (workspaceSlug: string, projectId: string, data: Partial<TIssue>, cycleId: string) => { override createIssue = async (workspaceSlug: string, projectId: string, data: Partial<TIssue>, cycleId: string) => {
try {
const response = await super.createIssue(workspaceSlug, projectId, data, cycleId, false); const response = await super.createIssue(workspaceSlug, projectId, data, cycleId, false);
await this.addIssueToCycle(workspaceSlug, projectId, cycleId, [response.id], false); await this.addIssueToCycle(workspaceSlug, projectId, cycleId, [response.id], false);
return response; return response;
} catch (error) {
throw error;
}
}; };
/** /**
@ -299,7 +294,6 @@ export class CycleIssues extends BaseIssuesStore implements ICycleIssues {
new_cycle_id: string; new_cycle_id: string;
} }
) => { ) => {
try {
// call API call to transfer issues // call API call to transfer issues
const response = await this.cycleService.transferIssues( const response = await this.cycleService.transferIssues(
workspaceSlug as string, workspaceSlug as string,
@ -310,11 +304,7 @@ export class CycleIssues extends BaseIssuesStore implements ICycleIssues {
// call fetch issues // call fetch issues
this.paginationOptions && this.paginationOptions &&
(await this.fetchIssues(workspaceSlug, projectId, "mutation", this.paginationOptions, cycleId)); (await this.fetchIssues(workspaceSlug, projectId, "mutation", this.paginationOptions, cycleId));
return response; return response;
} catch (error) {
throw error;
}
}; };
/** /**
@ -327,7 +317,6 @@ export class CycleIssues extends BaseIssuesStore implements ICycleIssues {
* @returns * @returns
*/ */
fetchActiveCycleIssues = async (workspaceSlug: string, projectId: string, perPageCount: number, cycleId: string) => { fetchActiveCycleIssues = async (workspaceSlug: string, projectId: string, perPageCount: number, cycleId: string) => {
try {
// set loader // set loader
set(this.activeCycleIds, [cycleId], undefined); set(this.activeCycleIds, [cycleId], undefined);
@ -353,9 +342,6 @@ export class CycleIssues extends BaseIssuesStore implements ICycleIssues {
}); });
return response; return response;
} catch (error) {
throw error;
}
}; };
/** /**
@ -367,7 +353,6 @@ export class CycleIssues extends BaseIssuesStore implements ICycleIssues {
* @returns * @returns
*/ */
fetchNextActiveCycleIssues = async (workspaceSlug: string, projectId: string, cycleId: string) => { fetchNextActiveCycleIssues = async (workspaceSlug: string, projectId: string, cycleId: string) => {
try {
//get the previous pagination data for the cycle id //get the previous pagination data for the cycle id
const activeCycle = get(this.activeCycleIds, [cycleId]); const activeCycle = get(this.activeCycleIds, [cycleId]);
@ -397,9 +382,6 @@ export class CycleIssues extends BaseIssuesStore implements ICycleIssues {
); );
return response; return response;
} catch (error) {
throw error;
}
}; };
/** /**
@ -411,7 +393,6 @@ export class CycleIssues extends BaseIssuesStore implements ICycleIssues {
* @returns * @returns
*/ */
quickAddIssue = async (workspaceSlug: string, projectId: string, data: TIssue, cycleId: string) => { quickAddIssue = async (workspaceSlug: string, projectId: string, data: TIssue, cycleId: string) => {
try {
// add temporary issue to store list // add temporary issue to store list
this.addIssue(data); this.addIssue(data);
@ -432,9 +413,6 @@ export class CycleIssues extends BaseIssuesStore implements ICycleIssues {
} }
return response; return response;
} catch (error) {
throw error;
}
}; };
// Using aliased names as they cannot be overridden in other stores // Using aliased names as they cannot be overridden in other stores

View file

@ -124,7 +124,6 @@ export class DraftIssuesFilter extends IssueFilterHelperStore implements IDraftI
); );
fetchFilters = async (workspaceSlug: string, projectId: string) => { fetchFilters = async (workspaceSlug: string, projectId: string) => {
try {
const _filters = this.handleIssuesLocalFilters.get(EIssuesStoreType.DRAFT, workspaceSlug, projectId, undefined); const _filters = this.handleIssuesLocalFilters.get(EIssuesStoreType.DRAFT, workspaceSlug, projectId, undefined);
const filters: IIssueFilterOptions = this.computedFilters(_filters?.filters); const filters: IIssueFilterOptions = this.computedFilters(_filters?.filters);
@ -143,9 +142,6 @@ export class DraftIssuesFilter extends IssueFilterHelperStore implements IDraftI
set(this.filters, [projectId, "displayProperties"], displayProperties); set(this.filters, [projectId, "displayProperties"], displayProperties);
set(this.filters, [projectId, "kanbanFilters"], kanbanFilters); set(this.filters, [projectId, "kanbanFilters"], kanbanFilters);
}); });
} catch (error) {
throw error;
}
}; };
updateFilters = async ( updateFilters = async (

View file

@ -517,7 +517,6 @@ export abstract class BaseIssuesStore implements IBaseIssuesStore {
id?: string, id?: string,
shouldUpdateList = true shouldUpdateList = true
) { ) {
try {
// perform an API call // perform an API call
const response = await this.issueService.createIssue(workspaceSlug, projectId, data); const response = await this.issueService.createIssue(workspaceSlug, projectId, data);
@ -528,9 +527,6 @@ export abstract class BaseIssuesStore implements IBaseIssuesStore {
shouldUpdateList && (await this.fetchParentStats(workspaceSlug, projectId)); shouldUpdateList && (await this.fetchParentStats(workspaceSlug, projectId));
return response; return response;
} catch (error) {
throw error;
}
} }
/** /**
@ -586,20 +582,13 @@ export abstract class BaseIssuesStore implements IBaseIssuesStore {
* @returns * @returns
*/ */
async createDraftIssue(workspaceSlug: string, projectId: string, data: Partial<TIssue>) { async createDraftIssue(workspaceSlug: string, projectId: string, data: Partial<TIssue>) {
try {
// call API to create a Draft issue // call API to create a Draft issue
const response = await this.issueDraftService.createDraftIssue(workspaceSlug, projectId, data); const response = await this.issueDraftService.createDraftIssue(workspaceSlug, projectId, data);
// call Fetch parent stats // call Fetch parent stats
this.fetchParentStats(workspaceSlug, projectId); this.fetchParentStats(workspaceSlug, projectId);
// Add issue to store // Add issue to store
this.addIssue(response); this.addIssue(response);
return response; return response;
} catch (error) {
throw error;
}
} }
/** /**
@ -640,29 +629,20 @@ export abstract class BaseIssuesStore implements IBaseIssuesStore {
* @param issueId * @param issueId
*/ */
async removeIssue(workspaceSlug: string, projectId: string, issueId: string) { async removeIssue(workspaceSlug: string, projectId: string, issueId: string) {
try {
// Store Before state of the issue // Store Before state of the issue
const issueBeforeRemoval = clone(this.rootIssueStore.issues.getIssueById(issueId)); const issueBeforeRemoval = clone(this.rootIssueStore.issues.getIssueById(issueId));
// update parent stats optimistically // update parent stats optimistically
this.updateParentStats(issueBeforeRemoval, undefined); this.updateParentStats(issueBeforeRemoval, undefined);
// Male API call // Male API call
await this.issueService.deleteIssue(workspaceSlug, projectId, issueId); await this.issueService.deleteIssue(workspaceSlug, projectId, issueId);
// Remove from Respective issue Id list // Remove from Respective issue Id list
runInAction(() => { runInAction(() => {
this.removeIssueFromList(issueId); this.removeIssueFromList(issueId);
}); });
// call fetch Parent stats // call fetch Parent stats
this.fetchParentStats(workspaceSlug, projectId); this.fetchParentStats(workspaceSlug, projectId);
// Remove issue from main issue Map store // Remove issue from main issue Map store
this.rootIssueStore.issues.removeIssue(issueId); this.rootIssueStore.issues.removeIssue(issueId);
} catch (error) {
throw error;
}
} }
/** /**
@ -672,18 +652,13 @@ export abstract class BaseIssuesStore implements IBaseIssuesStore {
* @param issueId * @param issueId
*/ */
async issueArchive(workspaceSlug: string, projectId: string, issueId: string) { async issueArchive(workspaceSlug: string, projectId: string, issueId: string) {
try {
const issueBeforeArchive = clone(this.rootIssueStore.issues.getIssueById(issueId)); const issueBeforeArchive = clone(this.rootIssueStore.issues.getIssueById(issueId));
// update parent stats optimistically // update parent stats optimistically
this.updateParentStats(issueBeforeArchive, undefined); this.updateParentStats(issueBeforeArchive, undefined);
// Male API call // Male API call
const response = await this.issueArchiveService.archiveIssue(workspaceSlug, projectId, issueId); const response = await this.issueArchiveService.archiveIssue(workspaceSlug, projectId, issueId);
// call fetch Parent stats // call fetch Parent stats
this.fetchParentStats(workspaceSlug, projectId); this.fetchParentStats(workspaceSlug, projectId);
runInAction(() => { runInAction(() => {
// Update the Archived at of the issue from store // Update the Archived at of the issue from store
this.rootIssueStore.issues.updateIssue(issueId, { this.rootIssueStore.issues.updateIssue(issueId, {
@ -692,9 +667,6 @@ export abstract class BaseIssuesStore implements IBaseIssuesStore {
// Since Archived remove the issue Id from the current store // Since Archived remove the issue Id from the current store
this.removeIssueFromList(issueId); this.removeIssueFromList(issueId);
}); });
} catch (error) {
throw error;
}
} }
/** /**
@ -705,22 +677,17 @@ export abstract class BaseIssuesStore implements IBaseIssuesStore {
* @returns * @returns
*/ */
async issueQuickAdd(workspaceSlug: string, projectId: string, data: TIssue) { async issueQuickAdd(workspaceSlug: string, projectId: string, data: TIssue) {
try {
// Add issue to store with a temporary Id // Add issue to store with a temporary Id
this.addIssue(data); this.addIssue(data);
// call Create issue method // call Create issue method
const response = await this.createIssue(workspaceSlug, projectId, data); const response = await this.createIssue(workspaceSlug, projectId, data);
runInAction(() => { runInAction(() => {
this.removeIssueFromList(data.id); this.removeIssueFromList(data.id);
this.rootIssueStore.issues.removeIssue(data.id); this.rootIssueStore.issues.removeIssue(data.id);
}); });
const currentCycleId = data.cycle_id !== "" && data.cycle_id === "None" ? undefined : data.cycle_id; const currentCycleId = data.cycle_id !== "" && data.cycle_id === "None" ? undefined : data.cycle_id;
const currentModuleIds = const currentModuleIds =
data.module_ids && data.module_ids.length > 0 ? data.module_ids.filter((moduleId) => moduleId != "None") : []; data.module_ids && data.module_ids.length > 0 ? data.module_ids.filter((moduleId) => moduleId != "None") : [];
const promiseRequests = []; const promiseRequests = [];
if (currentCycleId) { if (currentCycleId) {
promiseRequests.push(this.addCycleToIssue(workspaceSlug, projectId, currentCycleId, response.id)); promiseRequests.push(this.addCycleToIssue(workspaceSlug, projectId, currentCycleId, response.id));
@ -728,15 +695,10 @@ export abstract class BaseIssuesStore implements IBaseIssuesStore {
if (currentModuleIds.length > 0) { if (currentModuleIds.length > 0) {
promiseRequests.push(this.changeModulesInIssue(workspaceSlug, projectId, response.id, currentModuleIds, [])); promiseRequests.push(this.changeModulesInIssue(workspaceSlug, projectId, response.id, currentModuleIds, []));
} }
if (promiseRequests && promiseRequests.length > 0) { if (promiseRequests && promiseRequests.length > 0) {
await Promise.all(promiseRequests); await Promise.all(promiseRequests);
} }
return response; return response;
} catch (error) {
throw error;
}
} }
/** /**
@ -747,13 +709,10 @@ export abstract class BaseIssuesStore implements IBaseIssuesStore {
* @returns * @returns
*/ */
async removeBulkIssues(workspaceSlug: string, projectId: string, issueIds: string[]) { async removeBulkIssues(workspaceSlug: string, projectId: string, issueIds: string[]) {
try {
// Make API call to bulk delete issues // Make API call to bulk delete issues
const response = await this.issueService.bulkDeleteIssues(workspaceSlug, projectId, { issue_ids: issueIds }); const response = await this.issueService.bulkDeleteIssues(workspaceSlug, projectId, { issue_ids: issueIds });
// call fetch parent stats // call fetch parent stats
this.fetchParentStats(workspaceSlug, projectId); this.fetchParentStats(workspaceSlug, projectId);
// Remove issues from the store // Remove issues from the store
runInAction(() => { runInAction(() => {
issueIds.forEach((issueId) => { issueIds.forEach((issueId) => {
@ -762,9 +721,6 @@ export abstract class BaseIssuesStore implements IBaseIssuesStore {
}); });
}); });
return response; return response;
} catch (error) {
throw error;
}
} }
/** /**
@ -774,7 +730,6 @@ export abstract class BaseIssuesStore implements IBaseIssuesStore {
* @param issueIds * @param issueIds
*/ */
bulkArchiveIssues = async (workspaceSlug: string, projectId: string, issueIds: string[]) => { bulkArchiveIssues = async (workspaceSlug: string, projectId: string, issueIds: string[]) => {
try {
const response = await this.issueService.bulkArchiveIssues(workspaceSlug, projectId, { issue_ids: issueIds }); const response = await this.issueService.bulkArchiveIssues(workspaceSlug, projectId, { issue_ids: issueIds });
runInAction(() => { runInAction(() => {
@ -791,9 +746,6 @@ export abstract class BaseIssuesStore implements IBaseIssuesStore {
this.removeIssueFromList(issueId); this.removeIssueFromList(issueId);
}); });
}); });
} catch (error) {
throw error;
}
}; };
/** /**
@ -802,7 +754,6 @@ export abstract class BaseIssuesStore implements IBaseIssuesStore {
*/ */
bulkUpdateProperties = async (workspaceSlug: string, projectId: string, data: TBulkOperationsPayload) => { bulkUpdateProperties = async (workspaceSlug: string, projectId: string, data: TBulkOperationsPayload) => {
const issueIds = data.issue_ids; const issueIds = data.issue_ids;
try {
// make request to update issue properties // make request to update issue properties
await this.issueService.bulkOperations(workspaceSlug, projectId, data); await this.issueService.bulkOperations(workspaceSlug, projectId, data);
// update issues in the store // update issues in the store
@ -833,9 +784,6 @@ export abstract class BaseIssuesStore implements IBaseIssuesStore {
this.updateIssueList(issueDetails, issueBeforeUpdate); this.updateIssueList(issueDetails, issueBeforeUpdate);
}); });
}); });
} catch (error) {
throw error;
}
}; };
/** /**
@ -853,7 +801,6 @@ export abstract class BaseIssuesStore implements IBaseIssuesStore {
issueIds: string[], issueIds: string[],
fetchAddedIssues = true fetchAddedIssues = true
) { ) {
try {
// Perform an APi call to add issue to cycle // Perform an APi call to add issue to cycle
await this.issueService.addIssueToCycle(workspaceSlug, projectId, cycleId, { await this.issueService.addIssueToCycle(workspaceSlug, projectId, cycleId, {
issues: issueIds, issues: issueIds,
@ -877,9 +824,6 @@ export abstract class BaseIssuesStore implements IBaseIssuesStore {
issueIds.forEach((issueId) => { issueIds.forEach((issueId) => {
this.issueUpdate(workspaceSlug, projectId, issueId, { cycle_id: cycleId }, false); this.issueUpdate(workspaceSlug, projectId, issueId, { cycle_id: cycleId }, false);
}); });
} catch (error) {
throw error;
}
} }
/** /**
@ -890,7 +834,6 @@ export abstract class BaseIssuesStore implements IBaseIssuesStore {
* @param issueId * @param issueId
*/ */
async removeIssueFromCycle(workspaceSlug: string, projectId: string, cycleId: string, issueId: string) { async removeIssueFromCycle(workspaceSlug: string, projectId: string, cycleId: string, issueId: string) {
try {
const issueBeforeRemoval = clone(this.rootIssueStore.issues.getIssueById(issueId)); const issueBeforeRemoval = clone(this.rootIssueStore.issues.getIssueById(issueId));
// update parent stats optimistically // update parent stats optimistically
@ -909,9 +852,6 @@ export abstract class BaseIssuesStore implements IBaseIssuesStore {
// update Issue cycle Id to null by calling current store's update Issue, without making an API call // update Issue cycle Id to null by calling current store's update Issue, without making an API call
this.issueUpdate(workspaceSlug, projectId, issueId, { cycle_id: null }, false); this.issueUpdate(workspaceSlug, projectId, issueId, { cycle_id: null }, false);
} catch (error) {
throw error;
}
} }
/** /**
@ -1024,7 +964,6 @@ export abstract class BaseIssuesStore implements IBaseIssuesStore {
issueIds: string[], issueIds: string[],
fetchAddedIssues = true fetchAddedIssues = true
) { ) {
try {
// Perform an APi call to add issue to module // Perform an APi call to add issue to module
await this.moduleService.addIssuesToModule(workspaceSlug, projectId, moduleId, { await this.moduleService.addIssuesToModule(workspaceSlug, projectId, moduleId, {
issues: issueIds, issues: issueIds,
@ -1047,9 +986,6 @@ export abstract class BaseIssuesStore implements IBaseIssuesStore {
const updatedIssueModuleIds = uniq(concat(issueModuleIds, [moduleId])); const updatedIssueModuleIds = uniq(concat(issueModuleIds, [moduleId]));
this.issueUpdate(workspaceSlug, projectId, issueId, { module_ids: updatedIssueModuleIds }, false); this.issueUpdate(workspaceSlug, projectId, issueId, { module_ids: updatedIssueModuleIds }, false);
}); });
} catch (error) {
throw error;
}
} }
/** /**
@ -1061,14 +997,8 @@ export abstract class BaseIssuesStore implements IBaseIssuesStore {
* @returns * @returns
*/ */
async removeIssuesFromModule(workspaceSlug: string, projectId: string, moduleId: string, issueIds: string[]) { async removeIssuesFromModule(workspaceSlug: string, projectId: string, moduleId: string, issueIds: string[]) {
try {
// Perform an APi call to remove issue to module // Perform an APi call to remove issue to module
const response = await this.moduleService.removeIssuesFromModuleBulk( const response = await this.moduleService.removeIssuesFromModuleBulk(workspaceSlug, projectId, moduleId, issueIds);
workspaceSlug,
projectId,
moduleId,
issueIds
);
// if module Id is the current Module Id then call fetch parent stats // if module Id is the current Module Id then call fetch parent stats
if (this.moduleId === moduleId) this.fetchParentStats(workspaceSlug, projectId); if (this.moduleId === moduleId) this.fetchParentStats(workspaceSlug, projectId);
@ -1088,9 +1018,6 @@ export abstract class BaseIssuesStore implements IBaseIssuesStore {
}); });
return response; return response;
} catch (error) {
throw error;
}
} }
/* /*
@ -1103,7 +1030,6 @@ export abstract class BaseIssuesStore implements IBaseIssuesStore {
async addModulesToIssue(workspaceSlug: string, projectId: string, issueId: string, moduleIds: string[]) { async addModulesToIssue(workspaceSlug: string, projectId: string, issueId: string, moduleIds: string[]) {
// keep a copy of the original module ids // keep a copy of the original module ids
const originalModuleIds = get(this.rootIssueStore.issues.issuesMap, [issueId, "module_ids"]) ?? []; const originalModuleIds = get(this.rootIssueStore.issues.issuesMap, [issueId, "module_ids"]) ?? [];
try {
//Perform API call //Perform API call
await this.moduleService.addModulesToIssue(workspaceSlug, projectId, issueId, { await this.moduleService.addModulesToIssue(workspaceSlug, projectId, issueId, {
modules: moduleIds, modules: moduleIds,
@ -1125,9 +1051,6 @@ export abstract class BaseIssuesStore implements IBaseIssuesStore {
if (moduleIds.includes(this.moduleId ?? "")) { if (moduleIds.includes(this.moduleId ?? "")) {
this.fetchParentStats(workspaceSlug, projectId, this.moduleId); this.fetchParentStats(workspaceSlug, projectId, this.moduleId);
} }
} catch (error) {
throw error;
}
} }
/* /*

View file

@ -99,19 +99,12 @@ export class IssueAttachmentStore implements IIssueAttachmentStore {
}; };
fetchAttachments = async (workspaceSlug: string, projectId: string, issueId: string) => { fetchAttachments = async (workspaceSlug: string, projectId: string, issueId: string) => {
try {
const response = await this.issueAttachmentService.getIssueAttachment(workspaceSlug, projectId, issueId); const response = await this.issueAttachmentService.getIssueAttachment(workspaceSlug, projectId, issueId);
this.addAttachments(issueId, response); this.addAttachments(issueId, response);
return response; return response;
} catch (error) {
throw error;
}
}; };
createAttachment = async (workspaceSlug: string, projectId: string, issueId: string, data: FormData) => { createAttachment = async (workspaceSlug: string, projectId: string, issueId: string, data: FormData) => {
try {
const response = await this.issueAttachmentService.uploadIssueAttachment(workspaceSlug, projectId, issueId, data); const response = await this.issueAttachmentService.uploadIssueAttachment(workspaceSlug, projectId, issueId, data);
const issueAttachmentsCount = this.getAttachmentsByIssueId(issueId)?.length ?? 0; const issueAttachmentsCount = this.getAttachmentsByIssueId(issueId)?.length ?? 0;
@ -126,13 +119,9 @@ export class IssueAttachmentStore implements IIssueAttachmentStore {
} }
return response; return response;
} catch (error) {
throw error;
}
}; };
removeAttachment = async (workspaceSlug: string, projectId: string, issueId: string, attachmentId: string) => { removeAttachment = async (workspaceSlug: string, projectId: string, issueId: string, attachmentId: string) => {
try {
const response = await this.issueAttachmentService.deleteIssueAttachment( const response = await this.issueAttachmentService.deleteIssueAttachment(
workspaceSlug, workspaceSlug,
projectId, projectId,
@ -153,8 +142,5 @@ export class IssueAttachmentStore implements IIssueAttachmentStore {
}); });
return response; return response;
} catch (error) {
throw error;
}
}; };
} }

View file

@ -90,7 +90,6 @@ export class IssueCommentStore implements IIssueCommentStore {
issueId: string, issueId: string,
loaderType: TCommentLoader = "fetch" loaderType: TCommentLoader = "fetch"
) => { ) => {
try {
this.loader = loaderType; this.loader = loaderType;
let props = {}; let props = {};
@ -116,13 +115,9 @@ export class IssueCommentStore implements IIssueCommentStore {
}); });
return comments; return comments;
} catch (error) {
throw error;
}
}; };
createComment = async (workspaceSlug: string, projectId: string, issueId: string, data: Partial<TIssueComment>) => { createComment = async (workspaceSlug: string, projectId: string, issueId: string, data: Partial<TIssueComment>) => {
try {
const response = await this.issueCommentService.createIssueComment(workspaceSlug, projectId, issueId, data); const response = await this.issueCommentService.createIssueComment(workspaceSlug, projectId, issueId, data);
runInAction(() => { runInAction(() => {
@ -134,9 +129,6 @@ export class IssueCommentStore implements IIssueCommentStore {
}); });
return response; return response;
} catch (error) {
throw error;
}
}; };
updateComment = async ( updateComment = async (
@ -169,7 +161,6 @@ export class IssueCommentStore implements IIssueCommentStore {
}; };
removeComment = async (workspaceSlug: string, projectId: string, issueId: string, commentId: string) => { removeComment = async (workspaceSlug: string, projectId: string, issueId: string, commentId: string) => {
try {
const response = await this.issueCommentService.deleteIssueComment(workspaceSlug, projectId, issueId, commentId); const response = await this.issueCommentService.deleteIssueComment(workspaceSlug, projectId, issueId, commentId);
runInAction(() => { runInAction(() => {
@ -178,8 +169,5 @@ export class IssueCommentStore implements IIssueCommentStore {
}); });
return response; return response;
} catch (error) {
throw error;
}
}; };
} }

View file

@ -92,17 +92,12 @@ export class IssueLinkStore implements IIssueLinkStore {
}; };
fetchLinks = async (workspaceSlug: string, projectId: string, issueId: string) => { fetchLinks = async (workspaceSlug: string, projectId: string, issueId: string) => {
try {
const response = await this.issueService.fetchIssueLinks(workspaceSlug, projectId, issueId); const response = await this.issueService.fetchIssueLinks(workspaceSlug, projectId, issueId);
this.addLinks(issueId, response); this.addLinks(issueId, response);
return response; return response;
} catch (error) {
throw error;
}
}; };
createLink = async (workspaceSlug: string, projectId: string, issueId: string, data: Partial<TIssueLink>) => { createLink = async (workspaceSlug: string, projectId: string, issueId: string, data: Partial<TIssueLink>) => {
try {
const response = await this.issueService.createIssueLink(workspaceSlug, projectId, issueId, data); const response = await this.issueService.createIssueLink(workspaceSlug, projectId, issueId, data);
const issueLinkCount = this.getLinksByIssueId(issueId)?.length ?? 0; const issueLinkCount = this.getLinksByIssueId(issueId)?.length ?? 0;
runInAction(() => { runInAction(() => {
@ -112,13 +107,9 @@ export class IssueLinkStore implements IIssueLinkStore {
link_count: issueLinkCount + 1, // increment link count link_count: issueLinkCount + 1, // increment link count
}); });
}); });
// fetching activity // fetching activity
this.rootIssueDetailStore.activity.fetchActivities(workspaceSlug, projectId, issueId); this.rootIssueDetailStore.activity.fetchActivities(workspaceSlug, projectId, issueId);
return response; return response;
} catch (error) {
throw error;
}
}; };
updateLink = async ( updateLink = async (
@ -128,7 +119,6 @@ export class IssueLinkStore implements IIssueLinkStore {
linkId: string, linkId: string,
data: Partial<TIssueLink> data: Partial<TIssueLink>
) => { ) => {
try {
runInAction(() => { runInAction(() => {
Object.keys(data).forEach((key) => { Object.keys(data).forEach((key) => {
set(this.linkMap, [linkId, key], data[key as keyof TIssueLink]); set(this.linkMap, [linkId, key], data[key as keyof TIssueLink]);
@ -140,14 +130,9 @@ export class IssueLinkStore implements IIssueLinkStore {
// fetching activity // fetching activity
this.rootIssueDetailStore.activity.fetchActivities(workspaceSlug, projectId, issueId); this.rootIssueDetailStore.activity.fetchActivities(workspaceSlug, projectId, issueId);
return response; return response;
} catch (error) {
// TODO: fetch issue detail
throw error;
}
}; };
removeLink = async (workspaceSlug: string, projectId: string, issueId: string, linkId: string) => { removeLink = async (workspaceSlug: string, projectId: string, issueId: string, linkId: string) => {
try {
const issueLinkCount = this.getLinksByIssueId(issueId)?.length ?? 0; const issueLinkCount = this.getLinksByIssueId(issueId)?.length ?? 0;
await this.issueService.deleteIssueLink(workspaceSlug, projectId, issueId, linkId); await this.issueService.deleteIssueLink(workspaceSlug, projectId, issueId, linkId);
@ -163,8 +148,5 @@ export class IssueLinkStore implements IIssueLinkStore {
// fetching activity // fetching activity
this.rootIssueDetailStore.activity.fetchActivities(workspaceSlug, projectId, issueId); this.rootIssueDetailStore.activity.fetchActivities(workspaceSlug, projectId, issueId);
} catch (error) {
throw error;
}
}; };
} }

View file

@ -109,19 +109,12 @@ export class IssueReactionStore implements IIssueReactionStore {
// actions // actions
fetchReactions = async (workspaceSlug: string, projectId: string, issueId: string) => { fetchReactions = async (workspaceSlug: string, projectId: string, issueId: string) => {
try {
const response = await this.issueReactionService.listIssueReactions(workspaceSlug, projectId, issueId); const response = await this.issueReactionService.listIssueReactions(workspaceSlug, projectId, issueId);
this.addReactions(issueId, response); this.addReactions(issueId, response);
return response; return response;
} catch (error) {
throw error;
}
}; };
createReaction = async (workspaceSlug: string, projectId: string, issueId: string, reaction: string) => { createReaction = async (workspaceSlug: string, projectId: string, issueId: string, reaction: string) => {
try {
const response = await this.issueReactionService.createIssueReaction(workspaceSlug, projectId, issueId, { const response = await this.issueReactionService.createIssueReaction(workspaceSlug, projectId, issueId, {
reaction, reaction,
}); });
@ -137,9 +130,6 @@ export class IssueReactionStore implements IIssueReactionStore {
// fetching activity // fetching activity
this.rootIssueDetailStore.activity.fetchActivities(workspaceSlug, projectId, issueId); this.rootIssueDetailStore.activity.fetchActivities(workspaceSlug, projectId, issueId);
return response; return response;
} catch (error) {
throw error;
}
}; };
removeReaction = async ( removeReaction = async (
@ -149,7 +139,6 @@ export class IssueReactionStore implements IIssueReactionStore {
reaction: string, reaction: string,
userId: string userId: string
) => { ) => {
try {
const userReactions = this.reactionsByUser(issueId, userId); const userReactions = this.reactionsByUser(issueId, userId);
const currentReaction = find(userReactions, { actor: userId, reaction: reaction }); const currentReaction = find(userReactions, { actor: userId, reaction: reaction });
@ -165,8 +154,5 @@ export class IssueReactionStore implements IIssueReactionStore {
// fetching activity // fetching activity
this.rootIssueDetailStore.activity.fetchActivities(workspaceSlug, projectId, issueId); this.rootIssueDetailStore.activity.fetchActivities(workspaceSlug, projectId, issueId);
return response; return response;
} catch (error) {
throw error;
}
}; };
} }

View file

@ -113,13 +113,10 @@ export class IssueSubIssuesStore implements IIssueSubIssuesStore {
}; };
fetchSubIssues = async (workspaceSlug: string, projectId: string, parentIssueId: string) => { fetchSubIssues = async (workspaceSlug: string, projectId: string, parentIssueId: string) => {
try {
const response = await this.issueService.subIssues(workspaceSlug, projectId, parentIssueId); const response = await this.issueService.subIssues(workspaceSlug, projectId, parentIssueId);
const subIssuesStateDistribution = response?.state_distribution ?? {}; const subIssuesStateDistribution = response?.state_distribution ?? {};
const subIssues = (response.sub_issues ?? []) as TIssue[]; const subIssues = (response.sub_issues ?? []) as TIssue[];
this.rootIssueDetailStore.rootIssueStore.issues.addIssue(subIssues); this.rootIssueDetailStore.rootIssueStore.issues.addIssue(subIssues);
// fetch other issues states and members when sub-issues are from different project // fetch other issues states and members when sub-issues are from different project
if (subIssues && subIssues.length > 0) { if (subIssues && subIssues.length > 0) {
const otherProjectIds = uniq( const otherProjectIds = uniq(
@ -127,13 +124,11 @@ export class IssueSubIssuesStore implements IIssueSubIssuesStore {
) as string[]; ) as string[];
this.fetchOtherProjectProperties(workspaceSlug, otherProjectIds); this.fetchOtherProjectProperties(workspaceSlug, otherProjectIds);
} }
if (subIssues) { if (subIssues) {
this.rootIssueDetailStore.rootIssueStore.issues.updateIssue(parentIssueId, { this.rootIssueDetailStore.rootIssueStore.issues.updateIssue(parentIssueId, {
sub_issues_count: subIssues.length, sub_issues_count: subIssues.length,
}); });
} }
runInAction(() => { runInAction(() => {
set(this.subIssuesStateDistribution, parentIssueId, subIssuesStateDistribution); set(this.subIssuesStateDistribution, parentIssueId, subIssuesStateDistribution);
set( set(
@ -142,15 +137,10 @@ export class IssueSubIssuesStore implements IIssueSubIssuesStore {
subIssues.map((issue) => issue.id) subIssues.map((issue) => issue.id)
); );
}); });
return response; return response;
} catch (error) {
throw error;
}
}; };
createSubIssues = async (workspaceSlug: string, projectId: string, parentIssueId: string, issueIds: string[]) => { createSubIssues = async (workspaceSlug: string, projectId: string, parentIssueId: string, issueIds: string[]) => {
try {
const response = await this.issueService.addSubIssues(workspaceSlug, projectId, parentIssueId, { const response = await this.issueService.addSubIssues(workspaceSlug, projectId, parentIssueId, {
sub_issue_ids: issueIds, sub_issue_ids: issueIds,
}); });
@ -192,9 +182,6 @@ export class IssueSubIssuesStore implements IIssueSubIssuesStore {
); );
return; return;
} catch (error) {
throw error;
}
}; };
updateSubIssue = async ( updateSubIssue = async (
@ -206,7 +193,6 @@ export class IssueSubIssuesStore implements IIssueSubIssuesStore {
oldIssue: Partial<TIssue> = {}, oldIssue: Partial<TIssue> = {},
fromModal: boolean = false fromModal: boolean = false
) => { ) => {
try {
if (!fromModal) if (!fromModal)
await this.rootIssueDetailStore.rootIssueStore.projectIssues.updateIssue( await this.rootIssueDetailStore.rootIssueStore.projectIssues.updateIssue(
workspaceSlug, workspaceSlug,
@ -257,13 +243,9 @@ export class IssueSubIssuesStore implements IIssueSubIssuesStore {
} }
return; return;
} catch (error) {
throw error;
}
}; };
removeSubIssue = async (workspaceSlug: string, projectId: string, parentIssueId: string, issueId: string) => { removeSubIssue = async (workspaceSlug: string, projectId: string, parentIssueId: string, issueId: string) => {
try {
await this.rootIssueDetailStore.rootIssueStore.projectIssues.updateIssue(workspaceSlug, projectId, issueId, { await this.rootIssueDetailStore.rootIssueStore.projectIssues.updateIssue(workspaceSlug, projectId, issueId, {
parent_id: null, parent_id: null,
}); });
@ -296,13 +278,9 @@ export class IssueSubIssuesStore implements IIssueSubIssuesStore {
}); });
return; return;
} catch (error) {
throw error;
}
}; };
deleteSubIssue = async (workspaceSlug: string, projectId: string, parentIssueId: string, issueId: string) => { deleteSubIssue = async (workspaceSlug: string, projectId: string, parentIssueId: string, issueId: string) => {
try {
await this.rootIssueDetailStore.rootIssueStore.projectIssues.removeIssue(workspaceSlug, projectId, issueId); await this.rootIssueDetailStore.rootIssueStore.projectIssues.removeIssue(workspaceSlug, projectId, issueId);
const issue = this.rootIssueDetailStore.issue.getIssueById(issueId); const issue = this.rootIssueDetailStore.issue.getIssueById(issueId);
@ -333,13 +311,9 @@ export class IssueSubIssuesStore implements IIssueSubIssuesStore {
}); });
return; return;
} catch (error) {
throw error;
}
}; };
fetchOtherProjectProperties = async (workspaceSlug: string, projectIds: string[]) => { fetchOtherProjectProperties = async (workspaceSlug: string, projectIds: string[]) => {
try {
if (projectIds.length > 0) { if (projectIds.length > 0) {
for (const projectId of projectIds) { for (const projectId of projectIds) {
// fetching other project states // fetching other project states
@ -362,8 +336,5 @@ export class IssueSubIssuesStore implements IIssueSubIssuesStore {
); );
} }
} }
} catch (error) {
throw error;
}
}; };
} }

View file

@ -61,19 +61,13 @@ export class IssueSubscriptionStore implements IIssueSubscriptionStore {
}; };
fetchSubscriptions = async (workspaceSlug: string, projectId: string, issueId: string) => { fetchSubscriptions = async (workspaceSlug: string, projectId: string, issueId: string) => {
try {
const subscription = await this.issueService.getIssueNotificationSubscriptionStatus( const subscription = await this.issueService.getIssueNotificationSubscriptionStatus(
workspaceSlug, workspaceSlug,
projectId, projectId,
issueId issueId
); );
this.addSubscription(issueId, subscription?.subscribed); this.addSubscription(issueId, subscription?.subscribed);
return subscription?.subscribed; return subscription?.subscribed;
} catch (error) {
throw error;
}
}; };
createSubscription = async (workspaceSlug: string, projectId: string, issueId: string) => { createSubscription = async (workspaceSlug: string, projectId: string, issueId: string) => {

View file

@ -31,6 +31,7 @@ export interface ICalendarStore {
export class CalendarStore implements ICalendarStore { export class CalendarStore implements ICalendarStore {
loader: boolean = false; loader: boolean = false;
// eslint-disable-next-line @typescript-eslint/no-explicit-any
error: any | null = null; error: any | null = null;
// observables // observables

View file

@ -3819,6 +3819,13 @@
"@types/connect" "*" "@types/connect" "*"
"@types/node" "*" "@types/node" "*"
"@types/compression@^1.7.5":
version "1.7.5"
resolved "https://registry.yarnpkg.com/@types/compression/-/compression-1.7.5.tgz#0f80efef6eb031be57b12221c4ba6bc3577808f7"
integrity sha512-AAQvK5pxMpaT+nDvhHrsBhLSYG5yQdtkaJE1WYieSNY2mVFKAgmU4ks65rkZD5oqnGCFLyQpUr1CqI4DmUMyDg==
dependencies:
"@types/express" "*"
"@types/connect@*": "@types/connect@*":
version "3.4.38" version "3.4.38"
resolved "https://registry.yarnpkg.com/@types/connect/-/connect-3.4.38.tgz#5ba7f3bc4fbbdeaff8dded952e5ff2cc53f8d858" resolved "https://registry.yarnpkg.com/@types/connect/-/connect-3.4.38.tgz#5ba7f3bc4fbbdeaff8dded952e5ff2cc53f8d858"
@ -4607,7 +4614,7 @@ abort-controller@^3.0.0:
dependencies: dependencies:
event-target-shim "^5.0.0" event-target-shim "^5.0.0"
accepts@~1.3.8: accepts@~1.3.5, accepts@~1.3.8:
version "1.3.8" version "1.3.8"
resolved "https://registry.yarnpkg.com/accepts/-/accepts-1.3.8.tgz#0bf0be125b67014adcb0b0921e62db7bffe16b2e" resolved "https://registry.yarnpkg.com/accepts/-/accepts-1.3.8.tgz#0bf0be125b67014adcb0b0921e62db7bffe16b2e"
integrity sha512-PYAthTa2m2VKxuvSD3DPC/Gy+U+sOA1LAuT8mkmRuvw+NACSaeXEQ+NHcVF7rONl6qcaxV3Uuemwawk+7+SJLw== integrity sha512-PYAthTa2m2VKxuvSD3DPC/Gy+U+sOA1LAuT8mkmRuvw+NACSaeXEQ+NHcVF7rONl6qcaxV3Uuemwawk+7+SJLw==
@ -5216,6 +5223,11 @@ busboy@1.6.0:
dependencies: dependencies:
streamsearch "^1.1.0" streamsearch "^1.1.0"
bytes@3.0.0:
version "3.0.0"
resolved "https://registry.yarnpkg.com/bytes/-/bytes-3.0.0.tgz#d32815404d689699f85a4ea4fa8755dd13a96048"
integrity sha512-pMhOfFDPiv9t5jjIXkHosWmkSyQbvsgEVNkz0ERHbuLh2T/7j4Mqqpz523Fe8MVY89KC6Sh/QfS2sM+SjgFDcw==
bytes@3.1.2: bytes@3.1.2:
version "3.1.2" version "3.1.2"
resolved "https://registry.yarnpkg.com/bytes/-/bytes-3.1.2.tgz#8b0beeb98605adf1b128fa4386403c009e0221a5" resolved "https://registry.yarnpkg.com/bytes/-/bytes-3.1.2.tgz#8b0beeb98605adf1b128fa4386403c009e0221a5"
@ -5583,6 +5595,26 @@ commondir@^1.0.1:
resolved "https://registry.yarnpkg.com/commondir/-/commondir-1.0.1.tgz#ddd800da0c66127393cca5950ea968a3aaf1253b" resolved "https://registry.yarnpkg.com/commondir/-/commondir-1.0.1.tgz#ddd800da0c66127393cca5950ea968a3aaf1253b"
integrity sha512-W9pAhw0ja1Edb5GVdIF1mjZw/ASI0AlShXM83UUGe2DVr5TdAPEA1OA8m/g8zWp9x6On7gqufY+FatDbC3MDQg== integrity sha512-W9pAhw0ja1Edb5GVdIF1mjZw/ASI0AlShXM83UUGe2DVr5TdAPEA1OA8m/g8zWp9x6On7gqufY+FatDbC3MDQg==
compressible@~2.0.16:
version "2.0.18"
resolved "https://registry.yarnpkg.com/compressible/-/compressible-2.0.18.tgz#af53cca6b070d4c3c0750fbd77286a6d7cc46fba"
integrity sha512-AF3r7P5dWxL8MxyITRMlORQNaOA2IkAFaTr4k7BUumjPtRpGDTZpl0Pb1XCO6JeDCBdp126Cgs9sMxqSjgYyRg==
dependencies:
mime-db ">= 1.43.0 < 2"
compression@^1.7.4:
version "1.7.4"
resolved "https://registry.yarnpkg.com/compression/-/compression-1.7.4.tgz#95523eff170ca57c29a0ca41e6fe131f41e5bb8f"
integrity sha512-jaSIDzP9pZVS4ZfQ+TzvtiWhdpFhE2RDHz8QJkpX9SIpLq88VueF5jJw6t+6CUQcAoA6t+x89MLrWAqpfDE8iQ==
dependencies:
accepts "~1.3.5"
bytes "3.0.0"
compressible "~2.0.16"
debug "2.6.9"
on-headers "~1.0.2"
safe-buffer "5.1.2"
vary "~1.1.2"
compute-scroll-into-view@^3.0.2: compute-scroll-into-view@^3.0.2:
version "3.1.0" version "3.1.0"
resolved "https://registry.yarnpkg.com/compute-scroll-into-view/-/compute-scroll-into-view-3.1.0.tgz#753f11d972596558d8fe7c6bcbc8497690ab4c87" resolved "https://registry.yarnpkg.com/compute-scroll-into-view/-/compute-scroll-into-view-3.1.0.tgz#753f11d972596558d8fe7c6bcbc8497690ab4c87"
@ -7594,6 +7626,11 @@ header-case@^2.0.4:
capital-case "^1.0.4" capital-case "^1.0.4"
tslib "^2.0.3" tslib "^2.0.3"
helmet@^7.1.0:
version "7.1.0"
resolved "https://registry.yarnpkg.com/helmet/-/helmet-7.1.0.tgz#287279e00f8a3763d5dccbaf1e5ee39b8c3784ca"
integrity sha512-g+HZqgfbpXdCkme/Cd/mZkV0aV3BZZZSugecH03kl38m/Kmdx8jKjBikpDj2cr+Iynv4KpYEviojNdTJActJAg==
help-me@^5.0.0: help-me@^5.0.0:
version "5.0.0" version "5.0.0"
resolved "https://registry.yarnpkg.com/help-me/-/help-me-5.0.0.tgz#b1ebe63b967b74060027c2ac61f9be12d354a6f6" resolved "https://registry.yarnpkg.com/help-me/-/help-me-5.0.0.tgz#b1ebe63b967b74060027c2ac61f9be12d354a6f6"
@ -9034,6 +9071,11 @@ mime-db@1.52.0:
resolved "https://registry.yarnpkg.com/mime-db/-/mime-db-1.52.0.tgz#bbabcdc02859f4987301c856e3387ce5ec43bf70" resolved "https://registry.yarnpkg.com/mime-db/-/mime-db-1.52.0.tgz#bbabcdc02859f4987301c856e3387ce5ec43bf70"
integrity sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg== integrity sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==
"mime-db@>= 1.43.0 < 2":
version "1.53.0"
resolved "https://registry.yarnpkg.com/mime-db/-/mime-db-1.53.0.tgz#3cb63cd820fc29896d9d4e8c32ab4fcd74ccb447"
integrity sha512-oHlN/w+3MQ3rba9rqFr6V/ypF10LSkdwUysQL7GkXoTgIWeV+tcXGA852TBxH+gsh8UWoyhR1hKcoMJTuWflpg==
mime-types@^2.1.12, mime-types@^2.1.27, mime-types@^2.1.31, mime-types@~2.1.24, mime-types@~2.1.34: mime-types@^2.1.12, mime-types@^2.1.27, mime-types@^2.1.31, mime-types@~2.1.24, mime-types@~2.1.34:
version "2.1.35" version "2.1.35"
resolved "https://registry.yarnpkg.com/mime-types/-/mime-types-2.1.35.tgz#381a871b62a734450660ae3deee44813f70d959a" resolved "https://registry.yarnpkg.com/mime-types/-/mime-types-2.1.35.tgz#381a871b62a734450660ae3deee44813f70d959a"