Skip to content

Commit

Permalink
Merge pull request #3203 from microsoft-search/develop
Browse files Browse the repository at this point in the history
v4.9.3
  • Loading branch information
wobba authored Aug 23, 2023
2 parents 284e2bd + 736e6bc commit 156cc90
Show file tree
Hide file tree
Showing 19 changed files with 19 additions and 300 deletions.
2 changes: 1 addition & 1 deletion search-parts/config/package-solution.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"solution": {
"name": "PnP Modern Search - Search Web Parts - v4",
"id": "59903278-dd5d-4e9e-bef6-562aae716b8b",
"version": "4.9.2.0",
"version": "4.9.3.0",
"includeClientSideAssets": true,
"skipFeatureDeployment": true,
"isDomainIsolated": false,
Expand Down
202 changes: 2 additions & 200 deletions search-parts/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 1 addition & 2 deletions search-parts/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@pnp/modern-search-web-parts",
"version": "4.9.2",
"version": "4.9.3",
"private": true,
"main": "lib/index.js",
"engines": {
Expand All @@ -16,7 +16,6 @@
"@fluentui/react": "^8.109.7",
"@fluentui/react-file-type-icons": "8.8.18",
"@fluentui/react-theme-provider": "0.19.16",
"@microsoft/applicationinsights-web": "^2.8.9",
"@microsoft/mgt-react": "^2.10.1",
"@microsoft/mgt-sharepoint-provider": "^2.10.1",
"@microsoft/sp-component-base": "1.15.2",
Expand Down
6 changes: 0 additions & 6 deletions search-parts/src/common/Constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,6 @@ export class Constants {
* The client tag to append to all REST calls to SharePoint
*/
public static readonly X_CLIENTSERVICE_CLIENTTAG = 'NonISV|PnP|ModernSearch';

/**
* The PnP Application Insights instrumentation key and events for stats tracking
*/
public static readonly PNP_APP_INSIGHTS_INSTRUMENTATION_KEY = '0f0b9db6-680c-480c-804d-f75830e2c383';
public static readonly PNP_MODERN_SEARCH_EVENT_NAME = 'pnpModernSearchV4';
}

export enum AutoCalculatedDataSourceFields {
Expand Down
6 changes: 3 additions & 3 deletions search-parts/src/helpers/LocalizationHelper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,8 @@ class LocalizationHelper {
}

private static isInt(value: any): boolean {
const x = parseFloat(value);
return !isNaN(value) && (x | 0) === x;
const x = Number(value);
return Number.isInteger(x);
}

/**
Expand All @@ -92,4 +92,4 @@ class LocalizationHelper {
}
}

export default LocalizationHelper;
export default LocalizationHelper;
Original file line number Diff line number Diff line change
Expand Up @@ -173,11 +173,6 @@ export default interface ISearchResultsWebPartProps extends IBaseWebPartProps {
*/
selectedItemFieldValue: DynamicProperty<string>;

/**
* Flag indicating if telemetry are enabled
*/
enableTelemetry: boolean;

/**
* The queryModifier properties
*/
Expand Down
35 changes: 0 additions & 35 deletions search-parts/src/webparts/searchResults/SearchResultsWebPart.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,6 @@ import { BuiltinFilterTemplates } from '../../layouts/AvailableTemplates';
import { IExtensibilityConfiguration } from '../../models/common/IExtensibilityConfiguration';
import { IDataVerticalSourceData } from '../../models/dynamicData/IDataVerticalSourceData';
import { BaseWebPart } from '../../common/BaseWebPart';
import { ApplicationInsights } from '@microsoft/applicationinsights-web';
import commonStyles from '../../styles/Common.module.scss';
import { UrlHelper } from '../../helpers/UrlHelper';
import { ObjectHelper } from '../../helpers/ObjectHelper';
Expand Down Expand Up @@ -526,34 +525,6 @@ export default class SearchResultsWebPart extends BaseWebPart<ISearchResultsWebP
// Web components are only defined once.
await this.templateService.registerWebComponents(this.availableWebComponentDefinitions, this.instanceId);

if (this.properties.dataSourceKey && this.properties.selectedLayoutKey && this.properties.enableTelemetry) {

const usageEvent = {
name: Constants.PNP_MODERN_SEARCH_EVENT_NAME,
properties: {
selectedDataSource: this.properties.dataSourceKey,
selectedLayout: this.properties.selectedLayoutKey,
useFilters: this.properties.useFilters,
useVerticals: this.properties.useVerticals
}
};

// Track event with application insights (PnP)
const appInsights = new ApplicationInsights({
config: {
maxBatchInterval: 0,
instrumentationKey: Constants.PNP_APP_INSIGHTS_INSTRUMENTATION_KEY,
namePrefix: LogSource,
disableFetchTracking: true,
disableAjaxTracking: true
}
});

appInsights.loadAppInsights();
appInsights.context.application.ver = this.manifest.version;
appInsights.trackEvent(usageEvent);
}

// Initializes MS Graph Toolkit
if (this.properties.useMicrosoftGraphToolkit) {
await loadMsGraphToolkit(this.context);
Expand Down Expand Up @@ -694,11 +665,6 @@ export default class SearchResultsWebPart extends BaseWebPart<ISearchResultsWebP
this._propertyPanePropertyEditor({
webpart: this,
key: 'propertyEditor'
}),
PropertyPaneToggle('enableTelemetry', {
label: webPartStrings.PropertyPane.InformationPage.EnableTelemetryLabel,
offText: webPartStrings.PropertyPane.InformationPage.EnableTelemetryOn,
onText: webPartStrings.PropertyPane.InformationPage.EnableTelemetryOff,
})
]
}
Expand Down Expand Up @@ -1169,7 +1135,6 @@ export default class SearchResultsWebPart extends BaseWebPart<ISearchResultsWebP
this.properties.showResultsCount = this.properties.showResultsCount !== undefined ? this.properties.showResultsCount : true;
this.properties.showBlankIfNoResult = this.properties.showBlankIfNoResult !== undefined ? this.properties.showBlankIfNoResult : false;
this.properties.useMicrosoftGraphToolkit = this.properties.useMicrosoftGraphToolkit !== undefined ? this.properties.useMicrosoftGraphToolkit : false;
this.properties.enableTelemetry = this.properties.enableTelemetry !== undefined ? this.properties.enableTelemetry : true;

// Item selection properties
if (!this.properties.selectedItemFieldValue) {
Expand Down
5 changes: 1 addition & 4 deletions search-parts/src/webparts/searchResults/loc/da-dk.js
Original file line number Diff line number Diff line change
Expand Up @@ -118,10 +118,7 @@ define([], function() {
Extensibility: {
PanelHeader: "Konfigurér extensibility-biblioteker så de indlæser ved opstart.",
PanelDescription: "Tilføj/Fjern ID på dit extensibility-bibliotek her. Du kan specificere et visningsnavn og beslutte, om biblioteket skal indlæses eller ej ved opstart. Kun brugerdefinerede datakilder, layouts, web-komponenter og Handlebars-hjælpere vil blive loadet her.",
},
EnableTelemetryLabel: "PnP telemetri",
EnableTelemetryOn: "Slå telemetri til",
EnableTelemetryOff: "Slå telemetri fra"
}
},
CustomQueryModifier: {
EditQueryModifiersLabel: "Konfigurere tilgængelige brugerdefinerede forespørgselsmodifikatorer",
Expand Down
Loading

0 comments on commit 156cc90

Please sign in to comment.