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

EPMRPP-90667 || No 'Email server is disabled' message is displayed for Member/Operator/Customer users #3811

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 @@ -158,7 +158,7 @@ export const messages = defineMessages({
},
notConfiguredIntegration: {
id: 'NotificationsEnableForm.notConfiguredIntegration',
defaultMessage: 'Integration not configured yet',
defaultMessage: 'Integration is not configured yet',
},
configureIntegration: {
id: 'NotificationsEnableForm.configureIntegration',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,10 @@ export const RuleGroup = ({ pluginName, typedRules, notifications, isPluginEnabl

const isUpdateSettingAvailable = canUpdateSettings(userRole, projectRole);
const isReadOnly = !isUpdateSettingAvailable || !isPluginEnabled;
const isActivationRequired = isUpdateSettingAvailable || typedRules?.length > 0;
const isDisabledTooltipActivationRequired = !isPluginEnabled && isActivationRequired;
const isEmailIntegrationRequired =
pluginName === EMAIL && !isEmailIntegrationAvailable && isActivationRequired;

const onToggleHandler = (isEnabled, notification) => {
trackEvent(PROJECT_SETTINGS_NOTIFICATIONS_EVENTS.SWITCH_NOTIFICATION_RULE(isEnabled));
Expand Down Expand Up @@ -246,25 +250,24 @@ export const RuleGroup = ({ pluginName, typedRules, notifications, isPluginEnabl
</Toggle>
</div>
</FieldElement>
{isUpdateSettingAvailable &&
(!isPluginEnabled ? (
<div className={cx('disabled-plugin')}>
<p>
<span className={cx('capitalized')}>{pluginName}</span>{' '}
{formatMessage(messages.disabledPlugin, { pluginName })}
</p>
<RuleItemDisabledTooltip
className={cx('info-tooltip')}
tooltipContent={formatMessage(messages.disabledContactInfo)}
>
<i className={cx('icon', 'about-icon')}>{Parser(AboutIcon)}</i>
</RuleItemDisabledTooltip>
</div>
) : (
pluginName === EMAIL &&
!isEmailIntegrationAvailable && (
<div className={cx('integrate-configurations')}>
<p>{formatMessage(messages.notConfiguredIntegration)}</p>
{isDisabledTooltipActivationRequired ? (
maria-hambardzumian marked this conversation as resolved.
Show resolved Hide resolved
<div className={cx('disabled-plugin')}>
<p>
<span className={cx('capitalized')}>{pluginName}</span>{' '}
{formatMessage(messages.disabledPlugin, { pluginName })}
</p>
<RuleItemDisabledTooltip
className={cx('info-tooltip')}
tooltipContent={formatMessage(messages.disabledContactInfo)}
>
<i className={cx('icon', 'about-icon')}>{Parser(AboutIcon)}</i>
</RuleItemDisabledTooltip>
</div>
) : (
isEmailIntegrationRequired && (
<div className={cx('integrate-configurations')}>
<p>{formatMessage(messages.notConfiguredIntegration)}</p>
{isUpdateSettingAvailable && (
<LinkComponent
to={{
type: PROJECT_SETTINGS_TAB_PAGE,
Expand All @@ -278,9 +281,10 @@ export const RuleGroup = ({ pluginName, typedRules, notifications, isPluginEnabl
>
{formatMessage(messages.configureIntegration)}
</LinkComponent>
</div>
)
))}
)}
</div>
)
)}
</div>

<div className={cx('notifications-container')}>
Expand Down
Loading