Skip to content

Commit

Permalink
Fix for : Control enables changes to fields on Inactive Records, or w…
Browse files Browse the repository at this point in the history
…hen field is set to Read Only #4
  • Loading branch information
drivardxrm committed Mar 10, 2024
1 parent 08eb151 commit ccd59aa
Show file tree
Hide file tree
Showing 4 changed files with 554 additions and 563 deletions.
2 changes: 1 addition & 1 deletion FluentUISlider/ControlManifest.Input.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8" ?>
<manifest>
<control namespace="DR" constructor="FluentUISlider" version="0.0.11" display-name-key="FluentUI Slider" description-key="Turn a numeric field into a FluentUI v9 Slider" control-type="standard" preview-image="img/fluentui-slider.png">
<control namespace="DR" constructor="FluentUISlider" version="0.0.12" display-name-key="FluentUI Slider" description-key="Turn a numeric field into a FluentUI v9 Slider" control-type="standard" preview-image="img/fluentui-slider.png">

<external-service-usage enabled="false">
</external-service-usage>
Expand Down
12 changes: 10 additions & 2 deletions FluentUISlider/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,9 +70,17 @@ export class FluentUISlider implements ComponentFramework.StandardControl<IInput
this._props.max = context.parameters.max?.raw ?? 100
this._props.step = context.parameters.step?.raw ?? undefined // Run mode
this._props.vertical = context.parameters.vertical?.raw === 'true' ?? false
// this._props.disabled = context.parameters.input.security?.editable ?? false


// If the bound attribute is disabled because it is inactive or the user doesn't have access
let isReadOnly = context.mode?.isControlDisabled;

// When a field has FLS enabled, the security property on the attribute parameter is set
if (context.parameters?.input?.security) {
isReadOnly = isReadOnly || !context.parameters.input.security.editable;
}


this._props.disabled = isReadOnly

this._props.showtooltip = context.parameters.showTooltip?.raw === 'true' ?? true
this._props.showminmax = context.parameters.showMinMax?.raw === 'true' ?? true
Expand Down
Loading

0 comments on commit ccd59aa

Please sign in to comment.