mirror of
https://github.com/hcengineering/platform.git
synced 2025-04-13 11:50:56 +00:00
UBER-170: Navigation for contacts (#3323)
This commit is contained in:
parent
00e160ad86
commit
eee6e69114
@ -227,8 +227,52 @@ export function createModel (builder: Builder): void {
|
||||
icon: contact.icon.ContactApplication,
|
||||
alias: contactId,
|
||||
hidden: false,
|
||||
component: contact.component.ContactsTabs,
|
||||
locationResolver: contact.resolver.Location
|
||||
// component: contact.component.ContactsTabs,
|
||||
locationResolver: contact.resolver.Location,
|
||||
navigatorModel: {
|
||||
spaces: [],
|
||||
specials: [
|
||||
{
|
||||
id: 'employees',
|
||||
component: workbench.component.SpecialView,
|
||||
icon: contact.icon.Person,
|
||||
label: contact.string.Employee,
|
||||
componentProps: {
|
||||
_class: contact.class.Employee,
|
||||
icon: contact.icon.Person,
|
||||
label: contact.string.Employee,
|
||||
createLabel: contact.string.CreateEmployee,
|
||||
createComponent: contact.component.CreateEmployee
|
||||
}
|
||||
},
|
||||
{
|
||||
id: 'persons',
|
||||
component: workbench.component.SpecialView,
|
||||
icon: contact.icon.Person,
|
||||
label: contact.string.Person,
|
||||
componentProps: {
|
||||
_class: contact.class.Person,
|
||||
icon: contact.icon.Person,
|
||||
label: contact.string.Person,
|
||||
createLabel: contact.string.CreatePerson,
|
||||
createComponent: contact.component.CreatePerson
|
||||
}
|
||||
},
|
||||
{
|
||||
id: 'companies',
|
||||
component: workbench.component.SpecialView,
|
||||
icon: contact.icon.Company,
|
||||
label: contact.string.Organization,
|
||||
componentProps: {
|
||||
_class: contact.class.Organization,
|
||||
icon: contact.icon.Company,
|
||||
label: contact.string.Organization,
|
||||
createLabel: contact.string.CreateOrganization,
|
||||
createComponent: contact.component.CreateOrganization
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
contact.app.Contacts
|
||||
)
|
||||
@ -255,7 +299,8 @@ export function createModel (builder: Builder): void {
|
||||
'modifiedOn'
|
||||
],
|
||||
configOptions: {
|
||||
hiddenKeys: ['name', 'contact']
|
||||
hiddenKeys: ['name', 'contact'],
|
||||
sortable: true
|
||||
}
|
||||
},
|
||||
contact.viewlet.TableMember
|
||||
@ -270,11 +315,41 @@ export function createModel (builder: Builder): void {
|
||||
view.class.Viewlet,
|
||||
core.space.Model,
|
||||
{
|
||||
attachTo: contact.class.Contact,
|
||||
attachTo: contact.class.Person,
|
||||
descriptor: view.viewlet.Table,
|
||||
config: [
|
||||
'',
|
||||
'city',
|
||||
'attachments',
|
||||
'modifiedOn',
|
||||
{ key: '', presenter: view.component.RolePresenter, label: view.string.Role },
|
||||
{
|
||||
key: '$lookup.channels',
|
||||
label: contact.string.ContactInfo,
|
||||
sortingKey: ['$lookup.channels.lastMessage', 'channels']
|
||||
}
|
||||
],
|
||||
configOptions: {
|
||||
hiddenKeys: ['name'],
|
||||
sortable: true
|
||||
},
|
||||
baseQuery: {
|
||||
_class: {
|
||||
$in: [contact.class.Person],
|
||||
$nin: [contact.class.Employee]
|
||||
}
|
||||
}
|
||||
},
|
||||
contact.viewlet.TablePerson
|
||||
)
|
||||
builder.createDoc<Viewlet>(
|
||||
view.class.Viewlet,
|
||||
core.space.Model,
|
||||
{
|
||||
attachTo: contact.class.Employee,
|
||||
descriptor: view.viewlet.Table,
|
||||
config: [
|
||||
'',
|
||||
'_class',
|
||||
'city',
|
||||
'attachments',
|
||||
'modifiedOn',
|
||||
@ -290,7 +365,33 @@ export function createModel (builder: Builder): void {
|
||||
sortable: true
|
||||
}
|
||||
},
|
||||
contact.viewlet.TableContact
|
||||
contact.viewlet.TableEmployee
|
||||
)
|
||||
|
||||
builder.createDoc<Viewlet>(
|
||||
view.class.Viewlet,
|
||||
core.space.Model,
|
||||
{
|
||||
attachTo: contact.class.Organization,
|
||||
descriptor: view.viewlet.Table,
|
||||
config: [
|
||||
'',
|
||||
'city',
|
||||
'attachments',
|
||||
'modifiedOn',
|
||||
{ key: '', presenter: view.component.RolePresenter, label: view.string.Role },
|
||||
{
|
||||
key: '$lookup.channels',
|
||||
label: contact.string.ContactInfo,
|
||||
sortingKey: ['$lookup.channels.lastMessage', 'channels']
|
||||
}
|
||||
],
|
||||
configOptions: {
|
||||
hiddenKeys: ['name'],
|
||||
sortable: true
|
||||
}
|
||||
},
|
||||
contact.viewlet.TableOrganization
|
||||
)
|
||||
|
||||
builder.mixin(contact.class.Person, core.class.Class, view.mixin.ObjectEditor, {
|
||||
@ -559,7 +660,17 @@ export function createModel (builder: Builder): void {
|
||||
})
|
||||
|
||||
builder.mixin(contact.class.Contact, core.class.Class, view.mixin.ClassFilters, {
|
||||
filters: ['_class']
|
||||
filters: []
|
||||
})
|
||||
|
||||
builder.mixin(contact.class.Person, core.class.Class, view.mixin.ClassFilters, {
|
||||
filters: []
|
||||
})
|
||||
builder.mixin(contact.class.Employee, core.class.Class, view.mixin.ClassFilters, {
|
||||
filters: []
|
||||
})
|
||||
builder.mixin(contact.class.Organization, core.class.Class, view.mixin.ClassFilters, {
|
||||
filters: []
|
||||
})
|
||||
|
||||
builder.mixin(contact.class.Channel, core.class.Class, view.mixin.AttributeFilter, {
|
||||
|
@ -4,8 +4,8 @@
|
||||
"Contacts": "Contacts",
|
||||
"Persons": "Persons",
|
||||
"Organizations": "Companies",
|
||||
"CreatePerson": "Create person",
|
||||
"CreateOrganization": "Create company",
|
||||
"CreatePerson": "Person",
|
||||
"CreateOrganization": "Company",
|
||||
"OrganizationNamePlaceholder": "Company name",
|
||||
"OrganizationsNamePlaceholder": "Companies",
|
||||
"PersonFirstNamePlaceholder": "First name",
|
||||
@ -64,7 +64,7 @@
|
||||
"KickEmployee": "Kick an employee",
|
||||
"KickEmployeeDescr": "Are you sure you want to kick the employee out of the workspace? This action cannot be undone",
|
||||
"Email": "Email",
|
||||
"CreateEmployee": "Create an employee",
|
||||
"CreateEmployee": "Employee",
|
||||
"Inactive": "Inactive",
|
||||
"Birthday": "Birthday",
|
||||
"UseImage": "Attached photo",
|
||||
|
@ -4,8 +4,8 @@
|
||||
"Contacts": "Контакты",
|
||||
"Persons": "Люди",
|
||||
"Organizations": "Компании",
|
||||
"CreatePerson": "Создать персону",
|
||||
"CreateOrganization": "Создать компанию",
|
||||
"CreatePerson": "Персона",
|
||||
"CreateOrganization": "Компания",
|
||||
"OrganizationNamePlaceholder": "Имя компании",
|
||||
"OrganizationsNamePlaceholder": "Компании",
|
||||
"PersonFirstNamePlaceholder": "Имя",
|
||||
@ -64,7 +64,7 @@
|
||||
"KickEmployee": "Исключить сотрудника",
|
||||
"KickEmployeeDescr": "Вы действительно хотите выгнать сотрудника из рабочего пространства? Это действие нельзя отменить",
|
||||
"Email": "Email",
|
||||
"CreateEmployee": "Создать сотрудника",
|
||||
"CreateEmployee": "Cотрудник",
|
||||
"Inactive": "Не активный",
|
||||
"Birthday": "День рождения",
|
||||
"UseImage": "Загруженное Фото",
|
||||
|
@ -268,7 +268,9 @@ export const contactPlugin = plugin(contactId, {
|
||||
},
|
||||
viewlet: {
|
||||
TableMember: '' as Ref<Viewlet>,
|
||||
TableContact: '' as Ref<Viewlet>
|
||||
TablePerson: '' as Ref<Viewlet>,
|
||||
TableEmployee: '' as Ref<Viewlet>,
|
||||
TableOrganization: '' as Ref<Viewlet>
|
||||
},
|
||||
filter: {
|
||||
FilterChannelIn: '' as Ref<FilterMode>,
|
||||
|
@ -14,9 +14,8 @@ test.describe('contact tests', () => {
|
||||
// Create a new context with the saved storage state.
|
||||
await page.locator('[id="app-contact\\:string\\:Contacts"]').click()
|
||||
|
||||
await page.click('button:has-text("Contact")')
|
||||
|
||||
await (await page.locator('.ap-menuItem')).locator('text=Person').click()
|
||||
await page.click('.antiNav-element:has-text("Person")')
|
||||
await page.click('button:has-text("Person")')
|
||||
|
||||
const first = 'Elton-' + generateId(5)
|
||||
const last = 'John-' + generateId(5)
|
||||
@ -35,9 +34,8 @@ test.describe('contact tests', () => {
|
||||
test('create-company', async ({ page }) => {
|
||||
await page.locator('[id="app-contact\\:string\\:Contacts"]').click()
|
||||
|
||||
await page.click('button:has-text("Contact")')
|
||||
|
||||
await (await page.locator('.ap-menuItem')).locator('text=Company').click()
|
||||
await page.click('.antiNav-element:has-text("Company")')
|
||||
await page.click('button:has-text("Company")')
|
||||
|
||||
const orgName = 'Company' + generateId(5)
|
||||
|
||||
@ -52,6 +50,8 @@ test.describe('contact tests', () => {
|
||||
test('contact-search', async ({ page }) => {
|
||||
await page.locator('[id="app-contact\\:string\\:Contacts"]').click()
|
||||
|
||||
await page.click('.antiNav-element:has-text("Person")')
|
||||
|
||||
await expect(page.locator('text=M. Marina')).toBeVisible()
|
||||
expect(await page.locator('.antiTable-body__row').count()).toBeGreaterThan(5)
|
||||
|
||||
@ -63,17 +63,16 @@ test.describe('contact tests', () => {
|
||||
|
||||
await fillSearch(page, '')
|
||||
|
||||
await expect(page.locator('text=Chen Rosamund')).toBeVisible()
|
||||
expect(await page.locator('.antiTable-body__row').count()).toBeGreaterThan(5)
|
||||
await expect(page.locator('text=P. Andrey')).toBeVisible()
|
||||
expect(await page.locator('.antiTable-body__row').count()).toBeGreaterThan(3)
|
||||
})
|
||||
|
||||
test('delete-contact', async ({ page }) => {
|
||||
// Create a new context with the saved storage state.
|
||||
await page.locator('[id="app-contact\\:string\\:Contacts"]').click()
|
||||
|
||||
await page.click('button:has-text("Contact")')
|
||||
|
||||
await (await page.locator('.ap-menuItem')).locator('text=Person').click()
|
||||
await page.click('.antiNav-element:has-text("Person")')
|
||||
await page.click('button:has-text("Person")')
|
||||
|
||||
const first = 'Elton-' + generateId(5)
|
||||
const last = 'John-' + generateId(5)
|
||||
|
@ -13,7 +13,7 @@ test.describe('recruit tests', () => {
|
||||
|
||||
test('org-add-member', async ({ page }) => {
|
||||
await page.click('[id="app-contact\\:string\\:Contacts"]')
|
||||
await page.click('button:has-text("Contact")')
|
||||
await page.click('.antiNav-element:has-text("Company")')
|
||||
await page.click('button:has-text("Company")')
|
||||
await page.click('[placeholder="Company name"]')
|
||||
const orgId = 'Company-' + generateId()
|
||||
|
@ -47,7 +47,8 @@ test.describe('workbench tests', () => {
|
||||
await expect(page.locator('.textInput')).toBeVisible()
|
||||
|
||||
await page.click('[id="app-contact\\:string\\:Contacts"]')
|
||||
await expect(page).toHaveURL(`${PlatformURI}/workbench/sanity-ws/contact`)
|
||||
await page.click('.antiNav-element:has-text("Employee")')
|
||||
await expect(page).toHaveURL(`${PlatformURI}/workbench/sanity-ws/contact/employees`)
|
||||
// Click text=John Appleseed
|
||||
await expect(page.locator('text=Appleseed John')).toBeVisible()
|
||||
})
|
||||
|
Loading…
Reference in New Issue
Block a user