mirror of
https://github.com/hcengineering/platform.git
synced 2024-12-22 11:01:54 +03:00
UBER-629 Fix Kick Employee action (#3523)
Signed-off-by: Alexander Onnikov <alexander.onnikov@xored.com>
This commit is contained in:
parent
3058d902fc
commit
1260c8770c
@ -1,5 +1,6 @@
|
|||||||
//
|
//
|
||||||
// Copyright © 2020, 2021 Anticrm Platform Contributors.
|
// Copyright © 2020, 2021 Anticrm Platform Contributors.
|
||||||
|
// Copyright © 2023 Hardcore Engineering Inc.
|
||||||
//
|
//
|
||||||
// Licensed under the Eclipse Public License, Version 2.0 (the "License");
|
// 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
|
// you may not use this file except in compliance with the License. You may
|
||||||
@ -764,7 +765,7 @@ export function createModel (builder: Builder): void {
|
|||||||
},
|
},
|
||||||
secured: true
|
secured: true
|
||||||
},
|
},
|
||||||
contact.action.KickEmployee
|
contact.action.DeleteEmployee
|
||||||
)
|
)
|
||||||
|
|
||||||
createAction(
|
createAction(
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
//
|
//
|
||||||
// Copyright © 2020 Anticrm Platform Contributors.
|
// Copyright © 2020 Anticrm Platform Contributors.
|
||||||
|
// Copyright © 2023 Hardcore Engineering Inc.
|
||||||
//
|
//
|
||||||
// Licensed under the Eclipse Public License, Version 2.0 (the "License");
|
// 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
|
// you may not use this file except in compliance with the License. You may
|
||||||
@ -112,6 +113,7 @@ export default mergeIds(contactId, contact, {
|
|||||||
},
|
},
|
||||||
action: {
|
action: {
|
||||||
KickEmployee: '' as Ref<Action>,
|
KickEmployee: '' as Ref<Action>,
|
||||||
|
DeleteEmployee: '' as Ref<Action>,
|
||||||
MergeEmployee: '' as Ref<Action>
|
MergeEmployee: '' as Ref<Action>
|
||||||
},
|
},
|
||||||
actionImpl: {
|
actionImpl: {
|
||||||
|
@ -28,7 +28,8 @@
|
|||||||
"Person": "Person",
|
"Person": "Person",
|
||||||
"Organization": "Company",
|
"Organization": "Company",
|
||||||
"Employee": "Employee",
|
"Employee": "Employee",
|
||||||
"DeleteEmployee": "Delete",
|
"DeleteEmployee": "Delete employee",
|
||||||
|
"DeleteEmployeeDescr": "Are you sure you want to delete the employee from the workspace?",
|
||||||
"Value": "Value",
|
"Value": "Value",
|
||||||
"FullDescription": "Full description",
|
"FullDescription": "Full description",
|
||||||
"Phone": "Phone",
|
"Phone": "Phone",
|
||||||
@ -61,7 +62,7 @@
|
|||||||
"Members": "Members",
|
"Members": "Members",
|
||||||
"NoMembers": "No members added",
|
"NoMembers": "No members added",
|
||||||
"AddMember": "Add member",
|
"AddMember": "Add member",
|
||||||
"KickEmployee": "Kick an employee",
|
"KickEmployee": "Kick employee",
|
||||||
"KickEmployeeDescr": "Are you sure you want to kick the employee out of the workspace? This action cannot be undone",
|
"KickEmployeeDescr": "Are you sure you want to kick the employee out of the workspace? This action cannot be undone",
|
||||||
"Email": "Email",
|
"Email": "Email",
|
||||||
"CreateEmployee": "Employee",
|
"CreateEmployee": "Employee",
|
||||||
@ -70,7 +71,7 @@
|
|||||||
"UseImage": "Attached photo",
|
"UseImage": "Attached photo",
|
||||||
"UseGravatar": "Gravatar",
|
"UseGravatar": "Gravatar",
|
||||||
"UseColor": "Color",
|
"UseColor": "Color",
|
||||||
"NotSpecified": "Not specified",
|
"NotSpecified": "Not specified",
|
||||||
"Whatsapp": "Whatsapp",
|
"Whatsapp": "Whatsapp",
|
||||||
"WhatsappPlaceholder": "Whatsapp",
|
"WhatsappPlaceholder": "Whatsapp",
|
||||||
"Skype": "Skype",
|
"Skype": "Skype",
|
||||||
|
@ -29,6 +29,7 @@
|
|||||||
"Organization": "Компания",
|
"Organization": "Компания",
|
||||||
"Employee": "Сотрудник",
|
"Employee": "Сотрудник",
|
||||||
"DeleteEmployee": "Удалить",
|
"DeleteEmployee": "Удалить",
|
||||||
|
"DeleteEmployeeDescr": "Вы действительно хотите удалить сотрудника из рабочего пространства?",
|
||||||
"Value": "Значение",
|
"Value": "Значение",
|
||||||
"FullDescription": "Полное описание",
|
"FullDescription": "Полное описание",
|
||||||
"Phone": "Телефон",
|
"Phone": "Телефон",
|
||||||
|
@ -218,7 +218,7 @@ async function kickEmployee (doc: Employee): Promise<void> {
|
|||||||
MessageBox,
|
MessageBox,
|
||||||
{
|
{
|
||||||
label: contact.string.DeleteEmployee,
|
label: contact.string.DeleteEmployee,
|
||||||
message: contact.string.DeleteEmployee
|
message: contact.string.DeleteEmployeeDescr
|
||||||
},
|
},
|
||||||
undefined,
|
undefined,
|
||||||
(res?: boolean) => {
|
(res?: boolean) => {
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
//
|
//
|
||||||
// Copyright © 2020, 2021 Anticrm Platform Contributors.
|
// Copyright © 2020, 2021 Anticrm Platform Contributors.
|
||||||
// Copyright © 2021 Hardcore Engineering Inc.
|
// Copyright © 2021, 2023 Hardcore Engineering Inc.
|
||||||
//
|
//
|
||||||
// Licensed under the Eclipse Public License, Version 2.0 (the "License");
|
// 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
|
// you may not use this file except in compliance with the License. You may
|
||||||
@ -77,6 +77,7 @@ export default mergeIds(contactId, contact, {
|
|||||||
CategoryComponentLead: '' as IntlString,
|
CategoryComponentLead: '' as IntlString,
|
||||||
CategoryOther: '' as IntlString,
|
CategoryOther: '' as IntlString,
|
||||||
DeleteEmployee: '' as IntlString,
|
DeleteEmployee: '' as IntlString,
|
||||||
|
DeleteEmployeeDescr: '' as IntlString,
|
||||||
HasMessagesIn: '' as IntlString,
|
HasMessagesIn: '' as IntlString,
|
||||||
HasNewMessagesIn: '' as IntlString
|
HasNewMessagesIn: '' as IntlString
|
||||||
},
|
},
|
||||||
|
@ -6,10 +6,12 @@ docker-compose -p sanity up -d --force-recreate --renew-anon-volumes
|
|||||||
|
|
||||||
./wait-elastic.sh 9201
|
./wait-elastic.sh 9201
|
||||||
|
|
||||||
# Creae workspace record in accounts
|
# Create workspace record in accounts
|
||||||
./tool.sh create-workspace sanity-ws -o SanityTest
|
./tool.sh create-workspace sanity-ws -o SanityTest
|
||||||
# Create user record in accounts
|
# Create user record in accounts
|
||||||
./tool.sh create-account user1 -f John -l Appleseed -p 1234
|
./tool.sh create-account user1 -f John -l Appleseed -p 1234
|
||||||
|
# Make user the workspace maintainer
|
||||||
|
./tool.sh set-user-role user1 sanity-ws 1
|
||||||
./tool.sh confirm-email user1
|
./tool.sh confirm-email user1
|
||||||
|
|
||||||
./restore-workspace.sh
|
./restore-workspace.sh
|
@ -88,15 +88,70 @@ test.describe('contact tests', () => {
|
|||||||
await page.locator('.antiCard button:has-text("Create")').click()
|
await page.locator('.antiCard button:has-text("Create")').click()
|
||||||
await page.waitForSelector('form.antiCard', { state: 'detached' })
|
await page.waitForSelector('form.antiCard', { state: 'detached' })
|
||||||
|
|
||||||
|
await expect(page.locator(`td:has-text("${last} ${first}")`)).toHaveCount(1)
|
||||||
|
|
||||||
// Click #context-menu svg
|
// Click #context-menu svg
|
||||||
await page.hover(`td:has-text("${last} ${first}")`)
|
await page.hover(`td:has-text("${last} ${first}")`)
|
||||||
await page.click(`td:has-text("${last} ${first}")`, {
|
await page.click(`td:has-text("${last} ${first}")`, {
|
||||||
button: 'right'
|
button: 'right'
|
||||||
})
|
})
|
||||||
await page.click('text="Delete"')
|
await page.click('text="Delete"')
|
||||||
// Click text=Ok
|
// Click text=Yes
|
||||||
await page.click('text=Yes')
|
await page.click('text=Yes')
|
||||||
|
|
||||||
await expect(page.locator(`td:has-text("${first} ${last}")`)).toHaveCount(0)
|
await expect(page.locator(`td:has-text("${last} ${first}")`)).toHaveCount(0)
|
||||||
|
})
|
||||||
|
|
||||||
|
test('kick-and-delete-employee', async ({ page }) => {
|
||||||
|
// Create a new context with the saved storage state.
|
||||||
|
await page.locator('[id="app-contact\\:string\\:Contacts"]').click()
|
||||||
|
|
||||||
|
// Create employee
|
||||||
|
await page.click('.antiNav-element:has-text("Employee")')
|
||||||
|
await page.click('button:has-text("Employee")')
|
||||||
|
|
||||||
|
const first = 'Elton-' + generateId(5)
|
||||||
|
const last = 'John-' + generateId(5)
|
||||||
|
const mail = 'eltonjohn@' + generateId(5)
|
||||||
|
|
||||||
|
const firstName = page.locator('[placeholder="First name"]')
|
||||||
|
await firstName.click()
|
||||||
|
await firstName.fill(first)
|
||||||
|
|
||||||
|
const lastName = page.locator('[placeholder="Last name"]')
|
||||||
|
await lastName.click()
|
||||||
|
await lastName.fill(last)
|
||||||
|
|
||||||
|
const email = page.locator('[placeholder="Email"]')
|
||||||
|
await email.click()
|
||||||
|
await email.fill(mail)
|
||||||
|
|
||||||
|
await page.locator('.antiCard button:has-text("Create")').click()
|
||||||
|
await page.waitForSelector('form.antiCard', { state: 'detached' })
|
||||||
|
|
||||||
|
// Kick employee
|
||||||
|
|
||||||
|
// Click #context-menu svg
|
||||||
|
await page.hover(`td:has-text("${last} ${first}")`)
|
||||||
|
await page.click(`td:has-text("${last} ${first}")`, { button: 'right' })
|
||||||
|
await page.click('text="Kick employee"')
|
||||||
|
// Click text=Ok
|
||||||
|
await page.click('text=Ok')
|
||||||
|
|
||||||
|
await expect(page.locator(`td:has-text("${last} ${first}")`)).toHaveCount(1)
|
||||||
|
|
||||||
|
// We need some time to ensure that the status is proper one
|
||||||
|
await page.waitForTimeout(1000)
|
||||||
|
|
||||||
|
// Delete employee
|
||||||
|
|
||||||
|
// Click #context-menu svg
|
||||||
|
await page.hover(`td:has-text("${last} ${first}")`)
|
||||||
|
await page.click(`td:has-text("${last} ${first}")`, { button: 'right' })
|
||||||
|
await page.click('text="Delete employee"')
|
||||||
|
// Click text=Ok
|
||||||
|
await page.click('text=Ok')
|
||||||
|
|
||||||
|
await expect(page.locator(`td:has-text("${last} ${first}")`)).toHaveCount(0)
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
Loading…
Reference in New Issue
Block a user