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 Part 1 - redux changes #29546

Merged
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
Show all changes
15 commits
Select commit Hold shift + click to select a range
6742b75
created actions for adding and clearing last inserted block event.
jd-alexander Mar 4, 2021
fc8d9b4
added reducer for determining new state based on the action
jd-alexander Mar 4, 2021
fb115ae
added selector to query the state for the last block inserted
jd-alexander Mar 4, 2021
e3fefb6
Merge branch 'trunk' into rnmobile/simplify_image_insertion_flow-redu…
jd-alexander Mar 16, 2021
ee4d502
[RNMobile] Simplify media insertion flow Part 2 - media upload (#29547)
jd-alexander Mar 16, 2021
cb31236
Added release notes for auto-opening.
jd-alexander Mar 17, 2021
3aa051f
Merge branch 'trunk' into rnmobile/simplify_image_insertion_flow-redu…
jd-alexander Mar 17, 2021
b12215f
Merge branch 'trunk' into rnmobile/simplify_image_insertion_flow-redu…
jd-alexander Mar 19, 2021
d865c2b
[RNMobile] Refactor simplify media flow redux store changes (#30123)
jd-alexander Mar 31, 2021
3654e91
Merge branch 'trunk' into rnmobile/simplify_image_insertion_flow-redu…
jd-alexander Mar 31, 2021
4135172
added wasBlockJustInserted prop needed after merge with trunk.
jd-alexander Mar 31, 2021
92ee6f0
Merge branch 'trunk' into rnmobile/simplify_image_insertion_flow-redu…
jd-alexander Apr 7, 2021
d22738f
Merge branch 'trunk' into rnmobile/simplify_image_insertion_flow-redu…
jd-alexander Apr 19, 2021
bb98f4c
removed updateSelection from reducer so it's updated at all times.
jd-alexander Apr 19, 2021
1941ae8
Merge branch 'trunk' into rnmobile/simplify_image_insertion_flow-redu…
jd-alexander Apr 20, 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
2 changes: 1 addition & 1 deletion packages/block-editor/src/store/reducer.js
Original file line number Diff line number Diff line change
Expand Up @@ -1738,7 +1738,7 @@ export function highlightedBlock( state, action ) {
export function lastBlockInserted( state = {}, action ) {
switch ( action.type ) {
case 'INSERT_BLOCKS':
if ( ! action.updateSelection || ! action.blocks.length ) {
if ( ! action.blocks.length ) {
return state;
}

Expand Down
26 changes: 0 additions & 26 deletions packages/block-editor/src/store/test/reducer.js
Original file line number Diff line number Diff line change
Expand Up @@ -2960,7 +2960,6 @@ describe( 'state', () => {
source: 'inserter_menu',
},
type: 'INSERT_BLOCKS',
updateSelection: true,
};

const state = lastBlockInserted( {}, action );
Expand All @@ -2981,37 +2980,13 @@ describe( 'state', () => {
source: expectedSource,
},
type: 'INSERT_BLOCKS',
updateSelection: true,
};

const state = lastBlockInserted( {}, action );

expect( state.source ).toBe( expectedSource );
} );

it( 'should return state if last block inserted is called with action INSERT_BLOCKS that is not a updateSelection', () => {
const expectedState = {
clientId: '9db792c6-a25a-495d-adbd-97d56a4c4189',
};

const action = {
blocks: [
{
clientId: '62bfef6e-d5e9-43ba-b7f9-c77cf354141f',
},
],
meta: {
source: 'inserter_menu',
},
type: 'INSERT_BLOCKS',
updateSelection: false,
};

const state = lastBlockInserted( expectedState, action );

expect( state ).toEqual( expectedState );
} );

it( 'should return state if last block inserted is called with action INSERT_BLOCKS and block list is empty', () => {
const expectedState = {
clientId: '9db792c6-a25a-495d-adbd-97d56a4c4189',
Expand All @@ -3023,7 +2998,6 @@ describe( 'state', () => {
source: 'inserter_menu',
},
type: 'INSERT_BLOCKS',
updateSelection: true,
};

const state = lastBlockInserted( expectedState, action );
Expand Down
13 changes: 11 additions & 2 deletions packages/react-native-editor/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,17 @@ For each user feature we should also add a importance categorization label to i
-->

## Unreleased
* [**] The media upload options of the Image, Video and Gallery block automatically opens when the respective block is inserted. [#29546]
* [*] Image block: Improve text entry for long alt text. [#29670]
- [**] The media upload options of the Image, Video and Gallery block automatically opens when the respective block is inserted. [#29546]
- [*] Image block: Improve text entry for long alt text. [#29670]

## 1.50.0

jd-alexander marked this conversation as resolved.
Show resolved Hide resolved
## 1.50.1

- [x] Truncate rangecell screenreader decimals] [#30678]
- [x] Fix Quote block citation [#30548]
- [xx] Fix crash from non-adjustable unit RangeCell a11y activation [#30636]
- [xx] Fix Unsupported Block Editor on Android [#30650]

## 1.50.0

Expand Down