-
Notifications
You must be signed in to change notification settings - Fork 151
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
Taxonomy Property Control picker doesn't not work with Termset GUID #48
Comments
@AsishP thanks for reporting this. I'll take a look at it. |
@AsishP I have done a change to the service code. Can you check out the new beta version to see if it fixed it? More information about installing beta versions can be found here: https://sharepoint.github.io/sp-dev-fx-property-controls/beta/ |
Closing as this, feel free to reopen if needed. |
Thanks @estruyf . Sorry will check it soon and let you know. Is the fix still in beta release or now in v1.5.1 ? |
FIx is in the current release. |
Category
[ ] Enhancement
[X ] Bug
[ ] Question
Version
Please specify what version of the library you are using: [ 1.5.0 ]
Expected / Desired Behavior / Question
Taxonomy picker property control getTermStores() method is designed to work with TermsetGUID but doesn't work if termsetGUID is provided. The method is part of SPTermStorePickerService.ts class under \src\services.
Observed Behavior and fix
The groups don't load when Termset GUID is provided.
The fix is to change the code in the getTermStores() method to be a substring check instead of equal to.
Current code (not working)
termGroups = termGroups.map((group: IGroup) => {
group.TermSets.Child_Items = group.TermSets.Child_Items.filter((termSet: ITermSet) => termSet.Name === termsetNameOrId || termSet.Id.toLowerCase() === termsetNameOrId.toLowerCase());
return group;
});
Fixed Working code
termGroups = termGroups.map((group: IGroup) => {
group.TermSets.Child_Items = group.TermSets.Child_Items.filter((termSet: ITermSet) => termSet.Name === termsetNameOrId || termSet.Id.toLowerCase().indexOf(termsetNameOrId.toLowerCase()) !== -1);
return group;
});
Could we re-validate the above change and release an update. Please let me know if there are more queries.
Steps to Reproduce
Initialize and call the termstore method as below.
let termPickerHostProps : ISPTermStorePickerServiceProps = {
limitByGroupNameOrID: "",
limitByTermsetNameOrID: termSetGuid,
excludeSystemGroup: true
};
let termsService : SPTermStorePickerService = new SPTermStorePickerService(termPickerHostProps, context);
termsService.searchTermsByName("d").then((terms : IPickerTerm[]) => {
return resolve(terms);
}).catch((response: any) => {
return reject("Error in getTermSetCount for termSet ID " + termSetGuid + "Error = " + response.message);
});
Thanks!
Asish
The text was updated successfully, but these errors were encountered: