ФУНКЦИИ - МЕЖПРОЕКТНАЯ КОММУНИКАЦИЯ: guest-доступ Operational Core
This commit is contained in:
+6
-2
@@ -120,10 +120,14 @@ export const BaseCalendarRoot = observer(function BaseCalendarRoot(props: IBaseC
|
||||
issueProjectId,
|
||||
updateIssue
|
||||
).catch((err) => {
|
||||
const message =
|
||||
err?.detail === "You are not allowed to move this work item"
|
||||
? "У вас нет прав перемещать эту карточку"
|
||||
: "Не удалось выполнить действие";
|
||||
setToast({
|
||||
title: "Error!",
|
||||
title: "Ошибка",
|
||||
type: TOAST_TYPE.ERROR,
|
||||
message: err?.detail ?? "Failed to perform this action",
|
||||
message,
|
||||
});
|
||||
});
|
||||
};
|
||||
|
||||
@@ -103,7 +103,7 @@ export const BaseGanttRoot = observer(function BaseGanttRoot(props: IBaseGanttRo
|
||||
setToast({
|
||||
type: TOAST_TYPE.ERROR,
|
||||
title: t("toast.error"),
|
||||
message: "Error while updating work item dates, Please try again Later",
|
||||
message: "Не удалось обновить даты карточки. Попробуйте позже.",
|
||||
});
|
||||
}),
|
||||
[issues, projectId, workspaceSlug]
|
||||
|
||||
@@ -305,10 +305,10 @@ export const KanbanIssueBlock = observer(function KanbanIssueBlock(props: IssueB
|
||||
else {
|
||||
setToast({
|
||||
type: TOAST_TYPE.WARNING,
|
||||
title: "Cannot move work item",
|
||||
title: "Нельзя переместить карточку",
|
||||
message: !canEditIssueProperties
|
||||
? "You are not allowed to move this work item"
|
||||
: "Drag and drop is disabled for the current grouping",
|
||||
? "У вас нет прав перемещать эту карточку"
|
||||
: "Перетаскивание отключено для текущей группировки",
|
||||
});
|
||||
}
|
||||
}}
|
||||
|
||||
@@ -243,10 +243,10 @@ export const IssueBlock = observer(function IssueBlock(props: IssueBlockProps) {
|
||||
if (!isDraggingAllowed) {
|
||||
setToast({
|
||||
type: TOAST_TYPE.WARNING,
|
||||
title: "Cannot move work item",
|
||||
title: "Нельзя переместить карточку",
|
||||
message: !canEditIssueProperties
|
||||
? "You are not allowed to move this work item"
|
||||
: "Drag and drop is disabled for the current grouping",
|
||||
? "У вас нет прав перемещать эту карточку"
|
||||
: "Перетаскивание отключено для текущей группировки",
|
||||
});
|
||||
}
|
||||
}}
|
||||
|
||||
@@ -183,7 +183,7 @@ const getCycleColumns = (): IGroupByColumn[] | undefined => {
|
||||
icon: <CycleGroupIcon cycleGroup={cycleStatus} className="h-3.5 w-3.5" />,
|
||||
payload: { cycle_id: cycle.id },
|
||||
isDropDisabled,
|
||||
dropErrorMessage: isDropDisabled ? "Work item cannot be moved to completed cycles" : undefined,
|
||||
dropErrorMessage: isDropDisabled ? "Карточку нельзя перенести в завершённый цикл" : undefined,
|
||||
});
|
||||
});
|
||||
cycles.push({
|
||||
|
||||
@@ -27,6 +27,13 @@ type DNDStoreType =
|
||||
| EIssuesStoreType.EPIC
|
||||
| EIssuesStoreType.TEAM_PROJECT_WORK_ITEMS;
|
||||
|
||||
const resolveDragDropErrorMessage = (message?: string) => {
|
||||
if (message === "You are not allowed to move this work item") return "У вас нет прав перемещать эту карточку";
|
||||
if (message === "Work item cannot be moved to completed cycles") return "Карточку нельзя перенести в завершённый цикл";
|
||||
if (message === "Failed to perform this action") return "Не удалось выполнить действие";
|
||||
return message || "Не удалось выполнить действие";
|
||||
};
|
||||
|
||||
export const useGroupIssuesDragNDrop = (
|
||||
storeType: DNDStoreType,
|
||||
orderBy: TIssueOrderByOptions | undefined,
|
||||
@@ -63,8 +70,8 @@ export const useGroupIssuesDragNDrop = (
|
||||
) => {
|
||||
const errorToastProps = {
|
||||
type: TOAST_TYPE.ERROR,
|
||||
title: "Error!",
|
||||
message: "Error while updating work item",
|
||||
title: "Ошибка",
|
||||
message: "Не удалось обновить карточку",
|
||||
};
|
||||
const moduleKey = ISSUE_FILTER_DEFAULT_DATA["module"];
|
||||
const cycleKey = ISSUE_FILTER_DEFAULT_DATA["cycle"];
|
||||
@@ -117,9 +124,9 @@ export const useGroupIssuesDragNDrop = (
|
||||
orderBy !== "sort_order"
|
||||
).catch((err) => {
|
||||
setToast({
|
||||
title: "Error!",
|
||||
title: "Ошибка",
|
||||
type: TOAST_TYPE.ERROR,
|
||||
message: err?.detail ?? "Failed to perform this action",
|
||||
message: resolveDragDropErrorMessage(err?.detail),
|
||||
});
|
||||
});
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user