Skip to content

Commit

Permalink
EPMRPP 90569 || Code review fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
maria-hambardzumian committed Apr 26, 2024
1 parent 8f3e709 commit f0e69cf
Showing 1 changed file with 7 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -93,8 +93,8 @@ export const RuleGroup = ({ pluginName, typedRules, notifications, isPluginEnabl
projectPluginNotificationsStateSelector(pluginName),
);

const isAvailable = canUpdateSettings(userRole, projectRole);
const isReadOnly = !isAvailable || !isPluginEnabled;
const isUpdateSettingAvailable = canUpdateSettings(userRole, projectRole);
const isReadOnly = !isUpdateSettingAvailable || !isPluginEnabled;

const onToggleHandler = (isEnabled, notification) => {
trackEvent(PROJECT_SETTINGS_NOTIFICATIONS_EVENTS.SWITCH_NOTIFICATION_RULE(isEnabled));
Expand Down Expand Up @@ -246,7 +246,7 @@ export const RuleGroup = ({ pluginName, typedRules, notifications, isPluginEnabl
</Toggle>
</div>
</FieldElement>
{isAvailable &&
{isUpdateSettingAvailable &&
(!isPluginEnabled ? (
<div className={cx('disabled-plugin')}>
<p>
Expand Down Expand Up @@ -299,7 +299,7 @@ export const RuleGroup = ({ pluginName, typedRules, notifications, isPluginEnabl
dataAutomationId="notificationsRulesList"
className={cx('rule-group-list')}
/>
{isAvailable && (
{isUpdateSettingAvailable && (
<Button
customClassName={cx('add-rule')}
onClick={onAdd}
Expand All @@ -311,7 +311,9 @@ export const RuleGroup = ({ pluginName, typedRules, notifications, isPluginEnabl
)}
</div>
) : (
isAvailable && <EmptyRuleState ruleName={pluginName} onCreateClick={onAdd} />
isUpdateSettingAvailable && (
<EmptyRuleState ruleName={pluginName} onCreateClick={onAdd} />
)
)}
</div>
</Layout>
Expand Down

0 comments on commit f0e69cf

Please sign in to comment.