mirror of
https://github.com/makeplane/plane
synced 2024-06-14 14:31:34 +00:00
fix: profile activity workspace slug (#1752)
This commit is contained in:
parent
0e0e09c4fd
commit
d22e4b8212
@ -1,5 +1,7 @@
|
|||||||
import React from "react";
|
import React from "react";
|
||||||
|
|
||||||
|
import { useRouter } from "next/router";
|
||||||
|
|
||||||
import Link from "next/link";
|
import Link from "next/link";
|
||||||
|
|
||||||
// icons
|
// icons
|
||||||
@ -99,7 +101,11 @@ const activityDetails: {
|
|||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
export const Feeds: React.FC<any> = ({ activities }) => (
|
export const Feeds: React.FC<any> = ({ activities }) => {
|
||||||
|
const router = useRouter();
|
||||||
|
const { workspaceSlug } = router.query;
|
||||||
|
|
||||||
|
return (
|
||||||
<div>
|
<div>
|
||||||
<ul role="list" className="-mb-4">
|
<ul role="list" className="-mb-4">
|
||||||
{activities.map((activity: any, activityIdx: number) => {
|
{activities.map((activity: any, activityIdx: number) => {
|
||||||
@ -152,11 +158,11 @@ export const Feeds: React.FC<any> = ({ activities }) => (
|
|||||||
activity.field !== "link" &&
|
activity.field !== "link" &&
|
||||||
activity.field !== "estimate"
|
activity.field !== "estimate"
|
||||||
) {
|
) {
|
||||||
const { workspace_detail, project, issue } = activity;
|
const { project, issue } = activity;
|
||||||
value = (
|
value = (
|
||||||
<span className="text-custom-text-200">
|
<span className="text-custom-text-200">
|
||||||
created{" "}
|
created{" "}
|
||||||
<Link href={`/${workspace_detail.slug}/projects/${project}/issues/${issue}`}>
|
<Link href={`/${workspaceSlug}/projects/${project}/issues/${issue}`}>
|
||||||
<a className="inline-flex items-center hover:underline">
|
<a className="inline-flex items-center hover:underline">
|
||||||
this issue. <ArrowTopRightOnSquareIcon className="ml-1 h-3.5 w-3.5" />
|
this issue. <ArrowTopRightOnSquareIcon className="ml-1 h-3.5 w-3.5" />
|
||||||
</a>
|
</a>
|
||||||
@ -193,7 +199,8 @@ export const Feeds: React.FC<any> = ({ activities }) => (
|
|||||||
value = "link";
|
value = "link";
|
||||||
} else if (activity.field === "estimate_point") {
|
} else if (activity.field === "estimate_point") {
|
||||||
value = activity.new_value
|
value = activity.new_value
|
||||||
? activity.new_value + ` Point${parseInt(activity.new_value ?? "", 10) > 1 ? "s" : ""}`
|
? activity.new_value +
|
||||||
|
` Point${parseInt(activity.new_value ?? "", 10) > 1 ? "s" : ""}`
|
||||||
: "None";
|
: "None";
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -235,7 +242,9 @@ export const Feeds: React.FC<any> = ({ activities }) => (
|
|||||||
<div>
|
<div>
|
||||||
<div className="text-xs">
|
<div className="text-xs">
|
||||||
{activity.actor_detail.first_name}
|
{activity.actor_detail.first_name}
|
||||||
{activity.actor_detail.is_bot ? "Bot" : " " + activity.actor_detail.last_name}
|
{activity.actor_detail.is_bot
|
||||||
|
? "Bot"
|
||||||
|
: " " + activity.actor_detail.last_name}
|
||||||
</div>
|
</div>
|
||||||
<p className="mt-0.5 text-xs text-custom-text-200">
|
<p className="mt-0.5 text-xs text-custom-text-200">
|
||||||
Commented {timeAgo(activity.created_at)}
|
Commented {timeAgo(activity.created_at)}
|
||||||
@ -276,7 +285,8 @@ export const Feeds: React.FC<any> = ({ activities }) => (
|
|||||||
<div className="mt-1.5">
|
<div className="mt-1.5">
|
||||||
<div className="ring-6 flex h-7 w-7 items-center justify-center rounded-full bg-custom-background-80 text-custom-text-200 ring-white">
|
<div className="ring-6 flex h-7 w-7 items-center justify-center rounded-full bg-custom-background-80 text-custom-text-200 ring-white">
|
||||||
{activity.field ? (
|
{activity.field ? (
|
||||||
activityDetails[activity.field as keyof typeof activityDetails]?.icon
|
activityDetails[activity.field as keyof typeof activityDetails]
|
||||||
|
?.icon
|
||||||
) : activity.actor_detail.avatar &&
|
) : activity.actor_detail.avatar &&
|
||||||
activity.actor_detail.avatar !== "" ? (
|
activity.actor_detail.avatar !== "" ? (
|
||||||
<img
|
<img
|
||||||
@ -329,3 +339,4 @@ export const Feeds: React.FC<any> = ({ activities }) => (
|
|||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user