Skip to content

Commit b6735ab

Browse files
authored
Merge pull request #85 from carfup/release
Release v1.3.3.2
2 parents 4ae4a22 + 130d2b0 commit b6735ab

4 files changed

Lines changed: 17 additions & 7 deletions

File tree

Carfup_PCFControls/Other/Solution.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
<LocalizedName description="Carfup_PCFControls" languagecode="1033" />
99
</LocalizedNames>
1010
<Descriptions />
11-
<Version>1.3.3.1</Version>
11+
<Version>1.3.3.2</Version>
1212
<!-- Solution Package Type: Unmanaged(0)/Managed(1)/Both(2)-->
1313
<Managed>2</Managed>
1414
<Publisher>

QuickEditForm/QuickEditForm/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="Carfup" constructor="QuickEditForm" version="0.0.240" display-name-key="Carfup.QuickEditForm" description-key="QuickEditForm allows you to edit data from a lookup record using a Quick View Form definition as enty form." control-type="standard" preview-image="img/preview.png">
3+
<control namespace="Carfup" constructor="QuickEditForm" version="0.0.241" display-name-key="Carfup.QuickEditForm" description-key="QuickEditForm allows you to edit data from a lookup record using a Quick View Form definition as enty form." control-type="standard" preview-image="img/preview.png">
44
<!-- property node identifies a specific, configurable piece of data that the control expects from CDS -->
55
<property name="FieldToAttachControl" display-name-key="FieldToAttachControl" description-key="Property_Desc_Key" of-type="SingleLine.Text" usage="bound" required="true" />
66
<property name="QuickViewFormId" display-name-key="QuickViewFormId" description-key="GUID of the Quick View Form to render" of-type="SingleLine.Text" usage="input" required="true" />

QuickEditForm/QuickEditForm/components/TextFieldControl.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,11 +49,11 @@ export default class TextFieldControl extends React.Component<ITextFieldControlP
4949
value={this.grabValueFromFieldDefinition()}
5050
id={this.props.fieldDefinition.controlId}
5151
multiline={(this.props.fieldDefinition?.fieldType == "memo")}
52-
autoAdjustHeight={(this.props.fieldDefinition?.fieldType == "memo")}
5352
type={this.state.type}
5453
iconProps={{ iconName: this.props.icon }}
5554
onClick={this.onClick}
5655
style={{width:"100%"}}
56+
rows={(this.props.fieldDefinition?.fieldType == "memo" ? 4 : 1)}
5757
onDoubleClick={this.onDoubleClick}
5858
onChange={this.onChange}
5959
onFocus={(event) => {

QuickEditForm/QuickEditForm/index.ts

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -645,8 +645,11 @@ export class QuickEditForm implements ComponentFramework.StandardControl<IInputs
645645
for(j = numberOfRowPerColumn * k; j < nextColumnCount; j++)
646646
{
647647
let row = rows[j].outerHTML;
648+
//@ts-ignore
649+
let isHidden = $.parseXML(row).getElementsByTagName("cell")[0].attributes?.visible?.value === "false";
650+
648651
// @ts-ignore
649-
if($.parseXML(row).getElementsByTagName("control").length == 0 || $.parseXML(row).getElementsByTagName("label").length == 0 || $.parseXML(row).getElementsByTagName("control")[0].attributes.datafieldname == undefined || $.parseXML(row).getElementsByTagName("label")[0].attributes.description == undefined){
652+
if($.parseXML(row).getElementsByTagName("control").length == 0 || $.parseXML(row).getElementsByTagName("label").length == 0 || $.parseXML(row).getElementsByTagName("control")[0].attributes.datafieldname == undefined || $.parseXML(row).getElementsByTagName("label")[0].attributes.description == undefined || isHidden){
650653
continue;
651654
}
652655

@@ -665,8 +668,15 @@ export class QuickEditForm implements ComponentFramework.StandardControl<IInputs
665668
fieldDetail = fieldDetail[0];
666669
}
667670

671+
// @ts-ignore
672+
var labelName = $.parseXML(row).getElementsByTagName("label")[0].attributes.description?.value;
673+
674+
if(labelName == null){
675+
labelName = fieldDetail.DisplayName;
676+
}
677+
668678
// Generating the fields rendering
669-
this.retrieveFieldOptions(fieldDetail, isReadOnly, subColumnDiv);
679+
this.retrieveFieldOptions(fieldDetail, isReadOnly, labelName, subColumnDiv);
670680
}
671681
}
672682
}
@@ -676,13 +686,13 @@ export class QuickEditForm implements ComponentFramework.StandardControl<IInputs
676686
* Render the fields based on the metatada
677687
* @param fieldDetail field metadata
678688
*/
679-
private retrieveFieldOptions(fieldDetail: any, fieldReadOnly : boolean, divflex : HTMLDivElement){
689+
private retrieveFieldOptions(fieldDetail: any, fieldReadOnly : boolean, labelName : string, divflex : HTMLDivElement){
680690
let _this = this;
681691
let item = document.createElement("div");
682692
var techFieldName = fieldDetail.attributeDescriptor.LogicalName;
683693
var controlId = "carfup_qef_"+techFieldName;
684694
var type = fieldDetail.attributeDescriptor.Type;
685-
var label = fieldDetail.DisplayName;
695+
var label = labelName;
686696

687697
let isReadOnly = !fieldDetail.attributeDescriptor.IsValidForUpdate || this._isRecordReadOnly || fieldReadOnly || this._context.mode.isControlDisabled;
688698
let isRequired = fieldDetail.attributeDescriptor.RequiredLevel == 1 || fieldDetail.attributeDescriptor.RequiredLevel == 2;

0 commit comments

Comments
 (0)