Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Mobile] Disable Page Template picker if Modal Layout Picker is enabled #24061

Merged
merged 7 commits into from
Jul 24, 2020
Merged
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ data class GutenbergProps(
val editorTheme: Bundle?,
val translations: Bundle,
val isDarkMode: Boolean,
val htmlModeEnabled: Boolean
val htmlModeEnabled: Boolean,
val isModalLayoutPickerEnabled: Boolean
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was thinking of adding a default value to the new parameter in order to be able to merge this early without breaking the WP-Android code. Something like the following:

data class GutenbergProps @JvmOverloads constructor(
    val enableMentions: Boolean,
    val enableUnsupportedBlockEditor: Boolean,
    val localeSlug: String,
    val postType: String,
    val editorTheme: Bundle?,
    val translations: Bundle,
    val isDarkMode: Boolean,
    val htmlModeEnabled: Boolean
    val htmlModeEnabled: Boolean,
    val isModalLayoutPickerEnabled: Boolean = false
) {

Wdyt @mchowning , @chipsnyder ?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That seems like a good plan to me.

) {

fun getInitialProps(bundle: Bundle?) = (bundle ?: Bundle()).apply {
Expand All @@ -24,6 +25,7 @@ data class GutenbergProps(
putBundle(PROP_CAPABILITIES, Bundle().apply {
putBoolean(PROP_CAPABILITIES_MENTIONS, enableMentions)
putBoolean(PROP_CAPABILITIES_UNSUPPORTED_BLOCK_EDITOR, enableUnsupportedBlockEditor)
putBoolean(PROP_NAME_MODAL_LAYOUT_PICKER, isModalLayoutPickerEnabled)
})

editorTheme?.also {
Expand Down Expand Up @@ -52,5 +54,6 @@ data class GutenbergProps(
const val PROP_CAPABILITIES = "capabilities"
const val PROP_CAPABILITIES_MENTIONS = "mentions"
const val PROP_CAPABILITIES_UNSUPPORTED_BLOCK_EDITOR = "unsupportedBlockEditor"
const val PROP_NAME_MODAL_LAYOUT_PICKER = "modalLayoutPicker"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not a big deal, but for the sake of consistency with the other "capabilities" props, what would you think about renaming this variable to "PROP_CAPABILITIES_MODAL_LAYOUT_PICKER"?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You are right @mchowning . I copy pasted the wrong naming from the old code.
Thank you for your feedback :)

}
}