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:
parent
d258bda2fe
commit
6ba8259918
|
@ -4,33 +4,35 @@
|
|||
class="history-modal"
|
||||
>
|
||||
<:body>
|
||||
<Modal::History::Revision
|
||||
@model={{this.postRevision}}
|
||||
@mobileView={{this.site.mobileView}}
|
||||
@wikiDisabled={{this.wikiDisabled}}
|
||||
@previousCategory={{this.previousCategory}}
|
||||
@currentCategory={{this.currentCategory}}
|
||||
@displayInline={{this.displayInline}}
|
||||
@displaySideBySide={{this.displaySideBySide}}
|
||||
@displaySideBySideMarkdown={{this.displaySideBySideMarkdown}}
|
||||
@viewMode={{this.viewMode}}
|
||||
/>
|
||||
<Modal::History::Revisions
|
||||
@model={{this.postRevision}}
|
||||
@hiddenClasses={{this.hiddenClasses}}
|
||||
@mobileView={{this.site.mobileView}}
|
||||
@userChanges={{this.user_changes}}
|
||||
@wikiDisabled={{this.wikiDisabled}}
|
||||
@postTypeDisabled={{this.postTypeDisabled}}
|
||||
@previousCategory={{this.previousCategory}}
|
||||
@currentCategory={{this.currentCategory}}
|
||||
@previousTagChanges={{this.previousTagChanges}}
|
||||
@currentTagChanges={{this.currentTagChanges}}
|
||||
@bodyDiffHTML={{this.bodyDiffHTML}}
|
||||
@bodyDiff={{this.bodyDiff}}
|
||||
@calculateBodyDiff={{this.calculateBodyDiff}}
|
||||
@titleDiff={{this.titleDiff}}
|
||||
/>
|
||||
<ConditionalLoadingSpinner @condition={{this.loading}}>
|
||||
<Modal::History::Revision
|
||||
@model={{this.postRevision}}
|
||||
@mobileView={{this.site.mobileView}}
|
||||
@wikiDisabled={{this.wikiDisabled}}
|
||||
@previousCategory={{this.previousCategory}}
|
||||
@currentCategory={{this.currentCategory}}
|
||||
@displayInline={{this.displayInline}}
|
||||
@displaySideBySide={{this.displaySideBySide}}
|
||||
@displaySideBySideMarkdown={{this.displaySideBySideMarkdown}}
|
||||
@viewMode={{this.viewMode}}
|
||||
/>
|
||||
<Modal::History::Revisions
|
||||
@model={{this.postRevision}}
|
||||
@hiddenClasses={{this.hiddenClasses}}
|
||||
@mobileView={{this.site.mobileView}}
|
||||
@userChanges={{this.user_changes}}
|
||||
@wikiDisabled={{this.wikiDisabled}}
|
||||
@postTypeDisabled={{this.postTypeDisabled}}
|
||||
@previousCategory={{this.previousCategory}}
|
||||
@currentCategory={{this.currentCategory}}
|
||||
@previousTagChanges={{this.previousTagChanges}}
|
||||
@currentTagChanges={{this.currentTagChanges}}
|
||||
@bodyDiffHTML={{this.bodyDiffHTML}}
|
||||
@bodyDiff={{this.bodyDiff}}
|
||||
@calculateBodyDiff={{this.calculateBodyDiff}}
|
||||
@titleDiff={{this.titleDiff}}
|
||||
/>
|
||||
</ConditionalLoadingSpinner>
|
||||
</:body>
|
||||
<:footer>
|
||||
{{#if @model.editPost}}
|
||||
|
|
|
@ -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;
|
||||
});
|
||||
}
|
||||
|
||||
|
|
|
@ -68,6 +68,7 @@
|
|||
|
||||
<LinksRedirect
|
||||
@class="row body-diff"
|
||||
{{did-insert @calculateBodyDiff @bodyDiffHTML}}
|
||||
{{did-update @calculateBodyDiff @bodyDiffHTML}}
|
||||
>
|
||||
{{html-safe @bodyDiff}}
|
||||
|
|
|
@ -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(
|
||||
|
|
Loading…
Reference in New Issue