Added missing sample.json, devcontainer, updated readme

This commit is contained in:
Hugo Bernier 2024-02-10 13:04:17 -05:00
parent f25edc152b
commit 1c6a0a6023
4 changed files with 215 additions and 60 deletions

View File

@ -0,0 +1,38 @@
{
"name": "SPFx 1.18.0",
"image": "docker.io/m365pnp/spfx:1.18.0",
"customizations": {
"vscode": {
"extensions": [
"editorconfig.editorconfig",
"dbaeumer.vscode-eslint"
]
}
},
"forwardPorts": [
4321,
35729,
5432
],
"portsAttributes": {
"4321": {
"protocol": "https",
"label": "Manifest",
"onAutoForward": "silent",
"requireLocalPort": true
},
"5432": {
"protocol": "https",
"label": "Workbench",
"onAutoForward": "silent"
},
"35729": {
"protocol": "https",
"label": "LiveReload",
"onAutoForward": "silent",
"requireLocalPort": true
}
},
"postCreateCommand": "bash .devcontainer/spfx-startup.sh",
"remoteUser": "node"
}

View File

@ -0,0 +1,33 @@
echo
echo -e "\e[1;94mInstalling Node dependencies\e[0m"
npm install
## commands to create dev certificate and copy it to the root folder of the project
echo
echo -e "\e[1;94mGenerating dev certificate\e[0m"
gulp trust-dev-cert
# Convert the generated PEM certificate to a CER certificate
openssl x509 -inform PEM -in ~/.rushstack/rushstack-serve.pem -outform DER -out ./spfx-dev-cert.cer
# Copy the PEM ecrtificate for non-Windows hosts
cp ~/.rushstack/rushstack-serve.pem ./spfx-dev-cert.pem
## add *.cer to .gitignore to prevent certificates from being saved in repo
if ! grep -Fxq '*.cer' ./.gitignore
then
echo "# .CER Certificates" >> .gitignore
echo "*.cer" >> .gitignore
fi
## add *.pem to .gitignore to prevent certificates from being saved in repo
if ! grep -Fxq '*.pem' ./.gitignore
then
echo "# .PEM Certificates" >> .gitignore
echo "*.pem" >> .gitignore
fi
echo
echo -e "\e[1;92mReady!\e[0m"
echo -e "\n\e[1;94m**********\nOptional: if you plan on using gulp serve, don't forget to add the container certificate to your local machine. Please visit https://aka.ms/spfx-devcontainer for more information\n**********"

View File

@ -1,9 +1,9 @@
# Personal tools list / "My tools" # Personal tools list / "My tools"
## Summary ## Summary
This web part allows users to select tools from a predefined list and save them in their own personalized view. This web part allows users to select tools from a predefined list and save them in their own personalized view.
This webpart has the fundamental functionallity - a great starting point to build upon if you need something more advanced. This web part has the fundamental functionality - a great starting point to build upon if you need something more advanced.
<video width="600" height="" controls> <video width="600" height="" controls>
<source src="./assets/video-demo1.mp4" type="video/mp4"> <source src="./assets/video-demo1.mp4" type="video/mp4">
@ -22,14 +22,13 @@ This webpart has the fundamental functionallity - a great starting point to buil
* The web part title can be changed from the property pane, here you can also select to display the tools in two columns (defaults to 1 column if this is not selected) * The web part title can be changed from the property pane, here you can also select to display the tools in two columns (defaults to 1 column if this is not selected)
![](./assets/settings.png) ![](./assets/settings.png)
#### In the background ### In the background
The available tools are added to a list to show up in the web part The available tools are added to a list to show up in the web part
![](./assets/availableTools.png) ![](./assets/availableTools.png)
The web part saves to another list.. The web part saves to another list..
![](./assets/mytoolslist.png) ![](./assets/mytoolslist.png)
## Compatibility ## Compatibility
| :warning: Important | | :warning: Important |
@ -48,7 +47,6 @@ This sample is optimally compatible with the following environment configuration
![Hosted Workbench Compatible](https://img.shields.io/badge/Hosted%20Workbench-Compatible-green.svg) ![Hosted Workbench Compatible](https://img.shields.io/badge/Hosted%20Workbench-Compatible-green.svg)
![Compatible with Remote Containers](https://img.shields.io/badge/Remote%20Containers-Compatible-green.svg) ![Compatible with Remote Containers](https://img.shields.io/badge/Remote%20Containers-Compatible-green.svg)
## Applies to ## Applies to
* [SharePoint Framework](https://learn.microsoft.com/sharepoint/dev/spfx/sharepoint-framework-overview) * [SharePoint Framework](https://learn.microsoft.com/sharepoint/dev/spfx/sharepoint-framework-overview)
@ -58,7 +56,6 @@ This sample is optimally compatible with the following environment configuration
## Contributors ## Contributors
* [Eli Schei](https://github.com/Eli-Schei/) * [Eli Schei](https://github.com/Eli-Schei/)
## Version history ## Version history
@ -72,27 +69,35 @@ Version|Date|Comments
You need to run the script in the env-setup folder to create the content types and lists used in the code. If you create them manually you might need to change the code to use the correct list and field names. You need to run the script in the env-setup folder to create the content types and lists used in the code. If you create them manually you might need to change the code to use the correct list and field names.
For manual creation here is what you need: For manual creation here is what you need:
- List named "AvailableTools", needs to have fields "tool_name" and "tool_url" (both text fields);
- List named:"PersonalTools", needs to have fields "tool_username" (text) and "tool_usertools" (note / multi line text field) * List named "AvailableTools", needs to have fields "tool_name" and "tool_url" (both text fields);
* List named:"PersonalTools", needs to have fields "tool_username" (text) and "tool_usertools" (note / multi line text field)
## Minimal path to awesome ## Minimal path to awesome
- Clone this repository
- Run the script in the "env-setup" folder ([you need pnp-poweshell to run this](https://pnp.github.io/powershell/)) * Clone this repository
- In your CLI navigate to thesolution folder (the folder where this readme file lives) * Run the script in the "env-setup" folder ([you need pnp-poweshell to run this](https://pnp.github.io/powershell/))
- in the command-line run: * In your CLI navigate to the solution folder (the folder where this readme file lives)
- **npm install** * in the command-line run:
- **gulp serve** * `npm install`
* `gulp serve`
### Package and deploy web part ### Package and deploy web part
[Here is a blog post that takes you through every step](https://elischei.com/deploy-your-spfx-solution-using-pnp-powershell/) [Here is a blog post that takes you through every step](https://elischei.com/deploy-your-spfx-solution-using-pnp-powershell/)
#### Package #### Package
First you need to package the solution for production First you need to package the solution for production
```powershell ```powershell
gulp build gulp build
gulp bundle --ship gulp bundle --ship
gulp package-solution --ship gulp package-solution --ship
``` ```
Then you can upload the sppkg to your appcatalog manually, or using PnP powershell as shown below.
Then you can upload the `sppkg` to your appcatalog manually, or using PnP PowerShell as shown below.
```powershell ```powershell
Connect-PnPOnline "appcatalogurl" -Interactive Connect-PnPOnline "appcatalogurl" -Interactive
@ -106,55 +111,22 @@ Add-PnPApp -Path "./project-wp.sppkg" -Connection $appCatConnection -Publish -Sk
Admin/editor can add predefined tools (aka links) to a list, and the users will be able to select which tools they want in their own list. Admin/editor can add predefined tools (aka links) to a list, and the users will be able to select which tools they want in their own list.
<!--
Note that better pictures and documentation will increase the sample usage and the value you are providing for others. Thanks for your submissions in advance! You rock ❤.
-->
<!--
RESERVED FOR REPO MAINTAINERS
We'll add the video from the community call recording here
## Video
[![YouTube video title](./assets/video-thumbnail.jpg)](https://www.youtube.com/watch?v=XXXXX "YouTube video title")
-->
## Help ## Help
<!--
You can just search and replace this page with the following values:
Search for:
YOUR-SOLUTION-NAME
Replace with your sample folder name. E.g.: react-my-cool-sample
Search for:
@YOURGITHUBUSERNAME
Replace with your GitHub username, prefixed with an "@". If you have more than one author, use %20 to separate them, making sure to prefix everyone's username individually with an "@".
Example:
@hugoabernier
Or:
@hugoabernier%20@VesaJuvonen%20@PopWarner
-->
We do not support samples, but this community is always willing to help, and we want to improve these samples. We use GitHub to track issues, which makes it easy for community members to volunteer their time and help resolve issues. We do not support samples, but this community is always willing to help, and we want to improve these samples. We use GitHub to track issues, which makes it easy for community members to volunteer their time and help resolve issues.
If you're having issues building the solution, please run [spfx doctor](https://pnp.github.io/cli-microsoft365/cmd/spfx/spfx-doctor/) from within the solution folder to diagnose incompatibility issues with your environment. If you're having issues building the solution, please run [spfx doctor](https://pnp.github.io/cli-microsoft365/cmd/spfx/spfx-doctor/) from within the solution folder to diagnose incompatibility issues with your environment.
You can try looking at [issues related to this sample](https://github.com/pnp/sp-dev-fx-webparts/issues?q=label%3A%22sample%3A%20YOUR-SOLUTION-NAME%22) to see if anybody else is having the same issues. You can try looking at [issues related to this sample](https://github.com/pnp/sp-dev-fx-webparts/issues?q=label%3A%22sample%3A%20react-personal-tools-list%22) to see if anybody else is having the same issues.
You can also try looking at [discussions related to this sample](https://github.com/pnp/sp-dev-fx-webparts/discussions?discussions_q=YOUR-SOLUTION-NAME) and see what the community is saying. You can also try looking at [discussions related to this sample](https://github.com/pnp/sp-dev-fx-webparts/discussions?discussions_q=react-personal-tools-list) and see what the community is saying.
If you encounter any issues using this sample, [create a new issue](https://github.com/pnp/sp-dev-fx-webparts/issues/new?assignees=&labels=Needs%3A+Triage+%3Amag%3A%2Ctype%3Abug-suspected%2Csample%3A%20YOUR-SOLUTION-NAME&template=bug-report.yml&sample=YOUR-SOLUTION-NAME&authors=@YOURGITHUBUSERNAME&title=YOUR-SOLUTION-NAME%20-%20). If you encounter any issues using this sample, [create a new issue](https://github.com/pnp/sp-dev-fx-webparts/issues/new?assignees=&labels=Needs%3A+Triage+%3Amag%3A%2Ctype%3Abug-suspected%2Csample%3A%20react-personal-tools-list&template=bug-report.yml&sample=react-personal-tools-list&authors=@Eli-Schei&title=react-personal-tools-list%20-%20).
For questions regarding this sample, [create a new question](https://github.com/pnp/sp-dev-fx-webparts/issues/new?assignees=&labels=Needs%3A+Triage+%3Amag%3A%2Ctype%3Aquestion%2Csample%3A%20YOUR-SOLUTION-NAME&template=question.yml&sample=YOUR-SOLUTION-NAME&authors=@YOURGITHUBUSERNAME&title=YOUR-SOLUTION-NAME%20-%20). For questions regarding this sample, [create a new question](https://github.com/pnp/sp-dev-fx-webparts/issues/new?assignees=&labels=Needs%3A+Triage+%3Amag%3A%2Ctype%3Aquestion%2Csample%3A%20react-personal-tools-list&template=question.yml&sample=react-personal-tools-list&authors=@Eli-Schei&title=react-personal-tools-list%20-%20).
Finally, if you have an idea for improvement, [make a suggestion](https://github.com/pnp/sp-dev-fx-webparts/issues/new?assignees=&labels=Needs%3A+Triage+%3Amag%3A%2Ctype%3Aenhancement%2Csample%3A%20YOUR-SOLUTION-NAME&template=suggestion.yml&sample=YOUR-SOLUTION-NAME&authors=@YOURGITHUBUSERNAME&title=YOUR-SOLUTION-NAME%20-%20). Finally, if you have an idea for improvement, [make a suggestion](https://github.com/pnp/sp-dev-fx-webparts/issues/new?assignees=&labels=Needs%3A+Triage+%3Amag%3A%2Ctype%3Aenhancement%2Csample%3A%20react-personal-tools-list&template=suggestion.yml&sample=react-personal-tools-list&authors=@Eli-Schei&title=react-personal-tools-list%20-%20).
## Disclaimer ## Disclaimer

View File

@ -0,0 +1,112 @@
{
"name": "pnp-sp-dev-spfx-web-parts-react-personal-tools-list",
"source": "pnp",
"title": "Personal tools list",
"shortDescription": "Allows users to select tools from a predefined list and save them in their own personalized view.",
"url": "https://github.com/pnp/sp-dev-fx-webparts/tree/main/samples/react-personal-tools-list",
"downloadUrl": "https://pnp.github.io/download-partial/?url=https://github.com/pnp/sp-dev-fx-webparts/tree/main/samples/react-personal-tools-list",
"longDescription": [
"This web part allows users to select tools from a predefined list and save them in their own personalized view.",
"This web part has the fundamental functionality - a great starting point to build upon if you need something more advanced."
],
"creationDateTime": "2024-02-08",
"updateDateTime": "2024-02-08",
"products": [
"SharePoint"
],
"metadata": [
{
"key": "CLIENT-SIDE-DEV",
"value": "React"
},
{
"key": "SPFX-VERSION",
"value": "1.18.0"
}
],
"thumbnails": [
{
"name": "MyToolsDemo1.gif",
"type": "image",
"order": 100,
"url": "https://github.com/pnp/sp-dev-fx-webparts/raw/main/samples/react-personal-tools-list/assets/MyToolsDemo1.gif",
"alt": "Web Part Preview"
},
{
"name": "MyToolsDemo2.gif",
"type": "image",
"order": 101,
"url": "https://github.com/pnp/sp-dev-fx-webparts/raw/main/samples/react-personal-tools-list/assets/MyToolsDemo2.gif",
"alt": "Web Part Preview"
},
{
"name": "availableTools.png",
"type": "image",
"order": 102,
"url": "https://github.com/pnp/sp-dev-fx-webparts/raw/main/samples/react-personal-tools-list/assets/availableTools.png",
"alt": "Web Part Preview"
},
{
"name": "mytoold.png",
"type": "image",
"order": 103,
"url": "https://github.com/pnp/sp-dev-fx-webparts/raw/main/samples/react-personal-tools-list/assets/mytoold.png",
"alt": "Web Part Preview"
},
{
"name": "mytoolslist.png",
"type": "image",
"order": 104,
"url": "https://github.com/pnp/sp-dev-fx-webparts/raw/main/samples/react-personal-tools-list/assets/mytoolslist.png",
"alt": "Web Part Preview"
},
{
"name": "savedtools.png",
"type": "image",
"order": 105,
"url": "https://github.com/pnp/sp-dev-fx-webparts/raw/main/samples/react-personal-tools-list/assets/savedtools.png",
"alt": "Web Part Preview"
},
{
"name": "savetools.png",
"type": "image",
"order": 106,
"url": "https://github.com/pnp/sp-dev-fx-webparts/raw/main/samples/react-personal-tools-list/assets/savetools.png",
"alt": "Web Part Preview"
},
{
"name": "selecttools.png",
"type": "image",
"order": 107,
"url": "https://github.com/pnp/sp-dev-fx-webparts/raw/main/samples/react-personal-tools-list/assets/selecttools.png",
"alt": "Web Part Preview"
},
{
"name": "settings.png",
"type": "image",
"order": 108,
"url": "https://github.com/pnp/sp-dev-fx-webparts/raw/main/samples/react-personal-tools-list/assets/settings.png",
"alt": "Web Part Preview"
},
{
"name": "video-demo1.mp4",
"type": "video",
"order": 109,
"url": "https://github.com/pnp/sp-dev-fx-webparts/raw/main/samples/react-personal-tools-list/assets/video-demo1.mp4"
}
],
"authors": [
{
"gitHubAccount": "Eli-Schei",
"pictureUrl": "https://github.com/Eli-Schei.png",
"name": "Eli Schei"
}
],
"references": [
{
"name": "Build your first SharePoint client-side web part",
"description": "Client-side web parts are client-side components that run in the context of a SharePoint page. Client-side web parts can be deployed to SharePoint environments that support the SharePoint Framework. You can also use modern JavaScript web frameworks, tools, and libraries to build them.",
"url": "https://docs.microsoft.com/sharepoint/dev/spfx/web-parts/get-started/build-a-hello-world-web-part"
}
]
}