diff --git a/packages/kanban/src/components/Kanban.svelte b/packages/kanban/src/components/Kanban.svelte index 9a7d664e5d..4b644ccd66 100644 --- a/packages/kanban/src/components/Kanban.svelte +++ b/packages/kanban/src/components/Kanban.svelte @@ -17,13 +17,9 @@ import { createQuery, getClient } from '@anticrm/presentation' import { getPlatformColor, ScrollBox, Scroller } from '@anticrm/ui' import { createEventDispatcher } from 'svelte' - import { slide } from 'svelte/transition' - import { DocWithRank, StateType, TypeState } from '../types' + import { CardDragEvent, ExtItem, Item, StateType, TypeState } from '../types' import { calcRank } from '../utils' - - type Item = DocWithRank & { state: StateType; doneState: StateType | null } - type ExtItem = { prev?: Item; it: Item; next?: Item; pos: number } - type CardDragEvent = DragEvent & { currentTarget: EventTarget & HTMLDivElement } + import KanbanRow from './KanbanRow.svelte' export let _class: Ref> export let space: Ref @@ -144,7 +140,6 @@ return calcRank(object.it, object.next) } } - const slideD = (node: any, args: any) => (args.isDragging ? slide(node, args) : {}) function panelDragOver (event: Event, state: TypeState): void { event.preventDefault() @@ -184,11 +179,14 @@ let stateObjects: ExtItem[] const stateRefs: HTMLElement[] = [] + const stateRows: KanbanRow[] = [] $: stateRefs.length = states.length + $: stateRows.length = states.length - function scrollInto (statePos: number): void { + function scrollInto (statePos: number, obj: Item): void { stateRefs[statePos]?.scrollIntoView({ behavior: 'auto', block: 'nearest' }) + stateRows[statePos]?.scroll(obj) } export function select (offset: 1 | -1 | 0, of?: Doc, dir?: 'vertical' | 'horizontal'): void { @@ -227,16 +225,18 @@ if (offset === -1) { if (dir === undefined || dir === 'vertical') { - scrollInto(objState) - dispatch('obj-focus', (stateObjs[statePos - 1] ?? stateObjs[0]).it) + const obj = (stateObjs[statePos - 1] ?? stateObjs[0]).it + scrollInto(objState, obj) + dispatch('obj-focus', obj) return } else { while (objState > 0) { objState-- const nstateObjs = getStateObjects(objects, states[objState]) if (nstateObjs.length > 0) { - scrollInto(objState) - dispatch('obj-focus', (nstateObjs[statePos] ?? nstateObjs[nstateObjs.length - 1]).it) + const obj = (nstateObjs[statePos] ?? nstateObjs[nstateObjs.length - 1]).it + scrollInto(objState, obj) + dispatch('obj-focus', obj) break } } @@ -244,23 +244,25 @@ } if (offset === 1) { if (dir === undefined || dir === 'vertical') { - scrollInto(objState) - dispatch('obj-focus', (stateObjs[statePos + 1] ?? stateObjs[stateObjs.length - 1]).it) + const obj = (stateObjs[statePos + 1] ?? stateObjs[stateObjs.length - 1]).it + scrollInto(objState, obj) + dispatch('obj-focus', obj) return } else { while (objState < states.length - 1) { objState++ const nstateObjs = getStateObjects(objects, states[objState]) if (nstateObjs.length > 0) { - scrollInto(objState) - dispatch('obj-focus', (nstateObjs[statePos] ?? nstateObjs[nstateObjs.length - 1]).it) + const obj = (nstateObjs[statePos] ?? nstateObjs[nstateObjs.length - 1]).it + scrollInto(objState, obj) + dispatch('obj-focus', obj) break } } } } if (offset === 0) { - scrollInto(objState) + scrollInto(objState, obj) dispatch('obj-focus', obj) } } @@ -309,35 +311,25 @@ {/if} - {#each stateObjects as object} - {@const dragged = isDragging && object.it._id === dragCard?._id} -
cardDragOver(evt, object)} - on:drop|preventDefault={(evt) => cardDrop(evt, object)} - > -
dispatch('obj-focus', object.it)} - on:focus={() => {}} - on:contextmenu={(evt) => showMenu(evt, object)} - draggable={true} - class:draggable={true} - on:dragstart - on:dragend - class:dragged - on:dragstart={() => onDragStart(object, state)} - on:dragend={() => { - isDragging = false - }} - > - -
-
- {/each} + + + + + +
@@ -361,42 +353,6 @@ padding: 1.5rem 2rem 0; } - .card-container { - background-color: var(--board-card-bg-color); - border-radius: 0.25rem; - // transition: box-shadow .15s ease-in-out; - - &:hover { - background-color: var(--board-card-bg-hover); - } - &.checked { - background-color: var(--highlight-select); - box-shadow: inset 0 0 1px 1px var(--highlight-select-border); - - &:hover { - background-color: var(--highlight-select-hover); - } - } - &.selection, - &.checked.selection { - box-shadow: inset 0 0 1px 1px var(--primary-bg-color); - animation: anim-border 1s ease-in-out; - - &:hover { - background-color: var(--highlight-hover); - } - } - &.checked.selection:hover { - background-color: var(--highlight-select-hover); - } - - &.draggable { - cursor: grab; - } - &.dragged { - background-color: var(--board-bg-color); - } - } @keyframes anim-border { from { box-shadow: inset 0 0 1px 1px var(--primary-edit-border-color); diff --git a/packages/kanban/src/components/KanbanRow.svelte b/packages/kanban/src/components/KanbanRow.svelte new file mode 100644 index 0000000000..d88dd58789 --- /dev/null +++ b/packages/kanban/src/components/KanbanRow.svelte @@ -0,0 +1,129 @@ + + + +{#each stateObjects as object, i} + {@const dragged = isDragging && object.it._id === dragCard?._id} +
cardDragOver(evt, object)} + on:drop|preventDefault={(evt) => cardDrop(evt, object)} + > +
dispatch('obj-focus', object.it)} + on:focus={() => {}} + on:contextmenu={(evt) => showMenu(evt, object)} + draggable={true} + class:draggable={true} + on:dragstart + on:dragend + class:dragged + on:dragstart={() => onDragStart(object, state)} + on:dragend={() => { + isDragging = false + }} + > + +
+
+{/each} + + diff --git a/packages/kanban/src/types.ts b/packages/kanban/src/types.ts index 050e9f7a94..e272770861 100644 --- a/packages/kanban/src/types.ts +++ b/packages/kanban/src/types.ts @@ -19,3 +19,20 @@ export interface TypeState { color: number icon?: Asset } +/** + * @public + */ +export type Item = DocWithRank & { state: StateType, doneState: StateType | null } +/** + * @public + */ +export interface ExtItem { + prev?: Item + it: Item + next?: Item + pos: number +} +/** + * @public + */ +export type CardDragEvent = DragEvent & { currentTarget: EventTarget & HTMLDivElement } diff --git a/plugins/contact-resources/src/components/EmployeeAccountPresenter.svelte b/plugins/contact-resources/src/components/EmployeeAccountPresenter.svelte index 69ced0680d..ca0755746c 100644 --- a/plugins/contact-resources/src/components/EmployeeAccountPresenter.svelte +++ b/plugins/contact-resources/src/components/EmployeeAccountPresenter.svelte @@ -45,7 +45,6 @@
{formatName(employee.name)}
{:else} - {JSON.stringify(value)}
{value.email}
{/if} diff --git a/plugins/tracker-resources/src/components/ProjectSelector.svelte b/plugins/tracker-resources/src/components/ProjectSelector.svelte index 9f97d079c6..225e9b06ff 100644 --- a/plugins/tracker-resources/src/components/ProjectSelector.svelte +++ b/plugins/tracker-resources/src/components/ProjectSelector.svelte @@ -14,11 +14,11 @@ --> -{#if value && shortLabel} +{#if value}
- {#if issueName !== undefined} - {issueName} - {/if} + + {title} +
{/if} diff --git a/plugins/tracker-resources/src/components/issues/Issues.svelte b/plugins/tracker-resources/src/components/issues/Issues.svelte index 5690fea59e..da91666832 100644 --- a/plugins/tracker-resources/src/components/issues/Issues.svelte +++ b/plugins/tracker-resources/src/components/issues/Issues.svelte @@ -91,7 +91,11 @@ const options: FindOptions = { sort: { [issuesOrderKeyMap[orderingKey]]: issuesSortOrderMap[issuesOrderKeyMap[orderingKey]] }, limit: ENTRIES_LIMIT, - lookup: { assignee: contact.class.Employee, status: tracker.class.IssueStatus } + lookup: { + assignee: contact.class.Employee, + status: tracker.class.IssueStatus, + space: tracker.class.Team + } } $: baseQuery = { diff --git a/plugins/tracker-resources/src/components/issues/IssuesList.svelte b/plugins/tracker-resources/src/components/issues/IssuesList.svelte index 88ea0b98db..4d3e4f4628 100644 --- a/plugins/tracker-resources/src/components/issues/IssuesList.svelte +++ b/plugins/tracker-resources/src/components/issues/IssuesList.svelte @@ -57,7 +57,8 @@ const baseOptions: FindOptions = { lookup: { assignee: contact.class.Employee, - status: tracker.class.IssueStatus + status: tracker.class.IssueStatus, + space: tracker.class.Team } } diff --git a/plugins/tracker-resources/src/components/issues/ListView.svelte b/plugins/tracker-resources/src/components/issues/ListView.svelte index 354197230a..3b0e2c9d16 100644 --- a/plugins/tracker-resources/src/components/issues/ListView.svelte +++ b/plugins/tracker-resources/src/components/issues/ListView.svelte @@ -54,7 +54,11 @@ { sort: { [orderByKey]: issuesSortOrderMap[orderByKey] }, limit: 200, - lookup: { assignee: contact.class.Employee, status: tracker.class.IssueStatus } + lookup: { + assignee: contact.class.Employee, + status: tracker.class.IssueStatus, + space: tracker.class.Team + } } ) diff --git a/plugins/tracker-resources/src/components/issues/edit/SubIssuesSelector.svelte b/plugins/tracker-resources/src/components/issues/edit/SubIssuesSelector.svelte index 20d8a623b8..facae6141c 100644 --- a/plugins/tracker-resources/src/components/issues/edit/SubIssuesSelector.svelte +++ b/plugins/tracker-resources/src/components/issues/edit/SubIssuesSelector.svelte @@ -13,15 +13,14 @@ // limitations under the License. --> -{projectId} -{JSON.stringify(project)} {#if project} {:else} diff --git a/tests/sanity/tests/recruit.spec.ts b/tests/sanity/tests/recruit.spec.ts index f72661a62a..99aa9d6ca6 100644 --- a/tests/sanity/tests/recruit.spec.ts +++ b/tests/sanity/tests/recruit.spec.ts @@ -69,13 +69,12 @@ test.describe('recruit tests', () => { await page.click('button:has-text("Vacancy")') await page.fill('[placeholder="Software\\ Engineer"]', vacancyId) await page.click('button:has-text("Create")') - await page.locator(`text=${vacancyId}`).click() + await page.click(`tr > :has-text("${vacancyId}")`) await page.click('text=Talents') await page.click('text=Talents') await page.click('text=Andrey P.') - // await page.locator('.mixin-selector').locator('text="Candidate"').click() // Click on Add button await page.click('.applications-container .flex-row-center .flex-center') @@ -87,7 +86,7 @@ test.describe('recruit tests', () => { await page.click('button:has-text("Create")') - await page.locator(`tr:has-text("${vacancyId}") >> text=APP-`).click() + await page.click(`tr:has-text("${vacancyId}") >> text=APP-`) await page.click('button:has-text("Assigned recruiter")') await page.click('button:has-text("Rosamund Chen")') }) @@ -100,9 +99,9 @@ test.describe('recruit tests', () => { await page.locator('text=Vacancies').click() await page.click('button:has-text("Vacancy")') - await page.fill('[placeholder="Software\\ Engineer"]', vacancyId) - await page.click('button:has-text("Create")') - await page.locator(`text=${vacancyId}`).click() + await page.fill('form [placeholder="Software\\ Engineer"]', vacancyId) + await page.click('form button:has-text("Create")') + await page.click(`tr > :has-text("${vacancyId}")`) // Create Applicatio n1 await page.click('button:has-text("Application")') diff --git a/tests/sanity/tests/tags.spec.ts b/tests/sanity/tests/tags.spec.ts index 22da0219aa..a54b6442f4 100644 --- a/tests/sanity/tests/tags.spec.ts +++ b/tests/sanity/tests/tags.spec.ts @@ -90,17 +90,17 @@ test.describe('recruit tests', () => { // Click [placeholder="John"] await page.click('[placeholder="John"]') // Fill [placeholder="John"] - const first = 'first-' + generateId().slice(0, 4) + const first = 'first-' + generateId(4) await page.fill('[placeholder="John"]', first) // Click [placeholder="Appleseed"] await page.click('[placeholder="Appleseed"]') // Fill [placeholder="Appleseed"] - const last = 'last-' + generateId().slice(0, 4) + const last = 'last-' + generateId(4) await page.fill('[placeholder="Appleseed"]', last) // Click button:has-text("Create") await page.click('button:has-text("Create")') // Click text=q w - await page.click(`text=${first} ${last}`) + await page.click(`tr > :has-text("${first} ${last}")`) // Click text=java await expect(page.locator('text=java').first()).toBeVisible() })