TSK-678: Update First/Last names (#2652)

Signed-off-by: Andrey Sobolev <haiodo@gmail.com>
This commit is contained in:
Andrey Sobolev 2023-02-18 01:13:07 +07:00 committed by GitHub
parent 199fb0f7f4
commit c24ae539fb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
21 changed files with 128 additions and 194 deletions

View File

@ -16,7 +16,7 @@
import { generateId } from '@hcengineering/core'
import type { Metadata } from '@hcengineering/platform'
import { setMetadata } from '@hcengineering/platform'
import { Notification, notificationsStore, NotificationPosition, NotificationSeverity } from '.'
import { Notification, NotificationPosition, NotificationSeverity, notificationsStore } from '.'
import { AnyComponent, AnySvelteComponent } from './types'
export function setMetadataLocalStorage<T> (id: Metadata<T>, value: T | null): void {
@ -64,7 +64,7 @@ export function addNotification (
severity: NotificationSeverity.Success,
position: NotificationPosition.BottomRight,
component,
closeTimeout: 10000,
closeTimeout: parseInt(localStorage.getItem('#platform.notification.timeout') ?? '10000'),
params
}

View File

@ -7,10 +7,10 @@
"CreatePerson": "Create person",
"CreatePersons": "Create persons folder",
"CreateOrganization": "Create organization",
"OrganizationNamePlaceholder": "Apple",
"OrganizationNamePlaceholder": "Organization name",
"OrganizationsNamePlaceholder": "Organizations",
"PersonFirstNamePlaceholder": "John",
"PersonLastNamePlaceholder": "Appleseed",
"PersonFirstNamePlaceholder": "First name",
"PersonLastNamePlaceholder": "Last name",
"PersonLocationPlaceholder": "Location",
"PersonsNamePlaceholder": "Folder",
"CreateOrganizations": "Create organizations folder",

View File

@ -7,10 +7,10 @@
"CreatePerson": "Создать персону",
"CreatePersons": "Создать папку для людей",
"CreateOrganization": "Создать организацию",
"OrganizationNamePlaceholder": "Apple",
"OrganizationNamePlaceholder": "Имя организации",
"OrganizationsNamePlaceholder": "Организации",
"PersonFirstNamePlaceholder": "John",
"PersonLastNamePlaceholder": "Appleseed",
"PersonFirstNamePlaceholder": "Имя",
"PersonLastNamePlaceholder": "Фамилия",
"PersonLocationPlaceholder": "Местоположение",
"PersonsNamePlaceholder": "Папка",
"CreateOrganizations": "Создать папку для организаций",

View File

@ -146,6 +146,7 @@
</div>
{:else}
<div class="buttons-group xsmall-gap">
<!-- svelte-ignore a11y-click-events-have-key-events -->
<span
class="select-text cover-channel"
class:show

View File

@ -168,7 +168,6 @@
}
const saveItems = (): void => {
value = filterUndefined(displayItems)
dispatch('change', value)
updateMenu(displayItems)
}
@ -206,6 +205,9 @@
displayItems = dropItem(n)
} else {
item.value = result
if (displayItems.find((it) => item.value === it.value) === undefined) {
displayItems = [...displayItems, item]
}
}
saveItems()
focusManager?.setFocusPos(focusIndex + 1 + n)

View File

@ -1,93 +0,0 @@
<!--
// Copyright © 2020, 2021 Anticrm Platform Contributors.
// Copyright © 2021 Hardcore Engineering Inc.
//
// Licensed under the Eclipse Public License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License. You may
// obtain a copy of the License at https://www.eclipse.org/legal/epl-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
//
// See the License for the specific language governing permissions and
// limitations under the License.
-->
<script lang="ts">
import { ScrollBox, tooltip } from '@hcengineering/ui'
import ActionIcon from '@hcengineering/ui/src/components/ActionIcon.svelte'
import view from '@hcengineering/view'
import { queries, toIntl } from '..'
import ContentPopup from './ContentPopup.svelte'
</script>
<ScrollBox vertical>
<div class="query-content">
<table class="table">
<thead>
<tr>
<th>Index</th>
<th>Class</th>
<th>Query</th>
<th>Options</th>
<th>Result Count</th>
<th>Result</th>
<th>Actions</th>
</tr>
</thead>
<tbody>
{#each queries as q}
<tr class="tr-body">
<td>{queries.indexOf(q)}</td>
<td>{q._class}</td>
<td>{JSON.stringify(q.query)}</td>
<td>{JSON.stringify(q.options ?? {})}</td>
<td>{q.result.length}</td>
<td>
<span use:tooltip={{ label: toIntl('Content'), component: ContentPopup, props: { content: q.result } }}>
Results
</span>
</td>
<td>
<ActionIcon
direction={undefined}
size="small"
icon={view.icon.MoreH}
label={toIntl('Perform Class Query')}
action={() => {}}
/>
</td>
</tr>
{/each}
</tbody>
</table>
</div>
</ScrollBox>
<style lang="scss">
.query-content {
display: flex;
margin: 20px;
}
th,
td {
padding: 0.5rem 1.5rem;
text-align: left;
}
th {
height: 2.5rem;
font-weight: 500;
font-size: 0.75rem;
color: var(--theme-content-dark-color);
box-shadow: inset 0 -1px 0 0 var(--theme-bg-focused-color);
user-select: none;
}
.tr-body {
height: 3.25rem;
color: var(--theme-caption-color);
border-bottom: 1px solid var(--theme-button-border-hovered);
}
</style>

View File

@ -23,7 +23,6 @@ import core, {
Hierarchy,
ModelDb,
Ref,
toFindResult,
Tx,
TxResult,
WithLookup
@ -51,17 +50,16 @@ export interface QueryWithResult {
}
export const transactions: TxWitHResult[] = []
export const notifications: Tx[] = []
export const queries: QueryWithResult[] = []
class ModelClient implements Client {
notifyEnabled = true
constructor (readonly client: Client) {
this.notifyEnabled = (localStorage.getItem('#platform.notification.logging') ?? 'true') === 'true'
client.notify = (tx) => {
this.notify?.(tx)
console.info('devmodel# notify=>', tx, this.client.getModel(), getMetadata(devmodel.metadata.DevModel))
notifications.push(tx)
if (notifications.length > 500) {
notifications.shift()
if (this.notifyEnabled) {
console.info('devmodel# notify=>', tx, this.client.getModel(), getMetadata(devmodel.metadata.DevModel))
}
}
}
@ -82,26 +80,18 @@ class ModelClient implements Client {
options?: FindOptions<T>
): Promise<WithLookup<T> | undefined> {
const result = await this.client.findOne(_class, query, options)
console.info(
'devmodel# findOne=>',
_class,
query,
options,
'result => ',
result,
' =>model',
this.client.getModel(),
getMetadata(devmodel.metadata.DevModel)
)
queries.push({
_class,
query,
options: options as FindOptions<Doc>,
result: toFindResult(result !== undefined ? [result] : []),
findOne: true
})
if (queries.length > 100) {
queries.shift()
if (this.notifyEnabled) {
console.info(
'devmodel# findOne=>',
_class,
query,
options,
'result => ',
result,
' =>model',
this.client.getModel(),
getMetadata(devmodel.metadata.DevModel)
)
}
return result
}
@ -112,27 +102,27 @@ class ModelClient implements Client {
options?: FindOptions<T>
): Promise<FindResult<T>> {
const result = await this.client.findAll(_class, query, options)
console.info(
'devmodel# findAll=>',
_class,
query,
options,
'result => ',
result,
' =>model',
this.client.getModel(),
getMetadata(devmodel.metadata.DevModel)
)
queries.push({ _class, query, options: options as FindOptions<Doc>, result, findOne: false })
if (queries.length > 100) {
queries.shift()
if (this.notifyEnabled) {
console.info(
'devmodel# findAll=>',
_class,
query,
options,
'result => ',
result,
' =>model',
this.client.getModel(),
getMetadata(devmodel.metadata.DevModel)
)
}
return result
}
async tx (tx: Tx): Promise<TxResult> {
const result = await this.client.tx(tx)
console.info('devmodel# tx=>', tx, result, getMetadata(devmodel.metadata.DevModel))
if (this.notifyEnabled) {
console.info('devmodel# tx=>', tx, result, getMetadata(devmodel.metadata.DevModel))
}
transactions.push({ tx, result })
if (transactions.length > 100) {
transactions.shift()
@ -166,12 +156,6 @@ export async function Hook (client: Client): Promise<Client> {
icon: view.icon.Table,
id: 'transactions',
component: devmodel.component.ModelView
},
{
label: 'Queries' as IntlString,
icon: view.icon.Table,
id: 'queries',
component: devmodel.component.QueryView
}
]
}

View File

@ -54,8 +54,8 @@
"Location": "Location",
"Title": "Title",
"Source": "Source",
"PersonFirstNamePlaceholder": "John",
"PersonLastNamePlaceholder": "Appleseed",
"PersonFirstNamePlaceholder": "First name",
"PersonLastNamePlaceholder": "Last name",
"PersonLocationPlaceholder": "Location",
"ManageVacancyStatuses": "Manage vacancy templates",
"EditVacancy": "Edit",

View File

@ -54,8 +54,8 @@
"Location": "Местоположение",
"Title": "Заголовок",
"Source": "Источник",
"PersonFirstNamePlaceholder": "John",
"PersonLastNamePlaceholder": "Appleseed",
"PersonFirstNamePlaceholder": "First name",
"PersonLastNamePlaceholder": "Last name",
"PersonLocationPlaceholder": "Местоположение",
"ManageVacancyStatuses": "Управление шаблонами вакансии",
"EditVacancy": "Редактировать",

View File

@ -15,6 +15,14 @@
{
"name": "login:metadata:LoginEndpoint",
"value": "ws://localhost:3333"
},
{
"name": "#platform.notification.timeout",
"value": "1"
},
{
"name": "#platform.notification.logging",
"value": "false"
}
]
}

View File

@ -15,6 +15,10 @@
{
"name": "login:metadata:LoginEndpoint",
"value": "ws://localhost:3334"
},
{
"name": "#platform.notification.logging",
"value": "false"
}
]
}

View File

@ -8,7 +8,7 @@ test.use({
test.describe('duplicate-org-test', () => {
test.beforeEach(async ({ page }) => {
// Create user and workspace
await page.goto(`${PlatformURI}/workbench/sanity-ws`)
await (await page.goto(`${PlatformURI}/workbench/sanity-ws`))?.finished()
})
test('check-contact-exists', async ({ page }) => {
await page.click('[id="app-lead\\:string\\:LeadApplication"]')
@ -26,11 +26,11 @@ test.describe('duplicate-org-test', () => {
await page.click('button:has-text("Organization")')
// Click [placeholder="Apple"]
await page.click('[placeholder="Apple"]')
await page.click('[placeholder="Organization name"]')
const genId = 'Asoft-' + generateId(4)
// Fill [placeholder="Apple"]
await page.fill('[placeholder="Apple"]', genId)
await page.fill('[placeholder="Organization name"]', genId)
// Click button:has-text("Create")
await page.click('button:has-text("Create")')
@ -47,10 +47,10 @@ test.describe('duplicate-org-test', () => {
await page.click('button:has-text("Organization")')
// Click [placeholder="Apple"]
await page.click('[placeholder="Apple"]')
await page.click('[placeholder="Organization name"]')
// Fill [placeholder="Apple"]
await page.fill('[placeholder="Apple"]', genId)
await page.fill('[placeholder="Organization name"]', genId)
// Click text=Person already exists...
await page.click('text=Contact already exists...')

View File

@ -8,7 +8,7 @@ test.use({
test.describe('contact tests', () => {
test.beforeEach(async ({ page }) => {
// Create user and workspace
await page.goto(`${PlatformURI}/workbench/sanity-ws`)
await (await page.goto(`${PlatformURI}/workbench/sanity-ws`))?.finished()
})
test('create-contact', async ({ page }) => {
// Create a new context with the saved storage state.
@ -21,11 +21,11 @@ test.describe('contact tests', () => {
const first = 'Elton-' + generateId(5)
const last = 'John-' + generateId(5)
const firstName = page.locator('[placeholder="John"]')
const firstName = page.locator('[placeholder="First name"]')
await firstName.click()
await firstName.fill(first)
const lastName = page.locator('[placeholder="Appleseed"]')
const lastName = page.locator('[placeholder="Last name"]')
await lastName.click()
await lastName.fill(last)
@ -41,7 +41,7 @@ test.describe('contact tests', () => {
const orgName = 'Organization' + generateId(5)
const firstName = page.locator('[placeholder="Apple"]')
const firstName = page.locator('[placeholder="Organization name"]')
await firstName.click()
await firstName.fill(orgName)
@ -59,7 +59,9 @@ test.describe('contact tests', () => {
await searchBox.fill('Marina')
await searchBox.press('Enter')
await expect(page.locator('.antiTable-body__row')).toHaveCount(1)
await expect(page.locator('.antiTable-body__row')).toHaveCount(1, {
timeout: 15000
})
await searchBox.fill('')
await searchBox.press('Enter')
@ -79,11 +81,11 @@ test.describe('contact tests', () => {
const first = 'Elton-' + generateId(5)
const last = 'John-' + generateId(5)
const firstName = page.locator('[placeholder="John"]')
const firstName = page.locator('[placeholder="First name"]')
await firstName.click()
await firstName.fill(first)
const lastName = page.locator('[placeholder="Appleseed"]')
const lastName = page.locator('[placeholder="Last name"]')
await lastName.click()
await lastName.fill(last)

View File

@ -8,16 +8,16 @@ test.use({
test.describe('recruit tests', () => {
test.beforeEach(async ({ page }) => {
// Create user and workspace
await page.goto(`${PlatformURI}/workbench/sanity-ws`)
await (await page.goto(`${PlatformURI}/workbench/sanity-ws`))?.finished()
})
test('org-add-member', async ({ page }) => {
await page.click('[id="app-contact\\:string\\:Contacts"]')
await page.click('button:has-text("Contact")')
await page.click('button:has-text("Organization")')
await page.click('[placeholder="Apple"]')
await page.click('[placeholder="Organization name"]')
const orgId = 'Organiation-' + generateId()
await page.fill('[placeholder="Apple"]', orgId)
await page.fill('[placeholder="Organization name"]', orgId)
await page.click('button:has-text("Create")')
await page.waitForSelector('form.antiCard', { state: 'detached' })
await page.click(`text=${orgId}`)

View File

@ -11,6 +11,9 @@ const config: PlaywrightTestConfig = {
screenshots: true,
sources: true
}
}
},
retries: 1,
timeout: 60000,
maxFailures: 5
}
export default config

View File

@ -8,7 +8,7 @@ test.use({
test.describe('recruit review tests', () => {
test.beforeEach(async ({ page }) => {
// Create user and workspace
await page.goto(`${PlatformURI}/workbench/sanity-ws`)
await (await page.goto(`${PlatformURI}/workbench/sanity-ws`))?.finished()
})
test('create-review', async ({ page, context }) => {
await page.click('[id="app-recruit\\:string\\:RecruitApplication"]')

View File

@ -22,11 +22,11 @@ test.describe('recruit tests', () => {
const loc = 'Cupertino'
const email = `ej-${generateId(4)}@test.com`
const firstName = page.locator('[placeholder="John"]')
const firstName = page.locator('[placeholder="First name"]')
await firstName.click()
await firstName.fill(first)
const lastName = page.locator('[placeholder="Appleseed"]')
const lastName = page.locator('[placeholder="Last name"]')
await lastName.click()
await lastName.fill(last)
@ -60,6 +60,7 @@ test.describe('recruit tests', () => {
test('create-application', async ({ page }) => {
await page.locator('[id="app-recruit\\:string\\:RecruitApplication"]').click()
await page.waitForLoadState('load')
const vacancyId = 'My vacancy ' + generateId(4)

View File

@ -8,9 +8,9 @@ test.use({
test.describe('recruit tests', () => {
test.beforeEach(async ({ page }) => {
// Create user and workspace
await page.goto(`${PlatformURI}/workbench/sanity-ws`)
await (await page.goto(`${PlatformURI}/workbench/sanity-ws`))?.finished()
})
test('create-candidate-with-skill', async ({ page }) => {
test('create-skill-candidate-with-skill', async ({ page }) => {
// Go to http://localhost:8083/workbench/sanity-ws
await page.goto(`${PlatformURI}/workbench/sanity-ws`)
// Click [id="app-recruit\:string\:RecruitApplication"]
@ -22,11 +22,11 @@ test.describe('recruit tests', () => {
// Click button:has-text("Talent")
await page.click('button:has-text("Talent")')
// Fill [placeholder="John"]
await page.fill('[placeholder="John"]', 'Petr')
await page.fill('[placeholder="First name"]', 'Petr')
// Click [placeholder="Appleseed"]
await page.click('[placeholder="Appleseed"]')
await page.click('[placeholder="Last name"]')
// Fill [placeholder="Appleseed"]
await page.fill('[placeholder="Appleseed"]', 'Dooliutl')
await page.fill('[placeholder="Last name"]', 'Dooliutl')
// Click .ml-4 .tooltip-trigger .flex-center
await page.click('button:has-text("Skills")')
// Click text=Add/Create Skill Suggested Cancel >> button
@ -93,15 +93,15 @@ test.describe('recruit tests', () => {
// await page.click('button:has-text("Cancel")')
await page.keyboard.press('Escape')
// Click [placeholder="John"]
await page.click('[placeholder="John"]')
await page.click('[placeholder="First name"]')
// Fill [placeholder="John"]
const first = 'first-' + generateId(4)
await page.fill('[placeholder="John"]', first)
await page.fill('[placeholder="First name"]', first)
// Click [placeholder="Appleseed"]
await page.click('[placeholder="Appleseed"]')
await page.click('[placeholder="Last name"]')
// Fill [placeholder="Appleseed"]
const last = 'last-' + generateId(4)
await page.fill('[placeholder="Appleseed"]', last)
await page.fill('[placeholder="Last name"]', last)
// Click button:has-text("Create")
await page.click('button:has-text("Create")')
await page.waitForSelector('form.antiCard', { state: 'detached' })

View File

@ -9,7 +9,7 @@ test.use({
test.describe('project tests', () => {
test.beforeEach(async ({ page }) => {
// Create user and workspace
await page.goto(`${PlatformURI}/workbench/sanity-ws`)
await (await page.goto(`${PlatformURI}/workbench/sanity-ws`))?.finished()
})
test('create-project-issue', async ({ page }) => {
await page.click('[id="app-tracker\\:string\\:TrackerApplication"]')

View File

@ -30,6 +30,14 @@ test('create-issue-and-sub-issue', async ({ page }) => {
}
await createIssue(page, props)
await page.click('text="Issues"')
// Click [placeholder="Search"]
await page.locator('[placeholder="Search"]').click()
// Fill [placeholder="Search"]
await page.locator('[placeholder="Search"]').fill(props.name)
// Press Enter
await page.locator('[placeholder="Search"]').press('Enter')
await openIssue(page, props.name)
await checkIssue(page, props)
props.name = `sub${props.name}`
@ -40,12 +48,13 @@ test('create-issue-and-sub-issue', async ({ page }) => {
const getIssueName = (postfix: string = generateId(5)): string => `issue-${postfix}`
const panelStatusMap = new Map([
['Issues', DEFAULT_STATUSES],
['Active', ['Todo', 'In Progress']],
['Backlog', ['Backlog']]
])
test('issues-status-display', async ({ page }) => {
const panelStatusMap = new Map([
['Issues', DEFAULT_STATUSES],
['Active', ['Todo', 'In Progress']],
['Backlog', ['Backlog']]
])
const locator = page.locator('.list-container')
await navigate(page)
for (const status of DEFAULT_STATUSES) {
@ -58,15 +67,19 @@ test('issues-status-display', async ({ page }) => {
await expect(locator).toContainText(statuses)
if (excluded.length > 0) await expect(locator).not.toContainText(excluded)
await page.click(ViewletSelectors.Board)
if (excluded.length > 0) await expect(locator).not.toContainText(excluded)
for (const status of statuses) {
await expect(page.locator(`.panel-container:has-text("${status}")`)).toContainText(getIssueName(status))
await expect(
page.locator('.panel-container', {
has: page.locator(`.header:has-text("${status}")`)
})
).toContainText(getIssueName(status), { timeout: 15000 })
}
}
})
test('save-view-options', async ({ page }) => {
test.setTimeout(45000)
const panels = ['Issues', 'Active', 'Backlog']
await navigate(page)
for (const viewletSelector of [ViewletSelectors.Board, ViewletSelectors.Table]) {
@ -108,12 +121,11 @@ test('my-issues', async ({ page }) => {
})
test('report-time-from-issue-card', async ({ page }) => {
test.setTimeout(45000)
await navigate(page)
const assignee = 'Chen Rosamund'
const status = 'In Progress'
const values = [0.25, 0.5, 0.75, 1]
for (let i = 0; i < 10; i++) {
for (let i = 0; i < 5; i++) {
const random = Math.floor(Math.random() * values.length)
const time = values[random]
const name = getIssueName()
@ -151,14 +163,24 @@ test('report-time-from-main-view', async ({ page }) => {
const name = getIssueName()
await createIssue(page, { name, assignee, status })
// await page.click('.close-button > .button')
// Click [placeholder="Search"]
await page.locator('[placeholder="Search"]').click()
// Fill [placeholder="Search"]
await page.locator('[placeholder="Search"]').fill(name)
// Press Enter
await page.locator('[placeholder="Search"]').press('Enter')
await page.waitForSelector(`text="${name}"`)
await page.click('.close-button > .button')
let count = 0
for (let j = 0; j < 5; j++) {
const random = Math.floor(Math.random() * values.length)
const time = values[random]
count += time
await page.locator('.estimation-container').first().click()
await page.waitForSelector('text="Estimation"')

View File

@ -22,7 +22,7 @@ export const DEFAULT_STATUSES = ['Backlog', 'Todo', 'In Progress', 'Done', 'Canc
export const DEFAULT_USER = 'Appleseed John'
export async function navigate (page: Page): Promise<void> {
await page.goto(`${PlatformURI}/workbench/sanity-ws`)
await (await page.goto(`${PlatformURI}/workbench/sanity-ws`))?.finished()
await page.click('[id="app-tracker\\:string\\:TrackerApplication"]')
await expect(page).toHaveURL(`${PlatformURI}/workbench/sanity-ws/tracker`)
}