DEV: allows to prepend widgets to post nav controls (#10005)

DEV: allows to prepend widgets to post nav controls (#10005)

Co-authored-by: RĂ©gis Hanol regis@hanol.fr

diff --git a/app/assets/javascripts/discourse/app/widgets/post-menu.js b/app/assets/javascripts/discourse/app/widgets/post-menu.js
index 3798d71..00520eb 100644
--- a/app/assets/javascripts/discourse/app/widgets/post-menu.js
+++ b/app/assets/javascripts/discourse/app/widgets/post-menu.js
@@ -552,8 +552,17 @@ export default createWidget("post-menu", {
       postControls.push(repliesButton);
     }
 
-    let extraControls = applyDecorators(this, "extra-controls", attrs, state);
-    postControls.push(h("div.actions", visibleButtons.concat(extraControls)));
+    const extraControls = applyDecorators(this, "extra-controls", attrs, state);
+    const beforeExtraControls = applyDecorators(
+      this,
+      "before-extra-controls",
+      attrs,
+      state
+    );
+
+    const controlsButtons = [...beforeExtraControls, ...visibleButtons, ...extraControls];
+
+    postControls.push(h("div.actions", controlsButtons));
     if (state.adminVisible) {
       postControls.push(this.attach("post-admin-menu", attrs));
     }

GitHub sha: a3cf1cf6

This commit appears in #10005 which was approved by ZogStriP. It was merged by jjaffeux.