Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New Help Desk/Geolocation Sample #170

Merged
merged 6 commits into from
Jan 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
352 changes: 352 additions & 0 deletions samples/BasicCard-HelpDesk/.eslintrc.js

Large diffs are not rendered by default.

34 changes: 34 additions & 0 deletions samples/BasicCard-HelpDesk/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# Logs
logs
*.log
npm-debug.log*

# Dependency directories
node_modules

# Build generated files
dist
lib
release
solution
temp
*.sppkg
.heft

# Coverage directory used by tools like istanbul
coverage

# OSX
.DS_Store

# Visual Studio files
.ntvs_analysis.dat
.vs
bin
obj

# Resx Generated Code
*.resx.ts

# Styles Generated Code
*.scss.ts
16 changes: 16 additions & 0 deletions samples/BasicCard-HelpDesk/.npmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
!dist
config

gulpfile.js

release
src
temp

tsconfig.json
tslint.json

*.log

.yo-rc.json
.vscode
23 changes: 23 additions & 0 deletions samples/BasicCard-HelpDesk/.vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"version": "0.2.0",
"configurations": [
{
"name": "Hosted workbench",
"type": "msedge",
"request": "launch",
"url": "https://{tenantDomain}/_layouts/workbench.aspx",
"webRoot": "${workspaceRoot}",
"sourceMaps": true,
"sourceMapPathOverrides": {
"webpack:///.././src/*": "${webRoot}/src/*",
"webpack:///../../../src/*": "${webRoot}/src/*",
"webpack:///../../../../src/*": "${webRoot}/src/*",
"webpack:///../../../../../src/*": "${webRoot}/src/*"
},
"runtimeArgs": [
"--remote-debugging-port=9222",
"-incognito"
]
}
]
}
13 changes: 13 additions & 0 deletions samples/BasicCard-HelpDesk/.vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
// Place your settings in this file to overwrite default and user settings.
{
// Configure glob patterns for excluding files and folders in the file explorer.
"files.exclude": {
"**/.git": true,
"**/.DS_Store": true,
"**/bower_components": true,
"**/coverage": true,
"**/lib-amd": true,
"src/**/*.scss.ts": true
},
"typescript.tsdk": ".\\node_modules\\typescript\\lib"
}
22 changes: 22 additions & 0 deletions samples/BasicCard-HelpDesk/.yo-rc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
"@microsoft/generator-sharepoint": {
"plusBeta": false,
"isCreatingSolution": true,
"nodeVersion": "18.18.2",
"sdksVersions": {
"@microsoft/microsoft-graph-client": "3.0.2",
"@microsoft/teams-js": "2.12.0"
},
"version": "1.18.0",
"libraryName": "basic-card-help-desk",
"libraryId": "0623688d-f41a-4d3b-a2b2-8ddd32252d09",
"environment": "spo",
"packageManager": "npm",
"solutionName": "basic-card-help-desk",
"solutionShortDescription": "basic-card-help-desk description",
"skipFeatureDeployment": true,
"isDomainIsolated": false,
"componentType": "adaptiveCardExtension",
"aceTemplateType": "Generic"
}
}
72 changes: 72 additions & 0 deletions samples/BasicCard-HelpDesk/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
# basic-card-help-desk

## Summary

This sample used a help desk scenario to show how to use the geolocation and image upload functionality for Adaptive Card Extensions. It lists out the tickets assigned to a user and lets them upload image, get directions to a location, and close tickets.

## Used SharePoint Framework Version

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

## Applies to

- [SharePoint Framework](https://aka.ms/spfx)
- [Microsoft 365 tenant](https://docs.microsoft.com/en-us/sharepoint/dev/spfx/set-up-your-developer-tenant)

> Get your own free development tenant by subscribing to [Microsoft 365 developer program](http://aka.ms/o365devprogram)

## Prerequisites

> If you would like to use the geolocation sample you need a bing maps API key. If you don't have one leave the property blank and the geolocation functionality does not display.
> To use the image upload functionality the user doing the upload needs access to add items to the Site Assets library. If they do not have permissions to the library the upload image button will not appear.

## Solution

| Solution | Author(s) |
| ----------- | ------------------------------------------------------- |
| BasicCard-HelpDesk | Derek Cash-Peterson ([@spdcp](https://twitter.com/spdcp)) [Sympraxis Consulting] (<https://www.sympraxisconsulting.com>) |

## Version history

| Version | Date | Comments |
| ------- | ---------------- | --------------- |
| 1.0 | January 25, 2024 | Initial release |

## 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
- Ensure that you are at the solution folder
- in the command-line run:
- **npm install**
- **gulp serve**
- If you would like to use the geolocation features you will need to sign up for a [Bing Maps api key](https://www.bingmapsportal.com/) and enter it in the configuration of the ACE.

## Features

This sample shows how to navigate between different quick view cards. Description of the extension that expands upon high-level summary above.

This extension illustrates the following concepts:

- ACE development
- Geolocation
- Image Upload
- PnPjs

> Notice that better pictures and documentation will increase the sample usage and the value you are providing for others. Thanks for your submissions advance.

> Share your web part with others through Microsoft 365 Patterns and Practices program to get visibility and exposure. More details on the community, open-source projects and other activities from http://aka.ms/m365pnp.

## References

- [Getting started with SharePoint Framework](https://docs.microsoft.com/en-us/sharepoint/dev/spfx/set-up-your-developer-tenant)
- [Building for Microsoft teams](https://docs.microsoft.com/en-us/sharepoint/dev/spfx/build-for-teams-overview)
- [Use Microsoft Graph in your solution](https://docs.microsoft.com/en-us/sharepoint/dev/spfx/web-parts/get-started/using-microsoft-graph-apis)
- [Publish SharePoint Framework applications to the Marketplace](https://docs.microsoft.com/en-us/sharepoint/dev/spfx/publish-to-marketplace-overview)
- [Microsoft 365 Patterns and Practices](https://aka.ms/m365pnp) - Guidance, tooling, samples and open-source controls for your Microsoft 365 development
<img src="https://pnptelemetry.azurewebsites.net/sp-dev-fx-aces/samples/basiccard-helpdesk" />
Binary file added samples/BasicCard-HelpDesk/assets/demo1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added samples/BasicCard-HelpDesk/assets/demo2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added samples/BasicCard-HelpDesk/assets/demo3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
72 changes: 72 additions & 0 deletions samples/BasicCard-HelpDesk/assets/sample.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
[
{
"name": "pnp-sp-fx-aces-basiccard-helpdesk",
"source": "pnp",
"title": "Basic Card Help Desk",
"shortDescription": "This solution uses a help desk scenaio to demonstrate how to use the geolocation features and image upload functionality in Adaptive Card Extensions.",
"url": "https://github.com/pnp/sp-dev-fx-aces/tree/main/samples/BasicCard-HelpDesk",
"longDescription": [
"This solution uses a help desk scenaio to demonstrate how to use the geolocation features and image upload functionality in Adaptive Card Extensions. The sample creates a list to hold the help desk tickets and stores the images in the site assets library. It also leverages BingMaps api to get the street address."
],
"creationDateTime": "2024-01-25",
"updateDateTime": "2024-01-25",
"products": [
"SharePoint",
"Viva"
],
"metadata": [
{
"key": "CLIENT-SIDE-DEV",
"value": "React"
},
{
"key": "SPFX-VERSION",
"value": "1.18"
}
],
"thumbnails": [
{
"type": "image",
"order": 100,
"url": "https://raw.githubusercontent.com/pnp/sp-dev-fx-aces/main/samples/BasicCard-HelpDesk/assets/demo1.png",
"alt": "Preview"
},
{
"type": "image",
"order": 100,
"url": "https://raw.githubusercontent.com/pnp/sp-dev-fx-aces/main/samples/BasicCard-HelpDesk/assets/demo2.png",
"alt": "Preview"
},
{
"type": "image",
"order": 100,
"url": "https://raw.githubusercontent.com/pnp/sp-dev-fx-aces/main/samples/BasicCard-HelpDesk/assets/demo3.png",
"alt": "Preview"
}
],
"authors": [
{
"gitHubAccount": "dcashpeterson",
"pictureUrl": "https://github.com/dcashpeterson.png",
"name": "Derek Cash-Peterson"
}
],
"references": [
{
"name": "Viva Connections Extensibility guidance",
"description": "Adaptive Card Extensions are client-side components that run in the context of a SharePoint page.",
"url": "https://aka.ms/viva/connections/extensibility"
},
{
"name": "Adaptive Card Documentation",
"description": "Detailed documentation on Adaptive Cards including the Adaptive Card designer.",
"url": "https://adaptivecards.io/"
},
{
"name": "Adaptive Card Extension Design Guidance",
"description": "Design guidance for laying out Adaptive Card Extensions.",
"url": "https://docs.microsoft.com/en-us/sharepoint/dev/spfx/viva/design/design-intro"
}
]
}
]
18 changes: 18 additions & 0 deletions samples/BasicCard-HelpDesk/config/config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"$schema": "https://developer.microsoft.com/json-schemas/spfx-build/config.2.0.schema.json",
"version": "2.0",
"bundles": {
"basic-card-help-desk-adaptive-card-extension": {
"components": [
{
"entrypoint": "./lib/adaptiveCardExtensions/basicCardHelpDesk/BasicCardHelpDeskAdaptiveCardExtension.js",
"manifest": "./src/adaptiveCardExtensions/basicCardHelpDesk/BasicCardHelpDeskAdaptiveCardExtension.manifest.json"
}
]
}
},
"externals": {},
"localizedResources": {
"BasicCardHelpDeskAdaptiveCardExtensionStrings": "lib/adaptiveCardExtensions/basicCardHelpDesk/loc/{locale}.js"
}
}
7 changes: 7 additions & 0 deletions samples/BasicCard-HelpDesk/config/deploy-azure-storage.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"$schema": "https://developer.microsoft.com/json-schemas/spfx-build/deploy-azure-storage.schema.json",
"workingDir": "./release/assets/",
"account": "<!-- STORAGE ACCOUNT NAME -->",
"container": "basic-card-help-desk",
"accessKey": "<!-- ACCESS KEY -->"
}
41 changes: 41 additions & 0 deletions samples/BasicCard-HelpDesk/config/package-solution.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
{
"$schema": "https://developer.microsoft.com/json-schemas/spfx-build/package-solution.schema.json",
"solution": {
"name": "Help-Desk-ACE-Geolocation-Sample",
"id": "0623688d-f41a-4d3b-a2b2-8ddd32252d09",
"version": "1.0.0.1",
"includeClientSideAssets": true,
"skipFeatureDeployment": true,
"isDomainIsolated": false,
"developer": {
"name": "Sympraxis Consulting",
"websiteUrl": "https://sympraxisconsulting.com",
"privacyUrl": "https://symp.info/acegalleryprivacy",
"termsOfUseUrl": "https://symp.info/acegalleryterms",
"mpnId": "2459569"
},
"iconPath": "images/SolutionIcon.png",
"metadata": {
"shortDescription": {
"default": "This sample shows how to use geo-location features of Adaptive Card Extensions(ACEs) using a Help Desk Scenario."
},
"longDescription": {
"default": "This sample shows how to use geo-location features of Adaptive Card Extensions(ACEs) using a Help Desk Scenario."
},
"screenshotPaths": [],
"videoUrl": "",
"categories": []
},
"features": [
{
"title": "basic-card-help-desk Feature",
"description": "The feature that activates elements of the basic-card-help-desk solution.",
"id": "79fe7a0e-7ea8-48c0-af23-39a7f3a47666",
"version": "1.0.0.0"
}
]
},
"paths": {
"zippedPackage": "solution/basic-card-help-desk.sppkg"
}
}
3 changes: 3 additions & 0 deletions samples/BasicCard-HelpDesk/config/sass.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"$schema": "https://developer.microsoft.com/json-schemas/core-build/sass.schema.json"
}
6 changes: 6 additions & 0 deletions samples/BasicCard-HelpDesk/config/serve.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"$schema": "https://developer.microsoft.com/json-schemas/spfx-build/spfx-serve.schema.json",
"port": 4321,
"https": true,
"initialPage": "https://{tenantDomain}/_layouts/workbench.aspx"
}
4 changes: 4 additions & 0 deletions samples/BasicCard-HelpDesk/config/write-manifests.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"$schema": "https://developer.microsoft.com/json-schemas/spfx-build/write-manifests.schema.json",
"cdnBasePath": "<!-- PATH TO CDN -->"
}
16 changes: 16 additions & 0 deletions samples/BasicCard-HelpDesk/gulpfile.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
'use strict';

const build = require('@microsoft/sp-build-web');

build.addSuppression(`Warning - [sass] The local CSS class 'ms-Grid' is not camelCase and will not be type-safe.`);

var getTasks = build.rig.getTasks;
build.rig.getTasks = function () {
var result = getTasks.call(build.rig);

result.set('serve', result.get('serve-deprecated'));

return result;
};

build.initialize(require('gulp'));
Loading
Loading