Skip to content

Commit

Permalink
prod issuse fix of sage 300 (#937)
Browse files Browse the repository at this point in the history
* prod issuse fix of sage 300
  • Loading branch information
DhaaraniCIT authored Sep 3, 2024
1 parent f0d202d commit 1d08e58
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 23 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
<input type="text" class="tw-text-14-px tw-text-text-secondary !tw-font-500 tw-w-300-px !tw-px-14-px !tw-py-10-px tw-border tw-border-solid !tw-border-border-tertiary tw-rounded-4-px" value="{{ defaultField.source_field | snakeCaseToSpaceCase | titlecase }}" disabled>
</div>
<div class="input-toggle-section tw-w-10-vw tw-pt-10-px">
<p-inputSwitch [formControlName]="defaultField.formController" (onChange)="onImportToFyleToggleChange($event)"></p-inputSwitch>
<p-inputSwitch [formControlName]="defaultField.formController" (onChange)="onImportToFyleToggleChange($event, defaultField.destination_field)"></p-inputSwitch>
</div>
</div>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ export class ConfigurationImportFieldComponent implements OnInit {
(this.form.get('expenseFields') as FormArray).at(index)?.get('import_to_fyle')?.disable();
} else {
(this.form.get('expenseFields') as FormArray).at(index)?.get('import_to_fyle')?.setValue(true);
this.onImportToFyleToggleChange({checked: true});
this.onImportToFyleToggleChange({checked: true}, (this.form.get('expenseFields') as FormArray).at(index)?.get('destination_value')?.value);
if (this.appName === AppName.SAGE300) {
(this.form.get('expenseFields') as FormArray).at(index)?.get('import_code')?.addValidators(Validators.required);
}
Expand Down Expand Up @@ -228,7 +228,7 @@ export class ConfigurationImportFieldComponent implements OnInit {
(expenseField as FormGroup).controls.source_field.patchValue('');
(expenseField as FormGroup).controls.import_to_fyle.patchValue(false);
(expenseField as FormGroup).controls.import_to_fyle.enable();
this.onImportToFyleToggleChange({checked: false});
this.onImportToFyleToggleChange({checked: false}, (expenseField as FormGroup).controls.destination_field.value);
event?.stopPropagation();
this.isXeroProjectMapped = false;
this.xeroProjectMapping.emit(this.isXeroProjectMapped);
Expand All @@ -244,9 +244,9 @@ export class ConfigurationImportFieldComponent implements OnInit {
}
}

onImportToFyleToggleChange(event: any): void {
onImportToFyleToggleChange(event: any, destinationField: string): void {
if (this.appName === AppName.SAGE300) {
event.checked ? this.isImportCodeEnabledCounter.push(true) : this.isImportCodeEnabledCounter.pop();
event.checked && this.importCodeFieldConfig[destinationField] ? this.isImportCodeEnabledCounter.push(true) : this.isImportCodeEnabledCounter.pop();
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,10 @@ <h5 *ngIf="formControllerName === 'cccExportType' && brandingConfig.brandId ===
[emptyFilterMessage]="isOptionSearchInProgress ? 'Searching...' : 'No results found'"
[dropdownIcon]="isOptionSearchInProgress ? 'pi pi-spinner pi-spin' : 'pi pi-chevron-down ' + brandingConfig.brandId">
<ng-template let-options pTemplate="item">
<div>
<span #textElement
[ngStyle]="{'white-space': 'nowrap', 'overflow': 'hidden', 'text-overflow': 'ellipsis', 'max-width': '16rem'}"
[pTooltip]="isOverflowing(textElement) ? options.value: null" tooltipPosition="top">
<div #textElement
[ngStyle]="{'white-space': 'nowrap', 'overflow': 'hidden', 'text-overflow': 'ellipsis', 'max-width': '16rem'}"
[pTooltip]="isOverflowing(textElement) ? options.value: null" tooltipPosition="top">
<span>
{{options[optionLabel]}}
</span>
<p *ngIf="isMultiLineOption" class="tw-text-text-muted tw-text-12-px">{{ options.code ? options.code : '--'}}</p>
Expand Down Expand Up @@ -73,10 +73,10 @@ <h5 *ngIf="formControllerName === 'cccExportType' && brandingConfig.brandId ===
}" [disabled]="isDisabled">

<ng-template let-option pTemplate="item">
<div>
<span #textElement
[ngStyle]="{'white-space': 'nowrap', 'overflow': 'hidden', 'text-overflow': 'ellipsis', 'max-width': '16rem'}"
[pTooltip]="isOverflowing(textElement) ? option.label : null" tooltipPosition="top">
<div #textElement
[ngStyle]="{'white-space': 'nowrap', 'overflow': 'hidden', 'text-overflow': 'ellipsis', 'max-width': '16rem'}"
[pTooltip]="isOverflowing(textElement) ? option.label : null" tooltipPosition="top">
<span>
{{ brandingConfig.brandId === 'co' ? (option.label | sentenceCase) : (option.label)}}</span>
<p *ngIf="isMultiLineOption" class="tw-text-text-muted tw-text-12-px">{{ option.subLabel}}</p>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,10 @@
</div>
</ng-template>
<ng-template let-options pTemplate="item">
<div>
<span #textElement
[ngStyle]="{'white-space': 'nowrap', 'overflow': 'hidden', 'text-overflow': 'ellipsis', 'max-width': '16rem'}"
[pTooltip]="isOverflowing(textElement, options)" tooltipPosition="top">
<div #textElement
[ngStyle]="{'white-space': 'nowrap', 'overflow': 'hidden', 'text-overflow': 'ellipsis', 'max-width': '16rem'}"
[pTooltip]="isOverflowing(textElement, options)" tooltipPosition="top">
<span>
{{options.value}}
</span>
<p *ngIf="isMultiLineOption" class="tw-text-text-muted tw-text-12-px">{{ options.code ? options.code : '--'}}</p>
Expand Down
12 changes: 6 additions & 6 deletions src/app/shared/components/input/dropdown/dropdown.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@
[disabled]="isDisabled"
[formControlName]="formControllerName">
<ng-template pTemplate="item" let-item>
<div>
<span #textElement
class="tw-flex tw-justify-between tw-items-center"
[ngStyle]="{'white-space': 'nowrap', 'overflow': 'hidden', 'text-overflow': 'ellipsis', 'max-width': '16rem'}"
[pTooltip]="textElement.offsetWidth < textElement.scrollWidth ? item[displayKey] : null"
tooltipPosition="top">
<div #textElement
class="tw-flex tw-justify-between tw-items-center"
[ngStyle]="{'white-space': 'nowrap', 'overflow': 'hidden', 'text-overflow': 'ellipsis', 'max-width': '16rem'}"
[pTooltip]="textElement.offsetWidth < textElement.scrollWidth ? item[displayKey] : null"
tooltipPosition="top">
<span>
{{ item[displayKey] }}
</span>
<p *ngIf="isMultiLineOption" class="tw-text-text-muted tw-text-12-px">{{ item['subLabel'] }}o</p>
Expand Down

0 comments on commit 1d08e58

Please sign in to comment.