Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TSK-678: Update First/Last names #2652

Merged
merged 1 commit into from
Feb 17, 2023
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
4 changes: 2 additions & 2 deletions packages/ui/src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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
}

Expand Down
6 changes: 3 additions & 3 deletions plugins/contact-assets/lang/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
6 changes: 3 additions & 3 deletions plugins/contact-assets/lang/ru.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@
"CreatePerson": "Создать персону",
"CreatePersons": "Создать папку для людей",
"CreateOrganization": "Создать организацию",
"OrganizationNamePlaceholder": "Apple",
"OrganizationNamePlaceholder": "Имя организации",
"OrganizationsNamePlaceholder": "Организации",
"PersonFirstNamePlaceholder": "John",
"PersonLastNamePlaceholder": "Appleseed",
"PersonFirstNamePlaceholder": "Имя",
"PersonLastNamePlaceholder": "Фамилия",
"PersonLocationPlaceholder": "Местоположение",
"PersonsNamePlaceholder": "Папка",
"CreateOrganizations": "Создать папку для организаций",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,6 @@
}
const saveItems = (): void => {
value = filterUndefined(displayItems)
dispatch('change', value)
updateMenu(displayItems)
}

Expand Down Expand Up @@ -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)
Expand Down
93 changes: 0 additions & 93 deletions plugins/devmodel-resources/src/components/QueryView.svelte

This file was deleted.

80 changes: 32 additions & 48 deletions plugins/devmodel-resources/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ import core, {
Hierarchy,
ModelDb,
Ref,
toFindResult,
Tx,
TxResult,
WithLookup
Expand Down Expand Up @@ -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))
}
}
}
Expand All @@ -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
}
Expand All @@ -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()
Expand Down Expand Up @@ -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
}
]
}
Expand Down
4 changes: 2 additions & 2 deletions plugins/recruit-assets/lang/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
4 changes: 2 additions & 2 deletions plugins/recruit-assets/lang/ru.json
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,8 @@
"Location": "Местоположение",
"Title": "Заголовок",
"Source": "Источник",
"PersonFirstNamePlaceholder": "John",
"PersonLastNamePlaceholder": "Appleseed",
"PersonFirstNamePlaceholder": "First name",
"PersonLastNamePlaceholder": "Last name",
"PersonLocationPlaceholder": "Местоположение",
"ManageVacancyStatuses": "Управление шаблонами вакансии",
"EditVacancy": "Редактировать",
Expand Down
8 changes: 8 additions & 0 deletions tests/sanity/storage-dev.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,14 @@
{
"name": "login:metadata:LoginEndpoint",
"value": "ws://localhost:3333"
},
{
"name": "#platform.notification.timeout",
"value": "1"
},
{
"name": "#platform.notification.logging",
"value": "false"
}
]
}
Expand Down
4 changes: 4 additions & 0 deletions tests/sanity/storage.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@
{
"name": "login:metadata:LoginEndpoint",
"value": "ws://localhost:3334"
},
{
"name": "#platform.notification.logging",
"value": "false"
}
]
}
Expand Down
10 changes: 5 additions & 5 deletions tests/sanity/tests/contact.duplicate.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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"]')
Expand All @@ -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")')
Expand All @@ -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...')
Expand Down
Loading