Compare commits
17
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
7b858e3dd0 | ||
|
|
488db615c0 | ||
|
|
5cea66647e | ||
|
|
ab750c1829 | ||
|
|
bbb07ff595 | ||
|
|
1753ea0de0 | ||
|
|
8ff7a1630c | ||
|
|
5e87d7eefd | ||
|
|
cdada3fa23 | ||
|
|
4020b4fdef | ||
|
|
ba89ac3fcf | ||
|
|
a5571eae92 | ||
|
|
c12cab27f4 | ||
|
|
d1514ec52d | ||
|
|
c4264462b1 | ||
|
|
b1d4368154 | ||
|
|
95380175a6 |
@@ -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,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}
|
||||
"""
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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' }
|
||||
|
||||
@@ -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.
|
||||
|
||||
+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}]]]]))
|
||||
@@ -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]))
|
||||
|
||||
@@ -193,21 +193,17 @@
|
||||
[alias name nickname]))
|
||||
|
||||
(defn add-searchable-phrases-to-contact
|
||||
[{:keys [alias name added? blocked? identicon public-key nickname ens-verified display-name]}
|
||||
community-chat?]
|
||||
[{:keys [alias name added? blocked? identicon public-key nickname ens-verified]} community-chat?]
|
||||
(when (and alias
|
||||
(not (string/blank? alias))
|
||||
(or name
|
||||
display-name
|
||||
nickname
|
||||
added?
|
||||
community-chat?)
|
||||
(not blocked?))
|
||||
(add-searchable-phrases
|
||||
{:alias alias
|
||||
:name (or (and ens-verified (utils/safe-replace name ".stateofus.eth" ""))
|
||||
(when-not (string/blank? display-name) display-name)
|
||||
alias)
|
||||
:name (or (and ens-verified (utils/safe-replace name ".stateofus.eth" "")) alias)
|
||||
:identicon identicon
|
||||
:nickname nickname
|
||||
:ens-verified ens-verified
|
||||
|
||||
@@ -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))
|
||||
@@ -66,17 +66,15 @@
|
||||
(assoc contact' :two-names (contact-two-names contact' true))))
|
||||
|
||||
(defn displayed-name
|
||||
"Use preferred name, display-name, name or alias in that order"
|
||||
[{:keys [name display-name preferred-name alias public-key ens-verified]}]
|
||||
(let [display-name (if (string/blank? display-name) nil display-name)
|
||||
ens-name (or preferred-name
|
||||
display-name
|
||||
"Use preferred name, name or alias in that order"
|
||||
[{:keys [name preferred-name alias public-key ens-verified]}]
|
||||
(let [ens-name (or preferred-name
|
||||
name)]
|
||||
;; 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)]
|
||||
(or username ens-name))
|
||||
(or display-name alias (gfycat/generate-gfy public-key)))))
|
||||
(or alias (gfycat/generate-gfy public-key)))))
|
||||
|
||||
(defn contact-by-identity
|
||||
[contacts identity]
|
||||
|
||||
@@ -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]
|
||||
|
||||
@@ -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]]))
|
||||
|
||||
|
||||
|
||||
@@ -41,7 +41,7 @@
|
||||
{:type :negative :label (i18n/label :t/declined)}
|
||||
nil)}
|
||||
(case (:contact-request-state message)
|
||||
constants/contact-request-message-state-pending
|
||||
constants/contact-request-state-mutual
|
||||
{:button-1 {:label (i18n/label :t/decline)
|
||||
:accessibility-label :decline-contact-request
|
||||
:type :danger
|
||||
|
||||
@@ -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}))
|
||||
|
||||
@@ -134,16 +134,16 @@
|
||||
(case content-type
|
||||
|
||||
constants/content-type-text
|
||||
[content.text/text-content message-data context]
|
||||
[not-implemented/not-implemented [content.text/text-content message-data context]]
|
||||
|
||||
constants/content-type-emoji
|
||||
[old-message/emoji message-data]
|
||||
[not-implemented/not-implemented [old-message/emoji message-data]]
|
||||
|
||||
constants/content-type-sticker
|
||||
[old-message/sticker message-data]
|
||||
[not-implemented/not-implemented [old-message/sticker message-data]]
|
||||
|
||||
constants/content-type-audio
|
||||
[old-message/audio message-data]
|
||||
[not-implemented/not-implemented [old-message/audio message-data]]
|
||||
|
||||
constants/content-type-image
|
||||
[image/image-message 0 message-data context on-long-press]
|
||||
@@ -151,19 +151,19 @@
|
||||
constants/content-type-album
|
||||
[album/album-message message-data context on-long-press]
|
||||
|
||||
[content.unknown/unknown-content message-data])
|
||||
[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
|
||||
[{: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)
|
||||
|
||||
@@ -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
|
||||
@@ -160,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))}
|
||||
|
||||
@@ -210,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)
|
||||
@@ -230,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
|
||||
@@ -239,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)}])))))
|
||||
|
||||
@@ -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.131.7+hotfix.1",
|
||||
"commit-sha1": "47263752fca6d2efab08430aa71d33296374b805",
|
||||
"src-sha256": "1fsv1nlqw0rln01alzr5bqlh9mkh2jjwxg1binfiwq34fk91r4sq"
|
||||
"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