Skip to content

Commit 4bdc95d

Browse files
authored
Merge branch 'trunk' into ksp
2 parents e409bf9 + 4787df0 commit 4bdc95d

File tree

73 files changed

+4669
-487
lines changed

Some content is hidden

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

73 files changed

+4669
-487
lines changed

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ Fixes #
3232

3333
-----
3434

35-
## Testing Checklist:
35+
## Testing Checklist (strike-out the not-applying and unnecessary ones):
3636

3737
- [ ] WordPress.com sites and self-hosted Jetpack sites.
3838
- [ ] Portrait and landscape orientations.

RELEASE-NOTES.txt

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,17 @@
11
*** PLEASE FOLLOW THIS FORMAT: [<priority indicator, more stars = higher priority>] <description> [<PR URL>]
22

3+
24.5
4+
-----
5+
* [*] [internal] Block editor: Remove code associated to Story block [https://github.com/wordpress-mobile/WordPress-Android/pull/20400]
6+
* [*] [Jetpack-only] Fixes broken links on some notifications [https://github.com/wordpress-mobile/WordPress-Android/pull/20417]
7+
* [**] [internal] Block editor: Upgrade React Native to version 0.73.3 [#20167]
8+
39
24.4
410
-----
511
* [***] [Jetpack-only] Improved Notifications experience with richer UI elements and interactions [https://github.com/wordpress-mobile/WordPress-Android/pull/20072]
612
* [**] [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]
713
* [**] [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]
14+
* [***] [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]
1115
* [*] Block editor: Prevent crash when autoscrolling to blocks [https://github.com/WordPress/gutenberg/pull/59110]
1216
* [*] Block editor: Remove opacity change when images are being uploaded [https://github.com/WordPress/gutenberg/pull/59264]
1317
* [*] Block editor: Media & Text blocks correctly show an error message when the attached video upload fails [https://github.com/WordPress/gutenberg/pull/59288]

WordPress/build.gradle

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,9 +141,9 @@ android {
141141
buildConfigField "boolean", "PLANS_IN_SITE_CREATION", "false"
142142
buildConfigField "boolean", "READER_IMPROVEMENTS", "false"
143143
buildConfigField "boolean", "BLOGANUARY_DASHBOARD_NUDGE", "false"
144-
buildConfigField "boolean", "IN_APP_REVIEWS", "false"
145144
buildConfigField "boolean", "DYNAMIC_DASHBOARD_CARDS", "false"
146145
buildConfigField "boolean", "STATS_TRAFFIC_TAB", "false"
146+
buildConfigField "boolean", "READER_DISCOVER_NEW_ENDPOINT", "false"
147147

148148
// Override these constants in jetpack product flavor to enable/ disable features
149149
buildConfigField "boolean", "ENABLE_SITE_CREATION", "true"
@@ -158,6 +158,7 @@ android {
158158
buildConfigField "boolean", "BLAZE_MANAGE_CAMPAIGNS", "false"
159159
buildConfigField "boolean", "DASHBOARD_PERSONALIZATION", "false"
160160
buildConfigField "boolean", "ENABLE_SITE_MONITORING", "false"
161+
buildConfigField "boolean", "SYNC_PUBLISHING", "false"
161162

162163
manifestPlaceholders = [magicLinkScheme:"wordpress"]
163164
}

WordPress/jetpack_metadata/PlayStoreStrings.po

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -10,22 +10,24 @@ msgstr ""
1010
"X-Generator: VsCode\n"
1111
"Project-Id-Version: Jetpack - Apps - Android - Release Notes\n"
1212

13+
msgctxt "release_note_244"
14+
msgid ""
15+
"24.4:\n"
16+
"- Added a new Traffic tab on the Stats screen\n"
17+
"- Upgraded the Notifications design\n"
18+
"- Introduced video block support for VideoPress v5\n"
19+
"- Fixed a crash caused by block editor auto-scrolling\n"
20+
"- Provided an error message for video upload failure\n"
21+
"- Removed image transparency during upload\n"
22+
msgstr ""
23+
1324
msgctxt "release_note_243"
1425
msgid ""
1526
"24.3:\n"
1627
"Log in to your site with Google credentials, physical devices, and third-party passkeys. Don’t worry, the site’s still locked down tighter than the Colonel’s secret recipe.\n"
1728
"We hid the menu icon on Stats screens so it’s only visible from the Insights tab. Ninja mode: activated.\n"
1829
msgstr ""
1930

20-
msgctxt "release_note_242"
21-
msgid ""
22-
"24.2:\n"
23-
"- We added a new look and feel for content navigation and filtering.\n"
24-
"- Images and other media won’t “blink” during upload.\n"
25-
"- The editor won’t crash when you’re working on a large post.\n"
26-
"- We added new Site Monitoring menu items like metrics, PHP logs, and web server logs.\n"
27-
msgstr ""
28-
2931
#. translators: Release notes for this version to be displayed in the Play Store. Limit to 500 characters including spaces and commas!
3032
#. translators: Title to be displayed in the Play Store. Limit to 30 characters including spaces and commas!
3133
msgctxt "play_store_app_title"
Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,6 @@
1-
Log in to your site with Google credentials, physical devices, and third-party passkeys. Don’t worry, the site’s still locked down tighter than the Colonel’s secret recipe.
2-
We hid the menu icon on Stats screens so it’s only visible from the Insights tab. Ninja mode: activated.
1+
- Added a new Traffic tab on the Stats screen
2+
- Upgraded the Notifications design
3+
- Introduced video block support for VideoPress v5
4+
- Fixed a crash caused by block editor auto-scrolling
5+
- Provided an error message for video upload failure
6+
- Removed image transparency during upload

WordPress/metadata/PlayStoreStrings.po

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10,18 +10,20 @@ msgstr ""
1010
"X-Generator: VsCode\n"
1111
"Project-Id-Version: Release Notes & Play Store Descriptions\n"
1212

13-
msgctxt "release_note_243"
13+
msgctxt "release_note_244"
1414
msgid ""
15-
"24.3:\n"
16-
"You can log in to your WordPress website using Google credentials, physical devices, and other third-party passkeys. Don’t worry, your site is still locked down tighter than the Colonel’s secret recipe.\n"
15+
"24.4:\n"
16+
"We made a few changes to the block editor.\n"
17+
"\n"
18+
"- The app won’t crash anymore when the editor auto-scrolls down to a block.\n"
19+
"- You’ll now see an error message when a video fails to upload to media and text blocks.\n"
20+
"- Images no longer appear partly transparent while they’re being uploaded.\n"
1721
msgstr ""
1822

19-
msgctxt "release_note_242"
23+
msgctxt "release_note_243"
2024
msgid ""
21-
"24.2:\n"
22-
"We fixed an issue that made images and other media blink away while being uploaded. Presto, no more disappearing act.\n"
23-
"\n"
24-
"The editor won’t crash anymore when you’re working on large posts. That’s right, we’ve saved your drafts and your sanity.\n"
25+
"24.3:\n"
26+
"You can log in to your WordPress website using Google credentials, physical devices, and other third-party passkeys. Don’t worry, your site is still locked down tighter than the Colonel’s secret recipe.\n"
2527
msgstr ""
2628

2729
#. translators: Release notes for this version to be displayed in the Play Store. Limit to 500 characters including spaces and commas!
Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,5 @@
1-
You can log in to your WordPress website using Google credentials, physical devices, and other third-party passkeys. Don’t worry, your site is still locked down tighter than the Colonel’s secret recipe.
1+
We made a few changes to the block editor.
2+
3+
- The app won’t crash anymore when the editor auto-scrolls down to a block.
4+
- You’ll now see an error message when a video fails to upload to media and text blocks.
5+
- Images no longer appear partly transparent while they’re being uploaded.

WordPress/src/androidTest/java/org/wordpress/android/ui/notifications/NotificationsUtilsTest.java

Lines changed: 0 additions & 25 deletions
This file was deleted.
Lines changed: 118 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,118 @@
1+
package org.wordpress.android.ui.notifications
2+
3+
import android.text.SpannableStringBuilder
4+
import android.text.style.ClickableSpan
5+
import android.widget.TextView
6+
import androidx.test.platform.app.InstrumentationRegistry
7+
import dagger.hilt.android.testing.HiltAndroidTest
8+
import junit.framework.TestCase.assertEquals
9+
import junit.framework.TestCase.assertFalse
10+
import junit.framework.TestCase.assertNotNull
11+
import junit.framework.TestCase.assertTrue
12+
import org.junit.Test
13+
import org.wordpress.android.fluxc.tools.FormattableContent
14+
import org.wordpress.android.fluxc.tools.FormattableRange
15+
import org.wordpress.android.ui.notifications.blocks.NoteBlockClickableSpan
16+
import org.wordpress.android.ui.notifications.utils.NotificationsUtils
17+
18+
@HiltAndroidTest
19+
class NotificationsUtilsTest {
20+
@Test
21+
fun testSpannableHasCharacterAtIndex() {
22+
val spannableStringBuilder = SpannableStringBuilder("This is only a test.")
23+
24+
assertTrue(NotificationsUtils.spannableHasCharacterAtIndex(spannableStringBuilder, 's', 3))
25+
assertFalse(NotificationsUtils.spannableHasCharacterAtIndex(spannableStringBuilder, 's', 4))
26+
27+
// Test with bogus params
28+
assertFalse(NotificationsUtils.spannableHasCharacterAtIndex(null, 'b', -1))
29+
}
30+
31+
@Test
32+
fun testGetSpannableContentForRangesAndSkipInvalidUrls() {
33+
// Create a FormattableContent object
34+
val range1 = FormattableRange(indices = listOf(10, 14), url = "https://example.com", type = "a")
35+
val range2 = FormattableRange(indices = listOf(5, 20), url = "", type = "a") // invalid url to skip
36+
val formattableContent = FormattableContent(
37+
text = "This is a test content with a link",
38+
ranges = listOf(range1, range2)
39+
)
40+
41+
// Create a TextView object
42+
val textView = TextView(InstrumentationRegistry.getInstrumentation().context)
43+
44+
// Call the method with the created objects
45+
val result = NotificationsUtils.getSpannableContentForRanges(formattableContent, textView, false) {}
46+
47+
// Check the result
48+
assertNotNull(result)
49+
assertEquals("This is a test content with a link", result.toString())
50+
51+
// Check if the link is correctly set
52+
val spans = result.getSpans(10, 14, ClickableSpan::class.java)
53+
assertTrue(spans.size == 1)
54+
assertEquals("https://example.com", (spans[0] as NoteBlockClickableSpan).formattableRange.url)
55+
}
56+
57+
@Test
58+
fun testGetSpannableContentForRangesWithNoRanges() {
59+
// Create a FormattableContent object with no ranges
60+
val formattableContent = FormattableContent(text = "This is a test content with no link")
61+
62+
// Create a TextView object
63+
val textView = TextView(InstrumentationRegistry.getInstrumentation().context)
64+
65+
// Call the method with the created objects
66+
val result = NotificationsUtils.getSpannableContentForRanges(formattableContent, textView, false) {}
67+
68+
// Check the result
69+
assertNotNull(result)
70+
assertEquals("This is a test content with no link", result.toString())
71+
72+
// Check if no ClickableSpan is set
73+
val spans = result.getSpans(0, result.length, ClickableSpan::class.java)
74+
assertTrue(spans.isEmpty())
75+
}
76+
77+
@Test
78+
fun testGetSpannableContentForRangesWithInvalidIndex() {
79+
// Create a FormattableContent object with a range with an invalid index
80+
val range = FormattableRange(indices = listOf(50, 54), url = "https://example.com", type = "a")
81+
val formattableContent = FormattableContent(text = "This is a test content", ranges = listOf(range))
82+
83+
// Create a TextView object
84+
val textView = TextView(InstrumentationRegistry.getInstrumentation().context)
85+
86+
// Call the method with the created objects
87+
val result = NotificationsUtils.getSpannableContentForRanges(formattableContent, textView, false) {}
88+
89+
// Check the result
90+
assertNotNull(result)
91+
assertEquals("This is a test content", result.toString())
92+
93+
// Check if no ClickableSpan is set
94+
val spans = result.getSpans(0, result.length, ClickableSpan::class.java)
95+
assertTrue(spans.isEmpty())
96+
}
97+
98+
@Test
99+
fun testGetSpannableContentForRangesWithNullUrl() {
100+
// Create a FormattableContent object with a range with a null URL
101+
val range = FormattableRange(indices = listOf(10, 14), url = null, type = "a")
102+
val formattableContent = FormattableContent(text = "This is a test content with a link", ranges = listOf(range))
103+
104+
// Create a TextView object
105+
val textView = TextView(InstrumentationRegistry.getInstrumentation().context)
106+
107+
// Call the method with the created objects
108+
val result = NotificationsUtils.getSpannableContentForRanges(formattableContent, textView, false) {}
109+
110+
// Check the result
111+
assertNotNull(result)
112+
assertEquals("This is a test content with a link", result.toString())
113+
114+
// Check if no ClickableSpan is set for the range with the null URL
115+
val spans = result.getSpans(10, 14, ClickableSpan::class.java)
116+
assertTrue(spans.isEmpty())
117+
}
118+
}
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
package org.wordpress.android.modules
2+
3+
import dagger.Module
4+
import dagger.Provides
5+
import dagger.hilt.InstallIn
6+
import dagger.hilt.components.SingletonComponent
7+
import org.wordpress.android.ui.posts.IPostFreshnessChecker
8+
import org.wordpress.android.ui.posts.PostFreshnessCheckerImpl
9+
import javax.inject.Singleton
10+
11+
@InstallIn(SingletonComponent::class)
12+
@Module
13+
class PostModule {
14+
@Singleton
15+
@Provides
16+
fun providePostFreshnessChecker(): IPostFreshnessChecker = PostFreshnessCheckerImpl()
17+
}

0 commit comments

Comments
 (0)