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

MGT component to get data from term store #634

Closed
anoopt opened this issue Sep 15, 2020 · 8 comments · Fixed by #2172
Closed

MGT component to get data from term store #634

anoopt opened this issue Sep 15, 2020 · 8 comments · Fixed by #2172

Comments

@anoopt
Copy link
Contributor

anoopt commented Sep 15, 2020

Proposal: A new component that displays data from term store using the Microsoft Graph APIs for Taxonomy

Description

A dropdown or a similar control that gets the child terms under a specified termset id and outputs the details (id, name).
There should also be capability to get child terms under a specified term id.

Rationale

The output of this component can be used in tagging data.
Apart from tagging, the output of the component can be used to filter data or display relevant information related to the selected term.

This request is originating from this tweet by Jeremy.

It'd be great to reach out to @metulev about contributing the the Microsoft graph toolkit. Having a web component that can be used not just in spfx but anywhere would be super useful!

— Jeremy (@jthake) August 26, 2020

Preferred Solution

Get the required child terms under a termset and child terms under a term using the Microsoft Graph Taxonomy API.

Either id of a termset or id of a term needs to be supplied to control.

Advise is need on the look and feel please. Maybe something on lines of this GIF.

Additional Context

The SPFx webpart which uses the Microsoft Graph Taxonomy API can be found here.

Apologies if I haven't included any other required information.

@ghost
Copy link

ghost commented Sep 15, 2020

Hello anoopt, thank you for opening an issue with us!

I have automatically added a "needs triage" label to help get things started. Our team will analyze and investigate the issue, and escalate it to the relevant team if possible. Other community members may also look into the issue and provide feedback 🙌

@shweaver-MSFT
Copy link
Contributor

Hi @anoopt, Thanks for submitting this proposal!

This is a great idea for a new SharePoint focused component. This is not in our current roadmap, but would you be willing to implement this and submit it as a contribution? We are actually running a contest currently and awarding prizes for good contributions! Find more details here: https://github.com/microsoftgraph/microsoft-graph-toolkit/blob/main/contest.md

@anoopt
Copy link
Contributor Author

anoopt commented Sep 20, 2020

Thank you @shweaver-MSFT - I am willing to implement this. Can you please assign it to me? It might take some extra time for me to complete this.

@njaci1 njaci1 self-assigned this Sep 15, 2022
@njaci1 njaci1 moved this to Needs Triage 🔍 in Graph Toolkit Sep 15, 2022
@anoopt
Copy link
Contributor Author

anoopt commented Mar 29, 2023

Hi @sebastienlevert - This is the issue I was talking about earlier in the chat :)

I am happy to work on this with the following details if ok?

mgt-taxonomy-picker

Overview

The taxonomy picker is a component that can query any Microsoft Graph API and render a dropdown control allowing selection of a single term.

Note
This capability used to support a single selection coming from the term store. This will be reviewed in the future.

User Scenarios

Select a term from a term set

image

Select a term from a term in a term set

image

Select a term from a term in a term set in a different language

image

Proposed Solution

Examples

<mgt-taxonomy-picker termset-id="138a652e-7f23-46f6-b480-13da2308c235"></mgt-taxonomy-picker>

<mgt-taxonomy-picker termset-id="138a652e-7f23-46f6-b480-13da2308c235" term-id="a56caeb7-3b7d-4d22-93a9-0232e12905f6"></mgt-taxonomy-picker>

<mgt-taxonomy-picker termset-id="138a652e-7f23-46f6-b480-13da2308c235" term-id="a56caeb7-3b7d-4d22-93a9-0232e12905f6" locale="fr-FR"></mgt-taxonomy-picker>

<mgt-taxonomy-picker termset-id="138a652e-7f23-46f6-b480-13da2308c235" cache-enabled="true" cache-invalidation-period="50000"></mgt-taxonomy-picker>

Properties and Attributes

Attribute Property Description Type
placeholder placeholder The placeholder to use in the combobox. No default value is provided. string
termset-id termsetId The Id of the termset where the terms are present. The terms under the termset will be shown if term-id is not passed string
term-id termId The id of the term where the terms are present. Number
locale locale The locale of the terms that need to be displayed. This will be useful only when terms have multiple lables in different languages. String
default-selected-term-id defaultSelectedTermId Optional. The id of the term that should be selected by default. String
version version Optional API version to use when making the GET request. Default is beta. String
cache-enabled cacheEnabled Optional Boolean. When set, it indicates that the response from the resource will be cached. Overriden if refresh() is called. Default is false. Boolean
cache-invalidation-period cacheInvalidationPeriod Optional number of milliseconds. When set in combination with cacheEnabled, the delay before the cache reaches its invalidation period will be modified by this value. Default is 0 and will use the default invalidation period. Number

Events

Event When it is fired
selectionChanged Fired when the user makes a change in selection

Templates

Data type Data Context Description
default null: no data The template used to override the rendering of the entire component.
loading null: no data The template used to render the state of the picker while the request to Graph is being made
error null: no data The template used if search returns no results.

APIs and Permissions

Permissions required by this component are TermStore.Read.All.

@sebastienlevert
Copy link
Contributor

This is an awesome spec you have there! I invite you to create a PR to the /specs folder with the "specs" part there so we can review inline. The one scenario I have in mind, is what would be the experience for a "cascading" selection? Multiple mgt-taxonomy-picker?

@anoopt
Copy link
Contributor Author

anoopt commented Mar 29, 2023

Thank you @sebastienlevert . I will create a PR to the specs folder.

With respect to your question on the "cascading" selection, yes multiple mgt-taxonomy-picker was an option I thought of. Each picker will output the "selected term" object when a term is picked. The properties of that "selected term" can then be used to drive the cascading picker(s). Would that be ok?

@sebastienlevert
Copy link
Contributor

So it would be to the developer to build their own cascade, right?

anoopt added a commit to anoopt/microsoft-graph-toolkit that referenced this issue Mar 29, 2023
@anoopt
Copy link
Contributor Author

anoopt commented Mar 29, 2023

That is right Seb.

I have created a PR with the spec and have targeted it to the next/fluentui branch (as PR #1937 was targeted to the same branch).

sebastienlevert added a commit that referenced this issue Apr 6, 2023
* feat: added spec for mgt-taxonomy-picker
refs: #634

* feat: made changes as per the review comments

* feat: made changes as per the comments.

---------

Co-authored-by: Sébastien Levert <[email protected]>
@ghost ghost added the State: In Review label Apr 24, 2023
@musale musale removed help wanted Extra attention is needed Needs: Prototyping labels Jun 5, 2023
@musale musale linked a pull request Jun 5, 2023 that will close this issue
6 tasks
@musale musale closed this as completed Jun 5, 2023
@github-project-automation github-project-automation bot moved this from Needs Triage 🔍 to Done ✔️ in Graph Toolkit Jun 5, 2023
@ghost ghost locked as resolved and limited conversation to collaborators Jul 5, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

5 participants