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

[TESTING] Support background colors for Group block #13279

Closed
wants to merge 33 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
4527c27
Update gb-mobile reference
marecar3 Oct 20, 2020
bdd34a7
Update gb-mobile reference
marecar3 Oct 20, 2020
661c94c
Add support for document files
marecar3 Oct 20, 2020
b6d44c8
Upload selected document files
marecar3 Oct 20, 2020
c9028f9
Enable consolidated media picker
marecar3 Oct 21, 2020
af82450
Fix lint error
marecar3 Oct 21, 2020
9957e0f
Fix crash on Android and add tracking of document
marecar3 Oct 27, 2020
8de336a
Use native picker library
marecar3 Oct 27, 2020
f4a1401
remove unused request code
marecar3 Oct 27, 2020
f7b99a1
Remove unused code
marecar3 Oct 27, 2020
b358ff0
Merge branch 'develop' into gutenberg/file-block
marecar3 Oct 27, 2020
a856bac
rename document to file in all appearances
marecar3 Oct 27, 2020
c06f582
rename document to file in all appearances
marecar3 Oct 27, 2020
91d89c1
update gb mobile reference
marecar3 Oct 27, 2020
8aff5b9
Merge branch 'develop' into gutenberg/file-block
marecar3 Nov 2, 2020
f85da5b
Add proper case in getEventNameForStat for EDITOR_ADDED_FILE_VIA_LIBRARY
marecar3 Nov 2, 2020
39bcb3f
Convert media source statement to switch block
marecar3 Nov 2, 2020
d04776c
Update libs/editor/WordPressEditor/src/main/java/org/wordpress/androi…
marecar3 Nov 2, 2020
822cc6e
Fix renaming suggestion.
marecar3 Nov 2, 2020
ffa5f7d
Add break to switch case
marecar3 Nov 2, 2020
14b0e59
Merge branch 'develop' into gutenberg/file-block
marecar3 Nov 12, 2020
11c593e
remove unnecessary check if arguments are null
marecar3 Nov 12, 2020
741fb4d
Align naming
marecar3 Nov 12, 2020
59ff6c9
Updated gutenberg ref
jd-alexander Nov 12, 2020
95fd639
Merge branch 'develop' into gutenberg/file-block
jd-alexander Nov 12, 2020
8d2b23c
Removed unneeded arguments and fixed typo
jd-alexander Nov 12, 2020
d243c9e
Updated gutenberg ref
jd-alexander Nov 12, 2020
3e07ac8
Update gutenberg ref
etoledom Nov 13, 2020
1848053
Merge pull request #13178 from wordpress-mobile/gutenberg/file-block
etoledom Nov 13, 2020
a56f092
Update Gutenberg ref
Nov 17, 2020
931d9bc
Merge branch 'develop' into gutenberg/after_1.41.0
ceyhun Nov 17, 2020
31b2969
Merge branch 'gutenberg/after_1.41.0' into gutenberg/test-group-backg…
Nov 17, 2020
cd4b9a4
Update Gutenberg ref
Nov 19, 2020
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 @@ -2720,6 +2720,13 @@ postId, getSite(), mediaUri,
mOnGetMentionResult = null;
}
break;
case RequestCodes.FILE_LIBRARY:
uris = WPMediaUtils.retrieveMediaUris(data);
mAnalyticsTrackerWrapper.track(Stat.EDITOR_ADDED_FILE_VIA_LIBRARY);
for (Uri item : uris) {
mEditorMedia.addNewMediaToEditorAsync(item, false);
}
break;
}
}

Expand Down Expand Up @@ -2967,6 +2974,11 @@ public void onAddGifClicked(boolean allowMultipleSelection) {
onPhotoPickerIconClicked(PhotoPickerIcon.GIF, allowMultipleSelection);
}

@Override
public void onAddFileClicked(boolean allowMultipleSelection) {
WPMediaUtils.launchFileLibrary(this, allowMultipleSelection);
}

@Override
public void onPerformFetch(String path, Consumer<String> onResult, Consumer<Bundle> onError) {
if (mSite != null) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,7 @@ public enum Stat {
EDITOR_ADDED_PHOTO_VIA_WP_MEDIA_LIBRARY,
EDITOR_ADDED_VIDEO_VIA_WP_MEDIA_LIBRARY,
EDITOR_ADDED_PHOTO_VIA_STOCK_MEDIA_LIBRARY,
EDITOR_ADDED_FILE_VIA_LIBRARY,
MEDIA_PHOTO_OPTIMIZED,
MEDIA_PHOTO_OPTIMIZE_ERROR,
MEDIA_VIDEO_OPTIMIZED,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -793,6 +793,8 @@ public static String getEventNameForStat(AnalyticsTracker.Stat stat) {
return "editor_video_added";
case EDITOR_ADDED_PHOTO_VIA_STOCK_MEDIA_LIBRARY:
return "editor_photo_added";
case EDITOR_ADDED_FILE_VIA_LIBRARY:
return "editor_file_added";
case MEDIA_PHOTO_OPTIMIZED:
return "media_photo_optimized";
case MEDIA_PHOTO_OPTIMIZE_ERROR:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,7 @@ public interface EditorFragmentListener extends DialogVisibilityProvider {
void onHtmlModeToggledInToolbar();
void onAddStockMediaClicked(boolean allowMultipleSelection);
void onAddGifClicked(boolean allowMultipleSelection);
void onAddFileClicked(boolean allowMultipleSelection);
void onPerformFetch(String path, Consumer<String> onResult, Consumer<Bundle> onError);
void onGutenbergEditorSessionTemplateApplyTracked(String template);
void onGutenbergEditorSessionTemplatePreviewTracked(String template);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@ public class GutenbergEditorFragment extends EditorFragmentAbstract implements
private static final int CAPTURE_PHOTO_PERMISSION_REQUEST_CODE = 101;
private static final int CAPTURE_VIDEO_PERMISSION_REQUEST_CODE = 102;

private static final String MEDIA_SOURCE_FILE = "MEDIA_SOURCE_FILE";
private static final String MEDIA_SOURCE_STOCK_MEDIA = "MEDIA_SOURCE_STOCK_MEDIA";
private static final String GIF_MEDIA = "GIF_MEDIA";

Expand Down Expand Up @@ -263,12 +264,27 @@ public ArrayList<MediaOption> onGetOtherMediaImageOptions() {
return otherMediaImageOptions;
}

@Override
public ArrayList<MediaOption> onGetOtherMediaFileOptions() {
ArrayList<MediaOption> otherMediaFileOptions = initOtherMediaFileOptions();
return otherMediaFileOptions;
}

@Override
public void onOtherMediaButtonClicked(String mediaSource, boolean allowMultipleSelection) {
if (mediaSource.equals(MEDIA_SOURCE_STOCK_MEDIA)) {
mEditorFragmentListener.onAddStockMediaClicked(allowMultipleSelection);
} else if (mediaSource.equals(GIF_MEDIA)) {
mEditorFragmentListener.onAddGifClicked(allowMultipleSelection);
switch (mediaSource) {
case MEDIA_SOURCE_STOCK_MEDIA:
mEditorFragmentListener.onAddStockMediaClicked(allowMultipleSelection);
break;
case GIF_MEDIA:
mEditorFragmentListener.onAddGifClicked(allowMultipleSelection);
break;
case MEDIA_SOURCE_FILE:
mEditorFragmentListener.onAddFileClicked(allowMultipleSelection);
break;
default:
AppLog.e(T.EDITOR,
"Unsupported media source " + mediaSource);
}
}
},
Expand Down Expand Up @@ -503,6 +519,26 @@ private ArrayList<MediaOption> initOtherMediaImageOptions() {
return otherMediaOptions;
}

private ArrayList<MediaOption> initOtherMediaFileOptions() {
ArrayList<MediaOption> otherMediaOptions = new ArrayList<>();

FragmentActivity activity = getActivity();
if (activity == null) {
AppLog.e(T.EDITOR,
"Failed to initialize other media options because the activity is null");
return otherMediaOptions;
}

String packageName = activity.getApplication().getPackageName();

int chooseFileResourceId =
getResources().getIdentifier("photo_picker_choose_file", "string", packageName);

otherMediaOptions.add(new MediaOption(MEDIA_SOURCE_FILE, getString(chooseFileResourceId)));

return otherMediaOptions;
}

@Override public void onResume() {
super.onResume();

Expand Down Expand Up @@ -1016,7 +1052,8 @@ public void appendMediaFiles(Map<String, MediaFile> mediaList) {
rnMediaList.add(createRNMediaUsingMimeType(mediaId,
url,
mediaEntry.getValue().getMimeType(),
mediaEntry.getValue().getCaption()));
mediaEntry.getValue().getCaption(),
mediaEntry.getValue().getTitle()));
}

getGutenbergContainerFragment().appendMediaFiles(rnMediaList);
Expand Down
2 changes: 1 addition & 1 deletion libs/gutenberg-mobile
Submodule gutenberg-mobile updated 57 files
+4 −0 RELEASE-NOTES.txt
+2 −1 bundle/android/strings.xml
+2,097 −1,891 bundle/ios/App.js
+1 −1 bundle/ios/App.js.map
+2 −1 bundle/ios/GutenbergNativeTranslations.swift
+1 −1 bundle/ios/assets/gutenberg/packages/react-native-editor/i18n-cache/data/ar.json
+1 −1 bundle/ios/assets/gutenberg/packages/react-native-editor/i18n-cache/data/bg.json
+1 −1 bundle/ios/assets/gutenberg/packages/react-native-editor/i18n-cache/data/bo.json
+1 −1 bundle/ios/assets/gutenberg/packages/react-native-editor/i18n-cache/data/ca.json
+1 −1 bundle/ios/assets/gutenberg/packages/react-native-editor/i18n-cache/data/cs.json
+1 −1 bundle/ios/assets/gutenberg/packages/react-native-editor/i18n-cache/data/cy.json
+1 −1 bundle/ios/assets/gutenberg/packages/react-native-editor/i18n-cache/data/da.json
+1 −1 bundle/ios/assets/gutenberg/packages/react-native-editor/i18n-cache/data/de.json
+1 −1 bundle/ios/assets/gutenberg/packages/react-native-editor/i18n-cache/data/el.json
+1 −1 bundle/ios/assets/gutenberg/packages/react-native-editor/i18n-cache/data/en-au.json
+1 −1 bundle/ios/assets/gutenberg/packages/react-native-editor/i18n-cache/data/en-ca.json
+1 −1 bundle/ios/assets/gutenberg/packages/react-native-editor/i18n-cache/data/en-gb.json
+1 −1 bundle/ios/assets/gutenberg/packages/react-native-editor/i18n-cache/data/en-nz.json
+1 −1 bundle/ios/assets/gutenberg/packages/react-native-editor/i18n-cache/data/en-za.json
+1 −1 bundle/ios/assets/gutenberg/packages/react-native-editor/i18n-cache/data/es-ar.json
+1 −1 bundle/ios/assets/gutenberg/packages/react-native-editor/i18n-cache/data/es-cl.json
+1 −1 bundle/ios/assets/gutenberg/packages/react-native-editor/i18n-cache/data/es-cr.json
+1 −1 bundle/ios/assets/gutenberg/packages/react-native-editor/i18n-cache/data/es.json
+1 −1 bundle/ios/assets/gutenberg/packages/react-native-editor/i18n-cache/data/fa.json
+1 −1 bundle/ios/assets/gutenberg/packages/react-native-editor/i18n-cache/data/fr.json
+1 −1 bundle/ios/assets/gutenberg/packages/react-native-editor/i18n-cache/data/gl.json
+1 −1 bundle/ios/assets/gutenberg/packages/react-native-editor/i18n-cache/data/he.json
+1 −1 bundle/ios/assets/gutenberg/packages/react-native-editor/i18n-cache/data/hr.json
+1 −1 bundle/ios/assets/gutenberg/packages/react-native-editor/i18n-cache/data/hu.json
+1 −1 bundle/ios/assets/gutenberg/packages/react-native-editor/i18n-cache/data/id.json
+1 −1 bundle/ios/assets/gutenberg/packages/react-native-editor/i18n-cache/data/is.json
+1 −1 bundle/ios/assets/gutenberg/packages/react-native-editor/i18n-cache/data/it.json
+1 −1 bundle/ios/assets/gutenberg/packages/react-native-editor/i18n-cache/data/ja.json
+1 −1 bundle/ios/assets/gutenberg/packages/react-native-editor/i18n-cache/data/ka.json
+1 −1 bundle/ios/assets/gutenberg/packages/react-native-editor/i18n-cache/data/ko.json
+1 −1 bundle/ios/assets/gutenberg/packages/react-native-editor/i18n-cache/data/nb.json
+1 −1 bundle/ios/assets/gutenberg/packages/react-native-editor/i18n-cache/data/nl-be.json
+1 −1 bundle/ios/assets/gutenberg/packages/react-native-editor/i18n-cache/data/nl.json
+1 −1 bundle/ios/assets/gutenberg/packages/react-native-editor/i18n-cache/data/pl.json
+1 −1 bundle/ios/assets/gutenberg/packages/react-native-editor/i18n-cache/data/pt-br.json
+1 −1 bundle/ios/assets/gutenberg/packages/react-native-editor/i18n-cache/data/pt.json
+1 −1 bundle/ios/assets/gutenberg/packages/react-native-editor/i18n-cache/data/ro.json
+1 −1 bundle/ios/assets/gutenberg/packages/react-native-editor/i18n-cache/data/ru.json
+1 −1 bundle/ios/assets/gutenberg/packages/react-native-editor/i18n-cache/data/sk.json
+1 −1 bundle/ios/assets/gutenberg/packages/react-native-editor/i18n-cache/data/sq.json
+1 −1 bundle/ios/assets/gutenberg/packages/react-native-editor/i18n-cache/data/sr.json
+1 −1 bundle/ios/assets/gutenberg/packages/react-native-editor/i18n-cache/data/sv.json
+1 −1 bundle/ios/assets/gutenberg/packages/react-native-editor/i18n-cache/data/th.json
+1 −1 bundle/ios/assets/gutenberg/packages/react-native-editor/i18n-cache/data/tr.json
+1 −1 bundle/ios/assets/gutenberg/packages/react-native-editor/i18n-cache/data/uk.json
+1 −1 bundle/ios/assets/gutenberg/packages/react-native-editor/i18n-cache/data/ur.json
+1 −1 bundle/ios/assets/gutenberg/packages/react-native-editor/i18n-cache/data/vi.json
+1 −1 bundle/ios/assets/gutenberg/packages/react-native-editor/i18n-cache/data/zh-cn.json
+1 −1 bundle/ios/assets/gutenberg/packages/react-native-editor/i18n-cache/data/zh-tw.json
+2 −40 bundle/ios/assets/jetpack/extensions/index.json
+1 −1 gutenberg
+1 −1 jetpack