Skip to content

Commit

Permalink
Merge pull request #53 from scottdurow/features/open-dialog
Browse files Browse the repository at this point in the history
📦 Open dialog smart button
  • Loading branch information
scottdurow authored Sep 30, 2020
2 parents 5d1ca8e + 175ee0f commit bb77099
Show file tree
Hide file tree
Showing 15 changed files with 477 additions and 4 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<title>Dialog</title>
<style>
html,
body {
height: 100%;
margin: 0px;
padding: 0px;
border: 0px;
}
#root {
height: 100%;
}
</style>
<script type="text/javascript" src="../js/SmartButtons.ClientHooks.js"></script>
</head>
<body>
<noscript>You need to enable JavaScript to run this app.</noscript>
<div id="root">
</div>
<script type="text/javascript">
SmartButtons.ClientHooks.SmartButtons.AddCanvasAppIframe();
</script>
</body>
</html>
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -1081,6 +1081,285 @@
"Precision": 0
}
]
},

{
"ControlType": 0,
"__type": "ButtonControl",
"Id": "smartbutton.opendialog",
"Image16by16": "$webresource:dev1_/images/rundialog16.png",
"LabelTextText": "Open Dialog",
"Labels": [],
"smartButtonId": "opendialog",
"definitions": [
{
"validOnForm": true,
"validOnHomePageGrid": false,
"validOnSubGrid": false,
"template": {
"Control": {
"ControlType": 0,
"__type": "ButtonControl",
"Id": "dev1.EntityDisplayName.OpenDialogForm.Button",
"Image16by16": "$webresource:dev1_/images/rundialog16.png",
"ModernImage": "$webresource:dev1_/images/opendialog.svg",
"LabelTextText": "Open Dialog",
"Labels": [],
"TemplateAlias": "o1",
"PopulateOnlyOnce": false
},
"CommandDefinition": {
"Id": "dev1.EntityDisplayName.OpenDialogForm.Command",
"Labels": [],
"Actions": [
{
"__type": "JavascriptFunctionCommandAction",
"Parameters": [
{
"__type": "CrmParameter",
"Value": 2
},
{
"__type": "StringParameter",
"Value": ""
},
{
"__type": "IntParameter",
"Value": 470
},
{
"__type": "IntParameter",
"Value": 350
},
{
"__type": "StringParameter",
"Value": "Title"
},
{
"__type": "CrmParameter",
"Value": 4
},
{
"__type": "CrmParameter",
"Value": 9
},
{
"__type": "CrmParameter",
"Value": 22
}
],
"FunctionName": "SmartButtons.ClientHooks.SmartButtons.OpenDialog",
"Library": "$webresource:dev1_/js/SmartButtons.ClientHooks.js"
}
],
"DisplayRuleIds": [],
"EnableRuleIds": []
},
"DisplayRules": [],
"EnableRules": []
},
"propertyExpressions": [
{
"name": "$button.LabelTextText",
"value": "$data.Title"
},
{
"name": "$command.Actions()[0].Parameters()[1].Value",
"value": "$data.dialogurl"
},
{
"name": "$command.Actions()[0].Parameters()[2].Value",
"value": "$data.width"
},
{
"name": "$command.Actions()[0].Parameters()[3].Value",
"value": "$data.height"
},
{
"name": "$command.Actions()[0].Parameters()[4].Value",
"value": "$data.title"
}

]
},
{
"validOnForm": false,
"validOnHomePageGrid": true,
"validOnSubGrid": true,
"template": {
"Control": {
"__type": "ButtonControl",
"Id": "dev1.EntityDisplayName.OpenDialogGrid.Button",
"Labels": [],
"CommandCore": "dev1.EntityDisplayName.OpenDialogGrid.Command",
"ControlType": 0,
"Image16by16": "$webresource:dev1_/images/rundialog16.png",
"Image32by32": null,
"LabelTextText": "Open Dialog",
"TemplateAlias": "o1",
"ToolTipDescriptionText": null,
"ToolTipTitleText": null,
"AltText": null,
"ModernImage": "$webresource:dev1_/images/opendialog.svg",
"Description": null
},
"CommandDefinition": {
"Id": "dev1.EntityDisplayName.OpenDialogGrid.Command",
"Labels": [],
"Actions": [
{
"__type": "JavascriptFunctionCommandAction",
"Parameters": [
{
"__type": "CrmParameter",
"Value": 11
},
{
"__type": "StringParameter",
"Value": ""
},
{
"__type": "IntParameter",
"Value": 470
},
{
"__type": "IntParameter",
"Value": 350
},
{
"__type": "StringParameter",
"Value": "Title"
},
{
"__type": "CrmParameter",
"Value": 4
},
{
"__type": "CrmParameter",
"Value": 9
},
{
"__type": "CrmParameter",
"Value": 22
}
],
"FunctionName": "SmartButtons.ClientHooks.SmartButtons.OpenDialog",
"Library": "$webresource:dev1_/js/SmartButtons.ClientHooks.js"
}
],
"DisplayRuleIds": [],
"EnableRuleIds": [
"Mscrm.SelectionCountExactlyOne"
]
},
"DisplayRules": [],
"EnableRules": [
{
"Id": "Mscrm.SelectionCountExactlyOne",
"Labels": [],
"IsCore": true,
"Steps": [],
"__type": "EnableRule"
}
]
},
"propertyExpressions": [
{
"name": "$button.LabelTextText",
"value": "$data.Title"
},
{
"name": "$command.Actions()[0].Parameters()[1].Value",
"value": "$data.dialogurl"
},
{
"name": "$command.Actions()[0].Parameters()[2].Value",
"value": "$data.width"
},
{
"name": "$command.Actions()[0].Parameters()[3].Value",
"value": "$data.height"
},
{
"name": "$command.Actions()[0].Parameters()[4].Value",
"value": "$data.title"
}

]
}
],
"editableProperties": [
{
"Label": "Title",
"Value": null,
"ColSpan": 2,
"FieldName": "Title",
"PropertyType": "text",
"onlyOnCreate": true,
"Options": null,
"QueryCommand": null,
"IdAttribute": null,
"NameAttribute": null,
"Disable": false,
"Precision": 0
},
{
"Label": "Dialog Url (copy from canvas app details)",
"Value": null,
"ColSpan": 2,
"FieldName": "dialogurl",
"PropertyType": "text",
"onlyOnCreate": false,
"Options": null,
"QueryCommand": null,
"IdAttribute": null,
"NameAttribute": null,
"Disable": false,
"Precision": 0
},
{
"Label": "Width (e.g. 470)",
"Value": 200,
"ColSpan": 1,
"FieldName": "width",
"PropertyType": "numeric",
"onlyOnCreate": false,
"Options": null,
"QueryCommand": null,
"IdAttribute": null,
"NameAttribute": null,
"Disable": false,
"Precision": 0
},
{
"Label": "Height (e.g. 350)",
"Value": 300,
"ColSpan": 1,
"FieldName": "height",
"PropertyType": "numeric",
"onlyOnCreate": false,
"Options": null,
"QueryCommand": null,
"IdAttribute": null,
"NameAttribute": null,
"Disable": false,
"Precision": 0
},
{
"Label": "Title (leave empty to hide header)",
"Value": "",
"ColSpan": 2,
"FieldName": "title",
"PropertyType": "text",
"onlyOnCreate": false,
"Options": null,
"QueryCommand": null,
"IdAttribute": null,
"NameAttribute": null,
"Disable": false,
"Precision": 0
}
]
}

]
2 changes: 2 additions & 0 deletions Develop1SmartButtons/CrmPackage/package/Other/Solution.xml
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,8 @@
</Addresses>
</Publisher>
<RootComponents>
<RootComponent type="61" schemaName="dev1_/html/canvasapp_dialog.html" behavior="0" />
<RootComponent type="61" schemaName="dev1_/images/opendialog.svg" behavior="0" />
<RootComponent type="61" schemaName="dev1_/images/quickjs.svg" behavior="0" />
<RootComponent type="61" schemaName="dev1_/images/quickjs16.png" behavior="0" />
<RootComponent type="61" schemaName="dev1_/images/rundialog16.png" behavior="0" />
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<?xml version="1.0" encoding="utf-8"?>
<WebResource xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<WebResourceId>{6c3e32d8-b602-eb11-a813-000d3ad97943}</WebResourceId>
<Name>dev1_/html/canvasapp_dialog.html</Name>
<DisplayName>Please Wait</DisplayName>
<WebResourceType>1</WebResourceType>
<IntroducedVersion>1.0</IntroducedVersion>
<IsEnabledForMobileClient>0</IsEnabledForMobileClient>
<IsAvailableForMobileOffline>0</IsAvailableForMobileOffline>
<DependencyXml>&lt;Dependencies&gt;&lt;Dependency componentType="WebResource"/&gt;&lt;/Dependencies&gt;</DependencyXml>
<IsCustomizable>1</IsCustomizable>
<CanBeDeleted>1</CanBeDeleted>
<IsHidden>0</IsHidden>
<FileName>/WebResources/dev1_htmlcanvasapp_dialoghtml6C3E32D8-B602-EB11-A813-000D3AD97943</FileName>
</WebResource>
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<?xml version="1.0" encoding="utf-8"?>
<WebResource xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<WebResourceId>{623e32d8-b602-eb11-a813-000d3ad97943}</WebResourceId>
<Name>dev1_/images/opendialog.svg</Name>
<DisplayName>dev1_/images/opendialog.svg</DisplayName>
<WebResourceType>11</WebResourceType>
<IntroducedVersion>1.0</IntroducedVersion>
<IsEnabledForMobileClient>0</IsEnabledForMobileClient>
<IsAvailableForMobileOffline>0</IsAvailableForMobileOffline>
<IsCustomizable>1</IsCustomizable>
<CanBeDeleted>1</CanBeDeleted>
<IsHidden>0</IsHidden>
<FileName>/WebResources/dev1_imagesopendialogsvg623E32D8-B602-EB11-A813-000D3AD97943</FileName>
</WebResource>
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
<IntroducedVersion>1.0.0.0</IntroducedVersion>
<IsEnabledForMobileClient>0</IsEnabledForMobileClient>
<IsAvailableForMobileOffline>0</IsAvailableForMobileOffline>
<DependencyXml>&lt;Dependencies&gt;&lt;Dependency componentType="WebResource"/&gt;&lt;/Dependencies&gt;</DependencyXml>
<IsCustomizable>1</IsCustomizable>
<CanBeDeleted>1</CanBeDeleted>
<IsHidden>0</IsHidden>
Expand Down
2 changes: 1 addition & 1 deletion Develop1SmartButtons/CrmPackage/packages.config
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="Microsoft.CrmSdk.CoreTools" version="9.1.0.25" targetFramework="net452" />
<package id="spkl" version="1.0.375-beta" targetFramework="net452" />
<package id="spkl" version="1.0.432-beta" targetFramework="net452" />
</packages>
11 changes: 11 additions & 0 deletions Develop1SmartButtons/CrmPackage/spkl.json
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,17 @@
"uniquename": "dev1_/images/webhook.svg",
"file": "images\\webhook.svg",
"description": ""
},
{
"uniquename": "dev1_/images/opendialog.svg",
"file": "images\\opendialog.svg",
"description": ""
},
{
"uniquename": "dev1_/html/canvasapp_dialog.html",
"file": "html\\canvasapp_dialog.html",
"displayname": "Please Wait",
"description": ""
}
]
}
Expand Down
Binary file not shown.
Loading

0 comments on commit bb77099

Please sign in to comment.