From 7436b88ba2b98651b826a9828c0cb3d0a3e9b3f8 Mon Sep 17 00:00:00 2001 From: maria-hambardzumian Date: Fri, 26 Apr 2024 17:14:05 +0400 Subject: [PATCH 1/4] EPMRPP 90667 || No 'Email server is disabled' message is displayed for Member/Operator/Cusomer users --- .../notifications/ruleGroup/ruleGroup.jsx | 49 ++++++++++--------- 1 file changed, 27 insertions(+), 22 deletions(-) diff --git a/app/src/pages/inside/projectSettingsPageContainer/content/notifications/ruleGroup/ruleGroup.jsx b/app/src/pages/inside/projectSettingsPageContainer/content/notifications/ruleGroup/ruleGroup.jsx index 424ac20377..9e39776897 100644 --- a/app/src/pages/inside/projectSettingsPageContainer/content/notifications/ruleGroup/ruleGroup.jsx +++ b/app/src/pages/inside/projectSettingsPageContainer/content/notifications/ruleGroup/ruleGroup.jsx @@ -95,6 +95,11 @@ export const RuleGroup = ({ pluginName, typedRules, notifications, isPluginEnabl const isUpdateSettingAvailable = canUpdateSettings(userRole, projectRole); const isReadOnly = !isUpdateSettingAvailable || !isPluginEnabled; + const isActivationRequired = + isUpdateSettingAvailable || (!isUpdateSettingAvailable && typedRules.length > 0); + const isDisabledTooltipActivationRequired = !pluginName && isActivationRequired; + const isEmailIntegrationRequired = + pluginName === EMAIL && !isEmailIntegrationAvailable && isActivationRequired; const onToggleHandler = (isEnabled, notification) => { trackEvent(PROJECT_SETTINGS_NOTIFICATIONS_EVENTS.SWITCH_NOTIFICATION_RULE(isEnabled)); @@ -246,25 +251,24 @@ export const RuleGroup = ({ pluginName, typedRules, notifications, isPluginEnabl - {isUpdateSettingAvailable && - (!isPluginEnabled ? ( -
-

- {pluginName}{' '} - {formatMessage(messages.disabledPlugin, { pluginName })} -

- - {Parser(AboutIcon)} - -
- ) : ( - pluginName === EMAIL && - !isEmailIntegrationAvailable && ( -
-

{formatMessage(messages.notConfiguredIntegration)}

+ {isDisabledTooltipActivationRequired ? ( +
+

+ {pluginName}{' '} + {formatMessage(messages.disabledPlugin, { pluginName })} +

+ + {Parser(AboutIcon)} + +
+ ) : ( + isEmailIntegrationRequired && ( +
+

{formatMessage(messages.notConfiguredIntegration)}

+ {isUpdateSettingAvailable && ( {formatMessage(messages.configureIntegration)} -
- ) - ))} + )} +
+ ) + )}
From 95db049c6523284ceb30c0784d68550cea3a892f Mon Sep 17 00:00:00 2001 From: maria-hambardzumian Date: Fri, 26 Apr 2024 17:17:11 +0400 Subject: [PATCH 2/4] EPMRPP 90667 || grammar fix --- .../content/notifications/messages.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/src/pages/inside/projectSettingsPageContainer/content/notifications/messages.js b/app/src/pages/inside/projectSettingsPageContainer/content/notifications/messages.js index c4007985fc..8cabfe6d91 100644 --- a/app/src/pages/inside/projectSettingsPageContainer/content/notifications/messages.js +++ b/app/src/pages/inside/projectSettingsPageContainer/content/notifications/messages.js @@ -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', From a1a52bc89e8952196f188042731d381c848a6b6e Mon Sep 17 00:00:00 2001 From: maria-hambardzumian Date: Fri, 26 Apr 2024 17:46:13 +0400 Subject: [PATCH 3/4] EPMRPP 90667 || optional chaining for typed rules --- .../content/notifications/ruleGroup/ruleGroup.jsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/src/pages/inside/projectSettingsPageContainer/content/notifications/ruleGroup/ruleGroup.jsx b/app/src/pages/inside/projectSettingsPageContainer/content/notifications/ruleGroup/ruleGroup.jsx index 9e39776897..fe24a210a8 100644 --- a/app/src/pages/inside/projectSettingsPageContainer/content/notifications/ruleGroup/ruleGroup.jsx +++ b/app/src/pages/inside/projectSettingsPageContainer/content/notifications/ruleGroup/ruleGroup.jsx @@ -96,7 +96,7 @@ export const RuleGroup = ({ pluginName, typedRules, notifications, isPluginEnabl const isUpdateSettingAvailable = canUpdateSettings(userRole, projectRole); const isReadOnly = !isUpdateSettingAvailable || !isPluginEnabled; const isActivationRequired = - isUpdateSettingAvailable || (!isUpdateSettingAvailable && typedRules.length > 0); + isUpdateSettingAvailable || (!isUpdateSettingAvailable && typedRules?.length > 0); const isDisabledTooltipActivationRequired = !pluginName && isActivationRequired; const isEmailIntegrationRequired = pluginName === EMAIL && !isEmailIntegrationAvailable && isActivationRequired; From 62ae5ed89ec1c3a88515c01b2edbabcb6c289ee1 Mon Sep 17 00:00:00 2001 From: maria-hambardzumian Date: Mon, 29 Apr 2024 10:37:40 +0400 Subject: [PATCH 4/4] EPMRPP 90667 || Code review fixes --- .../content/notifications/ruleGroup/ruleGroup.jsx | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/app/src/pages/inside/projectSettingsPageContainer/content/notifications/ruleGroup/ruleGroup.jsx b/app/src/pages/inside/projectSettingsPageContainer/content/notifications/ruleGroup/ruleGroup.jsx index fe24a210a8..edf2a11b19 100644 --- a/app/src/pages/inside/projectSettingsPageContainer/content/notifications/ruleGroup/ruleGroup.jsx +++ b/app/src/pages/inside/projectSettingsPageContainer/content/notifications/ruleGroup/ruleGroup.jsx @@ -95,9 +95,8 @@ export const RuleGroup = ({ pluginName, typedRules, notifications, isPluginEnabl const isUpdateSettingAvailable = canUpdateSettings(userRole, projectRole); const isReadOnly = !isUpdateSettingAvailable || !isPluginEnabled; - const isActivationRequired = - isUpdateSettingAvailable || (!isUpdateSettingAvailable && typedRules?.length > 0); - const isDisabledTooltipActivationRequired = !pluginName && isActivationRequired; + const isActivationRequired = isUpdateSettingAvailable || typedRules?.length > 0; + const isDisabledTooltipActivationRequired = !isPluginEnabled && isActivationRequired; const isEmailIntegrationRequired = pluginName === EMAIL && !isEmailIntegrationAvailable && isActivationRequired;