Skip to content

Commit e409bf9

Browse files
committed
Merge branch 'trunk' into ksp
2 parents 1d8f53c + 0cecd32 commit e409bf9

File tree

339 files changed

+6377
-9991
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

339 files changed

+6377
-9991
lines changed

RELEASE-NOTES.txt

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,21 @@
22

33
24.4
44
-----
5-
5+
* [***] [Jetpack-only] Improved Notifications experience with richer UI elements and interactions [https://github.com/wordpress-mobile/WordPress-Android/pull/20072]
6+
* [**] [Jetpack-only] Block editor: Introduce VideoPress v5 support, to fix issues using video block with dotcom and Jetpack sites [https://github.com/wordpress-mobile/gutenberg-mobile/pull/6634]
7+
* [**] [internal] Removed the Stories from the codebase [https://github.com/wordpress-mobile/WordPress-Android/pull/20016]
8+
[***] [Jetpack-only] Stats: Introducing Traffic tab, delivering improved graphs, and combining Days/Weeks/Months/Years tabs into one, behind a feature flag. [https://github.com/wordpress-mobile/WordPress-Android/pull/19942]
9+
[***] [Jetpack-only] Improved Notifications experience with richer UI elements and interactions [https://github.com/wordpress-mobile/WordPress-Android/pull/20072]
10+
* [**] [Jetpack-only] Block editor: Introduce VideoPress v5 support, to fix issues using video block with dotcom and Jetpack sites [https://github.com/wordpress-mobile/gutenberg-mobile/pull/6634]
11+
* [*] Block editor: Prevent crash when autoscrolling to blocks [https://github.com/WordPress/gutenberg/pull/59110]
12+
* [*] Block editor: Remove opacity change when images are being uploaded [https://github.com/WordPress/gutenberg/pull/59264]
13+
* [*] Block editor: Media & Text blocks correctly show an error message when the attached video upload fails [https://github.com/WordPress/gutenberg/pull/59288]
614

715
24.3
816
-----
917
* [**] Added support to use third-party passkey providers and other devices passkeys as a WordPress.com login option [https://github.com/wordpress-mobile/WordPress-Android/pull/20174]
1018
* [*] [Jetpack-only] Fix the visibility issue with the menu button on the stats [https://github.com/wordpress-mobile/WordPress-Android/pull/20175]
19+
* [*] [internal][WordPress-only] Updates Jetpack banners and badges copy for consistency [https://github.com/wordpress-mobile/WordPress-Android/pull/20123]
1120

1221
24.2
1322
-----

WordPress/build.gradle

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,6 @@ repositories {
3838
includeGroup "org.wordpress.gutenberg-mobile"
3939
includeGroupByRegex "org.wordpress.react-native-libraries.*"
4040
includeGroup "com.automattic"
41-
includeGroup "com.automattic.stories"
4241
includeGroup "com.automattic.tracks"
4342
}
4443
}
@@ -371,11 +370,6 @@ dependencies {
371370
exclude group: 'org.wordpress', module: 'utils'
372371
}
373372
implementation "$gradle.ext.aboutAutomatticBinaryPath:$automatticAboutVersion"
374-
implementation ("$gradle.ext.storiesAndroidPath:$automatticStoriesVersion") {
375-
exclude group: 'androidx.navigation', module: 'navigation-fragment-ktx'
376-
exclude group: 'androidx.navigation', module: 'navigation-ui-ktx'
377-
}
378-
implementation "$gradle.ext.storiesAndroidMp4ComposePath:$automatticStoriesVersion"
379373

380374
implementation("$gradle.ext.tracksBinaryPath") {
381375
version {
@@ -466,8 +460,6 @@ dependencies {
466460
implementation "com.google.dagger:hilt-android:$gradle.ext.daggerVersion"
467461
ksp "com.google.dagger:hilt-compiler:$gradle.ext.daggerVersion"
468462

469-
testImplementation "$gradle.ext.storiesAndroidPhotoEditorPath:$automatticStoriesVersion"
470-
471463
testImplementation("androidx.arch.core:core-testing:$androidxArchCoreVersion", {
472464
exclude group: 'com.android.support', module: 'support-compat'
473465
exclude group: 'com.android.support', module: 'support-annotations'

WordPress/src/androidTest/java/org/wordpress/android/e2e/StatsTests.kt

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ import dagger.hilt.android.testing.HiltAndroidTest
66
import org.junit.After
77
import org.junit.Assume.assumeTrue
88
import org.junit.Before
9-
import org.junit.Ignore
109
import org.junit.Test
1110
import org.wordpress.android.BuildConfig
1211
import org.wordpress.android.R
@@ -22,9 +21,7 @@ import org.wordpress.android.util.StatsVisitsData
2221
class StatsTests : BaseTest() {
2322
@Before
2423
fun setUp() {
25-
// We're not running Stats tests for JP.
26-
// See https://github.com/wordpress-mobile/WordPress-Android/issues/18065
27-
assumeTrue(!BuildConfig.IS_JETPACK_APP)
24+
assumeTrue(BuildConfig.IS_JETPACK_APP)
2825
ComposeEspressoLink().unregister()
2926
logoutIfNecessary()
3027
wpLogin()
@@ -38,8 +35,7 @@ class StatsTests : BaseTest() {
3835
Espresso.pressBack()
3936
}
4037
}
41-
42-
@Ignore("Will be taken care of in a future PR - scrollToPosts is not working")
38+
4339
@Test
4440
fun e2eAllDayStatsLoad() {
4541
val todayVisits = StatsVisitsData("97", "28", "14", "11")

WordPress/src/androidTest/java/org/wordpress/android/e2e/pages/MySitesPage.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ class MySitesPage {
149149
val statsButton = Espresso.onView(
150150
Matchers.allOf(
151151
ViewMatchers.withText(R.string.stats),
152-
ViewMatchers.withId(R.id.my_site_item_primary_text)
152+
ViewMatchers.withId(R.id.quick_link_item)
153153
)
154154
)
155155
WPSupportUtils.clickOn(statsButton)
@@ -158,7 +158,7 @@ class MySitesPage {
158158
WPSupportUtils.waitForElementToBeDisplayedWithoutFailure(R.id.tabLayout)
159159

160160
// Wait for the stats to load
161-
WPSupportUtils.idleFor(8000)
161+
WPSupportUtils.idleFor(4000)
162162
return StatsPage()
163163
}
164164

WordPress/src/androidTest/java/org/wordpress/android/e2e/pages/StatsPage.kt

Lines changed: 19 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,15 @@
11
package org.wordpress.android.e2e.pages
22

3+
import androidx.recyclerview.widget.RecyclerView.ViewHolder
34
import androidx.test.espresso.Espresso
45
import androidx.test.espresso.action.ViewActions
56
import androidx.test.espresso.assertion.ViewAssertions
7+
import androidx.test.espresso.contrib.RecyclerViewActions
68
import androidx.test.espresso.matcher.ViewMatchers
79
import org.hamcrest.Matchers
810
import org.wordpress.android.R
911
import org.wordpress.android.support.WPSupportUtils
12+
import org.wordpress.android.ui.stats.refresh.lists.StatsListViewModel
1013
import org.wordpress.android.util.StatsKeyValueData
1114
import org.wordpress.android.util.StatsVisitsData
1215

@@ -31,37 +34,37 @@ class StatsPage {
3134
}
3235

3336
fun scrollToPosts(): StatsPage {
34-
scrollToCard("Posts and Pages")
37+
scrollToCard(1, StatsListViewModel.StatsSection.DAYS)
3538
return this
3639
}
3740

3841
fun scrollToReferrers(): StatsPage {
39-
scrollToCard("Referrers")
42+
scrollToCard(2, StatsListViewModel.StatsSection.DAYS)
4043
return this
4144
}
4245

4346
fun scrollToClicks(): StatsPage {
44-
scrollToCard("Clicks")
47+
scrollToCard(3, StatsListViewModel.StatsSection.DAYS)
4548
return this
4649
}
4750

4851
fun scrollToAuthors(): StatsPage {
49-
scrollToCard("Authors")
52+
scrollToCard(4, StatsListViewModel.StatsSection.DAYS)
5053
return this
5154
}
5255

5356
fun scrollToCountries(): StatsPage {
54-
scrollToCard("Countries")
57+
scrollToCard(5, StatsListViewModel.StatsSection.DAYS)
5558
return this
5659
}
5760

5861
fun scrollToVideos(): StatsPage {
59-
scrollToCard("Videos")
62+
scrollToCard(7, StatsListViewModel.StatsSection.DAYS)
6063
return this
6164
}
6265

6366
fun scrollToFileDownloads(): StatsPage {
64-
scrollToCard("File downloads")
67+
scrollToCard(8, StatsListViewModel.StatsSection.DAYS)
6568
return this
6669
}
6770

@@ -96,7 +99,7 @@ class StatsPage {
9699
)
97100
)
98101
)
99-
cardStructure.check(ViewAssertions.matches(ViewMatchers.isCompletelyDisplayed()))
102+
cardStructure.check(ViewAssertions.matches(ViewMatchers.isDisplayed()))
100103
return this
101104
}
102105

@@ -121,7 +124,7 @@ class StatsPage {
121124
)
122125
)
123126
)
124-
cardStructure.check(ViewAssertions.matches(ViewMatchers.isCompletelyDisplayed()))
127+
cardStructure.check(ViewAssertions.matches(ViewMatchers.isDisplayed()))
125128
}
126129
}
127130

@@ -160,15 +163,14 @@ class StatsPage {
160163
return this
161164
}
162165

163-
private fun scrollToCard(cardHeader: String) {
164-
val card = Espresso.onView(
165-
Matchers.allOf(
166-
ViewMatchers.isDescendantOfA(visibleCoordinatorLayout),
167-
ViewMatchers.withId(R.id.stats_block_list),
168-
ViewMatchers.hasDescendant(ViewMatchers.withText(cardHeader))
169-
)
166+
private fun scrollToCard(viewholderPosition: Int, section: StatsListViewModel.StatsSection) {
167+
WPSupportUtils.idleFor(2000)
168+
Espresso.onView(Matchers.allOf(
169+
ViewMatchers.withTagValue(Matchers.`is`(section.name))
170+
)).perform(
171+
RecyclerViewActions.scrollToPosition<ViewHolder>(viewholderPosition)
170172
)
171-
WPSupportUtils.scrollIntoView(R.id.statsPager, card, 0.5.toFloat())
173+
WPSupportUtils.idleFor(2000)
172174
}
173175

174176
companion object {

WordPress/src/jetpack/res/drawable/bg_note_avatar_badge.xml

Lines changed: 0 additions & 6 deletions
This file was deleted.

WordPress/src/main/AndroidManifest.xml

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -250,14 +250,6 @@
250250
android:value=".ui.posts.PostsListActivity" />
251251
</activity>
252252

253-
<!-- Story composer activity -->
254-
<activity
255-
android:name=".ui.stories.StoryComposerActivity"
256-
android:label="@string/app_name"
257-
android:screenOrientation="portrait"
258-
android:theme="@style/WordPress.Stories.Immersive">
259-
</activity>
260-
261253
<activity
262254
android:name=".ui.posts.PostsListActivity"
263255
android:launchMode="singleTop"

WordPress/src/main/java/org/wordpress/android/AppInitializer.kt

Lines changed: 0 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -39,12 +39,6 @@ import com.google.android.gms.auth.api.Auth
3939
import com.google.android.gms.common.api.GoogleApiClient
4040
import com.google.firebase.iid.FirebaseInstanceId
4141
import com.wordpress.rest.RestClient
42-
import com.wordpress.stories.compose.NotificationTrackerProvider
43-
import com.wordpress.stories.compose.frame.StoryNotificationType
44-
import com.wordpress.stories.compose.frame.StoryNotificationType.STORY_FRAME_SAVE_ERROR
45-
import com.wordpress.stories.compose.frame.StoryNotificationType.STORY_FRAME_SAVE_SUCCESS
46-
import com.wordpress.stories.compose.frame.StoryNotificationType.STORY_SAVE_ERROR
47-
import com.wordpress.stories.compose.frame.StoryNotificationType.STORY_SAVE_SUCCESS
4842
import kotlinx.coroutines.CoroutineScope
4943
import org.greenrobot.eventbus.EventBus
5044
import org.greenrobot.eventbus.Subscribe
@@ -76,7 +70,6 @@ import org.wordpress.android.networking.ConnectionChangeReceiver
7670
import org.wordpress.android.networking.OAuthAuthenticator
7771
import org.wordpress.android.networking.RestClientUtils
7872
import org.wordpress.android.push.GCMRegistrationScheduler
79-
import org.wordpress.android.push.NotificationType
8073
import org.wordpress.android.support.ZendeskHelper
8174
import org.wordpress.android.ui.ActivityId
8275
import org.wordpress.android.ui.debug.cookies.DebugCookieManager
@@ -93,7 +86,6 @@ import org.wordpress.android.ui.posts.editor.ImageEditorTracker
9386
import org.wordpress.android.ui.prefs.AppPrefs
9487
import org.wordpress.android.ui.reader.tracker.ReaderTracker
9588
import org.wordpress.android.ui.stats.refresh.lists.widget.WidgetUpdater.StatsWidgetUpdaters
96-
import org.wordpress.android.ui.stories.media.StoryMediaSaveUploadBridge
9789
import org.wordpress.android.ui.uploads.UploadService
9890
import org.wordpress.android.ui.uploads.UploadStarter
9991
import org.wordpress.android.util.AppLog
@@ -171,9 +163,6 @@ class AppInitializer @Inject constructor(
171163
@Inject
172164
lateinit var imageEditorTracker: ImageEditorTracker
173165

174-
@Inject
175-
lateinit var storyMediaSaveUploadBridge: StoryMediaSaveUploadBridge
176-
177166
@Inject
178167
lateinit var crashLogging: CrashLogging
179168

@@ -233,8 +222,6 @@ class AppInitializer @Inject constructor(
233222
lateinit var jetpackFeatureRemovalPhaseHelper: JetpackFeatureRemovalPhaseHelper
234223

235224
private lateinit var applicationLifecycleMonitor: ApplicationLifecycleMonitor
236-
lateinit var storyNotificationTrackerProvider: StoryNotificationTrackerProvider
237-
private set
238225

239226
@Suppress("DEPRECATION")
240227
private lateinit var credentialsClient: GoogleApiClient
@@ -368,10 +355,6 @@ class AppInitializer @Inject constructor(
368355
systemNotificationsTracker.checkSystemNotificationsState()
369356
ImageEditorInitializer.init(imageManager, imageEditorTracker, imageEditorFileUtils, appScope)
370357

371-
storyNotificationTrackerProvider = StoryNotificationTrackerProvider()
372-
storyMediaSaveUploadBridge.init(application)
373-
ProcessLifecycleOwner.get().lifecycle.addObserver(storyMediaSaveUploadBridge)
374-
375358
exPlat.forceRefresh()
376359

377360
debugCookieManager.sync()
@@ -969,29 +952,6 @@ class AppInitializer @Inject constructor(
969952
}
970953
}
971954

972-
inner class StoryNotificationTrackerProvider : NotificationTrackerProvider {
973-
private fun translateNotificationTypes(storyNotificationType: StoryNotificationType): NotificationType {
974-
return when (storyNotificationType) {
975-
STORY_SAVE_SUCCESS -> NotificationType.STORY_SAVE_SUCCESS
976-
STORY_SAVE_ERROR -> NotificationType.STORY_SAVE_ERROR
977-
STORY_FRAME_SAVE_SUCCESS -> NotificationType.STORY_FRAME_SAVE_SUCCESS
978-
STORY_FRAME_SAVE_ERROR -> NotificationType.STORY_FRAME_SAVE_ERROR
979-
}
980-
}
981-
982-
override fun trackShownNotification(storyNotificationType: StoryNotificationType) {
983-
systemNotificationsTracker.trackShownNotification(translateNotificationTypes(storyNotificationType))
984-
}
985-
986-
override fun trackTappedNotification(storyNotificationType: StoryNotificationType) {
987-
systemNotificationsTracker.trackTappedNotification(translateNotificationTypes(storyNotificationType))
988-
}
989-
990-
override fun trackDismissedNotification(storyNotificationType: StoryNotificationType) {
991-
systemNotificationsTracker.trackDismissedNotification(translateNotificationTypes(storyNotificationType))
992-
}
993-
}
994-
995955
private fun updateNotificationSettings() {
996956
if (!jetpackFeatureRemovalPhaseHelper.shouldShowNotifications()) {
997957
NotificationsUtils.cancelAllNotifications(application)

WordPress/src/main/java/org/wordpress/android/WordPress.kt

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ import android.app.Application
44
import android.content.Context
55
import com.android.volley.RequestQueue
66
import dagger.hilt.EntryPoints
7-
import org.wordpress.android.AppInitializer.StoryNotificationTrackerProvider
87
import org.wordpress.android.fluxc.tools.FluxCImageLoader
98
import org.wordpress.android.modules.AppComponent
109

@@ -13,9 +12,6 @@ import org.wordpress.android.modules.AppComponent
1312
* application. Containing public static variables and methods to be accessed by other classes.
1413
*/
1514
abstract class WordPress : Application() {
16-
val storyNotificationTrackerProvider: StoryNotificationTrackerProvider
17-
get() = initializer().storyNotificationTrackerProvider
18-
1915
abstract fun initializer(): AppInitializer
2016

2117
fun component(): AppComponent = EntryPoints.get(this, AppComponent::class.java)

WordPress/src/main/java/org/wordpress/android/datasets/NotificationsTable.java

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
import android.database.sqlite.SQLiteDatabase;
77
import android.text.TextUtils;
88

9+
import androidx.annotation.NonNull;
910
import androidx.annotation.Nullable;
1011

1112
import org.json.JSONException;
@@ -77,10 +78,10 @@ public static ArrayList<Note> getLatestNotes(int limit) {
7778
}
7879

7980
private static boolean putNote(Note note, boolean checkBeforeInsert) {
80-
String rawNote = prepareNote(note.getId(), note.getJSON().toString());
81+
String rawNote = prepareNote(note.getId(), note.getJson().toString());
8182

8283
ContentValues values = new ContentValues();
83-
values.put("type", note.getType());
84+
values.put("type", note.getRawType());
8485
values.put("timestamp", note.getTimestamp());
8586
values.put("raw_note_data", rawNote);
8687

@@ -124,7 +125,7 @@ private static String prepareNote(String noteId, String noteSrc) {
124125
return noteSrc;
125126
}
126127

127-
public static void saveNotes(List<Note> notes, boolean clearBeforeSaving) {
128+
public static void saveNotes(@NonNull List<Note> notes, boolean clearBeforeSaving) {
128129
getDb().beginTransaction();
129130
try {
130131
if (clearBeforeSaving) {
@@ -142,7 +143,7 @@ public static void saveNotes(List<Note> notes, boolean clearBeforeSaving) {
142143
}
143144
}
144145

145-
public static boolean saveNote(Note note) {
146+
public static boolean saveNote(@NonNull Note note) {
146147
getDb().beginTransaction();
147148
boolean saved = false;
148149
try {

0 commit comments

Comments
 (0)