Skip to content

Commit

Permalink
Merge pull request #21038 from wordpress-mobile/gutenberg/remove-gall…
Browse files Browse the repository at this point in the history
…ery-v1-and-experimental-flags

[Gutenberg] - Remove Gallery V1 and experimental flags
  • Loading branch information
Gerardo Pacheco authored Jul 12, 2024
2 parents e8a9fd2 + 6c6418e commit 9481dde
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 20 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2531,17 +2531,6 @@ class EditPostActivity : LocaleAwareActivity(), EditorFragmentActivity, EditorIm
)
}

/**
* Checks if the theme supports the new gallery block with image blocks.
* Note that if the editor theme has not been initialized (usually on the first app run)
* the value returned is null and the `unstable_gallery_with_image_blocks` analytics property will not be reported.
* @return true if the the supports the new gallery block with image blocks or null if the theme is not initialized.
*/
private fun themeSupportsGalleryWithImageBlocks(): Boolean? {
val editorTheme = editorThemeStore.getEditorThemeForSite(siteModel) ?: return null
return editorTheme.themeSupport.galleryWithImageBlocks
}

private var mediaCapturePath: String? = ""
private fun getUploadErrorHtml(mediaId: String, path: String): String {
return String.format(
Expand Down Expand Up @@ -3508,7 +3497,7 @@ class EditPostActivity : LocaleAwareActivity(), EditorFragmentActivity, EditorIm
if (showAztecEditor && editorFragment is AztecEditorFragment) {
val entryPoint =
intent.getSerializableExtra(EditPostActivityConstants.EXTRA_ENTRY_POINT) as PostUtils.EntryPoint?
postEditorAnalyticsSession?.start(null, themeSupportsGalleryWithImageBlocks(), entryPoint)
postEditorAnalyticsSession?.start(null, entryPoint)
}
}

Expand All @@ -3523,7 +3512,7 @@ class EditPostActivity : LocaleAwareActivity(), EditorFragmentActivity, EditorIm
// It assumes this is being called when the editor has finished loading
// If you need to refactor this, please ensure that the startup_time_ms property
// is still reflecting the actual startup time of the editor
postEditorAnalyticsSession?.start(unsupportedBlocksList, themeSupportsGalleryWithImageBlocks(), entryPoint)
postEditorAnalyticsSession?.start(unsupportedBlocksList, entryPoint)
presentNewPageNoticeIfNeeded()

// Start VM, load prompt and populate Editor with content after edit IS ready.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ public class PostEditorAnalyticsSession implements Serializable {
private static final String KEY_EDITOR = "editor";
private static final String KEY_HAS_UNSUPPORTED_BLOCKS = "has_unsupported_blocks";
private static final String KEY_UNSUPPORTED_BLOCKS = "unsupported_blocks";
private static final String KEY_GALLERY_WITH_IMAGE_BLOCKS = "unstable_gallery_with_image_blocks";
private static final String KEY_POST_TYPE = "post_type";
private static final String KEY_OUTCOME = "outcome";
private static final String KEY_SESSION_ID = "session_id";
Expand Down Expand Up @@ -115,16 +114,12 @@ public static PostEditorAnalyticsSession getNewPostEditorAnalyticsSession(
}

public void start(ArrayList<Object> unsupportedBlocksList,
Boolean galleryWithImageBlocks,
final EntryPoint entryPoint) {
if (!mStarted) {
mHasUnsupportedBlocks = unsupportedBlocksList != null && unsupportedBlocksList.size() > 0;
Map<String, Object> properties = getCommonProperties();
properties.put(KEY_UNSUPPORTED_BLOCKS,
unsupportedBlocksList != null ? unsupportedBlocksList : new ArrayList<>());
if (galleryWithImageBlocks != null) {
properties.put(KEY_GALLERY_WITH_IMAGE_BLOCKS, galleryWithImageBlocks);
}
// Note that start time only counts when the analytics session was created and not when the editor
// activity started. We are mostly interested in measuring the loading times for the block editor,
// where the main bottleneck seems to be initializing React Native and doing the initial load of Gutenberg.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ class PostEditorAnalyticsSessionTest {
val postEditorAnalyticsSession = createPostEditorAnalyticsSessionTracker(analyticsTracker)

// trigger all the editor_session events
postEditorAnalyticsSession.start(null, true, null)
postEditorAnalyticsSession.start(null, null)
postEditorAnalyticsSession.end()
postEditorAnalyticsSession.switchEditor(GUTENBERG)
postEditorAnalyticsSession.applyTemplate("Just a template name")
Expand Down
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ ext {
automatticAboutVersion = '1.4.0'
automatticRestVersion = '1.0.8'
automatticTracksVersion = '5.1.0'
gutenbergMobileVersion = 'v1.121.0-alpha1'
gutenbergMobileVersion = 'v1.121.0-alpha2'
wordPressAztecVersion = 'v2.1.3'
wordPressFluxCVersion = 'trunk-c670e916346bdaa2379936dd8dbb6750766ca319'
wordPressLoginVersion = '1.16.0'
Expand Down

0 comments on commit 9481dde

Please sign in to comment.