Skip to content

Commit

Permalink
Merge branch 'develop' into 17928-sync-biometry-no-password
Browse files Browse the repository at this point in the history
  • Loading branch information
clauxx authored Nov 30, 2023
2 parents 326db65 + d412fa3 commit 721aee0
Show file tree
Hide file tree
Showing 6 changed files with 64 additions and 9 deletions.
2 changes: 2 additions & 0 deletions src/status_im2/config.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -170,3 +170,5 @@
(def default-kdf-iterations 3200)

(def shell-navigation-disabled? false)

(def community-accounts-selection-enabled? false)
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
(ns status-im2.contexts.communities.actions.accounts-selection.view
(:require
[quo.core :as quo]
[react-native.core :as rn]
[react-native.gesture :as gesture]
[status-im2.common.password-authentication.view :as password-authentication]
[status-im2.contexts.communities.actions.request-to-join.style :as style]
[utils.i18n :as i18n]
[utils.re-frame :as rf]))

(defn join-community-and-navigate-back
[id]
(rf/dispatch [:password-authentication/show
{:content (fn [] [password-authentication/view])}
{:label (i18n/label :t/join-open-community)
:on-press #(rf/dispatch [:communities/request-to-join
{:community-id id :password %}])}])
(rf/dispatch [:navigate-back]))

(defn view
[]
(fn []
(let [{:keys [_name
id
_images]} (rf/sub [:get-screen-params])]
[rn/view {:flex 1}
[gesture/scroll-view {:style {:flex 1}}
[rn/view style/page-container
[rn/view {:style (style/bottom-container)}
[quo/button
{:accessibility-label :cancel
:on-press #(rf/dispatch [:navigate-back])
:type :grey
:container-style style/cancel-button}
(i18n/label :t/cancel)]
[quo/button
{:accessibility-label :join-community-button
:on-press #(join-community-and-navigate-back id)
:container-style {:flex 1}}
(i18n/label :t/request-to-join)]]]]])))
9 changes: 7 additions & 2 deletions src/status_im2/contexts/communities/overview/view.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
[status-im2.common.password-authentication.view :as password-authentication]
[status-im2.common.scroll-page.style :as scroll-page.style]
[status-im2.common.scroll-page.view :as scroll-page]
[status-im2.config :as config]
[status-im2.constants :as constants]
[status-im2.contexts.communities.actions.chat.view :as chat-actions]
[status-im2.contexts.communities.actions.community-options.view :as options]
Expand Down Expand Up @@ -182,10 +183,14 @@
(if (seq token-permissions)
[token-gates community]
[quo/button
{:on-press #(rf/dispatch [:open-modal :community-requests-to-join community])
{:on-press
(if config/community-accounts-selection-enabled?
#(rf/dispatch [:open-modal :community-account-selection community])
#(rf/dispatch [:open-modal :community-requests-to-join community]))

:accessibility-label :show-request-to-join-screen-button
:customization-color color
:icon-left :i/communities}
:icon-left :i/communities}
(i18n/label :t/request-to-join-community)]))

(when (not (or joined pending? token-permissions))
Expand Down
5 changes: 5 additions & 0 deletions src/status_im2/navigation/screens.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
[status-im2.contexts.chat.messages.view :as chat]
[status-im2.contexts.chat.new-chat.view :as new-chat]
[status-im2.contexts.chat.photo-selector.view :as photo-selector]
[status-im2.contexts.communities.actions.accounts-selection.view :as communities.accounts-selection]
[status-im2.contexts.communities.actions.request-to-join.view :as join-menu]
[status-im2.contexts.communities.discover.view :as communities.discover]
[status-im2.contexts.communities.overview.view :as communities.overview]
Expand Down Expand Up @@ -89,6 +90,10 @@
:options {:sheet? true}
:component join-menu/request-to-join}

{:name :community-account-selection
:options {:sheet? true}
:component communities.accounts-selection/view}

{:name :lightbox
:options options/lightbox
:component lightbox/lightbox}
Expand Down
11 changes: 6 additions & 5 deletions test/appium/tests/critical/test_deep_and_universal_links.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,8 @@ def test_links_deep_links(self):
for link, text in profile_links.items():
self.browser_view.open_url(link)
if text:
name_is_shown = self.profile_view.default_username_text.text == text
name_is_shown = self.profile_view.default_username_text.text == text \
or self.profile_view.default_username_text.text.endswith(link[-6:])
else:
name_is_shown = self.profile_view.default_username_text.text.endswith(link[-6:])
if not self.channel.profile_add_to_contacts_button.is_element_displayed(10) or not name_is_shown:
Expand All @@ -92,19 +93,19 @@ def test_links_deep_links(self):

@marks.testrail_id(704614)
def test_links_open_universal_links_from_other_apps(self):
app_package = self.driver.current_package
self.home.just_fyi("Opening a profile URL from google search bar when user is still logged in")
profile_url = "https://status.app/u#zQ3shVVxZMwLVEQvuu1KF6h4D2mzVyCC4F4mHLZm5dz5XU1aa"
self.home.click_system_home_button()
self.home.open_link_from_google_search_app(profile_url)
self.home.open_link_from_google_search_app(profile_url, app_package)
if not self.channel.profile_add_to_contacts_button.is_element_displayed(
10) or not self.profile_view.default_username_text.text.endswith(profile_url[-6:]):
self.errors.append("Profile was not opened by the url %s when user is logged in" % profile_url)

self.home.just_fyi("Opening a community URL from google search bar when user is logged out")
app_package = self.driver.current_package
self.driver.terminate_app(app_package)
community_url = "https://status.app/c/Ow==#zQ3shbmfT3hvh4mKa1v6uAjjyztQEroh8Mfn6Ckegjd7LT3XK"
self.home.open_link_from_google_search_app(community_url)
self.home.open_link_from_google_search_app(community_url, app_package)
self.sign_in.sign_in()
if not self.home.element_by_translation_id(
"community-admins-will-review-your-request").is_element_displayed(10):
Expand All @@ -114,7 +115,7 @@ def test_links_open_universal_links_from_other_apps(self):
self.driver.reset()
self.home.click_system_home_button()
channel_url = "https://status.app/cc/Ow==#zQ3shbmfT3hvh4mKa1v6uAjjyztQEroh8Mfn6Ckegjd7LT3XK"
self.home.open_link_from_google_search_app(channel_url)
self.home.open_link_from_google_search_app(channel_url, app_package)
self.sign_in.create_user()
if not self.home.element_by_translation_id(
"community-admins-will-review-your-request").is_element_displayed(10):
Expand Down
6 changes: 4 additions & 2 deletions test/appium/views/base_view.py
Original file line number Diff line number Diff line change
Expand Up @@ -842,9 +842,11 @@ def wait_for_staleness_of_element(self, element_instance: WebElement, seconds=10
raise TimeoutException(
"Device %s: expected element is not stale after %s seconds" % (self.driver.number, seconds)) from None

def open_link_from_google_search_app(self, link_text: str):
def open_link_from_google_search_app(self, link_text: str, app_package: str):
Button(self.driver, xpath="//*[contains(@resource-id,'search_container_all_apps')]").click()
EditBox(self.driver, xpath="//android.widget.EditText").send_keys(link_text)
self.driver.press_keycode(66)
Button(self.driver, xpath="//*[@resource-id='android:id/resolver_list']//*[@text='Status']").click_if_shown()
text_to_click = "Status PR" if app_package.endswith(".pr") else "Status"
Button(self.driver,
xpath="//*[@resource-id='android:id/resolver_list']//*[@text='%s']" % text_to_click).click_if_shown()
Button(self.driver, xpath="//*[@resource-id='android:id/button_once']").click()

0 comments on commit 721aee0

Please sign in to comment.