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

18638- [Communities] Implement Permissions Drawer #18988

Merged
merged 2 commits into from
Mar 21, 2024

Conversation

FFFra
Copy link
Contributor

@FFFra FFFra commented Feb 25, 2024

Fixes #18638
Follows Figma
Has a follow-up to design system

Summary

This PR introduces a detailed token permission bottom sheet within the Addresses For Permissions Screen. It is designed to encapsulate the full spectrum of logic and complexity associated with community token-gated rules, offering a robust framework that enhances user interaction and comprehension.

I appreciate your careful review and testing. 😀

Review notes

  • I've aimed to be thorough in my coverage and all tests should pass. Please highlight any oversights.

Testing notes

  • Please ensure the Desktop is been sent correctly.

Platforms

  • Android
  • iOS
Functional
  • 1-1 chats
  • public chats
  • group chats

Steps to test

  1. Create a Community in the Desktop App:

    • Begin by creating a community without applying any token gate rules.
  2. Invite a Mobile User:

    • Send an invitation to a user on a mobile device, and guide them to navigate through the URL provided in the invitation message.
  3. Join the Community:

    • On the mobile device, the user should click on the "Join Community" button to proceed.
  4. Access 'All Addresses' View:

    • Navigate to the 'All Addresses' section within the community settings or dashboard.
  5. Identify the 'Address for Permission' Label:

    • Locate the label titled "Address for Permission". Verify that the permissions button is not rendered in this initial configuration. An info button should become visible next to this label after some permissions have been added.
  6. Track Permissions:

    • By clicking on the info button next to the "Address for Permission" label, you should be able to view and track the permissions that were set up from the desktop app.

Before and after screenshots comparison

This is the expected behave

1 - The community has no token-gated permissions set:

1-test-permissions-NO-permissions.mov

2 -The community has a member token-gated permissions set:

1-test-permissions-token-permissions.mov

3 - The community has a collectibles token-gated permissions set and also admin set:

1-test-permissions-roles.mov

4 - Current wallet state using Testnet to validate this implementation:

image
image

status: ready!

@FFFra FFFra added this to the 2.27.0 Alpha milestone Feb 25, 2024
@FFFra FFFra self-assigned this Feb 25, 2024
@FFFra FFFra linked an issue Feb 25, 2024 that may be closed by this pull request
@FFFra FFFra requested a review from ilmotta February 25, 2024 12:06
@status-im-auto
Copy link
Member

status-im-auto commented Feb 25, 2024

Jenkins Builds

Click to see older builds (56)
Commit #️⃣ Finished (UTC) Duration Platform Result
e3cfbfe #1 2024-02-25 12:08:39 ~2 min tests 📄log
✔️ e3cfbfe #1 2024-02-25 12:13:27 ~7 min android 🤖apk 📲
✔️ e3cfbfe #1 2024-02-25 12:13:38 ~7 min android-e2e 🤖apk 📲
✔️ e3cfbfe #1 2024-02-25 12:15:28 ~9 min ios 📱ipa 📲
✔️ 6c0e1ef #2 2024-03-18 09:21:53 ~6 min tests 📄log
✔️ 6c0e1ef #2 2024-03-18 09:23:26 ~8 min ios 📱ipa 📲
✔️ 6c0e1ef #2 2024-03-18 09:23:30 ~8 min android-e2e 🤖apk 📲
✔️ 6c0e1ef #2 2024-03-18 09:23:45 ~8 min android 🤖apk 📲
99a608b #3 2024-03-18 11:28:06 ~1 min tests 📄log
✔️ 99a608b #3 2024-03-18 11:34:08 ~7 min android-e2e 🤖apk 📲
✔️ 99a608b #3 2024-03-18 11:34:09 ~7 min android 🤖apk 📲
✔️ 99a608b #3 2024-03-18 11:35:06 ~8 min ios 📱ipa 📲
e1b49ff #4 2024-03-19 03:48:27 ~1 min tests 📄log
3e563e7 #5 2024-03-19 03:54:33 ~2 min tests 📄log
✔️ 3e563e7 #5 2024-03-19 03:58:54 ~6 min android-e2e 🤖apk 📲
✔️ 3e563e7 #5 2024-03-19 03:58:58 ~6 min android 🤖apk 📲
✔️ 3e563e7 #5 2024-03-19 04:00:59 ~8 min ios 📱ipa 📲
8365483 #6 2024-03-19 05:28:26 ~1 min tests 📄log
✔️ 8365483 #6 2024-03-19 05:33:35 ~6 min android 🤖apk 📲
✔️ 8365483 #6 2024-03-19 05:33:46 ~6 min android-e2e 🤖apk 📲
✔️ 8365483 #6 2024-03-19 05:36:01 ~8 min ios 📱ipa 📲
4cc0703 #7 2024-03-19 05:43:20 ~2 min tests 📄log
✔️ 4cc0703 #7 2024-03-19 05:48:31 ~7 min android-e2e 🤖apk 📲
✔️ 4cc0703 #7 2024-03-19 05:48:40 ~7 min android 🤖apk 📲
✔️ 4cc0703 #7 2024-03-19 05:49:37 ~8 min ios 📱ipa 📲
✔️ 2159fbb #8 2024-03-19 06:57:43 ~5 min tests 📄log
✔️ 2159fbb #8 2024-03-19 06:58:02 ~6 min android 🤖apk 📲
✔️ 2159fbb #8 2024-03-19 06:59:09 ~7 min android-e2e 🤖apk 📲
✔️ 2159fbb #8 2024-03-19 07:00:23 ~8 min ios 📱ipa 📲
✔️ 5394436 #10 2024-03-19 08:16:31 ~6 min tests 📄log
✔️ 5394436 #10 2024-03-19 08:18:10 ~8 min android 🤖apk 📲
✔️ 5394436 #10 2024-03-19 08:18:14 ~8 min android-e2e 🤖apk 📲
✔️ 5394436 #10 2024-03-19 08:18:24 ~8 min ios 📱ipa 📲
✔️ 77d3966 #11 2024-03-19 09:13:15 ~6 min tests 📄log
✔️ 77d3966 #11 2024-03-19 09:15:08 ~8 min ios 📱ipa 📲
✔️ 77d3966 #11 2024-03-19 09:15:12 ~8 min android-e2e 🤖apk 📲
✔️ 77d3966 #11 2024-03-19 09:15:13 ~8 min android 🤖apk 📲
ae371d3 #13 2024-03-19 12:03:11 ~2 min tests 📄log
✔️ ae371d3 #13 2024-03-19 12:07:19 ~6 min android-e2e 🤖apk 📲
✔️ ae371d3 #13 2024-03-19 12:08:07 ~7 min android 🤖apk 📲
ae371d3 #13 2024-03-19 12:13:47 ~13 min ios 📄log
✔️ 2fb6ae6 #14 2024-03-19 12:39:20 ~6 min tests 📄log
✔️ 2fb6ae6 #14 2024-03-19 12:39:50 ~6 min android-e2e 🤖apk 📲
✔️ 2fb6ae6 #14 2024-03-19 12:40:48 ~7 min android 🤖apk 📲
✔️ 2fb6ae6 #14 2024-03-19 12:43:36 ~10 min ios 📱ipa 📲
✔️ 031e66b #15 2024-03-21 05:48:20 ~6 min tests 📄log
✔️ 031e66b #15 2024-03-21 05:50:04 ~8 min android-e2e 🤖apk 📲
✔️ 031e66b #15 2024-03-21 05:50:09 ~8 min android 🤖apk 📲
✔️ 031e66b #15 2024-03-21 05:51:03 ~9 min ios 📱ipa 📲
✔️ 53a51c5 #16 2024-03-21 06:15:15 ~7 min android-e2e 🤖apk 📲
✔️ 53a51c5 #16 2024-03-21 06:15:24 ~7 min android 🤖apk 📲
✔️ 53a51c5 #16 2024-03-21 06:17:01 ~9 min ios 📱ipa 📲
92038eb #18 2024-03-21 12:28:13 ~1 min tests 📄log
✔️ 2cdee67 #19 2024-03-21 12:37:19 ~6 min android 🤖apk 📲
✔️ 2cdee67 #19 2024-03-21 12:37:44 ~6 min android-e2e 🤖apk 📲
✔️ 2cdee67 #19 2024-03-21 12:41:00 ~9 min ios 📱ipa 📲
Commit #️⃣ Finished (UTC) Duration Platform Result
✔️ 478d5d6 #20 2024-03-21 12:47:24 ~5 min tests 📄log
✔️ 478d5d6 #20 2024-03-21 12:48:48 ~7 min android-e2e 🤖apk 📲
✔️ 478d5d6 #20 2024-03-21 12:48:59 ~7 min android 🤖apk 📲
✔️ 04f3f09 #21 2024-03-21 12:59:12 ~7 min android-e2e 🤖apk 📲
✔️ 04f3f09 #21 2024-03-21 12:59:18 ~7 min android 🤖apk 📲
✔️ 04f3f09 #21 2024-03-21 13:01:10 ~9 min ios 📱ipa 📲
✔️ 04f3f09 #22 2024-03-21 13:16:28 ~3 min tests 📄log

@FFFra FFFra requested a review from J-Son89 February 25, 2024 12:09

(def container
{:flex 1
:background-color :white})
Copy link
Contributor

Choose a reason for hiding this comment

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

Setting bg color to white won't work since we need a different color for dark theme.

(get token-permissions permission-type))
permission-types))

(defn get-token-role
Copy link
Contributor

Choose a reason for hiding this comment

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

filter-tokens and get-token-role can be marked as private using defn-

(defn get-token-role
[token-permissions]
(->> token-permissions
(remove (fn [[level _]] (#{5 6} level))) ; Exclude levels 5 and 6, focusing on token roles
Copy link
Contributor

Choose a reason for hiding this comment

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

Instead of hardcoding we should use constants -

(def ^:const community-token-permission-become-token-master 5)
(def ^:const community-token-permission-become-token-owner 6)

(defn get-token-role
[token-permissions]
(->> token-permissions
(remove (fn [[level _]] (#{5 6} level))) ; Exclude levels 5 and 6, focusing on token roles
Copy link
Contributor

Choose a reason for hiding this comment

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

If you are attempting to filter out the 'become a member' permission, then we should filter permission type 2 instead of removing types 5 and 6.

(def ^:const community-token-permission-become-member 2)

Comment on lines 30 to 31
tokens (filter-tokens token-permissions [1 2 3])
collectible (filter-tokens token-permissions [5 6])
Copy link
Contributor

Choose a reason for hiding this comment

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

We should use constants here too.

@@ -2,7 +2,8 @@
(:require
[clojure.string :as string]
[legacy.status-im.ui.screens.profile.visibility-status.utils :as visibility-status-utils]
[re-frame.core :as re-frame]
[re-frame.core :as re-frame] ;; [re-frame.db :as rf-db]
Copy link
Contributor

Choose a reason for hiding this comment

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

Comment

@ajayesivan
Copy link
Contributor

Screenshot 2024-02-27 at 13 32 20

As you can see in the screenshot 10SNT is become an admin permission, but it is being listed in member permissions.

Also, small UI issue: the divider width is incorrect.

@ajayesivan
Copy link
Contributor

We have a permission button on the 'request to join' screen and the 'address for airdrop' screen. Just pointing it out, perhaps we can address it in a follow-up.

@Samyoul Samyoul assigned ajayesivan and unassigned FFFra Feb 27, 2024
@cammellos cammellos modified the milestones: 2.27.0 Alpha, 2.28.0 Alpha Mar 14, 2024
@ajayesivan ajayesivan force-pushed the 18638-communities-implement-permission-drawer branch 4 times, most recently from f8a1095 to 5394436 Compare March 19, 2024 08:09
@ajayesivan ajayesivan force-pushed the 18638-communities-implement-permission-drawer branch from 5394436 to 77d3966 Compare March 19, 2024 09:06
@@ -16,6 +17,7 @@
[]
(let [{id :community-id} (rf/sub [:get-screen-params])
{:keys [name color images joined]} (rf/sub [:communities/community id])
{:keys [has-permissions?]} (rf/sub [:community/token-permissions id])
Copy link
Contributor

Choose a reason for hiding this comment

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

if you are pulling a single key, I think it's best to just create a new subscription

{:content (fn [] [confirm-discard-drawer
community-id])}])))
[identical-choices?])]
{:keys [has-permissions?]} (rf/sub [:community/token-permissions community-id])
Copy link
Contributor

Choose a reason for hiding this comment

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

same, new sub probably

(rf/dispatch [:show-bottom-sheet
{:content (fn [] [confirm-discard-drawer
community-id])}])))
[identical-choices?])
Copy link
Contributor

Choose a reason for hiding this comment

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

should not this be tracking community-id as well? I take if community-id changes the whole component will be thrown away, but still seems safer to track


(defn view
[id]
(let [{:keys [permissions]} (rf/sub [:community/token-permissions id])
Copy link
Contributor

Choose a reason for hiding this comment

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

same as above

(defn view
[id]
(let [{:keys [permissions]} (rf/sub [:community/token-permissions id])
role-text (fn [role]
Copy link
Contributor

Choose a reason for hiding this comment

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

this could be defined outside, as it will be recreated at each render (I don't think it matters, but it also looks a bit neater to defined it outside, since let to me implies is a closure

(map (fn [{:keys [tokens role satisfied?]}]
(when (seq tokens)
^{:key role}
[rn/view {:style {:margin-bottom 20}}
Copy link
Contributor

Choose a reason for hiding this comment

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

I would extract this component in a separate function

(rf/reg-event-fx :communities/check-permissions-to-join-community-with-all-addresses-success
(fn [{:keys [db]} [community-id result]]
{:db (-> db
(assoc-in [:communities/permissions-check-all community-id]
Copy link
Contributor

Choose a reason for hiding this comment

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

no need to thread here

{:db (assoc-in db [:communities/permissions-check community-id :checking?] true)
:json-rpc/call [{:method "wakuext_checkPermissionsToJoinCommunity"
:params [(cond-> {:communityId community-id}
addresses
Copy link
Contributor

Choose a reason for hiding this comment

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

This check is always true

(set nil) -> #{} (when #{} true) -> true

constants/community-token-permission-become-member)
(:satisfied %))
roles)
permissions (into []
Copy link
Contributor

Choose a reason for hiding this comment

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

instead of (into [] (map (mapv will put them directly into a vector

@ajayesivan ajayesivan force-pushed the 18638-communities-implement-permission-drawer branch from b49df50 to ae371d3 Compare March 19, 2024 12:00
@ajayesivan ajayesivan force-pushed the 18638-communities-implement-permission-drawer branch from ae371d3 to 2fb6ae6 Compare March 19, 2024 12:32
@status-im-auto
Copy link
Member

96% of end-end tests have passed

Total executed tests: 48
Failed tests: 1
Expected to fail tests: 1
Passed tests: 46
IDs of failed tests: 702851 
IDs of expected to fail tests: 703503 

Failed tests (1)

Click to expand
  • Rerun failed tests

  • Class TestActivityCenterContactRequestMultipleDevicePR:

    1. test_activity_center_contact_request_accept_swipe_mark_all_as_read, id: 702851

    Device 1: Tap on found: Button
    # STEP: Device1 check that contact appeared in contact list mutually

    /home/jenkins/.local/lib/python3.10/site-packages/urllib3/connectionpool.py:703: in urlopen
        httplib_response = self._make_request(
    /home/jenkins/.local/lib/python3.10/site-packages/urllib3/connectionpool.py:449: in _make_request
        six.raise_from(e, None)
    <string>:3: in raise_from
        ???
    /home/jenkins/.local/lib/python3.10/site-packages/urllib3/connectionpool.py:444: in _make_request
        httplib_response = conn.getresponse()
    /usr/lib/python3.10/http/client.py:1375: in getresponse
        response.begin()
    /usr/lib/python3.10/http/client.py:318: in begin
        version, status, reason = self._read_status()
    /usr/lib/python3.10/http/client.py:287: in _read_status
        raise RemoteDisconnected("Remote end closed connection without"
    E   http.client.RemoteDisconnected: Remote end closed connection without response
    
    During handling of the above exception, another exception occurred:
    activity_center/test_activity_center.py:134: in test_activity_center_contact_request_accept_swipe_mark_all_as_read
        self.device_2.just_fyi('Device1 check that contact appeared in contact list mutually')
    ../views/base_view.py:395: in just_fyi
        self.driver.execute_script("sauce:context=STEP: %s" % some_str)
    /home/jenkins/.local/lib/python3.10/site-packages/selenium/webdriver/remote/webdriver.py:405: in execute_script
        return self.execute(command, {"script": script, "args": converted_args})["value"]
    /home/jenkins/.local/lib/python3.10/site-packages/selenium/webdriver/remote/webdriver.py:343: in execute
        response = self.command_executor.execute(driver_command, params)
    /home/jenkins/.local/lib/python3.10/site-packages/selenium/webdriver/remote/remote_connection.py:291: in execute
        return self._request(command_info[0], url, body=data)
    /home/jenkins/.local/lib/python3.10/site-packages/selenium/webdriver/remote/remote_connection.py:312: in _request
        response = self._conn.request(method, url, body=body, headers=headers)
    /home/jenkins/.local/lib/python3.10/site-packages/urllib3/request.py:78: in request
        return self.request_encode_body(
    /home/jenkins/.local/lib/python3.10/site-packages/urllib3/request.py:170: in request_encode_body
        return self.urlopen(method, url, **extra_kw)
    /home/jenkins/.local/lib/python3.10/site-packages/urllib3/poolmanager.py:376: in urlopen
        response = conn.urlopen(method, u.request_uri, **kw)
    /home/jenkins/.local/lib/python3.10/site-packages/urllib3/connectionpool.py:787: in urlopen
        retries = retries.increment(
    /home/jenkins/.local/lib/python3.10/site-packages/urllib3/util/retry.py:550: in increment
        raise six.reraise(type(error), error, _stacktrace)
    /home/jenkins/.local/lib/python3.10/site-packages/urllib3/packages/six.py:769: in reraise
        raise value.with_traceback(tb)
    /home/jenkins/.local/lib/python3.10/site-packages/urllib3/connectionpool.py:703: in urlopen
        httplib_response = self._make_request(
    /home/jenkins/.local/lib/python3.10/site-packages/urllib3/connectionpool.py:449: in _make_request
        six.raise_from(e, None)
    <string>:3: in raise_from
        ???
    /home/jenkins/.local/lib/python3.10/site-packages/urllib3/connectionpool.py:444: in _make_request
        httplib_response = conn.getresponse()
    /usr/lib/python3.10/http/client.py:1375: in getresponse
        response.begin()
    /usr/lib/python3.10/http/client.py:318: in begin
        version, status, reason = self._read_status()
    /usr/lib/python3.10/http/client.py:287: in _read_status
        raise RemoteDisconnected("Remote end closed connection without"
     ('Connection aborted.', RemoteDisconnected('Remote end closed connection without response'))
    



    Device sessions

    Expected to fail tests (1)

    Click to expand

    Class TestCommunityOneDeviceMerged:

    1. test_community_discovery, id: 703503

    Test is not run, e2e blocker  
    

    [[reason: [NOTRUN] Curated communities not loading, https://github.com//issues/17852]]

    Passed tests (46)

    Click to expand

    Class TestDeepLinksOneDevice:

    1. test_links_open_universal_links_from_chat, id: 704613
    Device sessions

    2. test_links_deep_links, id: 702775
    Device sessions

    Class TestActivityCenterContactRequestMultipleDevicePR:

    1. test_activity_center_contact_request_decline, id: 702850
    Device sessions

    2. test_add_contact_field_validation, id: 702777
    Device sessions

    Class TestCommunityMultipleDeviceMerged:

    1. test_community_one_image_send_reply, id: 702859
    Device sessions

    2. test_community_several_images_send_reply, id: 703194
    Device sessions

    3. test_community_mark_all_messages_as_read, id: 703086
    Device sessions

    4. test_community_edit_delete_message_when_offline, id: 704615
    Device sessions

    5. test_community_message_edit, id: 702843
    Device sessions

    6. test_community_message_send_check_timestamps_sender_username, id: 702838
    Device sessions

    7. test_community_emoji_send_copy_paste_reply, id: 702840
    Device sessions

    8. test_community_unread_messages_badge, id: 702841
    Device sessions

    9. test_community_links_with_previews_github_youtube_twitter_gif_send_enable, id: 702844
    Device sessions

    10. test_community_contact_block_unblock_offline, id: 702894
    Device sessions

    11. test_community_message_delete, id: 702839
    Device sessions

    Class TestCommunityOneDeviceMerged:

    1. test_community_mute_community_and_channel, id: 703382
    Device sessions

    2. test_community_navigate_to_channel_when_relaunch, id: 702846
    Device sessions

    3. test_restore_multiaccount_with_waku_backup_remove_switch, id: 703133
    Device sessions

    4. test_community_copy_and_paste_message_in_chat_input, id: 702742
    Device sessions

    5. test_community_undo_delete_message, id: 702869
    Device sessions

    Class TestActivityMultipleDevicePR:

    1. test_activity_center_reply_read_unread_delete_filter_swipe, id: 702947
    Device sessions

    2. test_navigation_jump_to, id: 702936
    Device sessions

    Class TestActivityMultipleDevicePRTwo:

    1. test_activity_center_admin_notification_accept_swipe, id: 702958
    Device sessions

    2. test_activity_center_mentions, id: 702957
    Device sessions

    Class TestOneToOneChatMultipleSharedDevicesNewUi:

    1. test_1_1_chat_push_emoji, id: 702813
    Device sessions

    2. test_1_1_chat_text_message_delete_push_disappear, id: 702733
    Device sessions

    3. test_1_1_chat_emoji_send_reply_and_open_link, id: 702782
    Device sessions

    4. test_1_1_chat_message_reaction, id: 702730
    Device sessions

    5. test_1_1_chat_pin_messages, id: 702731
    Device sessions

    6. test_1_1_chat_edit_message, id: 702855
    Device sessions

    7. test_1_1_chat_non_latin_messages_stack_update_profile_photo, id: 702745
    Device sessions

    8. test_1_1_chat_send_image_save_and_share, id: 703391
    Device sessions

    Class TestCommunityMultipleDeviceMergedTwo:

    1. test_community_hashtag_links_to_community_channels, id: 702948
    Device sessions

    2. test_community_markdown_support, id: 702809
    Device sessions

    3. test_community_mentions_push_notification, id: 702786
    Device sessions

    4. test_community_leave, id: 702845
    Device sessions

    5. test_community_join_when_node_owner_offline, id: 703629
    Device sessions

    Class TestGroupChatMultipleDeviceMergedNewUI:

    1. test_group_chat_join_send_text_messages_push, id: 702807
    Device sessions

    2. test_group_chat_reactions, id: 703202
    Device sessions

    3. test_group_chat_pin_messages, id: 702732
    Device sessions

    4. test_group_chat_offline_pn, id: 702808
    Device sessions

    5. test_group_chat_send_image_save_and_share, id: 703297
    Device sessions

    6. test_group_chat_mute_chat, id: 703495
    Device sessions

    Class TestOneToOneChatMultipleSharedDevicesNewUiTwo:

    1. test_1_1_chat_delete_via_long_press_relogin, id: 702784
    Device sessions

    2. test_1_1_chat_mute_chat, id: 703496
    Device sessions

    3. test_1_1_chat_is_shown_message_sent_delivered_from_offline, id: 702783
    Device sessions

    @pavloburykh pavloburykh self-assigned this Mar 19, 2024
    @pavloburykh
    Copy link
    Contributor

    @ajayesivan thanks for the PR. Please take a look at the issues.

    ISSUE 1 Permissions drawer is not scrollable

    telegram-cloud-document-2-5465640381477571149.mp4

    @pavloburykh
    Copy link
    Contributor

    ISSUE 2 Permission drawer is not updated based on selected addresses with required tokens

    @ajayesivan not sure if this issue is valid, need to check with design team.

    Steps:

    1. Unselect some address holding required tokens
    2. Open permissions drawer and check if eligible roles are updated according to selected addresses

    Actual result: permission drawer is not updated. It still shows that user is eligible to join as despite user unselected account this tokens that are required for this role.

    telegram-cloud-document-2-5465640381477571174.mp4

    @pavloburykh
    Copy link
    Contributor

    ISSUE 3 Elements disappear on Request to join screen after backgrounding the app

    Steps:

    1. Open Request to join screen
    2. Backround/open the app
    3. See if all elements are visible

    Actual result: Permissions, Slide buttons and community logo disappear

    telegram-cloud-document-2-5465640381477571185.mp4

    @ajayesivan ajayesivan force-pushed the 18638-communities-implement-permission-drawer branch from 2fb6ae6 to 031e66b Compare March 21, 2024 05:41
    @ajayesivan
    Copy link
    Contributor

    Hi @pavloburykh,
    I have fixed issue 1 & 3.
    Regarding issue 2: it is the expected behaviors as specified here.

    Could you please retest the PR. Let me know if you have any questions, thank you!

    @status-im-auto
    Copy link
    Member

    83% of end-end tests have passed

    Total executed tests: 48
    Failed tests: 7
    Expected to fail tests: 1
    Passed tests: 40
    
    IDs of failed tests: 702845,702894,702786,702809,702948,703629,702777 
    
    IDs of expected to fail tests: 703503 
    

    Failed tests (7)

    Click to expand
  • Rerun failed tests

  • Class TestCommunityMultipleDeviceMergedTwo:

    1. test_community_leave, id: 702845
    Test setup failed: critical/chats/test_public_chat_browsing.py:840: in prepare_devices
        self.community_2.join_community()
    ../views/chat_view.py:426: in join_community
        self.community_status_joined.wait_for_visibility_of_element(60)
    ../views/base_element.py:147: in wait_for_visibility_of_element
        raise TimeoutException(
     Device 2: Text by accessibility id:`status-tag-positive` is not found on the screen after wait_for_visibility_of_element
    



    2. test_community_mentions_push_notification, id: 702786

    Device 2: Find Button by xpath: //*[@content-desc='password-input']/../following-sibling::*//*[@text='Join Community']
    Device 2: Tap on found: Button

    Test setup failed: critical/chats/test_public_chat_browsing.py:840: in prepare_devices
        self.community_2.join_community()
    ../views/chat_view.py:426: in join_community
        self.community_status_joined.wait_for_visibility_of_element(60)
    ../views/base_element.py:147: in wait_for_visibility_of_element
        raise TimeoutException(
     Device 2: Text by accessibility id:`status-tag-positive` is not found on the screen after wait_for_visibility_of_element
    



    Device sessions

    3. test_community_markdown_support, id: 702809

    Test setup failed: critical/chats/test_public_chat_browsing.py:840: in prepare_devices
        self.community_2.join_community()
    ../views/chat_view.py:426: in join_community
        self.community_status_joined.wait_for_visibility_of_element(60)
    ../views/base_element.py:147: in wait_for_visibility_of_element
        raise TimeoutException(
     Device 2: Text by accessibility id:`status-tag-positive` is not found on the screen after wait_for_visibility_of_element
    



    4. test_community_hashtag_links_to_community_channels, id: 702948

    Test setup failed: critical/chats/test_public_chat_browsing.py:840: in prepare_devices
        self.community_2.join_community()
    ../views/chat_view.py:426: in join_community
        self.community_status_joined.wait_for_visibility_of_element(60)
    ../views/base_element.py:147: in wait_for_visibility_of_element
        raise TimeoutException(
     Device 2: Text by accessibility id:`status-tag-positive` is not found on the screen after wait_for_visibility_of_element
    



    5. test_community_join_when_node_owner_offline, id: 703629

    Test setup failed: critical/chats/test_public_chat_browsing.py:840: in prepare_devices
        self.community_2.join_community()
    ../views/chat_view.py:426: in join_community
        self.community_status_joined.wait_for_visibility_of_element(60)
    ../views/base_element.py:147: in wait_for_visibility_of_element
        raise TimeoutException(
     Device 2: Text by accessibility id:`status-tag-positive` is not found on the screen after wait_for_visibility_of_element
    



    Class TestCommunityMultipleDeviceMerged:

    1. test_community_contact_block_unblock_offline, id: 702894

    Device 2: Text is Delivered
    Device 1: Looking for a message by text: Hurray! unblocked

    critical/chats/test_public_chat_browsing.py:740: in test_community_contact_block_unblock_offline
        self.errors.verify_no_errors()
    base_test_case.py:190: in verify_no_errors
        pytest.fail('\n '.join([self.errors.pop(0) for _ in range(len(self.errors))]))
     1-1 chat from blocked user is not removed and messages home is not empty!
    



    Device sessions

    Class TestActivityCenterContactRequestMultipleDevicePR:

    1. test_add_contact_field_validation, id: 702777

    Device 1: Find Button by xpath: //*[@text="Paste"]
    Device 1: Tap on found: Button

    activity_center/test_activity_center.py:237: in test_add_contact_field_validation
        self.errors.verify_no_errors()
    base_test_case.py:190: in verify_no_errors
        pytest.fail('\n '.join([self.errors.pop(0) for _ in range(len(self.errors))]))
     Error message is not shown for value "cs3:X1cQV8s:EVc:28w2qgcZjbBaFkfeDfshjg7jjr7Vrzp4hPKiTXfVTYUxs:7JCyC8Q5HNkfoSC2fNvW445CUMWfsGtXwCt8QPDBpDNK"
    



    Device sessions

    Expected to fail tests (1)

    Click to expand

    Class TestCommunityOneDeviceMerged:

    1. test_community_discovery, id: 703503

    Test is not run, e2e blocker  
    

    [[reason: [NOTRUN] Curated communities not loading, https://github.com//issues/17852]]

    Passed tests (40)

    Click to expand

    Class TestActivityMultipleDevicePR:

    1. test_activity_center_reply_read_unread_delete_filter_swipe, id: 702947
    Device sessions

    2. test_navigation_jump_to, id: 702936
    Device sessions

    Class TestGroupChatMultipleDeviceMergedNewUI:

    1. test_group_chat_reactions, id: 703202
    Device sessions

    2. test_group_chat_join_send_text_messages_push, id: 702807
    Device sessions

    3. test_group_chat_offline_pn, id: 702808
    Device sessions

    4. test_group_chat_pin_messages, id: 702732
    Device sessions

    5. test_group_chat_send_image_save_and_share, id: 703297
    Device sessions

    6. test_group_chat_mute_chat, id: 703495
    Device sessions

    Class TestCommunityMultipleDeviceMerged:

    1. test_community_emoji_send_copy_paste_reply, id: 702840
    Device sessions

    2. test_community_mark_all_messages_as_read, id: 703086
    Device sessions

    3. test_community_links_with_previews_github_youtube_twitter_gif_send_enable, id: 702844
    Device sessions

    4. test_community_unread_messages_badge, id: 702841
    Device sessions

    5. test_community_message_delete, id: 702839
    Device sessions

    6. test_community_message_send_check_timestamps_sender_username, id: 702838
    Device sessions

    7. test_community_edit_delete_message_when_offline, id: 704615
    Device sessions

    8. test_community_one_image_send_reply, id: 702859
    Device sessions

    9. test_community_message_edit, id: 702843
    Device sessions

    10. test_community_several_images_send_reply, id: 703194
    Device sessions

    Class TestDeepLinksOneDevice:

    1. test_links_deep_links, id: 702775
    Device sessions

    2. test_links_open_universal_links_from_chat, id: 704613
    Device sessions

    Class TestOneToOneChatMultipleSharedDevicesNewUiTwo:

    1. test_1_1_chat_mute_chat, id: 703496
    Device sessions

    2. test_1_1_chat_is_shown_message_sent_delivered_from_offline, id: 702783
    Device sessions

    3. test_1_1_chat_delete_via_long_press_relogin, id: 702784
    Device sessions

    Class TestCommunityOneDeviceMerged:

    1. test_community_copy_and_paste_message_in_chat_input, id: 702742
    Device sessions

    2. test_community_navigate_to_channel_when_relaunch, id: 702846
    Device sessions

    3. test_restore_multiaccount_with_waku_backup_remove_switch, id: 703133
    Device sessions

    4. test_community_undo_delete_message, id: 702869
    Device sessions

    5. test_community_mute_community_and_channel, id: 703382
    Device sessions

    Class TestActivityMultipleDevicePRTwo:

    1. test_activity_center_admin_notification_accept_swipe, id: 702958
    Device sessions

    2. test_activity_center_mentions, id: 702957
    Device sessions

    Class TestOneToOneChatMultipleSharedDevicesNewUi:

    1. test_1_1_chat_edit_message, id: 702855
    Device sessions

    2. test_1_1_chat_message_reaction, id: 702730
    Device sessions

    3. test_1_1_chat_non_latin_messages_stack_update_profile_photo, id: 702745
    Device sessions

    4. test_1_1_chat_pin_messages, id: 702731
    Device sessions

    5. test_1_1_chat_text_message_delete_push_disappear, id: 702733
    Device sessions

    6. test_1_1_chat_push_emoji, id: 702813
    Device sessions

    7. test_1_1_chat_emoji_send_reply_and_open_link, id: 702782
    Device sessions

    8. test_1_1_chat_send_image_save_and_share, id: 703391
    Device sessions

    Class TestActivityCenterContactRequestMultipleDevicePR:

    1. test_activity_center_contact_request_accept_swipe_mark_all_as_read, id: 702851
    Device sessions

    2. test_activity_center_contact_request_decline, id: 702850
    Device sessions

    @pavloburykh
    Copy link
    Contributor

    @ajayesivan thank you for the fixes. Looks good to me.

    One more question: how do we order the list of permissions in the drawer?

    I noticed that ordering is different on IOS and Android.

    On the video below you can see ordering on different devices of the same user:

    ordering.mp4

    @ajayesivan anyway, this does not block PR from merging, we can address separately is there is an issue.

    So PR is ready for merge.

    @ajayesivan
    Copy link
    Contributor

    ajayesivan commented Mar 21, 2024

    @pavloburykh Currently, it's not being ordered manually, but ideally, it should be in the same order on all devices, and we should implement some sort of sorting. I will create a follow-up issue to take care of this. Thank you for testing the PR!

    Edit: Follow-up issue: #19353

    @ajayesivan ajayesivan force-pushed the 18638-communities-implement-permission-drawer branch from 478d5d6 to 04f3f09 Compare March 21, 2024 12:51
    @ajayesivan ajayesivan merged commit 1e37765 into develop Mar 21, 2024
    6 checks passed
    @ajayesivan ajayesivan deleted the 18638-communities-implement-permission-drawer branch March 21, 2024 13:18
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Projects
    Archived in project
    Archived in project
    Development

    Successfully merging this pull request may close these issues.

    Communities: Implement permission drawer
    6 participants