DEV: Add loading spinner to history modal (#22666)

https://github.com/discourse/discourse/assets/50783505/b5f510a8-719c-461c-a02f-a8b3a8573466
This commit is contained in:
Isaac Janzen 2023-07-18 12:30:27 -05:00 committed by GitHub
parent d258bda2fe
commit 6ba8259918
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 31 additions and 29 deletions

View File

@ -4,6 +4,7 @@
class="history-modal"
>
<:body>
<ConditionalLoadingSpinner @condition={{this.loading}}>
<Modal::History::Revision
@model={{this.postRevision}}
@mobileView={{this.site.mobileView}}
@ -31,6 +32,7 @@
@calculateBodyDiff={{this.calculateBodyDiff}}
@titleDiff={{this.titleDiff}}
/>
</ConditionalLoadingSpinner>
</:body>
<:footer>
{{#if @model.editPost}}

View File

@ -168,8 +168,8 @@ export default class History extends Component {
refresh(postId, postVersion) {
this.loading = true;
Post.loadRevision(postId, postVersion).then((result) => {
this.loading = false;
this.postRevision = result;
this.loading = false;
});
}

View File

@ -68,6 +68,7 @@
<LinksRedirect
@class="row body-diff"
{{did-insert @calculateBodyDiff @bodyDiffHTML}}
{{did-update @calculateBodyDiff @bodyDiffHTML}}
>
{{html-safe @bodyDiff}}

View File

@ -42,7 +42,6 @@ acceptance("Edit Notification Click", function (needs) {
await visit("/");
await click(".header-dropdown-toggle.current-user");
await click(".notification.edited a");
const [v1, v2] = queryAll(".history-modal .revision-content");
assert.strictEqual(