Skip to content

Commit

Permalink
Merge branch 'trunk' into move-site-menu-items-to-viewmodel-slice
Browse files Browse the repository at this point in the history
  • Loading branch information
AjeshRPai committed Feb 13, 2024
2 parents 31d68d7 + 2271079 commit 6229933
Show file tree
Hide file tree
Showing 106 changed files with 3,799 additions and 5,011 deletions.
3 changes: 2 additions & 1 deletion .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,9 @@ Fixes #

-----

## UI Changes Testing Checklist:
## Testing Checklist:

- [ ] WordPress.com sites and self-hosted Jetpack sites.
- [ ] Portrait and landscape orientations.
- [ ] Light and dark modes.
- [ ] Fonts: Larger, smaller and bold text.
Expand Down
18 changes: 18 additions & 0 deletions .github/workflows/validate-issues.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: 📝 Validate Issues

on:
issues:
types: [opened, labeled, unlabeled]

jobs:
check-labels-on-issues:
uses: Automattic/dangermattic/.github/workflows/[email protected]
with:
label-format-list: '[
"^\[.+\]",
"^[[:alnum:]]"
]'
label-error-message: '🚫 Please add a type label (e.g. **[Type] Enhancement**) and a feature label (e.g. **Stats**) to this issue.'
label-success-message: 'Thanks for reporting! 👍'
secrets:
github-token: ${{ secrets.DANGERMATTIC_GITHUB_TOKEN }}
6 changes: 6 additions & 0 deletions RELEASE-NOTES.txt
Original file line number Diff line number Diff line change
@@ -1,11 +1,17 @@
*** PLEASE FOLLOW THIS FORMAT: [<priority indicator, more stars = higher priority>] <description> [<PR URL>]

24.3
-----
* [*] [Jetpack-only] Fix the visibility issue with the menu button on the stats [https://github.com/wordpress-mobile/WordPress-Android/pull/20175]

24.2
-----
* [**] Fix editor crash occurring on large posts [https://github.com/wordpress-mobile/WordPress-Android/pull/20046]
* [*] [Jetpack-only] Site Monitoring: Add Metrics, PHP Logs, and Web Server Logs under Site Monitoring [https://github.com/wordpress-mobile/WordPress-Android/issues/20067]
* [**] Prevent images from temporarily disappearing when uploading media [https://github.com/WordPress/gutenberg/pull/57869]
* [***] [Jetpack-only] Reader: introduced new UI/UX for content navigation and filtering [https://github.com/wordpress-mobile/WordPress-Android/pull/19978]
* [**] Prevents crashes when the webview state is too big [https://github.com/wordpress-mobile/WordPress-Android/pull/20139]
* [*] [WordPress-only] Prevents a crash occurring when uploading videos under certain conditions [https://github.com/wordpress-mobile/WordPress-Android/pull/20168]

24.1
-----
Expand Down
2 changes: 1 addition & 1 deletion WordPress/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -342,7 +342,7 @@ kapt {
}

dependencies {
implementation 'androidx.webkit:webkit:1.7.0'
implementation 'androidx.webkit:webkit:1.10.0'
implementation "androidx.navigation:navigation-compose:$androidxComposeNavigationVersion"
compileOnly project(path: ':libs:annotations')
kapt project(':libs:processors')
Expand Down
10 changes: 4 additions & 6 deletions WordPress/jetpack_metadata/release_notes.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
- Get notified when you’re working offline.
- Image block uploads pause/resume with internet connection.
- See custom gradient selections in the editor.
- Fixed forward/back arrows for right-to-left readers.
- Daily Prompt tags work properly.
- Tap Site Domain cards to manage domains.
* [**] Fix editor crash occurring on large posts [https://github.com/wordpress-mobile/WordPress-Android/pull/20046]
* [*] [Jetpack-only] Site Monitoring: Add Metrics, PHP Logs, and Web Server Logs under Site Monitoring [https://github.com/wordpress-mobile/WordPress-Android/issues/20067]
* [**] Prevent images from temporarily disappearing when uploading media [https://github.com/WordPress/gutenberg/pull/57869]
* [***] [Jetpack-only] Reader: introduced new UI/UX for content navigation and filtering [https://github.com/wordpress-mobile/WordPress-Android/pull/19978]
6 changes: 2 additions & 4 deletions WordPress/metadata/release_notes.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,2 @@
- Get notified when you’re working offline.
- Image block uploads pause when you lose internet and resume when you reconnect.
- Select a custom gradient in the editor and see a color indicator.
- “Forward” and “back” arrows are correct for right-to-left readers.
* [**] Fix editor crash occurring on large posts [https://github.com/wordpress-mobile/WordPress-Android/pull/20046]
* [**] Prevent images from temporarily disappearing when uploading media [https://github.com/WordPress/gutenberg/pull/57869]
132 changes: 77 additions & 55 deletions WordPress/src/main/java/org/wordpress/android/AppInitializer.kt
Original file line number Diff line number Diff line change
Expand Up @@ -464,65 +464,78 @@ class AppInitializer @Inject constructor(
credentialsClient.connect()
}

private fun createNotificationChannelsOnSdk26() {
private fun createNotificationChannelsOnSdk26(
normal: Boolean = true,
important: Boolean = true,
reminder: Boolean = true,
transient: Boolean = true,
weeklyRoundup: Boolean = true
) {
// create Notification channels introduced in Android Oreo
if (Build.VERSION.SDK_INT >= VERSION_CODES.O) {
// Create the NORMAL channel (used for likes, comments, replies, etc.)
val normalChannel = NotificationChannel(
application.getString(R.string.notification_channel_normal_id),
application.getString(R.string.notification_channel_general_title),
NotificationManager.IMPORTANCE_DEFAULT
)
// Register the channel with the system; you can't change the importance
// or other notification behaviors after this
val notificationManager = application.getSystemService(
Context.NOTIFICATION_SERVICE
) as NotificationManager
notificationManager.createNotificationChannel(normalChannel)
if (normal) {
// Create the NORMAL channel (used for likes, comments, replies, etc.)
val normalChannel = NotificationChannel(
application.getString(R.string.notification_channel_normal_id),
application.getString(R.string.notification_channel_general_title),
NotificationManager.IMPORTANCE_DEFAULT
)
// Register the channel with the system; you can't change the importance
// or other notification behaviors after this

// Create the IMPORTANT channel (used for 2fa auth, for example)
val importantChannel = NotificationChannel(
application.getString(R.string.notification_channel_important_id),
application.getString(R.string.notification_channel_important_title),
NotificationManager.IMPORTANCE_HIGH
)
// Register the channel with the system; you can't change the importance
// or other notification behaviors after this
notificationManager.createNotificationChannel(importantChannel)

// Create the REMINDER channel (used for various reminders, like Quick Start, etc.)
val reminderChannel = NotificationChannel(
application.getString(R.string.notification_channel_reminder_id),
application.getString(R.string.notification_channel_reminder_title),
NotificationManager.IMPORTANCE_LOW
)
// Register the channel with the system; you can't change the importance
// or other notification behaviors after this
notificationManager.createNotificationChannel(reminderChannel)

// Create the TRANSIENT channel (used for short-lived notifications such as processing a Like/Approve,
// or media upload)
val transientChannel = NotificationChannel(
application.getString(R.string.notification_channel_transient_id),
application.getString(R.string.notification_channel_transient_title),
NotificationManager.IMPORTANCE_DEFAULT
)
transientChannel.setSound(null, null)
transientChannel.enableVibration(false)
transientChannel.enableLights(false)
// Register the channel with the system; you can't change the importance
// or other notification behaviors after this
notificationManager.createNotificationChannel(transientChannel)

// Create the WEEKLY ROUNDUP channel (used for weekly roundup notification containing weekly stats)
val weeklyRoundupChannel = NotificationChannel(
application.getString(R.string.notification_channel_weekly_roundup_id),
application.getString(R.string.notification_channel_weekly_roundup_title),
NotificationManager.IMPORTANCE_LOW
)
// Register the channel with the system; you can't change the importance or other notification behaviors
// after this
notificationManager.createNotificationChannel(weeklyRoundupChannel)
notificationManager.createNotificationChannel(normalChannel)
}
if (important) {
// Create the IMPORTANT channel (used for 2fa auth, for example)
val importantChannel = NotificationChannel(
application.getString(R.string.notification_channel_important_id),
application.getString(R.string.notification_channel_important_title),
NotificationManager.IMPORTANCE_HIGH
)
// Register the channel with the system; you can't change the importance
// or other notification behaviors after this
notificationManager.createNotificationChannel(importantChannel)
}
if (reminder) {
// Create the REMINDER channel (used for various reminders, like Quick Start, etc.)
val reminderChannel = NotificationChannel(
application.getString(R.string.notification_channel_reminder_id),
application.getString(R.string.notification_channel_reminder_title),
NotificationManager.IMPORTANCE_LOW
)
// Register the channel with the system; you can't change the importance
// or other notification behaviors after this
notificationManager.createNotificationChannel(reminderChannel)
}
if (transient) {
// Create the TRANSIENT channel (used for short-lived notifications such as processing a Like/Approve,
// or media upload)
val transientChannel = NotificationChannel(
application.getString(R.string.notification_channel_transient_id),
application.getString(R.string.notification_channel_transient_title),
NotificationManager.IMPORTANCE_DEFAULT
)
transientChannel.setSound(null, null)
transientChannel.enableVibration(false)
transientChannel.enableLights(false)
// Register the channel with the system; you can't change the importance
// or other notification behaviors after this
notificationManager.createNotificationChannel(transientChannel)
}
if (weeklyRoundup) {
// Create the WEEKLY ROUNDUP channel (used for weekly roundup notification containing weekly stats)
val weeklyRoundupChannel = NotificationChannel(
application.getString(R.string.notification_channel_weekly_roundup_id),
application.getString(R.string.notification_channel_weekly_roundup_title),
NotificationManager.IMPORTANCE_LOW
)
// Register the channel with the system; you can't change the importance or other notification behaviors
// after this
notificationManager.createNotificationChannel(weeklyRoundupChannel)
}
}
}

Expand Down Expand Up @@ -980,10 +993,19 @@ class AppInitializer @Inject constructor(
}

private fun updateNotificationSettings() {
if(!jetpackFeatureRemovalPhaseHelper.shouldShowNotifications())
if (!jetpackFeatureRemovalPhaseHelper.shouldShowNotifications()) {
NotificationsUtils.cancelAllNotifications(application)
else
// Only create the transient notification channel to handle upload notifications
createNotificationChannelsOnSdk26(
normal = false,
important = false,
reminder = false,
transient = true,
weeklyRoundup = false,
)
} else {
createNotificationChannelsOnSdk26()
}
}

companion object {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package org.wordpress.android.designsystem

import android.content.res.Configuration
import android.os.Bundle
import androidx.compose.foundation.isSystemInDarkTheme
import androidx.compose.runtime.Composable
import androidx.compose.ui.tooling.preview.Preview
import org.wordpress.android.ui.LocaleAwareActivity
Expand All @@ -10,8 +11,10 @@ import org.wordpress.android.util.extensions.setContent
class DesignSystemActivity : LocaleAwareActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContent {
DesignSystem(onBackPressedDispatcher::onBackPressed)
setContent {
DesignSystemTheme(isSystemInDarkTheme()) {
DesignSystem(onBackPressedDispatcher::onBackPressed)
}
}
}

Expand All @@ -21,11 +24,10 @@ class DesignSystemActivity : LocaleAwareActivity() {
showBackground = true,
name = "Dark Mode"
)

@Composable
fun PreviewDesignSystemActivity() {
DesignSystem(onBackPressedDispatcher::onBackPressed)
DesignSystemTheme(isSystemInDarkTheme()) {
DesignSystem(onBackPressedDispatcher::onBackPressed)
}
}
}


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

import androidx.compose.runtime.Stable
import androidx.compose.ui.graphics.Color

/**
* Object containing static common colors used throughout the project. Note that the colors here are not SEMANTIC,
* meaning they don't represent the usage of the color (e.g.: PrimaryButtonBackground) but instead they are raw
* colors used throughout this app's design (e.g.: Green50).
*/
object DesignSystemAppColor {
// Black & White
@Stable
val Black = Color(0xFF000000)

@Stable
val White = Color(0xFFFFFFFF)

// Grays
@Stable
val Gray = Color(0xFFF2F2F7)

@Stable
val Gray10 = Color(0xFFC2C2C6)

@Stable
val Gray20 = Color(0x99EBEBF5)

@Stable
val Gray30 = Color(0xFF9B9B9E)

@Stable
val Gray40 = Color(0x993C3C43)

@Stable
val Gray50 = Color(0x4D3C3C43)

@Stable
val Gray60 = Color(0xFF4E4E4F)

@Stable
val Gray70 = Color(0xFF3A3A3C)

@Stable
val Gray80 = Color(0xFF2C2C2E)

// Blues
@Stable
val Blue = Color(0xFF0675C4)

@Stable
val Blue10 = Color(0xFF399CE3)

@Stable
val Blue20 = Color(0xFF1689DB)

// Greens
@Stable
val Green = Color(0xFF008710)

@Stable
val Green10 = Color(0xFF2FB41F)

@Stable
val Green20 = Color(0xFF069E08)

// Reds
@Stable
val Red = Color(0xFFD63638)

@Stable
val Red10 = Color(0xFFE65054)

// Oranges
@Stable
val Orange = Color(0xFFD67709)

@Stable
val Orange10 = Color(0xFFE68B28)
}
Loading

0 comments on commit 6229933

Please sign in to comment.