From 3ea926a908f61eb5699a1cbb7427ecc5b485bd81 Mon Sep 17 00:00:00 2001 From: Lakhan Baheti <94619783+1akhanBaheti@users.noreply.github.com> Date: Mon, 20 Nov 2023 16:36:50 +0530 Subject: [PATCH] fix: bug fixes & ui improvements. (#2772) * fix: create project modal member select * fix: overflow in workspace activity * fix: memeber selected state --- web/components/core/activity.tsx | 36 +++++++++---------- .../project/create-project-modal.tsx | 6 ++-- web/components/workspace/member-select.tsx | 18 ++++++---- .../[workspaceSlug]/me/profile/activity.tsx | 9 +++-- 4 files changed, 40 insertions(+), 29 deletions(-) diff --git a/web/components/core/activity.tsx b/web/components/core/activity.tsx index 2b0f7b4e6..6bddae940 100644 --- a/web/components/core/activity.tsx +++ b/web/components/core/activity.tsx @@ -84,7 +84,7 @@ const LabelPill = ({ labelId }: { labelId: string }) => { return ( l.id === labelId)?.color ?? "#000000", }} @@ -266,12 +266,12 @@ const activityDetails: { if (activity.verb === "created") return ( <> - added this issue to the cycle{" "} + added this issue to the cycle {activity.new_value} @@ -281,12 +281,12 @@ const activityDetails: { else if (activity.verb === "updated") return ( <> - set the cycle to{" "} + set the cycle to {activity.new_value} @@ -301,7 +301,7 @@ const activityDetails: { href={`/${workspaceSlug}/projects/${activity.project}/cycles/${activity.old_identifier}`} target="_blank" rel="noopener noreferrer" - className="w-full font-medium text-custom-text-100 inline-flex items-center gap-1 hover:underline" + className="font-medium text-custom-text-100 inline-flex items-center truncate gap-1 hover:underline" > {activity.old_value} @@ -370,15 +370,15 @@ const activityDetails: { return ( <> added a new label{" "} - + - {activity.new_value} + {activity.new_value} {showIssue && ( - <> + {" "} to - + )} ); @@ -386,15 +386,15 @@ const activityDetails: { return ( <> removed the label{" "} - + - {activity.old_value} + {activity.old_value} {showIssue && ( - <> + {" "} from - + )} ); @@ -482,7 +482,7 @@ const activityDetails: { href={`/${workspaceSlug}/projects/${activity.project}/modules/${activity.new_identifier}`} target="_blank" rel="noopener noreferrer" - className="w-full font-medium text-custom-text-100 inline-flex items-center gap-1 hover:underline" + className="font-medium text-custom-text-100 inline-flex items-center truncate gap-1 hover:underline" > {activity.new_value} @@ -497,7 +497,7 @@ const activityDetails: { href={`/${workspaceSlug}/projects/${activity.project}/modules/${activity.new_identifier}`} target="_blank" rel="noopener noreferrer" - className="w-full font-medium text-custom-text-100 inline-flex items-center gap-1 hover:underline" + className="font-medium text-custom-text-100 inline-flex items-center truncate gap-1 hover:underline" > {activity.new_value} @@ -512,7 +512,7 @@ const activityDetails: { href={`/${workspaceSlug}/projects/${activity.project}/modules/${activity.old_identifier}`} target="_blank" rel="noopener noreferrer" - className="w-full font-medium text-custom-text-100 inline-flex items-center gap-1 hover:underline" + className="font-medium text-custom-text-100 inline-flex items-center truncate gap-1 hover:underline" > {activity.old_value} @@ -525,7 +525,7 @@ const activityDetails: { name: { message: (activity, showIssue) => ( <> - set the name to {activity.new_value} + set the name to {activity.new_value} {showIssue && ( <> {" "} diff --git a/web/components/project/create-project-modal.tsx b/web/components/project/create-project-modal.tsx index 6659dca87..5cf6c1bcd 100644 --- a/web/components/project/create-project-modal.tsx +++ b/web/components/project/create-project-modal.tsx @@ -55,7 +55,7 @@ export interface ICreateProjectForm { description: string; emoji_and_icon: string; network: number; - project_lead_member: IWorkspaceMember; + project_lead_member: string; project_lead: string; cover_image: string; icon_prop: any; @@ -126,7 +126,7 @@ export const CreateProjectModal: FC = observer((props) => { if (typeof formData.emoji_and_icon === "object") payload.icon_prop = formData.emoji_and_icon; else payload.emoji = formData.emoji_and_icon; - payload.project_lead = formData.project_lead_member?.member.id; + payload.project_lead = formData.project_lead_member; return projectStore .createProject(workspaceSlug.toString(), payload) @@ -380,7 +380,7 @@ export const CreateProjectModal: FC = observer((props) => { control={control} render={({ field: { value, onChange } }) => ( member.member.id ===value)[0]} onChange={onChange} options={workspaceMembers || []} placeholder="Select Lead" diff --git a/web/components/workspace/member-select.tsx b/web/components/workspace/member-select.tsx index 26b76845d..9cc142699 100644 --- a/web/components/workspace/member-select.tsx +++ b/web/components/workspace/member-select.tsx @@ -11,7 +11,7 @@ import { IWorkspaceMember } from "types"; export interface IWorkspaceMemberSelect { value: IWorkspaceMember | undefined; - onChange: (value: IWorkspaceMember) => void; + onChange: (value: string) => void; options: IWorkspaceMember[]; placeholder?: string; disabled?: boolean; @@ -48,7 +48,7 @@ export const WorkspaceMemberSelect: FC = (props) => { : options?.filter((option) => option.member.display_name.toLowerCase().includes(query.toLowerCase())); const label = ( -
+
{value ? ( <> @@ -64,7 +64,13 @@ export const WorkspaceMemberSelect: FC = (props) => { ); return ( - +
-
+
{activityItem.field === "archived_at" && activityItem.new_value !== "restore" ? ( Plane ) : activityItem.actor_detail.is_bot ? ( @@ -166,7 +166,12 @@ const ProfileActivityPage: NextPageWithLayout = () => { {activityItem.actor_detail.display_name} )}{" "} - {message} {timeAgo(activityItem.created_at)} +
+ {message}{" "} + + {timeAgo(activityItem.created_at)} + +