Merge remote-tracking branch 'origin/master'

# Conflicts:
#	sharepoint/solution/react-content-query-webpart.sppkg
This commit is contained in:
Simon-Pierre Plante 2017-04-24 22:57:36 -04:00
commit c70188bdca
12 changed files with 101 additions and 14 deletions

BIN
Misc/allsites.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 242 KiB

BIN
Misc/datetime.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 716 KiB

BIN
Misc/filters.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.6 MiB

BIN
Misc/toolpart.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.5 MiB

108
README.md
View File

@ -1,6 +1,99 @@
## React Content Query WebPart ## React Content Query WebPart
This is where you include your WebPart documentation. The `React Content Query WebPart` is a modern version of the good old `Content by Query WebPart` that was introduced in SharePoint 2007. Built for *SharePoint 2016* and *Office 365*, this modern version is built against the new **SharePoint Framework (SPFx)** and uses the latest *Web Stack* practices. While the original WebPart was based on a `XSLT` templating engine, this *React* WebPart is based on the well known [Handlebars templating engine](http://handlebarsjs.com), which empowers users to create simple, yet powerfull `HTML` templates for rendering the queried content. This new version also lets the user query `any site collections` which resides on the same domain url, add `unlimited filters`, query *DateTime* fields to the `nearest minute` rather than being limited to a day, and much more.
### Features
#### Custom tool pane
A custom tool pane helps the user to easily configure his query in the same fashion he used to do with the original WebPart.
<img src="https://github.com/spplante/react-content-query/blob/master/Misc/toolpart.gif" width="500" />
#### Handlebars templating engine
Provide a link to your handlebars `.html` template and decide how you want to render the queried results.
*Handlebars template :*
```handlebars
<h1>Results : </h1>
<ul id="items">
{{#each items}}
<li>
<span>{{Title.textVaue}}</span>
{{FileRef.htmlValue}}
</li>
{{/each}}
</ul>
```
*Output :*
```handlebars
<h1>Results : </h1>
<ul id="items">
<li>
<span>My Item #1</span>
<a href="...">..</a>
</li>
<li>
<span>My Item #2</span>
<a href="...">..</a>
</li>
...
</ul>
```
#### Query any site collection within the same domain
The WebParts uses the search in order to get all sites under the current domain, which makes it possible to query not only subsites but other site collections and their subsites as well.
![DateTime](https://github.com/spplante/react-content-query/blob/master/Misc/allsites.gif "DateTime")
#### Add unlimited filters
The user isn't limited to 3 filters anymore, an unlimited amount of filters can be added.
<img src="https://github.com/spplante/react-content-query/blob/master/Misc/filters.gif" width="500" />
#### Include time in date filters if needed
It is now possible to include time validation when querying date fields, giving the user more possibilities when it comes to filtering events etc...
<img src="https://github.com/spplante/react-content-query/blob/master/Misc/datetime.gif" width="500" />
#### Built in page context available within the template
The SPFx [PageContext](https://github.com/SharePoint/sp-dev-docs/blob/master/reference/spfx/sp-page-context/pagecontext.md) object is exposed directly within the handlebars template context, which allows the user to interact with many usefull dynamic properties such as the current language for instance.
```handlebars
<h1>Current language : {{pageContext.web.language}} </h1>
<h1>Current web title : {{pageContext.web.title}} </h1>
<h1>Current user display name : {{pageContext.user.displayName}} </h1>
<h1>Current user login name : {{pageContext.user.loginName}} </h1>
<h1>Current user email : {{pageContext.user.email}} </h1>
...
```
#### Three predefined type of values for any field
For every view field returned by the query, three predefined types of values are available for an easier integration by the user who designs the handlebars template.
*Handlebars template :*
```handlebars
<h1>Text Value : {{MyUserField.textValue}}</h1>
<h1>Html Value : {{MyUserField.htmlValue}}</h1>
<h1>Raw Value : {{MyUserField.rawValue}}</h1>
```
*Output :*
```handlebars
<h1>Text Value : Simon-Pierre Plante</h1>
<h1>Html Value : <a href="..." onclick="...">Simon-Pierre Plante</a></h1>
<h1>Raw Value : { ID: 18 }</h1>
```
### Building the code ### Building the code
@ -16,16 +109,3 @@ This package produces the following:
* lib/* - intermediate-stage commonjs build artifacts * lib/* - intermediate-stage commonjs build artifacts
* dist/* - the bundled script, along with other resources * dist/* - the bundled script, along with other resources
* deploy/* - all resources which should be uploaded to a CDN. * deploy/* - all resources which should be uploaded to a CDN.
### Build options
gulp clean - TODO
gulp test - TODO
gulp serve - TODO
gulp bundle - TODO
gulp package-solution - TODO
### TO DOs
- Add support for URL field types in CAML query

View File

@ -0,0 +1 @@
<?xml version="1.0" encoding="utf-8"?><Elements xmlns="http://schemas.microsoft.com/sharepoint/"><ClientSideComponent Name="Content by Query WebPart" Id="46edf08f-95c7-4ca7-9146-6471f9f471be" ComponentManifest="{&quot;id&quot;:&quot;46edf08f-95c7-4ca7-9146-6471f9f471be&quot;,&quot;alias&quot;:&quot;ContentQueryWebPart&quot;,&quot;componentType&quot;:&quot;WebPart&quot;,&quot;version&quot;:&quot;1.0.0&quot;,&quot;manifestVersion&quot;:2,&quot;preconfiguredEntries&quot;:[{&quot;groupId&quot;:&quot;46edf08f-95c7-4ca7-9146-6471f9f471be&quot;,&quot;group&quot;:{&quot;default&quot;:&quot;Under Development&quot;},&quot;title&quot;:{&quot;default&quot;:&quot;Content by Query WebPart&quot;},&quot;description&quot;:{&quot;default&quot;:&quot;A react content by query WebPart for querying items within a site and easily displaying them using a simple yet powerfull HandleBars templating engine.&quot;,&quot;fr-FR&quot;:&quot;Un composante React permettant d&apos;effectuer des requêtes sur les items et de facilement afficher les résultat à l&apos;aide de gabarits HandleBars fournit par l&apos;utilisateur&quot;},&quot;officeFabricIconFontName&quot;:&quot;Page&quot;,&quot;properties&quot;:{&quot;description&quot;:&quot;Content by Query WebPart&quot;}}],&quot;loaderConfig&quot;:{&quot;entryModuleId&quot;:&quot;content-query.bundle&quot;,&quot;internalModuleBaseUrls&quot;:[&quot;https://publiccdn.sharepointonline.com/spptechnologies.sharepoint.com/110700492eeea162ee5bad0f35b1f0061ded8bf436ce0199efe2a4d24109e1c0df1ec594/react-content-query/&quot;],&quot;scriptResources&quot;:{&quot;content-query.bundle&quot;:{&quot;type&quot;:&quot;path&quot;,&quot;path&quot;:&quot;content-query.bundle_5c3bf535041735c079075c5e7d33a9ca.js&quot;},&quot;contentQueryStrings&quot;:{&quot;defaultPath&quot;:&quot;react-content-query-contentquerystrings_en-us_ce801b7de0a26a1c4489eac209191051.js&quot;,&quot;type&quot;:&quot;localizedPath&quot;,&quot;paths&quot;:{}},&quot;react&quot;:{&quot;type&quot;:&quot;component&quot;,&quot;version&quot;:&quot;15.4.2&quot;,&quot;id&quot;:&quot;0d910c1c-13b9-4e1c-9aa4-b008c5e42d7d&quot;},&quot;react-dom&quot;:{&quot;type&quot;:&quot;component&quot;,&quot;version&quot;:&quot;15.4.2&quot;,&quot;id&quot;:&quot;aa0a46ec-1505-43cd-a44a-93f3a5aa460a&quot;},&quot;@microsoft/sp-core-library&quot;:{&quot;type&quot;:&quot;component&quot;,&quot;version&quot;:&quot;1.0.0&quot;,&quot;id&quot;:&quot;7263c7d0-1d6a-45ec-8d85-d4d1d234171b&quot;},&quot;@microsoft/sp-webpart-base&quot;:{&quot;type&quot;:&quot;component&quot;,&quot;version&quot;:&quot;1.0.0&quot;,&quot;id&quot;:&quot;974a7777-0990-4136-8fa6-95d80114c2e0&quot;},&quot;@microsoft/sp-lodash-subset&quot;:{&quot;type&quot;:&quot;component&quot;,&quot;version&quot;:&quot;1.0.0&quot;,&quot;id&quot;:&quot;73e1dc6c-8441-42cc-ad47-4bd3659f8a3a&quot;},&quot;office-ui-fabric-react&quot;:{&quot;type&quot;:&quot;component&quot;,&quot;version&quot;:&quot;1.0.0&quot;,&quot;id&quot;:&quot;02a01e42-69ab-403d-8a16-acd128661f8e&quot;},&quot;@microsoft/sp-http&quot;:{&quot;type&quot;:&quot;component&quot;,&quot;version&quot;:&quot;1.0.0&quot;,&quot;id&quot;:&quot;c07208f0-ea3b-4c1a-9965-ac1b825211a6&quot;},&quot;@microsoft/sp-loader&quot;:{&quot;type&quot;:&quot;component&quot;,&quot;version&quot;:&quot;1.0.0&quot;,&quot;id&quot;:&quot;1c6c9123-7aac-41f3-a376-3caea41ed83f&quot;}}}}" Type="WebPart"></ClientSideComponent><Module Name="Content by Query WebPart" Url="_catalogs/wp" List="113"></Module></Elements>

View File

@ -0,0 +1 @@
<?xml version="1.0" encoding="utf-8"?><App xmlns="http://schemas.microsoft.com/sharepoint/2012/app/manifest" Name="React Content Query" ProductID="00406271-0276-406f-9666-512623eb6709" Version="1.0.0.0" SharePointMinVersion="16.0.0.0" IsClientSideSolution="true"><Properties><Title>React Content Query</Title></Properties></App>

View File

@ -0,0 +1 @@
<?xml version="1.0" encoding="utf-8"?><Types xmlns="http://schemas.openxmlformats.org/package/2006/content-types"><Default Extension="xml" ContentType="text/xml"></Default><Default Extension="rels" ContentType="application/vnd.openxmlformats-package.relationships+xml"></Default><Default Extension="webpart" ContentType="text/xml"></Default><Default Extension="htm" ContentType="text/xml"></Default><Default Extension="aspx" ContentType="text/xml"></Default><Default Extension="resx" ContentType="text/xml"></Default><Default Extension="png" ContentType="application/wsp"></Default><Default Extension="jpg" ContentType="application/wsp"></Default><Default Extension="gif" ContentType="application/wsp"></Default><Default Extension="bmp" ContentType="application/wsp"></Default></Types>

View File

@ -0,0 +1 @@
<?xml version="1.0" encoding="utf-8"?><Relationships xmlns="http://schemas.openxmlformats.org/package/2006/relationships"><Relationship Type="http://schemas.microsoft.com/sharepoint/2012/app/relationships/manifest-feature" Target="/feature_46edf08f-95c7-4ca7-9146-6471f9f471be.xml" Id="r3"></Relationship></Relationships>

View File

@ -0,0 +1 @@
<?xml version="1.0" encoding="utf-8"?><Relationships xmlns="http://schemas.openxmlformats.org/package/2006/relationships"><Relationship Type="http://schemas.microsoft.com/sharepoint/2012/app/relationships/partconfiguration" Target="/feature_46edf08f-95c7-4ca7-9146-6471f9f471be.xml.config.xml" Id="r1"></Relationship><Relationship Type="http://schemas.microsoft.com/sharepoint/2012/app/relationships/feature-elementmanifest" Target="/46edf08f-95c7-4ca7-9146-6471f9f471be/WebPart_46edf08f-95c7-4ca7-9146-6471f9f471be.xml" Id="r2"></Relationship></Relationships>

View File

@ -0,0 +1 @@
<?xml version="1.0" encoding="utf-8"?><Feature xmlns="http://schemas.microsoft.com/sharepoint/" Title="Content by Query WebPart Feature" Description="A feature which activates the Client-Side WebPart named Content by Query WebPart" Id="46edf08f-95c7-4ca7-9146-6471f9f471be" Version="1.0.0.0" Scope="Web" Hidden="FALSE"></Feature>

View File

@ -0,0 +1 @@
<?xml version="1.0" encoding="utf-8"?><AppPartConfig xmlns="http://schemas.microsoft.com/sharepoint/2012/app/partconfiguration"><Id>46edf08f-95c7-4ca7-9146-6471f9f471be</Id></AppPartConfig>