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

[Gutenberg] - Remove Gallery V1 and experimental flags #21038

Merged
merged 8 commits into from
Jul 12, 2024
Merged
Show file tree
Hide file tree
Changes from all 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 @@ -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 @@ -24,7 +24,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-79f2bc35285748c715e00f2a6648ed6831632178'
wordPressLoginVersion = '1.16.0'
Expand Down
Loading