Skip to content

Commit

Permalink
Moved bodypart-gallery to powerplatform-samples
Browse files Browse the repository at this point in the history
  • Loading branch information
Laskewitz committed May 8, 2024
1 parent 1ba4819 commit 3ee4923
Show file tree
Hide file tree
Showing 19 changed files with 188 additions and 0 deletions.
97 changes: 97 additions & 0 deletions samples/bodypart-gallery/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
# Body Part Selection Gallery App

## Summary

Happy to share some of my PowerApps projects that I think might be interesting with the community. I tend to spend too much time on UI/UX and I hope someone else finds them useful for their project . . . Just load the .msapp file and customise it to your heart's content.

An app with a Body Part Selection A gallery that can be applied to a canvas app to select various parts of the body. Use case - A reporting app that requires that the injured body part be submitted as a multi-choice option to a DB

![Preview](./assets/preview.png)

## Applies to

* [Microsoft Power Apps](https://docs.microsoft.com/powerapps/)

## Compatibility

![Power Apps Source File Pack and Unpack Utility 0.20](https://img.shields.io/badge/Packing%20Tool-0.20-green.svg)
![Premium License](https://img.shields.io/badge/Premium%20License-Not%20Required-green.svg "Premium Power Apps license not required")
![Experimental Features](https://img.shields.io/badge/Experimental%20Features-No-green.svg "Does not rely on experimental features")
![On-Premises Connectors](https://img.shields.io/badge/On--Premises%20Connectors-No-green.svg "Does not use on-premise connectors")
![Custom Connectors](https://img.shields.io/badge/Custom%20Connectors-Not%20Required-green.svg "Does not use custom connectors")

## Authors

Solution|Author(s)
--------|---------
Body-Part Selection Canvas App | [Mubarak Adeyemo](https://github.com/tMub365) ([@tMub365](https://www.twitter.com/tMub365) )

## Version history

Version|Date|Comments
-------|----|--------
1.0|Nov 30, 2022|Initial release

## Features

This sample illustrates the following concepts:

* Manipulating UI

## Prerequisites

### Using the component

Selecting each of the dots insert the name of the corresponding body part into a collection. The color of the selected dot also changes, with a correspodning title. Selecting the dot again deselects it and remove the body part form the collection.

If you have a form with a datacard driven by multichoice field, you can just copy the container into the datacard. A collection named `col_BodyPart` captures all the selection.

You can also use `TextInput_ManualInput` to capture free text, in case users need the option to enter such.

Update for the datacard can look like this

```If(
!(IsBlank(TextInput_ManualInput)),
TextInput_ManualInput.Text,
Concat(
col_BodyPart,
Value & ", "
)
)
```

To change the colours of any of the controls, Navigate to the Screen_Style.

## Data Sources

Static table with body part title

## Minimal Path to Awesome

* [Download](./solution/BodyPartSelection.msapp) the `.msapp` from the `solution` folder
* Use the `.msapp` file using **File** > **Open** > **Browse** within Power Apps Studio.
* Save and Publish

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

## Support

While we don't support samples, if you encounter any issues while using this sample, you can [create a new issue](https://github.com/pnp/powerapps-samples/issues/new?assignees=&labels=Needs%3A+Triage+%3Amag%3A%2Ctype%3Abug-suspected&template=bug-report.yml&sample=calendar-component&authors=@aprildunnam&title=calendar-component%20-%20).

For questions regarding this sample, [create a new question](https://github.com/pnp/powerapps-samples/issues/new?assignees=&labels=Needs%3A+Triage+%3Amag%3A%2Ctype%3Abug-suspected&template=question.yml&sample=calendar-component&authors=@aprildunnam&title=calendar-component%20-%20).

Finally, if you have an idea for improvement, [make a suggestion](https://github.com/pnp/powerapps-samples/issues/new?assignees=&labels=Needs%3A+Triage+%3Amag%3A%2Ctype%3Abug-suspected&template=suggestion.yml&sample=calendar-component&authors=@aprildunnam&title=calendar-component%20-%20).

## For more information

* [Create a component for canvas apps](https://docs.microsoft.com/powerapps/maker/canvas-apps/create-component#components-in-canvas-apps)
* [Overview of creating apps in Power Apps](https://docs.microsoft.com/powerapps/maker/)
* [Power Apps canvas apps documentation](https://docs.microsoft.com/en-us/powerapps/maker/canvas-apps/)

## PS

* Credit to aprildunnam for the content of this ReadMe. Without this, I wont even know where to start
* Thanks to David Warner and Hugo Bernier for the Nov 22 SharingIsCaring session. Lets just say that was my first official Github training
* First time contributing, please be gentle
Binary file added samples/bodypart-gallery/assets/preview.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
79 changes: 79 additions & 0 deletions samples/bodypart-gallery/assets/sample.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
[
{
"$schema": "https://developer.microsoft.com/en-us/json-schemas/pnp/samples/v1.0/metadata-schema.json",
"name": "pnp-powerplatform-samples-bodypart-gallery",
"version": "1.0.0.0",
"source": "pnp",
"creationDateTime": "2022-12-05T00:00:00.000Z",
"updateDateTime": "2022-12-05T00:00:00.000Z",
"title": "Bodypart Gallery",
"shortDescription": "An app with a Body Part Selection gallery that can be applied to a canvas app to select various parts of the body.",
"longDescription": [
"An app with a Body Part Selection gallery that can be applied to a canvas app to select various parts of the body. Use case - A reporting app that requires that the injured body part be submitted as a multi-choice option to a DB."
],
"url": "https://github.com/pnp/powerplatform-samples/tree/main/samples/bodypart-gallery",
"products": [
"Power Apps",
"Power Platform"
],
"tags": [
"ACCESSIBILITY", "CANVAS"
],
"categories": [
"POWERAPPS"
],
"metadata": [
{
"key": "POWERAPPS-MANIFEST-VERSION",
"value": "0.20"
},
{
"key": "POWERAPPS-TYPE",
"value": "Canvas"
},
{
"key": "POWERAPPS-EXPERIMENTAL",
"value": "No"
},
{
"key": "POWERAPPS-PREMIUM",
"value": "No"
},
{
"key": "POWERAPPS-ONPREM",
"value": "No"
},
{
"key": "POWERAPPS-CUSTOMCONNECTOR",
"value": "No"
}
],
"thumbnails": [
{
"type": "image",
"order": 100,
"url": "https://raw.githubusercontent.com/pnp/powerplatform-samples/main/samples/app-login/assets/home.png",
"alt": "Preview"
}
],
"authors": [
{
"gitHubAccount": "tMub365",
"name": "Mubarak Adeyemo",
"pictureUrl": "https://github.com/tMub365.png"
}
],
"references": [
{
"name": "Overview of creating apps in Power Apps",
"description": "Power Apps is a high-productivity development platform for business apps.",
"url": "https://docs.microsoft.com/powerapps/maker/"
},
{
"name": "Power Apps canvas apps documentation",
"description": "Design and build a business app from a canvas in Microsoft Power Apps with data from a variety of sources without writing any code using traditional programming languages, such as C#.",
"url": "https://docs.microsoft.com/en-us/powerapps/maker/canvas-apps/"
}
]
}
]
Binary file not shown.
1 change: 1 addition & 0 deletions samples/bodypart-gallery/sourcecode/AppCheckerResult.sarif
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"$schema":"https://schemastore.azurewebsites.net/schemas/json/sarif-2.1.0-rtm.4.json","version":"2.1.0","runs":[{"results":[{"ruleId":"acc-AccessibleLabelNeeded","ruleIndex":0,"message":{"id":"issue"},"locations":[{"physicalLocation":{"address":{"relativeAddress":0,"fullyQualifiedName":"Screen_BodyPart.Container1.DataCard_SelectedBodyPart.AccessibleLabel"}},"logicalLocations":[{"fullyQualifiedName":"Screen_BodyPart.Container1.DataCard_SelectedBodyPart.AccessibleLabel"}],"properties":{"module":"Screen_BodyPart","type":"Screen_BodyPart.Container1.DataCard_SelectedBodyPart","member":"AccessibleLabel"}}],"properties":{"level":"Medium"}},{"ruleId":"acc-AccessibleLabelNeeded","ruleIndex":0,"message":{"id":"issue"},"locations":[{"physicalLocation":{"address":{"relativeAddress":0,"fullyQualifiedName":"Screen_BodyPart.Container1.Container_BodyPart.Icon_ResetImage.AccessibleLabel"}},"logicalLocations":[{"fullyQualifiedName":"Screen_BodyPart.Container1.Container_BodyPart.Icon_ResetImage.AccessibleLabel"}],"properties":{"module":"Screen_BodyPart","type":"Screen_BodyPart.Container1.Container_BodyPart.Icon_ResetImage","member":"AccessibleLabel"}}],"properties":{"level":"Medium"}},{"ruleId":"acc-TabIndexShouldBeDefinedForInteractiveControl","ruleIndex":1,"message":{"id":"issue"},"locations":[{"physicalLocation":{"address":{"relativeAddress":0,"fullyQualifiedName":"Screen_BodyPart.Container1.Container_BodyPart.Icon_ResetImage.TabIndex"}},"logicalLocations":[{"fullyQualifiedName":"Screen_BodyPart.Container1.Container_BodyPart.Icon_ResetImage.TabIndex"}],"properties":{"module":"Screen_BodyPart","type":"Screen_BodyPart.Container1.Container_BodyPart.Icon_ResetImage","member":"TabIndex"}}],"properties":{"level":"Medium"}},{"ruleId":"acc-AccessibleLabelNeeded","ruleIndex":0,"message":{"id":"issue"},"locations":[{"physicalLocation":{"address":{"relativeAddress":0,"fullyQualifiedName":"Screen_BodyPart.Container1.Container_BodyPart.Gallery_ExtraBodyPart.AccessibleLabel"}},"logicalLocations":[{"fullyQualifiedName":"Screen_BodyPart.Container1.Container_BodyPart.Gallery_ExtraBodyPart.AccessibleLabel"}],"properties":{"module":"Screen_BodyPart","type":"Screen_BodyPart.Container1.Container_BodyPart.Gallery_ExtraBodyPart","member":"AccessibleLabel"}}],"properties":{"level":"Medium"}},{"ruleId":"acc-TabIndexShouldBeDefinedForInteractiveControl","ruleIndex":1,"message":{"id":"issue"},"locations":[{"physicalLocation":{"address":{"relativeAddress":0,"fullyQualifiedName":"Screen_BodyPart.Container1.Container_BodyPart.Gallery_ExtraBodyPart.TabIndex"}},"logicalLocations":[{"fullyQualifiedName":"Screen_BodyPart.Container1.Container_BodyPart.Gallery_ExtraBodyPart.TabIndex"}],"properties":{"module":"Screen_BodyPart","type":"Screen_BodyPart.Container1.Container_BodyPart.Gallery_ExtraBodyPart","member":"TabIndex"}}],"properties":{"level":"Medium"}},{"ruleId":"acc-AccessibleLabelNeeded","ruleIndex":0,"message":{"id":"issue"},"locations":[{"physicalLocation":{"address":{"relativeAddress":0,"fullyQualifiedName":"Screen_BodyPart.Container1.Container_BodyPart.TextInput_ManualInput.AccessibleLabel"}},"logicalLocations":[{"fullyQualifiedName":"Screen_BodyPart.Container1.Container_BodyPart.TextInput_ManualInput.AccessibleLabel"}],"properties":{"module":"Screen_BodyPart","type":"Screen_BodyPart.Container1.Container_BodyPart.TextInput_ManualInput","member":"AccessibleLabel"}}],"properties":{"level":"Medium"}},{"ruleId":"app-UnusedMediaResources","ruleIndex":2,"message":{"id":"issue"},"locations":[{"physicalLocation":{"address":{"relativeAddress":0,"fullyQualifiedName":"App.RespondSpinner"}},"logicalLocations":[{"fullyQualifiedName":"App.RespondSpinner"}],"properties":{"module":"App","type":"App","member":"RespondSpinner"}}],"properties":{"level":"Medium"}}],"tool":{"driver":{"name":"PowerApps app checker","fullName":"PowerApps app checker","version":"1.326","rules":[{"id":"acc-AccessibleLabelNeeded","messageStrings":{"issue":{"text":"Missing accessible label"}},"properties":{"howToFix":["Edit the accessible label property to describe the item."],"whyFix":"If there's no accessible text, people who can’t see the screen won't understand what’s in images and controls.","level":"Medium","componentType":"app","primaryCategory":"accessibility"}},{"id":"acc-TabIndexShouldBeDefinedForInteractiveControl","messageStrings":{"issue":{"text":"Missing tab stop"}},"properties":{"howToFix":["Set TabIndex to 0 or greater to ensure that interactive elements have a tab stop."],"whyFix":"People who use the keyboard with your app will not be able to access this element without a tab stop.","level":"Medium","componentType":"app","primaryCategory":"accessibility"}},{"id":"app-UnusedMediaResources","messageStrings":{"issue":{"text":"Unused media files"}},"properties":{"howToFix":["Remove the unused media file in the Media pane."],"whyFix":"This media file is not referenced by any control formulas so it is not needed. Removing it will improve performance.","componentType":"app","primaryCategory":"performance","level":"Medium"}}]}},"invocations":[{"executionSuccessful":true}],"columnKind":"utf16CodeUnits"}]}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions samples/bodypart-gallery/sourcecode/Controls/1.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"TopParent":{"Type":"ControlInfo","Name":"App","Template":{"Id":"http://microsoft.com/appmagic/appinfo","Version":"1.0","LastModifiedTimestamp":"0","Name":"appinfo","FirstParty":true,"IsPremiumPcfControl":false,"IsCustomGroupControlTemplate":false,"CustomGroupControlTemplateName":"","IsComponentDefinition":false,"OverridableProperties":{}},"Index":0.0,"PublishOrderIndex":0,"VariantName":"","LayoutName":"","MetaDataIDKey":"","PersistMetaDataIDKey":false,"IsFromScreenLayout":false,"StyleName":"","Parent":"","IsDataControl":true,"AllowAccessToGlobals":true,"IsGroupControl":false,"IsAutoGenerated":false,"Rules":[{"Property":"ConfirmExit","Category":"Data","InvariantScript":"false","RuleProviderType":"Unknown"},{"Property":"BackEnabled","Category":"Data","InvariantScript":"false","RuleProviderType":"Unknown"},{"Property":"MinScreenHeight","Category":"Design","InvariantScript":"320","RuleProviderType":"Unknown"},{"Property":"MinScreenWidth","Category":"Design","InvariantScript":"320","RuleProviderType":"Unknown"},{"Property":"OnStart","Category":"Behavior","InvariantScript":"","RuleProviderType":"Unknown"},{"Property":"SizeBreakpoints","Category":"ConstantData","InvariantScript":"[600, 900, 1200]","RuleProviderType":"Unknown"},{"Property":"StartScreen","Category":"OnDemandData","InvariantScript":"","RuleProviderType":"Unknown"}],"ControlPropertyState":["MinScreenHeight","MinScreenWidth","ConfirmExit","SizeBreakpoints","BackEnabled","OnStart","StartScreen"],"IsLocked":false,"ControlUniqueId":"1","Children":[]}}
1 change: 1 addition & 0 deletions samples/bodypart-gallery/sourcecode/Controls/15.json

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions samples/bodypart-gallery/sourcecode/Controls/3.json

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions samples/bodypart-gallery/sourcecode/Header.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"DocVersion":"1.326","MinVersionToLoad":"1.326","MSAppStructureVersion":"2.0","LastSavedDateTimeUTC":"10/17/2022 10:41:47"}
1 change: 1 addition & 0 deletions samples/bodypart-gallery/sourcecode/Properties.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"Author":"","Name":"Body Part Selection","Id":"6e94e9e2-c92c-41d2-b68b-80e11a57c717","FileID":"b28ac851-b15d-427e-a67b-6c8b4b0f419e","LocalConnectionReferences":"{}","LocalDatabaseReferences":"{}","LibraryDependencies":"[]","AppPreviewFlagsMap":{"delayloadscreens":true,"errorhandling":false,"enableappembeddingux":false,"blockmovingcontrol":true,"projectionmapping":true,"usedisplaynamemetadata":true,"usenonblockingonstartrule":true,"longlivingcache":false,"useguiddatatypes":true,"useexperimentalcdsconnector":true,"useenforcesavedatalimits":true,"webbarcodescanner":false,"componentauthoring":true,"reliableconcurrent":true,"parallelcodegen":false,"datatablev2control":true,"nativecdsexperimental":true,"reactformulabar":false,"delaycontrolrendering":false,"useexperimentalsqlconnector":true,"disablecdsfileandlargeimage":false,"formuladataprefetch":true,"enablerulespanel":false,"enhanceddelegation":true,"generatedebugpublishedapp":false,"keeprecentscreensloaded":false,"aibuilderserviceenrollment":true,"dynamicschema":false,"enablerowscopeonetonexpand":false,"herocontrols":false,"classiccontrols":false,"enablepcfmoderndatasets":true,"improvedmediacapture":false,"optimizedforteamsmeeting":false,"behaviorpropertyui":false,"autocreateenvironmentvariables":false,"externalmessage":false,"enhancedgalleryinitialization":true,"backfromhostaction":false,"enableonstartnavigate":false,"enableexcelonlinebusinessv2connector":false,"enableonstart":true,"exportimportcomponents2":true,"copyandmerge":false,"allowmultiplescreensincanvaspages":false,"enablecomponentscopeoldbehavior":false,"enablecomponentnamemaps":false,"enableideaspanel":true,"enablesaveloadcleardataonweb":false,"enablepowerautomatepane":false,"rtlsupport":false,"improvedtabstopbehavior":true,"rtlinstudiopreview":false,"cdsdataformatting":false,"enablerpawarecomponentdependency":true,"enableeditcacherefreshfrequency":false,"formularepair":true,"dataverseactionsenabled":false,"expandedsavedatasupport":true,"reverttooldpowerautomate":false,"appinsightserrortracing":false,"appinstrumentationcorrelationtracing":false,"enablecommandbar":false,"excelcompatibility":false,"namedformulas":false,"zeroalltabindexes":false,"untypedobject":false,"pdffunction":false},"DocumentLayoutWidth":1366,"DocumentLayoutHeight":768,"DocumentLayoutOrientation":"landscape","DocumentLayoutScaleToFit":true,"DocumentLayoutMaintainAspectRatio":true,"DocumentLayoutLockOrientation":false,"OriginatingVersion":"1.321","DocumentAppType":"DesktopOrTablet","DocumentType":"App","AppCreationSource":"AppFromScratch","AppDescription":"A gallery that can be applied to a canvas app to select various part of the body. Use case: An accident reporting app that requires that the injured part be submitted as multi choice option. \n\n\nBy Mubarak Adeyemo (@tmub365)","DefaultConnectedDataSourceMaxGetRowsCount":500,"ContainsThirdPartyPcfControls":false,"ErrorCount":0,"InstrumentationKey":"","EnableInstrumentation":false,"ControlCount":{"screen":2,"label":32,"groupContainer":2,"button":31,"text":2,"htmlViewer":3,"image":1,"icon":2,"gallery":1,"galleryTemplate":1,"checkbox":1,"rectangle":1,"group":1},"DeserializationLoadTime":1.2965851,"AnalysisLoadTime":0.6493912}
Loading

0 comments on commit 3ee4923

Please sign in to comment.