Skip to content

Add message search permalinks to Vue left menu

Eric Eastwood requested to merge vue-left-menu-message-search-permalinks into develop

Add message search permalinks to Vue left menu

Follow-up MR to https://gitlab.com/gitlab-org/gitter/webapp/merge_requests/1360

Clicking on a message search result now brings you to that message in chat

Testing

Setup

Since Elasticsearch doesn't work in development, we need to fake it. Replace the following lines and change the "id":"5cf8bf9f5488194300155927" to a message ID in the room you are looking at.

https://gitlab.com/gitlab-org/gitter/webapp/blob/7984c4966f8322a319172400561f064372ff013c/server/api/v1/rooms/chat-messages.js#L43-52

    if (q) {
      /* */
      options = {
        skip: parseInt(skip, 10) || 0,
        limit: parseInt(limit, 10) || 50,
        lang: lang,
        userId: userId
      };

      query = chatService.searchChatMessagesForRoom(troupeId, '' + q, options);
      /* */
      return `[{"id":"5cf8bf9f5488194300155927","text":"@MadLittleMods For some groups it might not matter much, but for others a lot.  Kinda like stack overflows 'take this offline' thing when you start doing a conversation in the comments.  Im' sure it's not simple to design","html":"<span data-link-type=\\"mention\\" data-screen-name=\\"MadLittleMods\\" class=\\"mention\\">@MadLittleMods</span> For some groups it might not matter much, but for others a lot.  Kinda like stack overflows &#39;take this offline&#39; thing when you start doing a conversation in the comments.  Im&#39; sure it&#39;s not simple to design","sent":"2016-05-18T02:48:51.386Z","fromUser":{"id":"5716e949187bb6f0eae04dd7","username":"awbacker","displayName":"Andrew Backer","url":"/awbacker","avatarUrl":"https://avatars-03.gitter.im/gh/uv/4/awbacker","avatarUrlSmall":"https://avatars0.githubusercontent.com/u/103330?v=4&s=60","avatarUrlMedium":"https://avatars0.githubusercontent.com/u/103330?v=4&s=128","v":2,"gv":"4"},"unread":false,"readBy":40,"urls":[],"mentions":[{"screenName":"MadLittleMods","userId":"553d437215522ed4b3df8c50","userIds":[]}],"issues":[],"meta":[],"highlights":["offline"],"v":1}]`;
    }

Reproduction

  1. Open the search view and search anything, wait for the results
  2. Click on the result and watch the chat view jump to the message
Edited by Eric Eastwood

Merge request reports