From 286efd1537096f20f0153b10fedf6ccfbdc95121 Mon Sep 17 00:00:00 2001 From: Andrei Prigorshnev Date: Mon, 4 Mar 2024 21:28:35 +0400 Subject: [PATCH] WIP: refactor --- assets/javascripts/discourse/widgets/assigned-to.js | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/assets/javascripts/discourse/widgets/assigned-to.js b/assets/javascripts/discourse/widgets/assigned-to.js index f925ee09..f14d15d3 100644 --- a/assets/javascripts/discourse/widgets/assigned-to.js +++ b/assets/javascripts/discourse/widgets/assigned-to.js @@ -1,3 +1,4 @@ +import { getOwner } from "@ember/application"; import { hbs } from "ember-cli-htmlbars"; import { h } from "virtual-dom"; import RenderGlimmer from "discourse/widgets/render-glimmer"; @@ -39,12 +40,21 @@ export const AssignedToWidget = ["assigned-to", { + `, { post: this.attrs.post, + editAssignment: () => this.editAssignment() } ) ]; }, + + editAssignment() { + const taskActions = getOwner(this).lookup("service:task-actions"); + taskActions.showAssignModal(this.attrs.post, { + targetType: "Post", + }); + } }];