From ca3681489d82b3147d9c4a27d8a285fc3ae4c47a Mon Sep 17 00:00:00 2001 From: Vadzim Hvazdovich Date: Tue, 23 Apr 2024 09:50:26 +0300 Subject: [PATCH] sonar fix --- app/src/components/fields/dynamicFieldsSection/utils.js | 2 +- .../modals/inviteUserModal/inviteUserModal.jsx | 8 +------- 2 files changed, 2 insertions(+), 8 deletions(-) diff --git a/app/src/components/fields/dynamicFieldsSection/utils.js b/app/src/components/fields/dynamicFieldsSection/utils.js index 8371b7e8b7..4ade87b258 100644 --- a/app/src/components/fields/dynamicFieldsSection/utils.js +++ b/app/src/components/fields/dynamicFieldsSection/utils.js @@ -76,7 +76,7 @@ export const getFieldComponent = (field) => { if (field.fieldType === MULTILINE_TEXT_TYPE) { fieldType = MULTILINE_TEXT_TYPE; - } else if (field.fieldType === ARRAY_TYPE && field.definedValues && field.definedValues.length) { + } else if (field.fieldType === ARRAY_TYPE && field.definedValues?.length) { fieldType = ARRAY_TYPE; } else if (field.fieldType === DATE_TYPE || field.fieldType.toLowerCase() === 'datetime') { fieldType = DATE_TYPE; diff --git a/app/src/pages/common/membersPage/modals/inviteUserModal/inviteUserModal.jsx b/app/src/pages/common/membersPage/modals/inviteUserModal/inviteUserModal.jsx index ab02b56850..283880c22c 100644 --- a/app/src/pages/common/membersPage/modals/inviteUserModal/inviteUserModal.jsx +++ b/app/src/pages/common/membersPage/modals/inviteUserModal/inviteUserModal.jsx @@ -259,13 +259,7 @@ export class InviteUserModal extends Component { }; formatUser = (user) => (user && { value: user.userLogin, label: user.userLogin }) || null; - filterProject = (value) => - !( - value && - this.props.selectedUser && - this.props.selectedUser.assignedProjects && - this.props.selectedUser.assignedProjects[value] - ); + filterProject = (value) => !(value && this.props.selectedUser?.assignedProjects?.[value]); render() { const {