DEV: migrates reviewable-created-by-name to gjs (#27861)

This commit is contained in:
Joffrey JAFFEUX 2024-07-11 11:54:17 +02:00 committed by GitHub
parent 7b91aff46f
commit 38f80be810
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
6 changed files with 30 additions and 29 deletions

View File

@ -0,0 +1,27 @@
import { hash } from "@ember/helper";
import PluginOutlet from "discourse/components/plugin-outlet";
import UserLink from "discourse/components/user-link";
import icon from "discourse-common/helpers/d-icon";
import i18n from "discourse-common/helpers/i18n";
const ReviewableCreatedByName = <template>
<div class="names">
<span class="username">
{{#if @user}}
<UserLink @user={{@user}}>{{@user.username}}</UserLink>
{{#if @user.silenced}}
{{icon "ban" title="user.silenced_tooltip"}}
{{/if}}
{{else}}
{{i18n "review.deleted_user"}}
{{/if}}
</span>
<PluginOutlet
@name="after-reviewable-post-user"
@connectorTagName="div"
@outletArgs={{hash user=@user}}
/>
</div>
</template>;
export default ReviewableCreatedByName;

View File

@ -1,17 +0,0 @@
<div class="names">
<span class="username">
{{#if this.user}}
<UserLink @user={{this.user}}>{{this.user.username}}</UserLink>
{{#if this.user.silenced}}
{{d-icon "ban" title="user.silenced_tooltip"}}
{{/if}}
{{else}}
{{i18n "review.deleted_user"}}
{{/if}}
</span>
<PluginOutlet
@name="after-reviewable-post-user"
@connectorTagName="div"
@outletArgs={{hash user=this.user}}
/>
</div>

View File

@ -1,3 +0,0 @@
import Component from "@ember/component";
export default Component.extend({});

View File

@ -37,10 +37,7 @@
{{#if this.reviewable.created_by}} {{#if this.reviewable.created_by}}
<div class="editable-created-by"> <div class="editable-created-by">
{{avatar this.reviewable.created_by imageSize="tiny"}} {{avatar this.reviewable.created_by imageSize="tiny"}}
<ReviewableCreatedByName <ReviewableCreatedByName @user={{this.reviewable.created_by}} />
@user={{this.reviewable.created_by}}
@tagName=""
/>
</div> </div>
{{/if}} {{/if}}

View File

@ -1,5 +1,5 @@
<div class="reviewable-post-header"> <div class="reviewable-post-header">
<ReviewableCreatedByName @user={{this.createdBy}} @tagName="" /> <ReviewableCreatedByName @user={{this.createdBy}} />
{{#if this.reviewable.reply_to_post_number}} {{#if this.reviewable.reply_to_post_number}}
<a <a
href={{concat href={{concat

View File

@ -404,10 +404,7 @@
@tagName="" @tagName=""
/> />
<div class="post-contents"> <div class="post-contents">
<ReviewableCreatedByName <ReviewableCreatedByName @user={{this.currentUser}} />
@user={{this.currentUser}}
@tagName=""
/>
<div class="post-body"><CookText <div class="post-body"><CookText
@rawText={{pending.raw}} @rawText={{pending.raw}}
/></div> /></div>