Skip to content

Commit 8f1d7e1

Browse files
committed
code cleanup
1 parent a074c1b commit 8f1d7e1

6 files changed

Lines changed: 6 additions & 13 deletions

IconTwoOption/ControlManifest.Input.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="utf-8" ?>
22
<manifest>
3-
<control namespace="DR" constructor="IconTwoOption" version="1.0.5" display-name-key="IconTwoOption" description-key="TwoOption control displaying icons" control-type="standard" preview-image="img/icontwooption-preview.png">
3+
<control namespace="DR" constructor="IconTwoOption" version="1.0.6" display-name-key="IconTwoOption" description-key="TwoOption control displaying icons" control-type="standard" preview-image="img/icontwooption-preview.png">
44
<!-- property node identifies a specific, configurable piece of data that the control expects from CDS -->
55
<property name="twooption" display-name-key="Two Option Field" description-key="Bounded Two-Option field" of-type="TwoOptions" usage="bound" required="true" />
66
<property name="lefticon" display-name-key="Left Side Icon" description-key="Left side icon, list here https://developer.microsoft.com/en-us/fabric#/styles/web/icons#fabric-icons-tool" of-type="SingleLine.Text" usage="input" required="true" default-value="Dislike"/>

IconTwoOption/index.ts

Lines changed: 5 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -61,25 +61,18 @@ export class IconTwoOption implements ComponentFramework.StandardControl<IInputs
6161
*/
6262
public updateView(context: ComponentFramework.Context<IInputs>): void
6363
{
64-
//Visibility of the main attribute on the form
65-
let isVisible = context.mode.isVisible
66-
64+
6765
// If the bound attribute is disabled because it is inactive or the user doesn't have access
6866
let isReadOnly = context.mode.isControlDisabled;
6967

7068
let isMasked = false;
7169
// When a field has FLS enabled, the security property on the attribute parameter is set
7270
if (context.parameters.twooption.security) {
7371
isReadOnly = isReadOnly || !context.parameters.twooption.security.editable;
74-
isVisible = isVisible && context.parameters.twooption.security.readable;
75-
isMasked = isVisible && !context.parameters.twooption.security.readable
72+
73+
isMasked = !context.parameters.twooption.security.readable
7674
}
7775

78-
if(!isVisible){
79-
return;
80-
}
81-
82-
8376
//LEFT TEXT
8477
let options:ComponentFramework.PropertyHelper.FieldPropertyMetadata.TwoOptionMetadata | undefined
8578
= context.parameters.twooption.attributes;
@@ -97,8 +90,8 @@ export class IconTwoOption implements ComponentFramework.StandardControl<IInputs
9790
}
9891

9992
// Add code to update control view
100-
this._selected = context.parameters.twooption.raw; //!== null ? context.parameters.twooption.raw : undefined;
101-
//this._selected = context.parameters.twooption.raw;
93+
this._selected = context.parameters.twooption.raw;
94+
10295
this._props.selected = this._selected;
10396
this._props.lefticon = context.parameters.lefticon.raw || "";
10497
this._props.righticon = context.parameters.righticon.raw || "";

IconTwoOptionPCF_1_0_4_1.zip

-290 KB
Binary file not shown.
-290 KB
Binary file not shown.

IconTwoOptionPCF_1_0_4_2.zip

290 KB
Binary file not shown.
290 KB
Binary file not shown.

0 commit comments

Comments
 (0)