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

Block Directory: Try/block directory inline error msgs. #19589

Closed
Show file tree
Hide file tree
Changes from 9 commits
Commits
Show all changes
245 commits
Select commit Hold shift + click to select a range
5f2112a
Block Directory: Add tests for install, uninstall and download block …
StevenDufresne Dec 27, 2019
8b12043
Add in the ability to set error notices into the state.
StevenDufresne Jan 8, 2020
3217e52
Add a notice component that should show errors inline. Also add a loa…
StevenDufresne Jan 9, 2020
2f3b81b
Separate the installAndDownload function so we can make a download on…
StevenDufresne Jan 9, 2020
f977e18
Update install tests because of new install triggers. Remove uninstal…
StevenDufresne Jan 9, 2020
78af7c3
Add some tests for the block items that are affected by the change.
StevenDufresne Jan 10, 2020
835af58
Remove a commented out component from test.
StevenDufresne Jan 10, 2020
2377468
Update the block notice to fix an issue with the full install callbac…
StevenDufresne Jan 13, 2020
2da9406
Remove empty new line added.
StevenDufresne Jan 13, 2020
701c277
Packages: Mark build-styles as side-effectful (#19535)
sirreal Jan 13, 2020
0f2ec15
[RNMobile] Refactor Caption component (#19118)
Jan 13, 2020
2380f2d
RichText: don't set focus when applying format (#19536)
ellatrix Jan 13, 2020
6e42279
Fix the height of the tags tokens (#19592)
youknowriad Jan 13, 2020
c3f7820
Block: split out toolbar rendering (#19564)
ellatrix Jan 13, 2020
ce2fce1
Update changelogs
gziolo Jan 13, 2020
b6ff6e9
chore(release): publish
gziolo Jan 13, 2020
e7342de
Adds a "(no title)" label to links to pages or posts with no title (#…
draganescu Jan 13, 2020
06782e1
Block: reposition tabbable inserter (#19596)
ellatrix Jan 13, 2020
5e2ac97
Block Library: Add a Post Excerpt block. (#19579)
epiqueras Jan 13, 2020
8d1afc9
Components: Add isFocusable state to Button (#19337)
diegohaz Jan 13, 2020
4aad528
[RNMobile] Fix media upload placeholder (#19497)
cameronvoell Jan 13, 2020
adf6735
RNMobile: Consolidate logic hiding blocks from release builds to one …
mchowning Jan 13, 2020
4a3ac85
Remove onSelectURL (#19606)
Soean Jan 14, 2020
67db0c6
Adds media replace flow to the cover block (#19583)
draganescu Jan 14, 2020
d89119d
Fix Navigable Container component usage code (#19615)
ediamin Jan 14, 2020
5338c47
Block: try merging effects (#19617)
ellatrix Jan 14, 2020
4ecf279
Editor keyboard shortcuts: fix Toggle Sidebar (#19605)
mcsf Jan 14, 2020
8f7d582
Fix focus capture (#19621)
ellatrix Jan 14, 2020
218b07f
Chore: Update package-lock.json file with the version generated by th…
gziolo Jan 14, 2020
adaae10
[RNMobile] Merge mobile release v1.20.0 back into master (step 2) (#1…
Tug Jan 14, 2020
952e057
Block: clean up after control removal (#19618)
ellatrix Jan 14, 2020
6118c92
Block Library: Add a Post Author block. (#19576)
epiqueras Jan 14, 2020
c55475f
Chore: Remove group block test code merged by mistake (#19640)
jorgefilipecosta Jan 14, 2020
b55605e
Top toolbar: adjust tab order (#19623)
ellatrix Jan 14, 2020
1c84ee8
Regions: position publish region after sidebar (#19427)
ellatrix Jan 14, 2020
c411b37
Block toolbar: fix hasMovers (#19619)
ellatrix Jan 14, 2020
eeb13f4
Block Library: Add a Post Date block. (#19578)
epiqueras Jan 14, 2020
119fa4f
Remove Popover from LinkControl component (#19638)
youknowriad Jan 14, 2020
99d38df
Chore: Skip intermittent end to end test on the button block (#19653)
jorgefilipecosta Jan 14, 2020
3870d07
Fix small visual select glitch (#19590)
youknowriad Jan 15, 2020
bff61b8
Prevent space being reserved for scrollbar when items fit popover (#1…
frontdevde Jan 15, 2020
a7db562
Page template previews (#19106)
koke Jan 15, 2020
b448074
Nav Block - show recent pages as default suggestions when creating Na…
getdave Jan 15, 2020
a14b498
Update to use new prop on LinkControl (#19667)
getdave Jan 15, 2020
b5c9419
Use noop for focus command on format edit. (#19668)
SergioEstevao Jan 15, 2020
8175deb
Add warning package (#19317)
diegohaz Jan 15, 2020
d971daf
Chore: Update downshift depdendency (#19661)
gziolo Jan 15, 2020
83c2ea6
Components: Fixed Color Picker Format Toggle placement (#19607)
jeryj Jan 15, 2020
c4b2590
Wrap color palette in fieldset with label inside of a legend (#19546)
jeryj Jan 15, 2020
931746b
[RNMobile] Shortcode block support (#19534)
chipsnyder Jan 15, 2020
c53b94d
LinkControl - adds search results label for initial suggestions (#19665)
getdave Jan 15, 2020
05bded0
Add supports html: false attribute to new website blocks. (#19646)
Soean Jan 15, 2020
31396e6
Post-Author: Move HTML tags outside of the translatable string (#19675)
chriskmnds Jan 15, 2020
3ccc77f
Docs: Fix typo block-filters.md (#19684)
Jan 15, 2020
17e5c2d
Block: remove inner div wrapper (#19593)
ellatrix Jan 15, 2020
ec6ea4c
Fix Navigation Link url escaping (#19679)
Addison-Stavlo Jan 15, 2020
e8fcacc
navigation: be able to set background color (#19108)
retrofox Jan 15, 2020
117d9f8
Add support for align wide to deprecated versions of gallery block (#…
talldan Jan 16, 2020
e446495
Block Directory: Change 'update' icon to text to be more communicativ…
StevenDufresne Jan 16, 2020
9441727
redux-routine: Improve isGenerator compat (#19666)
sirreal Jan 16, 2020
fd1a18a
[Mobile] Fix SelectControl to display label instead of value (#19547)
mkevins Jan 16, 2020
e08720a
Breadcrumb: add accessibility label (#19597)
ellatrix Jan 16, 2020
2057349
Add script to automatically update core packages (#19448)
jorgefilipecosta Jan 16, 2020
3bb8837
Storybook: Update to latest 5.3 (#19599)
Jan 16, 2020
e33a49f
Edit Site: Add template loading. (#19081)
epiqueras Jan 16, 2020
a900dc4
Multi block selection: fix tabbing (#19700)
ellatrix Jan 16, 2020
6770a0b
Remove draggable from all navigation-link blocks (#19648)
jeryj Jan 16, 2020
af81f90
Omit the onKeyDown prop from the NavigableContainer DOM element (#19695)
TimothyBJacobs Jan 16, 2020
dbe6466
Add storybook for Panel component (#18541)
mkaz Jan 16, 2020
80e1a5a
Block Editor: Flatten LinkControl components by mocking useSelect for…
aduth Jan 16, 2020
434f32f
RNMobile: Remove unneeded/duplicate css (#18759)
mchowning Jan 16, 2020
8e7e67b
Priority Queue: Invoke callback when flushing queue (#19282)
aduth Jan 16, 2020
9c5c691
Check for existing of avatar_urls array before trying to return the a…
glendaviesnz Jan 16, 2020
669549a
docgen: Omit unknown type tag from Markdown format output (#19571)
aduth Jan 16, 2020
dc68df3
Navigation: Do not output navigation links with empty labels (#19652)
jeryj Jan 16, 2020
247d383
Document packages-update wp-scripts command. (#19711)
jorgefilipecosta Jan 16, 2020
24b95e0
Update block-filters.md (#19595)
shaikhaezaz80 Jan 17, 2020
e8d9d90
Array type attribute source query comma missing (#19717)
mavinothkumar Jan 17, 2020
eaf6937
Add lint-md section to scripts readme (#19716)
mkaz Jan 17, 2020
b426964
Remove: Gradient Picker from cover block placeholder (#19712)
jorgefilipecosta Jan 17, 2020
a3a2f7b
Components: replace console.warn with @wordpress/warning (#19687)
diegohaz Jan 17, 2020
84f530f
Replace, on editing a navigation link, the current label with the tit…
draganescu Jan 17, 2020
df01dbe
Block Editor: Make initial inner blocks non-dirtying. (#19521)
epiqueras Jan 17, 2020
e8479aa
Sibling inserter: fix dead zone between blocks (#19719)
ellatrix Jan 17, 2020
9efa957
Block Editor: Remove non-public fetchSearchSuggestions from LinkContr…
aduth Jan 17, 2020
aac5dcc
Writing Flow: fix list selection (#19721)
ellatrix Jan 17, 2020
c8a1eef
Multi select: set focus back after attempt (#19720)
ellatrix Jan 17, 2020
cf9742c
DOM: Mark stripHTML as unstable (#19725)
aduth Jan 17, 2020
eb25c39
Update function to user object function notation.
StevenDufresne Jan 20, 2020
d21f46d
Don't render an empty ul if there are no items.
StevenDufresne Jan 20, 2020
be884ce
Remove empty comment lines.
StevenDufresne Jan 20, 2020
40eb35e
Make some updates to test to make them easier to read.
StevenDufresne Jan 20, 2020
bd954fa
Change object.assign to spread operator for legibility.
StevenDufresne Jan 20, 2020
e3555bb
Update the set install state action to match conventions in gutenberg.
StevenDufresne Jan 20, 2020
49a15c7
Fix more block styles fixes #8750 (#19745)
miminari Jan 20, 2020
c1e7575
Sibling inserter click redirect: add e2e tests (#19729)
ellatrix Jan 20, 2020
8af69dd
Block: fix alignments (#19704)
ellatrix Jan 20, 2020
722f7d7
[RNMobile] Correct navigation toolbar (#19560)
lukewalczak Jan 20, 2020
6484d9b
[RNMobile] Create drafts from template previews (#19398)
Jan 20, 2020
e40ceaf
Add max-height to CustomSelectControl menu (#19753)
Aljullu Jan 20, 2020
d9c6e65
Bump plugin version to 7.3.0-rc.1
ellatrix Jan 20, 2020
6d396c0
Block Editor: Link Control: Initialize inputValue state from value (#…
aduth Jan 20, 2020
a016b31
Block Editor: LinkControl: Align documentation with current behavior …
aduth Jan 20, 2020
49cd963
Block Editor: Link Control: Use URL as link when title empty (#19739)
aduth Jan 20, 2020
ee6cc56
[RNMobile] Fix image preview with small image size selected (#19247)
etoledom Jan 20, 2020
d4b7692
Use Select: Fix render queue. (#19286)
epiqueras Jan 20, 2020
e654dce
Project Management: Run pull request automation on closed (#19742)
aduth Jan 20, 2020
5ba3976
Try/group block custom text color (#19181)
glendaviesnz Jan 20, 2020
80824d7
Block Editor: Handle LinkControl submission via form handler (#19651)
aduth Jan 20, 2020
1ffedef
Added conditions and new translation strings for BlockMover (#19757)
momotofu Jan 21, 2020
9788231
Storybook: Add Placeholder component story (#19734)
mkaz Jan 21, 2020
98213cb
Make sure user's cannot click the button multiple times.
StevenDufresne Jan 21, 2020
942c262
Project Management: Fix pull request merge automation errors (#19768)
aduth Jan 21, 2020
0be6b14
Update the copy for the error messages. We should cycle back to add m…
StevenDufresne Jan 21, 2020
d21ec71
Move the notice component so its a child of the list item as opposed …
StevenDufresne Jan 21, 2020
056dd36
Add post requests documentation for apiFetch (#19759)
momotofu Jan 21, 2020
f6c90ed
Multi-select: don't focus first selected block (#19762)
ellatrix Jan 21, 2020
d6487f3
Update: Readme.txt Link to changelog instead of adding it inline(#19761)
jorgefilipecosta Jan 21, 2020
aad7459
Fix: Media & Text: "Crop image to fill entire column" reset on image …
jorgefilipecosta Jan 21, 2020
cd309db
Build: Include JSON files in zip archive (#19772)
ockham Jan 21, 2020
24c0e60
Makes appenders visible only for the current selection (#19598)
draganescu Jan 21, 2020
26062c8
Core-data: do not publish outdated state to subscribers during update…
alshakero Jan 21, 2020
7d59200
Add WordPress primitives package (#19781)
youknowriad Jan 21, 2020
c22b77c
navigation-link: set page id in the attrs (#18641)
retrofox Jan 21, 2020
b39e9d9
Project management: Add step that updates CHANGELOG files before npm …
gziolo Jan 21, 2020
b77d71a
Navigation Block: Add submenu chevron w/ setting (#19601)
WunderBart Jan 21, 2020
567cdb9
Embed: Fix failure placeholder alignment/sizing (#19673)
Jan 21, 2020
76304dd
Fix card component sub-component example code (#19802)
ediamin Jan 22, 2020
46fcca7
Introduce the Icons package (#17055)
senadir Jan 22, 2020
1f3ea11
Expose @wordpress/icons to react-native (#19810)
koke Jan 22, 2020
59ed771
Block popover: allow scrolling over (#19769)
ellatrix Jan 22, 2020
938fb55
Multi select: keep selection after move (#19784)
ellatrix Jan 22, 2020
2db504d
Bump plugin version to 7.3.0
ellatrix Jan 22, 2020
c079120
Navigation: Select parent navigation block on handleCreateFromExistin…
jeryj Jan 22, 2020
5a8eda1
Paragraph block: remove dead CSS (#19821)
ellatrix Jan 23, 2020
8acb023
Bundle the icons package instead of using it as an external (#19809)
youknowriad Jan 23, 2020
8f92cfe
Move a dozen of block icons to the icons package (#19808)
youknowriad Jan 23, 2020
6a1ea3c
Chore: Improve package-lock.json configuration
gziolo Jan 23, 2020
373d79a
Add mkevins and pinarol as code owners for gallery block (#19829)
mkevins Jan 23, 2020
0de9e37
Added shippedProposals (#19065)
abdel-h Jan 23, 2020
4ae2c15
Rich text: remove is-selected class (#19822)
ellatrix Jan 23, 2020
26b8015
Move more block SVGs to the icons package (#19834)
youknowriad Jan 23, 2020
89c2b44
Block: use context to provide selected element (#19782)
ellatrix Jan 23, 2020
dcb08f3
Popover: clean up requestAnimationFrame (#19771)
ellatrix Jan 23, 2020
e18e0a0
Update: Removed editor store usage from native mobile block ed… (#18794)
jorgefilipecosta Jan 23, 2020
7704da0
Navigation: Manage navigation link appender visibility based on curre…
jeryj Jan 23, 2020
681a297
Remove editor dependency from the block library (#16160)
jorgefilipecosta Jan 23, 2020
6d035d3
Add AnglePicker Component; Add useDragging hook (#19637)
jorgefilipecosta Jan 23, 2020
f5cdfca
Testing: Use deterministic selectors for incremented IDs (#19844)
aduth Jan 23, 2020
5275570
Innerblock Templates Docs Link Typo Issue Fixed (#19813)
delowardev Jan 23, 2020
17ef62d
Rich text: enable if multi selection is aborted (#19839)
ellatrix Jan 24, 2020
4cd1492
Block Directory: Refactor the reducer by breaking out the block manag…
StevenDufresne Jan 24, 2020
167d4d1
Fix panel header styles (#19842)
adekbadek Jan 24, 2020
b9b1818
Move more block icons to the icons package (#19838)
youknowriad Jan 24, 2020
d2576aa
Bump @babel/preset-env to 7.8.3 (Optional Chaining!) (#19831)
sainthkh Jan 24, 2020
21936b5
Style improvements for template previews (#19763)
koke Jan 24, 2020
605ee4d
[RNMobile] Release v1.21.0 to master (#19854)
etoledom Jan 24, 2020
bc57547
Packages: New create-block package for block scaffolding (#19773)
gziolo Jan 24, 2020
0470286
Pass the prop for selection color. (#19635)
SergioEstevao Jan 24, 2020
282687b
Do not use the deprecated package editor for InnerBlocks component (#…
Mahjouba91 Jan 24, 2020
f6eb4ec
Remove dead is-hovered selectors (#19870)
ellatrix Jan 24, 2020
23493b7
Move is-navigate-mode class to WritingFlow (#19868)
ellatrix Jan 24, 2020
361d2df
[RNmobile] Upgrade to RN 0.61.5 (#19369)
hypest Jan 24, 2020
b3b92f3
Update README.md (#19876)
mkaz Jan 25, 2020
9a364c9
Multi selection: fix intermittent e2e failure (#19865)
ellatrix Jan 25, 2020
b42cde3
Move more block icons to the icons library (#19862)
youknowriad Jan 27, 2020
1fb3c38
Paragraph block: remove min-height (#19835)
ellatrix Jan 27, 2020
e0958d7
Framework: Fix server-registered fixtures script (#19884)
aduth Jan 27, 2020
85ffc72
Shortcode Design Review (#19852)
chipsnyder Jan 27, 2020
288f8df
Update component to components in CONTRIBUTING.md (#19914)
diegohaz Jan 27, 2020
a45df0e
Apply sentence case formatting to PanelBody titles (#19901)
richtabor Jan 27, 2020
64767db
Clarify when isEligible function is called (#19899)
bfintal Jan 27, 2020
c1266a7
Block Editor: Refactor ObserveTyping as function component (#19881)
aduth Jan 27, 2020
9e3c713
Remove unnecessary import from playground (#19893)
costasovo Jan 27, 2020
ba2495f
Documentation: Organize Contributors Guide (#19853)
mkaz Jan 27, 2020
08182bf
[RNMobile] Correct isMobile condition in nested Media&Text (#19778)
lukewalczak Jan 28, 2020
bc38a3d
Blocks: Match blocks in the inserter using keywords from patterns (#1…
gziolo Jan 28, 2020
c49b051
Block editor: Alt+F10 shouldn't scroll to top (#19896)
ellatrix Jan 28, 2020
f6470e6
Multi-selection: fix clearing with side click (#19787)
ellatrix Jan 28, 2020
17f6eae
[RNMobile] fix show appender and separator in Group block (#19908)
jbinda Jan 28, 2020
a911562
Add docs for LocalAutosaveMonitor and __experimentalUpdateLocalAutosa…
mcsf Jan 28, 2020
a38b633
[RNMobile] Add media edit icon to image block (#19723)
leandroalonso Jan 28, 2020
6f97e52
Block Library: Handle Popover onClose for LinkControl (#19885)
aduth Jan 28, 2020
6aa04e8
Disable Autocomplete in shortcode block (#19848)
chipsnyder Jan 28, 2020
1d6895d
RichText API: Limit `prefix` transformations to Paragraph (#19727)
mcsf Jan 28, 2020
4c1ef94
Block Editor: LinkControl: Resolve error when undefined value, "view"…
aduth Jan 28, 2020
a394c9f
[RNMobile] Revert change to fix Action Sheet (#19934)
leandroalonso Jan 28, 2020
e64c554
Add background color support to Columns block (#17813)
richtabor Jan 28, 2020
8c3bd8e
Fix RTL styling for Media Text block (#18764)
richtabor Jan 28, 2020
6987e37
change order of composing style in svg primitive (#19927)
jbinda Jan 29, 2020
c2eece7
Add Prettier formatting script (#18048)
jsnajdr Jan 29, 2020
167bd70
Components: FontSizePicker: Adjust Select Button sizing (#19479)
Jan 29, 2020
b4efa12
Documentation: fix typo "Th" to "The" (#19833)
nekomajin Jan 29, 2020
5cb2727
[RNMobile] Long-press on inserter to show options for "add above" and…
ceyhun Jan 29, 2020
6c8d945
Docs: Add details for format-js to @wordpress/scripts package (#19946)
gziolo Jan 29, 2020
0bda7c4
Fix: Crash when creating a hierarchical post without title (#19936)
jorgefilipecosta Jan 29, 2020
7c32ac9
Fix: Color Gradients component was not able to handle only gra… (#19925)
jorgefilipecosta Jan 29, 2020
ea705dd
Add markdownlint script to lint docs markup (#19855)
mkaz Jan 30, 2020
d17bd4b
Use require.resolve() instead of <rootDir> in @wordpress/jest-preset-…
jameslnewell Jan 30, 2020
5832c30
added changelog entry (#19958)
jameslnewell Jan 30, 2020
06f02c9
Move the insert dashicon to the icons package (#19943)
youknowriad Jan 30, 2020
8497112
Replace all occurences of the yes dashicon with the check icon from t…
youknowriad Jan 30, 2020
e46d52d
Build: Include block.json files in the build output (#19786)
gziolo Jan 30, 2020
d66d53b
Block Editor: LinkControl: Prevent focus loss in edit mode toggle (#1…
aduth Jan 30, 2020
cfa9a97
Move Alignment, movers and trash icons to the icons package (#19944)
youknowriad Jan 30, 2020
c804524
Navigation Block: Move the link description panel below the SEO panel…
apeatling Jan 31, 2020
56d866f
Update hover and focus selectors for Move to Trash to ensure they're …
andrewserong Jan 31, 2020
be05701
Create block: Code quality improvements for the block scaffolding (#1…
gziolo Jan 31, 2020
1b5461c
Code quality: Enable linting for JS files starting with .
gziolo Jan 31, 2020
0194925
Popover: fix typo in removing event listener (#19978)
ellatrix Jan 31, 2020
f63053c
Eslint Plugin: Lint code formatting. (#19963)
epiqueras Jan 31, 2020
63d56f1
[RNMobile] Show the media edit icon only if the block is selected (#1…
leandroalonso Jan 31, 2020
5945e48
Fix: Admin menu collapses for 960px width but editor doesn't (#19970)
jorgefilipecosta Jan 31, 2020
767caac
Chore: Fix differences in package-lock.json file
gziolo Jan 31, 2020
539b1fc
RichText: try using hooks for wrapper component (#19095)
ellatrix Jan 31, 2020
6aa9944
Components: Apply width-based modifier classes to Placeholder only wh…
aduth Jan 31, 2020
4857ad5
Eslint: set line width to 80 (#19992)
ellatrix Jan 31, 2020
fb964cb
Editor: Remove post title escaping (#19955)
aduth Jan 31, 2020
362ab68
Add: Global styles css variables generation mechanism (#19883)
jorgefilipecosta Jan 31, 2020
06bd266
Navigation: Change UX to move focus to navigation link label and clos…
jeryj Jan 31, 2020
d362cb1
Lib: Limit `pre_render_block` extension. (#19989)
epiqueras Feb 1, 2020
80c5239
Fix, update, and sort _rc_ `hasProjectFile` filenames (#19994)
ntwb Feb 2, 2020
b6d8712
Docs: Include CHANGELOG entries from the relocated create-wordpress-b…
gziolo Feb 2, 2020
feed14a
Blocks: Rename patterns to variations in the Block API (#19966)
gziolo Feb 2, 2020
8f867e3
Block Directory: Add tests for install, uninstall and download block …
StevenDufresne Dec 27, 2019
a2b6b3a
Add in the ability to set error notices into the state.
StevenDufresne Jan 8, 2020
85890a1
Add a notice component that should show errors inline. Also add a loa…
StevenDufresne Jan 9, 2020
0cabebb
Separate the installAndDownload function so we can make a download on…
StevenDufresne Jan 9, 2020
3e4e6b6
Update install tests because of new install triggers. Remove uninstal…
StevenDufresne Jan 9, 2020
aeed523
Add some tests for the block items that are affected by the change.
StevenDufresne Jan 10, 2020
ccb0e99
Remove a commented out component from test.
StevenDufresne Jan 10, 2020
befc99f
Update the block notice to fix an issue with the full install callbac…
StevenDufresne Jan 13, 2020
94c6a79
Remove empty new line added.
StevenDufresne Jan 13, 2020
ba9390a
Update function to user object function notation.
StevenDufresne Jan 20, 2020
d07b5d0
Don't render an empty ul if there are no items.
StevenDufresne Jan 20, 2020
6ae6c34
Remove empty comment lines.
StevenDufresne Jan 20, 2020
442399a
Make some updates to test to make them easier to read.
StevenDufresne Jan 20, 2020
7642c58
Change object.assign to spread operator for legibility.
StevenDufresne Jan 20, 2020
4b5c634
Update the set install state action to match conventions in gutenberg.
StevenDufresne Jan 20, 2020
2759e4b
Make sure user's cannot click the button multiple times.
StevenDufresne Jan 21, 2020
dddbfdf
Update the copy for the error messages. We should cycle back to add m…
StevenDufresne Jan 21, 2020
b43763a
Move the notice component so its a child of the list item as opposed …
StevenDufresne Jan 21, 2020
f1b19fb
Fixed some mistakes introduced in rebase.
StevenDufresne Feb 3, 2020
10254d8
Run the new formatter and update the code.
StevenDufresne Feb 3, 2020
748fdc3
Merge in upstream after rebase.
StevenDufresne Feb 3, 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 @@ -10,7 +10,7 @@ import { __, sprintf } from '@wordpress/i18n';
import { BlockIcon } from '@wordpress/block-editor';
import BlockRatings from '../block-ratings';

function DownloadableBlockHeader( { icon, title, rating, ratingCount, onClick } ) {
function DownloadableBlockHeader( { icon, title, rating, ratingCount, isLoading, onClick } ) {
return (
<div className="block-directory-downloadable-block-header__row">
{
Expand All @@ -30,12 +30,13 @@ function DownloadableBlockHeader( { icon, title, rating, ratingCount, onClick }
</div>
<Button
isDefault
isBusy={ isLoading }
onClick={ ( event ) => {
event.preventDefault();
onClick();
} }
>
{ __( 'Add block' ) }
{ isLoading ? __( 'Adding…' ) : __( 'Add block' ) }
</Button>
</div>
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,19 @@ import { shallow } from 'enzyme';
* WordPress dependencies
*/
import { BlockIcon } from '@wordpress/block-editor';
import { Button } from '@wordpress/components';

/**
* Internal dependencies
*/
import DownloadableBlockHeader from '../index';
import { pluginWithImg, pluginWithIcon } from './fixtures';

const getContainer = ( { icon, title, rating, ratingCount } ) => {
const getContainer = ( { icon, title, rating, ratingCount }, onClick = jest.fn() ) => {
return shallow(
<DownloadableBlockHeader
icon={ icon }
onClick={ () => {} }
onClick={ onClick }
title={ title }
rating={ rating }
ratingCount={ ratingCount }
Expand All @@ -45,4 +46,16 @@ describe( 'DownloadableBlockHeader', () => {
expect( wrapper.find( BlockIcon ) ).toHaveLength( 1 );
} );
} );

describe( 'user interaction', () => {
test( 'should trigger the onClick function', () => {
const onClickMock = jest.fn();
const wrapper = getContainer( pluginWithIcon, onClickMock );
const event = {
preventDefault() {},
};
wrapper.find( Button ).simulate( 'click', event );
expect( onClickMock.mock.calls.length ).toBe( 1 );
StevenDufresne marked this conversation as resolved.
Show resolved Hide resolved
} );
} );
} );
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ import DownloadableBlockInfo from '../downloadable-block-info';
function DownloadableBlockListItem( {
item,
onClick,
isLoading,
notice,
} ) {
const {
icon,
Expand All @@ -32,9 +34,11 @@ function DownloadableBlockListItem( {
title={ title }
rating={ rating }
ratingCount={ ratingCount }
isLoading={ isLoading }
/>
</header>
<section className="block-directory-downloadable-block-list-item__body">
{ notice }
<DownloadableBlockInfo
activeInstalls={ activeInstalls }
description={ description }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,13 @@
.block-directory-downloadable-block-list-item__header {
display: flex;
flex-direction: column;
padding: 12px 12px 0;
padding: 12px;
}

.block-directory-downloadable-block-list-item__body {
display: flex;
flex-direction: column;
padding: 12px;
padding: 0 12px 12px;
}

.block-directory-downloadable-block-list-item__footer {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
export const plugin = {
name: 'boxer/boxer',
title: 'Boxer',
description: 'Boxer is a Block that puts your WordPress posts into boxes on a page.',
id: 'boxer-block',
icon: 'block-default',
rating: 5,
rating_count: 1,
active_installs: 0,
author_block_rating: 5,
author_block_count: '1',
author: 'CK Lee',
assets: [
'http://plugins.svn.wordpress.org/boxer-block/trunk/build/index.js',
'http://plugins.svn.wordpress.org/boxer-block/trunk/build/view.js',
],
humanized_updated: '3 months ago',
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
/**
* External dependencies
*/
import { shallow } from 'enzyme';

/**
* Internal dependencies
*/
import DownloadableBlockListItem from '../index';
import DownloadableBlockHeader from '../../downloadable-block-header';
import DownloadableBlockInfo from '../../downloadable-block-info';
import DownloadableBlockAuthorInfo from '../../downloadable-block-author-info';
import { plugin } from './fixtures';

const getContainer = ( item, onClick = jest.fn(), isLoading = false ) => {
return shallow(
<DownloadableBlockListItem
key={ item.id }
item={ item }
onClick={ onClick }
onFocus={ jest.fn() }
onMouseEnter={ jest.fn() }
onMouseLeave={ jest.fn() }
onBlur={ jest.fn() }
isLoading={ isLoading }
/>
);
};

describe( 'DownloadableBlockListItem', () => {
describe( 'Rendering', () => {
it( 'Should render the base components', () => {
const wrapper = getContainer( plugin, false );
expect( wrapper.find( DownloadableBlockHeader ).length ).toBe( 1 );
expect( wrapper.find( DownloadableBlockInfo ).length ).toBe( 1 );
expect( wrapper.find( DownloadableBlockAuthorInfo ).length ).toBe( 1 );
} );
StevenDufresne marked this conversation as resolved.
Show resolved Hide resolved
} );
} );
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
/**
* WordPress dependencies
*/
import { Notice, Button } from '@wordpress/components';
import { __ } from '@wordpress/i18n';

/**
* Internal dependencies
*/
import { DOWNLOAD_ERROR_NOTICE_ID } from '../../store/constants';

const DownloadableBlockNotice = ( { block, errorNotices, fullInstall, download } ) => {
if ( ! errorNotices[ block.id ] ) {
return null;
}

// A Failed install is the default error as its the first step
let copy = __( 'Block previews can\'t install.' );
let callback = fullInstall;

if ( errorNotices[ block.id ] === DOWNLOAD_ERROR_NOTICE_ID ) {
copy = __( 'Block previews can\'t load.' );
callback = download;
}

return (
<Notice status="error" isDismissible={ false } className="block-directory-downloadable-blocks-notice">
<span className="block-directory-downloadable-blocks-notice-content">
{ copy }
</span>
<Button isSmall isPrimary onClick={ () => {
callback( block );
} }>
{ __( 'Retry' ) }
</Button>
</Notice>
);
};

export default DownloadableBlockNotice;
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
.block-directory-downloadable-blocks-notice {
margin: 0;
}

.block-directory-downloadable-blocks-notice-content {
padding-right: 12px;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
export const plugin = {
id: 'boxer-block',
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
/**
* External dependencies
*/
import { shallow } from 'enzyme';

/**
* WordPress dependencies
*/
import { Button } from '@wordpress/components';

/**
* Internal dependencies
*/
import DownloadableBlockNotice from '../index';
import { plugin } from './fixtures';

import { DOWNLOAD_ERROR_NOTICE_ID, INSTALL_ERROR_NOTICE_ID } from '../../../store/constants';

const getContainer = ( { block, fullInstall = jest.fn(), download = jest.fn(), errorNotices = {} } ) => {
return shallow(
<DownloadableBlockNotice
block={ block }
fullInstall={ fullInstall }
download={ download }
errorNotices={ errorNotices }
/>
);
};

describe( 'DownloadableBlockNotice', () => {
StevenDufresne marked this conversation as resolved.
Show resolved Hide resolved
describe( 'Rendering', () => {
it( 'should return null when there are no error notices', () => {
const wrapper = getContainer( { block: plugin } );
expect( wrapper.type() ).toEqual( null );
StevenDufresne marked this conversation as resolved.
Show resolved Hide resolved
} );

it( 'should return something when there are error notices', () => {
const errorNotices = {
[ plugin.id ]: INSTALL_ERROR_NOTICE_ID,
};
const wrapper = getContainer( { block: plugin, errorNotices } );
expect( wrapper.length ).toBeGreaterThan( 0 );
} );
} );

describe( 'Behavior', () => {
it( 'should try the full install when the install failed', () => {
const errorNotices = {
[ plugin.id ]: INSTALL_ERROR_NOTICE_ID,
};

const fullInstall = jest.fn();
const download = jest.fn();

const wrapper = getContainer( { block: plugin, fullInstall, download, errorNotices } );

wrapper.find( Button ).simulate( 'click', { event: {} } );

expect( fullInstall.mock.calls.length ).toBe( 1 );
expect( download.mock.calls.length ).toBe( 0 );
StevenDufresne marked this conversation as resolved.
Show resolved Hide resolved
} );

it( 'should try to download again if it installed but failed to download', () => {
const errorNotices = {
[ plugin.id ]: DOWNLOAD_ERROR_NOTICE_ID,
};

const fullInstall = jest.fn();
const download = jest.fn();

const wrapper = getContainer( { block: plugin, fullInstall, download, errorNotices } );

wrapper.find( Button ).simulate( 'click', { event: {} } );

expect( fullInstall.mock.calls.length ).toBe( 0 );
expect( download.mock.calls.length ).toBe( 1 );
} );
} );
} );
Loading