Commit c00ea95b authored by Kushal Pandya's avatar Kushal Pandya

Merge branch...

Merge branch '356634-creating-an-issue-in-a-board-with-a-weight-in-scope-does-not-add-weight' into 'master'

Fix create issue in board with weight

See merge request gitlab-org/gitlab!83487
parents 86e3a049 479487ca
...@@ -111,7 +111,7 @@ export function fullLabelId(label) { ...@@ -111,7 +111,7 @@ export function fullLabelId(label) {
export function formatIssueInput(issueInput, boardConfig) { export function formatIssueInput(issueInput, boardConfig) {
const { labelIds = [], assigneeIds = [] } = issueInput; const { labelIds = [], assigneeIds = [] } = issueInput;
const { labels, assigneeId, milestoneId } = boardConfig; const { labels, assigneeId, milestoneId, weight } = boardConfig;
return { return {
...issueInput, ...issueInput,
...@@ -121,6 +121,7 @@ export function formatIssueInput(issueInput, boardConfig) { ...@@ -121,6 +121,7 @@ export function formatIssueInput(issueInput, boardConfig) {
: issueInput?.milestoneId, : issueInput?.milestoneId,
labelIds: [...labelIds, ...(labels?.map((l) => fullLabelId(l)) || [])], labelIds: [...labelIds, ...(labels?.map((l) => fullLabelId(l)) || [])],
assigneeIds: [...assigneeIds, ...(assigneeId ? [fullUserId(assigneeId)] : [])], assigneeIds: [...assigneeIds, ...(assigneeId ? [fullUserId(assigneeId)] : [])],
weight,
}; };
} }
......
...@@ -63,7 +63,7 @@ export default { ...@@ -63,7 +63,7 @@ export default {
} else if (weight === NO_WEIGHT) { } else if (weight === NO_WEIGHT) {
return -2; return -2;
} }
return -1; return null;
}, },
toggleEdit() { toggleEdit() {
if (this.dropdownHidden) { if (this.dropdownHidden) {
......
...@@ -27,6 +27,7 @@ describe('formatIssueInput', () => { ...@@ -27,6 +27,7 @@ describe('formatIssueInput', () => {
labelIds: ['gid://gitlab/GroupLabel/5', 'gid://gitlab/GroupLabel/44'], labelIds: ['gid://gitlab/GroupLabel/5', 'gid://gitlab/GroupLabel/44'],
assigneeIds: ['gid://gitlab/User/55'], assigneeIds: ['gid://gitlab/User/55'],
milestoneId: 'gid://gitlab/Milestone/66', milestoneId: 'gid://gitlab/Milestone/66',
weight: 1,
}); });
}); });
}); });
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment