Skip to content

Commit

Permalink
refactor: final changes
Browse files Browse the repository at this point in the history
  • Loading branch information
gowtham-balaganesh committed Sep 10, 2024
1 parent c1c3bda commit c501cb7
Show file tree
Hide file tree
Showing 8 changed files with 10 additions and 116 deletions.
14 changes: 0 additions & 14 deletions packages/crayons-core/src/components/form/form-util.ts
Original file line number Diff line number Diff line change
Expand Up @@ -480,20 +480,6 @@ export function getValueForField(values, field) {
return value;
}

export function getChoicesWithNoSectionCreated(choices) {
const choicesWithNoSection = [];
choices.reduce((choicesWithNoSection, choice) => {
if (!choice?.choice_options?.section_name) {
choicesWithNoSection.push({
text: choice.value,
value: choice.value,
});
}
return choicesWithNoSection;
}, []);
return choicesWithNoSection;
}

const handleUserTimeZoneOffset = (date) => {
return (
new Date(date).valueOf() + new Date(date).getTimezoneOffset() * 60 * 1000
Expand Down
4 changes: 2 additions & 2 deletions packages/crayons-extended/custom-objects/src/components.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ export namespace Components {
* index attached inside the parent group component
*/
"index": number;
"isEditing": any;
"isEditing": boolean;
/**
* The db type used to determine the json to be used for CUSTOM_OBJECTS or CONVERSATION_PROPERTIES
*/
Expand Down Expand Up @@ -1074,7 +1074,7 @@ declare namespace LocalJSX {
* index attached inside the parent group component
*/
"index"?: number;
"isEditing"?: any;
"isEditing"?: boolean;
/**
* Triggered when the section is expanded or collapsed
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,6 @@
--fw-button-hover-background-color: $color-smoke-25;
--fw-button-active-box-shadow: $color-smoke-25;
--fw-button--lg-focus-border: $color-smoke-25;

&.disabled {
pointer-events: none;
user-select: none;
cursor: not-allowed;
opacity: 0.6;
}
}

&.hide {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -231,8 +231,8 @@ export class FormBuilderFieldDragDropItem {
color='text'
class={{
'fb-show-hide-sections-btn': true,
'disabled': this.disabled,
}}
disabled={this.disabled}
onFwClick={() => {
this.setSectionsExpandState(!this.sectionsExpanded);
this.setSectionCreationExpandState(false);
Expand Down Expand Up @@ -272,16 +272,7 @@ export class FormBuilderFieldDragDropItem {
/>
)}

{this.sectionsExpanded && (
<fb-section-drag-drop
setSectionsExpandStateHandler={this.setSectionsExpandState}
dataProvider={this.dataProvider}
>
<div slot='sectiondragdrop'>
<slot name='section'></slot>
</div>
</fb-section-drag-drop>
)}
{this.sectionsExpanded && <slot name='section'></slot>}
</div>
)}
</Host>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ export class FormBuilderSection {
/*
* List of field options
*/
@Prop() fieldChoices;
@Prop() fieldChoices = null;
/**
* The db type used to determine the json to be used for CUSTOM_OBJECTS or CONVERSATION_PROPERTIES
*/
Expand All @@ -31,23 +31,23 @@ export class FormBuilderSection {
/*
* Choosen field value for a section
*/
@Prop({ mutable: true }) selectedFieldValue;
@Prop({ mutable: true }) selectedFieldValue = null;
/*
* Flag to show section pane in edit mode
*/
@Prop() isEditing;
@Prop() isEditing = false;
/**
* index attached inside the parent group component
*/
@Prop() index = -1;
/*
* Section name field error state
*/
@State() sectionInputState;
@State() sectionInputState = '';
/*
* Previously selected choice value while in edit mode
*/
@State() previousSelectedValue;
@State() previousSelectedValue = null;
/**
* State to show section input warning message
*/
Expand Down

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ export class FormBuilder {
/*
* Beta flag to enable Dynamic sections
*/
@Prop() dynamicSectionsBetaEnabled = true;
@Prop() dynamicSectionsBetaEnabled = false;
/**
* State to store the formValues as a state to transfer the field types
*/
Expand Down

0 comments on commit c501cb7

Please sign in to comment.