Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Minor fixes #2120

Merged
merged 2 commits into from
Mar 18, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ <h3 class="slds-section__title slds-truncate slds-p-around_xx-small slds-theme_s
fields={fieldArray}
columns={columns}
mode={mode}
density={density}
>
</lightning-record-form>
</template>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ export default class TagRecordForm extends LightningElement {
@api label;
@api fields;
@api twoColumns;
@api readOnly;
@api isDefaultOpen;

@track fieldArray = [];
@track open;
Expand All @@ -20,7 +20,7 @@ export default class TagRecordForm extends LightningElement {
}

if (typeof this.open === 'undefined') {
this.open = true;
this.open = this.isDefaultOpen;
}
} catch (error) {
console.error('Error in connectedCallback: ' + error.message);
Expand All @@ -31,7 +31,10 @@ export default class TagRecordForm extends LightningElement {
return this.open ? 'slds-section slds-is-open' : 'slds-section';
}
get mode() {
return this.readOnly ? 'readonly' : 'view';
return 'readonly';
}
get density() {
return 'Comfy';
}
get columns() {
return this.twoColumns ? '2' : '1';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
<LightningComponentBundle xmlns="http://soap.sforce.com/2006/04/metadata">
<apiVersion>62.0</apiVersion>
<isExposed>true</isExposed>
<masterLabel>TAG - Record Form</masterLabel>
<description>Simple component that display fields in two columns, with same styling as standard dynamic field sections.</description>
<targets>
<target>lightning__RecordPage</target>
</targets>
Expand All @@ -10,10 +12,12 @@
<objects>
<object>Account</object>
</objects>
<property name="fields" type="String" />
<property name="label" type="String" />
<property name="readOnly" type="Boolean" default="true" />
<property name="twoColumns" type="Boolean" default="true" />
<property name="label" type="String" description="Section header." />
<property name="fields" type="String" description="API names seprated by comma." />
<property name="isDefaultOpen" type="Boolean" default="true"
description="If checked, the section is open on page refresh. Closed if unchecked." />
<property name="twoColumns" type="Boolean" default="true"
description="If checked, the fields will display in two columns. One columns if unchecked." />
<supportedFormFactors>
<supportedFormFactor type="Large" />
<supportedFormFactor type="Small" />
Expand Down