Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions packages/presentation/src/components/Card.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@
export let numberOfBlocks: number = 0
export let thinHeader: boolean = false
export let accentHeader: boolean = false
export let headerNoPadding: boolean = false
export let hideSubheader: boolean = false
export let hideContent: boolean = false
export let hideAttachments: boolean = false
Expand Down Expand Up @@ -108,6 +109,7 @@
class="antiCard-header"
class:withSub={$$slots.subheader && !hideSubheader}
class:thinHeader
class:noPadding={headerNoPadding}
class:border-bottom-popup-divider={headerDivide}
>
<div class="antiCard-header__title-wrap">
Expand Down
4 changes: 4 additions & 0 deletions packages/theme/styles/dialogs.scss
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,10 @@
&.withSub.thinHeader { padding: 1rem 1.5rem 0; }
&.thinHeader:not(.withSub) { padding: 1rem 1.5rem; }
&:not(.withSub, .thinHeader) { padding: 1.5rem; }
&.noPadding {
padding: 0 1.5rem;
min-height: 4.75rem;
}

&__title-wrap {
display: flex;
Expand Down
2 changes: 2 additions & 0 deletions packages/ui/src/components/DropdownLabels.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
export let allowDeselect: boolean = false
export let showDropdownIcon: boolean = false

export let dataId: string | undefined = undefined
export let kind: ButtonKind = 'no-border'
export let size: ButtonSize = 'small'
export let justify: 'left' | 'center' = 'center'
Expand Down Expand Up @@ -68,6 +69,7 @@
{justify}
{disabled}
pressed={opened}
{dataId}
showTooltip={{ label, direction: labelDirection }}
on:click={() => {
if (!opened) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,7 @@
kind={'primary'}
icon={IconAdd}
size={'small'}
dataId={'btnAdd'}
{disabled}
on:click={(ev) => {
createAttribute(ev)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@
searchField="name"
showNavigate={false}
focusIndex={20000}
id={'selectSpaceType'}
/>
</svelte:fragment>
<div class="flex-col flex-gap-2">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@
<div class="hulyComponent-content__column-group">
<div class="hulyComponent-content__header">
<div class="flex gap-1">
<ButtonIcon icon={descriptor.icon} size={'large'} kind={'secondary'} />
<ButtonIcon icon={descriptor.icon} size={'large'} kind={'secondary'} dataId={'btnSelectIcon'} />
<ModernEditbox
kind="ghost"
size="large"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@
kind="primary"
icon={IconAdd}
size="small"
dataId={'btnAdd'}
{disabled}
on:click={(ev) => {
$settingsStore = { id: 'createRole', component: CreateRole, props: { type, descriptor } }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,6 @@
<div class="hulyTableAttr-header font-medium-12">
<IconFolder size="small" />
<span><Label label={task.string.Collections} /></span>
<ButtonIcon kind="primary" icon={IconAdd} size="small" {disabled} on:click={() => {}} />
<ButtonIcon kind="primary" icon={IconAdd} size="small" dataId={'btnAdd'} {disabled} on:click={() => {}} />
</div>
{/if}
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@
kind="primary"
icon={IconAdd}
size="small"
dataId={'btnAdd'}
{disabled}
on:click={(ev) => {
if (disabled) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import { Class, Doc, Ref, toIdMap } from '@hcengineering/core'
import { getClient } from '@hcengineering/presentation'
import task, { ProjectType, TaskType } from '@hcengineering/task'
import { ButtonKind, DropdownLabels } from '@hcengineering/ui'
import { ButtonKind, ButtonSize, DropdownLabels } from '@hcengineering/ui'
import { createEventDispatcher, onDestroy } from 'svelte'
import { selectedTaskTypeStore, taskTypeStore } from '../..'

Expand All @@ -11,7 +11,9 @@
export let focusIndex: number = -1
export let baseClass: Ref<Class<Doc>> | undefined = undefined
export let kind: ButtonKind = 'regular'
export let size: ButtonSize = 'medium'
export let allTypes = false

const client = getClient()

$: taskTypeDescriptors = toIdMap(client.getModel().findAllSync(task.class.TaskTypeDescriptor, {}))
Expand Down Expand Up @@ -48,8 +50,9 @@
<DropdownLabels
{focusIndex}
{kind}
size={'medium'}
{size}
{items}
dataId={'btnSelectTaskType'}
bind:selected={value}
enableSearch={false}
on:selected={change}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,7 @@
iconProps={{ value: taskType }}
size={'large'}
kind={'secondary'}
dataId={'btnSelectIcon'}
disabled={readonly}
on:click={selectIcon}
/>
Expand Down
14 changes: 10 additions & 4 deletions plugins/tracker-resources/src/components/CreateIssue.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -741,6 +741,7 @@
onCancel={showConfirmationDialog}
hideAttachments={attachments.size === 0}
hideSubheader={parentIssue == null}
headerNoPadding
noFade={true}
on:changeContent
>
Expand Down Expand Up @@ -778,11 +779,16 @@
<DocCreateExtComponent manager={docCreateManager} kind={'header'} space={currentProject} props={extraProps} />
</svelte:fragment>
<svelte:fragment slot="title" let:label>
<div class="flex-row-center gap-2">
<div>
<div class="flex-row-center gap-2 pt-1 pb-1 pr-1">
<span class="overflow-label">
<Label {label} />
</div>
<TaskKindSelector projectType={currentProject?.type} bind:value={kind} baseClass={tracker.class.Issue} />
</span>
<TaskKindSelector
projectType={currentProject?.type}
bind:value={kind}
baseClass={tracker.class.Issue}
size={'small'}
/>
{#if relatedTo}
<div class="lower mr-2">
<Label label={tracker.string.RelatedTo} />
Expand Down
2 changes: 2 additions & 0 deletions plugins/view-resources/src/components/ColorsPopup.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
class:disabled
class:selected={selected === color.name}
style="background-color: {col}"
data-id={color.name}
on:click={() => {
if (disabled) return
dispatch('close', i)
Expand All @@ -59,6 +60,7 @@
class:disabled
class:selected={selected === color.name}
style="background-color: {col}"
data-id={color.name}
on:click={() => {
if (disabled) return
dispatch('close', i)
Expand Down
1 change: 1 addition & 0 deletions tests/sanity/tests/contacts.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@ test.describe('contact tests', () => {
await contractPage.checkIfPersonIsDeleted(first, last, 1)
await contractPage.personRightClickOption(first, last, ButtonAction.NewApplication)
await contractPage.addNewApplication('Test Application', 'CR Chen Rosamund')
await page.waitForTimeout(1000)
await contractPage.clickOnEmployee(first, last)
await contractPage.checkStateApplication('HR Interview')
})
Expand Down
5 changes: 5 additions & 0 deletions tests/sanity/tests/model/contacts/contract-page.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ export class ContractPage {
readonly stateApplication = (role: string): Locator => this.page.getByRole('cell', { name: role })
readonly commentApplication = (): Locator => this.page.getByRole('button', { name: '1', exact: true })
readonly commentDescription = (): Locator => this.page.getByText('Test Application')
readonly buttonClosePanel = (): Locator => this.page.locator('button#btnPClose')

// ACTIONS

Expand Down Expand Up @@ -249,4 +250,8 @@ export class ContractPage {
await this.commentApplication().hover()
await expect(this.commentDescription()).toBeVisible()
}

async closePanel (): Promise<void> {
await this.buttonClosePanel().click()
}
}
131 changes: 131 additions & 0 deletions tests/sanity/tests/model/settings-page.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,131 @@
import { expect, type Locator } from '@playwright/test'
import { CommonPage } from './common-page'
import { SpaceTypes, TaskTypes } from './types'

export class SettingsPage extends CommonPage {
profileButton = (): Locator => this.page.locator('#profile-button')
settingsButton = (): Locator => this.page.locator('button:has-text("Settings")')
spaceTypesHeader = (): Locator => this.page.locator('button.hulyNavGroup-header', { hasText: 'Space types' })
newSpaceTypeButton = (): Locator => this.page.locator('#new-space-type')
popupSelectSpaceTypeButton = (): Locator =>
this.page.locator('form#setting\\:string\\:NewSpaceType div#selectSpaceType button')

popupSpaceTypeNameInput = (): Locator =>
this.page.locator('form#setting\\:string\\:NewSpaceType').getByPlaceholder('Space type', { exact: true })

popupCreateButton = (): Locator =>
this.page.locator('form#setting\\:string\\:NewSpaceType div.antiCard-footer button', { hasText: 'Create' })

spaceTypeButton = (name: string, category?: string): Locator =>
this.page.locator('div#navGroup-spaceTypes button.hulyTaskNavLink-container', {
hasText: category !== undefined ? `${name} ${category}` : name
})

breadcrumbButton = (hasText: string): Locator => this.page.locator('button.hulyBreadcrumb-container', { hasText })
stateButton = (name: string): Locator =>
this.page
.locator('div.hulyTableAttr-header', { hasText: 'Process states' })
.locator('xpath=..')
.locator('button.hulyTableAttr-content__row', { hasText: name })

statusNameInput = (): Locator =>
this.page.locator('div.hulyModal-container.type-aside', { hasText: 'Edit state' }).getByPlaceholder('Status name')

selectColorButton = (name: string): Locator =>
this.page.locator('div.hulyTableAttr-container', { hasText: 'Color' }).locator(`div.color[data-id="${name}"]`)

selectIconButton = (): Locator => this.page.locator('button[data-id="btnSelectIcon"]')
emojiSectionButton = (): Locator => this.page.locator('div.popup div.tab', { hasText: 'Emoji' })
emojiIconButton = (hasText: string): Locator => this.page.locator('div.popup div.element', { hasText })
taskTypeRow = (value: string): Locator =>
this.page
.locator('div.hulyTableAttr-header', { hasText: 'Task types' })
.locator('xpath=..')
.locator('div.hulyTableAttr-content button.hulyTableAttr-content__row', { hasText: value })

addTaskTypeButton = (): Locator =>
this.page.locator('div.hulyTableAttr-header', { hasText: 'Task types' }).locator('button[data-id="btnAdd"]')

taskNameInput = (): Locator => this.page.getByPlaceholder('Task name *')
taskTypeButton = (): Locator =>
this.page.locator('div.hulyModal-content__settingsSet-line', { hasText: 'Task type' }).locator('button')

asideFooterButton = (hasText: string): Locator =>
this.page.locator('div.hulyModal-container.type-aside div.hulyModal-footer button', { hasText })

async navigateToWorkspace (workspaceUrl: string): Promise<void> {
const response = await this.page.goto(workspaceUrl)
if (response === null || response === undefined) {
throw new Error(`Failed to navigate to ${workspaceUrl}`)
}
await response.finished()
}

async openProfileMenu (): Promise<void> {
await this.profileButton().click()
}

async openSettings (): Promise<void> {
await this.settingsButton().click()
}

async clickAddSpaceType (): Promise<void> {
await this.newSpaceTypeButton().click()
}

async createSpaceType (name: string, spaceType?: SpaceTypes): Promise<void> {
await this.spaceTypesHeader().hover()
await this.newSpaceTypeButton().click()
if (spaceType !== undefined) {
await this.popupSelectSpaceTypeButton().click()
await this.selectPopupMenu(spaceType).click()
}
await this.popupSpaceTypeNameInput().fill(name)
await this.popupCreateButton().click()
}

async selectSpaceType (name: string, category?: string): Promise<void> {
await this.spaceTypeButton(name, category).click()
}

async addTaskType (name: string, taskType?: TaskTypes): Promise<void> {
await this.addTaskTypeButton().click()
await this.taskNameInput().fill(name)
if (taskType !== undefined) {
await this.taskTypeButton().click()
await this.selectPopupItem(taskType)
}
await this.asideFooterButton('Create').click()
}

async checkTaskType (name: string, taskType?: TaskTypes): Promise<void> {
await expect(this.taskTypeRow(`${name} ${taskType ?? TaskTypes.Task}`)).toBeVisible()
}

async openTaskType (name: string, taskType?: TaskTypes): Promise<void> {
await this.taskTypeRow(`${name} ${taskType ?? TaskTypes.Task}`).click()
}

async checkOpened (breadcrumbOne: string, breadcrumbTwo?: string): Promise<void> {
if (breadcrumbTwo !== undefined) await expect(this.breadcrumbButton(breadcrumbTwo)).toBeVisible()
await expect(this.breadcrumbButton(breadcrumbOne)).toBeVisible()
}

async checkState (name: string): Promise<void> {
await expect(this.stateButton(name)).toBeVisible()
}

async changeState (name: string, newName: string, color?: string): Promise<void> {
await this.stateButton(name).click()
expect(await this.statusNameInput().inputValue()).toContain(name)
await this.statusNameInput().fill(newName)
if (color !== undefined) await this.selectColorButton(color).click()
await this.asideFooterButton('Save').click()
}

async changeIcon (): Promise<void> {
await this.selectIconButton().click()
await this.emojiSectionButton().click()
await this.emojiIconButton('❗').click()
}
}
4 changes: 2 additions & 2 deletions tests/sanity/tests/model/tracker/issues-page.ts
Original file line number Diff line number Diff line change
Expand Up @@ -170,10 +170,10 @@ export class IssuesPage extends CommonTrackerPage {
await this.page.keyboard.press('Escape')
}

async createAndOpenIssue (name: string, assignee: string, status: string): Promise<void> {
async createAndOpenIssue (name: string, assignee: string, status: string, taskType?: string): Promise<void> {
try {
await this.notificationTimeoutSetting('5000')
await createIssue(this.page, { name, assignee, status })
await createIssue(this.page, { name, assignee, status, taskType })
await this.page.waitForSelector(`text="${name}"`)
await this.viewIssueButton().click()
} finally {
Expand Down
20 changes: 18 additions & 2 deletions tests/sanity/tests/model/tracker/templates-page.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,14 @@ export class TemplatePage extends CommonTrackerPage {
proseMirrorEditor = (): Locator => this.page.locator('.ProseMirror')
saveTemplateButton = (): Locator => this.page.locator('text=Save template')
editTemplateButton = (): Locator => this.page.locator('text=Edit template')
vacanciesLink = (): Locator => this.page.locator('#new-space-type')
newSpaceTypeButton = (): Locator => this.page.locator('#new-space-type')
spaceTypeButton = (name: string, category?: string): Locator =>
this.page.locator('div#navGroup-spaceTypes button.hulyTaskNavLink-container', {
hasText: category !== undefined ? `${name} ${category}` : name
})

addTaskTypeButton = (): Locator =>
this.page.locator('div.hulyTableAttr-header', { hasText: 'Task types' }).locator('button[data-id="btnAdd"]')

async createNewTemplate (data: NewIssue): Promise<void> {
await this.buttonNewTemplate().click()
Expand Down Expand Up @@ -114,7 +121,16 @@ export class TemplatePage extends CommonTrackerPage {
}

async selectVacancies (): Promise<void> {
await this.vacanciesLink().click()
await this.newSpaceTypeButton().click()
}

async selectSpaceType (name: string, category?: string): Promise<void> {
await this.spaceTypeButton(name, category).click()
}

async addTaskType (): Promise<void> {
console.log('[!!!] ', await this.page.locator('div.hulyTableAttr-header', { hasText: 'Task types' }).isVisible())
await this.addTaskTypeButton().click()
}

async createTemplate (templateName: string, templateContent: string): Promise<void> {
Expand Down
Loading