Updates for Drop 5 (#47)
This commit is contained in:
parent
9ed8f8d9c2
commit
52164e34c9
|
@ -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
|
||||
|
|
|
@ -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",
|
||||
|
|
|
@ -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"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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';
|
||||
|
|
|
@ -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<ISearchSpfx
|
|||
this.removeChangeBinding = setTimeout(this.removeLogging, 500);
|
||||
}
|
||||
|
||||
// protected onPropertyPaneConfigurationStart() {
|
||||
// // Will probably be deleted in the next drop
|
||||
// console.log('onPropertyPaneConfigurationStart');
|
||||
// }
|
||||
|
||||
// protected onAfterPropertyPaneChangesApplied() {
|
||||
// // Will probably be deleted in the next drop
|
||||
// console.log('onAfterPropertyPaneChangesApplied');
|
||||
// }
|
||||
|
||||
// Will probably be added in the next drop
|
||||
// protected onPropertyPaneSave() {
|
||||
// console.log('onPropertyPaneSave');
|
||||
// }
|
||||
|
||||
/**
|
||||
* Property pane settings
|
||||
*/
|
||||
|
@ -231,9 +216,6 @@ export default class SearchSpfxWebPart extends BaseClientSideWebPart<ISearchSpfx
|
|||
groups: [{
|
||||
groupName: strings.BasicGroupName,
|
||||
groupFields: [
|
||||
PropertyPaneTextField('title', {
|
||||
label: strings.FieldsTitleLabel
|
||||
}),
|
||||
PropertyPaneTextField('query', {
|
||||
label: strings.QueryFieldLabel,
|
||||
description: strings.QueryInfoDescription,
|
||||
|
@ -251,6 +233,9 @@ export default class SearchSpfxWebPart extends BaseClientSideWebPart<ISearchSpfx
|
|||
}, {
|
||||
groupName: strings.TemplateGroupName,
|
||||
groupFields: [
|
||||
PropertyPaneTextField('title', {
|
||||
label: strings.FieldsTitleLabel
|
||||
}),
|
||||
PropertyPaneToggle('external', {
|
||||
label: strings.FieldsExternalLabel
|
||||
}),
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import * as React from 'react';
|
||||
import { ISearchSpfxWebPartProps } from '../ISearchSpfxWebPartProps';
|
||||
import { IWebPartContext } from '@microsoft/sp-client-preview';
|
||||
import { IWebPartContext } from '@microsoft/sp-webpart-base';
|
||||
|
||||
import searchActions from '../flux/actions/searchActions';
|
||||
import searchStore from '../flux/stores/searchStore';
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import {IWebPartContext} from '@microsoft/sp-client-preview';
|
||||
import {IWebPartContext} from '@microsoft/sp-webpart-base';
|
||||
export interface ISearchAction {
|
||||
actionType: Number;
|
||||
context?: IWebPartContext;
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import appDispatcher from '../dispatcher/appDispatcher';
|
||||
import searchActionIDs from './searchActionIDs';
|
||||
import {IWebPartContext} from '@microsoft/sp-client-preview';
|
||||
import {IWebPartContext} from '@microsoft/sp-webpart-base';
|
||||
|
||||
export class SearchActionsStatic {
|
||||
/**
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import { IWebPartContext } from '@microsoft/sp-client-preview';
|
||||
import { IWebPartContext } from '@microsoft/sp-webpart-base';
|
||||
import { IPageContext } from '../../utils/IPageContext';
|
||||
|
||||
import * as moment from 'moment';
|
||||
|
|
|
@ -3,7 +3,7 @@ import searchActionIDs from '../actions/searchActionIDs';
|
|||
import SearchTokenHelper from '../helpers/SearchTokenHelper';
|
||||
import { EventEmitter } from 'events';
|
||||
|
||||
import { IWebPartContext } from '@microsoft/sp-client-preview';
|
||||
import { IWebPartContext } from '@microsoft/sp-webpart-base';
|
||||
import { ISearchResults, ICells, ICellValue } from '../../utils/ISearchResults';
|
||||
|
||||
const CHANGE_EVENT: string = 'change';
|
||||
|
|
|
@ -61,7 +61,7 @@ export default class TableTemplate extends React.Component<ITableTemplate, {}> {
|
|||
this.props.results.map((result, index) => {
|
||||
return (<tr key={index}>
|
||||
<td>
|
||||
<a href={result.Path}><img src={`${this.iconUrl}${result.Fileextension !== null && this.unknown.indexOf(result.Fileextension) === -1 ? result.Fileextension : 'code'}.png`} /></a>
|
||||
<a href={result.Path}><img src={`${this.iconUrl}${result.Fileextension !== null && this.unknown.indexOf(result.Fileextension) === -1 ? result.Fileextension : 'code'}.png`} role='presentation' /></a>
|
||||
</td>
|
||||
<td>
|
||||
<a href={result.Path}>{result.Filename !== null ? result.Filename.substring(0, result.Filename.lastIndexOf('.')) : ""}</a>
|
||||
|
|
Loading…
Reference in New Issue