diff --git a/samples/react-search-refiners/README.md b/samples/react-search-refiners/README.md
index d78c0650e..2c082bf96 100644
--- a/samples/react-search-refiners/README.md
+++ b/samples/react-search-refiners/README.md
@@ -56,14 +56,15 @@ Version|Date|Comments
1.3 | Apr1, 2018 | Added the result count + entered keywords option
1.4 | May 10, 2018 |
- Added the query suggestions feature to the search box Web Part
- Added the automatic translation for taxonomy filter values according to the current site locale.
- Added the option in the search box Web Part to send the query to an other page
1.5 | Jul 2, 2018 | - Added a templating feature for search results with Handlebars inspired by the [react-content-query-webpart](https://github.com/SharePoint/sp-dev-fx-webparts/tree/master/samples/react-content-query-webpart) sample.
- Upgraded to 1.5.1-plusbeta to use the new SPFx dynamic data feature instead of event aggregator for Web Parts communication.
- Code refactoring and reorganization.
-2.0.0.5 | Sept 18, 2018 | - Upgraded to 1.6.0-plusbeta.
- Added dynamic loading of parts needed in edit mode to reduce web part footprint.
- Added configuration to sort.
- Added option to set web part title.
- Added result count tokens.
- Added toggle to load/use handlebars helpers/moment.
-2.1.0.0 | Oct 14, 2018 | - Bug fixes ([#641](https://github.com/SharePoint/sp-dev-fx-webparts/issues/641),[#642](https://github.com/SharePoint/sp-dev-fx-webparts/issues/642))
- Added document and Office 365 videos previews for the list template.
- Added SharePoint best bets support.
-2.1.1.0 | Oct 30, 2018 | - Bug fix for editing custom template.
- Bug fix for dynamic loading of video helper library.
- Added support for Page context query variables.
- Added `getUniqueCount` helper function.
-2.1.2.0 | Nov 9, 2018 | - Bug fix for IE11.
- Added date query variables.
- Added support for both result source id and query template.
- Added `getUniqueCount` helper function.
-2.2.0.0 | Nov 11, 2018 | - Upgraded to SPFx 1.7.0
- Added a TypeScript Azure Function to demonstrate NLP processing on search query
- Removed extension data source. Now we use the default SPFx 'Page Environment' data source.
-2.2.0.1 | Dec 3, 2018 | - Remove switch for handlebar helpers, and instead load helpers if used in the template.
-2.3.0.0 | Dec 13, 2018 | - Upgraded to @pnp/controls 1.13.0
- Added a result types features
- Fix bug regarding dynamic data source connection
-2.4.0.0 | Jan 03, 2019 | Added custom code renderer support.
+2.0.5 | Sept 18, 2018 | - Upgraded to 1.6.0-plusbeta.
- Added dynamic loading of parts needed in edit mode to reduce web part footprint.
- Added configuration to sort.
- Added option to set web part title.
- Added result count tokens.
- Added toggle to load/use handlebars helpers/moment.
+2.1.0 | Oct 14, 2018 | - Bug fixes ([#641](https://github.com/SharePoint/sp-dev-fx-webparts/issues/641),[#642](https://github.com/SharePoint/sp-dev-fx-webparts/issues/642))
- Added document and Office 365 videos previews for the list template.
- Added SharePoint best bets support.
+2.1.1 | Oct 30, 2018 | - Bug fix for editing custom template.
- Bug fix for dynamic loading of video helper library.
- Added support for Page context query variables.
- Added `getUniqueCount` helper function.
+2.1.2 | Nov 9, 2018 | - Bug fix for IE11.
- Added date query variables.
- Added support for both result source id and query template.
- Added `getUniqueCount` helper function.
+2.2.0 | Nov 11, 2018 | - Upgraded to SPFx 1.7.0
- Added a TypeScript Azure Function to demonstrate NLP processing on search query
- Removed extension data source. Now we use the default SPFx 'Page Environment' data source.
+2.2.0 | Dec 3, 2018 | - Remove switch for handlebar helpers, and instead load helpers if used in the template.
+2.3.0 | Dec 13, 2018 | - Upgraded to @pnp/controls 1.13.0
- Added a result types features
- Fix bug regarding dynamic data source connection
+2.4.0 | Jan 03, 2019 | Added custom code renderer support.
+2.4.1 | Jan 07, 2019 | Added backwards compability for older sort configurations, and old empty refiner configurations
## Important notice on upgrading the solution from pre v2.2.0.0
**Due to code restucturing we have hit an edge case which impacts upgrades from previous versions. To solve the issue go to `https://.sharepoint.com/sites//Lists/ComponentManifests` and remove the entries for SearchBox and Search Results, and then upload the .sppkg for the new release.**
diff --git a/samples/react-search-refiners/spfx/package.json b/samples/react-search-refiners/spfx/package.json
index 46f563ca2..eadbd1a86 100644
--- a/samples/react-search-refiners/spfx/package.json
+++ b/samples/react-search-refiners/spfx/package.json
@@ -1,6 +1,6 @@
{
"name": "pnp-react-search-refiners",
- "version": "2.4.0",
+ "version": "2.4.1",
"private": true,
"engines": {
"node": ">=0.10.0"
diff --git a/samples/react-search-refiners/spfx/src/webparts/searchResults/SearchResultsWebPart.ts b/samples/react-search-refiners/spfx/src/webparts/searchResults/SearchResultsWebPart.ts
index 0ca6e3ce7..27e63fd99 100644
--- a/samples/react-search-refiners/spfx/src/webparts/searchResults/SearchResultsWebPart.ts
+++ b/samples/react-search-refiners/spfx/src/webparts/searchResults/SearchResultsWebPart.ts
@@ -2,21 +2,21 @@
import * as ReactDom from 'react-dom';
import { Version, Text, Environment, EnvironmentType, DisplayMode, Log } from '@microsoft/sp-core-library';
import {
- BaseClientSideWebPart,
- IPropertyPaneConfiguration,
- PropertyPaneTextField,
- IWebPartPropertiesMetadata,
- PropertyPaneDynamicFieldSet,
- PropertyPaneDynamicField,
- DynamicDataSharedDepth,
- IPropertyPaneConditionalGroup,
- IPropertyPaneField,
- PropertyPaneToggle,
- PropertyPaneSlider,
- IPropertyPaneChoiceGroupOption,
- PropertyPaneChoiceGroup,
- PropertyPaneCheckbox,
- PropertyPaneHorizontalRule,
+ BaseClientSideWebPart,
+ IPropertyPaneConfiguration,
+ PropertyPaneTextField,
+ IWebPartPropertiesMetadata,
+ PropertyPaneDynamicFieldSet,
+ PropertyPaneDynamicField,
+ DynamicDataSharedDepth,
+ IPropertyPaneConditionalGroup,
+ IPropertyPaneField,
+ PropertyPaneToggle,
+ PropertyPaneSlider,
+ IPropertyPaneChoiceGroupOption,
+ PropertyPaneChoiceGroup,
+ PropertyPaneCheckbox,
+ PropertyPaneHorizontalRule,
} from '@microsoft/sp-webpart-base';
import * as strings from 'SearchResultsWebPartStrings';
import SearchResultsContainer from './components/SearchResultsContainer/SearchResultsContainer';
@@ -94,34 +94,34 @@ export default class SearchResultsWebPart extends BaseClientSideWebPart = React.createElement(
SearchResultsContainer,
{
@@ -163,7 +163,7 @@ export default class SearchResultsWebPart extends BaseClientSideWebPart {
this.initializeRequiredProperties();
@@ -195,11 +195,11 @@ export default class SearchResultsWebPart extends BaseClientSideWebPart {
+ let direction;
+ let kvp = sort.split(':');
+ if (kvp[1].toLocaleLowerCase().trim() === "ascending") {
+ direction = ISortFieldDirection.Ascending;
+ } else {
+ direction = ISortFieldDirection.Descending;
+ }
+
+ return {
+ sortField: kvp[0].trim(),
+ sortDirection: direction
+ } as ISortFieldConfiguration;
+ });
+ }
+
private _convertToSortList(sortList: ISortFieldConfiguration[]): Sort[] {
return sortList.map(e => {
-
+
let direction;
switch (e.sortDirection) {
@@ -247,31 +265,41 @@ export default class SearchResultsWebPart extends BaseClientSideWebPart {
// Code editor component for result types
@@ -330,10 +358,10 @@ export default class SearchResultsWebPart extends BaseClientSideWebPart 0) {
- itemProp = item[term[0]].map(e => { return e[term[1]]; }).join(',');
+ itemProp = item[term[0]].map(e => { return e[term[1]]; }).join(',');
} else {
- itemProp = item[term[0]][term[1]];
+ itemProp = item[term[0]][term[1]];
}
} else {
itemProp = item[pageProp];
@@ -548,7 +576,7 @@ export default class SearchResultsWebPart extends BaseClientSideWebPart[] {
-
+
// Sets up search settings fields
const searchSettingsFields: IPropertyPaneField[] = [
PropertyPaneTextField('queryTemplate', {
@@ -707,7 +735,7 @@ export default class SearchResultsWebPart extends BaseClientSideWebPart {
- return (
- React.createElement("div", null,
- React.createElement(this._textDialogComponent.TextDialog, {
- language: this._propertyFieldCodeEditorLanguages.Handlebars,
- dialogTextFieldValue: value ? value : dialogTextFieldValue,
- onChanged: (fieldValue) => onUpdate(field.id, fieldValue),
- strings: {
- cancelButtonText: strings.CancelButtonText,
- dialogButtonText: strings.DialogButtonText,
- dialogTitle: strings.DialogTitle,
- saveButtonText: strings.SaveButtonText
- }
- })
- )
- );
+ return (
+ React.createElement("div", null,
+ React.createElement(this._textDialogComponent.TextDialog, {
+ language: this._propertyFieldCodeEditorLanguages.Handlebars,
+ dialogTextFieldValue: value ? value : dialogTextFieldValue,
+ onChanged: (fieldValue) => onUpdate(field.id, fieldValue),
+ strings: {
+ cancelButtonText: strings.CancelButtonText,
+ dialogButtonText: strings.DialogButtonText,
+ dialogTitle: strings.DialogTitle,
+ saveButtonText: strings.SaveButtonText
+ }
+ })
+ )
+ );
}
},
{
@@ -943,9 +971,9 @@ export default class SearchResultsWebPart extends BaseClientSideWebPart renderer.id === (this.properties.selectedLayout as any));
- if(!this.properties.customTemplateFieldValues) {
+ if (!this.properties.customTemplateFieldValues) {
this.properties.customTemplateFieldValues = currentCodeRenderer.customFields.map(field => {
return {
fieldName: field,
@@ -953,7 +981,7 @@ export default class SearchResultsWebPart extends BaseClientSideWebPart 0) {
+ if (currentCodeRenderer.customFields && currentCodeRenderer.customFields.length > 0) {
const searchPropertyOptions = this.properties.selectedProperties.split(',').map(prop => {
return ({
key: prop,
@@ -980,7 +1008,7 @@ export default class SearchResultsWebPart extends BaseClientSideWebPart 0) {
+ if (registeredRenderers && registeredRenderers.length > 0) {
return registeredRenderers.map(ca => {
return {
key: ca.id,