diff --git a/samples/react-search/.gitignore b/samples/react-search/.gitignore index 29d9f19b2..9610e0f72 100644 --- a/samples/react-search/.gitignore +++ b/samples/react-search/.gitignore @@ -33,3 +33,6 @@ obj # Styles Generated Code *.scss.ts + +# VSCode settings +.vscode \ No newline at end of file diff --git a/samples/react-search/README.md b/samples/react-search/README.md index 8ffa5a9e3..1c1c0fcd4 100644 --- a/samples/react-search/README.md +++ b/samples/react-search/README.md @@ -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) ## 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 @@ -18,7 +18,7 @@ Sample Search Web Part with internal and external template support. This sample 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 @@ -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.6|October 19, 2016|Updates for drop 5. 0.1.0|January 18, 2017|Updates to support RC0. +1.0.0|February 28, 2017|Updates to support GA. ## 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.** diff --git a/samples/react-search/config/prepare-deploy.json b/samples/react-search/config/copy-assets.json similarity index 100% rename from samples/react-search/config/prepare-deploy.json rename to samples/react-search/config/copy-assets.json diff --git a/samples/react-search/config/tslint.json b/samples/react-search/config/tslint.json index 0010b6105..3c085daaf 100644 --- a/samples/react-search/config/tslint.json +++ b/samples/react-search/config/tslint.json @@ -16,13 +16,11 @@ "export-name": false, "forin": false, "label-position": false, - "label-undefined": false, "member-access": true, "no-arg": false, "no-console": false, "no-construct": false, "no-duplicate-case": true, - "no-duplicate-key": false, "no-duplicate-variable": true, "no-eval": false, "no-function-expression": true, @@ -32,8 +30,6 @@ "no-unnecessary-semicolons": true, "no-unused-expression": true, "no-unused-imports": true, - "no-unused-variable": true, - "no-unreachable": true, "no-use-before-declare": true, "no-with-statement": true, "semicolon": true, diff --git a/samples/react-search/package.json b/samples/react-search/package.json index 8be074831..a941bad2a 100644 --- a/samples/react-search/package.json +++ b/samples/react-search/package.json @@ -1,35 +1,33 @@ { "name": "search-wp-spfx", - "version": "0.1.0", + "version": "1.0.0", "private": true, "engines": { "node": ">=0.10.0" }, "dependencies": { - "@microsoft/sp-client-base": "~0.7.0", - "@microsoft/sp-client-preview": "~0.9.0", - "@microsoft/sp-core-library": "~0.1.2", - "@microsoft/sp-webpart-base": "~0.4.0", + "@microsoft/sp-client-base": "~1.0.0", + "@microsoft/sp-core-library": "~1.0.0", + "@microsoft/sp-webpart-base": "~1.0.0", "@types/react": "0.14.46", "@types/react-addons-shallow-compare": "0.14.17", "@types/react-addons-test-utils": "0.14.15", "@types/react-addons-update": "0.14.14", "@types/react-dom": "0.14.18", "@types/webpack-env": ">=1.12.1 <1.14.0", - "flux": "^3.1.2", - "moment": "^2.14.1", - "office-ui-fabric-react": "0.69.0", - "react": "0.14.8", - "react-dom": "0.14.8" + "flux": "3.1.2", + "moment": "2.17.1", + "react": "15.4.2", + "react-dom": "15.4.2" }, "devDependencies": { - "@microsoft/sp-build-web": "~0.9.0", - "@microsoft/sp-module-interfaces": "~0.7.0", - "@microsoft/sp-webpart-workbench": "~0.8.0", + "@microsoft/sp-build-web": "~1.0.0", + "@microsoft/sp-module-interfaces": "~1.0.0", + "@microsoft/sp-webpart-workbench": "~1.0.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", - "expose-loader": "^0.7.1", + "expose-loader": "0.7.3", "gulp": "~3.9.1" }, "scripts": { diff --git a/samples/react-search/src/webparts/searchSpfx/PropertyPaneControls/PropertyPaneLoggingFieldHost.tsx b/samples/react-search/src/webparts/searchSpfx/PropertyPaneControls/PropertyPaneLoggingFieldHost.tsx index bba4227f2..fa36af46a 100644 --- a/samples/react-search/src/webparts/searchSpfx/PropertyPaneControls/PropertyPaneLoggingFieldHost.tsx +++ b/samples/react-search/src/webparts/searchSpfx/PropertyPaneControls/PropertyPaneLoggingFieldHost.tsx @@ -1,6 +1,5 @@ import * as React from 'react'; import { IPropertyPaneLoggingFieldPropsInternal } from './PropertyPaneLoggingField'; -import { Label } from 'office-ui-fabric-react/lib/Label'; import styles from './PropertyPaneLoggingFieldStyling.module.scss'; @@ -97,7 +96,7 @@ export default class PropertyPaneLoggingFieldHost extends React.Component - + { (() => { if (typeof this.props.retrieve !== 'undefined') { diff --git a/samples/react-search/src/webparts/searchSpfx/SearchSpfx.module.scss b/samples/react-search/src/webparts/searchSpfx/components/SearchSpfx.module.scss similarity index 100% rename from samples/react-search/src/webparts/searchSpfx/SearchSpfx.module.scss rename to samples/react-search/src/webparts/searchSpfx/components/SearchSpfx.module.scss diff --git a/samples/react-search/src/webparts/searchSpfx/components/SearchSpfx.tsx b/samples/react-search/src/webparts/searchSpfx/components/SearchSpfx.tsx index 9ffd6bd29..2cfab852e 100644 --- a/samples/react-search/src/webparts/searchSpfx/components/SearchSpfx.tsx +++ b/samples/react-search/src/webparts/searchSpfx/components/SearchSpfx.tsx @@ -9,6 +9,8 @@ import { IExternalTemplate } from '../utils/ITemplates'; import TemplateLoader from '../templates/TemplateLoader'; +import 'SearchSpfx.module.scss'; + export interface ISearchSpfxProps extends ISearchSpfxWebPartProps { context: IWebPartContext; firstRender: Boolean; diff --git a/samples/react-search/src/webparts/searchSpfx/flux/stores/searchStore.ts b/samples/react-search/src/webparts/searchSpfx/flux/stores/searchStore.ts index 23caa23b7..180c41093 100644 --- a/samples/react-search/src/webparts/searchSpfx/flux/stores/searchStore.ts +++ b/samples/react-search/src/webparts/searchSpfx/flux/stores/searchStore.ts @@ -5,8 +5,8 @@ import SearchTokenHelper from '../helpers/SearchTokenHelper'; import { IWebPartContext } from '@microsoft/sp-webpart-base'; import { ISearchResults, ICells, ICellValue } from '../../utils/ISearchResults'; -import { SPHttpClientConfigurations} from '@microsoft/sp-http'; -import { EventEmitter } from 'eventemitter3'; +import { SPHttpClient } from '@microsoft/sp-http'; +import { EventEmitter } from 'fbemitter'; const CHANGE_EVENT: string = 'change'; @@ -19,14 +19,14 @@ export class SearchStoreStatic extends EventEmitter { * @param {function} callback */ public addChangeListener(callback): void { - this.on(CHANGE_EVENT, callback); + this.addListener(CHANGE_EVENT, callback); } /** * @param {function} callback */ public removeChangeListener(callback): void { - this.removeListener(CHANGE_EVENT, callback); + this.removeCurrentListener(); } public emitChange(): void { @@ -64,7 +64,7 @@ export class SearchStoreStatic extends EventEmitter { * @param {string} url */ public GetSearchData (context: IWebPartContext, url: string): Promise { - return context.spHttpClient.get(url, SPHttpClientConfigurations.v1).then((res: Response) => { + return context.spHttpClient.get(url, SPHttpClient.configurations.v1).then((res: Response) => { return res.json(); }); } diff --git a/samples/react-search/src/webparts/searchSpfx/templates/DefaultTemplate.tsx b/samples/react-search/src/webparts/searchSpfx/templates/DefaultTemplate.tsx index eb4ba9e02..e4e5e5b9e 100644 --- a/samples/react-search/src/webparts/searchSpfx/templates/DefaultTemplate.tsx +++ b/samples/react-search/src/webparts/searchSpfx/templates/DefaultTemplate.tsx @@ -1,6 +1,6 @@ import * as React from 'react'; -import styles from '../SearchSpfx.module.scss'; +import styles from '../components/SearchSpfx.module.scss'; import { ISearchSpfxWebPartProps } from '../ISearchSpfxWebPartProps'; export interface IDefaultTemplate extends ISearchSpfxWebPartProps { diff --git a/samples/react-search/src/webparts/searchSpfx/templates/TableTemplate.tsx b/samples/react-search/src/webparts/searchSpfx/templates/TableTemplate.tsx index 9c1c01d60..4ceaaed21 100644 --- a/samples/react-search/src/webparts/searchSpfx/templates/TableTemplate.tsx +++ b/samples/react-search/src/webparts/searchSpfx/templates/TableTemplate.tsx @@ -1,8 +1,7 @@ import * as React from 'react'; -import { css } from 'office-ui-fabric-react'; import { SPComponentLoader } from '@microsoft/sp-loader'; -import styles from '../SearchSpfx.module.scss'; +import styles from '../components/SearchSpfx.module.scss'; import { ISearchSpfxWebPartProps } from '../ISearchSpfxWebPartProps'; import * as moment from 'moment'; @@ -47,7 +46,7 @@ export default class TableTemplate extends React.Component { })() } - +
diff --git a/samples/react-search/tsconfig.json b/samples/react-search/tsconfig.json index ab2c1db8c..78258bdcd 100644 --- a/samples/react-search/tsconfig.json +++ b/samples/react-search/tsconfig.json @@ -7,6 +7,8 @@ "declaration": true, "sourceMap": true, "types": [ + "es6-promise", + "es6-collections", "webpack-env" ] } diff --git a/samples/react-search/tsd.json b/samples/react-search/tsd.json deleted file mode 100644 index ad5b996ea..000000000 --- a/samples/react-search/tsd.json +++ /dev/null @@ -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" - } - } -}
Type