Merge remote-tracking branch 'origin/master'
# Conflicts: # sharepoint/solution/react-content-query-webpart.sppkg
This commit is contained in:
commit
c70188bdca
Binary file not shown.
After Width: | Height: | Size: 242 KiB |
Binary file not shown.
After Width: | Height: | Size: 716 KiB |
Binary file not shown.
After Width: | Height: | Size: 4.6 MiB |
Binary file not shown.
After Width: | Height: | Size: 2.5 MiB |
108
README.md
108
README.md
|
@ -1,6 +1,99 @@
|
|||
## 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
|
||||
|
||||
|
@ -16,16 +109,3 @@ This package produces the following:
|
|||
* lib/* - intermediate-stage commonjs build artifacts
|
||||
* dist/* - the bundled script, along with other resources
|
||||
* 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
|
|
@ -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="{"id":"46edf08f-95c7-4ca7-9146-6471f9f471be","alias":"ContentQueryWebPart","componentType":"WebPart","version":"1.0.0","manifestVersion":2,"preconfiguredEntries":[{"groupId":"46edf08f-95c7-4ca7-9146-6471f9f471be","group":{"default":"Under Development"},"title":{"default":"Content by Query WebPart"},"description":{"default":"A react content by query WebPart for querying items within a site and easily displaying them using a simple yet powerfull HandleBars templating engine.","fr-FR":"Un composante React permettant d'effectuer des requêtes sur les items et de facilement afficher les résultat à l'aide de gabarits HandleBars fournit par l'utilisateur"},"officeFabricIconFontName":"Page","properties":{"description":"Content by Query WebPart"}}],"loaderConfig":{"entryModuleId":"content-query.bundle","internalModuleBaseUrls":["https://publiccdn.sharepointonline.com/spptechnologies.sharepoint.com/110700492eeea162ee5bad0f35b1f0061ded8bf436ce0199efe2a4d24109e1c0df1ec594/react-content-query/"],"scriptResources":{"content-query.bundle":{"type":"path","path":"content-query.bundle_5c3bf535041735c079075c5e7d33a9ca.js"},"contentQueryStrings":{"defaultPath":"react-content-query-contentquerystrings_en-us_ce801b7de0a26a1c4489eac209191051.js","type":"localizedPath","paths":{}},"react":{"type":"component","version":"15.4.2","id":"0d910c1c-13b9-4e1c-9aa4-b008c5e42d7d"},"react-dom":{"type":"component","version":"15.4.2","id":"aa0a46ec-1505-43cd-a44a-93f3a5aa460a"},"@microsoft/sp-core-library":{"type":"component","version":"1.0.0","id":"7263c7d0-1d6a-45ec-8d85-d4d1d234171b"},"@microsoft/sp-webpart-base":{"type":"component","version":"1.0.0","id":"974a7777-0990-4136-8fa6-95d80114c2e0"},"@microsoft/sp-lodash-subset":{"type":"component","version":"1.0.0","id":"73e1dc6c-8441-42cc-ad47-4bd3659f8a3a"},"office-ui-fabric-react":{"type":"component","version":"1.0.0","id":"02a01e42-69ab-403d-8a16-acd128661f8e"},"@microsoft/sp-http":{"type":"component","version":"1.0.0","id":"c07208f0-ea3b-4c1a-9965-ac1b825211a6"},"@microsoft/sp-loader":{"type":"component","version":"1.0.0","id":"1c6c9123-7aac-41f3-a376-3caea41ed83f"}}}}" Type="WebPart"></ClientSideComponent><Module Name="Content by Query WebPart" Url="_catalogs/wp" List="113"></Module></Elements>
|
|
@ -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>
|
|
@ -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>
|
|
@ -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>
|
|
@ -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>
|
|
@ -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>
|
|
@ -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>
|
Loading…
Reference in New Issue