Skip to content

Commit

Permalink
Merge branch 'trunk' into issue/stories-removal
Browse files Browse the repository at this point in the history
# Conflicts:
#	WordPress/src/main/java/org/wordpress/android/ui/prefs/AppPrefs.java
#	WordPress/src/main/java/org/wordpress/android/ui/prefs/AppPrefsWrapper.kt
#	WordPress/src/main/res/values-gl/strings.xml
  • Loading branch information
Jarvis Lin committed Mar 4, 2024
2 parents 681e81f + 50f27a4 commit 67b741a
Show file tree
Hide file tree
Showing 141 changed files with 2,555 additions and 1,697 deletions.
7 changes: 7 additions & 0 deletions RELEASE-NOTES.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,18 @@
* [***] [Jetpack-only] Improved Notifications experience with richer UI elements and interactions [https://github.com/wordpress-mobile/WordPress-Android/pull/20072]
* [**] [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]
* [**] [internal] Removed the Stories from the codebase [https://github.com/wordpress-mobile/WordPress-Android/pull/20016]
[***] [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]
[***] [Jetpack-only] Improved Notifications experience with richer UI elements and interactions [https://github.com/wordpress-mobile/WordPress-Android/pull/20072]
* [**] [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]
* [*] Block editor: Prevent crash when autoscrolling to blocks [https://github.com/WordPress/gutenberg/pull/59110]
* [*] Block editor: Remove opacity change when images are being uploaded [https://github.com/WordPress/gutenberg/pull/59264]
* [*] Block editor: Media & Text blocks correctly show an error message when the attached video upload fails [https://github.com/WordPress/gutenberg/pull/59288]

24.3
-----
* [**] 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]
* [*] [Jetpack-only] Fix the visibility issue with the menu button on the stats [https://github.com/wordpress-mobile/WordPress-Android/pull/20175]
* [*] [internal][WordPress-only] Updates Jetpack banners and badges copy for consistency [https://github.com/wordpress-mobile/WordPress-Android/pull/20123]

24.2
-----
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import dagger.hilt.android.testing.HiltAndroidTest
import org.junit.After
import org.junit.Assume.assumeTrue
import org.junit.Before
import org.junit.Ignore
import org.junit.Test
import org.wordpress.android.BuildConfig
import org.wordpress.android.R
Expand All @@ -22,9 +21,7 @@ import org.wordpress.android.util.StatsVisitsData
class StatsTests : BaseTest() {
@Before
fun setUp() {
// We're not running Stats tests for JP.
// See https://github.com/wordpress-mobile/WordPress-Android/issues/18065
assumeTrue(!BuildConfig.IS_JETPACK_APP)
assumeTrue(BuildConfig.IS_JETPACK_APP)
ComposeEspressoLink().unregister()
logoutIfNecessary()
wpLogin()
Expand All @@ -38,8 +35,7 @@ class StatsTests : BaseTest() {
Espresso.pressBack()
}
}

@Ignore("Will be taken care of in a future PR - scrollToPosts is not working")

@Test
fun e2eAllDayStatsLoad() {
val todayVisits = StatsVisitsData("97", "28", "14", "11")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ class MySitesPage {
val statsButton = Espresso.onView(
Matchers.allOf(
ViewMatchers.withText(R.string.stats),
ViewMatchers.withId(R.id.my_site_item_primary_text)
ViewMatchers.withId(R.id.quick_link_item)
)
)
WPSupportUtils.clickOn(statsButton)
Expand All @@ -158,7 +158,7 @@ class MySitesPage {
WPSupportUtils.waitForElementToBeDisplayedWithoutFailure(R.id.tabLayout)

// Wait for the stats to load
WPSupportUtils.idleFor(8000)
WPSupportUtils.idleFor(4000)
return StatsPage()
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,15 @@
package org.wordpress.android.e2e.pages

import androidx.recyclerview.widget.RecyclerView.ViewHolder
import androidx.test.espresso.Espresso
import androidx.test.espresso.action.ViewActions
import androidx.test.espresso.assertion.ViewAssertions
import androidx.test.espresso.contrib.RecyclerViewActions
import androidx.test.espresso.matcher.ViewMatchers
import org.hamcrest.Matchers
import org.wordpress.android.R
import org.wordpress.android.support.WPSupportUtils
import org.wordpress.android.ui.stats.refresh.lists.StatsListViewModel
import org.wordpress.android.util.StatsKeyValueData
import org.wordpress.android.util.StatsVisitsData

Expand All @@ -31,37 +34,37 @@ class StatsPage {
}

fun scrollToPosts(): StatsPage {
scrollToCard("Posts and Pages")
scrollToCard(1, StatsListViewModel.StatsSection.DAYS)
return this
}

fun scrollToReferrers(): StatsPage {
scrollToCard("Referrers")
scrollToCard(2, StatsListViewModel.StatsSection.DAYS)
return this
}

fun scrollToClicks(): StatsPage {
scrollToCard("Clicks")
scrollToCard(3, StatsListViewModel.StatsSection.DAYS)
return this
}

fun scrollToAuthors(): StatsPage {
scrollToCard("Authors")
scrollToCard(4, StatsListViewModel.StatsSection.DAYS)
return this
}

fun scrollToCountries(): StatsPage {
scrollToCard("Countries")
scrollToCard(5, StatsListViewModel.StatsSection.DAYS)
return this
}

fun scrollToVideos(): StatsPage {
scrollToCard("Videos")
scrollToCard(7, StatsListViewModel.StatsSection.DAYS)
return this
}

fun scrollToFileDownloads(): StatsPage {
scrollToCard("File downloads")
scrollToCard(8, StatsListViewModel.StatsSection.DAYS)
return this
}

Expand Down Expand Up @@ -96,7 +99,7 @@ class StatsPage {
)
)
)
cardStructure.check(ViewAssertions.matches(ViewMatchers.isCompletelyDisplayed()))
cardStructure.check(ViewAssertions.matches(ViewMatchers.isDisplayed()))
return this
}

Expand All @@ -121,7 +124,7 @@ class StatsPage {
)
)
)
cardStructure.check(ViewAssertions.matches(ViewMatchers.isCompletelyDisplayed()))
cardStructure.check(ViewAssertions.matches(ViewMatchers.isDisplayed()))
}
}

Expand Down Expand Up @@ -160,15 +163,14 @@ class StatsPage {
return this
}

private fun scrollToCard(cardHeader: String) {
val card = Espresso.onView(
Matchers.allOf(
ViewMatchers.isDescendantOfA(visibleCoordinatorLayout),
ViewMatchers.withId(R.id.stats_block_list),
ViewMatchers.hasDescendant(ViewMatchers.withText(cardHeader))
)
private fun scrollToCard(viewholderPosition: Int, section: StatsListViewModel.StatsSection) {
WPSupportUtils.idleFor(2000)
Espresso.onView(Matchers.allOf(
ViewMatchers.withTagValue(Matchers.`is`(section.name))
)).perform(
RecyclerViewActions.scrollToPosition<ViewHolder>(viewholderPosition)
)
WPSupportUtils.scrollIntoView(R.id.statsPager, card, 0.5.toFloat())
WPSupportUtils.idleFor(2000)
}

companion object {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,7 @@ public static void setConnectionsForSite(long siteId, PublicizeConnectionList co
db.delete(CONNECTIONS_TABLE, "site_id=?", new String[]{Long.toString(siteId)});

stmt = db.compileStatement(
"INSERT INTO " + CONNECTIONS_TABLE
"INSERT OR REPLACE INTO " + CONNECTIONS_TABLE
+ " (id," // 1
+ " site_id," // 2
+ " user_id," // 3
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,118 @@
package org.wordpress.android.designsystem

import android.content.res.Configuration
import androidx.compose.foundation.background
import androidx.compose.foundation.layout.Arrangement
import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.Row
import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.layout.size
import androidx.compose.foundation.lazy.LazyColumn
import androidx.compose.foundation.shape.RoundedCornerShape
import androidx.compose.material3.Divider
import androidx.compose.material3.MaterialTheme
import androidx.compose.material3.Text
import androidx.compose.runtime.Composable
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.draw.clip
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.res.dimensionResource
import androidx.compose.ui.tooling.preview.Preview
import androidx.compose.ui.unit.dp
import org.wordpress.android.R

@Composable
fun DesignSystemColorsScreen(
modifier: Modifier = Modifier
) {
LazyColumn(
modifier = modifier,
horizontalAlignment = Alignment.Start,
verticalArrangement = Arrangement.spacedBy(
dimensionResource(id = R.dimen.reader_follow_sheet_button_margin_top)
)
) {
item {
ColorTitle("Foreground")
val listForeground: List<ColorOption> = listOf(
ColorOption("Primary", MaterialTheme.colorScheme.primary),
ColorOption("Secondary", MaterialTheme.colorScheme.secondary),
ColorOption("Tertiary", MaterialTheme.colorScheme.tertiary),
ColorOption("Brand", MaterialTheme.colorScheme.brand),
ColorOption("Error", MaterialTheme.colorScheme.error),
ColorOption("Warning", MaterialTheme.colorScheme.warning),
ColorOption("WP", MaterialTheme.colorScheme.wp),
)
ColorCardList(listForeground)

ColorTitle("Background")
val listBackground: List<ColorOption> = listOf(
ColorOption("Primary", MaterialTheme.colorScheme.primaryContainer),
ColorOption("Secondary", MaterialTheme.colorScheme.secondaryContainer),
ColorOption("Tertiary", MaterialTheme.colorScheme.tertiaryContainer),
ColorOption("Quaternary", MaterialTheme.colorScheme.quaternaryContainer),
ColorOption("Brand", MaterialTheme.colorScheme.brandContainer),
ColorOption("WP", MaterialTheme.colorScheme.wpContainer),
)
ColorCardList(listBackground)
}
}
}
@OptIn(ExperimentalStdlibApi::class)
@Composable
fun ColorCard (colorName: String, color: Color) {
Row (modifier = Modifier.padding(10.dp, 3.dp).fillMaxWidth()) {
Column {
Box(
modifier = Modifier
.size(45.dp)
.clip(shape = RoundedCornerShape(5.dp, 5.dp, 5.dp, 5.dp))
.background(color)
)
}
Column {
Text(
modifier = Modifier.padding(start = 25.dp, end = 40.dp),
text = colorName,
color = MaterialTheme.colorScheme.primary,
)
Text(
modifier = Modifier.padding(start = 25.dp, end = 40.dp),
text = "#" + color.value.toHexString().uppercase().substring(0,8),
color = MaterialTheme.colorScheme.secondary
)
}
}
Divider(modifier = Modifier.padding(start = 10.dp, end = 10.dp))
}
@Composable
fun ColorCardList(colorOptions: List<ColorOption>) {
colorOptions.forEach { colorOption ->
ColorCard(colorOption.title, colorOption.color)
}
}
class ColorOption(var title: String, var color: Color)
@Composable
fun ColorTitle(title: String) {
Text(
modifier = Modifier.padding(start = 10.dp, top = 10.dp, bottom = 10.dp),
text = title,
style = MaterialTheme.typography.titleMedium.copy(color = MaterialTheme.colorScheme.primary),
)
}
@Preview(name = "Light Mode")
@Preview(
uiMode = Configuration.UI_MODE_NIGHT_YES,
showBackground = true,
name = "Dark Mode"
)
@Composable
fun DesignSystemColorsScreenPreview() {
DesignSystemTheme {
DesignSystemColorsScreen()
}
}

Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package org.wordpress.android.designsystem

import android.content.res.Configuration
import androidx.compose.foundation.layout.Arrangement
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.foundation.layout.padding
Expand Down Expand Up @@ -33,13 +34,20 @@ fun DesignSystemComponentsScreen(
}
}

@Preview
@Preview(name = "Light Mode")
@Preview(
uiMode = Configuration.UI_MODE_NIGHT_YES,
showBackground = true,
name = "Dark Mode"
)
@Composable
fun StartDesignSystemComponentsScreenPreview(){
DesignSystemComponentsScreen(
modifier = Modifier
.fillMaxSize()
.padding(dimensionResource(R.dimen.button_container_shadow_height))
)
DesignSystemTheme {
DesignSystemComponentsScreen(
modifier = Modifier
.fillMaxSize()
.padding(dimensionResource(R.dimen.button_container_shadow_height))
)
}
}

Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,7 @@ object DesignSystemDataSource {
Pair(R.string.design_system_components, DesignSystemScreen.Components.name),
)
val foundationScreenButtonOptions = listOf(
R.string.design_system_foundation_colors,
R.string.design_system_foundation_fonts,
R.string.design_system_foundation_lengths
Pair(R.string.design_system_foundation_colors, DesignSystemScreen.Colors.name)
)
val componentsScreenButtonOptions = listOf(
R.string.design_system_components_dsbutton
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import org.wordpress.android.R

@Composable
fun DesignSystemFoundationScreen(
onButtonClicked: (String) -> Unit,
modifier: Modifier = Modifier
) {
LazyColumn (
Expand All @@ -25,8 +26,8 @@ fun DesignSystemFoundationScreen(
item {
DesignSystemDataSource.foundationScreenButtonOptions.forEach { item ->
SelectOptionButton(
labelResourceId = item,
onClick = {}
labelResourceId = item.first,
onClick = { onButtonClicked(item.second) }
)
}
}
Expand All @@ -36,10 +37,13 @@ fun DesignSystemFoundationScreen(
@Preview
@Composable
fun StartDesignSystemFoundationScreenPreview(){
DesignSystemFoundationScreen(
modifier = Modifier
.fillMaxSize()
.padding(dimensionResource(R.dimen.button_container_shadow_height))
)
DesignSystemTheme {
DesignSystemFoundationScreen(
onButtonClicked = {},
modifier = Modifier
.fillMaxSize()
.padding(dimensionResource(R.dimen.button_container_shadow_height))
)
}
}

Loading

0 comments on commit 67b741a

Please sign in to comment.