Added sample.json and dev container

This commit is contained in:
Hugo Bernier 2023-07-15 16:42:09 -04:00
parent 358a2e7354
commit 597306fe0d
14 changed files with 147 additions and 29 deletions

View File

@ -2,12 +2,12 @@
## Summary ## Summary
This SPFx app alows quick access to user agenda, ToDo Tasks, Files and News and Relevenat People related to user. This SPFx app allows quick access to user agenda, ToDo Tasks, Files and News and Relevant People related to user.
![react-my-dashboard](./src/assets/MyDashboard_dark.png) ![react-my-dashboard](./assets/MyDashboard_dark.png)
![react-my-dashboard](./src/assets/MyDashboard_sp.png) ![react-my-dashboard](./assets/MyDashboard_sp.png)
![react-my-dashboard](./src/assets/MyDashboard_office.png) ![react-my-dashboard](./assets/MyDashboard_office.png)
![react-my-dashboard](./src/assets/mobileTeamsApp02.PNG) ![react-my-dashboard](./src/assets/mobileTeamsApp01.PNG) ![react-my-dashboard](./src/assets/mobileTeamsApp03.PNG) ![react-my-dashboard](./assets/mobileTeamsApp02.PNG) ![react-my-dashboard](./assets/mobileTeamsApp01.PNG) ![react-my-dashboard](./assets/mobileTeamsApp03.PNG)
## Compatibility ## Compatibility
@ -16,7 +16,7 @@ This SPFx app alows quick access to user agenda, ToDo Tasks, Files and News and
| Every SPFx version is only compatible with specific version(s) of Node.js. In order to be able to build this sample, please ensure that the version of Node on your workstation matches one of the versions listed in this section. This sample will not work on a different version of Node.| | Every SPFx version is only compatible with specific version(s) of Node.js. In order to be able to build this sample, please ensure that the version of Node on your workstation matches one of the versions listed in this section. This sample will not work on a different version of Node.|
|Refer to <https://aka.ms/spfx-matrix> for more information on SPFx compatibility. | |Refer to <https://aka.ms/spfx-matrix> for more information on SPFx compatibility. |
![SPFx 1.16.1](https://img.shields.io/badge/SPFx-1.16.1-green.svg) ![SPFx 1.17.2](https://img.shields.io/badge/SPFx-1.17.2-green.svg)
![Node.js v16 | v14](https://img.shields.io/badge/Node.js-v16%20|%20v14-green.svg) ![Node.js v16 | v14](https://img.shields.io/badge/Node.js-v16%20|%20v14-green.svg)
![SharePoint Online](https://img.shields.io/badge/SharePoint-Online-yellow.svg) ![SharePoint Online](https://img.shields.io/badge/SharePoint-Online-yellow.svg)
![Workbench Hosted: Does not work with local workbench](https://img.shields.io/badge/Workbench-Hosted-yellow.svg "Does not work with local workbench") ![Workbench Hosted: Does not work with local workbench](https://img.shields.io/badge/Workbench-Hosted-yellow.svg "Does not work with local workbench")
@ -29,16 +29,16 @@ This SPFx app alows quick access to user agenda, ToDo Tasks, Files and News and
## Prerequisites ## Prerequisites
This sample use Microsoft Graph Toolkit V3 RC and use the folling components : This sample use Microsoft Graph Toolkit V3 RC and use the following components :
- mgt-Agenda
- mgt-ToDo
- mgt-Person and PersonCard
- mgt-Search-results
- mgt-get
- mgt-files
Please add the required Microsoft Graph Permissions. Please see [Microsoft Graph Toolkit overview](https://learn.microsoft.com/en-us/graph/toolkit/overview) * mgt-Agenda
* mgt-ToDo
* mgt-Person and PersonCard
* mgt-Search-results
* mgt-get
* mgt-files
Please add the required Microsoft Graph Permissions. Please see [Microsoft Graph Toolkit overview](https://learn.microsoft.com/graph/toolkit/overview)
## Contributors ## Contributors
@ -48,14 +48,14 @@ Please add the required Microsoft Graph Permissions. Please see [Microsoft Grap
Version|Date|Comments Version|Date|Comments
-------|----|-------- -------|----|--------
1.0.0|June 23, 2023|Initial release 1.0.0|June 23, 2023|Initial release
## Minimal Path to Awesome ## Minimal Path to Awesome
The project was created with Visual Studio Teams Toolkit. The project was created with Visual Studio Teams Toolkit.
* Clone this repository * Clone this repository
* Navigate to src folder * Navigate to `src` folder
* in the command line run: * in the command line run:
* `npm install` * `npm install`
* `gulp build` * `gulp build`
@ -67,18 +67,14 @@ The project was created with Visual Studio Teams Toolkit.
## Features ## Features
This sample illustrates the following concepts on top of the SharePoint Framework: This sample illustrates the following concepts on top of the SharePoint Framework:
* using React for building SharePoint Framework client-side web parts * using React for building SharePoint Framework client-side web parts
* using Microsoft Graph Toolkit * using Microsoft Graph Toolkit
* Using React Hooks * Using React Hooks
* using Global State Management (JOTAI) * using Global State Management (JOTAI)
* using FLuentUI V9 * using FLuentUI V9
* using Visuatl Studio Teams Toolkit * using Visual Studio Teams Toolkit
## References ## References
@ -95,11 +91,11 @@ We do not support samples, but we this community is always willing to help, and
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.
If you encounter any issues while 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-birthdays&template=bug-report.yml&sample=react-birthdays&authors=@smaity%20@joaojmendes&title=react-birthdays%20-%20). If you encounter any issues while 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-my-dashboard&template=bug-report.yml&sample=react-my-dashboard&authors=@smaity%20@joaojmendes&title=react-my-dashboard%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-birthdays&template=question.yml&sample=react-birthdays&authors=@smaity%20@joaojmendes&title=react-birthdays%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-my-dashboard&template=question.yml&sample=react-my-dashboard&authors=@smaity%20@joaojmendes&title=react-my-dashboard%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-birthdays&template=question.yml&sample=react-birthdays&authors=@smaity%20@joaojmendes&title=react-birthdays%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-my-dashboard&template=question.yml&sample=react-my-dashboard&authors=@smaity%20@joaojmendes&title=react-my-dashboard%20-%20).
## Disclaimer ## Disclaimer

View File

Before

Width:  |  Height:  |  Size: 945 KiB

After

Width:  |  Height:  |  Size: 945 KiB

View File

Before

Width:  |  Height:  |  Size: 975 KiB

After

Width:  |  Height:  |  Size: 975 KiB

View File

Before

Width:  |  Height:  |  Size: 1.9 MiB

After

Width:  |  Height:  |  Size: 1.9 MiB

View File

Before

Width:  |  Height:  |  Size: 1.5 MiB

After

Width:  |  Height:  |  Size: 1.5 MiB

View File

Before

Width:  |  Height:  |  Size: 474 KiB

After

Width:  |  Height:  |  Size: 474 KiB

View File

Before

Width:  |  Height:  |  Size: 720 KiB

After

Width:  |  Height:  |  Size: 720 KiB

View File

Before

Width:  |  Height:  |  Size: 522 KiB

After

Width:  |  Height:  |  Size: 522 KiB

View File

@ -0,0 +1,50 @@
[
{
"name": "pnp-sp-dev-spfx-web-parts-react-my-dashboard",
"source": "pnp",
"title": "My Dashboard",
"shortDescription": "This SPFx app allows quick access to user agenda, ToDo Tasks, Files and News and Relevant People related to user.",
"url": "https://github.com/pnp/sp-dev-fx-webparts/tree/main/samples/react-my-dashboard",
"downloadUrl": "https://pnp.github.io/download-partial/?url=https://github.com/pnp/sp-dev-fx-webparts/tree/main/samples/react-my-dashboard",
"longDescription": [
"This SPFx app allows quick access to user agenda, ToDo Tasks, Files and News and Relevant People related to user."
],
"creationDateTime": "2023-06-23",
"updateDateTime": "2023-06-23",
"products": [
"SharePoint"
],
"metadata": [
{
"key": "CLIENT-SIDE-DEV",
"value": "React"
},
{
"key": "SPFX-VERSION",
"value": "1.17.2"
}
],
"thumbnails": [
{
"type": "image",
"order": 100,
"url": "https://github.com/pnp/sp-dev-fx-webparts/raw/main/samples/react-my-dashboard/assets/MyDashboard_default.png",
"alt": "Web Part Preview"
}
],
"authors": [
{
"gitHubAccount": "joaojmendes",
"pictureUrl": "https://github.com/joaojmendes.png",
"name": "João Mendes"
}
],
"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"
}
]
}
]

View File

@ -0,0 +1,39 @@
// For more information on how to run this SPFx project in a VS Code Remote Container, please visit https://aka.ms/spfx-devcontainer
{
"name": "SPFx 1.17.2",
"image": "docker.io/m365pnp/spfx:1.17.2",
// Set *default* container specific settings.json values on container create.
"settings": {},
// Add the IDs of extensions you want installed when the container is created.
"extensions": [
"editorconfig.editorconfig",
"dbaeumer.vscode-eslint"
],
// Use 'forwardPorts' to make a list of ports inside the container available locally.
"forwardPorts": [
4321,
35729
],
"portsAttributes": {
"4321": {
"protocol": "https",
"label": "Manifest",
"onAutoForward": "silent",
"requireLocalPort": true
},
// Not needed for SPFx>= 1.12.1
// "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

@ -32,7 +32,7 @@ export const MyFeed: React.FunctionComponent<IFeedProps> = (props: React.PropsWi
const tabs: ITab[] = [ const tabs: ITab[] = [
{ {
id: "tab1", id: "tab1",
name: strings.CompanyAnnoucements, name: strings.CompanyAnnouncements,
icon: <NewsIcon />, icon: <NewsIcon />,
} }

View File

@ -6,7 +6,7 @@ define([], function() {
"eventOrganizer":"Organizer", "eventOrganizer":"Organizer",
"Agenda":"Agenda", "Agenda":"Agenda",
"Todo":"Todo", "Todo":"Todo",
"CompanyAnnoucements":"Company Annoucements", "CompanyAnnouncements":"Company Announcements",
"Trending":"Trending", "Trending":"Trending",
"NoNews":"No News to show", "NoNews":"No News to show",
"Files":"Files", "Files":"Files",

View File

@ -5,7 +5,7 @@ declare interface IDashBoardWebPartStrings {
eventOrganizer:string; eventOrganizer:string;
Agenda:string; Agenda:string;
Todo:string; Todo:string;
CompanyAnnoucements:string; CompanyAnnouncements:string;
Trending:string; Trending:string;
NoNews:string; NoNews:string;
Files:string; Files:string;