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

Adding Leave Request Template #90

Merged
merged 2 commits into from
Apr 23, 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
Binary file added samples/leave-request/.DS_Store
Binary file not shown.
104 changes: 104 additions & 0 deletions samples/leave-request/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,104 @@
# Leave Request Template

## Summary

This template provides you with a solid foundation for a leave request system, consisting of a canvas app for users to see and submit their requests and a model driven app for administrators to manage the underlying data in Dataverse.

![picture of the sample](assets/homepage.png)

## Applies to

![Power Apps](https://img.shields.io/badge/Power%20Apps-Yes-green "Yes")
![Power Automate](https://img.shields.io/badge/Power%20Automate-No-red "No")
![Power BI](https://img.shields.io/badge/Power%20BI-No-red "No")
![Power Pages](https://img.shields.io/badge/Power%20Pages-No-red "No")
![Power Virtual Agents](https://img.shields.io/badge/Power%20Virtual%20Agents-No-red "No")
![Dataverse](https://img.shields.io/badge/Dataverse-Yes-green "Yes")
![AI Builder](https://img.shields.io/badge/AI%20Builder-No-red "No")
![Custom Connectors](https://img.shields.io/badge/Custom%20Connectors-No-red "No")
![Power Fx](https://img.shields.io/badge/Power%20Fx-No-red "No")

## Compatibility

![Premium License](https://img.shields.io/badge/Premium%20License-Required-red.svg "Premium Power Apps license required")
![Experimental Features](https://img.shields.io/badge/Experimental%20Features-No-green.svg "Does not rely on experimental features")

## Contributors

- [April Dunnam](https://github.com/aprildunnam)

## Version history

Version|Date|Comments
-------|----|--------
1.0|April 22, 2024|Initial release

## Features

This template not only gives you a good foundation for customizing your own leave request system, it also demonstrates multiple patterns that you can use across other apps.

### Key Features of the solution include:
* A dashboard landing page featuring custom SVG's to see a visual of remaining leave balances, notifications, a list of your fellow team members who have upcoming leave and a list of company holidays which you can add to your calendar from the app.
![Prompt Admin Products](assets/homepage.png)
* The ability to add new leave requests by category with the added built-in functionality to exclude weekends from your total days/hours requested calculation and the ability to limit submitting multiple leave requests for the same period.
![Prompt Admin Products](assets/RequestLeave.png)
* A custom confirmation screen which will show the user what their new leave balance will be if the request is approved and the ability to customize how many hours they will be gone each day.
![Prompt Admin Products](assets/Confirmation.png)
* A history page where users can see all of their submitted requests and filter by status.
![Prompt Admin Products](assets/History.png)
* An approvals page for designated approvers to process leave requests. When a request is processed by the approver, an email is automatically sent to the requestor informing them of the outcome.
![Prompt Admin Products](assets/approvals.png)



## Data Sources

* Dataverse

## Minimal Path to Awesome

* [Download](./solution/leave-request.zip) the `.zip` from the `solution` folder
* Within **Power Apps Studio**, import the solution `.zip` file using **Solutions** > **Import Solution** and select the `.zip` file you just packed.
* Open the Leave Request Management App and add in your data in the Company Holidays, Leave Types, Leave Approvers and Leave Balances tables. See examples of the data below:
![Model Driven Holidays Table](assets/ModelDriven_Holidays.png)
![Model Driven Leave Types Table](assets/ModelDriven_LeaveTypes.png)
![Model Driven Approvers Table](assets/ModelDriven_Approvers.png)
![Model Driven Balances Table](assets/ModelDriven_Balances.png)

## Using the Source Code

You can also use the [Power Apps CLI](https://docs.microsoft.com/powerapps/developer/data-platform/powerapps-cli) to pack the source code by following these steps::

* Clone the repository to a local drive
* Pack the source files back into a solution `.zip` file:

```bash
pac solution pack --zipfile pathtodestinationfile --folder pathtosourcefolder --processCanvasApps
```

Making sure to replace `pathtosourcefolder` to point to the path to this sample's `sourcecode` folder, and `pathtodestinationfile` to point to the path of this solution's `.zip` file (located under the `solution` folder)
* Within **Power Apps Studio**, import the solution `.zip` file using **Solutions** > **Import Solution** and select the `.zip` file you just packed.

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

## Help

We do not support samples, but we 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 encounter any issues while using this sample, you can [create a new issue](https://github.com/pnp/powerapps-samples/issues/new?assignees=Laskewitz&labels=Needs%3A+Triage+%3Amag%3A%2Ctype%3Abug-suspected&template=bug-report.yml&sample=leave-request&authors=@aprildunnam&title=leave-request%20-%20).

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

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

## For more information

* [Overview of creating apps in Power Apps](https://docs.microsoft.com/powerapps/maker/)
* [Power Apps canvas apps documentation](https://docs.microsoft.com/powerapps/maker/canvas-apps/)

<img src="https://m365-visitor-stats.azurewebsites.net/powerplatform-samples/samples/leave-request" />


---
Binary file added samples/leave-request/assets/.DS_Store
Binary file not shown.
Binary file added samples/leave-request/assets/Approvals.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/leave-request/assets/Confirmation.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/leave-request/assets/EditLeave.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/leave-request/assets/History.png
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.
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.
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.
Binary file added samples/leave-request/assets/RequestLeave.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/leave-request/assets/SubmitApproval.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/leave-request/assets/Success.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/leave-request/assets/homepage.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
67 changes: 67 additions & 0 deletions samples/leave-request/assets/sample.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
[
{
"name": "pnp-powerplatform-samples-leave-request",
"source": "pnp",
"title": "Leave Request",
"shortDescription": "Modern Power Apps Template for Leave Requests",
"url": "https://github.com/pnp/powerplatform-samples/tree/main/samples/leave-request",
"downloadUrl": "https://pnp.github.io/download-partial/?url=https://github.com/pnp/powerplatform-samples/tree/main/samples/leave-request",
"longDescription": [
"This sample shows how to create a leave request system in Power Apps using a canvas app with modern controls and a model driven app for back end management."
],
"creationDateTime": "2024-04-22",
"updateDateTime": "2024-04-22",
"products": [
"Power Apps",
"Power Platform"
],
"tags": [
"powerapps",
"modern"
],
"categories": [
"CANVAS",
"MODEL-DRIVEN"
],
"metadata": [
{
"key": "POWERAPPS-EXPERIMENTAL",
"value": "No"
},
{
"key": "POWERAPPS-PREMIUM",
"value": "Yes"
},
{
"key": "POWERAPPS-ONPREM",
"value": "No"
},
{
"key": "POWERAPPS-CUSTOMCONNECTOR",
"value": "No"
}
],
"thumbnails": [
{
"type": "image",
"order": 100,
"url": "https://github.com/pnp/powerplatform-samples/raw/main/samples/leave-request/assets/homepage.png",
"alt": "App preview"
}
],
"authors": [
{
"gitHubAccount": "aprildunnam",
"pictureUrl": "https://github.com/aprildunnam.png",
"name": "April Dunnam"
}
],
"references": [
{
"name": "Modern Controls",
"description": "Overview of modern controls and themes",
"url": "https://learn.microsoft.com/en-us/power-apps/maker/canvas-apps/controls/modern-controls/overview-modern-controls"
}
]
}
]
Binary file added samples/leave-request/solution/.DS_Store
Binary file not shown.
Binary file added samples/leave-request/solution/leave-request.zip
Binary file not shown.
Binary file added samples/leave-request/sourcecode/.DS_Store
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.

# msbuild output directories
/bin
/obj

# MSBuild Binary and Structured Log
*.binlog
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<PowerAppsTargetsPath>$(MSBuildExtensionsPath)\Microsoft\VisualStudio\v$(VisualStudioVersion)\PowerApps</PowerAppsTargetsPath>
</PropertyGroup>

<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" />
<Import Project="$(PowerAppsTargetsPath)\Microsoft.PowerApps.VisualStudio.Solution.props" Condition="Exists('$(PowerAppsTargetsPath)\Microsoft.PowerApps.VisualStudio.Solution.props')" />

<PropertyGroup>
<ProjectGuid>3f03b70b-2e09-45f0-b6ab-09527de5f1f2</ProjectGuid>
<TargetFrameworkVersion>v4.6.2</TargetFrameworkVersion>
<!--Remove TargetFramework when this is available in 16.1-->
<TargetFramework>net462</TargetFramework>
<RestoreProjectStyle>PackageReference</RestoreProjectStyle>
<SolutionRootPath>src</SolutionRootPath>
</PropertyGroup>

<!--
Solution Packager overrides, un-comment to use: SolutionPackagerType (Managed, Unmanaged, Both)
Solution Localization Control, if you want to enabled localization of your solution, un-comment SolutionPackageEnableLocalization and set the value to true. - Requires use of -loc flag on Solution Clone or Sync
-->
<!--
<PropertyGroup>
<SolutionPackageType>Managed</SolutionPackageType>
<SolutionPackageEnableLocalization>false</SolutionPackageEnableLocalization>
</PropertyGroup>
-->

<ItemGroup>
<PackageReference Include="Microsoft.PowerApps.MSBuild.Solution" Version="1.*" />
<PackageReference Include="Microsoft.NETFramework.ReferenceAssemblies" Version="1.0.0" PrivateAssets="All" />
</ItemGroup>

<ItemGroup>
<ExcludeDirectories Include="$(MSBuildThisFileDirectory)\.gitignore" />
<ExcludeDirectories Include="$(MSBuildThisFileDirectory)\bin\**" />
<ExcludeDirectories Include="$(MSBuildThisFileDirectory)\obj\**" />
<ExcludeDirectories Include="$(MSBuildThisFileDirectory)\*.cdsproj" />
<ExcludeDirectories Include="$(MSBuildThisFileDirectory)\*.cdsproj.user" />
<ExcludeDirectories Include="$(MSBuildThisFileDirectory)\*.sln" />
</ItemGroup>

<ItemGroup>
<None Include="$(MSBuildThisFileDirectory)\**" Exclude="@(ExcludeDirectories)" />
<Content Include="$(SolutionPackageZipFilePath)">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
</ItemGroup>

<Import Project="$(MSBuildToolsPath)\Microsoft.Common.targets" />
<Import Project="$(PowerAppsTargetsPath)\Microsoft.PowerApps.VisualStudio.Solution.targets" Condition="Exists('$(PowerAppsTargetsPath)\Microsoft.PowerApps.VisualStudio.Solution.targets')" />

</Project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
<?xml version="1.0" encoding="utf-8"?>
<AppModuleSiteMap xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<SiteMapUniqueName>ad_LeaveRequestManagement</SiteMapUniqueName>
<EnableCollapsibleGroups>False</EnableCollapsibleGroups>
<ShowHome>True</ShowHome>
<ShowPinned>True</ShowPinned>
<ShowRecents>True</ShowRecents>
<SiteMap IntroducedVersion="7.0.0.0">
<Area Id="area_377f4111" ResourceId="SitemapDesigner.NewTitle" DescriptionResourceId="SitemapDesigner.NewTitle" ShowGroups="true" IntroducedVersion="7.0.0.0">
<Titles>
<Title LCID="1033" Title="Area1" />
</Titles>
<Group Id="group_83937e1a" ResourceId="SitemapDesigner.NewGroup" DescriptionResourceId="SitemapDesigner.NewGroup" IntroducedVersion="7.0.0.0" IsProfile="false" ToolTipResourseId="SitemapDesigner.Unknown">
<Titles>
<Title LCID="1033" Title="Reference Tables" />
</Titles>
<SubArea Id="subarea_1f0570ae" Icon="/_imgs/imagestrips/transparent_spacer.gif" Entity="ad_companyholidays" Client="All,Outlook,OutlookLaptopClient,OutlookWorkstationClient,Web" AvailableOffline="true" PassParams="false" Sku="All,OnPremise,Live,SPLA" />
<SubArea Id="subarea_3b08d061" Icon="/_imgs/imagestrips/transparent_spacer.gif" Entity="ad_leaveapprovers" Client="All,Outlook,OutlookLaptopClient,OutlookWorkstationClient,Web" AvailableOffline="true" PassParams="false" Sku="All,OnPremise,Live,SPLA" />
<SubArea Id="subarea_e0a30be2" Icon="/_imgs/imagestrips/transparent_spacer.gif" Entity="ad_leavebalances" Client="All,Outlook,OutlookLaptopClient,OutlookWorkstationClient,Web" AvailableOffline="true" PassParams="false" Sku="All,OnPremise,Live,SPLA" />
<SubArea Id="subarea_80566917" Icon="/_imgs/imagestrips/transparent_spacer.gif" Entity="ad_leavetypes" Client="All,Outlook,OutlookLaptopClient,OutlookWorkstationClient,Web" AvailableOffline="true" PassParams="false" Sku="All,OnPremise,Live,SPLA" />
</Group>
<Group Id="group_12b28411" ResourceId="SitemapDesigner.NewGroup" DescriptionResourceId="SitemapDesigner.NewGroup" IntroducedVersion="7.0.0.0" IsProfile="false" ToolTipResourseId="SitemapDesigner.Unknown">
<Titles>
<Title LCID="1033" Title="Manage Data" />
</Titles>
<SubArea Id="subarea_1ed54b97" Icon="/_imgs/imagestrips/transparent_spacer.gif" Entity="ad_leaverequests" Client="All,Outlook,OutlookLaptopClient,OutlookWorkstationClient,Web" AvailableOffline="true" PassParams="false" Sku="All,OnPremise,Live,SPLA" />
</Group>
</Area>
</SiteMap>
<LocalizedNames>
<LocalizedName description="Leave Request Management" languagecode="1033" />
</LocalizedNames>
</AppModuleSiteMap>
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
<?xml version="1.0" encoding="utf-8"?>
<AppModuleSiteMap xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<SiteMapUniqueName>ad_LeaveRequestManagement</SiteMapUniqueName>
<EnableCollapsibleGroups>False</EnableCollapsibleGroups>
<ShowHome>True</ShowHome>
<ShowPinned>True</ShowPinned>
<ShowRecents>True</ShowRecents>
<SiteMap IntroducedVersion="7.0.0.0">
<Area Id="area_377f4111" ResourceId="SitemapDesigner.NewTitle" DescriptionResourceId="SitemapDesigner.NewTitle" ShowGroups="true" IntroducedVersion="7.0.0.0">
<Titles>
<Title LCID="1033" Title="Area1" />
</Titles>
<Group Id="group_83937e1a" ResourceId="SitemapDesigner.NewGroup" DescriptionResourceId="SitemapDesigner.NewGroup" IntroducedVersion="7.0.0.0" IsProfile="false" ToolTipResourseId="SitemapDesigner.Unknown">
<Titles>
<Title LCID="1033" Title="Reference Tables" />
</Titles>
<SubArea Id="subarea_1f0570ae" Icon="/_imgs/imagestrips/transparent_spacer.gif" Entity="ad_companyholidays" Client="All,Outlook,OutlookLaptopClient,OutlookWorkstationClient,Web" AvailableOffline="true" PassParams="false" Sku="All,OnPremise,Live,SPLA" />
<SubArea Id="subarea_3b08d061" Icon="/_imgs/imagestrips/transparent_spacer.gif" Entity="ad_leaveapprovers" Client="All,Outlook,OutlookLaptopClient,OutlookWorkstationClient,Web" AvailableOffline="true" PassParams="false" Sku="All,OnPremise,Live,SPLA" />
<SubArea Id="subarea_e0a30be2" Icon="/_imgs/imagestrips/transparent_spacer.gif" Entity="ad_leavebalances" Client="All,Outlook,OutlookLaptopClient,OutlookWorkstationClient,Web" AvailableOffline="true" PassParams="false" Sku="All,OnPremise,Live,SPLA" />
<SubArea Id="subarea_80566917" Icon="/_imgs/imagestrips/transparent_spacer.gif" Entity="ad_leavetypes" Client="All,Outlook,OutlookLaptopClient,OutlookWorkstationClient,Web" AvailableOffline="true" PassParams="false" Sku="All,OnPremise,Live,SPLA" />
</Group>
<Group Id="group_12b28411" ResourceId="SitemapDesigner.NewGroup" DescriptionResourceId="SitemapDesigner.NewGroup" IntroducedVersion="7.0.0.0" IsProfile="false" ToolTipResourseId="SitemapDesigner.Unknown">
<Titles>
<Title LCID="1033" Title="Manage Data" />
</Titles>
<SubArea Id="subarea_1ed54b97" Icon="/_imgs/imagestrips/transparent_spacer.gif" Entity="ad_leaverequests" Client="All,Outlook,OutlookLaptopClient,OutlookWorkstationClient,Web" AvailableOffline="true" PassParams="false" Sku="All,OnPremise,Live,SPLA" />
</Group>
</Area>
</SiteMap>
<LocalizedNames>
<LocalizedName description="Leave Request Management" languagecode="1033" />
</LocalizedNames>
</AppModuleSiteMap>
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
<?xml version="1.0" encoding="utf-8"?>
<AppModule>
<UniqueName>ad_LeaveRequestManagement</UniqueName>
<IntroducedVersion>1.0.0.0</IntroducedVersion>
<WebResourceId>953b9fac-1e5e-e611-80d6-00155ded156f</WebResourceId>
<OptimizedFor></OptimizedFor>
<statecode>0</statecode>
<statuscode>1</statuscode>
<FormFactor>1</FormFactor>
<ClientType>4</ClientType>
<NavigationType>0</NavigationType>
<AppModuleComponents>
<AppModuleComponent type="1" schemaName="ad_companyholidays" />
<AppModuleComponent type="1" schemaName="ad_leaveapprovers" />
<AppModuleComponent type="1" schemaName="ad_leavebalances" />
<AppModuleComponent type="1" schemaName="ad_leaverequests" />
<AppModuleComponent type="1" schemaName="ad_leavetypes" />
<AppModuleComponent type="62" schemaName="ad_LeaveRequestManagement" />
</AppModuleComponents>
<AppModuleRoleMaps>
<Role id="{627090ff-40a3-4053-8790-584edc5be201}" />
<Role id="{119f245c-3cc8-4b62-b31c-d1a046ced15d}" />
</AppModuleRoleMaps>
<LocalizedNames>
<LocalizedName description="Leave Request Management" languagecode="1033" />
</LocalizedNames>
<appsettings>
<appsetting settingdefinitionid.uniquename="AppChannel">
<iscustomizable>1</iscustomizable>
<value>1</value>
</appsetting>
</appsettings>
</AppModule>
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
<?xml version="1.0" encoding="utf-8"?>
<AppModule>
<UniqueName>ad_LeaveRequestManagement</UniqueName>
<IntroducedVersion>1.0.0.0</IntroducedVersion>
<WebResourceId>953b9fac-1e5e-e611-80d6-00155ded156f</WebResourceId>
<OptimizedFor></OptimizedFor>
<statecode>0</statecode>
<statuscode>1</statuscode>
<FormFactor>1</FormFactor>
<ClientType>4</ClientType>
<NavigationType>0</NavigationType>
<AppModuleComponents>
<AppModuleComponent type="1" schemaName="ad_companyholidays" />
<AppModuleComponent type="1" schemaName="ad_leaveapprovers" />
<AppModuleComponent type="1" schemaName="ad_leavebalances" />
<AppModuleComponent type="1" schemaName="ad_leaverequests" />
<AppModuleComponent type="1" schemaName="ad_leavetypes" />
<AppModuleComponent type="62" schemaName="ad_LeaveRequestManagement" />
</AppModuleComponents>
<AppModuleRoleMaps>
<Role id="{627090ff-40a3-4053-8790-584edc5be201}" />
<Role id="{119f245c-3cc8-4b62-b31c-d1a046ced15d}" />
</AppModuleRoleMaps>
<LocalizedNames>
<LocalizedName description="Leave Request Management" languagecode="1033" />
</LocalizedNames>
<appsettings>
<appsetting settingdefinitionid.uniquename="AppChannel">
<iscustomizable>1</iscustomizable>
<value>1</value>
</appsetting>
</appsettings>
</AppModule>
Loading
Loading