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

[AND-254] Fix polls not respecting [disabled] from dashboard. #5562

Open
wants to merge 2 commits into
base: develop
Choose a base branch
from

Conversation

VelikovPetar
Copy link
Contributor

🎯 Goal

We are currently showing the "Poll" attachment option even if it is disabled from the dashboard. If a user attempts to send a poll in this state, it will result in an error.
This PR includes a check for channel.config.polls == true before the "Polls" attachment is added to the "AttachmentPicker"

🛠 Implementation details

  • Compose: Introduce validation of the requested tabFactories in the AttachmentsPicker against the channel capabilities, to ensure that no disallowed factories are shown.
  • XML: A bit different implementation, as we don't have direct access to the Channel in the attachments picker: Expose pollsEnabled in the MessageComposerState and add it to the arePollsEnabled check in the MessageComposerView

🎨 UI Changes

Before After
before.mp4
after.mp4

🧪 Testing

Polls disabled

  1. Disable polls in Dashboard
  2. Open a channel
  3. Open attachments picker
  4. The "Poll" option should not be visible

Polls enabled

  1. Enable polls in Dashboard
  2. Open a channel
  3. Open attachments picker
  4. The "Poll" option should be visible

Copy link
Contributor

github-actions bot commented Jan 17, 2025

SDK Size Comparison 📏

SDK Before After Difference Status
stream-chat-android-client 3.04 MB 3.04 MB 0.00 MB 🟢
stream-chat-android-offline 3.25 MB 3.25 MB 0.00 MB 🟢
stream-chat-android-ui-components 7.91 MB 7.91 MB 0.00 MB 🟢
stream-chat-android-compose 9.14 MB 9.14 MB 0.00 MB 🟢

@VelikovPetar VelikovPetar marked this pull request as ready for review January 17, 2025 11:23
@VelikovPetar VelikovPetar requested a review from a team as a code owner January 17, 2025 11:23
Copy link

Quality Gate Failed Quality Gate failed

Failed conditions
25.0% Coverage on New Code (required ≥ 80%)

See analysis details on SonarQube Cloud

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant