Skip to content

Commit

Permalink
[MI-2228]:Fixed Jira Issue 819 (Create issue modal crashes when assig…
Browse files Browse the repository at this point in the history
…nee is selected before switching projects) (#8)

* iterim pr for qa

* updated changes that fixes crash

* this is a hotfix that fixes the crash

* fixes line issue

* updated logic to reset fields

* spacing

* updated types for datatypes

* fixed linting

* fixed linting issues

* [MI-2228]:Fixed jira issue 819

* [MI-2228]:Fixed review fixes

Co-authored-by: raju <raju.s@demansol.com>
Co-authored-by: sibasankarnayak <sibasankar@demansoltech.com>
  • Loading branch information
3 people authored Oct 19, 2022
1 parent f778e6f commit a9a15ab
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import BackendSelector, {Props as BackendSelectorProps} from '../backend_selecto

type Props = BackendSelectorProps & {
projectKey: string;
searchUsers: (params: {project: string; q: string}) => Promise<{data: JiraUser[]; error?: Error}>;
searchUsers: (params: {project: string; q: string}) => Promise<{data: {label: string; value: JiraUser[]}; error?: Error}>;
};

export default class JiraUserSelector extends React.PureComponent<Props> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,8 @@ export default class CreateIssueForm extends React.PureComponent<Props, State> {
});

let fields = {
...this.state.fields,
summary: this.state.fields.summary,
description: this.state.fields.description,
project: {key: projectKey},
} as CreateIssueFields;

Expand All @@ -160,7 +161,9 @@ export default class CreateIssueForm extends React.PureComponent<Props, State> {

handleIssueTypeChange = (_: string, issueType: string) => {
let fields = {
...this.state.fields,
summary: this.state.fields.summary,
description: this.state.fields.description,
project: {key: this.state.projectKey},
issuetype: {id: issueType},
} as CreateIssueFields;

Expand Down
1 change: 1 addition & 0 deletions webapp/src/types/model.ts
Original file line number Diff line number Diff line change
Expand Up @@ -212,6 +212,7 @@ export type AllProjectMetadata = {

export type CreateIssueFields = {
description: string;
summary?: string;
project: {key: string};
issuetype: {id: string};
} & {[key: string]: JiraField};

0 comments on commit a9a15ab

Please sign in to comment.