Skip to content

Commit

Permalink
Merge branch 'release/4.5.3' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
FranckyC committed Dec 21, 2021
2 parents e6d6fc9 + db1ef40 commit c5fe9cd
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 35 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.5.2.0",
"version": "4.5.3.0",
"includeClientSideAssets": true,
"skipFeatureDeployment": true,
"isDomainIsolated": false,
Expand Down
2 changes: 1 addition & 1 deletion 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.5.2",
"version": "4.5.3",
"private": true,
"main": "lib/index.js",
"engines": {
Expand Down
59 changes: 26 additions & 33 deletions search-parts/src/dataSources/MicrosoftSearchDataSource.ts
Original file line number Diff line number Diff line change
Expand Up @@ -231,6 +231,16 @@ export class MicrosoftSearchDataSource extends BaseDataSource<IMicrosoftSearchDa
description: `<em>${commonStrings.DataSources.MicrosoftSearch.QueryTextFieldInfoMessage}</em>`,
key: 'queryText'
}),
new PropertyPaneNonReactiveTextField('dataSourceProperties.queryTemplate', {
defaultValue: this.properties.queryTemplate,
label: commonStrings.DataSources.MicrosoftSearch.QueryTemplateFieldLabel,
placeholderText: commonStrings.DataSources.MicrosoftSearch.QueryTemplatePlaceHolderText,
multiline: true,
description: commonStrings.DataSources.MicrosoftSearch.QueryTemplateFieldDescription,
applyBtnText: commonStrings.DataSources.MicrosoftSearch.ApplyQueryTemplateBtnText,
allowEmptyValue: false,
rows: 8
}),
new PropertyPaneAsyncCombo('dataSourceProperties.entityTypes', {
availableOptions: this._availableEntityTypeOptions,
allowMultiSelect: true,
Expand All @@ -243,16 +253,20 @@ export class MicrosoftSearchDataSource extends BaseDataSource<IMicrosoftSearchDa
onPropertyChange: this.onCustomPropertyUpdate.bind(this),
textDisplayValue: entityTypesDisplayValue.filter(e => e).join(",")
}),
new PropertyPaneNonReactiveTextField('dataSourceProperties.queryTemplate', {
defaultValue: this.properties.queryTemplate,
label: commonStrings.DataSources.MicrosoftSearch.QueryTemplateFieldLabel,
placeholderText: commonStrings.DataSources.MicrosoftSearch.QueryTemplatePlaceHolderText,
multiline: true,
description: commonStrings.DataSources.MicrosoftSearch.QueryTemplateFieldDescription,
applyBtnText: commonStrings.DataSources.MicrosoftSearch.ApplyQueryTemplateBtnText,
allowEmptyValue: false,
rows: 8
}),
new PropertyPaneAsyncCombo('dataSourceProperties.fields', {
availableOptions: this._availableFields,
allowMultiSelect: true,
allowFreeform: true,
description: commonStrings.DataSources.MicrosoftSearch.SelectedFieldsPropertiesFieldDescription,
label: commonStrings.DataSources.MicrosoftSearch.SelectedFieldsPropertiesFieldLabel,
placeholder: commonStrings.DataSources.MicrosoftSearch.SelectedFieldsPlaceholderLabel,
searchAsYouType: false,
defaultSelectedKeys: this.properties.fields,
onPropertyChange: this.onCustomPropertyUpdate.bind(this),
onUpdateOptions: ((options: IComboBoxOption[]) => {
this._availableFields = options;
}).bind(this)
})
];
let useBetaEndpointFields: IPropertyPaneField<any>[] = [
PropertyPaneHorizontalRule(),
Expand Down Expand Up @@ -347,28 +361,7 @@ export class MicrosoftSearchDataSource extends BaseDataSource<IMicrosoftSearchDa
})
);
}

// Only available for ListItem an ExternalItem entities
// https://docs.microsoft.com/en-us/graph/api/resources/search-api-overview?view=graph-rest-1.0#get-selected-properties
if (this.properties.entityTypes.indexOf(EntityType.ListItem) !== -1 || this.properties.entityTypes.indexOf(EntityType.ExternalItem) !== -1) {
selectFieldsFields.push(
new PropertyPaneAsyncCombo('dataSourceProperties.fields', {
availableOptions: this._availableFields,
allowMultiSelect: true,
allowFreeform: true,
description: commonStrings.DataSources.MicrosoftSearch.SelectedFieldsPropertiesFieldDescription,
label: commonStrings.DataSources.MicrosoftSearch.SelectedFieldsPropertiesFieldLabel,
placeholder: commonStrings.DataSources.MicrosoftSearch.SelectedFieldsPlaceholderLabel,
searchAsYouType: false,
defaultSelectedKeys: this.properties.fields,
onPropertyChange: this.onCustomPropertyUpdate.bind(this),
onUpdateOptions: ((options: IComboBoxOption[]) => {
this._availableFields = options;
}).bind(this)
})
);
}


if (this.properties.entityTypes.indexOf(EntityType.Message) !== -1 && this.properties.entityTypes.length === 1) {
enableTopResultsFields.push(PropertyPaneToggle('dataSourceProperties.enableTopResults', {
label: commonStrings.DataSources.MicrosoftSearch.EnableTopResultsLabel
Expand Down Expand Up @@ -515,7 +508,7 @@ export class MicrosoftSearchDataSource extends BaseDataSource<IMicrosoftSearchDa
private initProperties(): void {
this.properties.entityTypes = this.properties.entityTypes !== undefined ? this.properties.entityTypes : [EntityType.DriveItem];

const CommonFields = ["name","webUrl","filetype","createdBy","createdDateTime","lastModifiedDateTime","parentReference","size","description","file","folder"];
const CommonFields = ["name","webUrl","filetype","createdBy","createdDateTime","lastModifiedDateTime","parentReference","size","description","file","folder","subject","bodyPreview","replyTo","from","sender","start","end","displayName","givenName","surname","userPrincipalName","phones","department"];

this.properties.fields = this.properties.fields !== undefined ? this.properties.fields : CommonFields;
this.properties.sortProperties = this.properties.sortProperties !== undefined ? this.properties.sortProperties : [];
Expand Down

0 comments on commit c5fe9cd

Please sign in to comment.