File tree Expand file tree Collapse file tree 7 files changed +35
-24
lines changed
mgt-components/src/components/preview/mgt-search-results
samples/react-admin-app/src/pages/Search
stories/components/preview/searchBox Expand file tree Collapse file tree 7 files changed +35
-24
lines changed Original file line number Diff line number Diff line change @@ -214,8 +214,7 @@ export class MgtSearchResults extends MgtTemplatedComponent {
214214 attribute : 'scopes' ,
215215 converter : ( value , type ) => {
216216 return value ? value . toLowerCase ( ) . split ( ',' ) : null ;
217- } ,
218- reflect : true
217+ }
219218 } )
220219 public scopes : string [ ] = [ ] ;
221220
@@ -229,8 +228,7 @@ export class MgtSearchResults extends MgtTemplatedComponent {
229228 attribute : 'content-sources' ,
230229 converter : ( value , type ) => {
231230 return value ? value . toLowerCase ( ) . split ( ',' ) : null ;
232- } ,
233- reflect : true
231+ }
234232 } )
235233 public contentSources : string [ ] = [ ] ;
236234
@@ -1246,7 +1244,7 @@ export class MgtSearchResults extends MgtTemplatedComponent {
12461244 }
12471245
12481246 if ( this . version === 'beta' ) {
1249- requestOptions . query . queryString = this . queryTemplate ? this . queryTemplate : undefined ;
1247+ ( requestOptions as BetaSearchRequest ) . query . queryTemplate = this . queryTemplate ? this . queryTemplate : undefined ;
12501248 }
12511249
12521250 return requestOptions ;
Original file line number Diff line number Diff line change 88// THIS FILE IS AUTO GENERATED
99// ANY CHANGES WILL BE LOST DURING BUILD
1010
11- export const PACKAGE_VERSION = '3.0.0-preview.2 ' ;
11+ export const PACKAGE_VERSION = '3.0.0-rc.1 ' ;
Original file line number Diff line number Diff line change 1- import { SearchBox , SearchResults } from '@microsoft/mgt-react' ;
1+ import { SearchBox , SearchResults } from '@microsoft/mgt-react/dist/es6/generated/react-preview ' ;
22import * as React from 'react' ;
33
4+ const filesScopes = [ 'Files.Read.All' , 'Sites.Read.All' ] ;
5+ const filesEntityTypes = [ 'driveItem' , 'listItem' , 'site' ] ;
6+ const bookmarksScopes = [ 'Bookmark.Read.All' ] ;
7+ const bookmarksEntityTypes = [ 'bookmark' ] ;
8+
49export const AllResults : React . FunctionComponent = ( ) => {
510 const [ searchTerm , setSearchTerm ] = React . useState < string > ( '' ) ;
611
712 return (
813 < >
914 < SearchBox searchTermChanged = { e => setSearchTerm ( e . detail ) } > </ SearchBox >
1015 < SearchResults
11- entityTypes = { [ 'bookmark' ] }
16+ entityTypes = { bookmarksEntityTypes }
1217 queryString = { searchTerm }
1318 version = "beta"
1419 size = { 1 }
15- scopes = { [ 'Bookmark.Read.All' ] }
20+ scopes = { bookmarksScopes }
1621 > </ SearchResults >
1722 < SearchResults
18- entityTypes = { [ 'driveItem' , 'listItem' , 'site' ] }
23+ entityTypes = { filesEntityTypes }
1924 queryString = { searchTerm }
20- scopes = { [ 'Files.Read.All' , 'Sites.Read.All' ] }
25+ scopes = { filesScopes }
2126 fetchThumbnail = { true }
2227 > </ SearchResults >
2328 </ >
Original file line number Diff line number Diff line change 1- import { MgtTemplateProps , SearchBox , SearchResults } from '@microsoft/mgt-react' ;
1+ import { MgtTemplateProps } from '@microsoft/mgt-react' ;
2+ import { SearchBox , SearchResults } from '@microsoft/mgt-react/dist/es6/generated/react-preview' ;
3+
24import * as React from 'react' ;
35
6+ const entityTypes = [ 'externalItem' ] ;
7+ const scopes = [ 'ExternalItem.Read.All' ] ;
8+ const contentSources = [ '/external/connections/contosopartsinventory' ] ;
9+
410export const ExternalItems : React . FunctionComponent = ( ) => {
511 const [ searchTerm , setSearchTerm ] = React . useState < string > ( '' ) ;
612
713 return (
814 < >
915 < SearchBox searchTermChanged = { e => setSearchTerm ( e . detail ) } > </ SearchBox >
10- < SearchResults
11- entityTypes = { [ 'externalItem' ] }
12- contentSources = { [ '/external/connections/contosopartsinventory' ] }
13- queryString = { searchTerm }
14- scopes = { [ 'ExternalItem.Read.All' ] }
15- >
16+ < SearchResults entityTypes = { entityTypes } contentSources = { contentSources } queryString = { searchTerm } scopes = { scopes } >
1617 < ExternalItemTemplate template = "result-externalItem" > </ ExternalItemTemplate >
1718 </ SearchResults >
1819 </ >
Original file line number Diff line number Diff line change 1- import { MgtTemplateProps , SearchBox , SearchResults } from '@microsoft/mgt-react' ;
1+ import { MgtTemplateProps } from '@microsoft/mgt-react' ;
2+ import { SearchBox , SearchResults } from '@microsoft/mgt-react/dist/es6/generated/react-preview' ;
23import * as React from 'react' ;
34
5+ const entityTypes = [ 'externalItem' , 'driveItem' ] ;
6+ const scopes = [ 'Files.Read.All' , 'ExternalItem.Read.All' ] ;
7+ const contentSources = [ '/external/connections/*' ] ;
8+
49export const Interleaving : React . FunctionComponent = ( ) => {
510 const [ searchTerm , setSearchTerm ] = React . useState < string > ( '' ) ;
611
712 return (
813 < >
914 < SearchBox searchTermChanged = { e => setSearchTerm ( e . detail ) } > </ SearchBox >
1015 < SearchResults
11- entityTypes = { [ 'externalItem' , 'driveItem' ] }
12- contentSources = { [ '/external/connections/*' ] }
16+ entityTypes = { entityTypes }
17+ contentSources = { contentSources }
1318 queryString = { searchTerm }
1419 version = { 'beta' }
15- scopes = { [ 'Files.Read.All' , 'ExternalItem.Read.All' ] }
20+ scopes = { scopes }
1621 >
1722 < ExternalItemTemplate template = "result-externalItem" > </ ExternalItemTemplate >
1823 </ SearchResults >
Original file line number Diff line number Diff line change 1- import { SearchBox , SearchResults } from '@microsoft/mgt-react' ;
1+ import { SearchBox , SearchResults } from '@microsoft/mgt-react/dist/es6/generated/react-preview ' ;
22import * as React from 'react' ;
33
44export const PeopleResults : React . FunctionComponent = ( ) => {
Original file line number Diff line number Diff line change @@ -44,11 +44,13 @@ export const events = () => html`
4444 <!-- See js tab for event subscription -->
4545
4646 < mgt-search-box > </ mgt-search-box >
47+ < mgt-search-results entity-types ="driveItem "> </ mgt-search-results >
4748 < script >
4849 import '@microsoft/mgt-components/dist/es6/components/preview' ;
4950 const searchBox = document . querySelector ( 'mgt-search-box' ) ;
51+ const searchResults = document . querySelector ( 'mgt-search-box' ) ;
5052 searchBox . addEventListener ( 'searchTermChanged' , ( e ) => {
51- console . log ( e . detail ) ;
53+ searchResults . queryString = e . detail ;
5254 } )
5355 </ script >
5456` ;
You can’t perform that action at this time.
0 commit comments