mirror of https://github.com/harness/drone.git
feat: [AH-1020]: remove actions from generic and maven artifact and version (#3555)
* feat: [AH-1020]: remove actions from generic and maven artifact and version * feat: [AH-1020]: remove actions from generic and maven artifact and versionmain
parent
6fb141f027
commit
51ebb0784a
|
@ -30,11 +30,9 @@ import VersionListTable, {
|
|||
type CommonVersionListTableProps
|
||||
} from '@ar/pages/version-list/components/VersionListTable/VersionListTable'
|
||||
import { VersionListColumnEnum } from '@ar/pages/version-list/components/VersionListTable/types'
|
||||
import ArtifactActions from '@ar/pages/artifact-details/components/ArtifactActions/ArtifactActions'
|
||||
import { VersionDetailsTab } from '../components/VersionDetailsTabs/constants'
|
||||
import GenericOverviewPage from './pages/overview/OverviewPage'
|
||||
import OSSContentPage from './pages/oss-details/OSSContentPage'
|
||||
import VersionActions from '../components/VersionActions/VersionActions'
|
||||
import GenericArtifactDetailsPage from './pages/artifact-details/GenericArtifactDetailsPage'
|
||||
import VersionDetailsHeaderContent from '../components/VersionDetailsHeaderContent/VersionDetailsHeaderContent'
|
||||
|
||||
|
@ -75,11 +73,11 @@ export class GenericVersionType extends VersionStep<ArtifactVersionSummary> {
|
|||
}
|
||||
}
|
||||
|
||||
renderArtifactActions(props: ArtifactActionProps): JSX.Element {
|
||||
return <ArtifactActions {...props} />
|
||||
renderArtifactActions(_props: ArtifactActionProps): JSX.Element {
|
||||
return <></>
|
||||
}
|
||||
|
||||
renderVersionActions(props: VersionActionProps): JSX.Element {
|
||||
return <VersionActions {...props} />
|
||||
renderVersionActions(_props: VersionActionProps): JSX.Element {
|
||||
return <></>
|
||||
}
|
||||
}
|
||||
|
|
|
@ -95,17 +95,18 @@ describe('Test Registry Artifact List Page', () => {
|
|||
expect(globalGetByText(getFirstRowColumn(3), tableData[0].downloadsCount?.toString() as string)).toBeInTheDocument()
|
||||
expect(globalGetByText(getFirstRowColumn(4), tableData[0].latestVersion)).toBeInTheDocument()
|
||||
|
||||
const actionBtn = getFirstRowColumn(5).querySelector('span[data-icon=Options')
|
||||
await userEvent.click(actionBtn as HTMLElement)
|
||||
const dialogs = document.getElementsByClassName('bp3-popover')
|
||||
await waitFor(() => expect(dialogs).toHaveLength(1))
|
||||
const selectPopover = dialogs[0] as HTMLElement
|
||||
// TODO: removed actions for now
|
||||
// const actionBtn = getFirstRowColumn(5).querySelector('span[data-icon=Options')
|
||||
// await userEvent.click(actionBtn as HTMLElement)
|
||||
// const dialogs = document.getElementsByClassName('bp3-popover')
|
||||
// await waitFor(() => expect(dialogs).toHaveLength(1))
|
||||
// const selectPopover = dialogs[0] as HTMLElement
|
||||
|
||||
const items = selectPopover.getElementsByClassName('bp3-menu-item')
|
||||
expect(items).toHaveLength(2)
|
||||
// const items = selectPopover.getElementsByClassName('bp3-menu-item')
|
||||
// expect(items).toHaveLength(2)
|
||||
|
||||
expect(items[0]).toHaveTextContent('artifactList.table.actions.deleteArtifact')
|
||||
expect(items[1]).toHaveTextContent('actions.setupClient')
|
||||
// expect(items[0]).toHaveTextContent('artifactList.table.actions.deleteArtifact')
|
||||
// expect(items[1]).toHaveTextContent('actions.setupClient')
|
||||
})
|
||||
|
||||
test('Should show error message if listing api fails', async () => {
|
||||
|
@ -281,7 +282,8 @@ describe('Test Registry Artifact List Page', () => {
|
|||
})
|
||||
})
|
||||
|
||||
test('Should list actions', async () => {
|
||||
// eslint-disable-next-line jest/no-disabled-tests
|
||||
test.skip('Should list actions', async () => {
|
||||
render(
|
||||
<ArTestWrapper path="/registries/abcd/:tab" pathParams={{ tab: RepositoryDetailsTab.PACKAGES }}>
|
||||
<RepositoryDetailsPage />
|
||||
|
|
|
@ -20,7 +20,6 @@ import type { ArtifactVersionSummary } from '@harnessio/react-har-service-client
|
|||
import { String } from '@ar/frameworks/strings'
|
||||
import { RepositoryPackageType } from '@ar/common/types'
|
||||
import { VersionListColumnEnum } from '@ar/pages/version-list/components/VersionListTable/types'
|
||||
import ArtifactActions from '@ar/pages/artifact-details/components/ArtifactActions/ArtifactActions'
|
||||
import VersionListTable, {
|
||||
type CommonVersionListTableProps
|
||||
} from '@ar/pages/version-list/components/VersionListTable/VersionListTable'
|
||||
|
@ -34,7 +33,6 @@ import {
|
|||
} from '@ar/frameworks/Version/Version'
|
||||
|
||||
import OSSContentPage from './pages/oss-details/OSSContentPage'
|
||||
import VersionActions from '../components/VersionActions/VersionActions'
|
||||
import { VersionDetailsTab } from '../components/VersionDetailsTabs/constants'
|
||||
import MavenArtifactOverviewPage from './pages/overview/MavenArtifactOverviewPage'
|
||||
import MavenArtifactDetailsPage from './pages/artifact-details/MavenArtifactDetailsPage'
|
||||
|
@ -77,11 +75,11 @@ export class MavenVersionType extends VersionStep<ArtifactVersionSummary> {
|
|||
}
|
||||
}
|
||||
|
||||
renderArtifactActions(props: ArtifactActionProps): JSX.Element {
|
||||
return <ArtifactActions {...props} />
|
||||
renderArtifactActions(_props: ArtifactActionProps): JSX.Element {
|
||||
return <></>
|
||||
}
|
||||
|
||||
renderVersionActions(props: VersionActionProps): JSX.Element {
|
||||
return <VersionActions {...props} />
|
||||
renderVersionActions(_props: VersionActionProps): JSX.Element {
|
||||
return <></>
|
||||
}
|
||||
}
|
||||
|
|
|
@ -95,17 +95,18 @@ describe('Test Registry Artifact List Page', () => {
|
|||
expect(globalGetByText(getFirstRowColumn(3), tableData[0].downloadsCount?.toString() as string)).toBeInTheDocument()
|
||||
expect(globalGetByText(getFirstRowColumn(4), tableData[0].latestVersion)).toBeInTheDocument()
|
||||
|
||||
const actionBtn = getFirstRowColumn(5).querySelector('span[data-icon=Options')
|
||||
await userEvent.click(actionBtn as HTMLElement)
|
||||
const dialogs = document.getElementsByClassName('bp3-popover')
|
||||
await waitFor(() => expect(dialogs).toHaveLength(1))
|
||||
const selectPopover = dialogs[0] as HTMLElement
|
||||
// TODO: removed actions for now
|
||||
// const actionBtn = getFirstRowColumn(5).querySelector('span[data-icon=Options')
|
||||
// await userEvent.click(actionBtn as HTMLElement)
|
||||
// const dialogs = document.getElementsByClassName('bp3-popover')
|
||||
// await waitFor(() => expect(dialogs).toHaveLength(1))
|
||||
// const selectPopover = dialogs[0] as HTMLElement
|
||||
|
||||
const items = selectPopover.getElementsByClassName('bp3-menu-item')
|
||||
expect(items).toHaveLength(2)
|
||||
// const items = selectPopover.getElementsByClassName('bp3-menu-item')
|
||||
// expect(items).toHaveLength(2)
|
||||
|
||||
expect(items[0]).toHaveTextContent('artifactList.table.actions.deleteArtifact')
|
||||
expect(items[1]).toHaveTextContent('actions.setupClient')
|
||||
// expect(items[0]).toHaveTextContent('artifactList.table.actions.deleteArtifact')
|
||||
// expect(items[1]).toHaveTextContent('actions.setupClient')
|
||||
})
|
||||
|
||||
test('Should show error message if listing api fails', async () => {
|
||||
|
@ -281,7 +282,8 @@ describe('Test Registry Artifact List Page', () => {
|
|||
})
|
||||
})
|
||||
|
||||
test('Should list actions', async () => {
|
||||
// eslint-disable-next-line jest/no-disabled-tests
|
||||
test.skip('Should list actions', async () => {
|
||||
render(
|
||||
<ArTestWrapper path="/registries/abcd/:tab" pathParams={{ tab: RepositoryDetailsTab.PACKAGES }}>
|
||||
<RepositoryDetailsPage />
|
||||
|
|
Loading…
Reference in New Issue