Skip to content

Commit f1fad74

Browse files
authored
Tracker fixes (#2255)
Signed-off-by: Andrey Sobolev <[email protected]>
1 parent ccd2048 commit f1fad74

File tree

23 files changed

+202
-102
lines changed

23 files changed

+202
-102
lines changed

common/changes/@anticrm/workspace/avatar_2021-11-09-17-00.json

Lines changed: 0 additions & 10 deletions
This file was deleted.

models/tracker/src/index.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -394,6 +394,8 @@ export function createModel (builder: Builder): void {
394394
props: { kind: 'list', size: 'small', justify: 'center' }
395395
},
396396
{ key: '', presenter: tracker.component.TitlePresenter, props: { shouldUseMargin: true, fixed: 'left' } },
397+
{ key: '', presenter: tracker.component.SubIssuesSelector, props: {} },
398+
{ key: '', presenter: tracker.component.GrowPresenter, props: {} },
397399
{ key: '', presenter: tracker.component.DueDatePresenter, props: { kind: 'list' } },
398400
{
399401
key: '',

models/tracker/src/plugin.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,8 @@ export default mergeIds(trackerId, tracker, {
3838
component: {
3939
// Required to pass build without errorsF
4040
Nope: '' as AnyComponent,
41-
SprintSelector: '' as AnyComponent
41+
SprintSelector: '' as AnyComponent,
42+
SubIssuesSelector: '' as AnyComponent
4243
},
4344
app: {
4445
Tracker: '' as Ref<Application>

packages/core/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@anticrm/core",
3-
"version": "0.6.16",
3+
"version": "0.6.17",
44
"main": "lib/index.js",
55
"author": "Anticrm Platform Contributors",
66
"license": "EPL-2.0",
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
<span class="root" />
2+
3+
<style lang="scss">
4+
.root {
5+
display: flex;
6+
flex-grow: 1;
7+
min-width: 0;
8+
white-space: nowrap;
9+
overflow: hidden;
10+
flex-shrink: 10;
11+
12+
&.with-margin {
13+
margin-left: 0.5rem;
14+
}
15+
}
16+
</style>

plugins/tracker-resources/src/components/issues/IssuesList.svelte

Lines changed: 25 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
import contact, { Employee } from '@anticrm/contact'
1717
import { Class, Doc, FindOptions, getObjectValue, Ref, WithLookup } from '@anticrm/core'
1818
import notification from '@anticrm/notification'
19-
import { getClient } from '@anticrm/presentation'
19+
import { createQuery, getClient } from '@anticrm/presentation'
2020
import { Issue, IssueStatus, Team } from '@anticrm/tracker'
2121
import {
2222
Button,
@@ -36,6 +36,7 @@
3636
import tracker from '../../plugin'
3737
import { IssuesGroupByKeys, issuesGroupEditorMap, IssuesOrderByKeys, issuesSortOrderMap } from '../../utils'
3838
import CreateIssue from '../CreateIssue.svelte'
39+
import GrowPresenter from './GrowPresenter.svelte'
3940
4041
export let _class: Ref<Class<Doc>>
4142
export let currentSpace: Ref<Team> | undefined = undefined
@@ -59,10 +60,19 @@
5960
lookup: {
6061
assignee: contact.class.Employee,
6162
status: tracker.class.IssueStatus,
62-
space: tracker.class.Team
63+
space: tracker.class.Team,
64+
_id: {
65+
subIssues: tracker.class.Issue
66+
}
6367
}
6468
}
6569
70+
const spaceQuery = createQuery()
71+
let currentTeam: Team | undefined
72+
$: spaceQuery.query(tracker.class.Team, { _id: currentSpace }, (res) => {
73+
currentTeam = res.shift()
74+
})
75+
6676
let personPresenter: AttributeModel
6777
6878
$: isCollapsedMap = Object.fromEntries(categories.map((category) => [category, false]))
@@ -175,6 +185,7 @@
175185
shouldShowPlaceholder={true}
176186
isInteractive={false}
177187
avatarSize={'x-small'}
188+
{currentSpace}
178189
/>
179190
{:else if headerComponent}
180191
<Component
@@ -186,7 +197,8 @@
186197
statuses: groupByKey === 'status' ? statuses : undefined,
187198
issues: groupedIssues[category],
188199
size: 'inline',
189-
kind: 'list'
200+
kind: 'list',
201+
currentSpace
190202
}}
191203
/>
192204
{/if}
@@ -244,6 +256,8 @@
244256
value={getObjectValue(attributeModel.key, docObject) ?? ''}
245257
groupBy={groupByKey}
246258
{...attributeModel.props}
259+
{statuses}
260+
{currentTeam}
247261
/>
248262
</div>
249263
{:else if attributeModelIndex === 1}
@@ -259,10 +273,12 @@
259273
value={getObjectValue(attributeModel.key, docObject) ?? ''}
260274
groupBy={groupByKey}
261275
{...attributeModel.props}
276+
{statuses}
277+
{currentTeam}
262278
/>
263279
</FixedColumn>
264280
</div>
265-
{:else if attributeModelIndex === 3}
281+
{:else if attributeModelIndex === 3 || attributeModel.presenter === GrowPresenter}
266282
<svelte:component
267283
this={attributeModel.presenter}
268284
value={getObjectValue(attributeModel.key, docObject) ?? ''}
@@ -281,6 +297,8 @@
281297
value={getObjectValue(attributeModel.key, docObject) ?? ''}
282298
groupBy={groupByKey}
283299
{...attributeModel.props}
300+
{statuses}
301+
{currentTeam}
284302
/>
285303
</FixedColumn>
286304
{:else}
@@ -291,6 +309,8 @@
291309
issueId={docObject._id}
292310
groupBy={groupByKey}
293311
{...attributeModel.props}
312+
{statuses}
313+
{currentTeam}
294314
/>
295315
</div>
296316
{/if}
@@ -367,12 +387,7 @@
367387
368388
.priorityPresenter,
369389
.issuePresenter {
370-
min-width: 0;
390+
// min-width: 0;
371391
min-height: 0;
372392
}
373-
// .grow-cell {
374-
// flex-grow: 1;
375-
// flex-shrink: 0;
376-
// min-width: 0;
377-
// }
378393
</style>

plugins/tracker-resources/src/components/issues/KanbanView.svelte

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -252,7 +252,7 @@
252252
</div>
253253
<div class="buttons-group xsmall-gap states-bar">
254254
{#if issue && issueStatuses && issue.subIssues > 0}
255-
<SubIssuesSelector {issue} {currentTeam} {issueStatuses} />
255+
<SubIssuesSelector value={issue} {currentTeam} statuses={issueStatuses} />
256256
{/if}
257257
<PriorityEditor value={issue} isEditable={true} kind={'link-bordered'} size={'inline'} justify={'center'} />
258258
<ProjectEditor

plugins/tracker-resources/src/components/issues/ListView.svelte

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,10 @@
5858
assignee: contact.class.Employee,
5959
status: tracker.class.IssueStatus,
6060
space: tracker.class.Team,
61-
sprint: tracker.class.Sprint
61+
sprint: tracker.class.Sprint,
62+
_id: {
63+
subIssues: tracker.class.Issue
64+
}
6265
}
6366
}
6467
)

plugins/tracker-resources/src/components/issues/TitlePresenter.svelte

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,8 @@
3030
<style lang="scss">
3131
.root {
3232
display: flex;
33-
flex-grow: 1;
34-
min-width: 0;
33+
flex-grow: 0;
34+
min-width: 7rem;
3535
white-space: nowrap;
3636
overflow: hidden;
3737
flex-shrink: 10;

plugins/tracker-resources/src/components/issues/edit/SubIssuesSelector.svelte

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,9 @@
2121
import tracker from '../../../plugin'
2222
import { getIssueId } from '../../../issues'
2323
24-
export let issue: WithLookup<Issue>
24+
export let value: WithLookup<Issue>
2525
export let currentTeam: Team | undefined
26-
export let issueStatuses: WithLookup<IssueStatus>[] | undefined
26+
export let statuses: WithLookup<IssueStatus>[] | undefined
2727
2828
export let kind: ButtonKind = 'link-bordered'
2929
export let size: ButtonSize = 'inline'
@@ -36,18 +36,18 @@
3636
let doneStatus: Ref<Doc> | undefined
3737
let countComplate: number = 0
3838
39-
$: if (issue.$lookup?.subIssues !== undefined) {
40-
subIssues = issue.$lookup.subIssues as Issue[]
41-
subIssues.sort((a, b) => a.rank.localeCompare(b.rank))
39+
$: if (value.$lookup?.subIssues !== undefined) {
40+
subIssues = value.$lookup.subIssues as Issue[]
41+
subIssues.sort((a, b) => (a.rank ?? '').localeCompare(b.rank ?? ''))
4242
}
43-
$: if (issueStatuses && subIssues) {
44-
doneStatus = issueStatuses.find((s) => s.category === tracker.issueStatusCategory.Completed)?._id ?? undefined
43+
$: if (statuses && subIssues) {
44+
doneStatus = statuses.find((s) => s.category === tracker.issueStatusCategory.Completed)?._id ?? undefined
4545
if (doneStatus) countComplate = subIssues.filter((si) => si.status === doneStatus).length
4646
}
4747
$: hasSubIssues = (subIssues?.length ?? 0) > 0
4848
4949
function getIssueStatusIcon (issue: Issue) {
50-
const status = issueStatuses?.find((s) => issue.status === s._id)
50+
const status = statuses?.find((s) => issue.status === s._id)
5151
const category = status?.$lookup?.category
5252
const color = status?.color ?? category?.color
5353
@@ -58,8 +58,8 @@
5858
}
5959
6060
function openIssue (target: Ref<Issue>) {
61-
if (target !== issue._id) {
62-
showPanel(tracker.component.EditIssue, target, issue._class, 'content')
61+
if (target !== value._id) {
62+
showPanel(tracker.component.EditIssue, target, value._class, 'content')
6363
}
6464
}
6565
function showSubIssues () {
@@ -71,7 +71,7 @@
7171
value: subIssues.map((iss) => {
7272
const text = currentTeam ? `${getIssueId(currentTeam, iss)} ${iss.title}` : iss.title
7373
74-
return { id: iss._id, text, isSelected: iss._id === issue._id, ...getIssueStatusIcon(iss) }
74+
return { id: iss._id, text, isSelected: iss._id === value._id, ...getIssueStatusIcon(iss) }
7575
}),
7676
width: 'large'
7777
},

0 commit comments

Comments
 (0)