diff --git a/packages/kanban/src/components/Kanban.svelte b/packages/kanban/src/components/Kanban.svelte index 49ab4e8558..2a40506a48 100644 --- a/packages/kanban/src/components/Kanban.svelte +++ b/packages/kanban/src/components/Kanban.svelte @@ -246,11 +246,7 @@ height: 100%; } .card-container { - display: flex; - flex-direction: column; - padding: .5rem 1rem; background-color: var(--board-card-bg-color); - border: 1px solid var(--board-card-bg-color); border-radius: .25rem; user-select: none; @@ -261,9 +257,7 @@ cursor: grab; } &.dragged { - padding: 1rem; background-color: var(--board-bg-color); - border: unset; } } diff --git a/packages/presentation/lang/en.json b/packages/presentation/lang/en.json index f5759d80f5..4454b56c7a 100644 --- a/packages/presentation/lang/en.json +++ b/packages/presentation/lang/en.json @@ -13,6 +13,7 @@ "Remove": "Remove", "Members": "Members", "Search": "Search...", - "Unassigned": "Unassigned" + "Unassigned": "Unassigned", + "CreateMore": "Create more" } } diff --git a/packages/presentation/lang/ru.json b/packages/presentation/lang/ru.json index 5282157e1f..f9dc485814 100644 --- a/packages/presentation/lang/ru.json +++ b/packages/presentation/lang/ru.json @@ -13,6 +13,7 @@ "Remove": "Удалить", "Members": "Участники", "Search": "Поиск...", - "Unassigned": "Не назначен" + "Unassigned": "Не назначен", + "CreateMore": "Создать еще" } } diff --git a/packages/presentation/src/components/Card.svelte b/packages/presentation/src/components/Card.svelte index e1fd6bb441..a1ad2c5c4e 100644 --- a/packages/presentation/src/components/Card.svelte +++ b/packages/presentation/src/components/Card.svelte @@ -20,7 +20,7 @@ import { createEventDispatcher } from 'svelte' import type { Ref, Class, Space, DocumentQuery } from '@anticrm/core' - import { Button, Label } from '@anticrm/ui' + import { Button, Label, IconClose, MiniToggle } from '@anticrm/ui' import SpaceSelect from './SpaceSelect.svelte' import presentation from '..' @@ -34,31 +34,50 @@ export let okAction: () => void export let canSave: boolean = false export let size: 'small'| 'medium' = 'small' - + export let createMore: boolean | undefined = undefined export let okLabel: IntlString = presentation.string.Create export let cancelLabel: IntlString = presentation.string.Cancel const dispatch = createEventDispatcher() -
{} }> + {} }>
-
- {#if $$slots.error} -
- -
- {/if} +
+ {#if spaceClass && spaceLabel && spacePlaceholder} + {#if $$slots.space} + + {:else} + + {/if} + + {/if} + +
+
+
- {#if spaceClass && spaceLabel && spacePlaceholder} + {#if (spaceClass && spaceLabel && spacePlaceholder) || $$slots.pool}
-
- +
{/if} - +
+ + {#if $$slots.error} + + {/if} +
diff --git a/packages/presentation/src/components/SpaceSelect.svelte b/packages/presentation/src/components/SpaceSelect.svelte index 2e4834ca85..3c25ee67dc 100644 --- a/packages/presentation/src/components/SpaceSelect.svelte +++ b/packages/presentation/src/components/SpaceSelect.svelte @@ -17,7 +17,7 @@ import type { IntlString } from '@anticrm/platform' import { getClient } from '../utils' - import { Label, showPopup, IconFolder } from '@anticrm/ui' + import { Label, showPopup, IconFolder, Button } from '@anticrm/ui' import SpacesPopup from './SpacesPopup.svelte' import type { Ref, Class, Space, DocumentQuery } from '@anticrm/core' @@ -27,10 +27,8 @@ export let label: IntlString export let placeholder: IntlString export let value: Ref | undefined - export let show: boolean = false let selected: Space | undefined - let btn: HTMLElement const client = getClient() @@ -39,43 +37,21 @@ } $: updateSelected(value) - - onMount(() => { - if (btn && show) { - btn.click() - show = false - } - }) -
{ - showPopup(SpacesPopup, { _class, spaceQuery }, btn, (result) => { +
- - + + {#if selected}{selected.name}{:else} + diff --git a/packages/presentation/src/index.ts b/packages/presentation/src/index.ts index d0aff88cd8..fc31f5d333 100644 --- a/packages/presentation/src/index.ts +++ b/packages/presentation/src/index.ts @@ -32,6 +32,7 @@ export { default as SpaceSelect } from './components/SpaceSelect.svelte' export { default as UserBox } from './components/UserBox.svelte' export { default as UserBoxList } from './components/UserBoxList.svelte' export { default as UserInfo } from './components/UserInfo.svelte' +export { default as UsersPopup } from './components/UsersPopup.svelte' export { connect, versionError } from './connect' export { default } from './plugin' export * from './types' diff --git a/packages/presentation/src/plugin.ts b/packages/presentation/src/plugin.ts index 9aa2fcc506..bff0f11e1a 100644 --- a/packages/presentation/src/plugin.ts +++ b/packages/presentation/src/plugin.ts @@ -42,7 +42,8 @@ export default plugin(presentationId, { Remove: '' as IntlString, Members: '' as IntlString, Search: '' as IntlString, - Unassigned: '' as IntlString + Unassigned: '' as IntlString, + CreateMore: '' as IntlString }, metadata: { RequiredVersion: '' as Metadata diff --git a/packages/theme/styles/_layouts.scss b/packages/theme/styles/_layouts.scss index e13120e4d2..4d96da5c59 100644 --- a/packages/theme/styles/_layouts.scss +++ b/packages/theme/styles/_layouts.scss @@ -244,8 +244,7 @@ p:last-child { margin-block-end: 0; } } .gap-1, .gap-1-5, .gap-2 { - & > * { margin-right: .25rem; } - & > *:last-child { margin-right: 0; } + & > *:not(:last-child) { margin-right: .25rem; } &.reverse { flex-direction: row-reverse; & > :last-child { margin-right: .25rem; } @@ -293,6 +292,8 @@ p:last-child { margin-block-end: 0; } .ml-6 { margin-left: 1.5rem; } .ml-8 { margin-left: 2rem; } .ml-10 { margin-left: 2.5rem; } +.ml-12 { margin-left: 3rem; } +.ml-22 { margin-left: 5.5rem; } .mr-1 { margin-right: .25rem; } .mr-2 { margin-right: .5rem; } .mr-3 { margin-right: .75rem; } @@ -300,6 +301,7 @@ p:last-child { margin-block-end: 0; } .mr-6 { margin-right: 1.5rem; } .mr-8 { margin-right: 2rem; } .mr-10 { margin-right: 2.5rem; } +.mt-0-5 { margin-top: .125rem; } .mt-1 { margin-top: .25rem; } .mt-2 { margin-top: .5rem; } .mt-3 { margin-top: .75rem; } @@ -317,10 +319,18 @@ p:last-child { margin-block-end: 0; } .mx-1 { margin: 0 .25rem; } .mx-2 { margin: 0 .5rem; } .mx-3 { margin: 0 .75rem; } +.my-4 { margin: 1rem 0; } +.pl-2 { padding-left: .5rem; } +.pl-4 { padding-left: 1rem; } .pr-1 { padding-right: .25rem; } +.pr-2 { padding-right: .5rem; } .pr-4 { padding-right: 1rem; } .pr-24 { padding-right: 6rem; } +.pt-2 { padding-top: .5rem; } +.pt-4 { padding-top: 1rem; } +.pb-2 { padding-bottom: .5rem; } +.pb-4 { padding-bottom: 1rem; } .p-2 { padding: .5rem; } .p-3 { padding: .75rem; } @@ -377,6 +387,7 @@ p:last-child { margin-block-end: 0; } .min-w-4 { min-width: 1rem; } .min-w-9 { min-width: 2.25rem; } .min-h-0 { min-height: 0; } +.min-w-min { min-width: min-content; } .clear-mins { min-width: 0; min-height: 0; @@ -540,13 +551,14 @@ a.no-line { .background-bg-accent { background-color: var(--theme-bg-accent-color); } .background-bg-accent-normal { background-color: var(--theme-bg-accent-normal); } -.content-color { color: var(--theme-content-color); } +.content-color { color: var(--content-color); } .content-trans-color { color: var(--theme-content-trans-color); } -.content-accent-color { color: var(--theme-content-accent-color); } +.content-accent-color { color: var(--accent-color); } .content-dark-color { color: var(--theme-content-dark-color); } -.caption-color { color: var(--theme-caption-color); } +.caption-color { color: var(--caption-color); } .red-color { color: var(--highlight-red); } +.error-color { color: var(--error-color); } .border-radius-4 { border-radius: 1rem; } .border-radius-3 { border-radius: 0.75rem; } diff --git a/packages/theme/styles/dialogs.scss b/packages/theme/styles/dialogs.scss index 64c19874de..9d2bd1e61b 100644 --- a/packages/theme/styles/dialogs.scss +++ b/packages/theme/styles/dialogs.scss @@ -111,10 +111,14 @@ } .antiCard-content { + display: flex; + flex-direction: column; flex-shrink: 0; flex-grow: 1; margin: 0 1rem; height: fit-content; + + & > *:not(:last-child) { margin-bottom: 1rem; } } .antiCard-pool { @@ -157,20 +161,25 @@ display: flex; align-items: center; min-width: 0; + + & > *:not(:first-child) { margin-left: .375rem; } } &__divider, &__title { - margin-left: .375rem; font-weight: 400; font-size: .8125rem; } &__divider { color: var(--content-color); } &__title { color: var(--accent-color); } } - .antiCard-content { margin: 0 1.125rem; } + .antiCard-content { margin: .5rem 1.125rem 1rem; } .antiCard-pool { flex-direction: row; - margin: .375rem .75rem .75rem; + align-items: center; + margin: 0 .75rem .75rem; + font-size: .75rem; + + & > *:not(:last-child) { margin-right: .375rem; } } .antiCard-footer { direction: ltr; @@ -182,6 +191,16 @@ border-top: 1px solid var(--button-bg-color); &.reverse { flex-direction: row-reverse; } + &__error { + flex-grow: 1; + display: flex; + margin-left: .375rem; + min-width: 0; + font-weight: 500; + font-size: .75rem; + color: var(--system-error-color); + &:empty { visibility: hidden; } + } } } } diff --git a/packages/theme/styles/global.scss b/packages/theme/styles/global.scss index 37e345e846..d2449cdb9d 100644 --- a/packages/theme/styles/global.scss +++ b/packages/theme/styles/global.scss @@ -64,6 +64,7 @@ scrollbar-color: var(--theme-menu-color) var(--theme-bg-color); scrollbar-width: thin; --font-family: 'IBM Plex Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto; + --timing-shadow: cubic-bezier(0,.65,.35,1); } ::-webkit-scrollbar { diff --git a/packages/theme/styles/popups.scss b/packages/theme/styles/popups.scss index 1bb2388b6c..12ab51b071 100644 --- a/packages/theme/styles/popups.scss +++ b/packages/theme/styles/popups.scss @@ -70,6 +70,13 @@ width: 1rem; height: 1rem; } + .color { + margin-right: .75rem; + width: .875rem; + height: .875rem; + border: 1px solid rgba(0, 0, 0, .1); + border-radius: .25rem; + } .label { flex-grow: 1; min-width: 0; diff --git a/packages/ui/src/components/Button.svelte b/packages/ui/src/components/Button.svelte index 86ac61d2fb..23ccdda2a0 100644 --- a/packages/ui/src/components/Button.svelte +++ b/packages/ui/src/components/Button.svelte @@ -22,8 +22,9 @@ export let label: IntlString | undefined = undefined export let labelParams: Record = {} - export let kind: 'primary' | 'secondary' | 'no-border' | 'transparent' | 'link' | 'dangerous' = 'secondary' + export let kind: 'primary' | 'secondary' | 'no-border' | 'transparent' | 'link' | 'link-bordered' | 'dangerous' = 'secondary' export let size: 'small' | 'medium' | 'large' | 'x-large' = 'medium' + export let shape: 'circle' | undefined = undefined export let icon: Asset | AnySvelteComponent | undefined = undefined export let justify: 'left' | 'center' = 'center' export let disabled: boolean = false @@ -31,7 +32,7 @@ export let width: string | undefined = undefined export let resetIconSize: boolean = false export let focus: boolean = false - export let isCircle: boolean = false + export let title: string | undefined = undefined export let input: HTMLButtonElement | undefined = undefined @@ -49,14 +50,16 @@ bind:this={input} class="button {kind} {size} jf-{justify}" class:only-icon={iconOnly} - class:border-radius-1={!isCircle} - class:border-radius-4={isCircle} + class:border-radius-1={shape !== 'circle'} + class:border-radius-4={shape === 'circle'} disabled={disabled || loading} style={width ? 'width: ' + width : ''} + {title} + type={kind === 'primary' ? 'submit' : 'button'} on:click > {#if icon && !loading} -
{:else} - {#if label} -
{#if !thread}
- {#if message.replies} await client.removeDoc(message._class, message.space, message._id) + } + const showMenu = async (ev: Event): Promise => { const actions = await getActions(client, message, chunter.class.ThreadMessage) actions.push(subscribeAction) @@ -67,7 +72,8 @@ const impl = await getResource(a.action) await impl(message) } - })) + })), + ...(getCurrentAccount()._id === message.createBy ? [deleteAction] : []) ] }, ev.target as HTMLElement diff --git a/plugins/chunter-resources/src/plugin.ts b/plugins/chunter-resources/src/plugin.ts index e08dbcf25e..cba353810e 100644 --- a/plugins/chunter-resources/src/plugin.ts +++ b/plugins/chunter-resources/src/plugin.ts @@ -50,6 +50,7 @@ export default mergeIds(chunterId, chunter, { LastReply: '' as IntlString, New: '' as IntlString, GetNewReplies: '' as IntlString, - TurnOffReplies: '' as IntlString + TurnOffReplies: '' as IntlString, + DeleteMessage: '' as IntlString } }) diff --git a/plugins/contact-assets/assets/icons.svg b/plugins/contact-assets/assets/icons.svg index bf2aa11770..3b90b11f4e 100644 --- a/plugins/contact-assets/assets/icons.svg +++ b/plugins/contact-assets/assets/icons.svg @@ -51,4 +51,8 @@ + + + + diff --git a/plugins/contact-assets/src/index.ts b/plugins/contact-assets/src/index.ts index b8b5e791fe..9f7a59e0fd 100644 --- a/plugins/contact-assets/src/index.ts +++ b/plugins/contact-assets/src/index.ts @@ -32,6 +32,7 @@ loadMetadata(contact.icon, { GitHub: `${icons}#github`, Edit: `${icons}#edit`, Person: `${icons}#person`, - Company: `${icons}#company` + Company: `${icons}#company`, + SocialEdit: `${icons}#social-edit` }) addStringsLoader(contactId, async (lang: string) => await import(`../lang/${lang}.json`)) diff --git a/plugins/contact-resources/src/components/Channels.svelte b/plugins/contact-resources/src/components/Channels.svelte index 9107a05a3f..3189bb8f8b 100644 --- a/plugins/contact-resources/src/components/Channels.svelte +++ b/plugins/contact-resources/src/components/Channels.svelte @@ -45,18 +45,20 @@
{:else} - -
- - showPopup(contact.component.SocialEditor, { values: channels }, ev.target, (result) => { - if (result !== undefined) { - dispatch('change', result) - } - })} - /> +
+ +
+ + showPopup(contact.component.SocialEditor, { values: channels }, ev.target, (result) => { + if (result !== undefined) { + dispatch('change', result) + } + })} + /> +
{/if} diff --git a/plugins/contact-resources/src/components/ChannelsView.svelte b/plugins/contact-resources/src/components/ChannelsView.svelte index 8a606e7760..0c50cd93c4 100644 --- a/plugins/contact-resources/src/components/ChannelsView.svelte +++ b/plugins/contact-resources/src/components/ChannelsView.svelte @@ -124,6 +124,8 @@ diff --git a/plugins/contact-resources/src/components/CreatePerson.svelte b/plugins/contact-resources/src/components/CreatePerson.svelte index 723b5371c7..f73f38b45f 100644 --- a/plugins/contact-resources/src/components/CreatePerson.svelte +++ b/plugins/contact-resources/src/components/CreatePerson.svelte @@ -21,11 +21,11 @@ import { getClient, Card, EditableAvatar } from '@anticrm/presentation' import attachment from '@anticrm/attachment' - import { EditBox, IconInfo, Label } from '@anticrm/ui' + import { EditBox, IconInfo, Label, Button, showPopup } from '@anticrm/ui' import { Channel, combineName, findPerson, Person } from '@anticrm/contact' import contact from '../plugin' - import Channels from './Channels.svelte' + import ChannelsView from './ChannelsView.svelte' import PersonPresenter from './PersonPresenter.svelte' let firstName = '' @@ -93,58 +93,41 @@ dispatch('close') }} > - {#if matches.length > 0} -
-
+ + {#if matches.length > 0} +
-
+
+ +
- -
- {/if} + {/if} +
-
- -
-
- -
-
- + + +
+
- -
- { - channels = e.detail - }} + {#if channels.length > 0} +
+ {/if} + +
+ - - diff --git a/plugins/contact/src/index.ts b/plugins/contact/src/index.ts index db14ace64b..12bedcbe04 100644 --- a/plugins/contact/src/index.ts +++ b/plugins/contact/src/index.ts @@ -170,7 +170,8 @@ const contactPlugin = plugin(contactId, { GitHub: '' as Asset, Edit: '' as Asset, Person: '' as Asset, - Company: '' as Asset + Company: '' as Asset, + SocialEdit: '' as Asset }, space: { Employee: '' as Ref, diff --git a/plugins/lead-resources/src/components/KanbanCard.svelte b/plugins/lead-resources/src/components/KanbanCard.svelte index d52a403d7c..1e74d3b043 100644 --- a/plugins/lead-resources/src/components/KanbanCard.svelte +++ b/plugins/lead-resources/src/components/KanbanCard.svelte @@ -28,43 +28,49 @@ export let object: WithLookup export let dragged: boolean - function showMenu(ev?: Event): void { + function showMenu (ev?: Event): void { showPopup(ContextMenu, { object }, (ev as MouseEvent).target as HTMLElement) } - function showLead() { + function showLead () { showPanel(view.component.EditDoc, object._id, object._class, 'full') } -
-
-
{object.title}
-
-
-
- +
+
+
+
{object.title}
+
+
+
+ +
+ { + showMenu(evt) + }} + icon={IconMoreH} + size={'small'} + /> +
+
+
+ {#if object.$lookup?.attachedTo} + + {/if} +
+ {#if (object.attachments ?? 0) > 0} +
+ +
+ {/if} + {#if (object.comments ?? 0) > 0} +
+ +
+ {/if}
- { - showMenu(evt) - }} - icon={IconMoreH} - size={'small'} - /> -
-
-
- {#if object.$lookup?.attachedTo} - - {/if} -
- {#if (object.attachments ?? 0) > 0} -
- {/if} - {#if (object.comments ?? 0) > 0} -
- {/if}
diff --git a/plugins/recruit-assets/lang/ru.json b/plugins/recruit-assets/lang/ru.json index 6f536a807b..d4e78fde32 100644 --- a/plugins/recruit-assets/lang/ru.json +++ b/plugins/recruit-assets/lang/ru.json @@ -75,7 +75,7 @@ "OpinionShortLabel": "OPE", "ReviewShortLabel": "RVE", "StartDate": "Дата начала", - "DueDate": "Дата конца", + "DueDate": "Дата окончания", "ReviewCategoryTitle":"Категория", "Verdict": "Вердикт", "OpinionSave": "Сохранить", diff --git a/plugins/recruit-resources/src/components/Applications.svelte b/plugins/recruit-resources/src/components/Applications.svelte index 0b5cef1b7a..5ec877f788 100644 --- a/plugins/recruit-resources/src/components/Applications.svelte +++ b/plugins/recruit-resources/src/components/Applications.svelte @@ -24,8 +24,8 @@ import FileDuo from './icons/FileDuo.svelte' import chunter from '@anticrm/chunter' import attachment from '@anticrm/attachment' -import { Applicant } from '@anticrm/recruit' -import { BuildModelKey } from '@anticrm/view' + import { Applicant } from '@anticrm/recruit' + import { BuildModelKey } from '@anticrm/view' export let objectId: Ref // export let space: Ref diff --git a/plugins/recruit-resources/src/components/ApplicationsView.svelte b/plugins/recruit-resources/src/components/ApplicationsView.svelte index adbc7019c4..5c8339aec4 100644 --- a/plugins/recruit-resources/src/components/ApplicationsView.svelte +++ b/plugins/recruit-resources/src/components/ApplicationsView.svelte @@ -60,7 +60,7 @@ } function showCreateDialog (ev: Event) { - showPopup(CreateApplication, { }, ev.target as HTMLElement) + showPopup(CreateApplication, { }, 'top') } function updateResultQuery (search: string): void { diff --git a/plugins/recruit-resources/src/components/CandidateCard.svelte b/plugins/recruit-resources/src/components/CandidateCard.svelte index f1a252a018..6760ab1e20 100644 --- a/plugins/recruit-resources/src/components/CandidateCard.svelte +++ b/plugins/recruit-resources/src/components/CandidateCard.svelte @@ -25,6 +25,7 @@ import recruit from '../plugin' export let candidate: Candidate + export let disabled: boolean = false let channels: Channel[] = [] const channelsQuery = createQuery() @@ -43,8 +44,8 @@
{#if candidate} -
{ - showPanel(view.component.EditDoc, candidate._id, candidate._class, 'full') +
{ + if (!disabled) showPanel(view.component.EditDoc, candidate._id, candidate._class, 'full') }}>{formatName(candidate.name)}
{candidate.title ?? ''}
{candidate.city ?? ''}
@@ -64,15 +65,16 @@ .card-container { padding: 1rem 1.5rem 1.25rem; background-color: var(--board-card-bg-color); - border: 1px solid var(--board-card-bg-color); + border: 1px solid var(--divider-color); border-radius: .5rem; - transition-property: box-shadow, background-color; - transition-timing-function: ease-in-out; + transition-property: box-shadow, background-color, border-color; + transition-timing-function: var(--timing-shadow); transition-duration: .15s; &:hover { background-color: var(--board-card-bg-hover); - box-shadow: var(--popup-shadow); + border-color: var(--button-border-color); + box-shadow: rgb(0 0 0 / 15%) 0px 4px 8px; } .label { diff --git a/plugins/recruit-resources/src/components/Candidates.svelte b/plugins/recruit-resources/src/components/Candidates.svelte index c0f921ed63..4112638f26 100644 --- a/plugins/recruit-resources/src/components/Candidates.svelte +++ b/plugins/recruit-resources/src/components/Candidates.svelte @@ -32,7 +32,7 @@ const tableDescriptor = client.findOne(view.class.Viewlet, { attachTo: recruit.mixin.Candidate, descriptor: view.viewlet.Table }) function showCreateDialog (ev: Event) { - showPopup(CreateCandidate, { space: recruit.space.CandidatesPublic }, ev.target as HTMLElement) + showPopup(CreateCandidate, { space: recruit.space.CandidatesPublic }, 'top') } let category: Ref | undefined = undefined diff --git a/plugins/recruit-resources/src/components/CreateApplication.svelte b/plugins/recruit-resources/src/components/CreateApplication.svelte index bab26b15f3..6e395a8489 100644 --- a/plugins/recruit-resources/src/components/CreateApplication.svelte +++ b/plugins/recruit-resources/src/components/CreateApplication.svelte @@ -17,13 +17,16 @@ import contact from '@anticrm/contact' import { Account, Class, Client, Doc, generateId, Ref, SortingOrder } from '@anticrm/core' import { getResource, OK, Resource, Severity, Status } from '@anticrm/platform' - import { Card, getClient, UserBox } from '@anticrm/presentation' - import type { Applicant, Candidate } from '@anticrm/recruit' + import { Card, getClient, UserBox, createQuery, AttributeEditor } from '@anticrm/presentation' + import type { Applicant, Candidate, Vacancy } from '@anticrm/recruit' import task, { calcRank, SpaceWithStates, State } from '@anticrm/task' - import { Grid, Status as StatusControl } from '@anticrm/ui' + import ui, { Status as StatusControl, Label, Button, ColorPopup, showPopup, getPlatformColor } from '@anticrm/ui' import view from '@anticrm/view' import { createEventDispatcher } from 'svelte' import recruit from '../plugin' + import CandidateCard from './CandidateCard.svelte' + import VacancyCard from './VacancyCard.svelte' + import ExpandRightDouble from './icons/ExpandRightDouble.svelte' export let space: Ref export let candidate: Ref @@ -58,7 +61,7 @@ } async function createApplication () { - const state = await client.findOne(task.class.State, { space: doc.space }) + const state = await client.findOne(task.class.State, { space: doc.space, _id: selectedState._id }) if (state === undefined) { throw new Error(`create application: state not found space:${doc.space}`) } @@ -115,6 +118,35 @@ } $: validate(doc, doc._class) + + let selectedVacancy: Vacancy + let selectedCandidate: Person + const vacancyQuery = createQuery() + $: if (doc.space !== undefined) { + vacancyQuery.query(recruit.class.Vacancy, { _id: doc.space }, (result) => { + selectedVacancy = result[0] + }) + } + const candidateQuery = createQuery() + $: if (doc.attachedTo !== undefined) { + candidateQuery.query(contact.class.Person, { _id: doc.attachedTo as Ref }, (result) => { + selectedCandidate = result[0] + }) + } + let states: Array<{id: number | string, color: number, label: string}> = [] + let selectedState: State + const statesQuery = createQuery() + $: if (doc.space !== undefined) { + statesQuery.query( + task.class.State, + { space: doc.space }, + (res) => { + states = res.map(s => { return { id: s._id, label: s.title, color: s.color} }) + selectedState = res.filter(s => s._id === doc.state)[0] ?? res[0] + }, + { sort: { rank: SortingOrder.Ascending } } + ) + } { dispatch('close') }} > - + + {#if !preserveCandidate} {/if} - + {#if states && doc.space} + + {/if} + + + diff --git a/plugins/recruit-resources/src/components/CreateCandidate.svelte b/plugins/recruit-resources/src/components/CreateCandidate.svelte index dc6cc890cb..993eb6a7a6 100644 --- a/plugins/recruit-resources/src/components/CreateCandidate.svelte +++ b/plugins/recruit-resources/src/components/CreateCandidate.svelte @@ -15,7 +15,7 @@ - { dispatch('close') }} > - - +
+
+
+ +
+ - { templateId = evt.detail }}/> -
-
+ + diff --git a/plugins/recruit-resources/src/components/EditApplication.svelte b/plugins/recruit-resources/src/components/EditApplication.svelte index 9c5a67815b..c289fab25d 100644 --- a/plugins/recruit-resources/src/components/EditApplication.svelte +++ b/plugins/recruit-resources/src/components/EditApplication.svelte @@ -64,7 +64,8 @@ diff --git a/plugins/recruit-resources/src/components/KanbanCard.svelte b/plugins/recruit-resources/src/components/KanbanCard.svelte index 8ec6cb2155..9319644864 100644 --- a/plugins/recruit-resources/src/components/KanbanCard.svelte +++ b/plugins/recruit-resources/src/components/KanbanCard.svelte @@ -36,43 +36,47 @@ $: doneTasks = todoItems.filter((it) => it.done) -
-
- -
-
- {formatName(object.$lookup?.attachedTo?.name ?? '')} +
+
+
+ +
+
+ {formatName(object.$lookup?.attachedTo?.name ?? '')} +
+
{object.$lookup?.attachedTo?.title ?? ''}
-
{object.$lookup?.attachedTo?.title ?? ''}
-
-
- {#if !dragged} -
- -
- - {/if} -
-
-
-
-
- - {#if todoItems.length > 0} - -
- ( {doneTasks?.length}/ {todoItems.length} ) -
-
+
+ {#if !dragged} +
+ +
+ {/if}
- {#if (object.attachments ?? 0) > 0} -
- {/if} - {#if (object.comments ?? 0) > 0} -
- {/if}
- +
+
+
+ + {#if todoItems.length > 0} + +
( {doneTasks?.length}/ {todoItems.length} )
+
+ {/if} +
+ {#if (object.attachments ?? 0) > 0} +
+ +
+ {/if} + {#if (object.comments ?? 0) > 0} +
+ +
+ {/if} +
+ +
diff --git a/plugins/recruit-resources/src/components/Vacancies.svelte b/plugins/recruit-resources/src/components/Vacancies.svelte index e862ea2d5f..0115f19b42 100644 --- a/plugins/recruit-resources/src/components/Vacancies.svelte +++ b/plugins/recruit-resources/src/components/Vacancies.svelte @@ -94,7 +94,7 @@ } function showCreateDialog (ev: Event) { - showPopup(CreateVacancy, { space: recruit.space.CandidatesPublic }, ev.target as HTMLElement) + showPopup(CreateVacancy, { space: recruit.space.CandidatesPublic }, 'top') } const applicationSorting = (a:Doc, b:Doc) => ((applications?.get(b._id as Ref)?.count ?? 0) - (applications?.get(a._id as Ref)?.count ?? 0)) ?? 0 const modifiedSorting = (a:Doc, b:Doc) => ((applications?.get(b._id as Ref)?.modifiedOn ?? 0) - (applications?.get(a._id as Ref)?.modifiedOn ?? 0)) ?? 0 diff --git a/plugins/recruit-resources/src/components/VacancyCard.svelte b/plugins/recruit-resources/src/components/VacancyCard.svelte index 956ca8fc83..e15dd3819c 100644 --- a/plugins/recruit-resources/src/components/VacancyCard.svelte +++ b/plugins/recruit-resources/src/components/VacancyCard.svelte @@ -23,6 +23,7 @@ import { Ref } from '@anticrm/core' export let vacancy: Vacancy + export let disabled: boolean = false let company: Organization | undefined $: getOrganization(vacancy?.company) @@ -43,14 +44,16 @@
{#if vacancy} -
{ - closeTooltip() - closePopup() - closePanel() - const loc = getCurrentLocation() - loc.path[2] = vacancy._id - loc.path.length = 3 - navigate(loc) +
{ + if (!disabled) { + closeTooltip() + closePopup() + closePanel() + const loc = getCurrentLocation() + loc.path[2] = vacancy._id + loc.path.length = 3 + navigate(loc) + } }}>{vacancy.name}
{#if company} {company.name} @@ -63,15 +66,16 @@ .card-container { padding: 1rem 1.5rem 1.25rem; background-color: var(--board-card-bg-color); - border: 1px solid var(--board-card-bg-color); + border: 1px solid var(--divider-color); border-radius: .5rem; - transition-property: box-shadow, background-color; - transition-timing-function: ease-in-out; + transition-property: box-shadow, background-color, border-color; + transition-timing-function: var(--timing-shadow); transition-duration: .15s; &:hover { background-color: var(--board-card-bg-hover); - box-shadow: var(--popup-shadow); + border-color: var(--button-border-color); + box-shadow: rgb(0 0 0 / 15%) 0px 4px 8px; } .logo { diff --git a/plugins/recruit-resources/src/components/YesNo.svelte b/plugins/recruit-resources/src/components/YesNo.svelte index 9dd41e1662..34689c9961 100644 --- a/plugins/recruit-resources/src/components/YesNo.svelte +++ b/plugins/recruit-resources/src/components/YesNo.svelte @@ -18,56 +18,82 @@ import { Label } from '@anticrm/ui' import recruit from '../plugin' + export let label: IntlString export let value: boolean | undefined - - function getLabel(value: boolean | undefined): IntlString { - if (value === true) return recruit.string.Yes - if (value === false) return recruit.string.No - return recruit.string.NA - } + export let disabled: boolean = false -
{ +
+ + +
+ + + {#if value === true} + + {:else if value === false} + + {:else} + + {/if} + +
+ diff --git a/plugins/recruit-resources/src/components/review/CreateReview.svelte b/plugins/recruit-resources/src/components/review/CreateReview.svelte index 61af65df04..c59c369029 100644 --- a/plugins/recruit-resources/src/components/review/CreateReview.svelte +++ b/plugins/recruit-resources/src/components/review/CreateReview.svelte @@ -22,7 +22,7 @@ import type { Candidate, Review } from '@anticrm/recruit' import task, { SpaceWithStates } from '@anticrm/task' import { StyledTextBox } from '@anticrm/text-editor' - import { DateRangePicker, Grid, Status as StatusControl, EditBox, Row } from '@anticrm/ui' + import { DateRangePicker, Grid, Status as StatusControl, EditBox, Row, DateRangePresenter } from '@anticrm/ui' import view from '@anticrm/view' import { createEventDispatcher } from 'svelte' import recruit from '../../plugin' @@ -39,8 +39,8 @@ let title: string = '' let description: string = '' - let startDate: number = Date.now() - let dueDate: number = Date.now() + let startDate: number | null = null + let dueDate: number | null = null let location: string = '' let company: Ref | undefined = undefined @@ -103,8 +103,8 @@ await client.addCollection(recruit.class.Review, doc.space, doc.attachedTo, doc.attachedToClass, 'reviews', { number: (incResult as any).object.sequence, - date: startDate ?? null, - dueDate: dueDate ?? null, + date: startDate ?? 0, + dueDate: dueDate ?? 0, description, verdict: '', title, @@ -143,7 +143,6 @@ - - - + + + { + doc.participants = [...(doc.participants ?? []), evt.detail._id] + }} + on:delete={(evt) => { + doc.participants = doc.participants?.filter((it) => it !== evt.detail._id) ?? [currentUser.employee] + }} + noItems={calendar.string.NoParticipants} + /> + + {#if !preserveCandidate} - {:else} -
{/if} - - - - - - { - doc.participants = [...(doc.participants ?? []), evt.detail._id] - }} - on:delete={(evt) => { - doc.participants = doc.participants?.filter((it) => it !== evt.detail._id) ?? [currentUser.employee] - }} - noItems={calendar.string.NoParticipants} - /> - - - - - - + + + diff --git a/plugins/tags-assets/assets/icons.svg b/plugins/tags-assets/assets/icons.svg index bcb89af2f1..d17e16b800 100644 --- a/plugins/tags-assets/assets/icons.svg +++ b/plugins/tags-assets/assets/icons.svg @@ -1,7 +1,5 @@ - - - - + + diff --git a/plugins/tags-resources/src/components/CreateTagElement.svelte b/plugins/tags-resources/src/components/CreateTagElement.svelte index 6a046227cf..5fea21117e 100644 --- a/plugins/tags-resources/src/components/CreateTagElement.svelte +++ b/plugins/tags-resources/src/components/CreateTagElement.svelte @@ -16,7 +16,7 @@ import { Class, Data, Doc, generateId, Ref } from '@anticrm/core' import { Card, createQuery, getClient } from '@anticrm/presentation' import { findTagCategory, TagCategory, TagElement } from '@anticrm/tags' - import { DropdownLabels, EditBox, getColorNumberByText, getPlatformColor, showPopup } from '@anticrm/ui' + import { DropdownLabels, EditBox, getColorNumberByText, getPlatformColor, showPopup, Button, IconFolder } from '@anticrm/ui' import { DropdownTextItem } from '@anticrm/ui/src/types' import { ColorsPopup } from '@anticrm/view-resources' import { createEventDispatcher } from 'svelte' @@ -88,58 +88,65 @@ okAction={createTagElenent} canSave={title.length > 0} space={tags.space.Tags} + createMore={false} on:close={() => { dispatch('close') }} > -
-
-
-
{ - showPopup(ColorsPopup, {}, evt.target, (col) => { - if (col != null) { - color = col - colorSet = true - } - }) - }} - /> +
+
+ +
+
+ +
-
- -
- -
- -
- { - categoryWasSet = true - }} + bind:value={description} + placeholder={tags.string.TagDescriptionPlaceholder} + maxWidth={'35rem'} kind={'small-style'} />
+ +
+ { + categoryWasSet = true + }} + /> +
+
diff --git a/plugins/tags-resources/src/components/TagsView.svelte b/plugins/tags-resources/src/components/TagsView.svelte index d7feca94fc..e4adb8fb12 100644 --- a/plugins/tags-resources/src/components/TagsView.svelte +++ b/plugins/tags-resources/src/components/TagsView.svelte @@ -43,7 +43,7 @@ } function showCreateDialog (ev: Event) { - showPopup(CreateTagElement, { targetClass, keyTitle }, ev.target as HTMLElement) + showPopup(CreateTagElement, { targetClass, keyTitle }, 'top') } const opt: FindOptions = { lookup: { diff --git a/plugins/task-resources/src/components/KanbanCard.svelte b/plugins/task-resources/src/components/KanbanCard.svelte index 49eb181ce2..f4c702ddab 100644 --- a/plugins/task-resources/src/components/KanbanCard.svelte +++ b/plugins/task-resources/src/components/KanbanCard.svelte @@ -34,41 +34,45 @@ $: doneTasks = todoItems.filter((it) => it.done) -
-
- - {#if todoItems.length > 0} - -
- ( {doneTasks?.length}/ {todoItems.length} ) -
-
- {/if} -
-
-
- +
+
+
+ + {#if todoItems.length > 0} + +
( {doneTasks?.length}/ {todoItems.length} )
+
+ {/if}
- { - showMenu(evt) - }} - icon={IconMoreH} - size={'small'} - /> +
+
+ +
+ { + showMenu(evt) + }} + icon={IconMoreH} + size={'small'} + /> +
+
+
{object.name}
+ +
+
+ {#if (object.attachments ?? 0) > 0} +
+ +
+ {/if} + {#if (object.comments ?? 0) > 0} +
+ +
+ {/if} +
+
-
{object.name}
- -
-
- {#if (object.attachments ?? 0) > 0} -
- {/if} - {#if (object.comments ?? 0) > 0} -
- {/if} -
- -
diff --git a/plugins/task-resources/src/components/kanban/KanbanTemplateSelector.svelte b/plugins/task-resources/src/components/kanban/KanbanTemplateSelector.svelte index 1e57cf1e28..dfd5386a9c 100644 --- a/plugins/task-resources/src/components/kanban/KanbanTemplateSelector.svelte +++ b/plugins/task-resources/src/components/kanban/KanbanTemplateSelector.svelte @@ -41,4 +41,4 @@ } - + diff --git a/plugins/task-resources/src/components/state/StateEditor.svelte b/plugins/task-resources/src/components/state/StateEditor.svelte index 99ecd2b53b..f10b3cc748 100644 --- a/plugins/task-resources/src/components/state/StateEditor.svelte +++ b/plugins/task-resources/src/components/state/StateEditor.svelte @@ -18,7 +18,7 @@ import { Ref } from '@anticrm/core' import task, { State } from '@anticrm/task' import { createQuery } from '@anticrm/presentation' - import { showPopup } from '@anticrm/ui' + import { showPopup, Button, SelectPopup } from '@anticrm/ui' import StatePresenter from './StatePresenter.svelte' import StatesPopup from './StatesPopup.svelte' @@ -35,19 +35,30 @@ {#if state} -
{ +
+ }} + > + + + + {/if} diff --git a/plugins/task-resources/src/components/state/StatePresenter.svelte b/plugins/task-resources/src/components/state/StatePresenter.svelte index be9f70ae6f..6d2d9d1deb 100644 --- a/plugins/task-resources/src/components/state/StatePresenter.svelte +++ b/plugins/task-resources/src/components/state/StatePresenter.svelte @@ -19,22 +19,19 @@ export let value: State + {#if value} -
- {value.title} +
+
+ {value.title ?? ''}
{/if} diff --git a/plugins/tracker-resources/src/index.ts b/plugins/tracker-resources/src/index.ts index 1afd8e1d84..5fa780183f 100644 --- a/plugins/tracker-resources/src/index.ts +++ b/plugins/tracker-resources/src/index.ts @@ -27,6 +27,10 @@ import Projects from './components/projects/Projects.svelte' import Views from './components/views/Views.svelte' import IssuePresenter from './components/issues/IssuePresenter.svelte' import TitlePresenter from './components/issues/TitlePresenter.svelte' +import PriorityPresenter from './components/issues/PriorityPresenter.svelte' +import StatusPresenter from './components/issues/StatusPresenter.svelte' +import AssigneePresenter from './components/issues/AssigneePresenter.svelte' + import ModificationDatePresenter from './components/issues/ModificationDatePresenter.svelte' import EditIssue from './components/issues/EditIssue.svelte' import NewIssueHeader from './components/NewIssueHeader.svelte' @@ -45,6 +49,9 @@ export default async (): Promise => ({ IssuePresenter, TitlePresenter, ModificationDatePresenter, + PriorityPresenter, + StatusPresenter, + AssigneePresenter, EditIssue, NewIssueHeader } diff --git a/plugins/tracker-resources/src/plugin.ts b/plugins/tracker-resources/src/plugin.ts index 4321418a08..9e6e2dc4c0 100644 --- a/plugins/tracker-resources/src/plugin.ts +++ b/plugins/tracker-resources/src/plugin.ts @@ -42,11 +42,11 @@ export default mergeIds(trackerId, tracker, { Team: '' as IntlString, SelectTeam: '' as IntlString, SaveIssue: '' as IntlString, - CreateMore: '' as IntlString, Todo: '' as IntlString, InProgress: '' as IntlString, Done: '' as IntlString, Canceled: '' as IntlString, + SetPriority: '' as IntlString, SetStatus: '' as IntlString, Priority: '' as IntlString, NoPriority: '' as IntlString, @@ -95,6 +95,9 @@ export default mergeIds(trackerId, tracker, { IssuePresenter: '' as AnyComponent, TitlePresenter: '' as AnyComponent, ModificationDatePresenter: '' as AnyComponent, + PriorityPresenter: '' as AnyComponent, + StatusPresenter: '' as AnyComponent, + AssigneePresenter: '' as AnyComponent, EditIssue: '' as AnyComponent, CreateTeam: '' as AnyComponent, NewIssueHeader: '' as AnyComponent diff --git a/plugins/view-resources/src/components/Table.svelte b/plugins/view-resources/src/components/Table.svelte index ae2d696187..9ceb57ac7d 100644 --- a/plugins/view-resources/src/components/Table.svelte +++ b/plugins/view-resources/src/components/Table.svelte @@ -48,7 +48,8 @@ const dispatch = createEventDispatcher() - $: sortingFunction = (config.find(it => (typeof it !== 'string') && it.sortingKey === sortKey) as BuildModelKey)?.sortingFunction + $: sortingFunction = (config.find((it) => typeof it !== 'string' && it.sortingKey === sortKey) as BuildModelKey) + ?.sortingFunction let qindex = 0 async function update ( @@ -103,11 +104,9 @@ let checked: Set> = new Set>() - function check (id: Ref, e: Event) { + function check (id: Ref, event: CustomEvent) { if (!enableChecking) return - const target = e.target as HTMLInputElement - const value = target.checked - if (value) { + if (event.detail) { checked.add(id) } else { checked.delete(id) @@ -138,8 +137,8 @@ 0} - on:change={(e) => { - objects.map((o) => check(o._id, e)) + on:value={(event) => { + objects.map((object) => check(object._id, event)) }} />
@@ -182,20 +181,23 @@
{ - check(object._id, e) + on:value={(event) => { + check(object._id, event) }} />
{/if} - +
{:else}
{ - check(object._id, e) + on:value={(event) => { + check(object._id, event) }} />
@@ -209,7 +211,11 @@ value={getObjectValue(attribute.key, object) ?? ''} {...attribute.props} /> -
showMenu(ev, object, row)}> +
showMenu(ev, object, row)} + >
@@ -236,9 +242,7 @@ {#if enableChecking}
- +
{/if} diff --git a/plugins/workbench-resources/src/components/SpaceHeader.svelte b/plugins/workbench-resources/src/components/SpaceHeader.svelte index e33c2bba8f..00df5f91ea 100644 --- a/plugins/workbench-resources/src/components/SpaceHeader.svelte +++ b/plugins/workbench-resources/src/components/SpaceHeader.svelte @@ -44,7 +44,7 @@ $: query.query(core.class.Space, { _id: spaceId }, result => { space = result[0] }) function showCreateDialog (ev: Event) { - showPopup(createItemDialog as AnyComponent, { space: spaceId }, ev.target as HTMLElement) + showPopup(createItemDialog as AnyComponent, { space: spaceId }, 'top') } $: updateViewlets(viewlets) diff --git a/plugins/workbench-resources/src/components/SpaceView.svelte b/plugins/workbench-resources/src/components/SpaceView.svelte index 86757e9966..18e44d2c60 100644 --- a/plugins/workbench-resources/src/components/SpaceView.svelte +++ b/plugins/workbench-resources/src/components/SpaceView.svelte @@ -16,11 +16,10 @@ {#if _class && space} - {#await getHeader(space._class) then header} - {#if header} - - {:else} - - {/if} - {/await} + {#if header} + + {:else} + + {/if} {/if} diff --git a/server-plugins/chunter-resources/src/index.ts b/server-plugins/chunter-resources/src/index.ts index 1784ccf069..fbc79374e6 100644 --- a/server-plugins/chunter-resources/src/index.ts +++ b/server-plugins/chunter-resources/src/index.ts @@ -13,9 +13,9 @@ // limitations under the License. // -import chunter, { Channel, Comment, Message } from '@anticrm/chunter' +import chunter, { Channel, Comment, Message, ThreadMessage } from '@anticrm/chunter' import { EmployeeAccount } from '@anticrm/contact' -import core, { Class, Doc, DocumentQuery, FindOptions, FindResult, Hierarchy, Ref, Tx, TxCreateDoc, TxProcessor, TxUpdateDoc } from '@anticrm/core' +import core, { Class, Doc, DocumentQuery, FindOptions, FindResult, Hierarchy, Ref, Tx, TxCreateDoc, TxProcessor, TxUpdateDoc, TxRemoveDoc } from '@anticrm/core' import login from '@anticrm/login' import { getMetadata } from '@anticrm/platform' import { TriggerControl } from '@anticrm/server-core' @@ -58,7 +58,7 @@ export async function CommentCreate (tx: Tx, control: TriggerControl): Promise) - if (!hierarchy.isDerived(doc._class, chunter.class.Comment)) { + if (!hierarchy.isDerived(doc._class, chunter.class.ThreadMessage)) { return [] } @@ -80,6 +80,44 @@ export async function CommentCreate (tx: Tx, control: TriggerControl): Promise { + const hierarchy = control.hierarchy + if (tx._class !== core.class.TxRemoveDoc) return [] + + const rmTx = tx as TxRemoveDoc + if (!hierarchy.isDerived(rmTx.objectClass, chunter.class.ThreadMessage)) { + return [] + } + const createTx = (await control.findAll(core.class.TxCreateDoc, { + objectId: rmTx.objectId + }, { limit: 1 }))[0] + + const comment = TxProcessor.createDoc2Doc(createTx as TxCreateDoc) + + const comments = await control.findAll(chunter.class.ThreadMessage, { + attachedTo: comment.attachedTo + }) + const updateTx = control.txFactory.createTxUpdateDoc( + chunter.class.Message, + comment.space, + comment.attachedTo, + { + replies: + comments + .map(comm => (control.modelDb.getObject(comm.createBy) as EmployeeAccount).employee), + lastReply: + comments.length > 0 + ? Math.max(...comments.map(comm => comm.createOn)) + : undefined + } + ) + + return [updateTx] +} + /** * @public */ @@ -112,7 +150,8 @@ export async function MessageCreate (tx: Tx, control: TriggerControl): Promise { const promises = [ MessageCreate(tx, control), - CommentCreate(tx, control) + CommentCreate(tx, control), + CommentDelete(tx, control) ] const res = await Promise.all(promises) return res.flat() diff --git a/tests/sanity/tests/recruit.spec.ts b/tests/sanity/tests/recruit.spec.ts index df36c0fdf2..a641ca517d 100644 --- a/tests/sanity/tests/recruit.spec.ts +++ b/tests/sanity/tests/recruit.spec.ts @@ -58,7 +58,7 @@ test.describe('recruit tests', () => { // Click on Add button await page.click('.applications-container .flex-row-center .flex-center') - await page.click('span:has-text("Select vacancy")') + await page.click('button:has-text("Vacancy")') await page.click(`button:has-text("${vacancyId}")`) @@ -142,13 +142,13 @@ test.describe('recruit tests', () => { // Click button:has-text("Review") await page.click('button:has-text("Review")') // Click [placeholder="\ "] - await page.click('[placeholder="placeholder"]') + await page.click('[placeholder="Title"]') // Fill [placeholder="\ "] - await page.fill('[placeholder="placeholder"]', 'Meet PEterson') + await page.fill('[placeholder="Title"]', 'Meet PEterson') // Click text=Location Company Company >> [placeholder="\ "] - await page.click('text=placeholder Location >> [placeholder="placeholder"]') + await page.click('[placeholder="Location"]') // Fill text=Location Company Company >> [placeholder="\ "] - await page.fill('text=placeholder Location >> [placeholder="placeholder"]', 'NSK') + await page.fill('[placeholder="Location"]', 'NSK') // Click text=Company Company >> div // await page.click('text=Company Company >> div') // Click button:has-text("Apple") diff --git a/tests/sanity/tests/tags.spec.ts b/tests/sanity/tests/tags.spec.ts index fdbc705826..cb140ce0f6 100644 --- a/tests/sanity/tests/tags.spec.ts +++ b/tests/sanity/tests/tags.spec.ts @@ -30,11 +30,11 @@ test.describe('recruit tests', () => { // Fill [placeholder="Please\ type\ Skill\ title"] await page.fill('[placeholder="Please\\ type\\ Skill\\ title"]', 's1') // Click text=Create Skill s1 Please type description here Category Other Create Cancel >> button - await page.click('text=Create Skill s1 Please type description here Category Other Create Cancel >> button') + await page.click('text=Create more Create >> button') // Click text=s1 await page.click('text=s1') // Click :nth-match(:text("Cancel"), 2) - await page.click(':nth-match(:text("Cancel"), 2)') + await page.click('button:has-text("Cancel")') // Click button:has-text("Create") await page.click('button:has-text("Create")') }) @@ -78,7 +78,7 @@ test.describe('recruit tests', () => { // Click text=java await page.click('text=java') // Click :nth-match(:text("Cancel"), 2) - await page.click(':nth-match(:text("Cancel"), 2)') + await page.click('button:has-text("Cancel")') // Click [placeholder="John"] await page.click('[placeholder="John"]') // Fill [placeholder="John"] diff --git a/tests/sanity/tests/workbench.spec.ts b/tests/sanity/tests/workbench.spec.ts index db4cf90b7b..46aa2e4f5d 100644 --- a/tests/sanity/tests/workbench.spec.ts +++ b/tests/sanity/tests/workbench.spec.ts @@ -14,14 +14,14 @@ test.describe('workbench tests', () => { await page.click('text=Applications') await expect(page).toHaveURL('http://localhost:8083/workbench%3Acomponent%3AWorkbenchApp/recruit%3Aapp%3ARecruit/applicants') // Click text=Applications Application >> span - await expect(page.locator('text=Applications Application >> span')).toBeVisible() + await expect(page.locator('text=Applications Application')).toBeVisible() await expect(page.locator('text=APP-1')).toBeVisible() // Click text=Candidates await page.click('text=Candidates') await expect(page).toHaveURL('http://localhost:8083/workbench%3Acomponent%3AWorkbenchApp/recruit%3Aapp%3ARecruit/candidates') - await expect(page.locator('text=Candidates Candidate >> span')).toBeVisible() + await expect(page.locator('text=Candidates Candidate')).toBeVisible() await expect(page.locator('text=Andrey P.')).toBeVisible() // Click text=Vacancies