-
Notifications
You must be signed in to change notification settings - Fork 283
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
Mgt-get and Template improvements #252
Conversation
…they have been defined
…pression. Fixed bug in template where additional context was not passed for data for
…pression. Fixed bug in template where additional context was not passed for data for
This is a pretty big PR. It'll take some time to go through the code and test all the features you added. In the future, I'd love to see smaller PRs for individual features so we can review them separately, as well as clear testing instructions for each. |
Agree, this would have been easier it was two separate PRs. Luckily, most of the code in the PR is sample code |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@nmetulev thanks for walking me through the account creation and permissions setup. The flow you described makes more sense to me now. Please document this in the future to make it easier for other members of the team to quickly and easily provide feedback on the code and approach, without fighting with environment and configuration issues.
I'm not entirely sure what your expectations are for the views, but I see content in all of them, so I'll assume that means passing. Perhaps adding a comment header to each sample would bring clarity on its purpose and expected functionality.
Test results:
- ✔ mgt-get/email
- ✔ mgt-get/grouping-email
- ✔ mgt-get/presence
- ✔ mgt-get/teams
- ❌ agenda-template - See comment for details
- ✔ templates
The rest of the code looks good, but I don't have any real way to tell what changes correlate to which feature. Please be more granular with PRs in the future.
Thanks @shweaver-MSFT. I've moved most samples to storybook so now it should be easier to test and validate. Could you take a look again and make sure you are not running into any issues still? I didn't move two samples ( @beth-panx, FYI, I moved some of the other stories to the templates story just to keep all the templating stories in the same place |
Documentation added here: https://github.com/microsoftgraph/microsoft-graph-docs/commit/35096f5da1758f5e75907f15306db95eea7eb869 under the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good :) Love the storybook additions
* added support for polling in mgt-get, events support in templates * Added refresh() and polling-rate now works for any api * relaxed requirements for {{}} and converters * mgt get now can render both default and value templates in the order they have been defined * fixed bad merge resolution * fixed bug in template where square brackets were not recognized in expression. Fixed bug in template where additional context was not passed for data for * fixed bug in template where square brackets were not recognized in expression. Fixed bug in template where additional context was not passed for data for * added data-props support and removed @event support * formatting * adding get stories * updated get stories * moved template sample to template story Co-authored-by: Nicolas Vogt <nicolasjvogt@gmail.com>
* added support for polling in mgt-get, events support in templates * Added refresh() and polling-rate now works for any api * relaxed requirements for {{}} and converters * mgt get now can render both default and value templates in the order they have been defined * fixed bad merge resolution * fixed bug in template where square brackets were not recognized in expression. Fixed bug in template where additional context was not passed for data for * fixed bug in template where square brackets were not recognized in expression. Fixed bug in template where additional context was not passed for data for * added data-props support and removed @event support * formatting * adding get stories * updated get stories * moved template sample to template story Co-authored-by: Nicolas Vogt <nicolasjvogt@gmail.com>
* added support for polling in mgt-get, events support in templates * Added refresh() and polling-rate now works for any api * relaxed requirements for {{}} and converters * mgt get now can render both default and value templates in the order they have been defined * fixed bad merge resolution * fixed bug in template where square brackets were not recognized in expression. Fixed bug in template where additional context was not passed for data for * fixed bug in template where square brackets were not recognized in expression. Fixed bug in template where additional context was not passed for data for * added data-props support and removed @event support * formatting * adding get stories * updated get stories * moved template sample to template story Co-authored-by: Nicolas Vogt <nicolasjvogt@gmail.com>
PR Type
Description of the changes
This PR introduces new features for both the
mgt-get
component and our templating implementation. These changes improve the prototyping experience for building UI with the graph.mgt-get
Added the
polling-rate
attribute. When set to a number of milliseconds, mgt-get will poll the request uri for updates in the defined interval. If using a resource that supports delta queries, polling will always query the delta api. The ui will only update if the data changes.Added the
refresh()
method to refresh the data manually. By default, the UI will only update if the data changes. Pass true to the method to force the component to update.Added the
value
template. Use the value template instead of thedefault
template when expecting the response from the graph to contain an array of items - such as messages, files, users, etc. Thevalue
template will automatically be repeated for each item in the value array. Thevalue
template will also start rendering the items as soon as they are ready and doesn't have to wait for all the items to load (unlike thedefault
template).Templates
Relaxed the requirements for double or triple curly braces. Now both
{{expression}}
and{{{expression}}}
act the same. In addition, expressions in attributes (such asdata-for
ordata-if
) now work with or without curly braces.Added support for event and property binding in templates.
Where
myEvent
is added as additional context or is passed by the component. Ex:Deprecated
MgtBaseComponent.templateConverters
and added
MgtBaseComponent.templateContext
instead. With support of events in templates,templateContext
better represents the function thantemplateConverters
and it avoids adding yet another propertiy.PR checklist
npm run build
) and changes have been tested in supported browsers (including IE11)npm run setLicense
)Documentation added here: https://github.com/microsoftgraph/microsoft-graph-docs/commit/35096f5da1758f5e75907f15306db95eea7eb869 under the
mgt-1.2
branch