This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| export interface ISearchResult { | |
| Message: string; | |
| Results: SearchResult[]; | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| { | |
| "entries": [ | |
| { | |
| "entry": "./lib/webparts/cobLatestnewsWp/CobLatestnewsWpWebPart.js", | |
| "outputPath": "./dist/cob-latestnews-wp.bundle.js", | |
| "exclude": [ | |
| "@ms/sp-client-platform" | |
| ], | |
| "isStandalone": true, | |
| "useWebpack": true |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import { | |
| IWebPartData, | |
| IWebPartContext, | |
| IClientSideWebPart, | |
| BaseClientSideWebPart, | |
| DisplayMode, | |
| IPropertyPanePage, | |
| IPropertyPaneFieldType | |
| } from '@ms/sp-client-platform'; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import { | |
| IWebPartData, | |
| IWebPartContext, | |
| IClientSideWebPart, | |
| BaseClientSideWebPart, | |
| DisplayMode, | |
| IPropertyPanePage, | |
| IPropertyPaneFieldType, | |
| HostType | |
| } from '@ms/sp-client-platform'; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // code to authenticate to Office 365 and obtain a DiscoveryClient object, which can then be used to create | |
| // a SharePointClient or OutlookServicesClient in order to access files/mail/calendar/contacts etc.. | |
| var signInUserId = ClaimsPrincipal.Current.FindFirst(ClaimTypes.NameIdentifier).Value; | |
| var userObjectId = ClaimsPrincipal.Current.FindFirst("http://schemas.microsoft.com/identity/claims/objectidentifier").Value; | |
| // !!! NOTE: DO NOT USE NaiveSessionCache IN PRODUCTION. A MORE PERSISTENT CACHE SUCH AS A DATABASE IS RECOMMENDED FOR PRODUCTION USE !!!! | |
| AuthenticationContext authContext = new AuthenticationContext(SettingsHelper.Authority, new NaiveSessionCache(signInUserId)); | |
| DiscoveryClient discClient = new DiscoveryClient(SettingsHelper.DiscoveryServiceEndpointUri, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 'use strict'; | |
| window.COB = window.COB || {}; | |
| window.COB.TermSetName = "Countries"; | |
| window.COB.TermSetLocale = "1033"; | |
| window.COB.FieldInternalName = "COB_Countries"; | |
| window.COB.JsomProvisioning = function () { | |
| var context, | |
| termStore, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // obtain web URL somehow - line below is fine for a list item RER, but you'll need another approach elsewhere.. | |
| string webUrl = properties.ItemEventProperties.WebUrl; | |
| Uri webUri = new Uri(webUrl); | |
| string realm = TokenHelper.GetRealmFromTargetUrl(webUri); | |
| string accessToken = TokenHelper.GetAppOnlyAccessToken(TokenHelper.SharePointPrincipal, webUri.Authority, realm).AccessToken; | |
| using (var clientContext = TokenHelper.GetClientContextWithAccessToken(webUrl, accessToken)) | |
| { | |
| // do CSOM stuff here.. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var COB = COB || {}; | |
| COB.SharePoint = COB.SharePoint || {}; | |
| COB.SharePoint.HybridSearch = COB.SharePoint.HybridSearch || {}; | |
| COB.SharePoint.HybridSearch.Standard = COB.SharePoint.HybridSearch.Standard || {}; | |
| COB.SharePoint.HybridSearch.CustomInterleaving = COB.SharePoint.HybridSearch.CustomInterleaving || {}; | |
| var results; | |
| COB.SharePoint.HybridSearch.GenericResult = (function ( ) { | |
| var __searchResult; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function onCustomInterleavedSearchQuerySuccess() { | |
| var mergedResults = new Array(); | |
| var fakeResultTable = {}; | |
| $.each(results.m_value.ResultTables, function (index, resultTable) { | |
| if (resultTable.TableType === 'SpecialTermResults') { | |
| // show best bets if we have any.. | |
| renderBestBetsResultTable(this) | |
| } | |
| else { |