Skip to content

Conversation

@danxuliu
Copy link
Member

@danxuliu danxuliu commented Oct 27, 2022

Pending:

  • Do not show Talk sidebar in public share page if Talk is disabled for the user? The problem is that the same approach used for the Files app does not seem to work in this case, probably because the user is in incognito mode when loading the public share page (although not in other requests, for example when joining the conversation).
    I have not checked if there is some way to know the actual user from the TemplateLoader, but if not then at least an error should be shown when failing to join the conversation in the public share page (which should be shown nevertheless if there is an error independently of this issue, so maybe it would be the way to go).

How to test (scenario 1)

  • Open Talk settings
  • Restrict Talk to be used only by certain group
  • Log in as a user not in that group
  • Open the Files app
  • Open the sidebar for a file

Result with this pull request

The Chat tab is not shown in the sidebar

Result without this pull request

The Chat tab is shown in the sidebar

How to test (scenario 2)

  • Open Talk settings
  • Restrict Talk to be used only by certain group
  • Log in as a user not in that group
  • Open the Files app
  • Share a file by link
  • Open the link in another tab in the same window
  • Join the conversation

Result with this pull request

The button is restored and an error is shown

Result without this pull request

The button is kept disabled and with a loading spinner forever, and no error is shown to the user

@danxuliu danxuliu added 3. to review bug feature: frontend 🖌️ "Web UI" client feature: talk-sidebar ⬅️ Sidebar integration of Talk into other apps like sharing and documents labels Oct 27, 2022
@danxuliu danxuliu added this to the 💟 Next Major (26) milestone Oct 27, 2022
@danxuliu
Copy link
Member Author

/backport to stable25

@danxuliu
Copy link
Member Author

/backport to stable24

@danxuliu
Copy link
Member Author

/backport to stable23

Joining a conversation in the public share page fails if Talk use is
limited to certain groups and the public share page is opened by a user
not in those groups. The incognito mode is enabled when the public share
page is loaded, so from the point of view of the event handler that adds
the Talk sidebar script the user is always a guest, and therefore adding
the script can not be prevented for users not allowed to use Talk.

Moreover, when those users tried to join the conversation in the public
share page the button was kept disabled with a loading spinner forever,
and no error was shown to the user.

For simplicity, and as it could be useful if joining the conversation
fails for any other reason, instead of looking for other ways to hide
the Talk sidebar if the user is not allowed to use Talk now, if joining
the conversation in the public share page fails, the button is restored
and an error toast is shown.

Signed-off-by: Daniel Calviño Sánchez <[email protected]>
@danxuliu danxuliu marked this pull request as ready for review October 28, 2022 00:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

3. to review bug feature: frontend 🖌️ "Web UI" client feature: talk-sidebar ⬅️ Sidebar integration of Talk into other apps like sharing and documents

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants