[COMPONENTS][Conversation] reply_add route nows shows the given Note entire conversation, the Note itself is highlighted in the conversation
This commit is contained in:
@@ -26,10 +26,10 @@ declare(strict_types = 1);
|
||||
|
||||
namespace Component\Conversation\Controller;
|
||||
|
||||
use function App\Core\I18n\_m;
|
||||
use Component\Feed\Feed;
|
||||
use Component\Feed\Util\FeedController;
|
||||
use Symfony\Component\HttpFoundation\Request;
|
||||
use function App\Core\I18n\_m;
|
||||
|
||||
class Conversation extends FeedController
|
||||
{
|
||||
@@ -40,15 +40,6 @@ class Conversation extends FeedController
|
||||
*/
|
||||
public function showConversation(Request $request, int $conversation_id)
|
||||
{
|
||||
// TODO:
|
||||
// if note is root -> just link
|
||||
// if note is a reply -> link from above plus anchor
|
||||
|
||||
/* $notes = DB::findBy(
|
||||
table: 'note',
|
||||
criteria: ['conversation_id' => $conversation_id],
|
||||
order_by: ['created' => 'DESC', 'id' => 'DESC']
|
||||
);*/
|
||||
$data = Feed::query(query: "note-conversation:{$conversation_id}", page: $this->int('p') ?? 1);
|
||||
$notes = $data['notes'];
|
||||
return [
|
||||
|
@@ -32,8 +32,10 @@ use App\Util\Exception\ClientException;
|
||||
use App\Util\Exception\NoLoggedInUser;
|
||||
use App\Util\Exception\NoSuchNoteException;
|
||||
use App\Util\Exception\ServerException;
|
||||
use Component\Feed\Feed;
|
||||
use Component\Feed\Util\FeedController;
|
||||
use Symfony\Component\HttpFoundation\Request;
|
||||
use function App\Core\I18n\_m;
|
||||
|
||||
class Reply extends FeedController
|
||||
{
|
||||
@@ -56,9 +58,14 @@ class Reply extends FeedController
|
||||
throw new NoSuchNoteException();
|
||||
}
|
||||
|
||||
$conversation_id = $note->getConversationId();
|
||||
$data = Feed::query(query: "note-conversation:{$conversation_id}", page: $this->int('p') ?? 1);
|
||||
$notes = $data['notes'];
|
||||
return [
|
||||
'_template' => 'reply/add_reply.html.twig',
|
||||
'note' => $note,
|
||||
'_template' => 'feed/feed.html.twig',
|
||||
'notes' => $notes,
|
||||
'should_format' => false,
|
||||
'page_title' => _m('Conversation'),
|
||||
];
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user