Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add checkbox for locking conversation #4331

Merged
merged 5 commits into from
Oct 15, 2020

Conversation

PVince81
Copy link
Member

@PVince81 PVince81 commented Oct 8, 2020

Added logic for setting a conversation to read-only.

Fixes #1647

Todos

  • read-only switch
  • proper error handling when sending a message and it doesn't go through: put it back
  • hide "Start call" button when read-only
  • hide "NewMessageForm" when read-only or leave visible but disabled ?
  • remove "Reply" buttons in messages list
  • add "(read-only)" text in conversation title
    • to be discussed as one might prefer to call it "(locked)", "(archived)" or whatever and the suffix interferes with renaming. maybe lock icon still better

Manual Tests

  • check that read-only checkbox not visible for non-moderators
  • test removed actions:
    • start call
    • reply
    • upload by drag and drop
  • check that guests get the same read-only experience

Automated Tests

  • check what scenarios could be added => seems read-only backend integration tests already exist

@PVince81 PVince81 added 2. developing feature: chat 💬 Chat and system messages feature: frontend 🖌️ "Web UI" client labels Oct 8, 2020
@PVince81 PVince81 self-assigned this Oct 8, 2020
@PVince81 PVince81 force-pushed the feature/1647/ui-for-readonly-conversation branch from 8f049ee to 45f5e9e Compare October 8, 2020 19:39
@PVince81 PVince81 marked this pull request as ready for review October 8, 2020 20:41
Copy link
Member

@nickvergessen nickvergessen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See first comment

@nickvergessen
Copy link
Member

Conflicting files
src/store/conversationsStore.js

@nickvergessen nickvergessen added this to the 💚 Next Major (21) milestone Oct 12, 2020
@PVince81 PVince81 force-pushed the feature/1647/ui-for-readonly-conversation branch from bf290e3 to 9b50e33 Compare October 13, 2020 09:17
@PVince81
Copy link
Member Author

adjusted based on review and conflict fixed

Added logic for setting a conversation to read-only.

Signed-off-by: Vincent Petry <vincent@nextcloud.com>
In a read-only conversation, the following actions are not available:
- start call button is hidden
- field for posting fields is hidden
- reply button in the messages list is hidden

Signed-off-by: Vincent Petry <vincent@nextcloud.com>
Whenever an error occurs when sending a message, the message is now put
back into the field and the temporary one is removed from the messages list.

Whenever a conversation was locked or lobby was enabled concurrently,
posting a message before the UI update could result in a 403 or 412 error.
These now display a proper message to inform about missing permissions.

Signed-off-by: Vincent Petry <vincent@nextcloud.com>
Moved isConversationReadOnly condition on the reply action button
instead of affecting all possible (future) actions.

Now using `showError` instead of the global OC notification, the
displayed border now has the correct color.

Renamed "room" to "conversation" in the error message.

Signed-off-by: Vincent Petry <vincent@nextcloud.com>
Signed-off-by: Vincent Petry <vincent@nextcloud.com>
@PVince81 PVince81 force-pushed the feature/1647/ui-for-readonly-conversation branch from 9b50e33 to 51debd5 Compare October 13, 2020 14:57
@PVince81
Copy link
Member Author

PVince81 commented Oct 13, 2020

adjusted, here is how it looks like now:
image

@PVince81
Copy link
Member Author

PVince81 commented Oct 13, 2020

  • BUG? seems settings tab is gone on sidebar => couldn't reproduce, likely a refresh issue on my local env

Copy link
Member

@nickvergessen nickvergessen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🦈

@nickvergessen nickvergessen merged commit 998626b into master Oct 15, 2020
@nickvergessen nickvergessen deleted the feature/1647/ui-for-readonly-conversation branch October 15, 2020 07:05
@jakobroehrl
Copy link
Contributor

@PVince81 @nickvergessen
Wouldn't it be better letting moderators write in locked conversations?
see #3886

@nickvergessen
Copy link
Member

For now this is not what they are designed for

@jakobroehrl
Copy link
Contributor

OK, can I try to implement a read only setting for !moderators?

@jakobroehrl
Copy link
Contributor

I need the function to lock the conversation for not moderator users.
Could I extend it?

Eg as a dropdown:
group is writeable for

  • all group users
  • only moderators
  • nobody

@PVince81 @nickvergessen What do you think?

@nickvergessen
Copy link
Member

Well the mobile clients would need to understand that too. So not possible for 11. We can see for 12

@fenvarien
Copy link

For education scenarios this feature would be very important and helpful. A moderator (teacher) should be able to write in locked chats too. So you could create chats with information for students and parents which are locked and other ones, which are used for the ongoing communication between teachters, staff, students and so on.

@jakobroehrl
Copy link
Contributor

For education scenarios this feature would be very important and helpful. A moderator (teacher) should be able to write in locked chats too. So you could create chats with information for students and parents which are locked and other ones, which are used for the ongoing communication between teachters, staff, students and so on.

Nobody can write on locked conversations.
Have a look here: #3886

This was referenced Feb 19, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add an UI option for "read-only" conversations
4 participants