Skip to content

Commit e76ddc9

Browse files
Grubba27pmusaraj
andauthored
FEATURE: revamping discover page + add hot topics (#281)
* FEATURE: revamping discover page + add hot topics See video: * DEV: lint * DEV: reviewed a bit more * DEV: lint * changes * Update carousel * DEV: small ui changes * dev: remove overrides * DEV: add tests and split discover into multiple files * DEV: add tests to the CI * DEV: lint * DEV: rename tests * DEV trying to make topic list stable * update metadata * minor layout adjustments for tablets --------- Co-authored-by: Penar Musaraj <pmusaraj@gmail.com>
1 parent fa37473 commit e76ddc9

35 files changed

Lines changed: 2805 additions & 334 deletions

.github/workflows/jest-tests.yml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
name: Jest Tests
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
pull_request:
8+
9+
concurrency:
10+
group: jest-tests-${{ format('{0}-{1}', github.head_ref || github.run_number, github.job) }}
11+
cancel-in-progress: true
12+
13+
jobs:
14+
build:
15+
runs-on: ubuntu-latest
16+
17+
steps:
18+
- uses: actions/checkout@v3
19+
20+
- name: Set up Node.js
21+
uses: actions/setup-node@v3
22+
with:
23+
node-version: 24
24+
cache: yarn
25+
26+
- name: Yarn install
27+
run: yarn
28+
29+
- name: Jest
30+
run: yarn test:unit

e2e/onboarding.test.js

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,3 @@
1-
/*global describe*/
2-
/*global beforeAll*/
3-
/*global beforeEach*/
4-
/*global it*/
5-
61
import { by, device, element, expect } from 'detox';
72
import i18n from 'i18n-js';
83

@@ -42,7 +37,7 @@ describe.each([['en'], ['fr']])(`Onboarding (locale: %s)`, locale => {
4237

4338
it('should show the Discover screen', async () => {
4439
await element(by.text(i18n.t('discover'))).tap();
45-
await expect(element(by.text(i18n.t('discover_all')))).toBeVisible();
40+
await expect(element(by.text(i18n.t('discover_pick_tag')))).toBeVisible();
4641
});
4742

4843
it('should show the Notifications screen', async () => {

e2e/topiclist.test.js

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,3 @@
1-
/*global describe*/
2-
/*global beforeAll*/
3-
/*global beforeEach*/
4-
/*global it*/
5-
61
import i18n from 'i18n-js';
72

83
import { by, device, element, expect } from 'detox';

eslint.config.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,5 +19,13 @@ export default [
1919
'no-undef': 'warn',
2020
},
2121
},
22+
{
23+
files: ['**/__tests__/**/*.js', '**/*.test.js'],
24+
languageOptions: {
25+
globals: {
26+
...globals.jest,
27+
},
28+
},
29+
},
2230
{ ignores: ['lib/*', 'react-native.config.js', '.*', '*.config.js'] },
2331
];

fastlane/Fastfile

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@ fastlane_require "base64"
22
fastlane_require "fileutils"
33
fastlane_require "json"
44

5-
IOS_APP_VERSION = "2.1.5"
6-
ANDROID_APP_VERSION = "2.1.2" # run `fastlane bootstrap` after editing this
5+
IOS_APP_VERSION = "2.2.0"
6+
ANDROID_APP_VERSION = "2.2.0" # run `fastlane bootstrap` after editing this
77
PROJECT_NAME = "Discourse"
88
IOS_TEAM_ID = "6T3LU73T8S"
99
KEYS_REPOSITORY = "git@github.com:discourse-org/discourse-mobile-keys.git"
@@ -172,8 +172,8 @@ platform :ios do
172172
export_method: "app-store",
173173
export_options: {
174174
provisioningProfiles: {
175-
"org.discourse.DiscourseApp" => "match AppStore org.discourse.DiscourseApp",
176-
"org.discourse.DiscourseApp.ShareExtension" => "match AppStore org.discourse.DiscourseApp.ShareExtension"
175+
"org.discourse.DiscourseApp" => "match AppStore org.discourse.DiscourseApp 1776778136",
176+
"org.discourse.DiscourseApp.ShareExtension" => "match AppStore org.discourse.DiscourseApp.ShareExtension 1776778138"
177177
}
178178
},
179179
clean: true,
@@ -194,8 +194,8 @@ platform :ios do
194194
export_method: "ad-hoc",
195195
export_options: {
196196
provisioningProfiles: {
197-
"org.discourse.DiscourseApp" => "match AdHoc org.discourse.DiscourseApp",
198-
"org.discourse.DiscourseApp.ShareExtension" => "match AdHoc org.discourse.DiscourseApp.ShareExtension"
197+
"org.discourse.DiscourseApp" => "match AdHoc org.discourse.DiscourseApp 1776778144",
198+
"org.discourse.DiscourseApp.ShareExtension" => "match AdHoc org.discourse.DiscourseApp.ShareExtension 1776778146"
199199
}
200200
},
201201
clean: true,

ios/Discourse.xcodeproj/project.pbxproj

Lines changed: 8 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -471,7 +471,7 @@
471471
CODE_SIGN_IDENTITY = "iPhone Developer";
472472
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Distribution";
473473
CODE_SIGN_STYLE = Manual;
474-
CURRENT_PROJECT_VERSION = 660;
474+
CURRENT_PROJECT_VERSION = 671;
475475
DEAD_CODE_STRIPPING = YES;
476476
DEVELOPMENT_TEAM = 6T3LU73T8S;
477477
"DEVELOPMENT_TEAM[sdk=iphoneos*]" = 6T3LU73T8S;
@@ -498,7 +498,7 @@
498498
PRODUCT_BUNDLE_IDENTIFIER = org.discourse.DiscourseApp;
499499
PRODUCT_NAME = Discourse;
500500
PROVISIONING_PROFILE_SPECIFIER = "match AdHoc org.discourse.DiscourseApp";
501-
"PROVISIONING_PROFILE_SPECIFIER[sdk=iphoneos*]" = "match AdHoc org.discourse.DiscourseApp";
501+
"PROVISIONING_PROFILE_SPECIFIER[sdk=iphoneos*]" = "match AdHoc org.discourse.DiscourseApp 1776778144";
502502
SWIFT_OBJC_BRIDGING_HEADER = "Discourse-Bridging-Header.h";
503503
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
504504
SWIFT_VERSION = 5.0;
@@ -516,7 +516,7 @@
516516
CODE_SIGN_ENTITLEMENTS = Discourse/Discourse.entitlements;
517517
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Distribution";
518518
CODE_SIGN_STYLE = Manual;
519-
CURRENT_PROJECT_VERSION = 660;
519+
CURRENT_PROJECT_VERSION = 671;
520520
DEVELOPMENT_TEAM = 6T3LU73T8S;
521521
"DEVELOPMENT_TEAM[sdk=iphoneos*]" = 6T3LU73T8S;
522522
ENABLE_BITCODE = NO;
@@ -543,7 +543,7 @@
543543
PRODUCT_NAME = Discourse;
544544
PROVISIONING_PROFILE = "8a5dde79-abbd-4707-a921-2b4412ef65ad";
545545
PROVISIONING_PROFILE_SPECIFIER = "match AppStore org.discourse.DiscourseApp";
546-
"PROVISIONING_PROFILE_SPECIFIER[sdk=iphoneos*]" = "match AppStore org.discourse.DiscourseApp";
546+
"PROVISIONING_PROFILE_SPECIFIER[sdk=iphoneos*]" = "match AppStore org.discourse.DiscourseApp 1776778136";
547547
SWIFT_OBJC_BRIDGING_HEADER = "Discourse-Bridging-Header.h";
548548
SWIFT_VERSION = 5.0;
549549
TARGETED_DEVICE_FAMILY = "1,2";
@@ -605,10 +605,7 @@
605605
LIBRARY_SEARCH_PATHS = "$(SDKROOT)/usr/lib/swift$(inherited)";
606606
MTL_ENABLE_DEBUG_INFO = YES;
607607
ONLY_ACTIVE_ARCH = YES;
608-
OTHER_LDFLAGS = (
609-
"$(inherited)",
610-
" ",
611-
);
608+
OTHER_LDFLAGS = "$(inherited) ";
612609
REACT_NATIVE_PATH = "${PODS_ROOT}/../../node_modules/react-native";
613610
SDKROOT = iphoneos;
614611
SWIFT_ACTIVE_COMPILATION_CONDITIONS = "$(inherited) DEBUG";
@@ -664,10 +661,7 @@
664661
IPHONEOS_DEPLOYMENT_TARGET = 10.0;
665662
LIBRARY_SEARCH_PATHS = "$(SDKROOT)/usr/lib/swift$(inherited)";
666663
MTL_ENABLE_DEBUG_INFO = NO;
667-
OTHER_LDFLAGS = (
668-
"$(inherited)",
669-
" ",
670-
);
664+
OTHER_LDFLAGS = "$(inherited) ";
671665
REACT_NATIVE_PATH = "${PODS_ROOT}/../../node_modules/react-native";
672666
SDKROOT = iphoneos;
673667
SWIFT_COMPILATION_MODE = wholemodule;
@@ -702,7 +696,7 @@
702696
PRODUCT_BUNDLE_IDENTIFIER = org.discourse.DiscourseApp.ShareExtension;
703697
PRODUCT_NAME = "$(TARGET_NAME)";
704698
PROVISIONING_PROFILE_SPECIFIER = "match AdHoc org.discourse.DiscourseApp.ShareExtension";
705-
"PROVISIONING_PROFILE_SPECIFIER[sdk=iphoneos*]" = "match AdHoc org.discourse.DiscourseApp.ShareExtension";
699+
"PROVISIONING_PROFILE_SPECIFIER[sdk=iphoneos*]" = "match AdHoc org.discourse.DiscourseApp.ShareExtension 1776778146";
706700
SKIP_INSTALL = YES;
707701
SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG;
708702
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
@@ -737,7 +731,7 @@
737731
PRODUCT_BUNDLE_IDENTIFIER = org.discourse.DiscourseApp.ShareExtension;
738732
PRODUCT_NAME = "$(TARGET_NAME)";
739733
PROVISIONING_PROFILE_SPECIFIER = "match AdHoc org.discourse.DiscourseApp.ShareExtension";
740-
"PROVISIONING_PROFILE_SPECIFIER[sdk=iphoneos*]" = "match AppStore org.discourse.DiscourseApp.ShareExtension";
734+
"PROVISIONING_PROFILE_SPECIFIER[sdk=iphoneos*]" = "match AdHoc org.discourse.DiscourseApp.ShareExtension 1776778146";
741735
SKIP_INSTALL = YES;
742736
SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule";
743737
SWIFT_VERSION = 5.0;

ios/Discourse/Info.plist

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
<key>CFBundlePackageType</key>
2020
<string>APPL</string>
2121
<key>CFBundleShortVersionString</key>
22-
<string>2.1.5</string>
22+
<string>2.2.0</string>
2323
<key>CFBundleSignature</key>
2424
<string>????</string>
2525
<key>CFBundleURLTypes</key>
@@ -37,7 +37,7 @@
3737
<dict/>
3838
</array>
3939
<key>CFBundleVersion</key>
40-
<string>660</string>
40+
<string>671</string>
4141
<key>Fabric</key>
4242
<dict>
4343
<key>APIKey</key>

ios/ShareExtension/Info.plist

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,9 @@
1717
<key>CFBundlePackageType</key>
1818
<string>$(PRODUCT_BUNDLE_PACKAGE_TYPE)</string>
1919
<key>CFBundleShortVersionString</key>
20-
<string>2.1.5</string>
20+
<string>2.2.0</string>
2121
<key>CFBundleVersion</key>
22-
<string>660</string>
22+
<string>671</string>
2323
<key>NSExtension</key>
2424
<dict>
2525
<key>NSExtensionAttributes</key>

jest.config.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
module.exports = {
22
preset: 'react-native',
3+
testPathIgnorePatterns: ['/node_modules/', '/e2e/'],
34
};

js/locale/en.json

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,18 @@
9292
"sites": "Sites",
9393
"find_new_communities": "Find new communities to join",
9494
"no_hot_topics": "No hot topics found for this site.",
95+
"discover_communities": "Communities",
96+
"discover_pick_tag": "What are you interested in?",
97+
"discover_pick_tag_description": "See what people have been discussing in Discourse communities recently and join the ones that most match your interests.",
98+
"discover_explore_more": "Explore another topic",
99+
"discover_communities_section": "%{tag} Communities",
100+
"discover_topics_section": "Recent Discussions in %{tag}",
101+
"discover_see_all_communities": "See all communities",
102+
"discover_community_directory": "Community Directory",
103+
"remove_from_home_screen": "Remove",
104+
"preview": "Preview",
105+
"community_recent_topics": "Hot Topics",
95106
"oops": "Oops, something went wrong.",
96-
"still_loading": "Still loading..."
107+
"still_loading": "Still loading...",
108+
"tag_label_programming_language": "programming"
97109
}

0 commit comments

Comments
 (0)