Add conversation part for open/closed status changed
See original GitHub issueIssue Description
Problem
We need to add a conversation part that includes a simple border and some small text saying either:
- {{You | username}} closed this conversation {{time-ago}}
- {{You | username}} reopened this conversation {{time-ago}}
These parts should not be shown in the user’s view of a conversation. Only the comment
part_type
should be shown. We’ll have to add a check for whether the user has admin privileges to see that information.
This is blocked by the API adding a part_type
for us to determine the type of conversation part to display.
Also needs https://github.com/code-corps/code-corps-api/issues/1322 to be done to be mergeable.
Issue Analytics
- State:
- Created 5 years ago
- Comments:9 (9 by maintainers)
Top Results From Across the Web
Automatically Changing the Status of an Open Conversation ...
Solution · From the Select a condition drop-down, choose Conversations: Status . · In the next drop-down field, select equal to . ·...
Read more >Get notified when someone's status changes in Teams
Option 1: Create a status change notification through a chat Choose Chat on the left side of the app. In your chat list,...
Read more >Closing and reopening side conversations - Zendesk help
To close a side conversation. Open the side conversation. Click the Mark done button. The side conversation status changes to Done.
Read more >Add to conversation when status changes - General FAQs
This automation will be triggered by a status change and add a comment/update to the conversation section. If you click on the “update”...
Read more >Parts of a Conversation | Element451 Help Center
Learn about the parts of a Conversation: assignees, participants, tags, notes, ... When a conversation is no longer active change the status to...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Proposed solution
rename
conversations/conversation-part
toconversations/conversation-part-comment
All related files
All references to those files
-test.js
renderPage
in testsconversation-thread.hbs
add a
conversations/conversation-part-closed.hbs
The component needs to inject the
currentUser
service, to compare thepart.author.id
withcurrentUser.user.id
and decide if it should renderYou closed this at...
orusername closed this at...
.add tests for this new component
add a
conversations/conversation-part-reopened.hbs
The component needs to inject the
currentUser
service, to compare thepart.author.id
withcurrentUser.user.id
and decide if it should renderYou reopened this at...
orusername reopened this at...
.add tests for this new component
modify conversation thread
components/conversations/conversation-thread.hbs
so that, for each conversation part, it renders a different componentpart_type
iscomment
, render the usualconversations/conversation-part.hbs
. Might want to rename it toconversation-part-comment
part_type
isclosed
, renderconversation-part-closed
part_type
isreopened
, renderconversation-part-reopened
, etc.add tests to support this change
Add client-filtering of parts based on authorizaton
Wrap non-comment parts in the conversation thread under a
{{#if canAdminister project}}
helper, to hide non-comment parts from users who aren’t admins on project.Add integration tests to support this change
canAdminister: true
canAdminister: false
, see if just the comment part is renderedSee
tests/integration/components/task-assignment-test.js
on how to register a fake abilityAs I said in chat, I like the idea of specifying thread type. It could even be used for other potential features.
There is an argument to be made, however, that if we’re rendering a conversation thread of type “project” and another one of type “user”, why not just call them
project-conversation-thread
anduser-conversation-thread
respectively and be done with it?No
{{#if}}
switching within the template, no component logic to test. We just test that the project conv page renders a proper thread of x parts and that the user conv page randers a user thread of x parts.In my view, If a user is able to, in any way, ever, receive data from the API which they should not be able to see, then our API is unsafe and we need to deal with it immediately.
The ember app rendering or not rendering that data, while adding a minor failsafe, is in no way a fix.
So what I’m saying is, if there is a risk, that means we have an API problem.