From 52164e34c9e69ebb4871929eafa039059af1815a Mon Sep 17 00:00:00 2001 From: Elio Struyf Date: Wed, 19 Oct 2016 21:12:39 +0200 Subject: [PATCH 1/2] Updates for Drop 5 (#47) --- samples/react-search/README.md | 3 +++ samples/react-search/config/config.json | 1 + samples/react-search/package.json | 15 ++++++------ .../PropertyPaneLoggingField.ts | 2 +- .../webparts/searchSpfx/SearchSpfxWebPart.ts | 23 ++++--------------- .../searchSpfx/components/SearchSpfx.tsx | 2 +- .../searchSpfx/flux/actions/ISearchAction.ts | 2 +- .../searchSpfx/flux/actions/searchActions.ts | 2 +- .../flux/helpers/SearchTokenHelper.ts | 2 +- .../searchSpfx/flux/stores/searchStore.ts | 2 +- .../searchSpfx/templates/TableTemplate.tsx | 2 +- 11 files changed, 23 insertions(+), 33 deletions(-) diff --git a/samples/react-search/README.md b/samples/react-search/README.md index 5a65a8b01..487d80bf6 100644 --- a/samples/react-search/README.md +++ b/samples/react-search/README.md @@ -23,6 +23,7 @@ Version|Date|Comments -------|----|-------- 0.0.4|September 08, 2016|Initial release 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. ## 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.** @@ -61,6 +62,8 @@ External templates can be loaded from an URL. If you want to test out this functionality, you can find a couple of sample templates in the [external templates]('./external_templates') folder. Upload one of these templates to your site, copy the file location and past it in the textbox. +> There is a sample project which you can use to create your own external templates. You can find it here: [Search WP SPFx Template Generator](https://github.com/estruyf/search-wp-spfx-templategenerator). + This Web Part illustrates the following concepts on top of the SharePoint Framework: - using React and the Flux pattern with TypeScript for building SharePoint Framework Client-Side Web Parts diff --git a/samples/react-search/config/config.json b/samples/react-search/config/config.json index 282b3d03c..6bec82716 100644 --- a/samples/react-search/config/config.json +++ b/samples/react-search/config/config.json @@ -9,6 +9,7 @@ "externals": { "@microsoft/sp-client-base": "node_modules/@microsoft/sp-client-base/dist/sp-client-base.js", "@microsoft/sp-client-preview": "node_modules/@microsoft/sp-client-preview/dist/sp-client-preview.js", + "@microsoft/sp-webpart-base": "node_modules/@microsoft/sp-webpart-base/dist/sp-webpart-base.js", "@microsoft/sp-lodash-subset": "node_modules/@microsoft/sp-lodash-subset/dist/sp-lodash-subset.js", "office-ui-fabric-react": "node_modules/office-ui-fabric-react/dist/office-ui-fabric-react.js", "react": "node_modules/react/dist/react.min.js", diff --git a/samples/react-search/package.json b/samples/react-search/package.json index 3daaf5e50..77d557fe7 100644 --- a/samples/react-search/package.json +++ b/samples/react-search/package.json @@ -1,13 +1,14 @@ { "name": "search-wp-spfx", - "version": "0.0.5", + "version": "0.0.6", "private": true, "engines": { "node": ">=0.10.0" }, "dependencies": { - "@microsoft/sp-client-base": "~0.3.0", - "@microsoft/sp-client-preview": "~0.4.0", + "@microsoft/sp-client-base": "~0.4.0", + "@microsoft/sp-client-preview": "~0.5.0", + "@microsoft/sp-webpart-base": "^0.1.0", "flux": "^2.1.1", "moment": "^2.14.1", "office-ui-fabric-react": "0.36.0", @@ -15,9 +16,9 @@ "react-dom": "0.14.8" }, "devDependencies": { - "@microsoft/sp-build-web": "~0.6.0", - "@microsoft/sp-module-interfaces": "~0.3.0", - "@microsoft/sp-webpart-workbench": "~0.4.0", + "@microsoft/sp-build-web": "~0.7.0", + "@microsoft/sp-module-interfaces": "~0.4.0", + "@microsoft/sp-webpart-workbench": "~0.5.0", "expose-loader": "^0.7.1", "gulp": "~3.9.1" }, @@ -26,4 +27,4 @@ "clean": "gulp nuke", "test": "gulp test" } -} \ No newline at end of file +} diff --git a/samples/react-search/src/webparts/searchSpfx/PropertyPaneControls/PropertyPaneLoggingField.ts b/samples/react-search/src/webparts/searchSpfx/PropertyPaneControls/PropertyPaneLoggingField.ts index 8188050b9..c3013917f 100644 --- a/samples/react-search/src/webparts/searchSpfx/PropertyPaneControls/PropertyPaneLoggingField.ts +++ b/samples/react-search/src/webparts/searchSpfx/PropertyPaneControls/PropertyPaneLoggingField.ts @@ -4,7 +4,7 @@ import * as ReactDom from 'react-dom'; import { IPropertyPaneField, IPropertyPaneFieldType -} from '@microsoft/sp-client-preview'; +} from '@microsoft/sp-webpart-base'; import { IPropertyPaneLoggingFieldProps } from './IPropertyPaneLoggingFieldProps'; import PropertyPaneLoggingFieldHost, { IPropertyPaneLoggingFieldHostProps } from './PropertyPaneLoggingFieldHost'; diff --git a/samples/react-search/src/webparts/searchSpfx/SearchSpfxWebPart.ts b/samples/react-search/src/webparts/searchSpfx/SearchSpfxWebPart.ts index 028db0deb..427c1e3a2 100644 --- a/samples/react-search/src/webparts/searchSpfx/SearchSpfxWebPart.ts +++ b/samples/react-search/src/webparts/searchSpfx/SearchSpfxWebPart.ts @@ -8,7 +8,7 @@ import { PropertyPaneDropdown, PropertyPaneSlider, PropertyPaneToggle -} from '@microsoft/sp-client-preview'; +} from '@microsoft/sp-webpart-base'; import { PropertyPaneLoggingField } from './PropertyPaneControls/PropertyPaneLoggingField'; @@ -190,21 +190,6 @@ export default class SearchSpfxWebPart extends BaseClientSideWebPart { this.props.results.map((result, index) => { return ( - + {result.Filename !== null ? result.Filename.substring(0, result.Filename.lastIndexOf('.')) : ""} From 6edbb5c5ce6b7ce4c788df2922e7625bae3ca1d2 Mon Sep 17 00:00:00 2001 From: Vardhaman Deshpande Date: Wed, 19 Oct 2016 20:13:04 +0100 Subject: [PATCH 2/2] Updated to drop 5, changed mock image urls (#46) * removed unused imports, changed image urls * updated to drop 5 --- samples/react-organisationchart/package.json | 14 +++++++------- .../IOrganisationChartWebPartProps.ts | 2 -- .../mocks/MockUserProfileService.ts | 10 +++++----- 3 files changed, 12 insertions(+), 14 deletions(-) diff --git a/samples/react-organisationchart/package.json b/samples/react-organisationchart/package.json index 105cc9ca6..215cc0f6b 100644 --- a/samples/react-organisationchart/package.json +++ b/samples/react-organisationchart/package.json @@ -6,18 +6,18 @@ "node": ">=0.10.0" }, "dependencies": { - "@microsoft/sp-client-base": "~0.2.1", - "@microsoft/sp-client-preview": "~0.3.0", - "office-ui-fabric-react": "0.36.0", + "@microsoft/sp-client-base": "~0.4.0", + "@microsoft/sp-client-preview": "~0.5.0", + "office-ui-fabric-react": "0.52.0", "react": "0.14.8", "react-dom": "0.14.8" }, "devDependencies": { - "@microsoft/sp-build-web": "~0.5.0", - "@microsoft/sp-module-interfaces": "~0.2.0", - "@microsoft/sp-webpart-workbench": "~0.3.0", + "@microsoft/sp-build-web": "~0.7.0", + "@microsoft/sp-module-interfaces": "~0.4.0", + "@microsoft/sp-webpart-workbench": "~0.5.0", "gulp": "~3.9.1", - "office-ui-fabric": "2.6.1" + "office-ui-fabric": "2.6.2" }, "scripts": { "build": "gulp bundle", diff --git a/samples/react-organisationchart/src/webparts/organisationChart/IOrganisationChartWebPartProps.ts b/samples/react-organisationchart/src/webparts/organisationChart/IOrganisationChartWebPartProps.ts index 3bd6b81e6..40d0ad0bb 100644 --- a/samples/react-organisationchart/src/webparts/organisationChart/IOrganisationChartWebPartProps.ts +++ b/samples/react-organisationchart/src/webparts/organisationChart/IOrganisationChartWebPartProps.ts @@ -1,5 +1,3 @@ -import { ServiceScope, EnvironmentType } from '@microsoft/sp-client-base'; - export interface IOrganisationChartWebPartProps { description: string; } diff --git a/samples/react-organisationchart/src/webparts/organisationChart/mocks/MockUserProfileService.ts b/samples/react-organisationchart/src/webparts/organisationChart/mocks/MockUserProfileService.ts index 2bd90d900..4d20cbea8 100644 --- a/samples/react-organisationchart/src/webparts/organisationChart/mocks/MockUserProfileService.ts +++ b/samples/react-organisationchart/src/webparts/organisationChart/mocks/MockUserProfileService.ts @@ -11,7 +11,7 @@ export class MockUserProfileService implements IUserProfileService { public getPropertiesForCurrentUser(): Promise { return new Promise((resolve, reject) => { - const user: IPerson = { Title: "Consultant", DisplayName: "Adam Jones", PictureUrl: "http://dev.office.com/Modules/DevOffice.Fabric/Fabric/components/persona/Persona.Person2.png" }; + const user: IPerson = { Title: "Consultant", DisplayName: "Adam Jones", PictureUrl: "https://raw.githubusercontent.com/OfficeDev/office-ui-fabric-react/master/images/persona-male.png" }; resolve(user); }); } @@ -20,8 +20,8 @@ export class MockUserProfileService implements IUserProfileService { return new Promise((resolve, reject) => { const users: IPerson[] = []; - users.push({ Title: "Manager", DisplayName: "Grant Steel", PictureUrl: "http://dev.office.com/Modules/DevOffice.Fabric/Fabric/components/persona/Persona.Person2.png" }); - users.push({ Title: "Head of Management", DisplayName: "Marcel Grose", PictureUrl: "http://dev.office.com/Modules/DevOffice.Fabric/Fabric/components/persona/Persona.Person2.png" }); + users.push({ Title: "Manager", DisplayName: "Grant Steel", PictureUrl: "https://raw.githubusercontent.com/OfficeDev/office-ui-fabric-react/master/images/persona-male.png" }); + users.push({ Title: "Head of Management", DisplayName: "Marcel Grose", PictureUrl: "https://raw.githubusercontent.com/OfficeDev/office-ui-fabric-react/master/images/persona-female.png" }); resolve(users); }); @@ -31,8 +31,8 @@ export class MockUserProfileService implements IUserProfileService { return new Promise((resolve, reject) => { const users: IPerson[] = []; - users.push({ Title: "Developer", DisplayName: "Russel Miller", PictureUrl: "http://dev.office.com/Modules/DevOffice.Fabric/Fabric/components/persona/Persona.Person2.png" }); - users.push({ Title: "IT Admin", DisplayName: "Robert Fischer", PictureUrl: "http://dev.office.com/Modules/DevOffice.Fabric/Fabric/components/persona/Persona.Person2.png" }); + users.push({ Title: "Developer", DisplayName: "Russel Miller", PictureUrl: "https://raw.githubusercontent.com/OfficeDev/office-ui-fabric-react/master/images/persona-female.png" }); + users.push({ Title: "IT Admin", DisplayName: "Robert Fischer", PictureUrl: "https://raw.githubusercontent.com/OfficeDev/office-ui-fabric-react/master/images/persona-male.png" }); resolve(users); });