@@ -10,7 +10,7 @@ import * as React from 'react';
1010
1111import * as telemetry from '../../common/telemetry' ;
1212import { toRelativeUrl } from '../../common/utilities/GeneralHelper' ;
13- import { getAllSites , getHubSites , ISite } from '../../services/SPSitesService' ;
13+ import { getAllSites , getHubSites , ISite , getAssociatedSites } from '../../services/SPSitesService' ;
1414import { ISitePickerProps } from './ISitePicker' ;
1515
1616const styles = mergeStyleSets ( {
@@ -73,7 +73,8 @@ export const SitePicker: React.FunctionComponent<ISitePickerProps> = (props: Rea
7373 className,
7474 selectedSites,
7575 trimDuplicates,
76- additionalQuery
76+ additionalQuery,
77+ hubsiteId
7778 } = props ;
7879
7980 const [ isLoading , setIsLoading ] = React . useState < boolean > ( ) ;
@@ -233,11 +234,18 @@ export const SitePicker: React.FunctionComponent<ISitePickerProps> = (props: Rea
233234 setFilteredSites ( [ ] ) ;
234235
235236 let promise : Promise < ISite [ ] > ;
236- if ( mode === 'hub' ) {
237- promise = getHubSites ( context ) ;
238- }
239- else {
240- promise = getAllSites ( context , mode !== 'site' , limitToCurrentSiteCollection , trimDuplicates === true , additionalQuery ) ;
237+ switch ( mode ) {
238+ case 'hub' :
239+ promise = getHubSites ( context ) ;
240+ break ;
241+
242+ case 'associatedsites' :
243+ promise = getAssociatedSites ( context , trimDuplicates === true , hubsiteId ) ;
244+ break ;
245+
246+ default :
247+ promise = getAllSites ( context , mode !== 'site' , limitToCurrentSiteCollection , trimDuplicates === true , additionalQuery ) ;
248+ break ;
241249 }
242250
243251 promise . then ( newSites => {
0 commit comments