diff --git a/samples/react-azure-devops-tasks/.devcontainer/devcontainer.json b/samples/react-azure-devops-tasks/.devcontainer/devcontainer.json new file mode 100644 index 000000000..d0df53099 --- /dev/null +++ b/samples/react-azure-devops-tasks/.devcontainer/devcontainer.json @@ -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.16.1", + "image": "docker.io/m365pnp/spfx:1.16.1", + // 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" +} \ No newline at end of file diff --git a/samples/react-azure-devops-tasks/.devcontainer/spfx-startup.sh b/samples/react-azure-devops-tasks/.devcontainer/spfx-startup.sh new file mode 100644 index 000000000..456d6aea8 --- /dev/null +++ b/samples/react-azure-devops-tasks/.devcontainer/spfx-startup.sh @@ -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**********" \ No newline at end of file diff --git a/samples/react-azure-devops-tasks/README.md b/samples/react-azure-devops-tasks/README.md index 1f4c3959d..28b8e59c7 100644 --- a/samples/react-azure-devops-tasks/README.md +++ b/samples/react-azure-devops-tasks/README.md @@ -1,8 +1,8 @@ -# react-azure-devops-tasks +# Azure DevOps Tasks ## Summary -This Adaptive Card Extension demonstrates displaying the number of assined tasks of Azure DevOps. +This Adaptive Card Extension demonstrates displaying the number of assigned tasks of Azure DevOps. ![](./assets/react-azure-devops-tasks.png) diff --git a/samples/react-azure-devops-tasks/assets/sample.json b/samples/react-azure-devops-tasks/assets/sample.json new file mode 100644 index 000000000..ce67adf21 --- /dev/null +++ b/samples/react-azure-devops-tasks/assets/sample.json @@ -0,0 +1,50 @@ +[ + { + "name": "pnp-sp-dev-spfx-web-parts-react-azure-devops-tasks", + "source": "pnp", + "title": "Azure DevOps Tasks", + "shortDescription": "This Adaptive Card Extension demonstrates displaying the number of assigned tasks of Azure DevOps.", + "url": "https://github.com/pnp/sp-dev-fx-webparts/tree/main/samples/react-azure-devops-tasks", + "downloadUrl": "https://pnp.github.io/download-partial/?url=https://github.com/pnp/sp-dev-fx-webparts/tree/main/samples/react-azure-devops-tasks", + "longDescription": [ + "This Adaptive Card Extension demonstrates displaying the number of assigned tasks of Azure DevOps." + ], + "creationDateTime": "2023-03-19", + "updateDateTime": "2023-03-19", + "products": [ + "SharePoint" + ], + "metadata": [ + { + "key": "CLIENT-SIDE-DEV", + "value": "React" + }, + { + "key": "SPFX-VERSION", + "value": "1.16.1" + } + ], + "thumbnails": [ + { + "type": "image", + "order": 100, + "url": "https://github.com/pnp/sp-dev-fx-webparts/raw/main/samples/react-azure-devops-tasks/assets/react-azure-devops-tasks.png", + "alt": "Web Part Preview" + } + ], + "authors": [ + { + "gitHubAccount": "karamem0", + "pictureUrl": "https://github.com/karamem0.png", + "name": "Takashi Shinohara" + } + ], + "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/en-us/sharepoint/dev/spfx/web-parts/get-started/build-a-hello-world-web-part" + } + ] + } +] \ No newline at end of file