Skip to content

Commit

Permalink
Add check for shouldRemoveJetpackFeatures to guide the create page flow
Browse files Browse the repository at this point in the history
  • Loading branch information
zwarm committed Jan 10, 2023
1 parent 6fa5ce6 commit b2feee0
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@
import org.wordpress.android.ui.jetpackoverlay.JetpackFeatureFullScreenOverlayFragment;
import org.wordpress.android.ui.jetpackoverlay.JetpackFeatureRemovalOverlayUtil;
import org.wordpress.android.ui.jetpackoverlay.JetpackFeatureRemovalOverlayUtil.JetpackFeatureCollectionOverlaySource;
import org.wordpress.android.ui.jetpackoverlay.JetpackFeatureRemovalPhaseHelper;
import org.wordpress.android.ui.main.WPMainNavigationView.OnPageListener;
import org.wordpress.android.ui.main.WPMainNavigationView.PageType;
import org.wordpress.android.ui.mlp.ModalLayoutPickerFragment;
Expand Down Expand Up @@ -268,6 +269,7 @@ public class WPMainActivity extends LocaleAwareActivity implements
@Inject OpenWebLinksWithJetpackFlowFeatureConfig mOpenWebLinksWithJetpackFlowFeatureConfig;
@Inject QRCodeAuthFlowFeatureConfig mQrCodeAuthFlowFeatureConfig;
@Inject JetpackFeatureRemovalOverlayUtil mJetpackFeatureRemovalOverlayUtil;
@Inject JetpackFeatureRemovalPhaseHelper mJetpackFeatureRemovalPhaseHelper;

@Inject BuildConfigWrapper mBuildConfigWrapper;

Expand Down Expand Up @@ -599,7 +601,8 @@ private void initViewModel() {
handleNewPostAction(PagePostCreationSourcesDetail.POST_FROM_MY_SITE, -1, null);
break;
case CREATE_NEW_PAGE:
if (mMLPViewModel.canShowModalLayoutPicker()) {
if (mMLPViewModel.canShowModalLayoutPicker()
&& !mJetpackFeatureRemovalPhaseHelper.shouldRemoveJetpackFeatures()) {
mMLPViewModel.createPageFlowTriggered();
} else {
handleNewPageAction("", "", null,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ import org.wordpress.android.ui.ActivityLauncher
import org.wordpress.android.ui.PagePostCreationSourcesDetail.PAGE_FROM_PAGES_LIST
import org.wordpress.android.ui.RequestCodes
import org.wordpress.android.ui.ScrollableViewInitializedListener
import org.wordpress.android.ui.jetpackoverlay.JetpackFeatureRemovalPhaseHelper
import org.wordpress.android.ui.mlp.ModalLayoutPickerFragment
import org.wordpress.android.ui.mlp.ModalLayoutPickerFragment.Companion.MODAL_LAYOUT_PICKER_TAG
import org.wordpress.android.ui.posts.EditPostActivity
Expand Down Expand Up @@ -109,6 +110,9 @@ class PagesFragment : Fragment(R.layout.pages_fragment), ScrollableViewInitializ
@Inject
lateinit var uploadUtilsWrapper: UploadUtilsWrapper

@Inject
lateinit var jetpackFeatureRemovalPhaseHelper: JetpackFeatureRemovalPhaseHelper

@Suppress("DEPRECATION")
private var progressDialog: ProgressDialog? = null

Expand Down Expand Up @@ -371,7 +375,8 @@ class PagesFragment : Fragment(R.layout.pages_fragment), ScrollableViewInitializ
})

viewModel.createNewPage.observe(viewLifecycleOwner, {
if (mlpViewModel.canShowModalLayoutPicker()) {
if (mlpViewModel.canShowModalLayoutPicker()
&& !jetpackFeatureRemovalPhaseHelper.shouldRemoveJetpackFeatures()) {
mlpViewModel.createPageFlowTriggered()
} else {
createNewPage()
Expand Down

0 comments on commit b2feee0

Please sign in to comment.