@@ -6,7 +6,6 @@ import { hbs } from "ember-cli-htmlbars";
66import { h } from "virtual-dom" ;
77import { renderAvatar } from "discourse/helpers/user-avatar" ;
88import discourseComputed from "discourse/lib/decorators" ;
9- import { withSilencedDeprecations } from "discourse/lib/deprecated" ;
109import getURL from "discourse/lib/get-url" ;
1110import { iconHTML , iconNode } from "discourse/lib/icon-library" ;
1211import { withPluginApi } from "discourse/lib/plugin-api" ;
@@ -16,10 +15,7 @@ import { escapeExpression } from "discourse/lib/utilities";
1615import RawHtml from "discourse/widgets/raw-html" ;
1716import RenderGlimmer from "discourse/widgets/render-glimmer" ;
1817import { i18n } from "discourse-i18n" ;
19- import AssignButton , {
20- assignPost ,
21- unassignPost ,
22- } from "../components/assign-button" ;
18+ import AssignButton from "../components/assign-button" ;
2319import BulkActionsAssignUser from "../components/bulk-actions/bulk-assign-user" ;
2420import EditTopicAssignments from "../components/modal/edit-topic-assignments" ;
2521import TopicLevelAssignMenu from "../components/topic-level-assign-menu" ;
@@ -778,7 +774,7 @@ function initialize(api) {
778774}
779775
780776function customizePostMenu ( api ) {
781- const transformerRegistered = api . registerValueTransformer (
777+ api . registerValueTransformer (
782778 "post-menu-buttons" ,
783779 ( {
784780 value : dag ,
@@ -804,47 +800,6 @@ function customizePostMenu(api) {
804800 ) ;
805801 }
806802 ) ;
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- } ) ;
848803}
849804
850805const REGEXP_USERNAME_PREFIX = / ^ ( a s s i g n e d : ) / gi;
0 commit comments