refactor: issue peek overview (#3001)
* refactor: peek overview components * fix: issue reactions * chore: update comment types * fix: access sepcifier value * chore: remove unused vars * fix: build errors * build-error: build error resolved --------- Co-authored-by: sriram veeraghanta <veeraghanta.sriram@gmail.com> Co-authored-by: gurusainath <gurusainath007@gmail.com>
This commit is contained in:
parent
c455f03ced
commit
539c7a3455
55 changed files with 526 additions and 455 deletions
|
|
@ -10,7 +10,7 @@ import { IssueService, IssueCommentService } from "services/issue";
|
|||
// hooks
|
||||
import useToast from "hooks/use-toast";
|
||||
// types
|
||||
import { IIssue, IIssueComment } from "types";
|
||||
import { IIssue, IIssueActivity } from "types";
|
||||
// fetch-keys
|
||||
import { PROJECT_ISSUES_ACTIVITY } from "constants/fetch-keys";
|
||||
|
||||
|
|
@ -41,7 +41,7 @@ export const InboxIssueActivity: React.FC<Props> = observer(({ issueDetails }) =
|
|||
|
||||
const user = userStore.currentUser;
|
||||
|
||||
const handleCommentUpdate = async (commentId: string, data: Partial<IIssueComment>) => {
|
||||
const handleCommentUpdate = async (commentId: string, data: Partial<any>) => {
|
||||
if (!workspaceSlug || !projectId || !issueDetails.id || !user) return;
|
||||
|
||||
await issueCommentService
|
||||
|
|
@ -86,7 +86,7 @@ export const InboxIssueActivity: React.FC<Props> = observer(({ issueDetails }) =
|
|||
});
|
||||
};
|
||||
|
||||
const handleAddComment = async (formData: IIssueComment) => {
|
||||
const handleAddComment = async (formData: IIssueActivity) => {
|
||||
if (!workspaceSlug || !issueDetails || !user) return;
|
||||
|
||||
await issueCommentService
|
||||
|
|
|
|||
|
|
@ -37,13 +37,10 @@ export const InboxMainContent: React.FC = observer(() => {
|
|||
const {
|
||||
inboxIssues: inboxIssuesStore,
|
||||
inboxIssueDetails: inboxIssueDetailsStore,
|
||||
user: userStore,
|
||||
user: { currentUser, currentProjectRole },
|
||||
projectState: { states },
|
||||
} = useMobxStore();
|
||||
|
||||
const user = userStore.currentUser;
|
||||
const userRole = userStore.currentProjectRole;
|
||||
|
||||
const { reset, control, watch } = useForm<IIssue>({
|
||||
defaultValues,
|
||||
});
|
||||
|
|
@ -156,7 +153,7 @@ export const InboxMainContent: React.FC = observer(() => {
|
|||
</div>
|
||||
);
|
||||
|
||||
const isAllowed = !!userRole && userRole >= EUserWorkspaceRoles.MEMBER;
|
||||
const isAllowed = !!currentProjectRole && currentProjectRole >= EUserWorkspaceRoles.MEMBER;
|
||||
|
||||
return (
|
||||
<>
|
||||
|
|
@ -249,12 +246,17 @@ export const InboxMainContent: React.FC = observer(() => {
|
|||
id: issueDetails.id,
|
||||
}}
|
||||
handleFormSubmit={submitChanges}
|
||||
isAllowed={isAllowed || user?.id === issueDetails.created_by}
|
||||
isAllowed={isAllowed || currentUser?.id === issueDetails.created_by}
|
||||
/>
|
||||
</div>
|
||||
|
||||
<IssueReaction projectId={projectId} workspaceSlug={workspaceSlug} issueId={issueDetails.id} />
|
||||
|
||||
{workspaceSlug && projectId && (
|
||||
<IssueReaction
|
||||
workspaceSlug={workspaceSlug.toString()}
|
||||
projectId={projectId.toString()}
|
||||
issueId={issueDetails.id}
|
||||
/>
|
||||
)}
|
||||
<InboxIssueActivity issueDetails={issueDetails} />
|
||||
</div>
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue