Skip to content

Commit

Permalink
EPMRPP-94816 || Jira Cloud. Implement functionality to add Assignee (#…
Browse files Browse the repository at this point in the history
…3998)

* EPMRPP-94816 || Jira Cloud. Implement functionality to add Assignee

* EPMRPP-94816 || Jira Cloud. Implement functionality to add Assignee
  • Loading branch information
maria-hambardzumian authored Sep 3, 2024
1 parent 3d518e1 commit 01f200f
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 2 deletions.
2 changes: 2 additions & 0 deletions app/src/components/fields/dynamicFieldsSection/constants.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ export const AUTOCOMPLETE_TYPE = 'autocomplete';
export const MULTIPLE_AUTOCOMPLETE_TYPE = 'multiAutocomplete';
export const CREATABLE_MULTIPLE_AUTOCOMPLETE_TYPE = 'creatableMultiAutocomplete';

export const ASSIGNEE_FIELD_NAME = 'assignee';

export const VALUE_NAME_KEY = 'valueName';
export const VALUE_ID_KEY = 'valueId';
export const VALUE_NONE = 'None';
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,15 @@
import React, { Component } from 'react';
import PropTypes from 'prop-types';
import classNames from 'classnames/bind';
import { JIRA_CLOUD } from 'pages/inside/projectSettingsPageContainer/content/integrations/integrationsList/integrationInfo/constats';
import { dynamicFieldShape } from './dynamicFieldShape';
import { getFieldComponent } from './utils';
import { VALUE_ID_KEY, VALUE_NAME_KEY } from './constants';
import {
ASSIGNEE_FIELD_NAME,
MULTIPLE_AUTOCOMPLETE_TYPE,
VALUE_ID_KEY,
VALUE_NAME_KEY,
} from './constants';
import styles from './dynamicFieldsSection.scss';

const cx = classNames.bind(styles);
Expand Down Expand Up @@ -64,7 +70,12 @@ export class DynamicFieldsSection extends Component {
} = this.props;

return fields.map((field) => {
const FieldComponent = getFieldComponent(field);
const isJiraCloud = integrationInfo.pluginName === JIRA_CLOUD;
const isAssigneeField = field.fieldName?.toLowerCase() === ASSIGNEE_FIELD_NAME.toLowerCase();
const fieldType =
isJiraCloud && isAssigneeField ? MULTIPLE_AUTOCOMPLETE_TYPE : field.fieldType;

const FieldComponent = getFieldComponent({ ...field, fieldType });

return (
<FieldComponent
Expand Down

0 comments on commit 01f200f

Please sign in to comment.