Skip to content

Commit

Permalink
Merge pull request #97 from rwilson504/DownloadFixandBoolReadme
Browse files Browse the repository at this point in the history
Download fixand bool readme
  • Loading branch information
rwilson504 authored Jul 17, 2020
2 parents 501b0ac + ddc002d commit 2a6a5c3
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 11 deletions.
11 changes: 4 additions & 7 deletions BooleanOptionset/README.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
PCF/REACT COLOR PICKER
BOOLEAN OPTIONSET
================

A PCF Control for choosing a color and setting it's value in a single line text field.
A PCF Control to allow you to set a Boolean field to a drop down instead of a toggle. Typically Booleans fields can be made into drop down easily using the form editor but on certain version of dynamics there is a bug which only allows Toggle style fields within Business Process Flow (BPF) screens. This control will allow you to have a drop down again on those BPF forms.

# Overview
This control utilizes React and the Office-Ui-Fabric to allow a user to pick a color and update the text field that the control is bound to.

![Demo Image](https://1.bp.blogspot.com/-DRZqFJPS1e8/XbtAv9zhLZI/AAAAAAABN1Y/Qt5eoWhmTBcW3tplwsLL2plE1bAOmQDGwCLcBGAsYHQ/s1600/PCFColorPicker.gif)
Note - Image above shows the color field twice so that you see that the field is being updated.
# Installation Usage
To utilize this control you can follow the [these instructions](https://powerusers.microsoft.com/t5/Power-Automate-Community-Blog/Preview-Custom-Controls-in-Business-Process-Flows/ba-p/263237) for adding custom PCF components to BPF forms.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest>
<control namespace="RAW" constructor="CanvasFileDownloader" version="0.0.9" display-name-key="RAW! Canvas File Downloader" description-key="Allows you to download a base64 file to your local machine." control-type="standard">
<control namespace="RAW" constructor="CanvasFileDownloader" version="0.0.11" display-name-key="RAW! Canvas File Downloader" description-key="Allows you to download a base64 file to your local machine." control-type="standard">
<!-- property node identifies a specific, configurable piece of data that the control expects from CDS -->
<property name="fileName" display-name-key="File Name" description-key="This will be the name of the file that the browser will use to save the file." of-type="SingleLine.Text" usage="input" required="true" />
<property name="fileMIMEType" display-name-key="MIME Type" description-key="This will be the name of the file that the browser will use to save the file." of-type="SingleLine.Text" usage="input" required="true" />
Expand Down
2 changes: 1 addition & 1 deletion CanvasFileDownloader/CanvasFileDownloader/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ export class CanvasFileDownloader implements ComponentFramework.StandardControl<
if (!params.download?.raw) return;

let a = document.createElement('a');
a.href = `data:${params.fileMIMEType.raw};base64,${params.fileContents.raw}`
a.href = params.fileContents.raw?.startsWith('data:') ? params.fileContents.raw : `data:${params.fileMIMEType.raw};base64,${params.fileContents.raw}`
a.download = params.fileName.raw || '';
document.body.appendChild(a)
a.click()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<LocalizedName description="CanvasFileDownloaderControl" languagecode="1033" />
</LocalizedNames>
<Descriptions />
<Version>1.0.6</Version>
<Version>1.0.8</Version>
<!-- Solution Package Type: Unmanaged(0)/Managed(1)/Both(2)-->
<Managed>2</Managed>
<Publisher>
Expand Down
2 changes: 1 addition & 1 deletion CanvasFileDownloader/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"version": "1.0.0",
"description": "Project containing your PowerApps Component Framework (PCF) control.",
"scripts": {
"build": "pcf-scripts build",
"build": "pcf-scripts build",
"clean": "pcf-scripts clean",
"rebuild": "pcf-scripts rebuild",
"start": "pcf-scripts start"
Expand Down

0 comments on commit 2a6a5c3

Please sign in to comment.