mirror of
https://github.com/hcengineering/platform.git
synced 2025-04-21 15:59:15 +00:00
Signed-off-by: Sergei Ogorelkov <sergei.ogorelkov@xored.com>
This commit is contained in:
parent
11fadf935d
commit
134e0a7926
@ -73,6 +73,7 @@
|
|||||||
sort: { rank: SortingOrder.Ascending }
|
sort: { rank: SortingOrder.Ascending }
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
$: canSave = !!(space && object.status && getTitle())
|
||||||
|
|
||||||
async function updateIssueStatusId (teamId: Ref<Team>, issueStatusId?: Ref<IssueStatus>) {
|
async function updateIssueStatusId (teamId: Ref<Team>, issueStatusId?: Ref<IssueStatus>) {
|
||||||
if (issueStatusId !== undefined) {
|
if (issueStatusId !== undefined) {
|
||||||
@ -92,6 +93,10 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function getTitle () {
|
||||||
|
return object.title.trim()
|
||||||
|
}
|
||||||
|
|
||||||
export function canClose (): boolean {
|
export function canClose (): boolean {
|
||||||
// if (object.title !== undefined) {
|
// if (object.title !== undefined) {
|
||||||
// showPopup(
|
// showPopup(
|
||||||
@ -107,11 +112,11 @@
|
|||||||
// }
|
// }
|
||||||
// )
|
// )
|
||||||
// }
|
// }
|
||||||
return object.title === ''
|
return canSave
|
||||||
}
|
}
|
||||||
|
|
||||||
async function createIssue () {
|
async function createIssue () {
|
||||||
if (!object.status) {
|
if (!canSave) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -131,7 +136,7 @@
|
|||||||
)
|
)
|
||||||
|
|
||||||
const value: Data<Issue> = {
|
const value: Data<Issue> = {
|
||||||
title: object.title,
|
title: getTitle(),
|
||||||
description: object.description,
|
description: object.description,
|
||||||
assignee: currentAssignee,
|
assignee: currentAssignee,
|
||||||
number: (incResult as any).object.sequence,
|
number: (incResult as any).object.sequence,
|
||||||
@ -166,11 +171,10 @@
|
|||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<!-- canSave: object.title.length > 0 && _space != null -->
|
|
||||||
<Card
|
<Card
|
||||||
label={tracker.string.NewIssue}
|
label={tracker.string.NewIssue}
|
||||||
okAction={createIssue}
|
okAction={createIssue}
|
||||||
canSave={true}
|
{canSave}
|
||||||
okLabel={tracker.string.SaveIssue}
|
okLabel={tracker.string.SaveIssue}
|
||||||
spaceClass={tracker.class.Team}
|
spaceClass={tracker.class.Team}
|
||||||
spaceLabel={tracker.string.Team}
|
spaceLabel={tracker.string.Team}
|
||||||
|
Loading…
Reference in New Issue
Block a user