[WEB-419] feat: manual issue archival (#3801)
* fix: issue archive without automation * fix: unarchive issue endpoint change * chore: archiving logic implemented in the quick-actions dropdowns * chore: peek overview archive button * chore: issue archive completed at state * chore: updated archiving icon and added archive option everywhere * chore: all issues quick actions dropdown * chore: archive and unarchive response * fix: archival mutation * fix: restore issue from peek overview * chore: update notification content for archive/restore * refactor: activity user name * fix: all issues mutation * fix: restore issue auth * chore: close peek overview on archival --------- Co-authored-by: NarayanBavisetti <narayan3119@gmail.com> Co-authored-by: gurusainath <gurusainath007@gmail.com>
This commit is contained in:
parent
b1520783cf
commit
30cc923fdb
77 changed files with 1402 additions and 691 deletions
|
|
@ -34,7 +34,7 @@ export const AllIssueLayoutRoot: React.FC = observer(() => {
|
|||
const { commandPalette: commandPaletteStore } = useApplication();
|
||||
const {
|
||||
issuesFilter: { filters, fetchFilters, updateFilters },
|
||||
issues: { loader, groupedIssueIds, fetchIssues, updateIssue, removeIssue },
|
||||
issues: { loader, groupedIssueIds, fetchIssues, updateIssue, removeIssue, archiveIssue },
|
||||
} = useIssues(EIssuesStoreType.GLOBAL);
|
||||
|
||||
const { dataViewId, issueIds } = groupedIssueIds;
|
||||
|
|
@ -138,6 +138,12 @@ export const AllIssueLayoutRoot: React.FC = observer(() => {
|
|||
|
||||
await removeIssue(workspaceSlug.toString(), projectId, issue.id, globalViewId.toString());
|
||||
},
|
||||
[EIssueActions.ARCHIVE]: async (issue: TIssue) => {
|
||||
const projectId = issue.project_id;
|
||||
if (!workspaceSlug || !projectId || !globalViewId) return;
|
||||
|
||||
await archiveIssue(workspaceSlug.toString(), projectId, issue.id, globalViewId.toString());
|
||||
},
|
||||
}),
|
||||
// eslint-disable-next-line react-hooks/exhaustive-deps
|
||||
[updateIssue, removeIssue, workspaceSlug]
|
||||
|
|
@ -147,6 +153,7 @@ export const AllIssueLayoutRoot: React.FC = observer(() => {
|
|||
async (issue: TIssue, action: EIssueActions) => {
|
||||
if (action === EIssueActions.UPDATE) await issueActions[action]!(issue);
|
||||
if (action === EIssueActions.DELETE) await issueActions[action]!(issue);
|
||||
if (action === EIssueActions.ARCHIVE) await issueActions[action]!(issue);
|
||||
},
|
||||
// eslint-disable-next-line react-hooks/exhaustive-deps
|
||||
[]
|
||||
|
|
@ -174,10 +181,12 @@ export const AllIssueLayoutRoot: React.FC = observer(() => {
|
|||
issue={issue}
|
||||
handleUpdate={async () => handleIssues({ ...issue }, EIssueActions.UPDATE)}
|
||||
handleDelete={async () => handleIssues(issue, EIssueActions.DELETE)}
|
||||
handleArchive={async () => handleIssues(issue, EIssueActions.ARCHIVE)}
|
||||
portalElement={portalElement}
|
||||
readOnly={!canEditProperties(issue.project_id)}
|
||||
/>
|
||||
),
|
||||
[handleIssues]
|
||||
[canEditProperties, handleIssues]
|
||||
);
|
||||
|
||||
const isEditingAllowed = !!currentWorkspaceRole && currentWorkspaceRole >= EUserWorkspaceRoles.MEMBER;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue