Skip to content

Commit

Permalink
Merge branch 'wordpress-mobile:trunk' into issue/21180
Browse files Browse the repository at this point in the history
  • Loading branch information
Agoni-0 authored Oct 24, 2024
2 parents ca83b85 + ccb4c3c commit 96bdc5c
Show file tree
Hide file tree
Showing 1,170 changed files with 149,346 additions and 399 deletions.
10 changes: 10 additions & 0 deletions .buildkite/commands/run-unit-tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,16 @@ elif [ "$1" == "image-editor" ]; then
test_results_dir="libs/image-editor/build/test-results"
test_log_dir="${test_results_dir}/testReleaseUnitTest/*.xml"
code_coverage_report="libs/image-editor/build/reports/kover/reportRelease.xml"
elif [ "$1" == "fluxc" ]; then
test_suite=":libs:fluxc:testReleaseUnitTest :libs:fluxc:koverXmlReportRelease"
test_results_dir="libs/fluxc/build/test-results"
test_log_dir="${test_results_dir}/testReleaseUnitTest/*.xml"
code_coverage_report="libs/fluxc/build/reports/kover/reportRelease.xml"
elif [ "$1" == "login" ]; then
test_suite=":libs:login:testReleaseUnitTest :libs:login:koverXmlReportRelease"
test_results_dir="libs/login/build/test-results"
test_log_dir="${test_results_dir}/testReleaseUnitTest/*.xml"
code_coverage_report="libs/login/build/reports/kover/reportRelease.xml"
else
echo "Invalid Test Suite! Expected 'wordpress', 'processors', or 'image-editor', received '$1' instead"
exit 1
Expand Down
20 changes: 20 additions & 0 deletions .buildkite/pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,26 @@ steps:
artifact_paths:
- "**/build/test-results/merged-test-results.xml"

- label: "🔬 Unit Test FluxC"
command: ".buildkite/commands/run-unit-tests.sh fluxc"
plugins:
- $CI_TOOLKIT
- $TEST_COLLECTOR:
<<: *test_collector_common_params
api-token-env-name: "BUILDKITE_ANALYTICS_TOKEN_UNIT_TESTS_FLUXC"
artifact_paths:
- "**/build/test-results/merged-test-results.xml"

- label: "🔬 Unit Test Login"
command: ".buildkite/commands/run-unit-tests.sh login"
plugins:
- $CI_TOOLKIT
- $TEST_COLLECTOR:
<<: *test_collector_common_params
api-token-env-name: "BUILDKITE_ANALYTICS_TOKEN_UNIT_TESTS_LOGIN"
artifact_paths:
- "**/build/test-results/merged-test-results.xml"

#################
# Instrumented (aka UI) Tests
#################
Expand Down
16 changes: 3 additions & 13 deletions WordPress/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,6 @@ repositories {
content {
includeGroup "org.wordpress"
includeGroup "org.wordpress.aztec"
includeGroup "org.wordpress.fluxc"
includeGroup "org.wordpress.wellsql"
includeGroup "org.wordpress.gutenberg-mobile"
includeGroup "org.wordpress.gutenbergkit"
Expand Down Expand Up @@ -220,6 +219,7 @@ android {
buildConfigField "boolean", "SYNC_PUBLISHING", "false"
buildConfigField "boolean", "ENABLE_IN_APP_UPDATES", "false"
buildConfigField "boolean", "ENABLE_NEW_GUTENBERG", "false"
buildConfigField "boolean", "ENABLE_NEW_GUTENBERG_THEME_STYLES", "false"

manifestPlaceholders = [magicLinkScheme:"wordpress"]
}
Expand Down Expand Up @@ -414,23 +414,13 @@ dependencies {
implementation (project(path:':libs:editor')) {
exclude group: 'org.wordpress', module: 'utils'
}
implementation("$gradle.ext.fluxCBinaryPath:${libs.versions.wordpress.fluxc.get()}") {
version {
strictly libs.versions.wordpress.fluxc.get()
}
exclude group: "com.android.volley"
exclude group: 'org.wordpress', module: 'utils'
exclude group: 'com.android.support', module: 'support-annotations'
}
implementation project(':libs:fluxc')
implementation("$gradle.ext.wputilsBinaryPath:${libs.wordpress.utils.get().version}") {
version {
strictly libs.wordpress.utils.get().version
}
}
implementation("$gradle.ext.loginFlowBinaryPath:${libs.versions.wordpress.login.get()}") {
exclude group: 'com.github.bumptech.glide'
exclude group: 'org.wordpress', module: 'utils'
}
implementation project(":libs:login")
implementation("$gradle.ext.aboutAutomatticBinaryPath:${libs.versions.automattic.about.get()}")

implementation("$gradle.ext.gutenbergKitBinaryPath:${libs.versions.gutenberg.kit.get()}")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,13 +77,15 @@ public Dialog onCreateDialog(Bundle savedInstanceState) {
} else {
hintView.setVisibility(View.GONE);
}

if (!isMultiline) {
editText.setMaxLines(1);
if (isMultiline) {
editText.setSingleLine(false);
editText.setMaxLines(10);
} else {
editText.setSingleLine(true);
}
if (!TextUtils.isEmpty(initialText)) {
editText.setText(initialText);
editText.setSelection(0, initialText.length());
editText.setSelection(0);
}

boolean isInputEnabled = args.getBoolean(IS_INPUT_ENABLED);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import androidx.compose.ui.platform.LocalLifecycleOwner
import androidx.compose.ui.tooling.preview.Preview
import androidx.compose.ui.viewinterop.AndroidView
import androidx.core.content.ContextCompat
import org.wordpress.android.ui.compose.theme.AppTheme
import org.wordpress.android.ui.compose.theme.AppThemeM2
import androidx.camera.core.Preview as CameraPreview

@Composable
Expand Down Expand Up @@ -98,7 +98,7 @@ class DummyCodeScanner : CodeScanner {
@Preview(name = "Dark mode", uiMode = Configuration.UI_MODE_NIGHT_YES)
@Composable
private fun BarcodeScannerScreenPreview() {
AppTheme {
AppThemeM2 {
BarcodeScanner(codeScanner = DummyCodeScanner(), onScannedResult = object : CodeScannerCallback {
override fun run(status: CodeScannerStatus?) {
// no-ops
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,18 @@ import android.content.res.Configuration
import androidx.activity.compose.rememberLauncherForActivityResult
import androidx.activity.result.contract.ActivityResultContracts
import androidx.compose.foundation.layout.padding
import androidx.compose.material.AlertDialog
import androidx.compose.material.MaterialTheme
import androidx.compose.material.Text
import androidx.compose.material.TextButton
import androidx.compose.material3.AlertDialog
import androidx.compose.material3.MaterialTheme
import androidx.compose.material3.Text
import androidx.compose.material3.TextButton
import androidx.compose.runtime.Composable
import androidx.compose.runtime.LaunchedEffect
import androidx.compose.ui.Modifier
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.tooling.preview.Preview
import androidx.compose.ui.unit.dp
import org.wordpress.android.R
import org.wordpress.android.ui.compose.theme.AppTheme
import org.wordpress.android.ui.compose.theme.AppThemeM3

@Composable
fun BarcodeScannerScreen(
Expand Down Expand Up @@ -91,7 +91,7 @@ private fun AlertDialog(
) {
Text(
ctaLabel,
color = MaterialTheme.colors.secondary,
color = MaterialTheme.colorScheme.secondary,
modifier = Modifier.padding(8.dp)
)
}
Expand All @@ -104,7 +104,7 @@ private fun AlertDialog(
) {
Text(
dismissCtaLabel,
color = MaterialTheme.colors.secondary,
color = MaterialTheme.colorScheme.secondary,
modifier = Modifier.padding(8.dp)
)
}
Expand All @@ -116,7 +116,7 @@ private fun AlertDialog(
@Preview(name = "Dark mode", uiMode = Configuration.UI_MODE_NIGHT_YES)
@Composable
fun DeniedOnceAlertDialog() {
AppTheme {
AppThemeM3 {
AlertDialog(
title = stringResource(id = R.string.barcode_scanning_alert_dialog_title),
message = stringResource(id = R.string.barcode_scanning_alert_dialog_rationale_message),
Expand All @@ -132,7 +132,7 @@ fun DeniedOnceAlertDialog() {
@Preview(name = "Dark mode", uiMode = Configuration.UI_MODE_NIGHT_YES)
@Composable
fun DeniedPermanentlyAlertDialog() {
AppTheme {
AppThemeM3 {
AlertDialog(
title = stringResource(id = R.string.barcode_scanning_alert_dialog_title),
message = stringResource(id = R.string.barcode_scanning_alert_dialog_permanently_denied_message),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import androidx.fragment.app.Fragment
import androidx.fragment.app.setFragmentResult
import androidx.fragment.app.viewModels
import dagger.hilt.android.AndroidEntryPoint
import org.wordpress.android.ui.compose.theme.AppTheme
import org.wordpress.android.ui.compose.theme.AppThemeM2
import org.wordpress.android.util.WPPermissionUtils
import javax.inject.Inject

Expand All @@ -38,7 +38,7 @@ class BarcodeScanningFragment : Fragment() {
private fun observeCameraPermissionState(view: ComposeView) {
viewModel.permissionState.observe(viewLifecycleOwner) { permissionState ->
view.setContent {
AppTheme {
AppThemeM2 {
BarcodeScannerScreen(
codeScanner = codeScanner,
permissionState = permissionState,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ import org.wordpress.android.ui.WPWebViewActivity
import org.wordpress.android.ui.blaze.BlazeActionEvent
import org.wordpress.android.ui.compose.components.MainTopAppBar
import org.wordpress.android.ui.compose.components.NavigationIcons
import org.wordpress.android.ui.compose.theme.AppTheme
import org.wordpress.android.ui.compose.theme.AppThemeM2
import org.wordpress.android.util.extensions.getSerializableCompat
import androidx.compose.foundation.layout.padding
import androidx.compose.ui.Modifier
Expand Down Expand Up @@ -69,7 +69,7 @@ class CampaignDetailFragment : Fragment(), CampaignDetailWebViewClient.CampaignD
savedInstanceState: Bundle?
): View = ComposeView(requireContext()).apply {
setContent {
AppTheme {
AppThemeM2 {
CampaignDetailPage(
navigationUp = requireActivity().onBackPressedDispatcher::onBackPressed
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ import org.wordpress.android.ui.blaze.blazecampaigns.CampaignViewModel
import org.wordpress.android.ui.compose.components.MainTopAppBar
import org.wordpress.android.ui.compose.components.NavigationIcons
import org.wordpress.android.ui.compose.theme.AppColor
import org.wordpress.android.ui.compose.theme.AppTheme
import org.wordpress.android.ui.compose.theme.AppThemeM2
import org.wordpress.android.ui.compose.utils.isLightTheme
import org.wordpress.android.ui.compose.utils.uiStringText
import org.wordpress.android.ui.main.jetpack.migration.compose.state.LoadingState
Expand Down Expand Up @@ -87,7 +87,7 @@ class CampaignListingFragment : Fragment() {
savedInstanceState: Bundle?
): View = ComposeView(requireContext()).apply {
setContent {
AppTheme {
AppThemeM2 {
val campaigns by viewModel.uiState.observeAsState()
CampaignListingPage(campaigns ?: CampaignListingUiState.Loading)
}
Expand Down Expand Up @@ -266,7 +266,7 @@ fun CampaignListingError(error: CampaignListingUiState.Error) {
@Preview
@Composable
fun CampaignListingErrorPreview() {
AppTheme {
AppThemeM2 {
CampaignListingError(CampaignListingUiState.Error(
title = UiString.UiStringRes(R.string.campaign_listing_page_no_campaigns_message_title),
description = UiString.UiStringRes(R.string.campaign_listing_page_no_campaigns_message_description),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ import org.wordpress.android.ui.compose.components.buttons.ImageButton
import org.wordpress.android.ui.compose.components.MainTopAppBar
import org.wordpress.android.ui.compose.components.NavigationIcons
import org.wordpress.android.ui.compose.theme.AppColor
import org.wordpress.android.ui.compose.theme.AppTheme
import org.wordpress.android.ui.compose.theme.AppThemeM2
import org.wordpress.android.ui.compose.unit.FontSize
import org.wordpress.android.ui.compose.unit.Margin
import org.wordpress.android.ui.utils.UiString
Expand Down Expand Up @@ -96,7 +96,7 @@ class BlazeOverlayFragment : Fragment() {
savedInstanceState: Bundle?
): View = ComposeView(requireContext()).apply {
setContent {
AppTheme {
AppThemeM2 {
val postModel by viewModel.promoteUiState.observeAsState(BlazeUiState.PromoteScreen.Site)
BlazeOverlayScreen(postModel)
}
Expand Down Expand Up @@ -361,7 +361,7 @@ class BlazeOverlayFragment : Fragment() {
@Preview
@Composable
private fun PreviewBlazeOverlayScreenPostFlow() {
AppTheme {
AppThemeM2 {
BlazeOverlayScreen(
content = BlazeUiState.PromoteScreen.PromotePost(
PostUIModel(
Expand All @@ -381,7 +381,7 @@ class BlazeOverlayFragment : Fragment() {
@Preview
@Composable
private fun PreviewBlazeOverlayScreenSiteFlow() {
AppTheme {
AppThemeM2 {
BlazeOverlayScreen(BlazeUiState.PromoteScreen.Site)
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ import org.wordpress.android.ui.blaze.BlazeWebViewHeaderUiState
import org.wordpress.android.ui.blaze.OnBlazeWebViewClientListener
import org.wordpress.android.ui.blaze.blazeoverlay.BlazeViewModel
import org.wordpress.android.ui.compose.components.MainTopAppBar
import org.wordpress.android.ui.compose.theme.AppTheme
import org.wordpress.android.ui.compose.theme.AppThemeM2
import org.wordpress.android.ui.compose.utils.uiStringText
import org.wordpress.android.ui.main.jetpack.migration.compose.state.LoadingState
import org.wordpress.android.editor.R as EditorR
Expand All @@ -73,7 +73,7 @@ class BlazePromoteWebViewFragment: Fragment(), OnBlazeWebViewClientListener,
savedInstanceState: Bundle?
) = ComposeView(requireContext()).apply {
setContent {
AppTheme {
AppThemeM2 {
BlazeWebViewScreen()
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ import androidx.compose.ui.unit.dp
import org.wordpress.android.R
import org.wordpress.android.ui.compose.components.ContentAlphaProvider
import org.wordpress.android.ui.compose.theme.AppColor
import org.wordpress.android.ui.compose.theme.AppTheme
import org.wordpress.android.ui.compose.theme.AppThemeM2
import org.wordpress.android.ui.compose.unit.Margin
import org.wordpress.android.ui.compose.utils.uiStringText
import org.wordpress.android.ui.utils.UiString.UiStringRes
Expand Down Expand Up @@ -241,7 +241,7 @@ private fun OverlayContentItem(
@Preview(name = "Dark Mode", uiMode = UI_MODE_NIGHT_YES)
@Composable
private fun BloganuaryNudgeLearnMoreOverlayPreview() {
AppTheme {
AppThemeM2 {
BloganuaryNudgeLearnMoreOverlay(
model = BloganuaryNudgeLearnMoreOverlayUiState(
noteText = UiStringRes(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import androidx.lifecycle.ViewModelProvider
import com.google.android.material.bottomsheet.BottomSheetDialog
import com.google.android.material.bottomsheet.BottomSheetDialogFragment
import dagger.hilt.android.AndroidEntryPoint
import org.wordpress.android.ui.compose.theme.AppTheme
import org.wordpress.android.ui.compose.theme.AppThemeM2
import org.wordpress.android.util.extensions.fillScreen
import org.wordpress.android.viewmodel.main.WPMainActivityViewModel
import javax.inject.Inject
Expand Down Expand Up @@ -40,7 +40,7 @@ class BloganuaryNudgeLearnMoreOverlayFragment : BottomSheetDialogFragment() {
override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View {
return ComposeView(requireContext()).apply {
setContent {
AppTheme {
AppThemeM2 {
BloganuaryNudgeLearnMoreOverlay(
model = viewModel.getUiState(isPromptsEnabled),
onActionClick = viewModel::onActionClick,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import kotlinx.coroutines.flow.onEach
import org.wordpress.android.ui.ActivityLauncher
import org.wordpress.android.ui.LocaleAwareActivity
import org.wordpress.android.ui.bloggingprompts.promptslist.compose.BloggingPromptsListScreen
import org.wordpress.android.ui.compose.theme.AppTheme
import org.wordpress.android.ui.compose.theme.AppThemeM2
import org.wordpress.android.ui.posts.PostUtils
import org.wordpress.android.util.extensions.setContent

Expand All @@ -24,7 +24,7 @@ class BloggingPromptsListActivity : LocaleAwareActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContent {
AppTheme {
AppThemeM2 {
val uiState by viewModel.uiStateFlow.collectAsState()
BloggingPromptsListScreen(
uiState,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ import androidx.compose.ui.unit.sp
import org.wordpress.android.R
import org.wordpress.android.ui.bloggingprompts.promptslist.model.BloggingPromptsListItemModel
import org.wordpress.android.ui.compose.theme.AppColor
import org.wordpress.android.ui.compose.theme.AppTheme
import org.wordpress.android.ui.compose.theme.AppThemeM2
import org.wordpress.android.ui.compose.unit.FontSize
import org.wordpress.android.ui.compose.unit.Margin
import org.wordpress.android.ui.compose.utils.asString
Expand Down Expand Up @@ -108,7 +108,7 @@ private fun ItemSubtitleDivider() {
fun BloggingPromptsListItemPreview(
@PreviewParameter(BloggingPromptsListItemPreviewProvider::class) model: BloggingPromptsListItemModel
) {
AppTheme {
AppThemeM2 {
BloggingPromptsListItem(model, onClick = {})
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ import org.wordpress.android.ui.bloggingprompts.promptslist.model.BloggingPrompt
import org.wordpress.android.ui.compose.components.EmptyContent
import org.wordpress.android.ui.compose.components.MainTopAppBar
import org.wordpress.android.ui.compose.components.NavigationIcons
import org.wordpress.android.ui.compose.theme.AppTheme
import org.wordpress.android.ui.compose.theme.AppThemeM2

@Composable
@SuppressLint("UnusedMaterialScaffoldPaddingParameter")
Expand Down Expand Up @@ -125,7 +125,7 @@ private fun NetworkErrorContent() {
fun BloggingPromptsListScreenPreview(
@PreviewParameter(provider = BloggingPromptsListScreenPreviewProvider::class) uiState: UiState
) {
AppTheme {
AppThemeM2 {
BloggingPromptsListScreen(uiState = uiState, onNavigateUp = {}, onItemClick = {})
}
}
Loading

0 comments on commit 96bdc5c

Please sign in to comment.