mirror of https://gitee.com/answerdev/answer.git
fix(TagInfo): Set the correct permissions and prompt text for deleting tags
This commit is contained in:
parent
d8409d5e26
commit
ce88efb174
|
@ -454,10 +454,13 @@ ui:
|
||||||
synonyms_text: The following tags will be remapped to
|
synonyms_text: The following tags will be remapped to
|
||||||
delete:
|
delete:
|
||||||
title: Delete this tag
|
title: Delete this tag
|
||||||
content: >-
|
tip_with_posts: >-
|
||||||
<p>We do not allowed deleting tag with posts.</p><p>Please remove this tag
|
<p>We do not allowed <strong>deleting tag with posts</strong>.</p>
|
||||||
from the posts first.</p>
|
<p>Please remove this tag from the posts first.</p>
|
||||||
content2: Are you sure you wish to delete?
|
tip_with_synonyms: >-
|
||||||
|
<p>We do not allowed <strong>deleting tag with synonyms</strong>.</p>
|
||||||
|
<p>Please remove the synonyms from this tag first.</p>
|
||||||
|
tip: Are you sure you wish to delete?
|
||||||
close: Close
|
close: Close
|
||||||
edit_tag:
|
edit_tag:
|
||||||
title: Edit Tag
|
title: Edit Tag
|
||||||
|
|
|
@ -86,15 +86,27 @@ const TagIntroduction = () => {
|
||||||
if (synonymsData?.synonyms && synonymsData.synonyms.length > 0) {
|
if (synonymsData?.synonyms && synonymsData.synonyms.length > 0) {
|
||||||
Modal.confirm({
|
Modal.confirm({
|
||||||
title: t('delete.title'),
|
title: t('delete.title'),
|
||||||
content: t('delete.content2'),
|
content: t('delete.tip_with_synonyms'),
|
||||||
showConfirm: false,
|
showConfirm: false,
|
||||||
cancelText: t('delete.close'),
|
cancelText: t('delete.close'),
|
||||||
});
|
});
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
if (tagInfo.question_count > 0) {
|
||||||
|
Modal.confirm({
|
||||||
|
title: t('delete.title'),
|
||||||
|
content: t('delete.tip_with_posts'),
|
||||||
|
showConfirm: false,
|
||||||
|
cancelText: t('delete.close'),
|
||||||
|
});
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
Modal.confirm({
|
Modal.confirm({
|
||||||
title: t('delete.title'),
|
title: t('delete.title'),
|
||||||
content: t('delete.content'),
|
content: t('delete.tip'),
|
||||||
|
confirmText: t('delete', { keyPrefix: 'btns' }),
|
||||||
|
confirmBtnVariant: 'danger',
|
||||||
onConfirm: () => {
|
onConfirm: () => {
|
||||||
deleteTag(tagInfo.tag_id);
|
deleteTag(tagInfo.tag_id);
|
||||||
},
|
},
|
||||||
|
|
Loading…
Reference in New Issue