-
Notifications
You must be signed in to change notification settings - Fork 592
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix pipeline details page breadcrumbs in admin perspective
- Loading branch information
1 parent
3baa5e3
commit 6e07d11
Showing
6 changed files
with
134 additions
and
2 deletions.
There are no files selected for viewing
19 changes: 19 additions & 0 deletions
19
frontend/packages/dev-console/src/components/pipelineruns/PipelineRunDetailsPage.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
36 changes: 36 additions & 0 deletions
36
...es/dev-console/src/components/pipelines/detail-page-tabs/PipelineConditionDetailsPage.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
import * as React from 'react'; | ||
// FIXME upgrading redux types is causing many errors at this time | ||
// eslint-disable-next-line @typescript-eslint/ban-ts-ignore | ||
// @ts-ignore | ||
import { useSelector } from 'react-redux'; | ||
import { DetailsPageProps, DetailsPage } from '@console/internal/components/factory'; | ||
import { getActivePerspective } from '@console/internal/reducers/ui'; | ||
import { RootState } from '@console/internal/redux'; | ||
import { getBreadcrumbPath } from '@console/internal/components/utils/breadcrumbs'; | ||
import { navFactory, Kebab } from '@console/internal/components/utils'; | ||
import { DetailsForKind } from '@console/internal/components/default-resource'; | ||
|
||
const PipelineConditionDetailsPage: React.FC<DetailsPageProps> = (props) => { | ||
const { namespace, kindObj, match, kind } = props; | ||
const activePerspective = useSelector((state: RootState) => getActivePerspective(state)); | ||
|
||
return ( | ||
<DetailsPage | ||
{...props} | ||
menuActions={Kebab.factory.common} | ||
breadcrumbsFor={() => [ | ||
{ | ||
name: kindObj.labelPlural, | ||
path: | ||
activePerspective === 'admin' | ||
? `/pipelines/ns/${namespace}/conditions` | ||
: getBreadcrumbPath(match), | ||
}, | ||
{ name: `${kindObj.label} Details`, path: `${match.url}` }, | ||
]} | ||
pages={[navFactory.details(DetailsForKind(kind)), navFactory.editYaml()]} | ||
/> | ||
); | ||
}; | ||
|
||
export default PipelineConditionDetailsPage; |
36 changes: 36 additions & 0 deletions
36
...ges/dev-console/src/components/pipelines/detail-page-tabs/PipelineResourceDetailsPage.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
import * as React from 'react'; | ||
// FIXME upgrading redux types is causing many errors at this time | ||
// eslint-disable-next-line @typescript-eslint/ban-ts-ignore | ||
// @ts-ignore | ||
import { useSelector } from 'react-redux'; | ||
import { DetailsPageProps, DetailsPage } from '@console/internal/components/factory'; | ||
import { getActivePerspective } from '@console/internal/reducers/ui'; | ||
import { RootState } from '@console/internal/redux'; | ||
import { getBreadcrumbPath } from '@console/internal/components/utils/breadcrumbs'; | ||
import { navFactory, Kebab } from '@console/internal/components/utils'; | ||
import { DetailsForKind } from '@console/internal/components/default-resource'; | ||
|
||
const PipelineResourceDetailsPage: React.FC<DetailsPageProps> = (props) => { | ||
const { namespace, kindObj, match, kind } = props; | ||
const activePerspective = useSelector((state: RootState) => getActivePerspective(state)); | ||
|
||
return ( | ||
<DetailsPage | ||
{...props} | ||
menuActions={Kebab.factory.common} | ||
breadcrumbsFor={() => [ | ||
{ | ||
name: kindObj.labelPlural, | ||
path: | ||
activePerspective === 'admin' | ||
? `/pipelines/ns/${namespace}/pipeline-resources` | ||
: getBreadcrumbPath(match), | ||
}, | ||
{ name: `${kindObj.label} Details`, path: `${match.url}` }, | ||
]} | ||
pages={[navFactory.details(DetailsForKind(kind)), navFactory.editYaml()]} | ||
/> | ||
); | ||
}; | ||
|
||
export default PipelineResourceDetailsPage; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters