feat: translation flows, revision conflicts, delete scopes, article moves and a target site for new articles
This commit is contained in:
1 parent
339e646eb8
commit
45fbbc33b1
93 files changed
+7630
-294
No files matched your search
@@ -57,8 +57,8 @@ function blocksWholeArticle(context: OverflowContext) {
|
||||
return context.siblings.some((sibling) => !holds(sibling.capabilities, 'delete'))
|
||||
}
|
||||
|
||||
function blockedExtra(blocked: boolean): Partial<OverflowItem> {
|
||||
return blocked ? { disabled: true, reason: t("You can't delete this article.") } : {}
|
||||
function blockedExtra(blocked: boolean, reason: string): Partial<OverflowItem> {
|
||||
return blocked ? { disabled: true, reason } : {}
|
||||
}
|
||||
|
||||
function editItems(context: OverflowContext): OverflowItem[] {
|
||||
@@ -70,12 +70,19 @@ function editItems(context: OverflowContext): OverflowItem[] {
|
||||
t('Move article'),
|
||||
'i-lucide-arrow-right-left',
|
||||
context,
|
||||
blockedExtra(blocked),
|
||||
blockedExtra(blocked, t("You can't delete this article.")),
|
||||
),
|
||||
]
|
||||
}
|
||||
|
||||
function deleteItems(context: OverflowContext): OverflowItem[] {
|
||||
if (context.language && context.siblings.length === 0) {
|
||||
return [
|
||||
item('deleteArticle', t('Delete article'), 'i-lucide-trash-2', context, {
|
||||
danger: true,
|
||||
}),
|
||||
]
|
||||
}
|
||||
const versionItem = item(
|
||||
'deleteVersion',
|
||||
deleteVersionLabel(context.language),
|
||||
@@ -91,7 +98,7 @@ function deleteItems(context: OverflowContext): OverflowItem[] {
|
||||
versionItem,
|
||||
item('deleteArticle', t('Delete article'), 'i-lucide-trash-2', context, {
|
||||
danger: !blocked,
|
||||
...blockedExtra(blocked),
|
||||
...blockedExtra(blocked, t("You can't delete this article.")),
|
||||
}),
|
||||
]
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user