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

[RNMobile] Simplify media insertion flow #25031

Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
70 commits
Select commit Hold shift + click to select a range
67c84d9
automatically open the media options bottom sheet
jd-alexander Sep 2, 2020
e8940fd
remove the image if the cancel option is selected.
jd-alexander Sep 2, 2020
d795232
added the clear media option.
jd-alexander Sep 3, 2020
3c29025
fixed the order of the cancel button.
jd-alexander Sep 3, 2020
0bc20d7
put a newline to separate cancellation if logic from the code below
jd-alexander Sep 3, 2020
9f3269b
made variable names more meaningful.
jd-alexander Sep 3, 2020
7de89e0
shared the destructiveButton logic between the Image & Cover block.
jd-alexander Sep 3, 2020
d488ba8
Merge branch 'master' into rnmobile/simplify_image_insertion_flow
jd-alexander Sep 24, 2020
8163ce6
merging resolved conflicts.
jd-alexander Sep 24, 2020
6a9d981
reverted the Image Editing Button behavior to having the ability to …
jd-alexander Sep 29, 2020
3de9cf0
Reverted changes to the ImageComponent and passed in the Clear Media …
jd-alexander Sep 29, 2020
59c36db
remove the delete behavior from the image block.
jd-alexander Sep 29, 2020
3cdde20
Utilize a delay on iOS so that the inserter being closed doesn't dism…
jd-alexander Sep 29, 2020
60a3feb
remove unnecessary line.
jd-alexander Sep 29, 2020
8966c23
put the mediaPickerOptions back in the correct location to eliminate …
jd-alexander Sep 29, 2020
0bfe3d6
pass the autoOpenMediaUpload flag to the MediaUpload component so it …
jd-alexander Sep 30, 2020
f72c3ae
moved delaying logic to the MediaUpload onPickerPresent function.
jd-alexander Sep 30, 2020
0ce172c
Once the media is cleared then the picker should not be shown.
jd-alexander Sep 30, 2020
e608165
removed unneeded MEDIA_UPLOAD_CANCEL type
jd-alexander Sep 30, 2020
c104069
revert changes made to the Cover block with onClearMedia logic.
jd-alexander Sep 30, 2020
0628c3f
removed unneeded variable for autoOpenMediaUpload
jd-alexander Sep 30, 2020
4148aca
added auto open to the Video block.
jd-alexander Oct 1, 2020
cb8f9e0
added the auto open to the Image Gallery block.
jd-alexander Oct 1, 2020
ff3e869
removed unneeded state and passed the auto open logic as an expression.
jd-alexander Oct 1, 2020
3016466
paused auto open logic as an expression to autoOpenMediaUpload.
jd-alexander Oct 1, 2020
af882b8
added a comment about why the delay is necessary on iOS.
jd-alexander Oct 1, 2020
07cea7b
attempt at fixing tests.
jd-alexander Oct 2, 2020
7ad8fc8
Changed the iOS Picker's termination action text from Cancel to Dismiss.
jd-alexander Oct 8, 2020
3f113a7
changed button accessibility id from Cancel to Dismiss.
jd-alexander Oct 8, 2020
23dc6fe
Merge branch 'master' into rnmobile/simplify_image_insertion_flow
jd-alexander Oct 9, 2020
372306f
Merge branch 'master' into rnmobile/simplify_image_insertion_flow
jd-alexander Oct 9, 2020
f217d4a
use driver.sleep( 1000 ) to ensure that the bottom sheet is visible.
jd-alexander Oct 9, 2020
e598262
Merge branch 'master' into rnmobile/simplify_image_insertion_flow
jd-alexander Oct 12, 2020
e3d3eeb
Merge branch 'master' into rnmobile/simplify_image_insertion_flow
jd-alexander Oct 12, 2020
96d6b7a
Merge branch 'master' into rnmobile/simplify_image_insertion_flow
jd-alexander Oct 13, 2020
1b9656b
The Undo and clearMedia buttons do not trigger the media upload picker
jd-alexander Oct 14, 2020
653b416
bottom sheet is not triggered for undo operations on the video block.
jd-alexander Oct 16, 2020
252c74e
bottom sheet is not triggered for clear or undo gallery operations
jd-alexander Oct 16, 2020
458499a
Merge branch 'master' into rnmobile/simplify_image_insertion_flow
jd-alexander Oct 16, 2020
4691407
converted behavior to utilize hooks in the gallery component.
jd-alexander Oct 16, 2020
ae0c58c
added actions for the block insertion events.
jd-alexander Nov 11, 2020
7b49207
Updated actions, reducer and selectors to support block inserted.
jd-alexander Nov 12, 2020
6cf07a6
added block insertion event to menu.
jd-alexander Nov 12, 2020
206a83f
Added wasBlockJustInserted to utilize it to open the bottom sheet.
jd-alexander Nov 12, 2020
d3cfdfa
Removed already opened logic and bound the wasBlockJustInserted
jd-alexander Nov 12, 2020
2fcaaab
simplified redux approach for auto opening.
jd-alexander Nov 13, 2020
350aef7
removed unneeded true comparison
jd-alexander Nov 13, 2020
043a9b6
renamed the behavior from blockInsertionEvent to lastBlockInserted
jd-alexander Nov 14, 2020
20e79e4
added the wasBlockJustInserted call to the Image block.
jd-alexander Nov 14, 2020
2fec1cc
added wasBlockJustInserted functionality to the Gallery flow.
jd-alexander Nov 14, 2020
e396965
added wasBlockJustInserted to the Video component.
jd-alexander Nov 14, 2020
397b79f
Updated the comment so it's more meaningful.
jd-alexander Nov 14, 2020
ef86342
Merge branch 'master' into rnmobile/simplify_image_insertion_flow
jd-alexander Nov 14, 2020
cb7aeaf
improved the comment of the lastBlockInserted selector
jd-alexander Nov 14, 2020
6afbaf8
Update packages/editor/src/store/selectors.native.js
jd-alexander Nov 17, 2020
f114df8
Merge branch 'master' into rnmobile/simplify_image_insertion_flow
jd-alexander Mar 1, 2021
35b703b
fixed issues that arose during the merge.
jd-alexander Mar 1, 2021
fd49e34
removed optimist block from reducer combination.
jd-alexander Mar 1, 2021
d56673f
Merge branch 'trunk' into rnmobile/simplify_image_insertion_flow
jd-alexander Mar 1, 2021
f76fd03
Utilized the useDispatch hook approach for last block inserted.
jd-alexander Mar 1, 2021
fd0e7dd
fixed lint errors.
jd-alexander Mar 1, 2021
c1c0087
Utilized editorPage.driver instead of driver reference.
jd-alexander Mar 1, 2021
fb4d162
added unit tests for the selectors.
jd-alexander Mar 1, 2021
21ce189
renamed the title of test group to match with tests within the store
jd-alexander Mar 2, 2021
91556bc
removed unneeded client from CLEAR_LAST_BLOCK_INSERTED
jd-alexander Mar 2, 2021
7030c9d
added unit tests for the actions and reducers of the last block inserted
jd-alexander Mar 2, 2021
f664f27
made test values simpler.
jd-alexander Mar 2, 2021
d0a8610
added documentation for changes to the MediaPlaceholder component.
jd-alexander Mar 2, 2021
e23f7df
Merge branch 'trunk' into rnmobile/simplify_image_insertion_flow
jd-alexander Mar 2, 2021
ca7eee3
updated MediaUpload and MediaPlaceholder documentation.
jd-alexander Mar 2, 2021
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
Prev Previous commit
Next Next commit
fixed lint errors.
  • Loading branch information
jd-alexander committed Mar 1, 2021
commit fd0e7dd57767074919ce5e41b15dba71c5e3e877
Original file line number Diff line number Diff line change
@@ -1,15 +1,14 @@
/**
* External dependencies
*/
import React from 'react';
import { Platform } from 'react-native';

import { delay } from 'lodash';

/**
* WordPress dependencies
*/
import { Component } from '@wordpress/element';
import { Component, React } from '@wordpress/element';
import { __ } from '@wordpress/i18n';
import { Picker } from '@wordpress/components';
import {
Expand Down
8 changes: 7 additions & 1 deletion packages/block-library/src/image/edit.native.js
Original file line number Diff line number Diff line change
Expand Up @@ -403,7 +403,13 @@ export class ImageEdit extends Component {

render() {
const { isCaptionSelected } = this.state;
const { attributes, isSelected, image, clientId, wasBlockJustInserted } = this.props;
const {
attributes,
isSelected,
image,
clientId,
wasBlockJustInserted,
} = this.props;
const { align, url, alt, id, sizeSlug, className } = attributes;

const sizeOptionsValid = find( this.sizeOptions, [
Expand Down
3 changes: 1 addition & 2 deletions packages/editor/src/store/selectors.native.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,6 @@ export const isEditedPostAutosaveable = createRegistrySelector(
}
);


/**
* Tells if the block with the passed clientId was just inserted.
*
Expand All @@ -66,4 +65,4 @@ export const isEditedPostAutosaveable = createRegistrySelector(
*/
export function wasBlockJustInserted( state, clientId ) {
return state.lastBlockInserted.clientId === clientId;
}
}