Skip to content

Commit

Permalink
Merge pull request #441 from SPShire/master
Browse files Browse the repository at this point in the history
Upgrade LinksAndHandlebarsTemplates Web Parts
  • Loading branch information
juliemturner authored Sep 10, 2020
2 parents e3c5b50 + a0f55a1 commit c28304d
Show file tree
Hide file tree
Showing 102 changed files with 28,005 additions and 21,039 deletions.
12 changes: 12 additions & 0 deletions solutions/LinksAndHandlebarsTemplate/.yo-rc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"@microsoft/generator-sharepoint": {
"isCreatingSolution": false,
"environment": "spo",
"version": "1.10.0",
"libraryName": "hub-web-parts",
"libraryId": "520c2090-be2a-4538-b2b0-fd3eeca0cea0",
"packageManager": "npm",
"isDomainIsolated": false,
"componentType": "webpart"
}
}
56 changes: 29 additions & 27 deletions solutions/LinksAndHandlebarsTemplate/README.md
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
---
page_type: sample
products:
- office-sp
languages:
- javascript
- typescript
extensions:
contentType: samples
technologies:
- SharePoint Framework
createdDate: 10/1/2017 12:00:00 AM
---
---
page_type: sample
products:
- office-sp
languages:
- javascript
- typescript
extensions:
contentType: samples
technologies:
- SharePoint Framework
createdDate: 10/1/2017 12:00:00 AM
---
# Hub and Link Web Parts

## Summary
Expand All @@ -35,6 +35,8 @@ Grouped Layout:

### Featured Content

> This web part is being deprecated in liu of using the `Out of the Box` Quick Links web part.
Tile links that enable users to show links with images stored within the web part or in a SharePoint list

Default Layout:
Expand All @@ -51,50 +53,50 @@ Stacked Layout:

### Box Button

> This web part is being deprecated in liu of using the `Out of the Box` Quick Links web part.
Button links that can be stored within the web part or in a SharePoint list

![Box Button](./assets/box_button.png "Box Button")

### Hub Template

A handlebars template web part that enables highly customized UI code to be applied to SharePoint list items.
A handlebars template web part that enables highly customized UI code to be applied to SharePoint list items.

> The Hub Template web part allow users to add JavaScript into the page. Carefully consider the implications of this capability, and restrict creation and updating of this part to specific site collections and audiences. The Hub Template is the only web part in the group that allows script injection
![Hub Template](./assets/hub_template.png "Hub Template")

## Used SharePoint Framework Version
![drop](https://img.shields.io/badge/version-1.4.1-green.svg)
## Used SharePoint Framework Version

![drop](https://img.shields.io/badge/version-1.10.0-green.svg)

## Applies to

* [SharePoint Framework](https://dev.office.com/sharepoint)
* [Office 365 tenant](https://dev.office.com/sharepoint/docs/spfx/set-up-your-development-environment)

## Prerequisites

Note that you will need to download and host a CAMLJS javascript library (https://github.com/andrei-markeev/camljs/blob/master/CamlJs/camljs.js).


## Version history

Version | Date | Comments
-------- | ------------------ | --------
1.0 | September 27, 2017 | Initial release
1.1 | April 12, 2018 | Updated to use CDN and to use SPFx v1.4.1
3.0 | August, 2020 | Update to SPFx v1.10.0, Update PnPJS to 2.xUpdate, FontAwesome to 5.x, Fix bug with grouped view doubling groups on non-list backed HubLinks web part, Deprecate BoxButton and FeaturedContent web parts to promote OOB Quick Links web part which replaces functionality, Update logging to move webpart-logging-.config file to Tenant App Property "LinksHandlebarsConfig"

## 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.**

---

## Minimal Path to Awesome

- Clone this repository
- (Optional) Configure the web part usage logging - /src/utilities/webpartlogger
- (Optional) Configure the approved image tab for the link picker - /src/components/LinkPickerPanel
- in the command line run:
- `npm install`
- `gulp serve`
* Clone this repository
* (Optional) Configure the web part usage logging - /src/utilities/webpartlogger
* (Optional) Configure the approved image tab for the link picker - /src/components/LinkPickerPanel
* in the command line run:
* `npm install`
* `gulp serve`

<img src="https://telemetry.sharepointpnp.com/sp-dev-solutions/solutions/linksandhandlebarstemplate" />
8 changes: 4 additions & 4 deletions solutions/LinksAndHandlebarsTemplate/config/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,16 @@
"box-button-web-part-bundle": {
"components": [
{
"entrypoint": "./lib/webparts/boxButtonWebPart/BoxButtonWebPartWebPart.js",
"manifest": "./src/webparts/boxButtonWebPart/BoxButtonWebPartWebPart.manifest.json"
"entrypoint": "./lib/webparts/boxButtonWebPart/BoxButtonWebPart.js",
"manifest": "./src/webparts/boxButtonWebPart/BoxButtonWebPart.manifest.json"
}
]
},
"featured-content-web-part-bundle": {
"components": [
{
"entrypoint": "./lib/webparts/featuredContentWebPart/FeaturedContentWebPartWebPart.js",
"manifest": "./src/webparts/featuredContentWebPart/FeaturedContentWebPartWebPart.manifest.json"
"entrypoint": "./lib/webparts/featuredContentWebPart/FeaturedContentWebPart.js",
"manifest": "./src/webparts/featuredContentWebPart/FeaturedContentWebPart.manifest.json"
}
]
},
Expand Down
23 changes: 12 additions & 11 deletions solutions/LinksAndHandlebarsTemplate/config/package-solution.json
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
{
"$schema": "https://dev.office.com/json-schemas/spfx-build/package-solution.schema.json",
"solution": {
"name": "Hub Web Parts",
"id": "520c2090-be2a-4538-b2b0-fd3eeca0cea0",
"version": "2.3.3.0",
"skipFeatureDeployment": true,
"includeClientSideAssets": true
},
"paths": {
"zippedPackage": "solution/hub-web-parts.sppkg"
}
"$schema": "https://dev.office.com/json-schemas/spfx-build/package-solution.schema.json",
"solution": {
"name": "Hub Web Parts",
"id": "520c2090-be2a-4538-b2b0-fd3eeca0cea0",
"version": "3.0.0.0",
"skipFeatureDeployment": true,
"includeClientSideAssets": true,
"isDomainIsolated": false
},
"paths": {
"zippedPackage": "solution/hub-web-parts.sppkg"
}
}
72 changes: 37 additions & 35 deletions solutions/LinksAndHandlebarsTemplate/gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,38 +12,40 @@ const bundleAnalyzer = require('webpack-bundle-analyzer');
* Adds a loader and a node setting for webpacking the handlebars-helpers correctly
* https://github.com/helpers/handlebars-helpers/issues/263
********************************************************************************************/
build.configureWebpack.mergeConfig({
additionalConfiguration: (generatedConfiguration) => {

generatedConfiguration.resolve.alias = { handlebars: 'handlebars/dist/handlebars.min.js' };

generatedConfiguration.module.rules.push(
{
test: /utils\.js$/,
loader: 'unlazy-loader',
include: [
/node_modules/,
]
}
);

generatedConfiguration.node = {
fs: 'empty'
}

const lastDirName = path.basename(__dirname);
const dropPath = path.join(__dirname, 'temp', 'stats');
generatedConfiguration.plugins.push(new bundleAnalyzer.BundleAnalyzerPlugin({
openAnalyzer: false,
analyzerMode: 'static',
reportFilename: path.join(dropPath, `${lastDirName}.stats.html`),
generateStatsFile: true,
statsFilename: path.join(dropPath, `${lastDirName}.stats.json`),
logLevel: 'error'
}));

return generatedConfiguration;
}
});

build.initialize(gulp);
// build.configureWebpack.mergeConfig({
// additionalConfiguration: (generatedConfiguration) => {

// generatedConfiguration.resolve.alias = {
// handlebars: 'handlebars/dist/handlebars.min.js'
// };

// // generatedConfiguration.module.rules.push(
// // {
// // test: /utils\.js$/,
// // loader: 'unlazy-loader',
// // include: [
// // /node_modules/,
// // ]
// // }
// // );

// // generatedConfiguration.node = {
// // fs: 'empty'
// // }

// const lastDirName = path.basename(__dirname);
// const dropPath = path.join(__dirname, 'temp', 'stats');
// generatedConfiguration.plugins.push(new bundleAnalyzer.BundleAnalyzerPlugin({
// openAnalyzer: false,
// analyzerMode: 'static',
// reportFilename: path.join(dropPath, `${lastDirName}.stats.html`),
// generateStatsFile: true,
// statsFilename: path.join(dropPath, `${lastDirName}.stats.json`),
// logLevel: 'error'
// }));

// return generatedConfiguration;
// }
// });

build.initialize(gulp);
Loading

0 comments on commit c28304d

Please sign in to comment.