mirror of
https://github.com/hcengineering/platform.git
synced 2025-04-27 10:49:44 +00:00
[TSK-223] Workbench: App alias (Part 1) (#2162)
Signed-off-by: Anna <anna.no@xored.com>
This commit is contained in:
parent
ea54231b8e
commit
3b25cc2b83
@ -14,6 +14,9 @@ HR:
|
||||
Tracker:
|
||||
- Manual issues ordering
|
||||
|
||||
Workbench
|
||||
- Use application aliases in URL
|
||||
|
||||
## 0.6.29
|
||||
|
||||
Platform:
|
||||
|
@ -15,7 +15,7 @@
|
||||
|
||||
// To help typescript locate view plugin properly
|
||||
import automation, { AutomationSupport } from '@anticrm/automation'
|
||||
import type { Board, Card, MenuPage, CommonBoardPreference, CardCover } from '@anticrm/board'
|
||||
import { Board, Card, MenuPage, CommonBoardPreference, CardCover, boardId } from '@anticrm/board'
|
||||
import type { Employee } from '@anticrm/contact'
|
||||
import { Class, DOMAIN_MODEL, IndexKind, Markup, Ref, Type } from '@anticrm/core'
|
||||
import {
|
||||
@ -140,6 +140,7 @@ export function createModel (builder: Builder): void {
|
||||
{
|
||||
label: board.string.BoardApplication,
|
||||
icon: board.icon.Board,
|
||||
alias: boardId,
|
||||
hidden: false,
|
||||
navigatorModel: {
|
||||
spaces: [
|
||||
|
@ -14,7 +14,7 @@
|
||||
//
|
||||
|
||||
import activity from '@anticrm/activity'
|
||||
import { Calendar, Event, Reminder } from '@anticrm/calendar'
|
||||
import { calendarId, Calendar, Event, Reminder } from '@anticrm/calendar'
|
||||
import { Employee } from '@anticrm/contact'
|
||||
import type { Domain, Markup, Ref, Timestamp } from '@anticrm/core'
|
||||
import { IndexKind } from '@anticrm/core'
|
||||
@ -104,6 +104,7 @@ export function createModel (builder: Builder): void {
|
||||
{
|
||||
label: calendar.string.ApplicationLabelCalendar,
|
||||
icon: calendar.icon.Calendar,
|
||||
alias: calendarId,
|
||||
hidden: false,
|
||||
component: calendar.component.Events
|
||||
},
|
||||
|
@ -14,9 +14,10 @@
|
||||
//
|
||||
|
||||
import activity from '@anticrm/activity'
|
||||
import type {
|
||||
import {
|
||||
Backlink,
|
||||
Channel,
|
||||
chunterId,
|
||||
ChunterMessage,
|
||||
ChunterSpace,
|
||||
Comment,
|
||||
@ -324,6 +325,7 @@ export function createModel (builder: Builder): void {
|
||||
{
|
||||
label: chunter.string.ApplicationLabelChunter,
|
||||
icon: chunter.icon.Chunter,
|
||||
alias: chunterId,
|
||||
hidden: false,
|
||||
navigatorModel: {
|
||||
specials: [
|
||||
|
@ -13,10 +13,11 @@
|
||||
// limitations under the License.
|
||||
//
|
||||
|
||||
import type {
|
||||
import {
|
||||
Channel,
|
||||
ChannelProvider,
|
||||
Contact,
|
||||
contactId,
|
||||
Employee,
|
||||
EmployeeAccount,
|
||||
Member,
|
||||
@ -170,6 +171,7 @@ export function createModel (builder: Builder): void {
|
||||
{
|
||||
label: contact.string.Contacts,
|
||||
icon: contact.icon.ContactApplication,
|
||||
alias: contactId,
|
||||
hidden: false,
|
||||
component: contact.component.Contacts
|
||||
},
|
||||
|
@ -15,7 +15,7 @@
|
||||
|
||||
import { Employee } from '@anticrm/contact'
|
||||
import { Arr, Class, Domain, DOMAIN_MODEL, IndexKind, Markup, Ref, Timestamp } from '@anticrm/core'
|
||||
import type { Department, DepartmentMember, Request, RequestType, Staff } from '@anticrm/hr'
|
||||
import { Department, DepartmentMember, hrId, Request, RequestType, Staff } from '@anticrm/hr'
|
||||
import {
|
||||
ArrOf,
|
||||
Builder,
|
||||
@ -139,6 +139,7 @@ export function createModel (builder: Builder): void {
|
||||
{
|
||||
label: hr.string.HRApplication,
|
||||
icon: hr.icon.HR,
|
||||
alias: hrId,
|
||||
hidden: false,
|
||||
navigatorModel: {
|
||||
specials: [
|
||||
|
@ -14,7 +14,7 @@
|
||||
//
|
||||
|
||||
import { Domain, IndexKind, Ref } from '@anticrm/core'
|
||||
import type { Category, Product, Variant } from '@anticrm/inventory'
|
||||
import { Category, inventoryId, Product, Variant } from '@anticrm/inventory'
|
||||
import { Builder, Collection, Index, Model, Prop, TypeRef, TypeString, UX } from '@anticrm/model'
|
||||
import attachment from '@anticrm/model-attachment'
|
||||
import core, { TAttachedDoc } from '@anticrm/model-core'
|
||||
@ -114,6 +114,7 @@ export function createModel (builder: Builder): void {
|
||||
{
|
||||
label: inventory.string.Inventory,
|
||||
icon: inventory.icon.InventoryApplication,
|
||||
alias: inventoryId,
|
||||
hidden: false,
|
||||
navigatorModel: {
|
||||
specials: [
|
||||
|
@ -16,7 +16,7 @@
|
||||
// To help typescript locate view plugin properly
|
||||
import type { Employee } from '@anticrm/contact'
|
||||
import { Class, Doc, FindOptions, IndexKind, Ref } from '@anticrm/core'
|
||||
import type { Customer, Funnel, Lead } from '@anticrm/lead'
|
||||
import { Customer, Funnel, Lead, leadId } from '@anticrm/lead'
|
||||
import { Builder, Collection, Index, Mixin, Model, Prop, TypeRef, TypeString, TypeMarkup, UX } from '@anticrm/model'
|
||||
import attachment from '@anticrm/model-attachment'
|
||||
import chunter from '@anticrm/model-chunter'
|
||||
@ -24,7 +24,7 @@ import contact, { TContact } from '@anticrm/model-contact'
|
||||
import core from '@anticrm/model-core'
|
||||
import task, { actionTemplates, TSpaceWithStates, TTask } from '@anticrm/model-task'
|
||||
import view, { createAction, actionTemplates as viewTemplates } from '@anticrm/model-view'
|
||||
import workbench, { Application } from '@anticrm/model-workbench'
|
||||
import workbench from '@anticrm/model-workbench'
|
||||
import setting from '@anticrm/setting'
|
||||
import lead from './plugin'
|
||||
|
||||
@ -101,6 +101,7 @@ export function createModel (builder: Builder): void {
|
||||
{
|
||||
label: lead.string.LeadApplication,
|
||||
icon: lead.icon.LeadApplication,
|
||||
alias: leadId,
|
||||
hidden: false,
|
||||
navigatorModel: {
|
||||
specials: [
|
||||
@ -262,7 +263,7 @@ export function createModel (builder: Builder): void {
|
||||
action: workbench.actionImpl.Navigate,
|
||||
actionProps: {
|
||||
mode: 'app',
|
||||
application: lead.app.Lead as Ref<Application>
|
||||
application: leadId
|
||||
},
|
||||
label: lead.string.GotoLeadApplication,
|
||||
icon: view.icon.ArrowRight,
|
||||
|
@ -40,7 +40,7 @@ import task, { TSpaceWithStates, TTask, actionTemplates } from '@anticrm/model-t
|
||||
import view, { createAction, actionTemplates as viewTemplates } from '@anticrm/model-view'
|
||||
import workbench, { Application, createNavigateAction } from '@anticrm/model-workbench'
|
||||
import { IntlString } from '@anticrm/platform'
|
||||
import { Applicant, Candidate, Candidates, Vacancy } from '@anticrm/recruit'
|
||||
import { Applicant, Candidate, Candidates, recruitId, Vacancy } from '@anticrm/recruit'
|
||||
import { KeyBinding } from '@anticrm/view'
|
||||
import setting from '@anticrm/setting'
|
||||
import recruit from './plugin'
|
||||
@ -161,6 +161,7 @@ export function createModel (builder: Builder): void {
|
||||
{
|
||||
label: recruit.string.RecruitApplication,
|
||||
icon: recruit.icon.RecruitApplication,
|
||||
alias: recruitId,
|
||||
hidden: false,
|
||||
navigatorModel: {
|
||||
spaces: [],
|
||||
@ -571,8 +572,8 @@ export function createModel (builder: Builder): void {
|
||||
})
|
||||
|
||||
function createGotoSpecialAction (builder: Builder, id: string, key: KeyBinding, label: IntlString): void {
|
||||
createNavigateAction(builder, key, label, {
|
||||
application: recruit.app.Recruit as Ref<Application>,
|
||||
createNavigateAction(builder, key, label, recruit.app.Recruit as Ref<Application>, {
|
||||
application: recruitId,
|
||||
mode: 'special',
|
||||
special: id
|
||||
})
|
||||
@ -588,7 +589,7 @@ export function createModel (builder: Builder): void {
|
||||
action: workbench.actionImpl.Navigate,
|
||||
actionProps: {
|
||||
mode: 'app',
|
||||
application: recruit.app.Recruit as Ref<Application>,
|
||||
application: recruitId,
|
||||
special: talentsId
|
||||
},
|
||||
label: recruit.string.GotoRecruitApplication,
|
||||
|
@ -17,7 +17,7 @@ import { Builder, Mixin, Model } from '@anticrm/model'
|
||||
import { Ref, Domain, DOMAIN_MODEL } from '@anticrm/core'
|
||||
import core, { TClass, TDoc } from '@anticrm/model-core'
|
||||
import setting from './plugin'
|
||||
import type { Editable, Integration, IntegrationType, Handler, SettingsCategory } from '@anticrm/setting'
|
||||
import { Editable, Integration, IntegrationType, Handler, SettingsCategory, settingId } from '@anticrm/setting'
|
||||
import type { Asset, IntlString } from '@anticrm/platform'
|
||||
import task from '@anticrm/task'
|
||||
import activity from '@anticrm/activity'
|
||||
@ -186,6 +186,7 @@ export function createModel (builder: Builder): void {
|
||||
{
|
||||
label: setting.string.Setting,
|
||||
icon: setting.icon.Setting,
|
||||
alias: settingId,
|
||||
hidden: true,
|
||||
component: setting.component.Settings
|
||||
},
|
||||
|
@ -49,7 +49,8 @@ import {
|
||||
IssueStatusCategory,
|
||||
Project,
|
||||
ProjectStatus,
|
||||
Team
|
||||
Team,
|
||||
trackerId
|
||||
} from '@anticrm/tracker'
|
||||
import { KeyBinding } from '@anticrm/view'
|
||||
import tags from '@anticrm/tags'
|
||||
@ -450,6 +451,7 @@ export function createModel (builder: Builder): void {
|
||||
{
|
||||
label: tracker.string.TrackerApplication,
|
||||
icon: tracker.icon.TrackerApplication,
|
||||
alias: trackerId,
|
||||
hidden: false,
|
||||
navigatorModel: {
|
||||
specials: [
|
||||
@ -527,8 +529,8 @@ export function createModel (builder: Builder): void {
|
||||
)
|
||||
|
||||
function createGotoSpecialAction (builder: Builder, id: string, key: KeyBinding, label: IntlString): void {
|
||||
createNavigateAction(builder, key, label, {
|
||||
application: tracker.app.Tracker,
|
||||
createNavigateAction(builder, key, label, tracker.app.Tracker, {
|
||||
application: trackerId,
|
||||
mode: 'space',
|
||||
spaceSpecial: id,
|
||||
spaceClass: tracker.class.Team
|
||||
@ -545,7 +547,7 @@ export function createModel (builder: Builder): void {
|
||||
action: workbench.actionImpl.Navigate,
|
||||
actionProps: {
|
||||
mode: 'app',
|
||||
application: tracker.app.Tracker
|
||||
application: trackerId
|
||||
},
|
||||
label: tracker.string.GotoTrackerApplication,
|
||||
icon: view.icon.ArrowRight,
|
||||
|
@ -30,6 +30,7 @@ export { Application }
|
||||
export class TApplication extends TDoc implements Application {
|
||||
label!: IntlString
|
||||
icon!: Asset
|
||||
alias!: string
|
||||
hidden!: boolean
|
||||
}
|
||||
|
||||
@ -51,9 +52,10 @@ export function createNavigateAction (
|
||||
builder: Builder,
|
||||
key: KeyBinding,
|
||||
label: IntlString,
|
||||
config: {
|
||||
application: Ref<Application>,
|
||||
props: {
|
||||
mode: 'app' | 'special' | 'space'
|
||||
application: Ref<Application>
|
||||
application?: string
|
||||
special?: string
|
||||
space?: Ref<Space>
|
||||
spaceClass?: Ref<Class<Space>>
|
||||
@ -62,7 +64,7 @@ export function createNavigateAction (
|
||||
): void {
|
||||
createAction(builder, {
|
||||
action: workbench.actionImpl.Navigate,
|
||||
actionProps: config,
|
||||
actionProps: props,
|
||||
label,
|
||||
icon: view.icon.ArrowRight,
|
||||
keyBinding: [key],
|
||||
@ -71,7 +73,7 @@ export function createNavigateAction (
|
||||
target: core.class.Doc,
|
||||
context: {
|
||||
mode: ['workbench', 'browser', 'editor', 'panel', 'popup'],
|
||||
application: config.application
|
||||
application
|
||||
}
|
||||
})
|
||||
}
|
||||
|
@ -1,4 +1,4 @@
|
||||
import { ChunterMessage } from '@anticrm/chunter'
|
||||
import { chunterId, ChunterMessage } from '@anticrm/chunter'
|
||||
import contact, { EmployeeAccount, formatName } from '@anticrm/contact'
|
||||
import { Account, Class, Client, Obj, Ref, Space, getCurrentAccount, Timestamp } from '@anticrm/core'
|
||||
import { Asset } from '@anticrm/platform'
|
||||
@ -58,7 +58,7 @@ export async function getDmName (client: Client, dm: Space): Promise<string> {
|
||||
export function getSpaceLink (id: Ref<Space>): string {
|
||||
const loc = getCurrentLocation()
|
||||
|
||||
loc.path[1] = chunter.app.Chunter
|
||||
loc.path[1] = chunterId
|
||||
loc.path[2] = id
|
||||
loc.path.length = 3
|
||||
loc.fragment = undefined
|
||||
|
@ -28,6 +28,7 @@ import core, {
|
||||
TxResult,
|
||||
WithLookup
|
||||
} from '@anticrm/core'
|
||||
import { devModelId } from '@anticrm/devmodel'
|
||||
import { Builder } from '@anticrm/model'
|
||||
import { getMetadata, IntlString, Resources } from '@anticrm/platform'
|
||||
import view from '@anticrm/view'
|
||||
@ -155,6 +156,7 @@ export async function Hook (client: Client): Promise<Client> {
|
||||
{
|
||||
label: 'DevModel' as IntlString,
|
||||
icon: view.icon.Model,
|
||||
alias: devModelId,
|
||||
hidden: false,
|
||||
navigatorModel: {
|
||||
spaces: [],
|
||||
|
@ -17,7 +17,7 @@
|
||||
import { getCurrentAccount } from '@anticrm/core'
|
||||
import login from '@anticrm/login'
|
||||
import { Avatar, createQuery } from '@anticrm/presentation'
|
||||
import setting, { SettingsCategory } from '@anticrm/setting'
|
||||
import setting, { SettingsCategory, settingId } from '@anticrm/setting'
|
||||
import { closePopup, getCurrentLocation, Icon, Label, navigate, setMetadataLocalStorage } from '@anticrm/ui'
|
||||
|
||||
// const client = getClient()
|
||||
@ -43,7 +43,7 @@
|
||||
function selectCategory (sp: SettingsCategory): void {
|
||||
closePopup()
|
||||
const loc = getCurrentLocation()
|
||||
loc.path[1] = setting.ids.SettingApp
|
||||
loc.path[1] = settingId
|
||||
loc.path[2] = sp.name
|
||||
loc.path.length = 3
|
||||
navigate(loc)
|
||||
|
@ -15,7 +15,7 @@
|
||||
<script lang="ts">
|
||||
import { Class, Doc, Ref } from '@anticrm/core'
|
||||
import { AttributesBar, getClient, KeyedAttribute } from '@anticrm/presentation'
|
||||
import setting from '@anticrm/setting'
|
||||
import setting, { settingId } from '@anticrm/setting'
|
||||
import { Button, getCurrentLocation, Label, navigate, Tooltip } from '@anticrm/ui'
|
||||
import { getFiltredKeys, isCollectionAttr } from '../utils'
|
||||
|
||||
@ -65,7 +65,7 @@
|
||||
on:click={(ev) => {
|
||||
ev.stopPropagation()
|
||||
const loc = getCurrentLocation()
|
||||
loc.path[1] = setting.ids.SettingApp
|
||||
loc.path[1] = settingId
|
||||
loc.path[2] = 'classes'
|
||||
loc.path.length = 3
|
||||
loc.query = { _class }
|
||||
|
@ -17,7 +17,7 @@
|
||||
import { getCurrentAccount } from '@anticrm/core'
|
||||
import login from '@anticrm/login'
|
||||
import { Avatar, createQuery, getClient } from '@anticrm/presentation'
|
||||
import setting, { SettingsCategory } from '@anticrm/setting'
|
||||
import setting, { SettingsCategory, settingId } from '@anticrm/setting'
|
||||
import {
|
||||
closePanel,
|
||||
closePopup,
|
||||
@ -57,7 +57,7 @@
|
||||
closePopup()
|
||||
closePanel()
|
||||
const loc = getCurrentLocation()
|
||||
loc.path[1] = setting.ids.SettingApp
|
||||
loc.path[1] = settingId
|
||||
loc.path[2] = sp.name
|
||||
loc.path.length = 3
|
||||
navigate(loc)
|
||||
@ -91,7 +91,7 @@
|
||||
|
||||
function getURLCategory (sp: SettingsCategory): string {
|
||||
const loc = getCurrentLocation()
|
||||
loc.path[1] = setting.ids.SettingApp
|
||||
loc.path[1] = settingId
|
||||
loc.path[2] = sp.name
|
||||
loc.path.length = 3
|
||||
return locationToUrl(loc)
|
||||
|
@ -59,7 +59,7 @@
|
||||
setClient(client)
|
||||
NotificationClientImpl.getClient()
|
||||
|
||||
let currentApp: Ref<Application> | undefined
|
||||
let currentAppAlias: string | undefined
|
||||
let currentSpace: Ref<Space> | undefined
|
||||
let currentSpecial: string | undefined
|
||||
let specialComponent: SpecialNavModel | undefined
|
||||
@ -158,14 +158,14 @@
|
||||
}
|
||||
|
||||
async function syncLoc (loc: Location): Promise<void> {
|
||||
const app = loc.path.length > 1 ? (loc.path[1] as Ref<Application>) : undefined
|
||||
const app = loc.path.length > 1 ? loc.path[1] : undefined
|
||||
const space = loc.path.length > 2 ? (loc.path[2] as Ref<Space>) : undefined
|
||||
const special = loc.path.length > 3 ? loc.path[3] : undefined
|
||||
|
||||
if (currentApp !== app) {
|
||||
if (currentAppAlias !== app) {
|
||||
clear(1)
|
||||
currentApp = app
|
||||
currentApplication = await client.findOne(workbench.class.Application, { _id: currentApp })
|
||||
currentAppAlias = app
|
||||
currentApplication = await client.findOne(workbench.class.Application, { alias: app })
|
||||
navigatorModel = currentApplication?.navigatorModel
|
||||
}
|
||||
|
||||
@ -206,7 +206,7 @@
|
||||
function clear (level: number): void {
|
||||
switch (level) {
|
||||
case 1:
|
||||
currentApp = undefined
|
||||
currentAppAlias = undefined
|
||||
currentApplication = undefined
|
||||
navigatorModel = undefined
|
||||
// eslint-disable-next-line no-fallthrough
|
||||
@ -227,7 +227,7 @@
|
||||
}
|
||||
|
||||
function navigateApp (app: Application): void {
|
||||
if (currentApp === app._id) {
|
||||
if (currentAppAlias === app.alias) {
|
||||
// Nothing to do.
|
||||
return
|
||||
}
|
||||
@ -235,7 +235,7 @@
|
||||
|
||||
doNavigate([], undefined, {
|
||||
mode: 'app',
|
||||
application: app._id
|
||||
application: app.alias
|
||||
})
|
||||
}
|
||||
|
||||
@ -395,7 +395,7 @@
|
||||
</div>
|
||||
<Applications
|
||||
{apps}
|
||||
active={currentApp}
|
||||
active={currentApplication?._id}
|
||||
on:active={(evt) => {
|
||||
navigateApp(evt.detail)
|
||||
}}
|
||||
|
@ -18,7 +18,7 @@ import type { Class, Client, Doc, Obj, Ref, Space } from '@anticrm/core'
|
||||
import core from '@anticrm/core'
|
||||
import type { Asset } from '@anticrm/platform'
|
||||
import { getResource } from '@anticrm/platform'
|
||||
import { Application, NavigatorModel } from '@anticrm/workbench'
|
||||
import { NavigatorModel } from '@anticrm/workbench'
|
||||
import view from '@anticrm/view'
|
||||
import { closePanel, getCurrentLocation, navigate } from '@anticrm/ui'
|
||||
import { getClient } from '@anticrm/presentation'
|
||||
@ -57,7 +57,7 @@ export async function doNavigate (
|
||||
evt: Event | undefined,
|
||||
props: {
|
||||
mode: 'app' | 'special' | 'space'
|
||||
application?: Ref<Application>
|
||||
application?: string
|
||||
special?: string
|
||||
spaceSpecial?: string
|
||||
space?: Ref<Space>
|
||||
|
@ -24,6 +24,7 @@ import { ViewAction } from '@anticrm/view'
|
||||
*/
|
||||
export interface Application extends Doc {
|
||||
label: IntlString
|
||||
alias: string
|
||||
icon: Asset
|
||||
hidden: boolean
|
||||
navigatorModel?: NavigatorModel
|
||||
@ -119,7 +120,7 @@ export default plugin(workbenchId, {
|
||||
actionImpl: {
|
||||
Navigate: '' as ViewAction<{
|
||||
mode: 'app' | 'special' | 'space'
|
||||
application?: Ref<Application>
|
||||
application?: string
|
||||
special?: string
|
||||
space?: Ref<Space>
|
||||
// If no space is selected, select first space from list
|
||||
|
@ -14,7 +14,7 @@ test.describe('actions tests', () => {
|
||||
await page.click('[id="app-recruit\\:string\\:RecruitApplication"]')
|
||||
|
||||
await page.click('text=Talents')
|
||||
await expect(page).toHaveURL(`${PlatformURI}/workbench%3Acomponent%3AWorkbenchApp/recruit%3Aapp%3ARecruit/talents`)
|
||||
await expect(page).toHaveURL(`${PlatformURI}/workbench%3Acomponent%3AWorkbenchApp/recruit/talents`)
|
||||
|
||||
await page.click('td:has-text("Frontend Engineer")')
|
||||
|
||||
@ -29,30 +29,26 @@ test.describe('actions tests', () => {
|
||||
await page.click('[id="app-recruit\\:string\\:RecruitApplication"]')
|
||||
|
||||
await page.click('text=Talents')
|
||||
await expect(page).toHaveURL(`${PlatformURI}/workbench%3Acomponent%3AWorkbenchApp/recruit%3Aapp%3ARecruit/talents`)
|
||||
await expect(page).toHaveURL(`${PlatformURI}/workbench%3Acomponent%3AWorkbenchApp/recruit/talents`)
|
||||
|
||||
await page.press('body', 'Meta+k')
|
||||
await page.fill('[placeholder="type\\ to\\ filter\\.\\.\\."]', 'go to')
|
||||
expect(await page.locator('div.selectPopup :text("Go To Vacancies")').count()).toBe(1)
|
||||
await page.click('div.selectPopup :text("Go To Vacancies")')
|
||||
|
||||
await expect(page).toHaveURL(
|
||||
`${PlatformURI}/workbench%3Acomponent%3AWorkbenchApp/recruit%3Aapp%3ARecruit/vacancies`
|
||||
)
|
||||
await expect(page).toHaveURL(`${PlatformURI}/workbench%3Acomponent%3AWorkbenchApp/recruit/vacancies`)
|
||||
})
|
||||
test('action-switch-applications', async ({ page }) => {
|
||||
await page.click('[id="app-recruit\\:string\\:RecruitApplication"]')
|
||||
|
||||
await page.click('text=Talents')
|
||||
await expect(page).toHaveURL(`${PlatformURI}/workbench%3Acomponent%3AWorkbenchApp/recruit%3Aapp%3ARecruit/talents`)
|
||||
await expect(page).toHaveURL(`${PlatformURI}/workbench%3Acomponent%3AWorkbenchApp/recruit/talents`)
|
||||
|
||||
await page.press('body', 'Meta+k')
|
||||
await page.fill('[placeholder="type\\ to\\ filter\\.\\.\\."]', 'go to')
|
||||
expect(await page.locator('div.selectPopup :text("Go To Applications")').count()).toBe(1)
|
||||
await page.click('div.selectPopup :text("Go To Applications")')
|
||||
|
||||
await expect(page).toHaveURL(
|
||||
`${PlatformURI}/workbench%3Acomponent%3AWorkbenchApp/recruit%3Aapp%3ARecruit/candidates`
|
||||
)
|
||||
await expect(page).toHaveURL(`${PlatformURI}/workbench%3Acomponent%3AWorkbenchApp/recruit/candidates`)
|
||||
})
|
||||
})
|
||||
|
@ -17,14 +17,10 @@ test.describe('contact tests', () => {
|
||||
await page.click('.antiPopup-submenu >> text=Settings')
|
||||
// Click button:has-text("Setting")
|
||||
await page.click('button:has-text("Setting")')
|
||||
await expect(page).toHaveURL(
|
||||
`${PlatformURI}/workbench%3Acomponent%3AWorkbenchApp/setting%3Aids%3ASettingApp/setting`
|
||||
)
|
||||
await expect(page).toHaveURL(`${PlatformURI}/workbench%3Acomponent%3AWorkbenchApp/setting/setting`)
|
||||
// Click text=Edit profile
|
||||
await page.click('text=Edit profile')
|
||||
await expect(page).toHaveURL(
|
||||
`${PlatformURI}/workbench%3Acomponent%3AWorkbenchApp/setting%3Aids%3ASettingApp/profile`
|
||||
)
|
||||
await expect(page).toHaveURL(`${PlatformURI}/workbench%3Acomponent%3AWorkbenchApp/setting/profile`)
|
||||
// Click [placeholder="Location"]
|
||||
await page.click('[placeholder="Location"]')
|
||||
// Fill [placeholder="Location"]
|
||||
@ -50,11 +46,9 @@ test.describe('contact tests', () => {
|
||||
await page.click('.antiPopup-submenu >> text=Settings')
|
||||
// Click button:has-text("Templates")
|
||||
await page.click('button:has-text("Templates")')
|
||||
await expect(page).toHaveURL(
|
||||
`${PlatformURI}/workbench%3Acomponent%3AWorkbenchApp/setting%3Aids%3ASettingApp/message-templates`
|
||||
)
|
||||
// Go to http://localhost:8083/workbench%3Acomponent%3AWorkbenchApp/setting%3Aids%3ASettingApp/message-templates
|
||||
await page.goto(`${PlatformURI}/workbench%3Acomponent%3AWorkbenchApp/setting%3Aids%3ASettingApp/message-templates`)
|
||||
await expect(page).toHaveURL(`${PlatformURI}/workbench%3Acomponent%3AWorkbenchApp/setting/message-templates`)
|
||||
// Go to http://localhost:8083/workbench%3Acomponent%3AWorkbenchApp/setting/message-templates
|
||||
await page.goto(`${PlatformURI}/workbench%3Acomponent%3AWorkbenchApp/setting/message-templates`)
|
||||
// Click .flex-center.icon-button
|
||||
await page.click('#create-template >> .flex-center.icon-button')
|
||||
// Click [placeholder="New\ template"]
|
||||
@ -85,9 +79,7 @@ test.describe('contact tests', () => {
|
||||
await page.click('.antiPopup-submenu >> text=Settings')
|
||||
// Click button:has-text("Manage Statuses")
|
||||
await page.click('button:has-text("Manage Statuses")')
|
||||
await expect(page).toHaveURL(
|
||||
`${PlatformURI}/workbench%3Acomponent%3AWorkbenchApp/setting%3Aids%3ASettingApp/statuses`
|
||||
)
|
||||
await expect(page).toHaveURL(`${PlatformURI}/workbench%3Acomponent%3AWorkbenchApp/setting/statuses`)
|
||||
// Click text=Vacancies
|
||||
await page.click('text=Vacancies')
|
||||
// Click #create-template div
|
||||
|
@ -15,10 +15,10 @@ test.describe('recruit tests', () => {
|
||||
await page.goto(`${PlatformURI}/workbench%3Acomponent%3AWorkbenchApp`)
|
||||
// Click [id="app-recruit\:string\:RecruitApplication"]
|
||||
await page.click('[id="app-recruit\\:string\\:RecruitApplication"]')
|
||||
await expect(page).toHaveURL(`${PlatformURI}/workbench%3Acomponent%3AWorkbenchApp/recruit%3Aapp%3ARecruit`)
|
||||
await expect(page).toHaveURL(`${PlatformURI}/workbench%3Acomponent%3AWorkbenchApp/recruit`)
|
||||
// Click text=Talents
|
||||
await page.click('text=Talents')
|
||||
await expect(page).toHaveURL(`${PlatformURI}/workbench%3Acomponent%3AWorkbenchApp/recruit%3Aapp%3ARecruit/talents`)
|
||||
await expect(page).toHaveURL(`${PlatformURI}/workbench%3Acomponent%3AWorkbenchApp/recruit/talents`)
|
||||
// Click button:has-text("Talent")
|
||||
await page.click('button:has-text("Talent")')
|
||||
// Fill [placeholder="John"]
|
||||
@ -50,10 +50,10 @@ test.describe('recruit tests', () => {
|
||||
await page.goto(`${PlatformURI}/workbench%3Acomponent%3AWorkbenchApp`)
|
||||
// Click [id="app-recruit\:string\:RecruitApplication"]
|
||||
await page.click('[id="app-recruit\\:string\\:RecruitApplication"]')
|
||||
await expect(page).toHaveURL(`${PlatformURI}/workbench%3Acomponent%3AWorkbenchApp/recruit%3Aapp%3ARecruit`)
|
||||
await expect(page).toHaveURL(`${PlatformURI}/workbench%3Acomponent%3AWorkbenchApp/recruit`)
|
||||
// Click text=Skills
|
||||
await page.click('text=Skills')
|
||||
await expect(page).toHaveURL(`${PlatformURI}/workbench%3Acomponent%3AWorkbenchApp/recruit%3Aapp%3ARecruit/skills`)
|
||||
await expect(page).toHaveURL(`${PlatformURI}/workbench%3Acomponent%3AWorkbenchApp/recruit/skills`)
|
||||
// Click button:has-text("Skill")
|
||||
await page.click('button:has-text("Skill")')
|
||||
// Click [placeholder="Please\ type\ skill\ title"]
|
||||
@ -76,7 +76,7 @@ test.describe('recruit tests', () => {
|
||||
await page.click('button:has-text("Create")')
|
||||
// Click text=Talents
|
||||
await page.click('text=Talents')
|
||||
await expect(page).toHaveURL(`${PlatformURI}/workbench%3Acomponent%3AWorkbenchApp/recruit%3Aapp%3ARecruit/talents`)
|
||||
await expect(page).toHaveURL(`${PlatformURI}/workbench%3Acomponent%3AWorkbenchApp/recruit/talents`)
|
||||
// Click button:has-text("Talent")
|
||||
await page.click('button:has-text("Talent")')
|
||||
// Click #add-tag div div
|
||||
|
@ -16,7 +16,7 @@ test.describe('project tests', () => {
|
||||
// Click text=Projects
|
||||
await page.click('text=Projects')
|
||||
await expect(page).toHaveURL(
|
||||
`${PlatformURI}/workbench%3Acomponent%3AWorkbenchApp/tracker%3Aapp%3ATracker/tracker%3Ateam%3ADefaultTeam/projects`
|
||||
`${PlatformURI}/workbench%3Acomponent%3AWorkbenchApp/tracker/tracker%3Ateam%3ADefaultTeam/projects`
|
||||
)
|
||||
await page.click('button:has-text("Project")')
|
||||
await page.click('[placeholder="Project\\ name"]')
|
||||
@ -39,7 +39,7 @@ test.describe('project tests', () => {
|
||||
await page.click('[id="app-tracker\\:string\\:TrackerApplication"]')
|
||||
await page.click('text=Projects')
|
||||
await expect(page).toHaveURL(
|
||||
`${PlatformURI}/workbench%3Acomponent%3AWorkbenchApp/tracker%3Aapp%3ATracker/tracker%3Ateam%3ADefaultTeam/projects`
|
||||
`${PlatformURI}/workbench%3Acomponent%3AWorkbenchApp/tracker/tracker%3Ateam%3ADefaultTeam/projects`
|
||||
)
|
||||
await page.click('button:has-text("Project")')
|
||||
const prjId = 'project-' + generateId()
|
||||
|
@ -7,7 +7,7 @@ test.use({
|
||||
async function navigate (page: Page): Promise<void> {
|
||||
await page.goto(`${PlatformURI}/workbench%3Acomponent%3AWorkbenchApp`)
|
||||
await page.click('[id="app-tracker\\:string\\:TrackerApplication"]')
|
||||
await expect(page).toHaveURL(`${PlatformURI}/workbench%3Acomponent%3AWorkbenchApp/tracker%3Aapp%3ATracker`)
|
||||
await expect(page).toHaveURL(`${PlatformURI}/workbench%3Acomponent%3AWorkbenchApp/tracker`)
|
||||
}
|
||||
|
||||
interface IssueProps {
|
||||
|
@ -12,27 +12,23 @@ test.describe('workbench tests', () => {
|
||||
test('navigator', async ({ page }) => {
|
||||
// Click [id="app-recruit\:string\:RecruitApplication"]
|
||||
await page.click('[id="app-recruit\\:string\\:RecruitApplication"]')
|
||||
await expect(page).toHaveURL(`${PlatformURI}/workbench%3Acomponent%3AWorkbenchApp/recruit%3Aapp%3ARecruit`)
|
||||
await expect(page).toHaveURL(`${PlatformURI}/workbench%3Acomponent%3AWorkbenchApp/recruit`)
|
||||
// Click text=Applications
|
||||
await page.click('text=Applications')
|
||||
await expect(page).toHaveURL(
|
||||
`${PlatformURI}/workbench%3Acomponent%3AWorkbenchApp/recruit%3Aapp%3ARecruit/candidates`
|
||||
)
|
||||
await expect(page).toHaveURL(`${PlatformURI}/workbench%3Acomponent%3AWorkbenchApp/recruit/candidates`)
|
||||
// Click text=Applications Application >> span
|
||||
await expect(page.locator('text=Applications Filter')).toBeVisible()
|
||||
await expect(page.locator('text="APP-1')).toBeDefined()
|
||||
|
||||
// Click text=Talents
|
||||
await page.click('text=Talents')
|
||||
await expect(page).toHaveURL(`${PlatformURI}/workbench%3Acomponent%3AWorkbenchApp/recruit%3Aapp%3ARecruit/talents`)
|
||||
await expect(page).toHaveURL(`${PlatformURI}/workbench%3Acomponent%3AWorkbenchApp/recruit/talents`)
|
||||
|
||||
await expect(page.locator('text=Andrey P.')).toBeVisible()
|
||||
|
||||
// Click text=Vacancies
|
||||
await page.click('text=Vacancies')
|
||||
await expect(page).toHaveURL(
|
||||
`${PlatformURI}/workbench%3Acomponent%3AWorkbenchApp/recruit%3Aapp%3ARecruit/vacancies`
|
||||
)
|
||||
await expect(page).toHaveURL(`${PlatformURI}/workbench%3Acomponent%3AWorkbenchApp/recruit/vacancies`)
|
||||
// Click text=Software Engineer
|
||||
await page.click('text=Software Engineer')
|
||||
await expect(page.locator('text=Software Engineer')).toBeVisible()
|
||||
@ -42,7 +38,7 @@ test.describe('workbench tests', () => {
|
||||
|
||||
// Click [id="app-chunter\:string\:ApplicationLabelChunter"]
|
||||
await page.click('[id="app-chunter\\:string\\:ApplicationLabelChunter"]')
|
||||
await expect(page).toHaveURL(`${PlatformURI}/workbench%3Acomponent%3AWorkbenchApp/chunter%3Aapp%3AChunter`)
|
||||
await expect(page).toHaveURL(`${PlatformURI}/workbench%3Acomponent%3AWorkbenchApp/chunter`)
|
||||
|
||||
await page.click('text=general')
|
||||
|
||||
@ -50,7 +46,7 @@ test.describe('workbench tests', () => {
|
||||
await expect(page.locator('.textInput')).toBeVisible()
|
||||
|
||||
await page.click('[id="app-contact\\:string\\:Contacts"]')
|
||||
await expect(page).toHaveURL(`${PlatformURI}/workbench%3Acomponent%3AWorkbenchApp/contact%3Aapp%3AContacts`)
|
||||
await expect(page).toHaveURL(`${PlatformURI}/workbench%3Acomponent%3AWorkbenchApp/contact`)
|
||||
// Click text=John Appleseed
|
||||
await expect(page.locator('text=John Appleseed')).toBeVisible()
|
||||
})
|
||||
@ -62,7 +58,7 @@ test.describe('workbench tests', () => {
|
||||
await page.click('.antiPopup-submenu >> text=Settings')
|
||||
// Click button:has-text("Terms")
|
||||
await page.click('button:has-text("Terms")')
|
||||
await expect(page).toHaveURL(`${PlatformURI}/workbench%3Acomponent%3AWorkbenchApp/setting%3Aids%3ASettingApp/terms`)
|
||||
await expect(page).toHaveURL(`${PlatformURI}/workbench%3Acomponent%3AWorkbenchApp/setting/terms`)
|
||||
// Click .ac-header
|
||||
await expect(page.locator('.ac-header >> text=Terms')).toBeVisible()
|
||||
})
|
||||
|
Loading…
Reference in New Issue
Block a user