Skip to content

Commit 1372999

Browse files
committed
Enhancement for #77
1 parent 6978e6e commit 1372999

File tree

6 files changed

+17
-5
lines changed

6 files changed

+17
-5
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@
66

77
- `SecurityTrimmedControl` control got added [#74](https://github.com/SharePoint/sp-dev-fx-controls-react/issues/74)
88

9+
**Enhancements**
10+
11+
- Allow the `TaxonomyPicker` to also be used in Application Customizer [#77](https://github.com/SharePoint/sp-dev-fx-controls-react/issues/77)
12+
913
**Fixes**
1014

1115
- Icon not showing up in the `Placeholder` control [#76](https://github.com/SharePoint/sp-dev-fx-controls-react/issues/76)

docs/documentation/docs/about/release-notes.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@
66

77
- `SecurityTrimmedControl` control got added [#74](https://github.com/SharePoint/sp-dev-fx-controls-react/issues/74)
88

9+
**Enhancements**
10+
11+
- Allow the `TaxonomyPicker` to also be used in Application Customizer [#77](https://github.com/SharePoint/sp-dev-fx-controls-react/issues/77)
12+
913
**Fixes**
1014

1115
- Icon not showing up in the `Placeholder` control [#76](https://github.com/SharePoint/sp-dev-fx-controls-react/issues/76)

src/controls/taxonomyPicker/ITaxonomyPicker.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import { ApplicationCustomizerContext } from '@microsoft/sp-application-base';
12
import { IPickerTerms } from './ITermPicker';
23
import { ITermStore, IGroup, ITermSet, ITerm } from '../../services/ISPTermStorePickerService';
34
import SPTermStorePickerService from '../../services/SPTermStorePickerService';
@@ -26,7 +27,7 @@ export interface ITaxonomyPickerProps {
2627
/**
2728
* WebPart's context
2829
*/
29-
context: IWebPartContext;
30+
context: IWebPartContext | ApplicationCustomizerContext;
3031
/**
3132
* Limit the terms that can be picked by the Term Set name or ID
3233
*/

src/controls/taxonomyPicker/ITermPicker.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import { ApplicationCustomizerContext } from '@microsoft/sp-application-base';
12
import { IWebPartContext } from '@microsoft/sp-webpart-base';
23

34

@@ -42,7 +43,7 @@ export interface IPropertyFieldTermPickerProps {
4243
/**
4344
* WebPart's context
4445
*/
45-
context: IWebPartContext;
46+
context: IWebPartContext | ApplicationCustomizerContext;
4647
/**
4748
* Limit the term sets that can be used by the group name or ID
4849
*/
@@ -88,6 +89,6 @@ export interface IPropertyFieldTermPickerProps {
8889
* Default value is 200.
8990
*/
9091
deferredValidationTime?: number;
91-
92+
9293
}
9394

src/controls/taxonomyPicker/TermPicker.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import { ITaxonomyPickerProps } from './ITaxonomyPicker';
77
import { IWebPartContext } from '@microsoft/sp-webpart-base';
88
import * as strings from 'ControlStrings';
99
import { Icon } from 'office-ui-fabric-react';
10+
import { ApplicationCustomizerContext } from '@microsoft/sp-application-base';
1011

1112
export class TermBasePicker extends BasePicker<IPickerTerm, IBasePickerProps<IPickerTerm>>
1213
{
@@ -19,7 +20,7 @@ export interface ITermPickerState {
1920

2021
export interface ITermPickerProps {
2122
termPickerHostProps: ITaxonomyPickerProps;
22-
context: IWebPartContext;
23+
context: IWebPartContext | ApplicationCustomizerContext;
2324
disabled: boolean;
2425
value: IPickerTerms;
2526
allowMultipleSelections : boolean;

src/services/SPTermStorePickerService.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ import { ITaxonomyPickerProps } from '../controls/taxonomyPicker/ITaxonomyPicker
1212
import { IPickerTerms, IPickerTerm } from '../controls/taxonomyPicker/ITermPicker';
1313
import { ITermStore, ITerms, ITerm, IGroup, ITermSet, ITermSets } from './ISPTermStorePickerService';
1414
import SPTermStoreMockHttpClient from './SPTermStorePickerMockService';
15+
import { ApplicationCustomizerContext } from '@microsoft/sp-application-base';
1516

1617

1718
/**
@@ -25,7 +26,7 @@ export default class SPTermStorePickerService {
2526
/**
2627
* Service constructor
2728
*/
28-
constructor(private props: ITaxonomyPickerProps, private context: IWebPartContext) {
29+
constructor(private props: ITaxonomyPickerProps, private context: IWebPartContext | ApplicationCustomizerContext) {
2930
if (Environment.type !== EnvironmentType.Local) {
3031
{
3132
this.clientServiceUrl = this.context.pageContext.web.absoluteUrl + '/_vti_bin/client.svc/ProcessQuery';

0 commit comments

Comments
 (0)