React-search sample updated to support GA (#135)
This commit is contained in:
parent
52b33e32f4
commit
4ee9218ba5
|
@ -33,3 +33,6 @@ obj
|
||||||
|
|
||||||
# Styles Generated Code
|
# Styles Generated Code
|
||||||
*.scss.ts
|
*.scss.ts
|
||||||
|
|
||||||
|
# VSCode settings
|
||||||
|
.vscode
|
|
@ -7,7 +7,7 @@ Sample Search Web Part with internal and external template support. This sample
|
||||||
![Sample of the search web part](./assets/preview.png)
|
![Sample of the search web part](./assets/preview.png)
|
||||||
|
|
||||||
## Used SharePoint Framework Version
|
## Used SharePoint Framework Version
|
||||||
![drop](https://img.shields.io/badge/drop-RC0-green.svg)
|
![drop](https://img.shields.io/badge/drop-GA-green.svg)
|
||||||
|
|
||||||
## Applies to
|
## Applies to
|
||||||
|
|
||||||
|
@ -18,7 +18,7 @@ Sample Search Web Part with internal and external template support. This sample
|
||||||
|
|
||||||
Solution|Author(s)
|
Solution|Author(s)
|
||||||
--------|---------
|
--------|---------
|
||||||
react-search-wp|Elio Struyf (MVP, Ventigrate, [@eliostruyf](https://twitter.com/eliostruyf))
|
react-search-wp|Elio Struyf (MVP, U2U, [@eliostruyf](https://twitter.com/eliostruyf))
|
||||||
|
|
||||||
## Version history
|
## Version history
|
||||||
|
|
||||||
|
@ -28,6 +28,7 @@ Version|Date|Comments
|
||||||
0.0.5|September 27, 2016|Updates for drop 4. Added the abilty to use various search tokens. Plus a logging field to watch search calls.
|
0.0.5|September 27, 2016|Updates for drop 4. Added the abilty to use various search tokens. Plus a logging field to watch search calls.
|
||||||
0.0.6|October 19, 2016|Updates for drop 5.
|
0.0.6|October 19, 2016|Updates for drop 5.
|
||||||
0.1.0|January 18, 2017|Updates to support RC0.
|
0.1.0|January 18, 2017|Updates to support RC0.
|
||||||
|
1.0.0|February 28, 2017|Updates to support GA.
|
||||||
|
|
||||||
## Disclaimer
|
## Disclaimer
|
||||||
**THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.**
|
**THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.**
|
||||||
|
|
|
@ -16,13 +16,11 @@
|
||||||
"export-name": false,
|
"export-name": false,
|
||||||
"forin": false,
|
"forin": false,
|
||||||
"label-position": false,
|
"label-position": false,
|
||||||
"label-undefined": false,
|
|
||||||
"member-access": true,
|
"member-access": true,
|
||||||
"no-arg": false,
|
"no-arg": false,
|
||||||
"no-console": false,
|
"no-console": false,
|
||||||
"no-construct": false,
|
"no-construct": false,
|
||||||
"no-duplicate-case": true,
|
"no-duplicate-case": true,
|
||||||
"no-duplicate-key": false,
|
|
||||||
"no-duplicate-variable": true,
|
"no-duplicate-variable": true,
|
||||||
"no-eval": false,
|
"no-eval": false,
|
||||||
"no-function-expression": true,
|
"no-function-expression": true,
|
||||||
|
@ -32,8 +30,6 @@
|
||||||
"no-unnecessary-semicolons": true,
|
"no-unnecessary-semicolons": true,
|
||||||
"no-unused-expression": true,
|
"no-unused-expression": true,
|
||||||
"no-unused-imports": true,
|
"no-unused-imports": true,
|
||||||
"no-unused-variable": true,
|
|
||||||
"no-unreachable": true,
|
|
||||||
"no-use-before-declare": true,
|
"no-use-before-declare": true,
|
||||||
"no-with-statement": true,
|
"no-with-statement": true,
|
||||||
"semicolon": true,
|
"semicolon": true,
|
||||||
|
|
|
@ -1,35 +1,33 @@
|
||||||
{
|
{
|
||||||
"name": "search-wp-spfx",
|
"name": "search-wp-spfx",
|
||||||
"version": "0.1.0",
|
"version": "1.0.0",
|
||||||
"private": true,
|
"private": true,
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">=0.10.0"
|
"node": ">=0.10.0"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@microsoft/sp-client-base": "~0.7.0",
|
"@microsoft/sp-client-base": "~1.0.0",
|
||||||
"@microsoft/sp-client-preview": "~0.9.0",
|
"@microsoft/sp-core-library": "~1.0.0",
|
||||||
"@microsoft/sp-core-library": "~0.1.2",
|
"@microsoft/sp-webpart-base": "~1.0.0",
|
||||||
"@microsoft/sp-webpart-base": "~0.4.0",
|
|
||||||
"@types/react": "0.14.46",
|
"@types/react": "0.14.46",
|
||||||
"@types/react-addons-shallow-compare": "0.14.17",
|
"@types/react-addons-shallow-compare": "0.14.17",
|
||||||
"@types/react-addons-test-utils": "0.14.15",
|
"@types/react-addons-test-utils": "0.14.15",
|
||||||
"@types/react-addons-update": "0.14.14",
|
"@types/react-addons-update": "0.14.14",
|
||||||
"@types/react-dom": "0.14.18",
|
"@types/react-dom": "0.14.18",
|
||||||
"@types/webpack-env": ">=1.12.1 <1.14.0",
|
"@types/webpack-env": ">=1.12.1 <1.14.0",
|
||||||
"flux": "^3.1.2",
|
"flux": "3.1.2",
|
||||||
"moment": "^2.14.1",
|
"moment": "2.17.1",
|
||||||
"office-ui-fabric-react": "0.69.0",
|
"react": "15.4.2",
|
||||||
"react": "0.14.8",
|
"react-dom": "15.4.2"
|
||||||
"react-dom": "0.14.8"
|
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@microsoft/sp-build-web": "~0.9.0",
|
"@microsoft/sp-build-web": "~1.0.0",
|
||||||
"@microsoft/sp-module-interfaces": "~0.7.0",
|
"@microsoft/sp-module-interfaces": "~1.0.0",
|
||||||
"@microsoft/sp-webpart-workbench": "~0.8.0",
|
"@microsoft/sp-webpart-workbench": "~1.0.0",
|
||||||
"@types/chai": ">=3.4.34 <3.6.0",
|
"@types/chai": ">=3.4.34 <3.6.0",
|
||||||
"@types/flux": "^3.0.0",
|
"@types/flux": "3.0.1",
|
||||||
"@types/mocha": ">=2.2.33 <2.6.0",
|
"@types/mocha": ">=2.2.33 <2.6.0",
|
||||||
"expose-loader": "^0.7.1",
|
"expose-loader": "0.7.3",
|
||||||
"gulp": "~3.9.1"
|
"gulp": "~3.9.1"
|
||||||
},
|
},
|
||||||
"scripts": {
|
"scripts": {
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
import * as React from 'react';
|
import * as React from 'react';
|
||||||
import { IPropertyPaneLoggingFieldPropsInternal } from './PropertyPaneLoggingField';
|
import { IPropertyPaneLoggingFieldPropsInternal } from './PropertyPaneLoggingField';
|
||||||
import { Label } from 'office-ui-fabric-react/lib/Label';
|
|
||||||
|
|
||||||
import styles from './PropertyPaneLoggingFieldStyling.module.scss';
|
import styles from './PropertyPaneLoggingFieldStyling.module.scss';
|
||||||
|
|
||||||
|
@ -97,7 +96,7 @@ export default class PropertyPaneLoggingFieldHost extends React.Component<IPrope
|
||||||
//Renders content
|
//Renders content
|
||||||
return (
|
return (
|
||||||
<div className={styles.loggingField}>
|
<div className={styles.loggingField}>
|
||||||
<Label>{this.props.label}</Label>
|
<label className="ms-Label">{this.props.label}</label>
|
||||||
{
|
{
|
||||||
(() => {
|
(() => {
|
||||||
if (typeof this.props.retrieve !== 'undefined') {
|
if (typeof this.props.retrieve !== 'undefined') {
|
||||||
|
|
|
@ -9,6 +9,8 @@ import { IExternalTemplate } from '../utils/ITemplates';
|
||||||
|
|
||||||
import TemplateLoader from '../templates/TemplateLoader';
|
import TemplateLoader from '../templates/TemplateLoader';
|
||||||
|
|
||||||
|
import 'SearchSpfx.module.scss';
|
||||||
|
|
||||||
export interface ISearchSpfxProps extends ISearchSpfxWebPartProps {
|
export interface ISearchSpfxProps extends ISearchSpfxWebPartProps {
|
||||||
context: IWebPartContext;
|
context: IWebPartContext;
|
||||||
firstRender: Boolean;
|
firstRender: Boolean;
|
||||||
|
|
|
@ -5,8 +5,8 @@ import SearchTokenHelper from '../helpers/SearchTokenHelper';
|
||||||
import { IWebPartContext } from '@microsoft/sp-webpart-base';
|
import { IWebPartContext } from '@microsoft/sp-webpart-base';
|
||||||
import { ISearchResults, ICells, ICellValue } from '../../utils/ISearchResults';
|
import { ISearchResults, ICells, ICellValue } from '../../utils/ISearchResults';
|
||||||
|
|
||||||
import { SPHttpClientConfigurations} from '@microsoft/sp-http';
|
import { SPHttpClient } from '@microsoft/sp-http';
|
||||||
import { EventEmitter } from 'eventemitter3';
|
import { EventEmitter } from 'fbemitter';
|
||||||
|
|
||||||
const CHANGE_EVENT: string = 'change';
|
const CHANGE_EVENT: string = 'change';
|
||||||
|
|
||||||
|
@ -19,14 +19,14 @@ export class SearchStoreStatic extends EventEmitter {
|
||||||
* @param {function} callback
|
* @param {function} callback
|
||||||
*/
|
*/
|
||||||
public addChangeListener(callback): void {
|
public addChangeListener(callback): void {
|
||||||
this.on(CHANGE_EVENT, callback);
|
this.addListener(CHANGE_EVENT, callback);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {function} callback
|
* @param {function} callback
|
||||||
*/
|
*/
|
||||||
public removeChangeListener(callback): void {
|
public removeChangeListener(callback): void {
|
||||||
this.removeListener(CHANGE_EVENT, callback);
|
this.removeCurrentListener();
|
||||||
}
|
}
|
||||||
|
|
||||||
public emitChange(): void {
|
public emitChange(): void {
|
||||||
|
@ -64,7 +64,7 @@ export class SearchStoreStatic extends EventEmitter {
|
||||||
* @param {string} url
|
* @param {string} url
|
||||||
*/
|
*/
|
||||||
public GetSearchData (context: IWebPartContext, url: string): Promise<ISearchResults> {
|
public GetSearchData (context: IWebPartContext, url: string): Promise<ISearchResults> {
|
||||||
return context.spHttpClient.get(url, SPHttpClientConfigurations.v1).then((res: Response) => {
|
return context.spHttpClient.get(url, SPHttpClient.configurations.v1).then((res: Response) => {
|
||||||
return res.json();
|
return res.json();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
import * as React from 'react';
|
import * as React from 'react';
|
||||||
|
|
||||||
import styles from '../SearchSpfx.module.scss';
|
import styles from '../components/SearchSpfx.module.scss';
|
||||||
import { ISearchSpfxWebPartProps } from '../ISearchSpfxWebPartProps';
|
import { ISearchSpfxWebPartProps } from '../ISearchSpfxWebPartProps';
|
||||||
|
|
||||||
export interface IDefaultTemplate extends ISearchSpfxWebPartProps {
|
export interface IDefaultTemplate extends ISearchSpfxWebPartProps {
|
||||||
|
|
|
@ -1,8 +1,7 @@
|
||||||
import * as React from 'react';
|
import * as React from 'react';
|
||||||
import { css } from 'office-ui-fabric-react';
|
|
||||||
import { SPComponentLoader } from '@microsoft/sp-loader';
|
import { SPComponentLoader } from '@microsoft/sp-loader';
|
||||||
|
|
||||||
import styles from '../SearchSpfx.module.scss';
|
import styles from '../components/SearchSpfx.module.scss';
|
||||||
import { ISearchSpfxWebPartProps } from '../ISearchSpfxWebPartProps';
|
import { ISearchSpfxWebPartProps } from '../ISearchSpfxWebPartProps';
|
||||||
|
|
||||||
import * as moment from 'moment';
|
import * as moment from 'moment';
|
||||||
|
@ -47,7 +46,7 @@ export default class TableTemplate extends React.Component<ITableTemplate, {}> {
|
||||||
})()
|
})()
|
||||||
}
|
}
|
||||||
|
|
||||||
<table className={css('ms-Table', styles.templateTable)}>
|
<table className={`ms-Table ${styles.templateTable}`}>
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
<th>Type</th>
|
<th>Type</th>
|
||||||
|
|
|
@ -7,6 +7,8 @@
|
||||||
"declaration": true,
|
"declaration": true,
|
||||||
"sourceMap": true,
|
"sourceMap": true,
|
||||||
"types": [
|
"types": [
|
||||||
|
"es6-promise",
|
||||||
|
"es6-collections",
|
||||||
"webpack-env"
|
"webpack-env"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,54 +0,0 @@
|
||||||
{
|
|
||||||
"version": "v4",
|
|
||||||
"repo": "borisyankov/DefinitelyTyped",
|
|
||||||
"ref": "master",
|
|
||||||
"path": "typings",
|
|
||||||
"bundle": "typings/tsd.d.ts",
|
|
||||||
"installed": {
|
|
||||||
"combokeys/combokeys.d.ts": {
|
|
||||||
"commit": "88c0d5f868bc184d70b6799d36b1946787beb48d"
|
|
||||||
},
|
|
||||||
"immutable/immutable.d.ts": {
|
|
||||||
"commit": "f15deaa4ee778667791b2a25362e37d3cc10592d"
|
|
||||||
},
|
|
||||||
"fbemitter/fbemitter.d.ts": {
|
|
||||||
"commit": "f15deaa4ee778667791b2a25362e37d3cc10592d"
|
|
||||||
},
|
|
||||||
"react/react.d.ts": {
|
|
||||||
"commit": "f15deaa4ee778667791b2a25362e37d3cc10592d"
|
|
||||||
},
|
|
||||||
"flux/flux.d.ts": {
|
|
||||||
"commit": "f15deaa4ee778667791b2a25362e37d3cc10592d"
|
|
||||||
},
|
|
||||||
"react/react-addons-create-fragment.d.ts": {
|
|
||||||
"commit": "f15deaa4ee778667791b2a25362e37d3cc10592d"
|
|
||||||
},
|
|
||||||
"react/react-global.d.ts": {
|
|
||||||
"commit": "f15deaa4ee778667791b2a25362e37d3cc10592d"
|
|
||||||
},
|
|
||||||
"react/react-addons-css-transition-group.d.ts": {
|
|
||||||
"commit": "f15deaa4ee778667791b2a25362e37d3cc10592d"
|
|
||||||
},
|
|
||||||
"react/react-addons-transition-group.d.ts": {
|
|
||||||
"commit": "f15deaa4ee778667791b2a25362e37d3cc10592d"
|
|
||||||
},
|
|
||||||
"react/react-addons-perf.d.ts": {
|
|
||||||
"commit": "f15deaa4ee778667791b2a25362e37d3cc10592d"
|
|
||||||
},
|
|
||||||
"react/react-addons-linked-state-mixin.d.ts": {
|
|
||||||
"commit": "f15deaa4ee778667791b2a25362e37d3cc10592d"
|
|
||||||
},
|
|
||||||
"react/react-addons-pure-render-mixin.d.ts": {
|
|
||||||
"commit": "f15deaa4ee778667791b2a25362e37d3cc10592d"
|
|
||||||
},
|
|
||||||
"react/react-dom.d.ts": {
|
|
||||||
"commit": "f15deaa4ee778667791b2a25362e37d3cc10592d"
|
|
||||||
},
|
|
||||||
"react/react-addons-update.d.ts": {
|
|
||||||
"commit": "f15deaa4ee778667791b2a25362e37d3cc10592d"
|
|
||||||
},
|
|
||||||
"react/react-addons-test-utils.d.ts": {
|
|
||||||
"commit": "f15deaa4ee778667791b2a25362e37d3cc10592d"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
Loading…
Reference in New Issue