Skip to content

Conversation

@maier49
Copy link
Contributor

@maier49 maier49 commented Jun 23, 2020

Type: bug

The following has been addressed in the PR:

  • There is a related issue
  • All code matches the style guide
  • Unit tests are included in the PR
  • For new widgets, an entry has been added to the .dojorc
  • For new widgets, theme.variant() is added to the root domnode
  • Any widget variant uses theme.compose like this
  • WidgetProperties are exported

Description:
Adds a Resource widget which is intended to be used only as a custom element to wrap widgets that expect a resource. It can be seen in action here wrapping a list component:
https://resource-widget.vercel.app/

The changes to other widgets were needed because when rendering as a custom element the child widget renders once before the parent can edit its properties, which was accessing an undefined object in widgets that use a resource.
Resolves #1481

@vercel
Copy link

vercel bot commented Jun 23, 2020

This pull request is being automatically deployed with Vercel (learn more).
To see the status of your deployment, click below or on the icon next to each commit.

🔍 Inspect: https://vercel.com/dojo/dojowidgets/h1rru3bky
✅ Preview: https://dojowidgets-git-fork-maier49-resource-wrapper.dojo1.vercel.app

@codecov
Copy link

codecov bot commented Jun 23, 2020

Codecov Report

Merging #1494 into master will decrease coverage by 0.13%.
The diff coverage is 62.16%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1494      +/-   ##
==========================================
- Coverage   91.06%   90.93%   -0.14%     
==========================================
  Files          84       85       +1     
  Lines        4242     4278      +36     
  Branches     1145     1153       +8     
==========================================
+ Hits         3863     3890      +27     
- Misses        180      184       +4     
- Partials      199      204       +5     
Impacted Files Coverage Δ
src/chip-typeahead/index.tsx 92.04% <25.00%> (-2.08%) ⬇️
src/list/index.tsx 88.28% <25.00%> (-0.70%) ⬇️
src/select/index.tsx 84.90% <25.00%> (-1.51%) ⬇️
src/typeahead/index.tsx 87.03% <25.00%> (-1.02%) ⬇️
src/resource/index.tsx 90.47% <90.47%> (ø)
src/range-slider/index.tsx 78.35% <0.00%> (+1.75%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 975d975...e04331a. Read the comment docs.

@matt-gadd
Copy link
Contributor

@maier49 this seems a bit intrusive on widget authoring. I couldn't really tell how a user would pass a resource template from html either? is this something we can potentially solve at the framework/element wrapper level without a wrapping widget?

@maier49
Copy link
Contributor Author

maier49 commented Jul 15, 2020

Closing in favor of attempting to resolve this directly in framework
dojo/framework#815

@maier49 maier49 closed this Jul 15, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Resource support for Custom Elements

2 participants