From ee823d215e18576cbd4ccae7abf44107759ec505 Mon Sep 17 00:00:00 2001 From: Anmol Singh Bhatia <121005188+anmolsinghbhatia@users.noreply.github.com> Date: Mon, 14 Oct 2024 17:26:54 +0530 Subject: [PATCH] [WEB-2629] chore: workspace draft issue ux copy updated (#5825) * chore: workspace draft issue ux copy updated * chore: workspace draft issue ux copy updated --- .../(projects)/drafts/header.tsx | 4 ++-- .../issues/confirm-issue-discard.tsx | 8 +++++--- .../components/issues/issue-modal/base.tsx | 2 +- .../issues/issue-modal/draft-issue-layout.tsx | 2 +- .../components/issues/issue-modal/form.tsx | 6 +++--- .../issues/workspace-draft/delete-modal.tsx | 19 +++++-------------- .../workspace-draft/draft-issue-block.tsx | 2 +- web/core/constants/empty-state.ts | 6 +++--- 8 files changed, 21 insertions(+), 28 deletions(-) diff --git a/web/app/[workspaceSlug]/(projects)/drafts/header.tsx b/web/app/[workspaceSlug]/(projects)/drafts/header.tsx index 0c5b4ecc7f1..41c68bdbb7e 100644 --- a/web/app/[workspaceSlug]/(projects)/drafts/header.tsx +++ b/web/app/[workspaceSlug]/(projects)/drafts/header.tsx @@ -41,7 +41,7 @@ export const WorkspaceDraftHeader: FC = observer(() => { } />} + link={} />} /> {paginationInfo?.total_count && paginationInfo?.total_count > 0 ? ( @@ -60,7 +60,7 @@ export const WorkspaceDraftHeader: FC = observer(() => { onClick={() => setIsDraftIssueModalOpen(true)} disabled={!isAuthorizedUser} > - Draft issue + Draft an issue diff --git a/web/core/components/issues/confirm-issue-discard.tsx b/web/core/components/issues/confirm-issue-discard.tsx index 09bedbf5986..58070349084 100644 --- a/web/core/components/issues/confirm-issue-discard.tsx +++ b/web/core/components/issues/confirm-issue-discard.tsx @@ -61,10 +61,12 @@ export const ConfirmIssueDiscard: React.FC = (props) => { - Draft Issue + Save this draft? - Would you like to save this issue in drafts? + + You can save this issue to Drafts so you can come back to it later.{" "} + @@ -80,7 +82,7 @@ export const ConfirmIssueDiscard: React.FC = (props) => { Cancel - {isLoading ? "Saving" : "Save draft"} + {isLoading ? "Saving" : "Save to Drafts"} diff --git a/web/core/components/issues/issue-modal/base.tsx b/web/core/components/issues/issue-modal/base.tsx index 73ccd8b9ac1..75006d885a2 100644 --- a/web/core/components/issues/issue-modal/base.tsx +++ b/web/core/components/issues/issue-modal/base.tsx @@ -206,7 +206,7 @@ export const CreateUpdateIssueModalBase: React.FC = observer(( setToast({ type: TOAST_TYPE.SUCCESS, title: "Success!", - message: `${is_draft_issue ? "Draft issue" : "Issue"} created successfully.`, + message: `${is_draft_issue ? "Draft created." : "Issue created successfully."} `, actionItems: !is_draft_issue && response?.project_id && ( = observer((props) => { setToast({ type: TOAST_TYPE.SUCCESS, title: "Success!", - message: "Draft Issue created successfully.", + message: "Draft created.", }); captureIssueEvent({ eventName: "Draft issue created", diff --git a/web/core/components/issues/issue-modal/form.tsx b/web/core/components/issues/issue-modal/form.tsx index 0cdd347917d..45c63cfc84e 100644 --- a/web/core/components/issues/issue-modal/form.tsx +++ b/web/core/components/issues/issue-modal/form.tsx @@ -272,7 +272,7 @@ export const IssueFormRoot: FC = observer((props) => { handleFormSubmit(data))}> - {data?.id ? "Update" : isDraft ? "Create draft" : "Create new"} issue + {data?.id ? "Update" : isDraft ? "Create a draft" : "Create new issue"} {/* Disable project selection if editing an issue */} @@ -422,8 +422,8 @@ export const IssueFormRoot: FC = observer((props) => { : isSubmitting ? "Creating" : isDraft - ? "Create draft issue" - : "Create"} + ? "Save to Drafts" + : "Save"} {moveToIssue && ( void; dataId?: string | null | undefined; data?: TWorkspaceDraftIssue; - isSubIssue?: boolean; onSubmit?: () => Promise; }; export const WorkspaceDraftIssueDeleteIssueModal: React.FC = (props) => { - const { dataId, data, isOpen, handleClose, isSubIssue = false, onSubmit } = props; + const { dataId, data, isOpen, handleClose, onSubmit } = props; // states const [isDeleting, setIsDeleting] = useState(false); // store hooks const { issueMap } = useIssues(); - const { getProjectById } = useProject(); const { allowPermissions } = useUserPermissions(); const { data: currentUser } = useUser(); @@ -41,7 +39,6 @@ export const WorkspaceDraftIssueDeleteIssueModal: React.FC = (props) => { // derived values const issue = data ? data : issueMap[dataId!]; - const projectDetails = getProjectById(issue?.project_id); const isIssueCreator = issue?.created_by === currentUser?.id; const authorized = isIssueCreator || canPerformProjectAdminActions; @@ -68,7 +65,7 @@ export const WorkspaceDraftIssueDeleteIssueModal: React.FC = (props) => { setToast({ type: TOAST_TYPE.SUCCESS, title: "Success!", - message: `${isSubIssue ? "Sub-issue" : "Issue"} deleted successfully`, + message: `draft deleted.`, }); onClose(); }) @@ -92,14 +89,8 @@ export const WorkspaceDraftIssueDeleteIssueModal: React.FC = (props) => { handleSubmit={handleIssueDelete} isSubmitting={isDeleting} isOpen={isOpen} - title="Delete issue" - content={ - <> - Are you sure you want to delete issue{" "} - {projectDetails?.identifier} - {""}? All of the data related to the issue will be permanently removed. This action cannot be undone. - > - } + title="Delete draft" + content={<>Are you sure you want to delete this draft? This can't be undone.>} /> ); }; diff --git a/web/core/components/issues/workspace-draft/draft-issue-block.tsx b/web/core/components/issues/workspace-draft/draft-issue-block.tsx index 089801447c3..f9838645957 100644 --- a/web/core/components/issues/workspace-draft/draft-issue-block.tsx +++ b/web/core/components/issues/workspace-draft/draft-issue-block.tsx @@ -74,7 +74,7 @@ export const DraftIssueBlock: FC = observer((props) => { }, { key: "move-to-issues", - title: "Move to issues", + title: "Move to project", icon: SquareStackIcon, action: () => { setMoveToIssue(true); diff --git a/web/core/constants/empty-state.ts b/web/core/constants/empty-state.ts index 34a205d7e45..267d8cdd798 100644 --- a/web/core/constants/empty-state.ts +++ b/web/core/constants/empty-state.ts @@ -761,11 +761,11 @@ const emptyStateDetails = { }, [EmptyStateType.WORKSPACE_DRAFT_ISSUES]: { key: EmptyStateType.WORKSPACE_DRAFT_ISSUES, - title: "No Draft Issues Yet", - description: "There are no draft issues in your workspace right now. Begin by adding your first one.", + title: "Half-written issues, and soon, comments will show up here.", + description: "To try this out, start adding an issue and leave it mid-way or create your first draft below. 😉", path: "/empty-state/workspace-draft/issue", primaryButton: { - text: "Create draft issue", + text: "Create your first draft", }, accessType: "workspace", access: [EUserPermissions.ADMIN, EUserPermissions.MEMBER],
Would you like to save this issue in drafts?
+ You can save this issue to Drafts so you can come back to it later.{" "} +