Compare commits
16
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
7b858e3dd0 | ||
|
|
488db615c0 | ||
|
|
5cea66647e | ||
|
|
ab750c1829 | ||
|
|
bbb07ff595 | ||
|
|
1753ea0de0 | ||
|
|
8ff7a1630c | ||
|
|
5e87d7eefd | ||
|
|
cdada3fa23 | ||
|
|
4020b4fdef | ||
|
|
ba89ac3fcf | ||
|
|
a5571eae92 | ||
|
|
c12cab27f4 | ||
|
|
d1514ec52d | ||
|
|
c4264462b1 | ||
|
|
b1d4368154 |
@@ -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,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
@@ -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,4 +1,4 @@
|
||||
library 'status-jenkins-lib@v1.6.3'
|
||||
library 'status-jenkins-lib@v1.6.6'
|
||||
|
||||
pipeline {
|
||||
agent { label params.AGENT_LABEL }
|
||||
|
||||
@@ -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()
|
||||
|
||||
@@ -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}
|
||||
"""
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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}
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
library 'status-jenkins-lib@v1.6.6'
|
||||
|
||||
pipeline {
|
||||
|
||||
agent { label 'linux' }
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
library 'status-jenkins-lib@v1.6.3'
|
||||
library 'status-jenkins-lib@v1.6.6'
|
||||
|
||||
pipeline {
|
||||
agent { label 'macos' }
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
library 'status-jenkins-lib@v1.6.3'
|
||||
library 'status-jenkins-lib@v1.6.6'
|
||||
|
||||
pipeline {
|
||||
agent { label 'linux' }
|
||||
|
||||
@@ -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.
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -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>
|
||||
|
||||
+5
@@ -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 |
@@ -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
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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]))
|
||||
|
||||
@@ -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]
|
||||
|
||||
@@ -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))
|
||||
@@ -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)))
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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))))
|
||||
|
||||
@@ -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))))
|
||||
|
||||
@@ -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]
|
||||
|
||||
@@ -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]
|
||||
|
||||
@@ -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
|
||||
[]
|
||||
|
||||
@@ -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))
|
||||
|
||||
@@ -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}]))
|
||||
|
||||
@@ -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]]))
|
||||
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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}))
|
||||
|
||||
@@ -156,14 +156,14 @@
|
||||
[status/status outgoing-status])]]]])))])
|
||||
|
||||
(defn message-with-reactions
|
||||
[{:keys [pinned pinned-by mentioned in-pinned-view? content-type
|
||||
[{: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}
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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}]])
|
||||
@@ -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)}])))))
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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}]}])
|
||||
|
||||
|
||||
@@ -45,3 +45,5 @@
|
||||
(defn advance-timers-by-time
|
||||
[time-ms]
|
||||
(js/jest.advanceTimersByTime time-ms))
|
||||
|
||||
(def mock-fn js/jest.fn)
|
||||
|
||||
@@ -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"
|
||||
}
|
||||
|
||||
@@ -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'
|
||||
|
||||
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user