Compare commits

...
Author SHA1 Message Date
Volodymyr Kozieiev 7b858e3dd0 Gating on Status community 2023-02-16 14:19:47 +00:00
Mohamed Javid 488db615c0 Get community-id from notification data for mentions and replies (#15100)
* [Chore] Get community-id from notification data

* [Chore] Updated name for community chat
2023-02-16 16:10:23 +05:30
Parvesh Monu 5cea66647e fix deep links to user profiles don't do anything on tap (#15089) 2023-02-15 23:27:34 +05:30
Andrea Maria Piana ab750c1829 Upgrade status-go to 0.131.4
https://github.com/status-im/status-go/compare/dea21f44...0b2f0ef2
2023-02-15 12:16:59 +00:00
Siddarth Kumar bbb07ff595 we should explicitly mention testing status-go in our docs (#15091)
* we should explicitly mention testing status-go
2023-02-15 17:06:55 +05:30
Alexander 1753ea0de0 Allow user to add contact by scanning their QR code (with a fake QR code reader) (#15076)
* Allow user to add contact by scanning their QR code

* Newline

* Small fix

* Fix
2023-02-15 10:41:48 +01:00
Ulises Manuel Cárdenas 8ff7a1630c [#15019] small option card component (#15077)
* Create small-option-card component

* Add preview screen

* Add mock-fn to test helpers

* Add component tests

* Move namespaces

* Change new section name

* Refactor tests

* Change test-ids by accessibility labels
2023-02-14 16:06:13 -06:00
Parvesh Monu 5e87d7eefd fix new chat button is not visible in small screen devices (#15079) 2023-02-14 16:57:30 +05:30
jakub cdada3fa23 ci: update ITSEncryptionExportComplianceCode
We were using old ID for the encryption compliance from old Org.
Because of this the iOS release builds failed at TestFlight upload:
```
Error: Asset validation failed Invalid Export Compliance Code.
The export compliance key value [1aa92c4d-6194-4d7d-b70a-16b48256b87e]
in the app's Info.plist doesn’t match the key value of the app’s export
compliance documentation.
To find the correct value, go to My Apps on App Store Connect. (90592)
```
Related:
- https://stackoverflow.com/questions/53326492/
- https://help.apple.com/app-store-connect/#/dev38f592ac9

Signed-off-by: Jakub Sokołowski <jakub@status.im>
2023-02-14 10:33:58 +01:00
Ibrahem Khalil 4020b4fdef Fix pinned messages (#14787) 2023-02-14 10:50:09 +02:00
jakub ba89ac3fcf ci: fix Jenkins lib function for reading version
Otherwise we just get `UNKNOWN` in release filenames.

Depends on: https://github.com/status-im/status-jenkins-lib/pull/56

Signed-off-by: Jakub Sokołowski <jakub@status.im>
2023-02-13 18:05:11 +01:00
John Ngei a5571eae92 Fix: Communities home header flickering when user scrolls (#15060) 2023-02-10 17:06:49 +03:00
Alexander c12cab27f4 The [Cancel] and [Join] buttons are hidden within 'Join Community' overlay (#14971)
* The [Cancel] and [Join] buttons are hidden within 'Join Community' overlay

* Lint

* Fixes

* Lint fix
2023-02-10 13:59:36 +01:00
Siddarth Kumar d1514ec52d fetch emoji hash for profile (#14987)
* add emoji-hash to app-db post login
2023-02-10 16:32:46 +05:30
Churikova Tetiana c4264462b1 ci/e2e: make copying of nightly artifacts work
Signed-off-by: Jakub Sokołowski <jakub@status.im>
2023-02-09 20:32:18 +01:00
flexsurfer b1d4368154 [#15046] Contacts in contact list are sorted by 3-random name (#15051) 2023-02-09 17:40:59 +01:00
Omar Basem 95380175a6 fix: image actions (#14996)
* fix: image actions and reactions
2023-02-09 07:18:49 +04:00
70 changed files with 839 additions and 371 deletions
+1 -1
View File
@@ -1,4 +1,4 @@
library 'status-jenkins-lib@v1.6.5'
library 'status-jenkins-lib@v1.6.6'
/* Options section can't access functions in objects. */
def isPRBuild = utils.isPRBuild()
+3 -1
View File
@@ -1,4 +1,4 @@
library 'status-jenkins-lib@v1.6.3'
library 'status-jenkins-lib@v1.6.6'
pipeline {
agent { label 'linux' }
@@ -8,6 +8,8 @@ pipeline {
disableConcurrentBuilds()
/* Prevent Jenkins jobs from running forever */
timeout(time: 40, unit: 'MINUTES')
/* Allow copying of artifacts from this job. */
copyArtifactPermission('/status-mobile/e2e/*')
/* Limit builds retained */
buildDiscarder(logRotator(
numToKeepStr: '10',
+1 -1
View File
@@ -1,4 +1,4 @@
library 'status-jenkins-lib@v1.6.5'
library 'status-jenkins-lib@v1.6.6'
/* Options section can't access functions in objects. */
def isPRBuild = utils.isPRBuild()
+1 -1
View File
@@ -1,4 +1,4 @@
library 'status-jenkins-lib@v1.6.3'
library 'status-jenkins-lib@v1.6.6'
pipeline {
agent { label params.AGENT_LABEL }
+1 -1
View File
@@ -1,4 +1,4 @@
library 'status-jenkins-lib@v1.6.3'
library 'status-jenkins-lib@v1.6.6'
/* Options section can't access functions in objects. */
def isPRBuild = utils.isPRBuild()
+12 -6
View File
@@ -1,3 +1,5 @@
library 'status-jenkins-lib@v1.6.6'
pipeline {
agent { label 'linux' }
@@ -18,13 +20,17 @@ pipeline {
disableConcurrentBuilds()
}
stages {
stage('Prep') {
stage('Fetch') {
when { expression { !params.APK_URL } }
steps { script {
if (params.PR_ID == null) {
error("PR_ID parameter not set!")
}
copyArtifacts(
projectName: "status-mobile/nightly",
filter: '*-x86.apk',
/* WARNING: This copies the latest available artifact. */
selector: lastWithArtifacts(),
)
apk_path = "${env.WORKSPACE}/${utils.findFile('*-x86.apk')}"
} }
}
@@ -73,7 +79,7 @@ pipeline {
-m testrail_id \
-m \"new_ui_critical or new_ui_medium\" \
-k \"${params.KEYWORD_EXPRESSION}\" \
--apk=${params.APK_NAME}
--apk=${params.APK_URL ?: apk_path}
"""
}
}
+9 -3
View File
@@ -1,4 +1,4 @@
library 'status-jenkins-lib@v1.6.5'
library 'status-jenkins-lib@v1.6.6'
pipeline {
@@ -14,6 +14,10 @@ pipeline {
name: 'PR_ID',
description: 'ID of the Pull Request triggering this build.',
)
string(
name: 'APK_URL',
description: 'Optional, set if job require APK to be downloaded from URL.',
)
string(
name: 'KEYWORD_EXPRESSION',
description: 'This will run tests which contain names that match the given string expression (Optional)',
@@ -54,9 +58,11 @@ pipeline {
}
stage('Fetch') {
steps { script { /* WARNING: This copies the latest available artifact. */
when { expression { !params.APK_URL } }
steps { script {
copyArtifacts(
projectName: "status-mobile/prs/android-e2e/PR-${params.PR_ID}",
/* WARNING: This copies the latest available artifact. */
selector: lastWithArtifacts(),
)
apk_path = "${env.WORKSPACE}/${utils.findFile('result/*.apk')}"
@@ -119,7 +125,7 @@ pipeline {
--rerun_count=2 \
--testrail_report=True \
-k \"${params.KEYWORD_EXPRESSION}\" \
--apk=${apk_path} \
--apk=${params.APK_URL ?: apk_path} \
--build=PR-${params.PR_ID}-${utils.timestamp()} \
--pr_number=${params.PR_ID} \
${extraPytestOpts}
+2
View File
@@ -1,3 +1,5 @@
library 'status-jenkins-lib@v1.6.6'
pipeline {
agent { label 'linux' }
+1 -1
View File
@@ -1,4 +1,4 @@
library 'status-jenkins-lib@v1.6.3'
library 'status-jenkins-lib@v1.6.6'
pipeline {
agent { label 'macos' }
+1 -1
View File
@@ -1,4 +1,4 @@
library 'status-jenkins-lib@v1.6.3'
library 'status-jenkins-lib@v1.6.6'
pipeline {
agent { label 'linux' }
+8 -7
View File
@@ -27,12 +27,10 @@ The most important thing is that
status-mobile code that makes it to the `develop` branch, should always point to a tagged version of status-go in the `develop` branch of status-go.
In practice this means:
1) Create a PR in status-go, get it reviewed by status-go devs
2) Create a PR in status-mobile, get it reviewed by devs, then go through manual testing (if necessary)
3) Once ready to merge, merge status-go PR first, make sure you bump the `VERSION` file in status-go
In practice, this means that sometimes they need to be merged in lockstep.
1) Create a PR in status-go and status-mobile. Update the status-go version to the PR revision `scripts/update-status-go.sh $git_revision`.
2) Get both PRs reviewed and approved. Once status-mobile PR has been approved, go through manual QA testing if necessary. Don't merge status-mobile PR just yet.
3) Now that you know the integration between client & server is working, bump the `VERSION` in status-go and merge it.
4) Once merged, tag the version with the new version and push the tag:
```
git checkout develop
@@ -41,4 +39,7 @@ In practice this means:
git push origin vx.y.z
```
5) Update status-mobile with the new status-go version, using the new tag `scripts/update-status-go.sh "vx.y.z"`
6) Push, make sure it's rebased and go through the merge process as above.
6) In status-mobile, push, rebase against `develop` and merge it 🚀
important note : make sure your status-go PRs get a tested-ok by QA before merging them in.
+1 -1
View File
@@ -52,7 +52,7 @@
<key>ITSAppUsesNonExemptEncryption</key>
<true/>
<key>ITSEncryptionExportComplianceCode</key>
<string>1aa92c4d-6194-4d7d-b70a-16b48256b87e</string>
<string>37d5ac79-0eb2-4e66-9117-8a8515185a7f</string>
<key>LSApplicationQueriesSchemes</key>
<array>
<string>whatsapp</string>
+1 -1
View File
@@ -48,7 +48,7 @@
<key>ITSAppUsesNonExemptEncryption</key>
<true/>
<key>ITSEncryptionExportComplianceCode</key>
<string>1aa92c4d-6194-4d7d-b70a-16b48256b87e</string>
<string>37d5ac79-0eb2-4e66-9117-8a8515185a7f</string>
<key>LSApplicationQueriesSchemes</key>
<array>
<string>whatsapp</string>
@@ -1139,6 +1139,11 @@ class StatusModule extends ReactContextBaseJavaModule implements LifecycleEventL
executeRunnableStatusGoMethod(() -> Statusgo.generateAlias(seed), callback);
}
@ReactMethod
public void emojiHash(final String publicKey, final Callback callback) throws JSONException {
executeRunnableStatusGoMethod(() -> Statusgo.emojiHash(publicKey), callback);
}
@ReactMethod(isBlockingSynchronousMethod = true)
public String identicon(final String seed) {
return Statusgo.identicon(seed);
@@ -865,6 +865,12 @@ RCT_EXPORT_METHOD(generateAliasAsync:(NSString *)publicKey
callback(@[result]);
}
RCT_EXPORT_METHOD(emojiHash:(NSString *)publicKey
callback:(RCTResponseSenderBlock)callback) {
NSString *result = StatusgoEmojiHash(publicKey);
callback(@[result]);
}
RCT_EXPORT_BLOCKING_SYNCHRONOUS_METHOD(identicon:(NSString *)publicKey) {
return StatusgoIdenticon(publicKey);
}
Binary file not shown.

After

Width:  |  Height:  |  Size: 9.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 539 KiB

+1 -1
View File
@@ -82,7 +82,7 @@
:optimizations :simple
:target :node-test
;; When running tests without a REPL you can uncomment below line to `make test-watch` a specific file
;;:ns-regexp "status-im2.subs.subs-test$"
;; :ns-regexp "status-im2.subs.chat.messages-test$"
:main
status-im.test-runner/main
;; set :ui-driven to true to let shadow-cljs inject node-repl
@@ -0,0 +1,54 @@
(ns quo2.components.onboarding.small-option-card.component-spec
(:require [quo2.components.onboarding.small-option-card.view :as small-option-card]
[status-im.react-native.resources :as resources]
[test-helpers.component :as h]))
(defn- testing-small-option-card
[variant
{:keys [title subtitle image on-press]
:or {title "title" subtitle "subtitle"}}]
[small-option-card/small-option-card
{:variant variant
:title title
:subtitle subtitle
:image image
:on-press on-press}])
(h/describe "small-option-card"
(h/describe "Title & subtitle are rendered"
(let [title "A title"
subtitle "A subtitle"
component-props {:title title :subtitle subtitle}]
(h/test "`:main` variant"
(h/render (testing-small-option-card :main component-props))
(-> (h/get-by-text title) h/expect .toBeTruthy)
(-> (h/get-by-text subtitle) h/expect .toBeTruthy))
(h/test "`:icon` variant"
(h/render (testing-small-option-card :icon component-props))
(-> (h/get-by-text title) h/expect .toBeTruthy)
(-> (h/get-by-text subtitle) h/expect .toBeTruthy))))
(h/describe "Card pressed"
(let [on-press-fn (h/mock-fn)
component-props {:on-press on-press-fn}]
(h/test "`:main` variant"
(h/render (testing-small-option-card :main component-props))
(h/fire-event :press (h/get-by-label-text :small-option-card))
(-> on-press-fn js/expect .toHaveBeenCalled))
(h/test "`:icon` variant"
(h/render (testing-small-option-card :icon component-props))
(h/fire-event :press (h/get-by-label-text :small-option-card))
(-> on-press-fn js/expect .toHaveBeenCalled))))
(h/describe "Image rendered"
(let [image (resources/get-mock-image :small-opt-card-main)
component-props {:image image}]
(h/test "`:main` variant"
(h/render (testing-small-option-card :main component-props))
(-> (h/get-by-label-text :small-option-card-main-image) h/expect .-not .toBeNull))
(h/test "`:icon` variant"
(h/render (testing-small-option-card :icon component-props))
(-> (h/get-by-label-text :small-option-card-icon-image) h/expect .-not .toBeNull)))))
@@ -0,0 +1,52 @@
(ns quo2.components.onboarding.small-option-card.style
(:require [quo2.foundations.colors :as colors]))
(def text-container {:flex 1})
(def title
{:color colors/white
:height 22})
(def subtitle
{:color colors/white-opa-70
:height 18})
(def icon-variant
{:flex-direction :row
:padding-vertical 8
:padding-horizontal 12})
(def icon-variant-image-container
{:width 32
:height 40
:justify-content :center
:align-items :center
:padding-vertical 4
:margin-right 8})
(def icon-variant-image
{:flex 1
:width 32
:height 32})
(def main-variant
{:flex 1
:margin-bottom -8})
(def main-variant-text-container
{:height 62
:padding-top 10
:padding-bottom 12
:padding-horizontal 12})
(def touchable-overlay {:border-radius 16})
(defn card-container
[main-variant?]
(when main-variant? {:height 343}))
(defn card
[main-variant?]
{:background-color colors/white-opa-5
:border-radius 16
:height (if main-variant? 335 56)})
@@ -0,0 +1,66 @@
(ns quo2.components.onboarding.small-option-card.view
(:require [quo2.components.markdown.text :as text]
[quo2.components.onboarding.small-option-card.style :as style]
[quo2.foundations.colors :as colors]
[react-native.core :as rn]
[react-native.fast-image :as fast-image]))
(defn- texts
[{:keys [title subtitle]}]
[rn/view {:style style/text-container}
[text/text
{:style style/title
:size :paragraph-1
:weight :semi-bold
:number-of-lines 1}
title]
[text/text
{:style style/subtitle
:size :paragraph-2
:weight :regular
:number-of-lines 1}
subtitle]])
(defn- icon-variant
[{:keys [title subtitle image]}]
[rn/view {:style style/icon-variant}
[rn/view {:style style/icon-variant-image-container}
[fast-image/fast-image
{:accessibility-label :small-option-card-icon-image
:style style/icon-variant-image
:resize-mode :contain
:source image}]]
[texts
{:title title
:subtitle subtitle}]])
(defn- main-variant
[{:keys [title subtitle image]}]
[rn/view {:style style/main-variant}
[rn/view {:style style/main-variant-text-container}
[texts
{:title title
:subtitle subtitle}]]
[fast-image/fast-image
{:accessibility-label :small-option-card-main-image
:style {:flex 1}
:resize-mode :contain
:source image}]])
(defn small-option-card
[{:keys [variant title subtitle image on-press]
:or {variant :main}}]
(let [main-variant? (= variant :main)
card-component (if main-variant? main-variant icon-variant)]
[rn/touchable-highlight
{:accessibility-label :small-option-card
:style style/touchable-overlay
:active-opacity 1
:underlay-color colors/white-opa-5
:on-press on-press}
[rn/view {:style (style/card-container main-variant?)}
[rn/view {:style (style/card main-variant?)}
[card-component
{:title title
:subtitle subtitle
:image image}]]]]))
@@ -3,8 +3,7 @@
(defn container
[]
{:flex 1
:flex-direction :row
{:flex-direction :row
:background-color (colors/theme-colors colors/neutral-5 colors/neutral-80-opa-40)
:padding 11
:align-self :stretch
+4
View File
@@ -50,6 +50,7 @@
quo2.components.separator
quo2.components.settings.accounts.view
quo2.components.settings.privacy-option
quo2.components.onboarding.small-option-card.view
quo2.components.tabs.account-selector
quo2.components.tabs.tabs
quo2.components.tags.context-tags
@@ -101,6 +102,9 @@
;;;; BANNER
(def banner quo2.components.banners.banner.view/banner)
;;;; CARDS
(def small-option-card quo2.components.onboarding.small-option-card.view/small-option-card)
;;;; COMMUNITY
(def community-card-view-item quo2.components.community.community-card-view/community-card-view-item)
(def communities-list-view-item quo2.components.community.community-list-view/communities-list-view-item)
+4 -3
View File
@@ -6,7 +6,8 @@
[quo2.components.drawers.action-drawers.component-spec]
[quo2.components.drawers.permission-context.component-spec]
[quo2.components.markdown.--tests--.text-component-spec]
[quo2.components.selectors.--tests--.selectors-component-spec]
[quo2.components.selectors.filter.component-spec]
[quo2.components.onboarding.small-option-card.component-spec]
[quo2.components.record-audio.record-audio.--tests--.record-audio-component-spec]
[quo2.components.record-audio.soundtrack.--tests--.soundtrack-component-spec]))
[quo2.components.record-audio.soundtrack.--tests--.soundtrack-component-spec]
[quo2.components.selectors.--tests--.selectors-component-spec]
[quo2.components.selectors.filter.component-spec]))
+6 -5
View File
@@ -14,7 +14,8 @@
[status-im2.contexts.activity-center.events :as activity-center]
[status-im2.common.toasts.events :as toasts]
[status-im2.navigation.events :as navigation]
[taoensso.timbre :as log]))
[taoensso.timbre :as log]
[status-im.communities.mock :as mock]))
(def crop-size 1000)
@@ -100,10 +101,10 @@
(rf/defn handle-communities
{:events [::fetched]}
[{:keys [db]} communities]
{:db (reduce (fn [db {:keys [id] :as community}]
(assoc-in db [:communities id] (<-rpc community)))
db
communities)})
{:db (mock/add-mock-data (reduce (fn [db {:keys [id] :as community}]
(assoc-in db [:communities id] (<-rpc community)))
db
communities))})
(rf/defn handle-response
[_ response-js]
+42
View File
@@ -0,0 +1,42 @@
(ns status-im.communities.mock
(:require [status-im2.constants :as constants]))
(def status-channel-to-mock "5c328f54-4d40-4984-ae96-b946247d8dba")
(def community-gates
{:join [[{:token "KNC"
:amount 200}
{:token "MANA"
:amount 10}
{:token "RARE"
:amount 50}]
[{:token "KNC"
:amount 200}
{:token "MANA"
:amount 50}]]})
(def channel-gates
{:read [[{:token "KNC"
:amount 100}
{:token "RARE"
:amount 50}]
[{:token "KNC"
:amount 200}
{:token "MANA"
:amount 50}]]
:write [[{:token "KNC"
:amount 400}]
[{:token "KNC"
:amount 100}
{:token "RARE"
:amount 50}]]})
(defn add-mock-data
[db]
(if (get-in db [:communities constants/status-community-id])
(-> db
(assoc-in [:communities constants/status-community-id :gates] community-gates)
(assoc-in [:communities constants/status-community-id :status] :gated)
(assoc-in [:communities constants/status-community-id :chats status-channel-to-mock :gates]
channel-gates))
db))
+2 -2
View File
@@ -43,8 +43,8 @@
(defn sort-contacts
[contacts]
(sort (fn [c1 c2]
(let [name1 (or (:name c1) (:address c1) (:public-key c1))
name2 (or (:name c2) (:address c2) (:public-key c2))]
(let [name1 (first (:two-names c1))
name2 (first (:two-names c2))]
(compare (string/lower-case name1)
(string/lower-case name2))))
(vals contacts)))
+9 -12
View File
@@ -40,11 +40,8 @@
:three-words-name (or alias (gfycat/generate-gfy public-key))}
;; Preferred name is our own otherwise we make sure it's verified
(or preferred-name (and ens-verified name))
(assoc :ens-name (str "@" (or (stateofus/username ens-name) ens-name))))))
(assoc :ens-name (or (stateofus/username ens-name) ens-name)))))
;; NOTE: this does a bit of unnecessary work, we could short-circuit the work
;; once the first two are found, i.e don't calculate short key if 2 are already
;; available
(defn contact-two-names
"Returns vector of two names in next order nickname, ens name, display-name, three word name, public key"
[{:keys [names
@@ -56,17 +53,17 @@
display-name
three-words-name]}
(or names (contact-names contact))
short-public-key (when public-key?
(utils/get-shortened-address (or compressed-key
public-key)))]
(->> [nickname ens-name display-name three-words-name short-public-key]
(remove string/blank?)
(take 2))))
non-empty-names (remove string/blank? [nickname ens-name display-name three-words-name])]
(if (> (count non-empty-names) 1)
(vec (take 2 non-empty-names))
[(first non-empty-names)
(when public-key? (utils/get-shortened-address (or compressed-key public-key)))])))
(defn contact-with-names
"Returns contact with :names map "
[contact]
(assoc contact :names (contact-names contact)))
(let [contact' (assoc contact :names (contact-names contact))]
(assoc contact' :two-names (contact-two-names contact' true))))
(defn displayed-name
"Use preferred name, name or alias in that order"
@@ -76,7 +73,7 @@
;; Preferred name is our own otherwise we make sure it's verified
(if (or preferred-name (and ens-verified name))
(let [username (stateofus/username ens-name)]
(str "@" (or username ens-name)))
(or username ens-name))
(or alias (gfycat/generate-gfy public-key)))))
(defn contact-by-identity
+2 -2
View File
@@ -29,11 +29,11 @@
(testing "names is nil"
(testing "nickname has precedence"
(is
(= [nickname formatted-ens]
(= [nickname ens-name]
(ma/contact-two-names contact public-key))))
(testing "ens name is second option"
(is
(= [formatted-ens display-name]
(= [ens-name display-name]
(ma/contact-two-names
(dissoc contact :nickname)
public-key))))
+5 -2
View File
@@ -44,7 +44,8 @@
[status-im2.navigation.events :as navigation]
[status-im2.common.log :as logging]
[taoensso.timbre :as log]
[utils.security.core :as security]))
[utils.security.core :as security]
[status-im2.contexts.emoji-hash.events :as emoji-hash]))
(re-frame/reg-fx
::initialize-communities-enabled
@@ -411,7 +412,8 @@
(communities/fetch)
(logging/set-log-level (:log-level multiaccount))
(activity-center/notifications-fetch-unread-contact-requests)
(activity-center/notifications-fetch-unread-count))))
(activity-center/notifications-fetch-unread-count)
#_(communities/resolve-mock-community-info))))
(re-frame/reg-fx
::open-last-chat
@@ -473,6 +475,7 @@
(get-group-chat-invitations)
(multiaccounts/get-profile-picture)
(multiaccounts/switch-preview-privacy-mode-flag)
(emoji-hash/fetch-for-current-public-key)
(link-preview/request-link-preview-whitelist)
(visibility-status-updates-store/fetch-visibility-status-updates-rpc)
(switcher-cards-store/fetch-switcher-cards-rpc))))
+6
View File
@@ -481,6 +481,12 @@
(when (validators/valid-public-key? public-key)
(.generateAliasAsync ^js (status) public-key callback)))
(defn public-key->emoji-hash
"Generate an emoji hash from the multiaccount public key"
[public-key callback]
(when (validators/valid-public-key? public-key)
(.emojiHash ^js (status) public-key callback)))
(defn identicon
"Generate a icon based on a string, synchronously"
[seed]
+3 -1
View File
@@ -67,7 +67,9 @@
:user-picture-female2 (js/require "../resources/images/mock/user_picture_female2.png")
:user-picture-male4 (js/require "../resources/images/mock/user_picture_male4.png")
:user-picture-male5 (js/require "../resources/images/mock/user_picture_male5.png")
:coinbase (js/require "../resources/images/mock/coinbase.png")})
:coinbase (js/require "../resources/images/mock/coinbase.png")
:small-opt-card-icon (js/require "../resources/images/mock/small_opt_card_icon.png")
:small-opt-card-main (js/require "../resources/images/mock/small_opt_card_main.png")})
(defn get-theme-image
[k]
+18 -4
View File
@@ -8,6 +8,8 @@
[status-im.ethereum.core :as ethereum]
[status-im.ethereum.eip681 :as eip681]
[status-im.ethereum.ens :as ens]
[status-im.utils.types :as types]
[status-im.native-module.core :as status]
[status-im.ethereum.stateofus :as stateofus]
[status-im2.utils.validators :as validators]
[status-im.utils.http :as http]
@@ -71,15 +73,27 @@
(defn match-contact-async
[chain {:keys [user-id ens-name]} callback]
(let [valid-key (and (validators/valid-public-key? user-id)
(not= user-id ens/default-key))]
(let [valid-public-key? (and (validators/valid-public-key? user-id)
(not= user-id ens/default-key))
valid-compressed-key? (validators/valid-compressed-key? user-id)]
(cond
valid-key
valid-public-key?
(callback {:type :contact
:public-key user-id
:ens-name ens-name})
(and (not valid-key)
valid-compressed-key?
(status/compressed-key->public-key
user-id
(fn [response]
(let [{:keys [error]} (types/json->clj response)]
(when-not error
(match-contact-async
chain
{:user-id (str "0x" (subs response 5)) :ens-name ens-name}
callback)))))
(and (not valid-public-key?)
(string? user-id)
(not (string/blank? user-id))
(not= user-id "0x"))
@@ -16,6 +16,7 @@
:justify-content :center
:align-items :center})
(defn chat-button
[{:keys [bottom]}]
{:bottom (- bottom 50)})
(def chat-button
{:position :absolute
:bottom 30
:align-self :center})
@@ -6,14 +6,12 @@
[reagent.core :as reagent]
[status-im2.constants :as constants]
[utils.i18n :as i18n]
[status-im.ui.components.react :as react]
[react-native.core :as rn]
[utils.re-frame :as rf]
[status-im.ui.components.toolbar :as toolbar]
[status-im2.common.contact-list.view :as contact-list]
[quo2.components.markdown.text :as text]
[status-im.ui.components.invite.events :as invite.events]
[status-im.ui2.screens.chat.components.new-chat.styles :as style]
[quo.components.safe-area :as safe-area]
[status-im.react-native.resources :as resources]))
(defn- hide-sheet-and-dispatch
@@ -33,11 +31,11 @@
(defn- no-contacts-view
[]
[react/view
[rn/view
{:style {:justify-content :center
:align-items :center
:margin-top 120}}
[react/image
[rn/image
{:source (resources/get-image (if (quo2.colors/dark?) :no-contacts-dark :no-contacts))}]
[text/text
{:weight :semi-bold
@@ -74,9 +72,8 @@
added? (reagent/atom '())
{:keys [nickname ens-name three-words-name]} names
first-username (or ens-name nickname three-words-name)
no-contacts? (empty? contacts)
safe-area (safe-area/use-safe-area)]
[react/view {:style {:height (* window-height 0.9)}}
no-contacts? (empty? contacts)]
[rn/view {:style {:height (* window-height 0.9)}}
[quo2/button
{:type :grey
:icon true
@@ -85,7 +82,7 @@
:override-background-color (quo2.colors/theme-colors quo2.colors/neutral-10
quo2.colors/neutral-90)}
:i/close]
[react/view style/contact-selection-heading
[rn/view style/contact-selection-heading
[quo2/text
{:weight :semi-bold
:size :heading-1
@@ -99,9 +96,8 @@
(i18n/label :t/selected-count-from-max
{:selected (inc selected-contacts-count)
:max constants/max-group-chat-participants})])]
[react/view
{:style {:height 430
:margin-bottom -20}}
[rn/view
{:style {:flex 1}}
(if no-contacts?
[no-contacts-view]
[contact-list/contact-list
@@ -110,21 +106,19 @@
:added? added?
:search? false
:start-a-new-chat? true
:on-toggle on-toggle}])]
:on-toggle on-toggle}
70])]
(when contacts-selected?
[toolbar/toolbar
{:size :default
:show-border? false
:center [button/button
{:type :primary
:accessibility-label :next-button
:style (style/chat-button safe-area)
:on-press (fn []
(if one-contact-selected?
(hide-sheet-and-dispatch [:chat.ui/start-chat
public-key])
(hide-sheet-and-dispatch [:navigate-to
:new-group])))}
(if one-contact-selected?
(i18n/label :t/chat-with {:selected-user first-username})
(i18n/label :t/setup-group-chat))]}])]))])
[button/button
{:type :primary
:style style/chat-button
:accessibility-label :next-button
:on-press (fn []
(if one-contact-selected?
(hide-sheet-and-dispatch [:chat.ui/start-chat
public-key])
(hide-sheet-and-dispatch [:navigate-to
:new-group])))}
(if one-contact-selected?
(i18n/label :t/chat-with {:selected-user first-username})
(i18n/label :t/setup-group-chat))])]))])
@@ -113,11 +113,7 @@
:pop-to-root-tab-fx :profile-stack}
public-key
(navigation/navigate-to-cofx (-> cofx
(assoc-in [:db :contacts/identity] public-key)
(assoc-in [:db :contacts/ens-name] ens-name))
:profile
{})))
{:dispatch [:chat.ui/show-profile public-key ens-name]}))
(rf/defn handle-eip681
[cofx data]
@@ -31,13 +31,13 @@
:overflow :hidden})
(defn content-style
[insets]
[insets bottom-safe-area-spacing?]
{:position :absolute
:left 0
:right 0
:top 0
:padding-top border-radius
:padding-bottom (:bottom insets)})
:padding-bottom (if bottom-safe-area-spacing? (:bottom insets) 0)})
(defn selected-background
[]
+16 -14
View File
@@ -81,23 +81,25 @@
(defn bottom-sheet
[props children]
(let [{on-cancel :on-cancel
disable-drag? :disable-drag?
show-handle? :show-handle?
visible? :visible?
backdrop-dismiss? :backdrop-dismiss?
expandable? :expandable?
selected-item :selected-item
is-initially-expaned? :expanded?
:or {show-handle? true
backdrop-dismiss? true
expandable? false
is-initially-expaned? false}}
(let [{on-cancel :on-cancel
disable-drag? :disable-drag?
show-handle? :show-handle?
visible? :visible?
backdrop-dismiss? :backdrop-dismiss?
expandable? :expandable?
bottom-safe-area-spacing? :bottom-safe-area-spacing?
selected-item :selected-item
is-initially-expanded? :expanded?
:or {show-handle? true
backdrop-dismiss? true
expandable? false
bottom-safe-area-spacing? true
is-initially-expanded? false}}
props
content-height (reagent/atom nil)
show-bottom-sheet? (reagent/atom nil)
keyboard-was-shown? (reagent/atom false)
expanded? (reagent/atom is-initially-expaned?)
expanded? (reagent/atom is-initially-expanded?)
gesture-running? (reagent/atom false)
reset-atoms (fn []
(reset! show-bottom-sheet? nil)
@@ -226,7 +228,7 @@
{:behaviour (if platform/ios? :padding :height)
:style {:flex 1}}
[rn/view
{:style (styles/content-style insets)
{:style (styles/content-style insets bottom-safe-area-spacing?)
:on-layout (when-not (and
(some? @content-height)
(> @content-height 0))
+2 -2
View File
@@ -9,7 +9,7 @@
[quo/divider-label {:label title}])
(defn contact-list
[data]
[data padding-bottom]
(let [contacts (if (:group data)
(rf/sub [:contacts/grouped-by-first-letter])
(rf/sub [:contacts/filtered-active-sections]))]
@@ -18,6 +18,6 @@
:sticky-section-headers-enabled false
:sections contacts
:render-section-header-fn contacts-section-header
:content-container-style {:padding-bottom 20}
:content-container-style {:padding-bottom (or padding-bottom 20)}
:render-data data
:render-fn contact-list-item/contact-list-item}]))
+2 -2
View File
@@ -74,7 +74,7 @@
:style {:line-height 21}}
name]])
(if top-nav
[top-nav]
top-nav
[quo/page-nav
(merge {:horizontal-description? true
:one-icon-align-left? true
@@ -89,7 +89,7 @@
:icon-background-color (icon-color)
:on-press #(rf/dispatch [:navigate-back])}}))])
(when title-colum
[title-colum])
title-colum)
sticky-header]]))
+2 -2
View File
@@ -214,8 +214,8 @@
{2 {0 image-size
1 image-size}
3 {0 [(* image-size 2) (* image-size 1.5)]
1 [(- image-size 1) (- (* image-size 0.67) 1)]
2 [(- image-size 1) (- (* image-size 0.67) 1)]}
1 [(- image-size 0.5) (- (* image-size 0.67) 1)]
2 [(- image-size 0.5) (- (* image-size 0.67) 1)]}
4 {0 image-size
1 image-size
2 image-size
@@ -36,13 +36,11 @@
parsed-text-children))))
(defn view
[{:keys [author chat-name chat-id message read timestamp]}]
(let [chat (rf/sub [:chats/chat chat-id])
community-id (:community-id chat)
is-chat-from-community? (not (nil? community-id))
community (rf/sub [:communities/community community-id])
community-name (:name community)
community-image (get-in community [:images :thumbnail :uri])]
[{:keys [author chat-name community-id chat-id message read timestamp]}]
(let [community-chat? (not (string/blank? community-id))
community (rf/sub [:communities/community community-id])
community-name (:name community)
community-image (get-in community [:images :thumbnail :uri])]
[rn/touchable-opacity
{:on-press (fn []
(rf/dispatch [:hide-popover])
@@ -54,7 +52,7 @@
:unread? (not read)
:context [[common/user-avatar-tag author]
[quo/text {:style style/tag-text} (string/lower-case (i18n/label :t/on))]
(if is-chat-from-community?
(if community-chat?
[quo/context-tag tag-params {:uri community-image} community-name chat-name]
[quo/group-avatar-tag chat-name tag-params])]
:message {:body (message-body message)}}]]))
@@ -1,5 +1,6 @@
(ns status-im2.contexts.activity-center.notification.reply.view
(:require [quo2.core :as quo]
(:require [clojure.string :as string]
[quo2.core :as quo]
[quo2.foundations.colors :as colors]
[react-native.core :as rn]
[status-im.ui2.screens.chat.messages.message :as old-message]
@@ -37,13 +38,11 @@
nil))
(defn view
[{:keys [author chat-name chat-id message read timestamp]}]
(let [chat (rf/sub [:chats/chat chat-id])
community-id (:community-id chat)
is-chat-from-community? (not (nil? community-id))
community (rf/sub [:communities/community community-id])
community-name (:name community)
community-image (get-in community [:images :thumbnail :uri])]
[{:keys [author chat-name community-id chat-id message read timestamp]}]
(let [community-chat? (not (string/blank? community-id))
community (rf/sub [:communities/community community-id])
community-name (:name community)
community-image (get-in community [:images :thumbnail :uri])]
[rn/touchable-opacity
{:on-press (fn []
(rf/dispatch [:hide-popover])
@@ -55,7 +54,7 @@
:unread? (not read)
:context [[common/user-avatar-tag author]
[quo/text {:style style/lowercase-text} (i18n/label :t/on)]
(if is-chat-from-community?
(if community-chat?
[quo/context-tag tag-params {:uri community-image} community-name chat-name]
[quo/group-avatar-tag chat-name tag-params])]
:message {:body-number-of-lines 1
@@ -6,6 +6,7 @@
[status-im.ethereum.ens :as ens]
[status-im.ethereum.stateofus :as stateofus]
[status-im.native-module.core :as status]
[status-im2.navigation.events :as navigation]
[status-im2.utils.validators :as validators]
[status-im.utils.utils :as utils]))
@@ -109,3 +110,10 @@
{:events [:contacts/clear-new-identity :contacts/new-chat-focus]}
[{:keys [db]}]
{:db (dissoc db :contacts/new-identity)})
(rf/defn qr-code-scanned
{:events [:contacts/qr-code-scanned]}
[{:keys [db] :as cofx} input]
(rf/merge cofx
(set-new-identity input)
(navigation/navigate-back)))
@@ -2,6 +2,7 @@
(:require [quo2.core :as quo]
[react-native.core :as rn]
[status-im.react-native.resources :as resources]
[status-im.qr-scanner.core :as qr-scanner]
[status-im2.contexts.add-new-contact.style :as style]
[utils.debounce :as debounce]
[utils.i18n :as i18n]
@@ -42,7 +43,8 @@
600)})]
[quo/button
(merge style/button-qr
{:on-press #(js/alert "TODO: to be implemented")})
{:on-press #(rf/dispatch [::qr-scanner/scan-code
{:handler :contacts/qr-code-scanned}])})
:i/scan]]
(when error?
[rn/view style/container-error
@@ -14,12 +14,12 @@
:overflow :hidden})
(defn image
[dimensions index portrait?]
[dimensions index portrait? images-count]
{:width (:width dimensions)
:height (:height dimensions)
:margin-left (when (or (and (not= index 0) (not= index 2) (not= count 3))
(= count 3)
(and portrait? (= index 2)))
:margin-left (when (or (and (not= index 0) (not= index 2) (not= images-count 3))
(and (not portrait?) (= images-count 3) (= index 2))
(and portrait? (= images-count 3) (> index 0)))
1)
:margin-bottom (when (< index 2) 1)
:align-self :flex-start})
@@ -5,8 +5,7 @@
[react-native.fast-image :as fast-image]
[status-im2.contexts.chat.messages.content.album.style :as style]
[status-im2.constants :as constants]
[utils.re-frame :as rf]
[status-im2.contexts.chat.messages.content.image.view :as image]))
[utils.re-frame :as rf]))
(def rectangular-style-count 3)
@@ -17,7 +16,7 @@
{:width (second size-arr) :height (first size-arr) :album-style album-style}))
(defn album-message
[{:keys [albumize?] :as message}]
[message]
(let [shared-element-id (rf/sub [:shared-element-id])
first-image (first (:album message))
album-style (if (> (:image-width first-image) (:image-height first-image))
@@ -26,43 +25,44 @@
images-count (count (:album message))
;; album images are always square, except when we have 3 images, then they must be rectangular
;; (portrait or landscape)
portrait? (and (= images-count rectangular-style-count) (= album-style :portrait))]
(if (and albumize? (> images-count 1))
[rn/view
{:style (style/album-container portrait?)}
(map-indexed
(fn [index item]
(let [images-size-key (if (< images-count constants/max-album-photos) images-count :default)
size (get-in constants/album-image-sizes [images-size-key index])
dimensions (if (not= images-count rectangular-style-count)
{:width size :height size}
(find-size size album-style))]
[rn/touchable-opacity
{:key (:message-id item)
:active-opacity 1
:on-press (fn []
(rf/dispatch [:chat.ui/update-shared-element-id (:message-id item)])
(js/setTimeout #(rf/dispatch [:navigate-to :lightbox
{:messages (:album message) :index index}])
100))}
[fast-image/fast-image
{:style (style/image dimensions index portrait?)
:source {:uri (:image (:content item))}
:native-ID (when (and (= shared-element-id (:message-id item))
(< index constants/max-album-photos))
:shared-element)}]
(when (and (> images-count constants/max-album-photos)
(= index (- constants/max-album-photos 1)))
[rn/view
{:style style/overlay}
[quo/text
{:weight :bold
:size :heading-2
:style {:color colors/white}}
(str "+" (- images-count (dec constants/max-album-photos)))]])]))
(:album message))]
[:<>
(map-indexed
(fn [index item]
[image/image-message index item])
(:album message))])))
portrait? (and (= images-count rectangular-style-count) (= album-style :portrait))
text (:text (:content first-image))]
[:<>
;; This text comp is temporary. Should later use
;; `status-im2.contexts.chat.messages.content.text.view`
(when (not= text "placeholder") [quo/text {:style {:margin-bottom 10}} text])
[rn/view
{:style (style/album-container portrait?)}
(map-indexed
(fn [index item]
(let [images-size-key (if (< images-count constants/max-album-photos) images-count :default)
size (get-in constants/album-image-sizes [images-size-key index])
dimensions (if (not= images-count rectangular-style-count)
{:width size :height size}
(find-size size album-style))]
[rn/touchable-opacity
{:key (:message-id item)
:active-opacity 1
;; issue: https://github.com/status-im/status-mobile/issues/14995
:on-long-press #(js/alert "Action drawer for albums is not supported yet")
:on-press (fn []
(rf/dispatch [:chat.ui/update-shared-element-id (:message-id item)])
(js/setTimeout #(rf/dispatch [:navigate-to :lightbox
{:messages (:album message) :index index}])
100))}
[fast-image/fast-image
{:style (style/image dimensions index portrait? images-count)
:source {:uri (:image (:content item))}
:native-ID (when (and (= shared-element-id (:message-id item))
(< index constants/max-album-photos))
:shared-element)}]
(when (and (> images-count constants/max-album-photos)
(= index (- constants/max-album-photos 1)))
[rn/view
{:style style/overlay}
[quo/text
{:weight :bold
:size :heading-2
:style {:color colors/white}}
(str "+" (- images-count (dec constants/max-album-photos)))]])]))
(:album message))]]))
@@ -1,12 +1,15 @@
(ns status-im2.contexts.chat.messages.content.image.view
(:require [react-native.core :as rn]
[react-native.fast-image :as fast-image]
[utils.re-frame :as rf]))
(:require
[quo2.core :as quo]
[react-native.core :as rn]
[react-native.fast-image :as fast-image]
[status-im2.constants :as constants]
[utils.re-frame :as rf]))
(defn calculate-dimensions
[width height]
(let [max-width (if (> width height) 320 190)
max-height (if (> width height) 190 320)]
(let [max-width (if (> width height) (* 2 constants/image-size) (* 1.5 constants/image-size))
max-height (if (> width height) (* 1.5 constants/image-size) (* 2 constants/image-size))]
(if (> height width)
(let [calculated-height (* (min height max-height) (/ (max width max-width) width))
calculated-width (* (max width max-width) (/ (min height max-height) height))]
@@ -16,7 +19,7 @@
{:width calculated-width :height calculated-height}))))
(defn image-message
[index {:keys [content image-width image-height message-id] :as message}]
[_ {:keys [content image-width image-height message-id] :as message} context on-long-press]
(let [dimensions (calculate-dimensions (or image-width 1000) (or image-height 1000))
text (:text content)]
(fn []
@@ -24,7 +27,7 @@
[rn/touchable-opacity
{:active-opacity 1
:key message-id
:style {:margin-top (when (> index 0) 20)}
:on-long-press #(on-long-press message context)
:on-press (fn []
(rf/dispatch [:chat.ui/update-shared-element-id message-id])
(js/setTimeout #(rf/dispatch [:navigate-to :lightbox
@@ -32,7 +35,7 @@
100))}
;; This text comp is temporary. Should later use
;; `status-im2.contexts.chat.messages.content.text.view`
(when (and (not= text "placeholder") (= index 0)) [rn/text text])
(when (not= text "placeholder") [quo/text {:style {:margin-bottom 10}} text])
[fast-image/fast-image
{:source {:uri (:image content)}
:style (merge dimensions {:border-radius 12})
@@ -6,8 +6,10 @@
[status-im2.contexts.chat.messages.drawers.view :as drawers]))
(defn message-reactions-row
[chat-id message-id]
(let [reactions (rf/sub [:chats/message-reactions message-id chat-id])]
[chat-id message-id messages-ids]
(let [reactions (if messages-ids
(mapcat #(rf/sub [:chats/message-reactions % chat-id]) messages-ids)
(rf/sub [:chats/message-reactions message-id chat-id]))]
(when (seq reactions)
[rn/view {:margin-left 52 :margin-bottom 12 :flex-direction :row}
(for [{:keys [own emoji-id quantity emoji-reaction-id] :as emoji-reaction} reactions]
@@ -28,8 +30,12 @@
:accessibility-label (str "emoji-reaction-" emoji-id)}]])
[quo/add-reaction
{:on-press (fn []
(rf/dispatch [:dismiss-keyboard])
(rf/dispatch
[:bottom-sheet/show-sheet
{:content (fn [] [drawers/reactions
{:chat-id chat-id :message-id message-id}])}]))}]])))
;; issue: https://github.com/status-im/status-mobile/issues/14995
(if messages-ids
(js/alert "Reactions for albums is not yet supported")
(do
(rf/dispatch [:dismiss-keyboard])
(rf/dispatch
[:bottom-sheet/show-sheet
{:content (fn [] [drawers/reactions
{:chat-id chat-id :message-id message-id}])}]))))}]])))
@@ -2,10 +2,10 @@
(:require [quo2.foundations.colors :as colors]))
(defn message-container
[in-pinned-view? pinned mentioned last-in-group?]
(merge (when (and (not in-pinned-view?) (or mentioned pinned))
[in-pinned-view? pinned-by mentioned last-in-group?]
(merge (when (and (not in-pinned-view?) (or mentioned pinned-by))
{:background-color colors/primary-50-opa-5
:margin-bottom 4})
(when (or mentioned pinned last-in-group?)
(when (or mentioned pinned-by last-in-group?)
{:margin-top 8})
{:border-radius 16}))
@@ -83,6 +83,13 @@
(rf/dispatch [:bottom-sheet/show-sheet
{:content (drawers/reactions-and-actions message-data context)}]))
(defn on-long-press
[message-data context]
(rf/dispatch [:dismiss-keyboard])
(rf/dispatch [:bottom-sheet/show-sheet
{:content (drawers/reactions-and-actions message-data
context)}]))
(defn user-message-content
[{:keys [content-type quoted-message content outgoing outgoing-status] :as message-data}
{:keys [chat-id] :as context}]
@@ -112,11 +119,7 @@
(reset! show-delivery-state? true)
(js/setTimeout #(reset! show-delivery-state? false)
delivery-state-showing-time-ms)))
:on-long-press (fn []
(rf/dispatch [:dismiss-keyboard])
(rf/dispatch [:bottom-sheet/show-sheet
{:content (drawers/reactions-and-actions message-data
context)}]))}
:on-long-press #(on-long-press message-data context)}
[rn/view {:style {:padding-vertical 8}}
(when (and (seq response-to) quoted-message)
[old-message/quoted-message {:message-id response-to :chat-id chat-id} quoted-message])
@@ -130,39 +133,41 @@
[author message-data]
(case content-type
constants/content-type-text [not-implemented/not-implemented
[content.text/text-content message-data context]]
constants/content-type-text
[not-implemented/not-implemented [content.text/text-content message-data context]]
constants/content-type-emoji [not-implemented/not-implemented
[old-message/emoji message-data]]
constants/content-type-emoji
[not-implemented/not-implemented [old-message/emoji message-data]]
constants/content-type-sticker [not-implemented/not-implemented
[old-message/sticker message-data]]
constants/content-type-sticker
[not-implemented/not-implemented [old-message/sticker message-data]]
constants/content-type-image [image/image-message 0 message-data context]
constants/content-type-audio
[not-implemented/not-implemented [old-message/audio message-data]]
constants/content-type-audio [not-implemented/not-implemented
[old-message/audio message-data]]
constants/content-type-image
[image/image-message 0 message-data context on-long-press]
constants/content-type-album [album/album-message message-data context]
constants/content-type-album
[album/album-message message-data context on-long-press]
[not-implemented/not-implemented [content.unknown/unknown-content message-data]])
(when @show-delivery-state?
[status/status outgoing-status])]]]])))])
(defn message-with-reactions
[{:keys [pinned pinned-by mentioned in-pinned-view? content-type
last-in-group? message-id]
[{:keys [pinned-by mentioned in-pinned-view? content-type
last-in-group? message-id messages-ids]
:as message-data}
{:keys [chat-id] :as context}]
[rn/view
{:style (style/message-container in-pinned-view? pinned mentioned last-in-group?)
{:style (style/message-container in-pinned-view? pinned-by mentioned last-in-group?)
:accessibility-label :chat-item}
(when pinned
(when pinned-by
[pin/pinned-by-view pinned-by])
(if (#{constants/content-type-system-text constants/content-type-community
constants/content-type-contact-request}
content-type)
[system-message-content message-data]
[user-message-content message-data context])
[reactions/message-reactions-row chat-id message-id]])
[reactions/message-reactions-row chat-id message-id messages-ids]])
@@ -10,16 +10,18 @@
[status-im2.common.not-implemented :as not-implemented]))
(defn pin-message
[{:keys [chat-id pinned] :as message-data}]
(let [pinned-messages (rf/sub [:chats/pinned chat-id])]
(if (and (not pinned) (> (count pinned-messages) 2))
[{:keys [chat-id pinned pinned-by] :as message-data}]
(let [pinned-messages (rf/sub [:chats/pinned chat-id])
message-not-pinned? (and (empty? pinned-by) (not pinned))]
(if (and message-not-pinned? (> (count pinned-messages) 2))
(do
(js/setTimeout (fn [] (rf/dispatch [:dismiss-keyboard])) 500)
(rf/dispatch [:pin-message/show-pin-limit-modal chat-id]))
(rf/dispatch [:pin-message/send-pin-message (assoc message-data :pinned (not pinned))]))))
(rf/dispatch [:pin-message/send-pin-message
(assoc message-data :pinned message-not-pinned?)]))))
(defn get-actions
[{:keys [outgoing content pinned outgoing-status] :as message-data}
[{:keys [outgoing content pinned-by outgoing-status] :as message-data}
{:keys [edit-enabled show-input? can-delete-message-for-everyone? community? message-pin-enabled]}]
(concat
(when (and outgoing edit-enabled)
@@ -44,12 +46,12 @@
(when message-pin-enabled
[{:type :main
:on-press #(pin-message message-data)
:label (i18n/label (if pinned
:label (i18n/label (if pinned-by
(if community? :t/unpin-from-channel :t/unpin-from-chat)
(if community? :t/pin-to-channel :t/pin-to-chat)))
:icon :i/pin
:id (if pinned :unpin :pin)}])
(when-not pinned
:id (if pinned-by :unpin :pin)}])
(when-not pinned-by
[{:type :danger
:on-press (fn []
(rf/dispatch
@@ -29,7 +29,8 @@
:position :absolute
:right 20})
(def camera-button-container
(defn close-button-container
[]
{:background-color (colors/theme-colors colors/neutral-10 colors/neutral-80)
:width 32
:height 32
@@ -130,7 +130,7 @@
[rn/touchable-opacity
{:active-opacity 1
:on-press #(rf/dispatch [:navigate-back])
:style style/camera-button-container}
:style (style/close-button-container)}
[quo/icon :i/close
{:size 20 :color (colors/theme-colors colors/black colors/white)}]])
[album-title true selected-album selected temporary-selected]
@@ -77,18 +77,30 @@
(defn home-page-comunity-lists
[{:keys [selected-tab padding-top]}]
(fn []
[rn/view {:style {:flex 1}}
[communities-header selected-tab padding-top]
[render-communities-segments selected-tab]]))
[rn/view {:style {:flex 1}}
[communities-header selected-tab padding-top]
[render-communities-segments selected-tab]])
(defn home-sticky-header
[{:keys [selected-tab scroll-height padding-top]}]
(fn []
(when (> @scroll-height 80)
[rn/view
{:style style/blur-tabs-header}
[community-segments selected-tab padding-top]])))
(when (> @scroll-height 80)
[rn/view
{:style style/blur-tabs-header}
[community-segments selected-tab padding-top]]))
(defn home-nav
[]
[common.home/top-nav
{:type :default
:hide-search true
:style {:background-color :transparent}}])
(defn title-column
[]
[common.home/title-column
{:label (i18n/label :t/communities)
:handler #(rf/dispatch [:bottom-sheet/show-sheet :add-new {}])
:accessibility-label :new-chat-button}])
(defn communities-screen-content
[]
@@ -98,16 +110,8 @@
[scroll-page/scroll-page
{:name (i18n/label :t/communities)
:on-scroll #(reset! scroll-height %)
:top-nav (fn []
[common.home/top-nav
{:type :default
:hide-search true
:style {:background-color :transparent}}])
:title-colum (fn []
[common.home/title-column
{:label (i18n/label :t/communities)
:handler #(rf/dispatch [:bottom-sheet/show-sheet :add-new {}])
:accessibility-label :new-chat-button}])
:top-nav [home-nav]
:title-colum [title-column]
:background-color (colors/theme-colors
colors/white
colors/neutral-95)
@@ -36,8 +36,7 @@
:margin-bottom 20})
(def title-container
{:flex 1
:flex-direction :row
{:flex-direction :row
:align-items :center
:justify-content :space-between})
@@ -56,10 +55,10 @@
{:flex 1
:margin-right 12})
(def request-button
{:margin-top 32
:margin-bottom 16
:flex 1
(defn bottom-container
[safe-area-insets]
{:padding-top 32
:padding-bottom (:bottom safe-area-insets)
:flex-direction :row
:align-items :center
:justify-content :space-evenly})
@@ -1,9 +1,10 @@
(ns status-im2.contexts.communities.menus.request-to-join.view
(:require [quo.react-native :as rn]
[quo2.core :as quo]
(:require [react-native.core :as rn]
[react-native.safe-area :as safe-area]
[reagent.core :as reagent]
[utils.i18n :as i18n]
[status-im2.contexts.communities.menus.request-to-join.style :as style]
[quo2.core :as quo]
[utils.i18n :as i18n]
[utils.re-frame :as rf]
[utils.requests :as requests]))
@@ -73,60 +74,72 @@
:render-fn community-rule-item}])
(defn request-to-join
[{:keys [permissions name id images
can-join? can-request-access?
[{:keys [permissions
name
id
images
can-join?
can-request-access?
requested-to-join-at]}]
(let [agreed-to-rules? (reagent/atom false)
is-open? (not= 3 (:access permissions))]
(fn []
[rn/scroll-view {:style style/page-container}
[rn/view
{:style style/title-container}
(let [agreed-to-rules? (reagent/atom false)]
[safe-area/consumer
(fn [insets]
[:f>
(fn []
(let [{window-height :height} (rn/use-window-dimensions)
is-open? (not= 3 (:access permissions))]
[rn/scroll-view {:style {:max-height (- window-height (:top insets))}}
[rn/view style/page-container
[rn/view
{:style style/title-container}
[quo/text
{:accessibility-label :communities-join-community
:weight :semi-bold
:size :heading-1}
(request-to-join-text is-open?)]
[rn/view
{:style style/request-icon}
[quo/icon :i/info]]]
[quo/context-tag
{:style
{:margin-right :auto
:margin-top 8}}
(:thumbnail images) name]
[quo/text
{:style {:margin-top 24}
:accessibility-label :communities-rules-title
:weight :semi-bold
:size :paragraph-1}
(i18n/label :t/community-rules)]
[community-rules-list community-rules]
[quo/text
{:accessibility-label :communities-join-community
:weight :semi-bold
:size :heading-1}
(request-to-join-text is-open?)]
[rn/view
{:style style/request-icon}
[quo/icon :i/info]]]
[quo/context-tag
{:style
{:margin-right :auto
:margin-top 8}}
(:thumbnail images) name]
[quo/text
{:style {:margin-top 24}
:accessibility-label :communities-rules-title
:weight :semi-bold
:size :paragraph-1}
(i18n/label :t/community-rules)]
[quo/disclaimer
{:accessibility-label :rules-disclaimer-checkbox
:container-style {:margin-top 20}
:on-change #(swap! agreed-to-rules? not)}
(i18n/label :t/accept-community-rules)]
[rn/view
{:style style/request-button}
[quo/button
{:accessibility-label :cancel
:on-press #(rf/dispatch [:bottom-sheet/hide])
:type :grey
:style style/cancel-button} (i18n/label :t/cancel)]
[quo/button
{:accessibility-label :join-community-button
:on-press (fn []
(if can-join?
(do
(rf/dispatch [:communities/join id])
(rf/dispatch [:bottom-sheet/hide]))
(do (and can-request-access?
(not (pos? requested-to-join-at))
(requests/can-request-access-again? requested-to-join-at))
(rf/dispatch [:communities/request-to-join id])
(rf/dispatch [:bottom-sheet/hide]))))
:disabled (not @agreed-to-rules?)
:style {:flex 1}} (request-to-join-text is-open?)]]])))
[community-rules-list community-rules]
[quo/disclaimer
{:accessibility-label :rules-disclaimer-checkbox
:container-style {:margin-top 20}
:on-change #(swap! agreed-to-rules? not)}
(i18n/label :t/accept-community-rules)]
[rn/view {:style (style/bottom-container insets)}
[quo/button
{:accessibility-label :cancel
:on-press #(rf/dispatch [:bottom-sheet/hide])
:type :grey
:style style/cancel-button} (i18n/label :t/cancel)]
[quo/button
{:accessibility-label :join-community-button
:on-press (fn []
(if can-join?
(do
(rf/dispatch [:communities/join id])
(rf/dispatch [:bottom-sheet/hide]))
(do (and can-request-access?
(not (pos? requested-to-join-at))
(requests/can-request-access-again?
requested-to-join-at))
(rf/dispatch [:communities/request-to-join id])
(rf/dispatch [:bottom-sheet/hide]))))
:disabled (not @agreed-to-rules?)
:style {:flex 1}} (request-to-join-text is-open?)]]]]))])]))
@@ -31,7 +31,7 @@
(utils/join-existing-users-string user-list)]])
(defn channel-token-gating-details
[name token-gating emoji channel-color]
[name gates emoji channel-color]
[rn/view {:height 350 :margin-top 20}
[quo/token-gating
{:channel {:name name
@@ -42,15 +42,15 @@
(js/alert
"Entered channel"
"Wuhuu!! You successfully entered the channel :)"))
:gates token-gating}}]])
:gates gates}}]])
(defn open-channel-token-gating-details
[name token-gating emoji channel-color]
[name gates emoji channel-color]
(rf/dispatch
[:bottom-sheet/show-sheet
{:content
(fn []
[channel-token-gating-details name token-gating emoji channel-color])
[channel-token-gating-details name gates emoji channel-color])
:content-height 210}]))
(defn layout-y
@@ -119,9 +119,10 @@
[quo/button
{:on-press #(rf/dispatch
[:bottom-sheet/show-sheet
{:content (fn [] [join-menu/request-to-join
community])
:content-height 300}])
{:content (fn [] [join-menu/request-to-join
community])
:bottom-safe-area-spacing? false
:content-height 300}])
:accessibility-label :show-request-to-join-screen-button
:override-background-color community-color
:style style/join-button
@@ -159,13 +160,13 @@
:gates tokens}}]])
(defn add-on-press-handler
[community-id {:keys [name emoji id locked? token-gating] :or {locked? false} :as chat}]
[community-id {:keys [name emoji id locked? gates] :or {locked? false} :as chat}]
(merge
chat
(if (and locked? token-gating)
(if (and locked? gates)
{:on-press #(open-channel-token-gating-details
name
token-gating
gates
emoji
(colors/custom-color :pink 50))}
@@ -209,14 +210,16 @@
(defn community-content
[{:keys [name description locked joined images
status tokens tags requested-to-join-at id]
status tags requested-to-join-at id]
:as community}
{:keys [on-categories-heights-changed
on-first-channel-height-changed]}]
(let [pending? (pos? requested-to-join-at)
thumbnail-image (get-in images [:thumbnail])
chats-by-category (rf/sub [:communities/categorized-channels id])
users (rf/sub [:communities/users id])]
(let [pending? (pos? requested-to-join-at)
thumbnail-image (get-in images [:thumbnail])
chats-by-category (rf/sub [:communities/categorized-channels id])
users (rf/sub [:communities/users id])
join-gates (rf/sub [:community/join-gates id])
permission-tag-tokens (rf/sub [:community/permission-tag-tokens id])]
[rn/view
[rn/view {:padding-horizontal 20}
(when (and (not joined)
@@ -229,7 +232,7 @@
[quo/permission-tag-container
{:locked locked
:status status
:tokens tokens
:tokens permission-tag-tokens
:on-press #(rf/dispatch
[:bottom-sheet/show-sheet
{:content-height 210
@@ -238,7 +241,7 @@
[community-token-gating-details
name
thumbnail-image
tokens])}])}]])
join-gates])}])}]])
(when (or pending? joined)
[rn/view
{:position :absolute
@@ -0,0 +1,19 @@
(ns status-im2.contexts.emoji-hash.events
(:require [utils.re-frame :as rf]
[status-im.native-module.core :as native-module]
[utils.transforms :as transform]))
(defn fetch-for-current-public-key
[]
(let [public-key (rf/sub [:multiaccount/public-key])]
(native-module/public-key->emoji-hash
public-key
(fn [response]
(let [response-clj (transform/json->clj response)
emoji-hash (get response-clj :result)]
(rf/dispatch [:emoji-hash/add-to-multiaccount emoji-hash]))))))
(rf/defn add-emoji-hash-to-multiaccount
{:events [:emoji-hash/add-to-multiaccount]}
[{:keys [db]} emoji-hash]
{:db (assoc db :multiaccount/emoji-hash emoji-hash)})
@@ -8,6 +8,7 @@
[re-frame.core :as re-frame]
[react-native.core :as rn]
[react-native.safe-area :as safe-area]
[status-im2.contexts.quo-preview.animated-header-list.animated-header-list :as animated-header-list]
[status-im2.contexts.quo-preview.avatars.account-avatar :as account-avatar]
[status-im2.contexts.quo-preview.avatars.channel-avatar :as channel-avatar]
[status-im2.contexts.quo-preview.avatars.group-avatar :as group-avatar]
@@ -46,6 +47,7 @@
[status-im2.contexts.quo-preview.navigation.top-nav :as top-nav]
[status-im2.contexts.quo-preview.notifications.activity-logs :as activity-logs]
[status-im2.contexts.quo-preview.notifications.toast :as toast]
[status-im2.contexts.quo-preview.onboarding.small-option-card :as small-option-card]
[status-im2.contexts.quo-preview.posts-and-attachments.messages-skeleton :as messages-skeleton]
[status-im2.contexts.quo-preview.profile.collectible :as collectible]
[status-im2.contexts.quo-preview.profile.profile-card :as profile-card]
@@ -68,8 +70,7 @@
[status-im2.contexts.quo-preview.wallet.lowest-price :as lowest-price]
[status-im2.contexts.quo-preview.wallet.network-amount :as network-amount]
[status-im2.contexts.quo-preview.wallet.network-breakdown :as network-breakdown]
[status-im2.contexts.quo-preview.wallet.token-overview :as token-overview]
[status-im2.contexts.quo-preview.animated-header-list.animated-header-list :as animated-header-list]))
[status-im2.contexts.quo-preview.wallet.token-overview :as token-overview]))
(def screens-categories
{:foundations [{:name :shadows
@@ -186,6 +187,9 @@
{:name :toast
:insets {:top false}
:component toast/preview-toasts}]
:onboarding [{:name :small-option-card
:insets {:top false}
:component small-option-card/preview-small-option-card}]
:posts-and-attachments [{:name :messages-skeleton
:insets {:top false}
:component messages-skeleton/preview-messages-skeleton}]
@@ -0,0 +1,58 @@
(ns status-im2.contexts.quo-preview.onboarding.small-option-card
(:require
[quo.react-native :as rn]
[quo2.components.onboarding.small-option-card.view :as quo2]
[quo2.foundations.colors :as colors]
[reagent.core :as reagent]
[status-im.react-native.resources :as resources]
[status-im2.contexts.quo-preview.preview :as preview]))
(def descriptor
[{:label "Variant"
:key :variant
:type :select
:options [{:key :main
:value "Main"}
{:key :icon
:value "Icon"}]}
{:label "Image"
:key :image
:type :select
:options [{:key (resources/get-mock-image :small-opt-card-main)
:value "Image 1"}
{:key (resources/get-mock-image :small-opt-card-icon)
:value "Image 2"}]}
{:label "Title"
:key :title
:type :text}
{:label "Subtitle"
:key :subtitle
:type :text}])
(defn cool-preview
[]
(let [state (reagent/atom {:variant :main
:image (-> descriptor second :options first :key)
:title "Generate keys "
:subtitle "Your new self-sovereign identity in Status"
:on-press #(js/alert "Small option card pressed!")})]
(fn []
[rn/touchable-without-feedback {:on-press rn/dismiss-keyboard!}
[rn/view {:style {:padding-bottom 150}}
[rn/view {:style {:flex 1}}
[preview/customizer state descriptor]]
[rn/view
{:style {:background-color colors/neutral-80
:padding 20}}
[quo2/small-option-card @state]]]])))
(defn preview-small-option-card
[]
[rn/view
{:style {:background-color (colors/theme-colors colors/white colors/neutral-90)
:flex 1}}
[rn/flat-list
{:flex 1
:keyboardShouldPersistTaps :always
:header [cool-preview]
:key-fn str}]])
+33 -16
View File
@@ -111,22 +111,39 @@
(defn albumize-messages
[messages]
(get
(reduce (fn [{:keys [messages albums]} message]
(let [album-id (:album-id message)
albums (cond-> albums album-id (update album-id conj message))
messages (if album-id
(conj (filterv #(not= album-id (:album-id %)) messages)
{:album (get albums album-id)
:album-id album-id
:albumize? (:albumize? message)
:message-id album-id
:content-type constants/content-type-album})
(conj messages message))]
{:messages messages
:albums albums}))
{:messages []
:albums {}}
messages)
(reduce
(fn [{:keys [messages albums]} message]
(let [album-id (:album-id message)
;; check if this image is the first image in an album (which is not albumized yet)
add-text? (when (and album-id (not (:albumize? message)) (> (count (get albums album-id)) 0))
(not (some #(= false %)
(mapv #(< (:timestamp message) (:timestamp %))
(get albums album-id)))))
albums (cond-> albums album-id (update album-id conj message))
;; keep text of the first album image only
message (if (or add-text? (<= (count (get albums album-id)) 1))
message
(assoc-in message [:content :text] nil))
messages (if (and (> (count (get albums album-id)) 1) (:albumize? message))
(conj (filterv #(not= album-id (:album-id %)) messages)
{:album (get albums album-id)
:album-id album-id
:albumize? (:albumize? message)
:messages-ids (mapv :message-id (get albums album-id))
:message-id album-id
:content-type constants/content-type-album})
;; remove text of other images in an album
(if add-text?
(conj (mapv #(when (= (:album-id %) album-id)
(assoc-in % [:content :text] nil))
messages)
message)
(conj messages message)))]
{:messages messages
:albums albums}))
{:messages []
:albums {}}
messages)
:messages))
(re-frame/reg-sub
+7 -2
View File
@@ -10,7 +10,9 @@
[{:message-id "0x111" :album-id "abc" :albumize? true}
{:message-id "0x222" :album-id "abc" :albumize? true}
{:message-id "0x333" :album-id "abc" :albumize? true}
{:message-id "0x444" :album-id "abc" :albumize? true}])
{:message-id "0x444" :album-id "abc" :albumize? true}
{:message-id "0x555" :album-id "edf" :timestamp 10 :content {:text "Wassup!"}}
{:message-id "0x666" :album-id "edf" :timestamp 20 :content {:text "Wassup!"}}])
(def messages-albumized-state
[{:album [{:message-id "0x444" :album-id "abc" :albumize? true}
@@ -20,7 +22,10 @@
:album-id "abc"
:albumize? true
:message-id "abc"
:content-type constants/content-type-album}])
:messages-ids ["0x444" "0x333" "0x222" "0x111"]
:content-type constants/content-type-album}
{:message-id "0x555" :album-id "edf" :timestamp 10 :content {:text "Wassup!"}}
{:message-id "0x666" :album-id "edf" :timestamp 20 :content {:text nil}}])
(deftest albumize-messages
(testing "Finding albums in the messages list"
+64 -1
View File
@@ -216,6 +216,34 @@
(sort-by :position)
(into []))))
(def token-images
{"KNC" (js/require "../resources/images/tokens/mainnet/KNC.png")
"MANA" (js/require "../resources/images/tokens/mainnet/MANA.png")
"RARE" (js/require "../resources/images/tokens/mainnet/RARE.png")
"ETH" (js/require "../resources/images/tokens/mainnet/ETH.png")
"DAI" (js/require "../resources/images/tokens/mainnet/DAI.png")})
(defn token-image
[token]
(get token-images token))
(defn enrich-gate-for-ui
[{:keys [token] :as gate}]
(assoc gate :token-img-src (token-image token) :is-sufficient? false))
(defn enrich-gates-vector-for-ui
[gates]
(vec (map enrich-gate-for-ui gates)))
(defn enrich-gates-for-ui
[gates]
(vec (map (fn [v]
(if (vector? v)
(enrich-gates-vector-for-ui v)
(enrich-gate-for-ui v)))
gates)))
(re-frame/reg-sub
:communities/categorized-channels
(fn [[_ community-id]]
@@ -223,7 +251,7 @@
(re-frame/subscribe [:chats/chats])])
(fn [[{:keys [joined categories chats]} full-chats-data] [_ community-id]]
(reduce
(fn [acc [_ {:keys [name categoryID id emoji can-post?]}]]
(fn [acc [_ {:keys [name categoryID id emoji can-post? gates]}]]
(let [category (keyword
(get-in categories
[categoryID :name]
@@ -235,6 +263,11 @@
#(vec (conj %1 %2))
{:name name
:emoji emoji
:gates (merge
(when (contains? gates :read)
{:read (enrich-gates-for-ui (:read gates))})
(when (contains? gates :write)
{:write (enrich-gates-for-ui (:write gates))}))
:unread-messages? (pos? unviewed-messages-count)
:mentions-count (or unviewed-mentions-count 0)
:locked? (or (not joined) (not can-post?))
@@ -250,3 +283,33 @@
{:full-name "Marcus C"}
{:full-name "MNO PQR"}
{:full-name "STU VWX"}]))
(re-frame/reg-sub
:community/join-gates
(fn [[_ community-id]]
[(re-frame/subscribe [:communities/community community-id])])
(fn [[{:keys [gates]}] _]
(when gates
{:join (enrich-gates-for-ui (gates :join))})))
(defn icons-for-permission-tag
[gates]
(vec (map-indexed (fn [i {:keys [token]}]
{:id i :token-icon (token-image token)})
gates)))
(re-frame/reg-sub
:community/permission-tag-tokens
(fn [[_ community-id]]
[(re-frame/subscribe [:communities/community community-id])])
(fn [[{:keys [gates]}] _]
(when gates
(let [join-gates (gates :join)
first-item (first join-gates)]
(if (vector? first-item)
(vec (map-indexed (fn [i v]
{:id i
:group (icons-for-permission-tag v)})
join-gates))
[{:id 0
:group (icons-for-permission-tag join-gates)}])))))
+4 -10
View File
@@ -76,16 +76,10 @@
:contacts/active-sections
:<- [:contacts/active]
(fn [contacts]
(-> (reduce
(fn [acc contact]
(let [first-char (first (:alias contact))]
(if (get acc first-char)
(update-in acc [first-char :data] #(conj % contact))
(assoc acc first-char {:title first-char :data [contact]}))))
{}
contacts)
sort
vals)))
(->> contacts
(group-by #(string/upper-case (ffirst (:two-names %))))
sort
(mapv (fn [[title items]] {:title title :data items})))))
(re-frame/reg-sub
:contacts/grouped-by-first-letter
+6 -3
View File
@@ -95,7 +95,8 @@
:names {:nickname nil
:display-name ""
:three-words-name "Fake Slim Shady"
:ens-name "@slim.shady"}
:ens-name "slim.shady"}
:two-names ["slim.shady" "Fake Slim Shady"]
:has-added-us true
:contact-request-state 1}]}
{:title "I"
@@ -124,7 +125,8 @@
:names {:nickname nil
:display-name ""
:three-words-name "Instant noodles"
:ens-name "@slim.shady"}
:ens-name "slim.shady"}
:two-names ["slim.shady" "Instant noodles"]
:has-added-us true
:contact-request-state 1}]}
{:title "R"
@@ -153,7 +155,8 @@
:names {:nickname nil
:display-name ""
:three-words-name "Real Slim Shady"
:ens-name "@slim.shady"}
:ens-name "slim.shady"}
:two-names ["slim.shady" "Real Slim Shady"]
:has-added-us true
:contact-request-state 1}]}])
+2
View File
@@ -45,3 +45,5 @@
(defn advance-timers-by-time
[time-ms]
(js/jest.advanceTimersByTime time-ms))
(def mock-fn js/jest.fn)
+3 -3
View File
@@ -3,7 +3,7 @@
"_comment": "Instead use: scripts/update-status-go.sh <rev>",
"owner": "status-im",
"repo": "status-go",
"version": "v0.130.0",
"commit-sha1": "dea21f440a9f630c4b8324fcde0b016d6c3fc02b",
"src-sha256": "1w9iyigj0rkqfnyb8m9w802r1lx1cydg41p8qb7hnsry2bgrfk97"
"version": "v0.131.4",
"commit-sha1": "0b2f0ef28923d2bc3c9051d038e7c512bfdc741f",
"src-sha256": "1pql2dkzwny5yv8ggi2dikfc6dbp64cyxjnm8k0nyl2wfs8ax2cg"
}
+2 -2
View File
@@ -108,9 +108,9 @@ class BaseTestReport:
return url
@staticmethod
def get_jenkins_link_to_rerun_e2e(branch_name="develop", pr_id="", apk_name="", tr_case_ids=""):
def get_jenkins_link_to_rerun_e2e(branch_name="develop", pr_id="", tr_case_ids=""):
return 'https://ci.status.im/job/status-mobile/job/e2e/job/status-app-prs-rerun/parambuild/' \
'?BRANCH_NAME=%s&APK_NAME=%s&PR_ID=%s&TR_CASE_IDS=%s' % (branch_name, apk_name, pr_id, tr_case_ids)
'?BRANCH_NAME=%s&PR_ID=%s&TR_CASE_IDS=%s' % (branch_name, pr_id, tr_case_ids)
def get_sauce_final_screenshot_url(self, job_id):
return 'https://media.giphy.com/media/9M5jK4GXmD5o1irGrF/giphy.gif'
-2
View File
@@ -71,13 +71,11 @@ class GithubHtmlReport(BaseTestReport):
if not_executed_tests:
html += "<li><a href=\"%s\">Rerun not executed tests</a></li>" % self.get_jenkins_link_to_rerun_e2e(
pr_id=pr_id,
apk_name=apk_name,
tr_case_ids=','.join([str(i) for i in tests]))
if failed_tests:
html += "<li><a href=\"%s\">Rerun failed tests</a></li>" % self.get_jenkins_link_to_rerun_e2e(
pr_id=pr_id,
apk_name=apk_name,
tr_case_ids=','.join([str(test.testrail_case_id) for test in tests]))
if not not_executed_tests: