Skip to content

Commit

Permalink
Update field-editor.tsx
Browse files Browse the repository at this point in the history
  • Loading branch information
Elayaraman committed Apr 5, 2024
1 parent 9ba9405 commit c5abf56
Showing 1 changed file with 10 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1322,12 +1322,12 @@ export class FieldEditor {

private renderStatusToggle(objFormValue) {
const strBaseClassName = 'fw-field-editor';
const choices = objFormValue.choices;

const choices = objFormValue?.choices;
const isSlaEnabled =
objFormValue.field_options.slaTimerEnabled &&
(Object(choices[1].choice_options).keys.length > 1 ||
Object(choices[2].choice_options).keys.length > 1);
objFormValue?.field_options?.slaTimerEnabled &&
(choices[1]?.choice_options?.pause_resolution_sla_timer !== undefined ||
choices[2].choice_options?.pause_resolution_sla_timer !== undefined);
const slaClassName = `${isSlaEnabled ? 'sla' : ''}`;

const renderToggle = (id, name, checked) => (
<span>
Expand All @@ -1341,18 +1341,18 @@ export class FieldEditor {
</span>
);
return (
<div
class={`${strBaseClassName}-status-toggle ${isSlaEnabled ? 'sla' : ''}`}
>
<div class={`${strBaseClassName}-status-toggle-item header`}>
<div class={`${strBaseClassName}-status-toggle`}>
<div
class={`${strBaseClassName}-status-toggle-item header ${slaClassName}`}
>
<span>{i18nText('fieldLabel')}</span>
<span>{i18nText('ertText')}</span>
{isSlaEnabled && <span>{i18nText('pstText')}</span>}
</div>
{choices.map((dataItem) => {
return (
<div
class={`${strBaseClassName}-status-toggle-item`}
class={`${strBaseClassName}-status-toggle-item ${slaClassName}`}
key={dataItem.id}
>
<span>
Expand Down

0 comments on commit c5abf56

Please sign in to comment.