Skip to content

Commit

Permalink
Merge pull request #85 from carfup/release
Browse files Browse the repository at this point in the history
Release v1.3.3.2
  • Loading branch information
carfup authored Jan 5, 2021
2 parents 4ae4a22 + 130d2b0 commit b6735ab
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 7 deletions.
2 changes: 1 addition & 1 deletion Carfup_PCFControls/Other/Solution.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<LocalizedName description="Carfup_PCFControls" languagecode="1033" />
</LocalizedNames>
<Descriptions />
<Version>1.3.3.1</Version>
<Version>1.3.3.2</Version>
<!-- Solution Package Type: Unmanaged(0)/Managed(1)/Both(2)-->
<Managed>2</Managed>
<Publisher>
Expand Down
2 changes: 1 addition & 1 deletion QuickEditForm/QuickEditForm/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="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">
<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">
<!-- property node identifies a specific, configurable piece of data that the control expects from CDS -->
<property name="FieldToAttachControl" display-name-key="FieldToAttachControl" description-key="Property_Desc_Key" of-type="SingleLine.Text" usage="bound" required="true" />
<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" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,11 +49,11 @@ export default class TextFieldControl extends React.Component<ITextFieldControlP
value={this.grabValueFromFieldDefinition()}
id={this.props.fieldDefinition.controlId}
multiline={(this.props.fieldDefinition?.fieldType == "memo")}
autoAdjustHeight={(this.props.fieldDefinition?.fieldType == "memo")}
type={this.state.type}
iconProps={{ iconName: this.props.icon }}
onClick={this.onClick}
style={{width:"100%"}}
rows={(this.props.fieldDefinition?.fieldType == "memo" ? 4 : 1)}
onDoubleClick={this.onDoubleClick}
onChange={this.onChange}
onFocus={(event) => {
Expand Down
18 changes: 14 additions & 4 deletions QuickEditForm/QuickEditForm/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -645,8 +645,11 @@ export class QuickEditForm implements ComponentFramework.StandardControl<IInputs
for(j = numberOfRowPerColumn * k; j < nextColumnCount; j++)
{
let row = rows[j].outerHTML;
//@ts-ignore
let isHidden = $.parseXML(row).getElementsByTagName("cell")[0].attributes?.visible?.value === "false";

// @ts-ignore
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){
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){
continue;
}

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

// @ts-ignore
var labelName = $.parseXML(row).getElementsByTagName("label")[0].attributes.description?.value;

if(labelName == null){
labelName = fieldDetail.DisplayName;
}

// Generating the fields rendering
this.retrieveFieldOptions(fieldDetail, isReadOnly, subColumnDiv);
this.retrieveFieldOptions(fieldDetail, isReadOnly, labelName, subColumnDiv);
}
}
}
Expand All @@ -676,13 +686,13 @@ export class QuickEditForm implements ComponentFramework.StandardControl<IInputs
* Render the fields based on the metatada
* @param fieldDetail field metadata
*/
private retrieveFieldOptions(fieldDetail: any, fieldReadOnly : boolean, divflex : HTMLDivElement){
private retrieveFieldOptions(fieldDetail: any, fieldReadOnly : boolean, labelName : string, divflex : HTMLDivElement){
let _this = this;
let item = document.createElement("div");
var techFieldName = fieldDetail.attributeDescriptor.LogicalName;
var controlId = "carfup_qef_"+techFieldName;
var type = fieldDetail.attributeDescriptor.Type;
var label = fieldDetail.DisplayName;
var label = labelName;

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

0 comments on commit b6735ab

Please sign in to comment.