Forum Discussion

PerBonomi's avatar
9 years ago

Reply "Collision detection"

Since our Super Users asked for it I cobbled together this widget. It's not perfect, but it seems to be working.

I asked Lithium to add a custom field for messages, so I can save a state of who is currently replying to a post and when they hit reply.

Logic:

On loading the Reply Page, check if the user has a certain role, like Super User.

If yes:

- add the current user's id and system time to the list in that custom field.

- check that same field for other entries

- If an entry is found, check how long ago the other user(s) loaded the Reply page and if within a certain time frame, show the current user who else is replying.

Since I don't know how to cleanly hook into the reply (post) button's built-in triggers I added a mouseenter trigger to the Post and Cancel buttons, which removes the user's id and time from the custom field.

Screenshot below. Code is attached. One component, one endpoint.

 

15 Replies

  • ClaudiusH's avatar
    ClaudiusH
    Khoros Alumni (Retired)
    8 years ago

    PerBonomi Your code is suggesting that this component will only show to a super user if other super users are responding to the same topic.

    Wendy_S Your screenshot though suggests that it will show to super users if any community member is responding. Is that correct?

     

    I actually favour the variant where only SUs see other SUs responding as the second variant seems quite intrusive to almost the level of monitoring members' behaviour. Also usually the SU's / staff's worry  most of the time seems to be to respond to a topic another SU/staff is responding to and not necessarily normal "mortal" members.

  • Wendy_S's avatar
    Wendy_S
    Boss
    8 years ago

    You are right Claudius. I like PerBonomi set up a lot too so we might reconsider.

    It will usually be another expert or agent responding and not a user. But again, I get the point as well. 

    Cheers!

  • Wendy_S's avatar
    Wendy_S
    Boss
    8 years ago

    ClaudiusH wrote:

    @PerBonomi Your code is suggesting that this component will only show to a super user if other super users are responding to the same topic.

    @Wendy_S Your screenshot though suggests that it will show to super users if any community member is responding. Is that correct?

     

    I actually favour the variant where only SUs see other SUs responding as the second variant seems quite intrusive to almost the level of monitoring members' behaviour. Also usually the SU's / staff's worry  most of the time seems to be to respond to a topic another SU/staff is responding to and not necessarily normal "mortal" members.



    You are right Claudius. I like PerBonomi set up a lot too so we might reconsider.

    It will usually be another expert or agent responding and not a user. But again, I get the point as well. 

    Cheers!

  • housikrausi's avatar
    housikrausi
    Expert
    7 years ago

    PerBonomiI have the reference to this Feature from @DanK. Great feature. I am technically affine but have such a feature not yet built into lithium. Can I read somewhere how this works or is an IT specialist generally necessary?

  • PerBonomi's avatar
    PerBonomi
    Boss
    7 years ago

    housikrausi wrote:

    PerBonomiI have the reference to this Feature from @DanK. Great feature. I am technically affine but have such a feature not yet built into lithium. Can I read somewhere how this works or is an IT specialist generally necessary?


    Hey housikrausi.  The code is fairly short and basic. The zip contains one component and one endpoint. Pretty much copy/paste. But just have a look and see. One thing you need Lithium Support for is to add a custom metadata field to messages. It's this one in the code, you can call it anything you want, I went with spotify.editors: "/metadata/key/spotify.editors/"