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

[v25.0] Issue Tracker Assignee appears empty and will not update until a selection is madefix data.assignees in new and edit #9018

Open
wants to merge 5 commits into
base: 25.0-release
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
8 changes: 5 additions & 3 deletions modules/issue_tracker/jsx/IssueForm.js
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,6 @@ class IssueForm extends Component {
let isWatching = this.state.issueData.watching;
let attachmentUploadBtn = null;
let attachmentFileElement = null;

const siteOptions = this.state.Data.sites;
// Add an 'All Sites' options in the Site dropdown
// to allow NULL value
Expand Down Expand Up @@ -367,6 +366,7 @@ class IssueForm extends Component {
(data) => {
let newIssue = !data.issueData.issueID;
let formData = data.issueData;

// ensure that if the user is at multiple sites and
// its a new issue, the centerID (which is a dropdown)
// is set to the empty option instead of an array of
Expand All @@ -383,8 +383,11 @@ class IssueForm extends Component {
if (formData.centerID == null) {
formData.centerID = 'all';
}
formData.assignee =
Object.keys(data.assignees).find(
(key) => data.assignees[key] === data.issueData.assignee
);
}

this.setState({
Data: data,
isLoaded: true,
Expand Down Expand Up @@ -484,7 +487,6 @@ class IssueForm extends Component {
// todo: only give valid inputs for fields given previous input to other fields
const formDataUpdate = this.state.formData;
formDataUpdate[formElement] = value;

this.setState({
formData: formDataUpdate,
});
Expand Down