UX: Indicate capped history revisions only when they're actually capped (#14000)

We've recently added a limit to the posts history modal so it displays the last 100 revisions only for performance reasons. However, the title of the modal now always says `History, last 100 revisions` even when the post has fewer than 100 revisions which can be a bit noisy.

This PR amends the history modal so the title of the modal says `History` when the post's revisions count is ≤100, and `History, last 100 revisions` when it has more >100 revisions.
This commit is contained in:
Osama Sayegh
2021-08-11 00:24:37 +03:00
committed by GitHub
parent 8569895f71
commit bdcb96ad1b
3 changed files with 12 additions and 2 deletions

View File

@@ -46,6 +46,15 @@ export default Controller.extend(ModalFunctionality, {
previousTagChanges: customTagArray("model.tags_changes.previous"),
currentTagChanges: customTagArray("model.tags_changes.current"),
@discourseComputed("post.version")
modalTitleKey(version) {
if (version > 100) {
return "history_capped_revisions";
} else {
return "history";
}
},
@discourseComputed(
"previousVersion",
"model.current_version",

View File

@@ -1,4 +1,4 @@
{{#d-modal-body title="history" maxHeight="70%"}}
{{#d-modal-body title=modalTitleKey maxHeight="70%"}}
<div id="revision">
<div id="revision-details">
{{d-icon "pencil-alt"}}

View File

@@ -3402,7 +3402,8 @@ en:
one: "user"
other: "users"
category_title: "Category"
history: "History, last 100 revisions"
history_capped_revisions: "History, last 100 revisions"
history: "History"
changed_by: "by %{author}"
raw_email: