-
Notifications
You must be signed in to change notification settings - Fork 1.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[WEB-2629] chore: workspace draft issue ux copy updated #5825
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||||||
---|---|---|---|---|---|---|---|---|---|---|
|
@@ -8,24 +8,22 @@ | |||||||||
// constants | ||||||||||
import { PROJECT_ERROR_MESSAGES } from "@/constants/project"; | ||||||||||
// hooks | ||||||||||
import { useIssues, useProject, useUser, useUserPermissions } from "@/hooks/store"; | ||||||||||
import { useIssues, useUser, useUserPermissions } from "@/hooks/store"; | ||||||||||
import { EUserPermissions, EUserPermissionsLevel } from "@/plane-web/constants/user-permissions"; | ||||||||||
type Props = { | ||||||||||
isOpen: boolean; | ||||||||||
handleClose: () => void; | ||||||||||
dataId?: string | null | undefined; | ||||||||||
data?: TWorkspaceDraftIssue; | ||||||||||
isSubIssue?: boolean; | ||||||||||
onSubmit?: () => Promise<void>; | ||||||||||
}; | ||||||||||
|
||||||||||
export const WorkspaceDraftIssueDeleteIssueModal: React.FC<Props> = (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 @@ | |||||||||
|
||||||||||
// 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 @@ | |||||||||
setToast({ | ||||||||||
type: TOAST_TYPE.SUCCESS, | ||||||||||
title: "Success!", | ||||||||||
message: `${isSubIssue ? "Sub-issue" : "Issue"} deleted successfully`, | ||||||||||
message: `draft deleted.`, | ||||||||||
}); | ||||||||||
onClose(); | ||||||||||
}) | ||||||||||
|
@@ -92,14 +89,8 @@ | |||||||||
handleSubmit={handleIssueDelete} | ||||||||||
isSubmitting={isDeleting} | ||||||||||
isOpen={isOpen} | ||||||||||
title="Delete issue" | ||||||||||
content={ | ||||||||||
<> | ||||||||||
Are you sure you want to delete issue{" "} | ||||||||||
<span className="break-words font-medium text-custom-text-100">{projectDetails?.identifier}</span> | ||||||||||
{""}? 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.</>} | ||||||||||
Comment on lines
+92
to
+93
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. LGTM: Improved clarity in modal title and content The updates to the modal title and content accurately reflect the action of deleting a draft, which is consistent with the component's new focus. The content clearly communicates the permanence of the action, which is important for user awareness. There's a minor issue with the apostrophe in "can't" as flagged by the static analysis tool. To resolve this, please apply the following change: - content={<>Are you sure you want to delete this draft? This can't be undone.</>}
+ content={<>Are you sure you want to delete this draft? This can't be undone.</>} This change will ensure proper rendering of the apostrophe across different environments. 📝 Committable suggestion
Suggested change
🧰 Tools🪛 GitHub Check: lint-web
|
||||||||||
/> | ||||||||||
); | ||||||||||
}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💡 Codebase verification
Inconsistent Capitalization of "Drafts" in User-Facing Text
The shell script results indicate that "Drafts" is used inconsistently across various user-facing components and messages. To ensure a uniform user experience, please update all instances of "draft" to "Drafts" in user interface elements and documentation.
🔗 Analysis chain
Consistent button text
The change from "Save draft" to "Save to Drafts" aligns well with the updated dialog title and description. It clearly indicates the action and destination of the draft.
To ensure consistency across the application, please verify that "Drafts" is capitalized in other relevant components and documentation. Run the following script to check for inconsistencies:
🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
Length of output: 70
Script:
Length of output: 16708