fix: activity not coming for blocking/blocked, 'related to' and duplicate (#2189)
* fix: activity not coming for duplicate, relatesd to and for blocked/blocking refactor: mutation logic to use relation id instead of issue id * fix: mutation logic and changed keys to be aligned with api * fix: build error
This commit is contained in:
parent
79bf7d4c0c
commit
f6b92fc953
10 changed files with 142 additions and 98 deletions
|
|
@ -1,9 +1,10 @@
|
|||
import { useRouter } from "next/router";
|
||||
|
||||
// icons
|
||||
import { CopyPlus } from "lucide-react";
|
||||
import { Icon, Tooltip } from "components/ui";
|
||||
import { Squares2X2Icon } from "@heroicons/react/24/outline";
|
||||
import { BlockedIcon, BlockerIcon } from "components/icons";
|
||||
import { BlockedIcon, BlockerIcon, RelatedIcon } from "components/icons";
|
||||
// helpers
|
||||
import { renderShortDateWithYearFormat } from "helpers/date-time.helper";
|
||||
import { capitalizeFirstLetter } from "helpers/string.helper";
|
||||
|
|
@ -117,7 +118,7 @@ const activityDetails: {
|
|||
icon: <BlockerIcon height="12" width="12" color="#6b7280" />,
|
||||
},
|
||||
|
||||
blocks: {
|
||||
blocked_by: {
|
||||
message: (activity) => (
|
||||
<>
|
||||
{activity.old_value === ""
|
||||
|
|
@ -132,6 +133,36 @@ const activityDetails: {
|
|||
icon: <BlockedIcon height="12" width="12" color="#6b7280" />,
|
||||
},
|
||||
|
||||
duplicate: {
|
||||
message: (activity) => (
|
||||
<>
|
||||
{activity.old_value === ""
|
||||
? "marked this issue as duplicate of "
|
||||
: "removed this issue as a duplicate of "}
|
||||
<span className="font-medium text-custom-text-100">
|
||||
{activity.verb === "created" ? activity.new_value : activity.old_value}
|
||||
</span>
|
||||
.
|
||||
</>
|
||||
),
|
||||
icon: <CopyPlus size={12} color="#6b7280" />,
|
||||
},
|
||||
|
||||
relates_to: {
|
||||
message: (activity) => (
|
||||
<>
|
||||
{activity.old_value === ""
|
||||
? "marked that this issue relates to "
|
||||
: "removed the relation from "}
|
||||
<span className="font-medium text-custom-text-100">
|
||||
{activity.old_value === "" ? activity.new_value : activity.old_value}
|
||||
</span>
|
||||
.
|
||||
</>
|
||||
),
|
||||
icon: <RelatedIcon height="12" width="12" color="#6b7280" />,
|
||||
},
|
||||
|
||||
cycles: {
|
||||
message: (activity) => (
|
||||
<>
|
||||
|
|
|
|||
|
|
@ -351,25 +351,23 @@ export const IssuePropertiesDetail: React.FC<Props> = (props) => {
|
|||
{blockedIssue &&
|
||||
blockedIssue.map((issue) => (
|
||||
<div
|
||||
key={issue.related_issue_detail?.id}
|
||||
key={issue.issue_detail?.id}
|
||||
className="group inline-flex mr-1 cursor-pointer items-center gap-1 rounded-2xl border border-custom-border-200 px-1.5 py-0.5 text-xs text-red-500 duration-300 hover:border-red-500/20 hover:bg-red-500/20"
|
||||
>
|
||||
<a
|
||||
href={`/${workspaceSlug}/projects/${issue.related_issue_detail?.project_detail.id}/issues/${issue.related_issue_detail?.id}`}
|
||||
href={`/${workspaceSlug}/projects/${issue.issue_detail?.project_detail.id}/issues/${issue.issue_detail?.id}`}
|
||||
target="_blank"
|
||||
rel="noopener noreferrer"
|
||||
className="flex items-center gap-1"
|
||||
>
|
||||
<BlockedIcon height={10} width={10} />
|
||||
{`${issue?.related_issue_detail?.project_detail?.identifier}-${issue?.related_issue_detail?.sequence_id}`}
|
||||
{`${issue?.issue_detail?.project_detail?.identifier}-${issue?.issue_detail?.sequence_id}`}
|
||||
</a>
|
||||
<button
|
||||
type="button"
|
||||
className="duration-300"
|
||||
onClick={() => {
|
||||
const updatedBlocked = blockedIssue.filter(
|
||||
(i) => i.related_issue_detail?.id !== issue.related_issue_detail?.id
|
||||
);
|
||||
const updatedBlocked = blockedIssue.filter((i) => i?.id !== issue?.id);
|
||||
|
||||
if (!user) return;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue