-
Notifications
You must be signed in to change notification settings - Fork 357
Added mgt-taxonomy-picker control #2172
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
Added mgt-taxonomy-picker control #2172
Conversation
todo: storybook and docs
…soft-graph-toolkit into mgt-taxonomy-picker
|
Thank you for creating a Pull Request @anoopt. This is a checklist for the PR reviewer(s) to complete before approving and merging this PR:
|
|
@anoopt thank you for this work on the taxonomy picker component! For Qn1, is your tenant able to show the values for the endpoint in https://aka.ms/ge? The storybook uses the mock endpoint and I have had issues with some endpoints before. Have you tried logging into the storybook with your own tenant? For Qn 2 do you mean you want to give the ability to either render a custom option template or a default one? |
|
Thank you @musale . For Qusetion 1 - Yes, I see results in the Graph Explorer for that endpoint. Sorry, I am not sure how to login to the storybook with my tenant. If I use mgt-login it always uses the mock provider with user as For Question 2 - Yes, if it's possible can provide that ability for users? |
|
For Qn1: Yes the IDs are from the tenant used in most of the sandboxes. I'm not sure about the relevant permissions being granted but I assume that is the case. To login with your tenant in the story book, add the For Qn 2: You totally can do that using custom templates. So instead of: <fluent-option value=${term.id} selected @click=${e => this.handleClick(e, term)}>
${this.renderTemplate('term', { term }, term.id) || term.labels[0].name}
</fluent-option>You do: ${this.renderTemplate('term', { term }, term.id) ||
<fluent-option value=${term.id} selected @click=${e => this.handleClick(e, term)}>
${term.labels[0].name}
</fluent-option>This allows the user to specify their own If that doesn't work for you, you can use CSS to customize the :host {
fluent-option {
&::part(content) {
background: var(--term-option-background-color, var(--neutral-fill-stealth-rest)) // var(--neutral-fill-stealth-rest) is the default background for option
// other customizable options
}
}
}The |
packages/mgt-components/src/components/mgt-taxonomy-picker/mgt-taxonomy-picker.ts
Outdated
Show resolved
Hide resolved
packages/mgt-components/src/components/mgt-taxonomy-picker/strings.ts
Outdated
Show resolved
Hide resolved
|
@anoopt This is awesome work! Thank you so much for this contribution. Regarding the option to customize the rendering of the item in the combobox list, I'd suggest against it. cc: @musale |
|
Thank you @gavinbarron . With the current code I faced the exact issue that you mentioned i.e. selection interactions not working as per the expectation. Is it ok to leave the code as is for now so that when in future templating is supported for |
|
@musale - Can we please grant |
|
@anoopt I think that the way it is now is just fine and if in the future we have a better story for templating those items we can address it then. The items in the second list are using Unicode emojis in their text, not any custom rendering, which looks slick but is still just text. Regarding the scope request, we're working with the team that manages the sandbox tenant to get more scopes consented but it will take a little time to get resolved. |
|
@anoopt could you also add documentation for the component in this repo https://github.com/microsoftgraph/microsoft-graph-docs and target the |
|
@musale - I have submitted a PR for documentation. |
musale
left a comment
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.
LGTM!
Mnickii
left a comment
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.
LGTM!
|
@anoopt FYI, the tenant now supports the TermStore.Read.All scope, so it will be way easier to test for our users! All looks good but I have a request. Can I ask you to update storied based on the tenant data? Then we're all good for merging, it works great! Thanks! We will see if we add data in this tenant to make the stories easier to manage. Thanks! |
|
@sebastienlevert - I have updated the stories accordingly. I will update the docs as well. |
|
This will need to be updated with the current state of next/fluentui in order to pass the CI builds as there was a breaking change in the object definition of MgtTemplatedComponent |
|
@anoopt FYI, this needs an change to MgtTaxonomyPicker as the code cannot compile now due to changes in the target branch: |
|
@gavinbarron - Apologies. I have updated the code. Running |
sebastienlevert
left a comment
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.
LGTM and works great!
gavinbarron
left a comment
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.
Let's ship it! 🚀
|
Hey @anoopt! We are currently reviewing all the components before we go live for the Toolkit and wanted to bring a suggestion. Currently, the control is using Do you think that makes sense to re-use the Please let us know! We'd love to work with you on that one! |
|
Hi @sebastienlevert - Yes I agree with this. In fact that was my first plan when I started working on the mgt-taxonomy-picker. However, the only reason why I did not [
{
"id": "7a1343f9-72ec-4206-8d12-b5ad9f74bec1",
"createdDateTime": "2022-02-21T14:23:40.247Z",
"lastModifiedDateTime": "2022-03-21T12:59:15.217Z",
"labels": [
{
"name": "Bangalore",
"isDefault": true,
"languageTag": "en-US"
}
],
"descriptions": []
},
{
"id": "d2f52bf3-99a3-41a0-9206-4643915e39c3",
"createdDateTime": "2022-02-20T23:59:50.84Z",
"lastModifiedDateTime": "2022-03-01T00:44:13.88Z",
"labels": [
{
"name": "Headquarters",
"isDefault": true,
"languageTag": "en-US"
}
],
"descriptions": []
},
{
"id": "26d0cb04-7f86-4e2b-aecc-f62bafacfeea",
"createdDateTime": "2022-03-29T08:31:07.933Z",
"lastModifiedDateTime": "2022-03-29T08:31:59.827Z",
"labels": [
{
"name": "Lisbon",
"isDefault": true,
"languageTag": "en-US"
}
],
"descriptions": []
},
{
"id": "8765d0db-e56e-45ef-a98c-249c29bd6803",
"createdDateTime": "2022-02-13T01:29:25.1Z",
"lastModifiedDateTime": "2022-03-04T16:35:41.28Z",
"labels": [
{
"name": "London",
"isDefault": true,
"languageTag": "en-US"
}
],
"descriptions": []
}
]So, if this line in Using |
|
Adding @musale @gavinbarron @Mnickii to this thread. How could we support some sort of "nested" access for the picker? Goal is to re-use as much as possible the existing components instead of rebuilding! |
|
Thanks for the context @anoopt that's very helpful. I'll take a look at the eval option. |
|
@gavinbarron how should we treat this for accessibiltiy review and v3? |
|
@sebastienlevert and @gavinbarron - Just for my information, is |
|
In this case, we will be looking at it in 3.1 for the |
|
For the availability in React, we created an issue: #2490 |


PR Type
Feature
Description of the changes
Closes #634
Add
mgt-taxonomy-pickercontrol as #2156 .Questions
mgt-getstory to get term groups and see a 403 forbidden message. Can you please let me know if any configuration needs to be updated in the storybook?renderTemplatefunction to customise the rendering of each option that gets rendered in the dropdown. However, I am not able to achieve that with the committed code. Please see line number 300. Any help here would be appreciated.PR checklist
yarn build) and changes have been tested in at least two supported browsers (Edge + non-Chromium based browser)yarn setLicense)