Skip to content

Commit

Permalink
Enhancement for #77
Browse files Browse the repository at this point in the history
  • Loading branch information
estruyf committed May 18, 2018
1 parent 6978e6e commit 1372999
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 5 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@

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

**Enhancements**

- Allow the `TaxonomyPicker` to also be used in Application Customizer [#77](https://github.com/SharePoint/sp-dev-fx-controls-react/issues/77)

**Fixes**

- Icon not showing up in the `Placeholder` control [#76](https://github.com/SharePoint/sp-dev-fx-controls-react/issues/76)
Expand Down
4 changes: 4 additions & 0 deletions docs/documentation/docs/about/release-notes.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@

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

**Enhancements**

- Allow the `TaxonomyPicker` to also be used in Application Customizer [#77](https://github.com/SharePoint/sp-dev-fx-controls-react/issues/77)

**Fixes**

- Icon not showing up in the `Placeholder` control [#76](https://github.com/SharePoint/sp-dev-fx-controls-react/issues/76)
Expand Down
3 changes: 2 additions & 1 deletion src/controls/taxonomyPicker/ITaxonomyPicker.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { ApplicationCustomizerContext } from '@microsoft/sp-application-base';
import { IPickerTerms } from './ITermPicker';
import { ITermStore, IGroup, ITermSet, ITerm } from '../../services/ISPTermStorePickerService';
import SPTermStorePickerService from '../../services/SPTermStorePickerService';
Expand Down Expand Up @@ -26,7 +27,7 @@ export interface ITaxonomyPickerProps {
/**
* WebPart's context
*/
context: IWebPartContext;
context: IWebPartContext | ApplicationCustomizerContext;
/**
* Limit the terms that can be picked by the Term Set name or ID
*/
Expand Down
5 changes: 3 additions & 2 deletions src/controls/taxonomyPicker/ITermPicker.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { ApplicationCustomizerContext } from '@microsoft/sp-application-base';
import { IWebPartContext } from '@microsoft/sp-webpart-base';


Expand Down Expand Up @@ -42,7 +43,7 @@ export interface IPropertyFieldTermPickerProps {
/**
* WebPart's context
*/
context: IWebPartContext;
context: IWebPartContext | ApplicationCustomizerContext;
/**
* Limit the term sets that can be used by the group name or ID
*/
Expand Down Expand Up @@ -88,6 +89,6 @@ export interface IPropertyFieldTermPickerProps {
* Default value is 200.
*/
deferredValidationTime?: number;

}

3 changes: 2 additions & 1 deletion src/controls/taxonomyPicker/TermPicker.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import { ITaxonomyPickerProps } from './ITaxonomyPicker';
import { IWebPartContext } from '@microsoft/sp-webpart-base';
import * as strings from 'ControlStrings';
import { Icon } from 'office-ui-fabric-react';
import { ApplicationCustomizerContext } from '@microsoft/sp-application-base';

export class TermBasePicker extends BasePicker<IPickerTerm, IBasePickerProps<IPickerTerm>>
{
Expand All @@ -19,7 +20,7 @@ export interface ITermPickerState {

export interface ITermPickerProps {
termPickerHostProps: ITaxonomyPickerProps;
context: IWebPartContext;
context: IWebPartContext | ApplicationCustomizerContext;
disabled: boolean;
value: IPickerTerms;
allowMultipleSelections : boolean;
Expand Down
3 changes: 2 additions & 1 deletion src/services/SPTermStorePickerService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import { ITaxonomyPickerProps } from '../controls/taxonomyPicker/ITaxonomyPicker
import { IPickerTerms, IPickerTerm } from '../controls/taxonomyPicker/ITermPicker';
import { ITermStore, ITerms, ITerm, IGroup, ITermSet, ITermSets } from './ISPTermStorePickerService';
import SPTermStoreMockHttpClient from './SPTermStorePickerMockService';
import { ApplicationCustomizerContext } from '@microsoft/sp-application-base';


/**
Expand All @@ -25,7 +26,7 @@ export default class SPTermStorePickerService {
/**
* Service constructor
*/
constructor(private props: ITaxonomyPickerProps, private context: IWebPartContext) {
constructor(private props: ITaxonomyPickerProps, private context: IWebPartContext | ApplicationCustomizerContext) {
if (Environment.type !== EnvironmentType.Local) {
{
this.clientServiceUrl = this.context.pageContext.web.absoluteUrl + '/_vti_bin/client.svc/ProcessQuery';
Expand Down

0 comments on commit 1372999

Please sign in to comment.