Skip to content

Commit

Permalink
EPMRPP-78479 || code review fixes - 3
Browse files Browse the repository at this point in the history
  • Loading branch information
Dzmitry Kosarau authored and Dzmitry Kosarau committed Aug 4, 2022
1 parent a817ce6 commit 6f44b2b
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,7 @@ export const RuleItem = ({ item, actions, onToggle, disabled, content, onClick }

const onClickHandler = () => {
setShown(!shown);
if (!shown && onClick) {
onClick();
}
onClick(shown);
};

return (
Expand Down Expand Up @@ -79,12 +77,12 @@ RuleItem.propTypes = {
onToggle: PropTypes.func,
disabled: PropTypes.bool,
content: PropTypes.node,
onClick: PropTypes.oneOfType([PropTypes.func, PropTypes.instanceOf(null)]),
onClick: PropTypes.func,
};
RuleItem.defaultProps = {
actions: [],
onToggle: () => {},
disabled: false,
content: null,
onClick: null,
onClick: () => {},
};
Original file line number Diff line number Diff line change
Expand Up @@ -53,12 +53,12 @@ RuleList.propTypes = {
onToggle: PropTypes.func,
disabled: PropTypes.bool,
ruleItemContent: PropTypes.oneOfType([PropTypes.func, PropTypes.node]),
handleRuleItemClick: PropTypes.oneOfType([PropTypes.func, PropTypes.instanceOf(null)]),
handleRuleItemClick: PropTypes.func,
};
RuleList.defaultProps = {
actions: [],
onToggle: () => {},
disabled: true,
ruleItemContent: null,
handleRuleItemClick: null,
handleRuleItemClick: () => {},
};
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,7 @@ const AddEditNotificationModal = ({
PROJECT_SETTINGS_NOTIFICATIONS_EVENTS.CLICK_SAVE_BUTTON_IN_MODAL(
modalName,
informOwner,
attributesValue.length,
isEditorShown ? attributesValue.length : undefined,
messages[sendCase].defaultMessage,
switcher,
),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -209,8 +209,10 @@ export const Notifications = ({ setHeaderTitleNode }) => {
},
];

const handleRuleItemClick = () => {
trackEvent(PROJECT_SETTINGS_NOTIFICATIONS_EVENTS.CLICK_TO_EXPAND_NOTIFICATIONS_DETAILS);
const handleRuleItemClick = (isShown) => {
if (isShown) {
trackEvent(PROJECT_SETTINGS_NOTIFICATIONS_EVENTS.CLICK_TO_EXPAND_NOTIFICATIONS_DETAILS);
}
};

const handleDocumentationClick = () => {
Expand Down Expand Up @@ -243,7 +245,7 @@ export const Notifications = ({ setHeaderTitleNode }) => {
actions={actions}
onToggle={onToggleHandler}
ruleItemContent={NotificationRuleContent}
onClick={handleRuleItemClick}
handleRuleItemClick={handleRuleItemClick}
/>
</div>
</>
Expand Down

0 comments on commit 6f44b2b

Please sign in to comment.