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

Fix "Create issue modal crashes when assignee is selected before switching projects" #834

Closed
wants to merge 12 commits into from
4 changes: 2 additions & 2 deletions webapp/src/components/data_selectors/backend_selector.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import AsyncSelect from 'react-select/async';

import {Theme} from 'mattermost-redux/types/preferences';

import {IssueMetadata, ReactSelectOption, JiraIssue, SearchIssueParams, APIResponse} from 'types/model';
import {IssueMetadata, ReactSelectOption, JiraIssue, SearchIssueParams, APIResponse, AvatarSize} from 'types/model';
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This import should be removed


import {getStyleForReactSelect} from 'utils/styles';
import {isEpicNameField, isEpicIssueType} from 'utils/jira_issue_metadata';
Expand Down Expand Up @@ -160,7 +160,7 @@ export default class BackendSelector extends React.PureComponent<Props, State> {

// option's label hasn't been fetched yet
return {
label: v,
label: v.displayName,
value: v,
};
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@sanjaydemansol Can you please explain this fix? All other types of selectors (non-user) seem to be working correctly. Do they actually need to have this change (which they do receive the change if it is applied in this file)? It seems the problem is specific to users, so I would expect the fix to go into jira_user_selector.tsx.

Can you please describe how you discovered the root cause, and how this fixes it? What is the error printed to the console during the crash, and what line does it occur on?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mickmister this is unrelated to the issue. I'm not sure why it is here. I have updated the code to remove this. The crash is caused by the assignee property not being reset. I am awaiting dipak to finish the qa on this one.

};
Expand Down