EQMS-1202 Fix navigation in documents (#7630)

Signed-off-by: Alexander Onnikov <Alexander.Onnikov@xored.com>
This commit is contained in:
Alexander Onnikov 2025-01-13 13:00:44 +07:00 committed by GitHub
parent 7702c5ef83
commit ab28a62ecb
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 17 additions and 12 deletions

View File

@ -50,7 +50,7 @@ async function generateDocumentLocation (
return {
loc: {
path: [appComponent, workspace, documentsId, doc.space],
path: [appComponent, workspace],
fragment: getPanelFragment(doc)
},
defaultLocation: {
@ -86,7 +86,7 @@ async function generateProjectDocumentLocation (
return {
loc: {
path: [appComponent, workspace, documentsId, prjdoc.space],
path: [appComponent, workspace],
fragment: getPanelFragment(prjdoc)
},
defaultLocation: {

View File

@ -122,11 +122,11 @@ export async function generateLocation (loc: Location, id: Ref<Document>): Promi
return {
loc: {
path: [appComponent, workspace, documentId, doc.space],
path: [appComponent, workspace],
fragment: getPanelURI(document.component.EditDoc, doc._id, doc._class, 'content')
},
defaultLocation: {
path: [appComponent, workspace, documentId],
path: [appComponent, workspace],
fragment: getPanelURI(document.component.EditDoc, doc._id, doc._class, 'content')
}
}

View File

@ -130,7 +130,10 @@ export async function generateFileLocation (loc: Location, id: Ref<File>): Promi
return {
loc: {
path: [appComponent, workspace, driveId],
path:
doc.parent !== undefined
? [appComponent, workspace, driveId, 'folder', doc.parent]
: [appComponent, workspace, driveId],
fragment: getPanelFragment(doc)
},
defaultLocation: {

View File

@ -6,6 +6,7 @@ import { DocumentHistoryPage } from './document-history-page'
export class DocumentContentPage extends DocumentCommonPage {
readonly page: Page
readonly panel: Locator
readonly buttonDocumentTitle: Locator
readonly buttonMoreActions: Locator
readonly textDocumentStatus: Locator
@ -103,6 +104,7 @@ export class DocumentContentPage extends DocumentCommonPage {
constructor (page: Page) {
super(page)
this.page = page
this.panel = page.locator('.popupPanel-body')
this.buttonDocumentTitle = page.locator('button.version-item span.name')
this.buttonMoreActions = page.locator('.hulyHeader-buttonsGroup > .no-print > .antiButton').first()
this.textDocumentStatus = page.locator('button.version-item div.root span.label')
@ -260,16 +262,16 @@ export class DocumentContentPage extends DocumentCommonPage {
}
async checkIfReviewersAndApproversAreVisible (): Promise<void> {
await expect(this.page.getByText('Appleseed John').first()).toBeVisible()
await expect(this.page.getByText('Dirak Kainin')).toBeVisible()
await expect(this.page.getByText('Appleseed John').nth(1)).toBeVisible()
await expect(this.panel.getByText('Appleseed John').first()).toBeVisible()
await expect(this.panel.getByText('Dirak Kainin')).toBeVisible()
await expect(this.panel.getByText('Appleseed John').nth(1)).toBeVisible()
}
async checkTheUserCantChangeReviewersAndApprovers (): Promise<void> {
await this.page.getByText('Appleseed John').first().click()
await expect(this.page.getByText('Dirak Kainin').nth(1)).not.toBeVisible()
await this.page.getByText('Dirak Kainin').click()
await expect(this.page.getByText('Dirak Kainin').nth(1)).not.toBeVisible()
await this.panel.getByText('Appleseed John').first().click()
await expect(this.panel.getByText('Dirak Kainin').nth(1)).not.toBeVisible()
await this.panel.getByText('Dirak Kainin').click()
await expect(this.panel.getByText('Dirak Kainin').nth(1)).not.toBeVisible()
}
async clickDocumentHeader (name: string): Promise<void> {