mirror of
https://github.com/hcengineering/platform.git
synced 2025-04-14 20:39:03 +00:00
Tracker: fix console errors in the Issue Editor (#2001)
Signed-off-by: Sergei Ogorelkov <sergei.ogorelkov@xored.com>
This commit is contained in:
parent
8c8ba5c86e
commit
e85fcdbc30
@ -319,6 +319,10 @@ export function createModel (builder: Builder): void {
|
||||
const boardId = 'board'
|
||||
const projectsId = 'projects'
|
||||
|
||||
builder.mixin(tracker.class.Issue, core.class.Class, view.mixin.AttributePresenter, {
|
||||
presenter: tracker.component.IssuePresenter
|
||||
})
|
||||
|
||||
builder.mixin(tracker.class.TypeIssuePriority, core.class.Class, view.mixin.AttributePresenter, {
|
||||
presenter: tracker.component.PriorityPresenter
|
||||
})
|
||||
|
@ -69,7 +69,8 @@
|
||||
"ChangeParent": "Change parent issue\u2026",
|
||||
"RemoveParent": "Remove parent issue",
|
||||
"OpenParent": "Open parent issue",
|
||||
"SubIssues": "Sub-issues ({subIssues})",
|
||||
"SubIssues": "Sub-issues",
|
||||
"SubIssuesList": "Sub-issues ({subIssues})",
|
||||
"OpenSubIssues": "Open sub-issues",
|
||||
"AddSubIssues": "{subIssues, plural, =1 {Add sub-issue} other {+ Add sub-issues}}",
|
||||
"BlockedBy": "",
|
||||
|
@ -43,7 +43,8 @@
|
||||
"Low": "Низкий",
|
||||
"Unassigned": "Не назначен",
|
||||
"AddIssueTooltip": "Добавить задачу\u2026",
|
||||
"SubIssues": "Подзадачи ({subIssues})",
|
||||
"SubIssues": "Подзадачи",
|
||||
"SubIssuesList": "Подзадачи ({subIssues})",
|
||||
"OpenSubIssues": "Открыть подзадачи",
|
||||
"AddSubIssues": "{subIssues, plural, =1 {Добавить подзадачу} other {+ Добавить подзадачи}}",
|
||||
|
||||
|
@ -13,31 +13,37 @@
|
||||
// limitations under the License.
|
||||
-->
|
||||
<script lang="ts">
|
||||
import { getClient } from '@anticrm/presentation'
|
||||
import { createQuery, getClient } from '@anticrm/presentation'
|
||||
import type { Issue, Team } from '@anticrm/tracker'
|
||||
import { Icon, showPanel } from '@anticrm/ui'
|
||||
import tracker from '../../plugin'
|
||||
|
||||
export let value: Issue
|
||||
export let currentTeam: Team
|
||||
export let currentTeam: Team | undefined
|
||||
export let inline: boolean = false
|
||||
|
||||
const client = getClient()
|
||||
const spaceQuery = createQuery()
|
||||
const shortLabel = client.getHierarchy().getClass(value._class).shortLabel
|
||||
|
||||
$: issueName = `${currentTeam.identifier}-${value.number}`
|
||||
|
||||
const handleIssuePreviewOpened = () => {
|
||||
function handleIssueEditorOpened () {
|
||||
showPanel(tracker.component.EditIssue, value._id, value._class, 'content')
|
||||
}
|
||||
|
||||
$: if (!currentTeam) {
|
||||
spaceQuery.query(tracker.class.Team, { _id: value.space }, (res) => ([currentTeam] = res))
|
||||
}
|
||||
$: issueName = currentTeam && `${currentTeam.identifier}-${value.number}`
|
||||
</script>
|
||||
|
||||
{#if value && shortLabel}
|
||||
<div class="flex-presenter issuePresenterRoot" class:inline-presenter={inline} on:click={handleIssuePreviewOpened}>
|
||||
<div class="flex-presenter issuePresenterRoot" class:inline-presenter={inline} on:click={handleIssueEditorOpened}>
|
||||
<div class="icon">
|
||||
<Icon icon={tracker.icon.Issue} size={'small'} />
|
||||
</div>
|
||||
<span title={issueName} class="label nowrap issueLabel">{issueName}</span>
|
||||
{#if issueName !== undefined}
|
||||
<span title={issueName} class="label nowrap issueLabel">{issueName}</span>
|
||||
{/if}
|
||||
</div>
|
||||
{/if}
|
||||
|
||||
|
@ -86,8 +86,12 @@
|
||||
</span>
|
||||
</div>
|
||||
<div class="flex-center">
|
||||
<ProjectEditor value={issue} />
|
||||
<DueDateEditor value={issue} />
|
||||
{#if issue.project !== null}
|
||||
<ProjectEditor value={issue} />
|
||||
{/if}
|
||||
{#if issue.dueDate !== null}
|
||||
<DueDateEditor value={issue} />
|
||||
{/if}
|
||||
<AssigneeEditor value={issue} />
|
||||
</div>
|
||||
</div>
|
||||
|
@ -58,7 +58,7 @@
|
||||
icon={isCollapsed ? Collapsed : Expanded}
|
||||
size="small"
|
||||
kind="transparent"
|
||||
label={tracker.string.SubIssues}
|
||||
label={tracker.string.SubIssuesList}
|
||||
labelParams={{ subIssues: issue.subIssues }}
|
||||
on:click={() => (isCollapsed = !isCollapsed)}
|
||||
/>
|
||||
@ -97,11 +97,11 @@
|
||||
|
||||
<style lang="scss">
|
||||
.list {
|
||||
border-bottom: 1px solid var(--divider-color);
|
||||
border-top: 1px solid var(--divider-color);
|
||||
|
||||
&.collapsed {
|
||||
margin-top: 1px;
|
||||
border-bottom: none;
|
||||
padding-top: 1px;
|
||||
border-top: none;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
@ -87,6 +87,7 @@ export default mergeIds(trackerId, tracker, {
|
||||
AssignTo: '' as IntlString,
|
||||
AssignedTo: '' as IntlString,
|
||||
SubIssues: '' as IntlString,
|
||||
SubIssuesList: '' as IntlString,
|
||||
SetParent: '' as IntlString,
|
||||
ChangeParent: '' as IntlString,
|
||||
RemoveParent: '' as IntlString,
|
||||
|
Loading…
Reference in New Issue
Block a user