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

Taxonomy Property Control picker doesn't not work with Termset GUID #48

Closed
AsishP opened this issue Apr 17, 2018 · 5 comments
Closed

Taxonomy Property Control picker doesn't not work with Termset GUID #48

AsishP opened this issue Apr 17, 2018 · 5 comments
Milestone

Comments

@AsishP
Copy link

AsishP commented Apr 17, 2018

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

@estruyf
Copy link
Member

estruyf commented Apr 17, 2018

@AsishP thanks for reporting this. I'll take a look at it.

@estruyf estruyf added this to the v1.5.1 milestone Apr 17, 2018
estruyf added a commit that referenced this issue Apr 17, 2018
@estruyf
Copy link
Member

estruyf commented Apr 17, 2018

@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/

@estruyf
Copy link
Member

estruyf commented Apr 24, 2018

Closing as this, feel free to reopen if needed.

@AsishP
Copy link
Author

AsishP commented Apr 28, 2018

Thanks @estruyf . Sorry will check it soon and let you know. Is the fix still in beta release or now in v1.5.1 ?

@estruyf
Copy link
Member

estruyf commented Apr 30, 2018

FIx is in the current release.

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

No branches or pull requests

2 participants