fix: bot activity and comment log name (#463)

* fix: github bot activity log details

* fix: bot comment details

* fix: updated bot logs

* refactor: bot name logic
This commit is contained in:
Aaryan Khandelwal 2023-03-17 10:38:01 +05:30 committed by GitHub
parent 0fb9a14f15
commit 5f796e732a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 16 additions and 8 deletions

View File

@ -54,11 +54,14 @@ export const LinksList: React.FC<Props> = ({ links, handleDeleteLink, userAuth }
<LinkIcon className="h-3.5 w-3.5" />
</div>
<div>
<h5 className="w-4/5">{link.title}</h5>
<h5 className="w-4/5 break-all">{link.title}</h5>
<p className="mt-0.5 text-gray-500">
Added {timeAgo(link.created_at)}
<br />
by {link.created_by_detail.email}
by{" "}
{link.created_by_detail.is_bot
? link.created_by_detail.first_name + " Bot"
: link.created_by_detail.email}
</p>
</div>
</a>

View File

@ -160,7 +160,7 @@ export const IssueActivitySection: React.FC<Props> = () => {
{activity.actor_detail.avatar && activity.actor_detail.avatar !== "" ? (
<Image
src={activity.actor_detail.avatar}
alt={activity.actor_detail.name}
alt={activity.actor_detail.first_name}
height={30}
width={30}
className="rounded-full"
@ -179,7 +179,10 @@ export const IssueActivitySection: React.FC<Props> = () => {
<div className={`${activity.field ? "ml-1.5" : ""} w-full text-xs`}>
<p>
<span className="font-medium">
{activity.actor_detail.first_name} {activity.actor_detail.last_name}
{activity.actor_detail.first_name}
{activity.actor_detail.is_bot
? " Bot"
: " " + activity.actor_detail.last_name}
</span>
<span>
{" "}

View File

@ -55,7 +55,7 @@ export const CommentCard: React.FC<Props> = ({ comment, onSubmit, handleCommentD
{comment.actor_detail.avatar && comment.actor_detail.avatar !== "" ? (
<Image
src={comment.actor_detail.avatar}
alt={comment.actor_detail.name}
alt={comment.actor_detail.first_name}
height={30}
width={30}
className="rounded-full"
@ -71,7 +71,8 @@ export const CommentCard: React.FC<Props> = ({ comment, onSubmit, handleCommentD
<div className="w-full space-y-1">
<p className="flex items-center gap-2 text-xs text-gray-500">
<span>
{comment.actor_detail.first_name} {comment.actor_detail.last_name}
{comment.actor_detail.first_name}
{comment.actor_detail.is_bot ? "Bot" : " " + comment.actor_detail.last_name}
</span>
<span>{timeAgo(comment.created_at)}</span>
</p>

View File

@ -137,7 +137,7 @@ export interface BlockeIssueDetail {
export interface IIssueComment {
id: string;
actor: string;
actor_detail: IUser;
actor_detail: IUserLite;
created_at: Date;
updated_at: Date;
comment: string;
@ -187,7 +187,7 @@ export interface IIssueLabels {
export interface IIssueActivity {
id: string;
actor_detail: IUser;
actor_detail: IUserLite;
created_at: Date;
updated_at: Date;
verb: string;

View File

@ -33,6 +33,7 @@ export interface IUserLite {
email: string;
avatar: string;
created_at: Date;
is_bot: boolean;
}
export interface IUserActivity {