Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions packages/i18n/src/locales/en/translations.json
Original file line number Diff line number Diff line change
Expand Up @@ -323,6 +323,9 @@
"deleting": "Deleting",
"make_a_copy": "Make a copy",
"move_to_project": "Move to project",
"deleting": "Deleting",
"make_a_copy": "Make a copy",
"move_to_project": "Move to project",
"good": "Good",
"morning": "morning",
"afternoon": "afternoon",
Expand Down Expand Up @@ -1205,6 +1208,7 @@
},

"workspace_draft_issues": {
"draft_an_issue": "Draft an issue",
"draft_an_issue": "Draft an issue",
"empty_state": {
"title": "Half-written issues, and soon, comments will show up here.",
Expand All @@ -1216,6 +1220,15 @@
"delete_modal": {
"title": "Delete draft",
"description": "Are you sure you want to delete this draft? This can't be undone."
},
"toasts": {
"created": {
"success": "Draft created",
"error": "Issue could not be created. Please try again."
},
"deleted": {
"success": "Draft deleted"
}
}
},

Expand Down
10 changes: 6 additions & 4 deletions web/core/components/issues/issue-modal/draft-issue-layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import React, { useState } from "react";
import isEmpty from "lodash/isEmpty";
import { observer } from "mobx-react";
import { useParams, usePathname } from "next/navigation";
import { useTranslation } from "@plane/i18n";
// types
import type { TIssue } from "@plane/types";
// ui
Expand Down Expand Up @@ -35,6 +36,7 @@ export const DraftIssueLayout: React.FC<DraftIssueProps> = observer((props) => {
const { captureIssueEvent } = useEventTracker();
const { handleCreateUpdatePropertyValues } = useIssueModal();
const { createIssue } = useWorkspaceDraftIssues();
const { t } = useTranslation();

const handleClose = () => {
if (data?.id) {
Expand Down Expand Up @@ -80,8 +82,8 @@ export const DraftIssueLayout: React.FC<DraftIssueProps> = observer((props) => {
.then((res) => {
setToast({
type: TOAST_TYPE.SUCCESS,
title: "Success!",
message: "Draft created.",
title: `${t("success")}!`,
message: t("workspace_draft_issues.toast.created.success"),
});
captureIssueEvent({
eventName: "Draft issue created",
Expand All @@ -96,8 +98,8 @@ export const DraftIssueLayout: React.FC<DraftIssueProps> = observer((props) => {
.catch(() => {
setToast({
type: TOAST_TYPE.ERROR,
title: "Error!",
message: "Issue could not be created. Please try again.",
title: `${t("error")}!`,
message: t("workspace_draft_issues.toast.created.error"),
});
captureIssueEvent({
eventName: "Draft issue created",
Expand Down
8 changes: 4 additions & 4 deletions web/core/components/issues/workspace-draft/delete-modal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,8 @@ export const WorkspaceDraftIssueDeleteIssueModal: React.FC<Props> = (props) => {
.then(() => {
setToast({
type: TOAST_TYPE.SUCCESS,
title: "Success!",
message: `draft deleted.`,
title: `${t("success")}!`,
message: t("workspace_draft_issues.toast.deleted.success"),
});
onClose();
})
Expand All @@ -92,8 +92,8 @@ export const WorkspaceDraftIssueDeleteIssueModal: React.FC<Props> = (props) => {
handleSubmit={handleIssueDelete}
isSubmitting={isDeleting}
isOpen={isOpen}
title={t("delete_modal.title")}
content={<>{t("delete_modal.description")}</>}
title={t("workspace_draft_issues.delete_modal.title")}
content={<>{t("workspace_draft_issues.delete_modal.description")}</>}
primaryButtonText={{
loading: t("deleting"),
default: t("delete"),
Expand Down
Loading