@@ -6,7 +6,6 @@ import { hbs } from "ember-cli-htmlbars";
6
6
import { h } from "virtual-dom" ;
7
7
import { renderAvatar } from "discourse/helpers/user-avatar" ;
8
8
import discourseComputed from "discourse/lib/decorators" ;
9
- import { withSilencedDeprecations } from "discourse/lib/deprecated" ;
10
9
import getURL from "discourse/lib/get-url" ;
11
10
import { iconHTML , iconNode } from "discourse/lib/icon-library" ;
12
11
import { withPluginApi } from "discourse/lib/plugin-api" ;
@@ -16,10 +15,7 @@ import { escapeExpression } from "discourse/lib/utilities";
16
15
import RawHtml from "discourse/widgets/raw-html" ;
17
16
import RenderGlimmer from "discourse/widgets/render-glimmer" ;
18
17
import { i18n } from "discourse-i18n" ;
19
- import AssignButton , {
20
- assignPost ,
21
- unassignPost ,
22
- } from "../components/assign-button" ;
18
+ import AssignButton from "../components/assign-button" ;
23
19
import BulkActionsAssignUser from "../components/bulk-actions/bulk-assign-user" ;
24
20
import EditTopicAssignments from "../components/modal/edit-topic-assignments" ;
25
21
import TopicLevelAssignMenu from "../components/topic-level-assign-menu" ;
@@ -778,7 +774,7 @@ function initialize(api) {
778
774
}
779
775
780
776
function customizePostMenu ( api ) {
781
- const transformerRegistered = api . registerValueTransformer (
777
+ api . registerValueTransformer (
782
778
"post-menu-buttons" ,
783
779
( {
784
780
value : dag ,
@@ -804,47 +800,6 @@ function customizePostMenu(api) {
804
800
) ;
805
801
}
806
802
) ;
807
-
808
- const silencedKey =
809
- transformerRegistered && "discourse.post-menu-widget-overrides" ;
810
-
811
- withSilencedDeprecations ( silencedKey , ( ) => customizeWidgetPostMenu ( api ) ) ;
812
- }
813
-
814
- function customizeWidgetPostMenu ( api ) {
815
- api . addPostMenuButton ( "assign" , ( post ) => {
816
- if ( post . firstPost ) {
817
- return ;
818
- }
819
- if ( post . assigned_to_user || post . assigned_to_group ) {
820
- return {
821
- action : "unassignPost" ,
822
- icon : "user-xmark" ,
823
- className : "unassign-post" ,
824
- title : "discourse_assign.unassign_post.title" ,
825
- position :
826
- post . assigned_to_user ?. id === api . getCurrentUser ( ) . id
827
- ? "first"
828
- : "second-last-hidden" ,
829
- } ;
830
- } else {
831
- return {
832
- action : "assignPost" ,
833
- icon : "user-plus" ,
834
- className : "assign-post" ,
835
- title : "discourse_assign.assign_post.title" ,
836
- position : "second-last-hidden" ,
837
- } ;
838
- }
839
- } ) ;
840
-
841
- api . attachWidgetAction ( "post" , "assignPost" , function ( ) {
842
- assignPost ( this . model , getOwner ( this ) . lookup ( "service:task-actions" ) ) ;
843
- } ) ;
844
-
845
- api . attachWidgetAction ( "post" , "unassignPost" , function ( ) {
846
- unassignPost ( this . model , getOwner ( this ) . lookup ( "service:task-actions" ) ) ;
847
- } ) ;
848
803
}
849
804
850
805
const REGEXP_USERNAME_PREFIX = / ^ ( a s s i g n e d : ) / gi;
0 commit comments