Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #5433 from vikram-raj/odc-3589
Bug 1835425: Don't show Remove Trigger when there are no triggers
- Loading branch information
Showing
8 changed files
with
97 additions
and
35 deletions.
There are no files selected for viewing
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
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
30 changes: 30 additions & 0 deletions
30
frontend/packages/dev-console/src/components/pipelines/list-page/PipelineRowKebabActions.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,30 @@ | ||
import * as React from 'react'; | ||
import { referenceForModel } from '@console/internal/module/k8s'; | ||
import { ResourceKebabWithUserLabel } from '../../pipelineruns/triggered-by'; | ||
import { getPipelineKebabActions } from '../../../utils/pipeline-actions'; | ||
import { Pipeline } from '../../../utils/pipeline-augment'; | ||
import { PipelineModel } from '../../../models'; | ||
import { usePipelineTriggerTemplateNames } from '../utils/triggers'; | ||
|
||
type PipelineRowKebabActionsProps = { | ||
pipeline: Pipeline; | ||
}; | ||
|
||
const pipelineReference = referenceForModel(PipelineModel); | ||
|
||
const PipelineRowKebabActions: React.FC<PipelineRowKebabActionsProps> = ({ pipeline }) => { | ||
const { | ||
metadata: { name, namespace }, | ||
} = pipeline; | ||
const templateNames = usePipelineTriggerTemplateNames(name, namespace) || []; | ||
|
||
return ( | ||
<ResourceKebabWithUserLabel | ||
actions={getPipelineKebabActions(pipeline.latestRun, templateNames.length > 0)} | ||
kind={pipelineReference} | ||
resource={pipeline} | ||
/> | ||
); | ||
}; | ||
|
||
export default PipelineRowKebabActions; |
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
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